text
stringlengths
2.85k
2.55M
label
class label
11 classes
arXiv:1703.07181v1 [math.AC] 21 Mar 2017 WEYR STRUCTURES OF MATRICES AND RELEVANCE TO COMMUTATIVE FINITE-DIMENSIONAL ALGEBRAS K. C. O’MEARA DEPARTMENT OF MATHEMATICS UNIVERSITY OF CANTERBURY CHRISTCHURCH, NEW ZEALAND AND J. WATANABE DEPARTMENT OF MATHEMATICS TOKAI UNIVERSITY HIRATSUKA 259-1292 JAPAN PHONE +81-463-58-1211 FAX +81-463-58-9543 EMAIL [email protected] Abstract. We relate the Weyr structure of a square matrix B to that of the t × t block upper triangular matrix C that has B down the main diagonal and first superdiagonal, and zeros elsewhere. Of special interest is the case t = 2 and where C is the n Bn , which is defined inductively by  th Sierpinski matrix  Bn−1 Bn−1 B0 = 1 and Bn = . This yields an easy derivation of the 0 Bn−1 Weyr structure of Bn as the binomial coefficients arranged in decreasing order. Earlier proofs of the Jordan analogue of this had often relied on deep theorems from such areas as algebraic geometry. The result has interesting consequences for commutative, finite-dimension algebras. Noncommutative finite-dimensional algebras over a field F have been studied, almost without pause, since the 1840’s, with many beautiful results uncovered. A sizable group continues to work on them. But interest in their commutative cousins has only recently been revived. The latter study has been less concerned with the intricacies arising from the particular field F than with the radical. In fact, we will assume F is algebraically closed. Of course, finite-dimensional algebras are finitely generated as algebras. For commutative, finite-dimensional algebras R there are a number of simply-stated, basic problems that remain unanswered. To name one, although we will not pursue this, what is the minimum number of generators of R required in order for some faithful R-module M to have dimension (over F ) less than dim R? If R can be generated by k elements, then for k = 1, 2, the minimum dimension of a faithful module is dim R. For k > 3 there are easy examples where Date: March 13, 2017. 2010 Mathematics Subject Classification. Primary: 13A02, Secondary: 13E10, 15A21, 15A27. Key words and phrases. Weyr form, Sierpinsky matrix, hard Lefschetz theorem, commutative Artinian algebras, Jordan cannonical form. 1 dim M < dim R. But when k = 3 this has been open for over 50 years. The question is better known in the form of whether Gerstenhaber’s theorem for two commuting n × n matrices over F also holds for three: if A, B, C are commuting n×n matrices, must the dimension of the (unital) subalgebra F [A, B, C] of Mn (F ) generated by A, B, C have dimension at most n? (For those interested in further details, such as how algebraic geometry impacts the problem, see [1], [2], Chapters 5, 7 of [7], and [4]. This is another instance where the Weyr form seems better suited than its Jordan counterpart.) The application of our theorems on the Weyr structures of block matrices is to the monomial complete intersection ring B = F [x1 , x2 , . . . , xn ]/(xd11 +1 , . . . , xdnn +1 ) where d1 , d2 , . . . , dn are integers. If Bi is the homogeneous space of B of degree i, we give a relatively simple proof of the result that the multiplication map ×(x1 + x2 + · · · + xn )N −2k : Bk → BN −k is a bijection, where N = d1 + · · · + dn . This had first been proved by R. Stanley using the Hard Leftschetz theorem in algebraic geometry, and later by the second author using the theory of the Lie algebra sl(2). A corollary is that the Weyr structure of the multiplication map ×(x1 + x2 + · · · + xn ) : B → B is the partition dim B = dim B0 +dim B1 +· · ·+dim BN , once the terms are arranged in decreasing order. As background (we will not pursue this connection), the strong Lefschetz property (which can be defined for an endomorphism of any finite graded vector space) is important when interpreted in terms of a representation of the Lie algebra sl(2). The foundation for these representations, in turn, relies on the Clebsch– Gordan decomposition of modules over sl(2). We mention this in passing because it was discovered by a physicist, and used in quantum mechanics, yet again a reminder that mathematics associated with physics invariably turns out to be important in other areas. The Weyr structure of certain blocked matrices relates nicely to the Hilbert function of an Artinian algebra, much nicer than the previously known connections in term of Jordan structure. For example, the Hilbert function of the algebra F [x1 , x2 , . . . , xn ]/(x21 , x22 , . . . , x2n ) has coefficients, when arranged in decreasing order, those in the Weyr structure of the linear map induced by multiplication by a “general element” (1 + x1 )(1 + x2 ) · · · (1 + xn ). The matrix of the map is, in fact, the n th Sierpinski matrix Bn described in the Abstract. In our Preliminaries section, we record the basic facts about the Weyr form. The latter form has re-emerged in recent years from relative obscurity since its discovery by the Czech mathematician Eduard Weyr in the 1880’s. The Weyr form has been shown to a better tool than its Jordan cousin in a number of situations, but the two forms should really be regarded as partners. The user should be prepared to flip back and forth, using a lovely duality, according to varying situations. 2 1. Preliminaries The crux of our arguments involve the shifting effect under multiplication by a nilpotent Weyr matrix W , as well as the fact that every square matrix A over an algebraically closed field F has a Weyr canonical form. That is, A is similar to a unique Weyr matrix W = diag(W (λ1 ), W (λ2 ), . . . , W (λk )), where λ1 , λ2 , . . . , λk are the distinct eigenvalues of A, and where for a given λ ∈ F , the basic n × n Weyr matrix W (λ) with eigenvalue λ takes the following form: There is a partition n1 + n2 + · · · + nr = n of n with n1 ≥ n2 ≥ · · · ≥ nr ≥ 1 such that, when W (λ) is viewed as an r × r blocked matrix (Wij ), where the (i, j) block Wij is an ni × nj matrix, the following three features are present: (1) The main diagonal blocks Wii are the ni × ni scalar matrices λI for i = 1, . . . , r. (2) The first superdiagonal blocks Wi,i+1 are full column-rank ni × ni+1 matrices in reduced row-echelon form (that is, an identity matrix followed by zero rows) for i = 1, . . . , r − 1. (3) All other blocks of W are zero (that is, Wij = 0 when j 6= i, i + 1). In this case, we say that W (λ) has Weyr structure (n1 , n2 , . . . , nr ). If n1 = n2 = · · · = nr , then W (λ) is said to have a homogeneous structure. For instance, the basic Weyr matrix with eigenvalue λ and Weyr structure (3, 3, 2, 2) is  λ 0 0 1  λ 0 0   λ 0    λ   W (λ) =          0 1 0 0 λ 0 0 1 0 1 0 0 0 1 λ 0 0 λ 0 1 0 λ 0 1 λ 0 0 λ          .         The monograph [7] gives a comprehensive account of the Weyr form. See also [3] and [8]. For a general square matrix A, the Weyr structure of A associated with an eigenvalue λ is the Weyr structure of the basic Weyr block W (λ) that occurs in the unique Weyr form of A. This can be calculated without constructing the Weyr form by looking at the ranks (equivalently nullities) of the powers of A (hence much easier than obtaining directly the Jordan structure in terms of ranks 3 of powers, although the Jordan structure can be deduced as the dual partition of the Weyr structure; see [7], Theorem 2.4.1 and Corollary 2.4.6). Proposition 1.1. The Weyr structure of a matrix A associated with an eigenvalue λ is (n1 , n2 , . . . , nr ) where r = nilpotent index of A − λI, ni = rank(A − λI)i−1 − rank(A − λI)i , for i = 1, . . . , r. Moreover, rank Ai = ni+1 + ni+2 + · · · + nr for each i. Proof. See [7], Proposition 2.2.3.  A nilpotent Weyr matrix W , of Weyr structure (n1 , n2 , . . . , nr ), when right multiplying a matrix X that is blocked according to the block structure of W (so the (i, j) block Xij is ni × nj ) shifts the blocks of X one step to the right, introducing a zero first column of blocks and killing the last column of blocks. However, if the Weyr structure of W is nonhomogeneous (meaning not all the ni are equal), W can’t faithfully shift the jth column of blocks of X to the (j + 1)th column if nj > nj+1 . In this case only the first nj+1 columns of Xij are shifted, and the remaining nj − nj+1 are deleted. Left multiplication by W has a similar shifting effect on the rows of blocks of X, shifting from the bottom upwards, and appending ni − ni+1 zero rows to X(i+1)j whenever ni > ni+1 . See Remark 2.3.1 in [7]. It is critical to our later arguments to have a clear mental picture of what the powers W k of a nilpotent Weyr matrix W look like. This is best done as a (repeated) special case of what the shifting does when we left or right multiply a matrix X by W . We illustrate this in the case W is the nilpotent Weyr matrix of structure (3, 2, 2). The leftmost matrix X in the product XW here centralizes W , so the right hand side of the equation also agrees with left multiplying X by W in terms of shifting rows of blocks. (This and other examples we have used have been purloined from [7], Chapter 2. But one co-author of the monograph, after consultation with one co-author of the present paper, has agreed not to pursue charges!)               0 0 0 1 0 0 0 0 0 0 a b h i a b e h i l m     c d f j k n p  0 0 0 0 1 0 0   0 0 0 c d j k    0 0 g 0 0 q r   0 0 0 0 0 0 0   0 0 0 0 0 0 0    a b h i  0 0 1 0 = 0 0 a b    c d j k  0 0 0 1   0 0 c d    a b  0 0   0 0 c d 0 0 0 0 4       .     Our applications of Weyr structures for certain blocked matrices are connected with L graded algebras. A graded commutative Artinian F -algebra A, with grading A = nk=0 , is said to have the strong Lefschetz property if there is a linear element l such that the multiplication map ×li : Ak −→ Ak+i has full rank for all i = 0, . . . , n and k = 1, . . . , n − i. And A has the weak Lefschetz property if the above property holds for all k and i = 1. In each case, the element l is referred to as a “Lefschetz element”. As the second author had observed (before he became aware of the Weyr form and had been using the Jordan form), A having the strong Lefschetz property is equivalent to the Jordan form of the multiplication map by a “general element” having Jordan structure the dual partition of dim A as the sequence of the dimensions of the homogeneous spaces Ai , arranged in decreasing order. Therefore, by the duality between the Jordan and Weyr forms, the Weyr structure of the multiplication map must be the sequence of these dimensions (again in decreasing order). The second author also observed that the weak Lefschetz property is equivalent to the number of blocks in the Jordan form (the nullity of the map) being the maximum dim Ai , and therefore the latter is the size of the first Weyr structure component. 2. Block upper triangular t × t matrices: Reduction to a single eigenvalue of 0 or 1 Let B be an n × n matrix over an algebraically closed field F and consider the t × t block upper triangular matrix   B B 0 ... 0 0      0 B B ... 0 0     .  C =  .. .      0 0 0 ... B B    0 0 0 ... 0 B By the Generalized Eigenspace Decomposition of B we know B is similar to a block diagonal matrix diag(B1 , B2 , . . . , Bk ) where Bi has a single eigenvalue λi (and so λ1 , λ2 , . . . , λk are the distinct eigenvalues of B). (See, for instance, [7], Theorem 1.5.2 and Corollary 1.5.4.) If conjugating by an invertible matrix P achieves this decomposition, then it is easily seen that conjugating C by diag(P, P, . . . , P ), 5 followed by conjugation by permutation matrices corresponding to various transpositions, gives C = diag(C1 , C2 , . . . , Ck ) where   Bi Bi 0 . . . 0 0      0 Bi Bi . . . 0 0     ..  Ci =  . .      0 0 0 . . . Bi Bi    0 0 0 . . . 0 Bi Since the Weyr structure of C associated with the eigenvalue λi is the Weyr structure of Ci associated with λi (which in turn is the Weyr structure of the nilpotent matrix Ci − λi I), the upshot of all this is that it is enough to establish the Weyr structure of B in the case B has a single eigenvalue λ, that is, B = λI+W where W is a nilpotent matrix. Moreover, since every square matrix is similar to a Weyr matrix, we can assume W is in fact a nilpotent Weyr matrix because if Q is an invertible matrix such that Q−1 BQ is in Weyr form, then conjugating C by diag(Q, Q, . . . , Q) gives   0  Q−1 BQ Q−1 BQ    0 Q−1 BQ Q−1 BQ    .. C =  .     0 0 0    0 0 0 ... 0 0     ... 0 0    .    . . . Q−1 BQ Q−1 BQ     −1 ... 0 Q BQ and Q−1 BQ = λI + Q−1 W Q where Q−1 W Q is a nilpotent Weyr matrix. Henceforth, we assume B = λI + W where W is a nilpotent Weyr matrix with Weyr structure (m1 , m2 , . . . , mr ). Note that the Weyr structures of B and C are the same as those of the nilpotent W = B − λI and X = C − λI, respectively. If λ = 0, the connection between the Weyr structures of B and C is easy. We record this in our next proposition. Proposition 2.1. When B is an n × n nilpotent matrix and F has characteristic 0 or p > n, the Weyr structures (m1 , m2 , . . . , mr ) and (n1 , n2 , . . . , ns ) of B and C respectively are related by (1) s = r. (2) ni = tmi for all i. 6 Proof. Just looking at the powers of X k we see that rank X k = t rank W k , whence by Proposition 1.1, we have s = r and ni = tmi for all i.  When λ 6= 0 these structures are independent of λ. This is because a nilpotent matrix and a nonzero scalar multiple of it must be similar — their powers have the same nullity (see Proposition 2.2.8 in [7]). Hence X is similar to (1/λ)X. Also there is an invertible matrix P such that P −1 (1/λ)W P = W . Therefore conjugating (1/λ)X by diag(P, P, . . . , P ) shows X is similar to the matrix obtained by replacing λ by 1. Henceforth, we can assume λ = 1 if λ 6= 0. To find the Weyr structure of X, it is enough by Proposition 1.1 to find the ranks of powers of X. 3. The case t = 2 Theorem 3.1. Let B be an n × n matrix over an algebraically closed field F of characteristic 0 or p > n. Let λ be an eigenvalue of B. Let C be the 2 × 2 block upper triangular matrix   B B C = . 0 B Let (m1 , m2 , . . . , mr ) and (n1 , n2 , . . . , ns ) be the Weyr structures associated with λ of B and C, respectively. The following relationships hold: (1) If λ = 0, then s = r and ni = 2mi for all i. (2) If λ 6= 0 and r = 1, then s = 2 and n1 = n2 = m1 . (3) If λ = 6 0 and r > 1, then s = r + 1 and (a) n1 = m1 + m2 , (b) ns−1 = ms−2 , ns = ms−1 , (c) ni = mi−1 + mi+1 for 2 ≤ i ≤ s − 2. Remark 3.2. We don’t need the algebraically closed assumption if we know a particular λ ∈ F is an eigenvalue of B, but in general we do in order to get the reduction in Section 2.  Proof. By our earlier reduction, we can assume B = λI +W where W is a nilpotent Weyr matrix and λ = 0 or λ = 1. CASE (1): λ = 0. This is covered by Proposition 2.1. CASE (2): λ = 1, r = 1. Here B = I, where I denotes the identity matrix of the appropriate size (here m1 × m1 ). Thus C − I has nilpotent index 2, whence 7 s = 2. Also rank(C − I) = m1 and so n1 = nullity(C − I) = 2m1 − m1 = m1 and n2 = rank(C − I) − rank(C − I)2 = m1 . CASE (3): λ = 1, r > 1. The Weyr structures of B and C are  the same as the W B Weyr structures of W and X = C − diag(I, I) = . For each integer 0 W k ≥ 0, we have that   W k kW k−1 B k (4) X = , 0 Wk and hence the nilpotent index of X is 1 more than that of W (because B is invertible). Therefore s = r + 1. We next relate the ranks of X k and W k . Notice from equation (4) that X k is row equivalent to (and hence has the same rank as)     W k kW k−1 B − kW k W k kW k−1 (5) Y = = . 0 Wk 0 Wk CLAIM: for 1 ≤ k ≤ s − 1, we have rank X k = rank W k−1 + rank W k+1 . When k = s − 1, we see directly that rank X k = rank W k−1 because the diagonal of X k is zero. Since rank W k+1 = 0, the desired relationship holds. Now assume 1 ≤ k ≤ s − 2. It is enough to show Y has the stated rank. However, for any nilpotent Weyr matrix W, we can see that the rank of Y is indeed as claimed, simply by looking at the single nonzero superdiagonal of blocks in the (1,1), (1,2), and (2,2) blocks of Y (latter of same size as the matrix W ). By row operations the (2,2) superdiagonal can be used to clear out the (1,2) superdiagonal except for the first block which has size m1 × mk and has the identity matrix Imk as its top half and zeros below. Now all the nonzero rows of Y are independent. At first glance it looks like the rank of Y is therefore 2 rank W k . But remember what happens in the powers of W when W has a nonhomogeneous structure — blocks are pushed to the right but the last few columns are lost in a block if there is a squeeze (see discussion at the end of Section 1). Hence we have picked up an extra mk − mk+1 nonzero rows over those in diag(W k , W k ). So therefore, using Proposition 1.1, we have rank Y = (mk − mk+1 ) + 2 rank W k = (mk − mk+1 ) + 2(mk+1 + mk+2 + · · · + mr ) = (mk + · · · + mr ) + (mk+2 + · · · + mr ) = rank W k−1 + rank W k+1 . [To make the above argument clearer, here is the matrix picture of Y in the case W has Weyr structure (m1 , m2 , m3 , m4 ) = (3, 2, 1, 1), λ = 1, and k = 2. The header on the matrix indicates the width of the various blocks of W . 8 m1  Y =                            m2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 m3 m4 1 0 0 0 0 0 0 0 0 1 0 0 0 m1 m2 m3 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 m4 0 0 0 0 0 2 0 0 0 0 1 0 0 0                             Notice that here rank W 2 = 2, and for D = diag(W 2 , W 2 ), we have rank D = 2(rank X 2 ) = 4. However rank Y = 5. After using the (2, 2) block of Y to clear out the two nonzero entries 2 in the last two columns of the (1, 2) block of Y , the remaining rows of Y are independent. But we have picked up an extra m2 − m3 = 1 independent row in Y in additional to the four in D because of the (2, 12) entry 2 in Y .] Now for the proof of 3(a). From the above Claim and the fact that X is twice as large as W , we have n1 = rank X 0 − rank X = 2 rank W 0 − (rank W 0 + rank W 2 ) = rank W 0 − rank W 2 = m1 + m2 . For the proof of 3(b), we have ns−1 = rank X s−2 − rank X s−1 = (rank W s−3 + rank W s−1 ) − (rank W s−2 + rank W s ) = ms−2 , ns = rank X s−1 − rank X s = rank W s−2 + rank W s − 0 = ms−1 . 9 Finally, for the proof of 3(c), by our Claim, for 2 ≤ i ≤ s − 2 we have that ni = rank X i−1 − rank X i = (rank W i−2 + rank W i ) − (rank W i−1 + W i+1 ) = mi−1 + mi+1 , as desired.  The sequence of “Sierpinski” matrices Bn (an informal term, chosen because the Bn look like a Sierpinski triangle (or gasket), often shown as fractal figure) are defined inductively by B0 = 1,   Bn Bn Bn+1 = 0 Bn for n = 0, 1, 2, . . . . Thus Bn is 2n × 2n . Repeated applications of Theorem 3.1 yield: Corollary 3.3. Over a field F of characteristic 0 or p > n, the Weyr structure of the nth Sierpinski matrix Bn is the sequence of binomial coefficients n!/k!(n − k)! for k = 1, . . . , n arranged in decreasing order. (Decreasing for us means nonincreasing.) Proof. The connection between the nth and (n + 1)th sequences of binomial coefficients (arranged in decreasing order) is exactly as we have in (2) and (3) of Theorem 3.1 for the Weyr structures of Bn and Bn+1 (and with λ = 1). They also have the starting point at n = 0. Hence the Weyr structures and sequences of binomial coefficients must be the same.  Thus, the Weyr structures of the first seven Sierpinski matrices are: 1 1 1 2 1 1 3 3 1 1 6 4 4 1 1 10 10 5 5 1 1 20 15 15 6 6 1 1 By contrast, taking the dual structures we obtain the Jordan structures of the first seven Sierpinski matrices: 1 2 3 1 4 2 2 5 3 3 3 1 1 6 4 4 4 4 2 2 2 2 2 7 5 5 5 5 5 3 3 3 3 3 3 3 3 3 1 1 1 1 1 10 So no obvious natural pattern connecting the Jordan structures, although it would be possible to write down a messy relationship by using the Weyr pattern and translating via dual partitions. For instance, the first Jordan structure component of Bn will be n + 1, the length of the Weyr structure, because this is the nilpotent index of Bn − I. And the length of the Jordan structure of Bn will be the first Weyr component, because this is the nullity of Bn − I. This is why we didn’t display the Jordan structure of B7 because it has 35 Jordan structure components (as against 8 Weyr components)! Is this yet another situation where the Weyr form seems more in tune to natural phenomenon than its Jordan counterpart? On the other hand, using the Lie algebra sl(2), the second author [10] established a connection between the Jordan structure of the multiplication map by “a general element” of B = F [x1 , x2 , . . . , xn ]/(xe1 , xe2 , . . . , xen ) and the n th Sierpinski matrix Bn . He did this by showing that the Jordan structure of the matrix of the multiplication map of a general element is the dual of the sequence (in decreasing order) of the coefficients of the Hilbert function, which here is given by (1 + T + T 2 + · · · + T e−1 )n . Using simpler methods, Hidemi Ikeda much later proved the same thing for B = F [x1 , x2 , . . . , xn ]/(x21 , x22 , . . . , x2n ). 4. The case t = 3 Examined closely, the proof for t = 2 is actually very simple. However, it gives little indication of what happens when t > 2. Moreover, a critical point in the argument later for t > 2 doesn’t occur when t = 2. The case t = 3 is a better indicator of what happens in general, and the pitfalls to watch out for, but even here one is left guessing the general pattern. It is the case t = 4 (combined with t = 2 and t = 3) that finally strongly suggests the general pattern, as well as the inductive argument to use. Proposition 4.1. Again suppose B is an n × n matrix over a field F of characteristic 0 or p > n, and assume B has a single eigenvalue λ, and this is nonzero. Let t = 3 and let C be the t × t block upper triangular matrix defined earlier. Let W = B − λI and X = C − λI. Let r, s be the nilpotent indices of W, C respectively. Then we have: (1) s = r + 2. (2) rank X = 2n + rank W 3 . (3) For 2 ≤ k ≤ s − 1, rank X k = rank W k−2 + rank W k + rank W k+2 . 11 Proof. Let (m1 , m2 , . . . , mr ) and (n1 , n2 , . . . , ns ) be the Weyr structures of W and X respectively. By our earlier reduction in Section 2, we can assume λ = 1. (1) and (3). Assume 2 ≤ k ≤ r + 1. We have    Wk     k X =   0      0   kW k−1 B k(k − 1)/2W k−2 B 2      . k k−1  W kW B      k 0 W Hence the nilpotent index of X is 2 more than that of W . Thus s = r + 2. Expanding the terms by replacing B with I + W , we see that X k has the form     Wk       0      0  cW k−2 + dW k−1 + eW k        aW k−1 + bW k      k W aW k−1 + bW k Wk 0 for nonzero integers a, b, c, d, e and with a = k and c = k(k − 1)/2. Using row and column operations, we see that X k is equivalent to     Wk     Y =   0      0 aW k−1 Wk 0  bW k−2       aW k−1       k W for a = k, b = k(k − 1)/2 (so b has been renamed as the above c). When k = r + 1, only the (1, 3) entry of Y is nonzero, so clearly rank Y = rank W k−2 and the relation in (3) holds (because W k = W k−1 = 0). Henceforth we assume 2 ≤ k ≤ r. When we refer to the “blocks of Y ” (or of X k ) we mean the 9 blocks resulting from partitioning 3n as (n, n, n). But we also need to refer to entries within 12 these blocks, and there it is convenient to reference “blocks within a block” by partitioning an n × n matrix by the Weyr structure (m1 , m2 , . . . , mr ) of W . We will find rank Y using only column operations, moving across the three columns of blocks, and ensuring the nonzero individual columns (among the 3n columns of Y ) are independent at each step. This will establish a pattern which will help us with larger t by induction. The first column of blocks causes no problem because the nonzero columns of W k are linearly independent and there are rank W k = mk+1 + · · · + mr of them. Now move to the 2nd column of blocks. The columns of Y that contain a nonzero column of W k in the (2, 2) block are independent, and independent of all columns to their left in Y . So they contribute another rank W k to the rank Y . Therefore, for rank purposes, the only columns in Y that can further contribute must not “step over the W k line”. (Note that the nonzero columns of W k begin at the start of the (1, k + 1) block, when we block according to the partition (m1 , m2 , . . . , mr ), and are then ALL nonzero from that point on.) Now the only stuff in the (1, 2) block of Y that is inside the W k line is the (1, k) block of aW k−1 , which has aImk as its top part and zeros below. Clear out the first mk+1 columns of aW k−1 using those from the (1, k + 1) block of W k in the (1, 1) block of Y . Now all the nonzero columns within the first two blocks of Y are independent. Thus the column rank of Y to this point is 2 rank W k + (mk − mk+1 ). Moreover, the column space of Y to this point includes the space of all 3n × 3n column matrices with arbitrary entries in the first mk positions and zeros after (the natural copy of F mk , the space of mk ×1 column vectors over F ). This second step has been quite straightforward. Moreover, we never have to change this part of Y in the third step!. Now to the third column of blocks. Again there is a contribution of rank W k to rank Y coming from the W k in the (3, 3) block, and any further contribution can only be within the W k line. The only stuff within the line, in terms of the blocking of W , are two blocks in the (1, 3) block of X k , and one in the (2, 3) block. 13 The picture is this:                                               bImk−1 bImk | | aImk | | | < − − Wk                                       line       Knowing we have the copy of F mk in the top part of our column space to date, we can clear out the first mk columns of the bImk−1 in the first of these. What remains from this block contributes another mk−1 − mk to rank Y . This now leaves only the other two blocks containing bImk and aImk , in the (2, k) block and (1, k) block respectively (relative to the structure of W , but in the (1, 3) and (2, 3) blocks of Y ). But here we must be very careful about the clearing argument involved. It depends on b 6= a2 !! Thus any “hand-waving” argument based on the matrix picture, but not taking into account the actual values of a and b, will likely give the wrong answer! (The first author has got Matlab to thank for rescuing him after falling into this pit by assuming he could work with just a = b = 1 !) To clear out a particular column of blocks in the 3rd column of Y , we look to the left and note all columns of blocks that have a common part with the column under consideration. Then we argue what linear combinations of the stuff to the left can be used for clearing. In turn that involves looking at the rank of a small matrix and deciding what is the dependence of its last column on the earlier ones. But this requires a very clear mental picture of what a power of the Weyr matrix W looks like. If b = a2 , then subtracting a times the matching blocks in the second column of blocks of Y from the two blocks in question in the third column of blocks gives the desired clearing for new independent columns. This results in an extra contribution of mk − mk+1 to rank Y . But when b 6= a2 the matching blocks in the 14   a b 1 a is nonsingular. However, we can subtract from those in the third, a times those in the second column, followed by subtracting b times the k + 2 column of W k within the (1, 1) block of Y . In this case, the extra contribution to rank Y is mk − mk+2 . But when we look at the specific a = k and b = k(k − 1)/2 we are dealing with, we see b 6= a2 . Thus it is the latter contribution that applies. Hence we have established that second column are independent of those in the third, because the matrix rank X k = 3 rank W k + (mk − mk+1 ) + (mk−1 − mk ) + (mk − mk+2 ) = 3 rank W k + mk−1 + mk − mk+1 − mk+2 = 3(mk+1 + · · · + mr ) + mk−1 + mk − mk+1 − mk+2 = (mk−1 + · · · + mr ) + (mk+1 + · · · + mr ) + (mk+3 + · · · + mr ) = rank W k−2 + rank W k + rank W k+2 . (2) When k = 1, the (1, 3) block of X k is zero. So the argument is slightly different but simpler.  Corollary 4.2. Let (m1 , m2 , . . . , mr ) and (n1 , n2 , . . . , ns ) be the Weyr structures relative to a nonzero eigenvalue λ of B and C respectively. We have: (1) (2) (3) (4) (5) s = r + 2. n 1 = m1 + m2 + m3 . n 2 = m1 + m2 + m4 . ni = mi−2 + mi + mi+2 for 3 ≤ i ≤ s − 3. ns−2 = ms−4 + ms−2 , ns−1 = ms−3 , and ns = ms−2 . Proof. (1) This was established in Proposition 4.1(1). (2), (3). By Propositions 1.1 and 4.1, we have n1 = rank I − rank X = 3n − (2n + rank W 3 ) = n − (m4 + m5 + · · · + mr ) = (m1 + · · · + mr ) − (m4 + · · · + mr ) = m1 + m2 + m3 , and n2 = rank X − rank X 2 = (2n + rank W 3 ) − (rank W 0 + rank W 2 + rank W 4 ) = (n − rank W 2 ) + (rank W 3 − rank W 4 ) = m1 + m2 + m4 . 15 (4) For 3 ≤ i ≤ s − 3, we have by Proposition 4.1 ni = rank X i−1 − rank X i = (rank W i−3 + rank W i−1 + rank W i+1 ) − (rank W i−2 + rank W i + rank W i+2 ) = (rank W i−3 − rank W i−2 ) + (rank W i−1 − rank W i ) + (rank W i+1 − rank W i+2 ) = mi−2 + mi + mi+2 . (5) Same calculation as in (4) after noting rank W j = 0 for j ≥ s − 2.  5. The case t = 4 and higher This involves the same strategy, working out the contribution to rank X k that comes from the new column of blocks (the 4th here or column t in general). We have   Xk  W k a W k−1 B b W k−2 B 2 c W k−3 B 3 k k k      0 Wk ak W k−1 B bk W k−2 B 2   =    0 0 Wk ak W k−1 B     0 0 0 Wk                where ak = k, b1 = 0 and bk = k(k − 1)/2 for k ≥ 2, c1 = c2 = 0 and ck = (k − 2)(k − 1)k/6 for k ≥ 3. Again by our earlier reduction we can assume B has just one eigenvalue λ, and that λ = 1. From the expression for X k we see that the nilpotent index of X is 3 more than that of W , whence s = r + 3. Expanding terms using B = I + W , and clearing using row and column operations shows X k 16 is equivalent to   W k a W k−1 b W k−2 ck W k−3 k k      0 Wk ak W k−1 bk W k−2 + dk W k−1   Y =    0 0 Wk ak W k−1     0 0 0 Wk                 where ak , bk , ck are the integers as above. The coefficient dk is a nonzero integer whose value need not concern us. When t = 3, we were able to clear out so as to leave just the smallest power of W in each of the nonzero blocks, but it looks like this is not possible when t = 4 (getting rid of dk W k−1 without messing other things up). However, this type of clearing was just for convenience, and the arguments work just as well without it (because a given power of W “covers all the higher powers” in the sense that its column space contains the column spaces of higher powers). Suppose k ≥ 3 (the arguments for k = 1 and k = 2 are slightly different but easier). Again we can ignore the stuff outside the W k line. Blocking the 4th column of Y (which is a 4n × n matrix) by partitioning its columns by (m1 , m2 , . . . , mr ) and its rows by 4 lots of this partition, we see that the matrix inside the W k line has one (nonzero) block in column k − 2 (an m1 × mk−2 matrix), two blocks in column k − 1, and three blocks in column k. The contribution to rank X k from column k −2 is mk−2 −mk−1 . The contribution from column k −1 is mk−1 −mk+1 .  ak bk ck has rank 2 with the the first For this we observe that the matrix 1 a k bk two columns independent (whence the 3rd column is a linear combination of the first two). The contribution from column k is mk − mk+3 , and here we use the fact that   1 ak bk ck  0 1 a k bk  0 0 1 ak has rank 3 with the first 3 columns independent (so the 4th column is a combination of the first three), as well the previous observation concerning the 2 × 3 matrix. Of course, outside the W k line we have a contribution of rank W k . Thus the total contribution from all of the 4th column of Y is rank W k + mk−2 + mk − mk+1 − mk+3 . 17 Adding to this the known contribution of 3 rank W k + mk−1 + mk − mk+1 − mk+2 from the first 3 columns of X k (the case t = 3), we have: rank X k = rank Y = 4 rank W k + mk−2 + mk−1 + 2mk − 2mk+1 − mk+2 − mk+3 = rank W k−3 + rank W k−1 + rank W k+1 + rank W k+3 . If we also compute rank X = 4 rank W + 3m1 − m2 − m3 − m4 = 3n + rank W 4 and rank X 2 = 4 rank W 2 + 2m1 + 2m2 − 2m3 − m4 − m5 , we can compute the new Weyr structure components n1 , n2 , . . . ns using the connection ni = rank X i−1 − rank X i as: Proposition 5.1. For t = 4 we have: (1) (2) (3) (4) (5) (6) s = r + 3. n 1 = m1 + m2 + m3 + m4 . n 2 = m1 + m2 + m3 + m5 . n 3 = m1 + m2 + m4 + m6 . ni = mi−3 + mi−1 + mi+1 + mi+3 for 4 ≤ i ≤ s − 4. ns−3 = ms−6 + ms−4 , ns−2 = ms−5 + ms−3 , ns−1 = ms−4 , ns = ms−3 . The pattern is now perfectly clear. For a general t, we have rank X k = rank W k−t+1 + rank W k−t+3 + rank W k−t+5 + · · · + rank W k+t−1 for k ≥ t − 1. Also, s = r + t − 1 and the “middle range” of Weyr structure components ni are given by ni = mi−t+1 + mi−t+3 + mi−t+5 + · · · + mi+t−1 for t ≤ i ≤ s − t. So the rule is “go back t − 1 terms from mi to get the first term on the right hand side, then include all terms got by going up in steps of 2, until you have a total of t terms”. Actually this also holds for all i ≥ t if we ignore terms that no longer make sense (such as mr+1 ). The initial ni for i = 1, . . . , t − 1 are given by ni = m1 + · · · + mt−i+1 + mt−i+3 + mt−i+5 + · · · + mt+i−1 . So the rule here is to “add the first t − i + 1 terms before going up in steps of 2 to reach a total of t terms”. However, a proof of these claims for general t requires a careful argument. We won’t give the full details, just a sketch. For the induction to work in going from t − 1 to t, it is enough to show that the total contribution to rank X k from the new t th column is the proposed rank X k for t less the assumed one for t − 1. As before, there is a contribution of rank W k to the right of the W k line, so we need 18 to know the extra contribution E that comes from left of the W k line. A little arithmetic shows this must be (for the induction to work)  P P(t−1)/2 (t−1)/2  mk+2i if t is odd mk−t+2i −  i=1 i=1 E =  Pt/2  Pt/2 m if t is even. − k−t+2i i=1 mk+2i i=1 (Note these expressions contain no redundant mj .) Next, instead of the labels ak , bk , ck we used for the coefficients of the smallest power of W in the top row of blocks of the 4 × 4 matrix X k , for general t and fixed k, we denote the coefficient of the smallest power of W in the (1, i) block by ai . Thus a1 = 1, a2 = k(k − 1)/2, a3 = k(k − 1)(k− 2)/6, . . . and the general ai for i ≥ 1 can be computed inductively to be ai = ki . It is important in the arguments that follow to note that, due to the actual values of the ai , each of the b × b submatrices of the b × t matrix   a1 a2 a3 a4 . . . at  0 a1 a2 a3 . . . at−1    B =  ..   .  0 . . . a1 a2 . . . at−b+1 is nonsingular for b = 2, . . . t. In particular, the last column of B is a linear combination of the previous b columns, but no fewer. Blocking the t th column of X k (which is a tn × t matrix) by partitioning its columns by (m1 , m2 , . . . , mr ) and its rows by t lots of this partition, we then calculate what extra contribution each nonzero column of blocks inside the W k line makes to the already known contribution from columns 1, 2, . . . , t − 1 of the t × t blocked X k . Using the same sort of the argument we used for t = 4 yields the following results (where # blocks is the number of nonzero blocks in a particular column of blocks): column # blocks contribution k−t+2 1 mk−t+2 − mk−t+3 k−t+3 2 mk−t+3 − mk−t+5 k−t+4 3 mk−t+4 − mk−t+7 k−t+5 .. . 4 .. . mk−t+5 − mk−t+9 .. . k t−1 mk − mk+t−1 Adding these contributions leads to the above value of E. 19 6. Relevance to Commutative Finite-dimensional algebras Let F be a field and let R = F [x1 , x2 , · · · , xn ] be the polynomial ring in n variables with coefficients in F . Let A = R/I, where I is an ideal which contains (xd11 +1 , xd22 +1 , . . . , xdnn +1 ) for some integers d1 , d2 , . . . , dn . In this case A is a commutative finite-dimensional algebra over F . Any element f ∈ A induces via multiplication an endomorphism of the vector space ×f : A → A, which has a single eigenvalue (namely, the constant part of f ) and, in most cases, a complicated nilpotent part. One of the basic problems in the theory of Artinian rings is to determine the Weyr form of ×f for a general element f ∈ A. If I = (xd11 +1 , xd22 +1 , . . . , xdnn +1 ), then A = R/I is called a monomial complete intersection ring. First we treat the quadratic monomial complete intersection: d1 = d2 = · · · = dn = 1. For the rest of this section we fix A = F [x1 , x2 , . . . , xn ]/(x21 , x22 , · · · , x2n ). The set of square-free monomials in x1 , . . . , xn is a basis for A. We order these using the reverse lexicographic order: 1 < x1 < x2 < x1 x2 < x3 < x1 x3 < x2 x3 < x1 x2 x3 < x4 < · · · < x2 x3 · · · xn < x1 x2 · · · xn . This sequence can be characterized inductively by saying that the monomials in the second half are divisible by xn , and if we substitute 1 for xn , the sequence coincides with the first half in the same order. We fix as our ordered basis for A the set of square-free monomials ordered in this way. Note that the multiplication by any variable xi kills a monomial which is divisible by xi but it preserves the order of the rest of the basis. Let g be the sum of all the square-free monomials, that is, g = 1 + x1 + x2 + · · · + x1 x2 + x1 x3 + · · · + x1 x2 · · · xn = (1 + x1 )(1 + x2 ) · · · (1 + xn ). We consider the linear map ×g : A → A defined by m 7→ gm. The matrix for ×g relative to our ordered basis above is exactly the nth Sierpinski Bn described in Section 3. Hence from Corollary 3.3 we obtain the following description of the Weyr structure of ×g: Theorem 6.1. Let p be the characteristic of F . Assume that either p = 0 or p > n. Then the Weyr structure of ×g (associated with its sole eigenvalue 1) is the sequence of binomial coefficients ni arranged in the decreasing order. 20 Let l = x1 +x2 +· · ·+xn , and consider the multiplication map ×(1+l) : A → A. Exactly the same argument as for ×g yields the following: Theorem 6.2. (1) The Weyr structure of ×(1 + l) : A → A is the sequence of binomial coefficients arranged in decreasing order. (2) The Weyr structure of ×l : A → A is the sequences of binomial coefficients arranged in decreasing order. Note that the algebra A has a natural grading and A may be regarded as a graded algebra. In fact, if we denote by Ak the vector space spanned by the square-free monomials of degree k, Ak = {xj1 xj2 · · · xjk : 1 ≤ j1 < j2 < · · · < jk ≤ n}, then A decomposes as a direct sum of subspaces n M A= Ak . k=0 Note that the multiplication of A, that is (f, g) 7→ f g, is compatible with the grading, meaning that the multiplication restricts to a map  Ai ×Aj → Ai+j for each n pair i, j. Notice also that dimF Ak = dimF An−k = k , and the multiplication map ×l : A → A acts on the summands Ak of our grading by mapping ×l ×l ×l A0 → A1 → A2 → A3 → · · · → An . It is easy to see the following is true: Proposition 6.3. n−k h i h i X rank ×lk : Ai → Ai+k . rank ×lk : A → A = i=0 By Theorem 6.2 and Proposition 1.1, this is possible only if ×lk : Ai → Ai+k has full rank. We single this out as a theorem: Theorem 6.4. For all k = 0, 1, 2, · · · , [n/2], the multiplication map ×ln−2k : Ak → An−k is bijective. Let n = n1 + n2 + · · · + nr be a partition of n (so the ni are integers with n1 ≥ n2 ≥ · · · ≥ nr > 0). Divide the set of variables x1 , · · · , xn into r groups {x1 , . . . , xn1 } {xn1 +1 , . . . , xn1 +n2 } {z } | | {z } n1 n2 ··· {xn1 +···+nr−1+1 , . . . , xn }. | {z } nr Let Q = F [y1 , y2 , · · · , yr ] be the polynomial ring in r variables, and define the ring homomorphism φ : Q → A by sending yi to the sum of the variables in the i-th group: φ(yi ) = xn1 +n2 +ni−1 +1 + xn1 +n2 +ni−1 +2 + · · · + xn1 +n2 +···+ni . 21 It is not difficult to see that the kernel of φ is the ideal generated by (y1n1 +1 , y2n2 +1 , . . . , yrnr +1 ). Hence we have a natural inclusion of the Artinian algebras B ֒→ A where A = F [x1 , x2 , . . . , xn ]/(x21 , x22 , . . . , x2n ), B = F [y1 , . . . , yr ]/(y1n1 +1 , y2n2 +1 , . . . , yrnr +1 ). Recall that l is the sum of the variables in A, so we may also write l = y1 + y2 + · · · + yr . In particular, l is an element of B. There is a unique element of highest degree in B, namely n! y n1 · · · yrnr . ln = n!x1 x2 · · · xn = n1 ! · · · nr ! 1 The inclusion B ֒→ A is actually a grade–preserving inclusion. Thus we have the commutative diagram: → An−2 → An−1 → An ×l ×l → Bn−2 → Bn−1 → Bn ֒→ ֒→ ֒→ ×l ×l ×l B0 → B1 → B2 → · · · ×l ×l ×l ֒→ ×l ֒→ ×l ֒→ ×l A0 → A1 → A2 → · · · ··· ×l In particular, for each k = 0, 1, · · · , [n/2], we have the commutative diagram ֒→ ֒→ ×ln−2k : Ak → An−k . ×ln−2k : Bk → Bn−k Inasmuch as the map ×ln−2k : Ak → An−k is bijective, the restricted map ×ln−2k : Bk → Bn−k is injective. It is easy to see that dimF Bk = dimF Bn−k , whence the restricted map is also in fact bijective. Thus we have established the following theorem. Theorem 6.5. Let B be the monomial complete intersection ring, B = F [y1 , y2 , · · · , yr ]/(y1d1 +1 , y2d2 +1 , · · · , yrdr +1 ). Then the multiplication map ×(y1 + y2 + · · · + yr )n−2k : Bk → Bn−k is a bijection. Remark 6.6. (1) Ikeda has shown that if a graded Artinian F -algebra A has the strong Lefschetz property with a Lefschetz element l, then A[x]/(x2 ) has the strong Lefschetz property with x + l as a Lefschetz element. It immediately follows that the quadratic monomial complete intersection ring has the strong Lefschetz property with Lefschetz element x+l. Our results on the Weyr structures of blocked matrices can be used to prove this directly, in fact for A[x]/(xt ). This enables us 22 to determine the Weyr form for ×l ∈ EndF (B) for a general element l in the monomial complete intersection ring B. (2) Let A = F [x, y]/(xm , y n ) be a monomial complete intersection ring in two variables. Assume that F has characteristic 0 or p > m + n − 2. Our results on Weyr structures can be used to obtain the Weyr structure of the multiplication map ×(x + y) : A → A, whereas this is not so easy to prove just by commutative algebra (cf. [5]).  Theorem 6.7. Let B be the monomial complete intersection ring, B = F [x1 , · · · , xn ]/(xd11 +1 , · · · , xdnn +1 ). Let l be a general element in B. Write |Bi | for the dimension of Bi (where Bi is the homogeneous space of B of degree i). Then the Weyr structure of ×l is given by the partition |B| = |B0 | + |B1 | + · · · + |Bd1 +···+dn |, once arranged in decreasing order (see also Proposition 6.8). Proposition 6.8. Let B be the monomial complete intersection ring as defined in Theorem 6.7. Then the dimensions dim Bi of the homogeneous components of B are determined as the coefficients of T i in the polynomial n Y (1 + T + T 2 + · · · + T dj ). j=1 Remark 6.9. Theorem 6.7 was proved by R. Stanley in [9] using the Hard Lefschetz Theorem in algebraic geometry. It was also proved in [10], in which the second author used the theory of the Lie algebra sl(2). It is rather an amazing fact that Theorem 6.7 is an easy consequence of Theorem 6.2, since Theorem 6.7 is a generalisation of Theorem 6.2. Theorem 6.2 was proved by Ikeda [6] in an elementary manner without a reference to the general case. Our proof here is elementary also, but quite different from the proof of Ikeda. References [1] Gerstenhaber, M., On dominance and varieties of commuting matrices, Ann. of Math. 73 (1961) 324 - 348. [2] Guralnick, R. M., A note on commuting pairs of matrices, Linear Multilinear Algebra 31 (1992) 71 - 75. [3] Horn, R. A.; Johnson, C. R., Matrix Analysis, Cambridge University Press, Cambridge, Second Edition, 2013. [4] Holbrook, J.; O’Meara, K. C., Some thoughts on Gerstenhaber’s theorem, Linear Algebra Appl., 466 (2015), 267 – 295. [5] Iima, K.; Iwamatsu, R. On the Jordan decomposition of tensored matrices of Jordan canonical forms, Math. J. Okayama Univ. 51 (2009), 133 – 148. 23 [6] Ikeda, H., Results on Dilworth and Rees numbers of Artinian rings, Jpn. J. Math.(N.S.) 22(1), 147–158 (1996). [7] O’Meara, K. C.; Clark, J.; Vinsonhaler C. I., Advanced Topics in Linear Algebra: Weaving Matrix Problems through the Weyr Form, Oxford University Press, Oxford, 2011. [8] Shapiro, H., The Weyr characteristic, Amer. Math. Monthly 106 (1999), 919–929. [9] Stanley, R. P., Weyl groups, the hard Lefschetz theorem, and the Sperner property, SIAM J. Algebra, Discrete Methods I(2), 168–184 (1980). [10] Watanabe, J., The Dilworth number of Artinian rings and finite posets with rank function, In: Commutative Algebra and Combinatorics, Kyoto, 1985, Advanced Studies in Pure Mathematics, vol.11, 303–312, North-Holland, Amsterdam (1987). E-mail address: [email protected] E-mail address: [email protected] 24
0math.AC
New Results on Online Resource Minimization∗ Lin Chen† Nicole Megow† Kevin Schewior‡ arXiv:1407.7998v3 [cs.DS] 8 Dec 2015 February 20, 2018 Abstract We consider the online resource minimization problem in which jobs with hard deadlines arrive online over time at their release dates. The task is to determine a feasible schedule on a minimum number of machines. We rigorously study this problem and derive various algorithms with small constant competitive ratios for interesting restricted problem variants. As the most important special case, we consider scheduling jobs with agreeable deadlines. We provide the first constant-ratio competitive algorithm for the non-preemptive setting, which is of particular interest with regard to the known strong lower bound of n for the general problem. For the preemptive setting, we show that the natural algorithm LLF achieves a constant ratio for agreeable jobs, while in general it has a lower bound of Ω(n1/3 ). We also give an O(log n)-competitive algorithm for the general preemptive problem, which improves upon a known O(log(pmax /pmin ))-competitive algorithm. Our algorithm maintains a dynamic partition of the job set into loose and tight jobs and schedules each (temporal) subset individually on separate sets of machines. The key is a characterization of how the decrease in the relative laxity of jobs influences the optimum number of machines. To achieve this we derive a compact expression of the optimum value, which might be of independent interest. We complement the general algorithmic result by showing lower bounds that rule out that other known algorithms may yield a similar performance guarantee. ∗ This research was supported by the German Science Foundation (DFG) under contract ME 3825/1. The third author was supported by the DFG within the research training group ‘Methods for Discrete Structures’ (GRK 1408). † Technische Universität München, Zentrum für Mathematik, Garching, Germany. Email: [email protected], [email protected]. ‡ Technische Universität Berlin, Institut für Mathematik, Berlin, Germany. Email: [email protected]. 1 Introduction Minimizing the resource usage is a key to the achievement of economic, environmental or societal goals. We consider the fundamental problem of minimizing the number of machines that is necessary for feasibly scheduling jobs with release dates and hard deadlines. We consider the online variant of this problem in which every job becomes known to the online algorithm only at its release date. We denote this problem as online machine minimization problem. We also consider a semi-online variant in which we give the online algorithm slightly more information by giving the optimal number of machines as part of the input. We develop several algorithms for preemptive and non-preemptive problem variants, and evaluate their performance by the competitive ratio, a widely-used measure that compares the solution value of an online algorithm with an optimal offline value. We derive the first constant-competitive algorithms for certain variants of (semi-)online machine minimization and improve several others. As a major special case, we consider online deadline scheduling with agreeable deadlines, i.e., when the order of deadlines for all jobs coincides with the order of their release dates. We give the first constant-competitive algorithm for scheduling agreeable jobs non-preemptively, which contrasts to the strong lower bound of n for the general problem [18]. We also prove that for the preemptive scheduling problem, one of the most natural algorithms called Least Laxity First (LLF) achieves a constant ratio for agreeable jobs, in contrast with its lower bound of Ω(n1/3 ) on the general problem. Our most general result is a O(log n)-competitive algorithm for the preemptive scheduling problem. Previous results. The preemptive semi-online machine minimization problem, in which the optimal number of machines is known in advance, has been investigated extensively by Phillips et al. [17], and there have hardly been any improvements since then. Phillips et al. show a general ) on the competitive ratio for lower bound of 45 and leave a huge gap to the upper bound O(log ppmax min the so-called Least Laxity First (LLF) Algorithm. Not so surprisingly, they also rule out that the Earliest Deadline First (EDF) Algorithm could improve on the performance of LLF; indeed they ). It is a wide open question if preemptive (semi-)online machine show a lower bound of Ω( ppmax min minimization admits a constant-factor online algorithm. The non-preemptive problem is considerably harder than the preemptive problem. If the set of jobs arrives online over time, then no algorithm can achieve a constant or even sublinear competitive ratio [18]. However, relevant special cases admit online algorithms with small constant worst-case guarantees. The problem with unit processing times was studied in a series of papers [9,13,14,18,19] and implicitly in the context of energy-minimization in [4]. It has been shown that an optimal online algorithm has the exact competitive ratio e ≈ 2.72 [4, 9]. For non-preemptive scheduling of jobs with equal deadlines, an upper bound of 16 is given in [9]. We are not aware of any previous work on online machine minimization restricted to instances with agreeable deadlines. However, in other contexts, e.g., online buffer management [12] and scheduling with power management [1, 3], it has been studied as an important and relevant class of instances. Online deadline scheduling with extra speedup is another related problem variant. We are given the same input as in the semi-online machine minimization problem. Instead of equipping an online algorithm with additional machines, the given m machines may run at an increased speed s ≥ 1. The goal is to find an online scheduling algorithm that requires minimum speed s. This problem seems much better understood and (nearly) tight speedup factors below 2 are known (see [2,15,17]). However, the power of speed is much stronger than additional machines since it allows parallel processing of jobs to some extent. Algorithms that perform well for the speed-problem, such as, EDF, LLF and a deadline-ordered algorithm, do not admit constant performance guarantees for the 1 preemptive OPT known LB general pj ≤ α(dj − rj ) agreeable deadlines dj ≡ d pj ≡ p pj ≡ 1 5 4 [17] − − − 8 7 − UB O (log n) non-preemptive OPT unknown LB 1 (1−α)2 e [4, 9] − 18 1 3 1 [13] e e e e OPT known UB O (log n) ⋆ 4 (1−α)2 ⋆ [4, 9] [4, 9] [4, 9] [4, 9] 72 4⋆ 9.38 e [4, 9] ⋆ OPT unknown LB UB LB UB n [18] n [18] − − n [18] n [18] − − − − 9 5 41 4 1 [13] 8 7 − e e e e [4, 9] [4, 9] [4, 9] [4, 9] 16 11 91 10 e [4, 9] Table 1: State of the art for (semi-)online machine minimization. New results presented in this paper are colored red (and have no reference). Results for the online setting that are directly derived from the semi-online setting are marked with a star (⋆ ). Trivial bounds are excluded (−). machine minimization problem. We also mention that the offline problem, in which all jobs are known in advance, can be solved optimally in polynomial time if job preemption is allowed [11]. Again, the problem complexity increases drastically if preemption is not allowed. In fact, the problem of deciding whether one machine suffices to schedule all the jobs non-preemptively is strongly NP-complete [10]. It is even open if a constant-factor approximation exists; a lower bound of 2 − ε was given in [8]. The currently best known non-preemptive approximation algorithm is by Chuzhoy et al. [7] who propose a sophisticated rounding procedure for a linear programming relaxation that yields an q approximation factor of O( logloglogn n ). Small constant factors were obtained for special cases [8,20]: in particular, Yu and Zhang [20] give a 2-approximation when all release dates are equal and a 6-approximation when all processing times are equal. Our contribution. We develop several algorithms and bounding techniques for the (semi-) online machine minimization problem. We give an improved algorithm for the general problem and present a rigorous study of interesting restricted variants for which we show small constant competitive ratios. A summary of our new results can be found in Table 1. As an important special case, we consider the class of instances with agreeable deadlines in which the order of deadlines for all jobs coincides with the order of their release dates. We give the first constant competitive ratio for the preemptive and non-preemptive problem variants. The constant performance guarantee for the non-preemptive setting is particularly interesting with regard to the strong lower bound of n for instances without this restriction [18]. For the preemptive setting, we show that the natural algorithm LLF admits a constant performance guarantee on agreeable jobs, in contrast with its non-constant ratio on the general problem. We also quantify how the tightness of jobs influences the performance of algorithms such as EDF and LLF, which might be of independent interest. Our most general result is a O(log n)-competitive algorithm for the unrestricted preemptive online problem. This improves on the O(log(pmax /pmin ))-competitive algorithm by Phillips et al. [16, 17], which was actually obtained for the semi-online problem in which the optimal number of machines is known in advance. But as we shall see it can be used to solve the online problem as well. In fact, we show that the online machine minimization problem can be reduced to the semionline problem by losing at most a factor 4 in the competitive ratio. This is true for preemptive as well as non-preemptive scheduling. 2 Our algorithm for the general problem maintains a dynamic partition of jobs into loose and tight jobs and schedules each (temporal) subset individually on separate machines. The loose jobs are scheduled by EDF whereas the tight jobs require a more sophisticated treatment. The key is a characterization of how the decrease in the relative laxity of jobs influences the optimum number of machines. To quantify this we derive a compact expression of the optimum value, which might be of independent interest. We complement this algorithmic result by showing strong lower bounds on LLF or any deadline-ordered algorithm. We remark that our algorithms run in polynomial time (except for the non-preemptive online algorithms). As a side result, we even improve upon a previous approximation result for nonpreemptive offline machine minimization with jobs of equal processing time when the optimum is not known. Our semi-online 4-competitive algorithm can be easily turned into an offline 4approximation which improves upon a known 6-approximation [20]. Outline. In Section 2, we introduce some notations and state basic results used throughout the paper. In Section 3, we give constant-competitive algorithms for the problem of scheduling agreeable jobs. We continue with the other special cases of equal processing times and uniform deadlines in Sections 4 and 5, respectively. Our general O(log n)-competitive algorithm is presented in Section 6. We finally present some lower bounds in Section 7. 2 Problem Definition and Preliminaries Problem definition. Given is a set of jobs J = {1, 2, . . . , n} where each job j ∈ J has a processing time pj ∈ N, a release date rj ∈ N which is the earliest possible time at which the job can be processed, and a deadline dj ∈ N by which it must be completed. The task is to open a minimum number of machines such that there is a feasible schedule in which no job misses its deadline. In a feasible schedule each job j ∈ J is scheduled for pj units of time within the time window [rj , dj ]. Each opened machine can process at most one job at the time, and no job is running on multiple machines at the same time. When we allow job preemption, then a job can be preempted at any moment in time and may resume processing later on the same or any other machine. When preemption is not allowed, then a job must run until completion once it has started. To evaluate the performance of our online algorithms we perform a competitive analysis (see e.g. [5]). We call an online algorithm A c-competitive if mA machines with mA ≤ c · m suffice to guarantee a feasible solution for any instance that admits a feasible schedule on m machines. Notation. We let J(t) := {j ∈ J | rj ≤ t} denote the set of all jobs that have been released by time t. For some job set J we let m(J) denote the minimum number of machines needed to feasibly schedule J. If J is clear from the context, we also write more concisely m for m(J) and m(t) for m(J(t)). Consider an algorithm A and the schedule A(J) it obtains for J. We denote the remaining A(J) processing time of a job j at time t by pj (t). Further, we define the laxity of j at time t A(J) A(J) as ℓj (t) = dj − t − pj (t) and call ℓj = ℓj (rj ) the original laxity. We denote the largest deadline in J by dmax (J) = maxj∈J dj . We classify jobs by the fraction that their processing time takes from the feasible time window and call a job j α-loose at t if pj (t) ≤ α(dj − rj ) or α-tight at t, otherwise. Here, we drop t if t = rj . Finally, a job is called active at any time it is released but unfinished. We analyze our algorithms by estimating the total processing volume (or workload) that is assigned to certain time intervals [t, t′ ). To this end, we denote by wA(J) (t) the total processing volume of J that A assigns to [t, t + 1) (or simply to t). Since our algorithms make decisions at 3 integral time points, this is simply the number of assigned jobs. Further, WA(J) (t) denotes the total remaining processing time of all unfinished jobs (including those not yet released). We omit the superscripts whenever J or A are non-ambiguous, and we use OPT to indicate an optimal schedule. Reduction to the semi-online problem. In the following we show that we may assume that the optimum number of machines m is given by losing at most a factor 4 in the competitive ratio. We employ the general idea of doubling an unknown parameter, which has been successfully employed in solving various online optimization problems [6]. In our case, the unknown parameter is the optimal number of machines. The idea is to open additional machines at any time that the optimum solution has doubled. Let Aα (m) denote an α-competitive algorithm for the semi-online machine minimization problem given the optimum number of machines m. Then our algorithm for the online problem is as follows. Algorithm Double: • Let t0 = minj∈J rj . For i = 1, 2, . . . let ti = min{t | m(t) > 2m(ti−1 )}. • At any time ti , i = 0, 1, . . ., open 2αm(ti ) additional machines. All jobs with rj ∈ [ti−1 , ti ) are scheduled by Algorithm Aα (2m(ti−1 )) on the machines opened at time ti−1 . Observe that this procedure can be executed online, since the time points t0 , t1 , . . . as well as m(t0 ), m(t1 ), . . . can be computed online and Aα is assumed to be an algorithm for the semi-online problem. Since the optimal solution increases only at release dates, which are integral, we may assume that ti ∈ N. Notice also that Double does not preempt jobs which would not have been preempted by Algorithm Aα . Theorem 1. Given an α-competitive algorithm for the (non)-preemptive semi-online machine minimization problem, Double is 4α-competitive for (non)-preemptive online machine minimization. Proof. Let t0 , t1 , . . . , tk denotes the times at which Double opens new machines. Double schedules the jobs Ji = {j | rj ∈ [ti , ti+1 )}, with i = 0, 1, . . . , k, using Algorithm Aα (2m(ti )) on 2αm(ti ) machines exclusively. This yields a feasible schedule since an optimal solution for Ji ⊆ J(ti+1 − 1) requires at most m(ti+1 − 1) ≤ 2m(ti ) machines and the α-competitive subroutine Aα (2m(ti )) is guaranteed to find a feasible solution given a factor α times more machines than optimal, i.e., 2αm(ti ). It remains to compare the number of machines opened by Double with the optimal number of machines m, which is at least m(tk ). By construction it holds that 2m(ti ) ≤ m(ti+1 ), which implies by recursive application that m(tk ) (1) 2m(ti ) ≤ k−i−1 . 2 The total number of machines opened by Double is k X 2αm(ti ) ≤ i=0 k X i=0 α 1 m(tk ) = 2α 2k−i−1 k X 1 m(tk ) ≤ 4αm, 2i i=0 which concludes the proof. Using standard arguments, this performance guarantee can be improved to a factor e ≈ 2.72 using randomization over the doubling factor. However, in the context of hard real-time guarantees a worst-case guarantee that is achieved in expectation seems less relevant and we omit it. 4 Algorithms. An algorithm for the (semi-)online machine minimization problem is called busy if, at all times t, wA (t) < m implies that there are exactly wA (t) active jobs at t. Two well-known busy algorithms are the following. The Earliest Deadline First (EDF) algorithm on m′ machines schedules at any time the m′ jobs with the smallest deadline. The Least Laxity First (LLF) algorithm on m′ machines, schedules at any time the m′ jobs with the smallest non-negative laxity at that time. In both cases, ties are broken in favor of earlier release dates or, in case of equal release dates, by lower job indices. For simplicity, we assume in this paper that both EDF and LLF make decisions only at integer time points. Scheduling loose jobs. Throughout the paper, we will use the fact that, for any fixed α < 1, we can achieve a constant competitive ratio on α-loose jobs, i.e., when pj (t) ≤ α(dj − rj ), simply by using EDF. We remark that the same result also applies to LLF. Theorem 2. If every job is α-loose, EDF is a 1/(1 − α)2 -competitive algorithm for preemptive semi-online machine minimization. We prove this theorem by establishing a contradiction based on the workload that EDF when missing deadlines must assign to some interval. We do so by using the following work load inequality, which holds for arbitrary busy algorithms. Lemma 1. Let every job be α-loose, c ≥ 1/(1 − α)2 and let A be a busy algorithm for semi-online ′ ′ machine minimization using cm machines. Assume that ℓA j (t ) ≥ 0 holds, for all t ≤ t and j. Then WA (t) ≤ WOPT (t) + α · m · (dmax − t) . 1−α Proof. We prove by induction. The base is clear since WA (0) = WOPT (0). Now assume the lemma holds for all t′ < t. There are three possibilities. Case 1. We have wA (t) ≤ α/(1 − α) · m. By the fact that A is busy, there is an empty machine ′ at time t, meaning that there are at most α/(1 − α) · m active jobs. Given that ℓA j (t ) ≥ 0 for all ′ t ≤ t, each of the active jobs has a remaining processing time of no more than dmax − t, implying that WA (t) is bounded by α/(1 − α) · m · (dmax − t) plus the total processing time of the jobs that are not released. As the latter volume cannot exceed WOPT (t), the claim follows. Case 2. We have wA (t) ≥ 1/(1 − α) · m. According to the induction hypothesis, it holds that WA (t − 1) ≤ WOPT (t − 1) + α/(1 − α) · m · (dmax − t + 1). Using wOPT (t) ≤ m, we get WOPT (t) ≥ WOPT (t−1)−m. For Algorithm A, it holds that WA (t) = WA (t−1)−wA (t) ≤ WA (t−1)−1/(1−α)·m. Inserting the first inequality into the second one proves the claim. Case 3. We have α/(1 − α) · m < wA (t) < 1/(1 − α) · m. Again by the fact that A is busy, there is an empty machine at time t, i.e., there are less than 1/(1 − α) · m active jobs. Distinguish two cases. Case 3a. We have pj (t) ≤ α(dj − t) for all active jobs. Then the total remaining processing time of active jobs is bounded by α(dmax − t) · 1/(1 − α) · m. Plugging in the total processing time of unreleased jobs, which is bounded by WOPT (t), we again get the claim. Case 3b. There exists an active job j with pj (t) > α(dj − t). Using that j is α-loose, i.e., pj ≤ α(dj − rj ), we get that j is not processed for at least (1 − α)(t − rj ) many time units in the interval [rj , t]. As Algorithm A is busy, this means that all machines are occupied at these times, 5 yielding WA (t) ≤ WA (rj ) − (1 − α)(t − rj ) · cm α ≤ WOPT (rj ) + · m · (dmax − rj ) − (1 − α)(t − rj ) · cm 1−α α · m · (dmax − t) − m · (t − rj ), ≤ WOPT (rj ) + 1−α where the second inequality follows by the induction hypothesis for t = rj , and the third one follows by c ≥ 1/(1 − α)2 . Lastly, the feasibility of the optimal schedule implies WOPT (t) ≥ WOPT (rj ) − m · (t − rj ), which in turn implies the claim by plugging it into the former inequality. Proof of Theorem 2. Let cm be the number of machines EDF uses and consider the schedule produced by EDF from an arbitrary instance J only consisting of α-loose jobs. We have to prove that every job is finished before its deadline if c = 1/(1 − α)2 . To this end, suppose that EDF fails. Among the jobs that are missed, let j ⋆ be one of those with the earliest release date. First observe that we can transform J into J ′ ⊂ J such that j ⋆ ∈ J ′ , maxj∈J ′ dj = dj ⋆ and EDF still fails on J ′ . For this purpose, simply define J ′ = {j ∈ J | dj ≤ dj ⋆ } and notice that we have only removed jobs with a later deadline than maxj∈J ′ dj . This implies that every job from J ′ receives the same processing in the EDF schedule of J ′ as in the one of J. We can hence consider J ′ instead of J from now on. In the following, we establish a contradiction on the workload during the time interval [rj ⋆ , dj ⋆ ]. The first step towards this is applying Lemma 1 for an upper bound. Also making use of the feasibility of the optimal schedule, we get: WEDF (rj ⋆ ) ≤ WOPT (ra ) + ≤ α · m · (dmax − rj ⋆ ) 1−α 1 · m · (dmax − rj ⋆ ). 1−α We can, however, also lower bound this workload. Thereto, note that job j ⋆ is not processed for at least (1 − α)(dj ⋆ − rj ⋆ ) time units, implying that all machines must be occupied by then, i.e., WEDF (rj ⋆ ) > (1 − α) · cm · (dmax − rj ⋆ ). If we compare the right-hand sides of the two inequalities, we arrive at a contradiction if and only if c ≥ 1/(1 − α)2 , which concludes the proof. 3 Constant-competitive Algorithms for Agreeable Deadlines In this section, we study the special case of (semi-)online machine minimization of jobs with agreeable deadlines. That is, for any two jobs j, k ∈ J with rj < rk it holds that also dj ≤ dk . 3.1 Preemptive scheduling We propose an algorithm that again schedules α-loose jobs by EDF or LLF on m/(1 − α)2 machines, which is feasible by Theorem 2. Furthermore, α-tight jobs are scheduled by LLF, for which we obtain the following bound. 6 Theorem 3. The competitive ratio of LLF is at most 4/α + 6 if all jobs are α-tight and have agreeable deadlines. The proof is based on a load argument. Notice that Lemma 1 is no longer true since jobs now are all tight. To define a new load inequality we introduce the set Λ(t) which is defined as follows. Consider the latest point in time before (or at) t such that at most m jobs are processed and denote it by φ(t) = max{t′ ≤ t | wLLF (t′ ) ≤ m}. Let Λ(t) be the set of active jobs at time φ(t). Obviously |Λ(t)| ≤ m. If there does not exist such a φ(t), i.e., w(x) > m holds for any x ≤ t, then we let Λ(t) = ∅. Lemma 2. Consider an instance consisting only of α-tight jobs. Let c ≥ 4/α + 6 and t such that there is no job missed by LLF up to time t. Then we have X WLLF (t) ≤ WOPT (t) + pj (t). j∈Λ(t) Proof. The lemma is trivially true for t = 0. Now assume t > 0 and that the lemma holds for all t′ < t. We make the following assumptions. Indeed, if any of them is not true, then we can easily prove the lemma. (i) φ(t) = tl exists, and tl < t. (ii) Λ(t) 6= ∅. (iii) During [tl , t], at least one job is not processed all the time. (iv) dj ≥ t for at least one job j ∈ Λ(t). Consider assumption (i). The lemma is obviously true if φ(t) does not exist because that means wLLF (t′ ) > m for any t′ ≤ t. That is at time t, LLF must have finished more load than the optimum solution, in which only m machines are available. It follows directly that WLLF (t) ≤ WOPT (t). Otherwise there exists φ(t) = tl ≤ t. Notice that, if tl = t, then obviously WLLF (tl ) ≤ WOPT (tl ) + P ′ j∈Λ(tl ) pj (tl ). Thus we assume in the following that tl < t, and it follows that Λ(t ) = Λ(tl ) for ′ any t ∈ [tl , t]. Consider assumption (ii). If φ(t) = tl exists while Λ(t) is empty, then LLF finishes all the jobs released before time tl , while wLLF (t′ ) > m ≥ wOPT (t′ ) for tl < t′ ≤ t. It is easy to see that the lemma follows. P Consider assumption (iii). Notice that WLLF (t) ≤ WOPT (t) + j∈Λ(t) pj (t) is obviously true if no new job is released after tl . If a new job is released after tl and scheduled without preemption by LLF, then its contribution to WLLF (t) is no more than its contribution to WOPT P(t). Plugging in the contributions of the newly released jobs, we still have WLLF (t) ≤ WOPT (t) + j∈Λ(t) pj (t). Consider assumption (iv). If it is not true, we have WLLF (t − 1) ≤ WOPT (t − 1) according to the induction hypothesis, and pj (t − 1) = 0 holds for all j ∈ Λ(t − 1). Given that WLLF (t) ≤ WLLF (t − 1) − m and WOPT (t − 1) ≥ WOPT (t) − m, the lemma is true. We proceed with the four assumptions above. Notice that some job is not processed in [tl , t], and we let [t0 , t0 +1] be the first such time. We let ta be the first time in [t0 , t] with wLLF (ta ) ≤ 2m. Notice that ta might not exist, and in this case wLLF (t′ ) > 2m holds for all t′ ∈ [t0 , t]. As a consequence we get WLLF (t) ≤PWLLF (t0 ) − 2mP · (t − t0 ). On the other hand, WOPT (t) ≥ WOPT (t0 ) − m · (t P− t0). Given the fact that j∈Λ(t) pj (t) ≤ j∈Λ(t) pj (t0 )−m·(t−t0), we have WLLF (t) ≤ WOPT (t)+ j∈Λ(t) pj (t). 7 Now assume that ta ≤ t exists. Let tb ≤ t0 be the latest time with wLLF (tb − 1) ≤ γcm for some parameter γ < 1 that will be fixed later (i.e., w(t′ ) > γcm for t′ ∈ [tb , t0 ]). Given that wLLF (tl ) ≤ m, we know that tb ∈ [tl , t0 ] ⊆ [tl , t], and furthermore that WLLF (t) ≤ WLLF (tb ) − γcm · (t0 − tb ). (2) Since wLLF (tb − 1) ≤ γcm and wLLF (t0 ) = cm, at least (1 − γ) · cm jobs are released during [tb , t0 ]. Since wLLF (ta ) ≤ 2m, among these (1 − γ) · cm jobs, there are at least (1 − γ − 2/c) · cm finished before ta . Let j be any of these jobs released after tb and finished before ta . Now consider the active jobs at time tl . We know by (iv) that at least one of them, say job j ′ , has a deadline no less than t. Recall that we are given an agreeable instance, hence job j that is released after j ′ must have a larger deadline, i.e., dj ≥ t. Further, we have rj ≤ t0 , and as job j is a tight job it follows that pj ≥ α · (dj − rj ) ≥ α · (t − t0 ). Thus, WLLF (t) ≤ WLLF (tb ) − (1 − γ − 2/c) · αcm · (t − t0 ). (3) By combining Inequalities 2 and 3, we have WLLF (t) ≤ WLLF (tb ) − max{γ · cm · (t0 − tb ), (1 − γ − 2/c) · αcm · (t − t0 )} ≤ WLLF (tb ) − 1/2 · γcm · (t − tb ). (4) if we choose γ such that α · (1 − γ − 2/c) = γ. P WLLF (tb ) ≤ WOPT (tb ) + P On the other hand, it is easy to observe the followingPthree inequalities: p (t) ≥ p (t ), W (t) ≥ W (t ) − m · (t − t ), and j j b OPT OPT b b j∈Λ(t) pj (tb ) − m · (t − tb ). j∈Λ(t) j∈Λ(t) Hence it follows that X WLLF (tb ) ≤ WOPT (t) + m · (t − tb ) + pj (t) + m · (t − tb ). (5) j∈Λ(t) By combining Inequalites 4 and 5, it can be easily seen that the lemma holds if we set γ/2 · c ≥ 2. Combining this inequality with the equation α · (1 − γ − 2/c) = γ above, we get c ≥ 4/α + 6, i.e., for c ≥ 4/α + 6, the lemma is true. Proof of Theorem 3. Assume the contrary, i.e., LLF fails. From the counterexamples, we pick one with the minimum number of jobs and let J denote the instance. Among all those jobs that are missed, we let z be the job with the earliest release date. Since job z is missed, there must exist some time t0 when the laxity of job z is 0 but it is still not processed in favor of cm other jobs. Let these jobs be job 1 to job cm with r1 ≤ r2 ≤ · · · ≤ rcm and Sz be the set of them. We have the following observations used throughout the proof: • No job is released after t0 . • For 1 ≤ i ≤ cm, we have di ≤ dz . • For 1 ≤ i ≤ cm, each job i has 0 laxity at t0 and is not missed. Hence it is processed without preemption until time di . Let tb = r⌊cm/3⌋ and ta = d⌊2cm/3⌋ . Consider time tb . According to Lemma 2, we have WLLF (tb ) ≤ WOPT (tb ) + X pj (tb ) ≤ WOPT (tb ) + m · (ta − tb ). j∈Λ(tb ) 8 (6) To see why the second inequality holds, observe that there are ⌊cm/3⌋ > m jobs being processed at time tb . Thus any job in Λ(tb ) must have a release date no later than rm and hence it has a deadline no later than dm ≤ ta . Furthermore, no job from Λ(tb ) is missed, so the total remaining load of these jobs at ta is at most m · (ta − tb ). We focus on the interval [tb , ta ] and will establish a contradiction on the load processed by LLF during this interval. We define a job j to be a bad job if it contributes more to WOPT (ta ) than to WLLF (ta ), i.e., either one of the following is true: • Job j is not finished at ta in both LLF and OPT, and we have pOPT (ta ) > pLLF j j (ta ). • At ta , job j is finished in LLF but it is not finished in OPT. Observation 1. If the laxity of a job becomes 0 in LLF at some time during [tb , ta ], then it is not a bad job. Hence, any job in Sz cannot be a bad job since their laxities are 0 at t0 ∈ [tb , ta ]. Since we have ta = d⌊2/3cm⌋ , and a bad job j is not finished in OPT at time ta , we get that dj ≥ d⌊2/3cm⌋ , and rj ≥ r⌊2/3cm⌋ ≥ tb = r⌊cm/3⌋ . Now delete all the bad jobs in the schedules produced by LLF and OPT and denote their corresponding remaining loads at some t by ŴLLF (t) and ŴOPT (t), respectively. By the preceding observations, we again have ŴLLF (tb ) ≤ ŴOPT (tb ) + m · (ta − tb ) because the same amount is subtracted from both sides of Inequality 6. Further, by the definition of bad jobs, we have ŴLLF (ta ) ≥ ŴOPT (ta ). It follows directly that ŴLLF (tb ) − ŴLLF (ta ) ≤ 2m · (ta − tb ), and we show in the following that ŴLLF (tb ) − ŴLLF (ta ) ≥ ⌊cm/3⌋ · (ta − tb ) > 2m · (ta − tb ), which will yield a contradiction and thus prove the theorem. Towards proving the claim, let ŵLLF (t) be the load of LLF at time t in the schedule of LLF after deleting bad jobs. We prove that for any t ∈ [tb , ta ], we have ŵLLF (t) ≥ ⌊cm/3⌋. We first observe that at any t ∈ [t0 , ta ] job ⌊2cm/3⌋ + 1 to job cm of Sz are processed. Thus the statement is true for every t ∈ [t0 , ta ]. Consider any time t ∈ [tb , t0 ]. The first ⌊cm/3⌋ jobs from Sz are released and not finished, which implies that wLLF (t) ≥ ⌊cm/3⌋. Obviously if at time t no bad job is processed, then ŵLLF (t) = wLLF (t) and we are done. Otherwise at time t some bad job is being processed. We claim that, during [tb , t0 ], the jobs 1, . . . , ⌊cm/3⌋ from Sz will never be preempted in favor of a bad job, and then ŵLLF (t) ≥ ⌊cm/3⌋ follows. Suppose this is not true. Then there exists some time t ∈ [tb , t0 ], some bad job j and some other job j ′ ∈ {1, 2, · · · , ⌊cm/3⌋} such that j ′ is preempted at t while j is being processed. We focus on the two jobs j and j ′ , and pick up the last time t′ such that j ′ is preempted while j is being processed, and obviously t′ < t0 . Since j ′ is preempted at t′ , we get ℓj (t′ ) ≤ ℓj ′ (t′ ). We know that the laxity of a job decreases by 1 if it is preempted, and remains the same if it gets processed. From time t′ + 1 to t0 , we know that j ′ will never be preempted in favor of j since t′ is the last such time. This means whenever ℓj ′ (t) decreases by 1 (meaning that j ′ is preempted), then ℓj (t) also decreases by 1. So from t′ + 1 to t0 , ℓj ′ (t) decreases no more than ℓj (t), implying that ℓj (t0 ) ≤ ℓj ′ (t0 ) = 0, which contradicts the fact that j is a bad job. 9 Recall that α-loose jobs can be scheduled via EDF or LLF on m/(1 − α)2 machines. If we set α = 1/2 and use LLF on the α-tight jobs, we get the following result. Theorem 4. If deadlines are agreeable, there is a 18-competitive algorithm for preemptive semionline machine minimization. By applying Double, we get the following result for the fully online case. Theorem 5. If deadlines are agreeable, there is a 72-competitive algorithm for preemptive online machine minimization. 3.2 Non-preemptive Scheduling Consider the non-preemptive version of machine minimization with agreeable deadlines. Again we schedule α-tight and α-loose jobs separately. In particular, α-loose jobs are scheduled by a nonpreemptive variant of EDF, that is, at any time [t, t + 1], jobs processed at [t − 1, t] and are not finished continue to be processed. If there are free machines, then among all the jobs that are not processed we select the ones with earliest deadlines and process them. To schedule α-tight jobs, we use MediumFit: Algorithm MediumFit: Upon the release of a job j, we schedule it non-preemptively during the medium part of its processing interval, i.e., [rj + 1/2 · ℓj , dj − 1/2 · ℓj ]. We first prove a lemma about EDF and the α-tight jobs. Lemma 3. Non-preemptive EDF is a 1/(1 − α)2 -competitive algorithm for non-preemptive semionline machine minimization problem if all jobs are α-loose and have agreeable deadlines. Proof. We use the same technique as Theorem 2, i.e., we prove via contradiction on the workload. We observe that the load inequality provided by Lemma 1 is also true for non-preemptive machine minimization. Suppose EDF fails, then among all the jobs that are missed we consider the job with the earliest release date and let it be j ⋆ . Again let J ′ = {j ∈ J | dj ≤ dj ⋆ }. We claim that EDF also fails on J ′ . To see why, notice that jobs in J \ J ′ have a larger deadline than j ⋆ . Hence according to the agreeable deadlines their release dates are larger or equal to rj ⋆ . Furthermore according to EDF they are of a lower priority in scheduling, thus the scheduling of job j ⋆ could not be delayed in favor of jobs in J \ J ′ . This implies that EDF also fails on J ′ . The remaining argument is the same as the proof of Theorem 2. We remark that for non-agreeable deadlines, EDF is not a constant-competitive algorithm for αloose jobs. Indeed, non-preemptive (semi-)online machine minimization does not admit algorithms using less than n machines when m = 1, even if every job is α-loose for any constant α [18]. The above argument fails as we can no longer assume that the job j ⋆ missed by EDF has the largest deadline. We continue with a lemma about MediumFit: Lemma 4. MediumFit is a (2⌈1/α⌉ + 1)-competitive (semi-)online algorithm for non-preemptive machine minimization on α-tight jobs with agreeable deadlines. Proof. Suppose that the algorithm runs more than [2⌈1/α⌉ + 1] · m jobs at some time t. By the generalized pigeonhole principle, 2⌈1/α⌉ + 2 of them must run on the same machine in OPT. Consequently, on this machine, ⌈1/α⌉ + 1 of them are not finished after or not started before t. W.l.o.g. assume that the latter is the case and call these jobs J ⋆ (the other case is symmetric). 10 Observe that, as J ⋆ has been completely released at t, we can assume that, in OPT, these jobs are scheduled in order of their release dates, for this is the order of their deadlines. Now choose j ⋆ with maximum release date, that is, also maximum deadline, from J ⋆ . It holds that X t+ pj ≤ dj ⋆ = rj ⋆ + ℓj ⋆ + pj ⋆ . j∈J ⋆ Plugging in rj ⋆ ≤ t − ℓj ⋆ /2, which follows from the definition of MediumFit, yields X ℓj ⋆ . 2 pj ≤ j∈J ⋆ \{j ⋆ } Hence, for all j ∈ J ⋆ \ {j ⋆ }, we have rj ≤ rj ⋆ ≤ t − ℓj ⋆ ≤t− 2 X pj ′ , j ′ ∈J ⋆ \{j ⋆ } which follows by our choice of j ⋆ as well as the previous inequalities. Since all of these jobs are α-tight, we have X pj ′ . pj ≥ α · (t − rj ) ≥ α · j ′ ∈J ⋆ \{j ⋆ } By summing over all such j, we get X pj > α · (|J ⋆ | − 1) · j∈J ⋆ \{j ⋆ }   1 · ≥α· α X pj j∈J ⋆ \{j ⋆ } X j∈J ⋆ \{j ⋆ } pj ≥ X pj , j∈J ⋆ \{j ⋆ } which is a contradiction. Combining the above two lemmas and choosing α = 1/2, we have a guarantee for the semi-online case. Theorem 6. For non-preemptive machine minimization with agreeable deadlines, there is a semionline 9-competitive algorithm. A fully online (2 · ⌈1/α⌉ + 1 + 4/(1 − α)2 )-competitive algorithm can be obtained by using MediumFit for tight jobs and combining EDF with Double. Setting α = 1/3 we get the following. Theorem 7. For non-preemptive machine minimization with agreeable deadlines, there is a online 16-competitive algorithm. 4 Equal processing times Consider the special case of (semi-)online machine minimization of jobs that have equal processing times, that is, pj = p for all j ∈ J. 11 4.1 Preemptive Scheduling We first study preemptive semi-online machine minimization on instances with equal processing times. We firstly show that EDF is 3-competitive for semi-online machine minimization. Then we complement this result by a lower bound of 8/7 on the competitive ratio of any deterministic online algorithm for the special case of equal processing times. Finally, we give a 9.38-competitive online algorithm. Theorem 8. EDF is a 3-competitive algorithm for semi-online machine minimization when all processing times are equal. Proof. Suppose the theorem is not true. Among those instances EDF fails at, we pick one with the minimum number of jobs. It is easy to see that in this counterexample there is only one job missing its deadline. Let j be this job. Then dj is the maximum deadline among all the jobs and we let dj = d. Furthermore, during [d − p, d] there must be some time when job j is preempted. Let t0 ∈ [d − p, d] be the time when job j is preempted, and St0 be the set of jobs that are processed at time t0 . We claim that the total workload processed by EDF during [t0 − p, d] is at least 3mp. To see why, consider the EDF schedule. For simplicity we assume that St0 contains job 1 to job 3m and job i is always scheduled on machine i during [t0 − p, d] for 1 ≤ i ≤ 3m. We show that the workload of machine i in [t0 − p, d] is at least p and the claim follows. Consider job i. Then due to the fact that job i does not miss its deadline, we know that the workload on machine i during [t0 , d] is at least pi (t0 ). Consider any time in [t0 − (p − pi (t0 )), t0 ]. either job i is scheduled or it is not in favor of other jobs. In both cases, the workload of machine i is at least p − pi (t0 ). Thus, the workload of machine i during [t0 − p, d] is at least p. Since EDF fails, the previous considerations yield WEDF (t0 − p) > 3mp. (7) By the feasibility of the instance however, we know that WOPT (t0 − p) ≤ m · [d − (t0 − p)] ≤ 2mp (8) (recall that t0 ≥ d − p). Therefore before time t0 − p, there must exist some time t when wEDF (t) ≤ wOPT (t) ≤ m and, if t′ is the latest such time, that wEDF (t) > wOPT (t) for any t′ < t < t0 . As there are at most m active jobs at time t′ in the EDF schedule, we now get that WEDF (t′ ) ≤ WOPT (t′ ) + mp. (9) On the other hand, we have the inequalities WEDF (t′ ) ≥ WEDF (t0 − p) + m · (t0 − p − t′ ) and WOPT (t′ ) ≤ WOPT (t0 − p) + m · (t0 − p − t′ ). Plugging in Inequalities 7 and 8, respectively, into both of the latter ones yields a contradiction to Inequality 9. Moreover, we provide a non-trivial lower bound. The underlying structure resembles the one known from the lower bound proof for the general semi-online machine minimization problem from [17]. Theorem 9. Let c < 8/7. On instances fulfilling pj ≡ p ∈ N, there does not exist a c-competitive algorithm for the semi-online machine minimization problem. W.l.o.g. we restrict to even m. We will heavily make use of the following technical lemma. 12 Lemma 5. Let c < 8/7, m be even and A be a c-competitive algorithm for semi-online machine minimization. Assume that J with pj = 2, for all j ∈ J, is an instance with the following properties: (i) WOPT(J) (t) = 0, (ii) WA(J) (t) ≥ w and (iii) dj = t + 3 for all jobs j active at t in A(J). Then there exists an instance J ′ ⊃ J such that pj = 2, for all j ∈ J ′ , with the following properties: (i) WOPT(J ′ ) (t + 3) = 0, (ii) WA(J ′ ) (t + 3) ≥ w′ > w and (iii) dj = t + 6 for all jobs j active at t + 3 in A(J ′ ). Proof. We augment J the following way. At t, we release m more tight jobs and m/2 more loose jobs. For each job j of the more tight jobs, we set rj = t and dj = t + 3; for each of the more loose jobs, we set rj = t and dj = t + 6. We first observe that any c-competitive algorithm A has to do at least w + 2m − 2m · (c − 1) = w + 2m · (2 − c) work on the remaining active jobs from J as well as the more tight jobs (i.e., all active jobs except for the more loose ones) in the interval [t, t + 2]. That is because m tight jobs (i.e., dj = t + 4 for each job j of them) could be released at t + 2, forcing any c-competitive algorithm at t + 2 to have left not more work than 2m · (c − 1) of the jobs due at t + 3. Also note that in an optimal schedule, all the jobs could be feasibly scheduled. By the above observation, we get that A is not c-competitive if w + 2m · (2 − c) > 2cm. Otherwise, we can upper bound the work done on the more loose jobs in the interval [t, t + 2] by 2cm − w + 2m · (c − 2) = 4m · (c − 1) − w, amounting to 4m · (c − 1) − w + cm/2 = 4m · (9c/8 − 1) − w in the interval [t, t + 3]. What remains (of the more loose jobs) at t + 3 is thus at least a total workload of cm − 4m · (9c/8 − 1) + w = 4m · (1 − 7c/8) + w, which is larger than w if and only if c < 8/7. This allows us to prove the theorem. Proof of Theorem 9. We assume there exists a c-competitive algorithm A for semi-online machine minimization. Obviously, the lemma can be applied for J = ∅ and t = 0 (note that w = 0). By re-applying the lemma to the resulting instance for ⌈3cm⌉ more times, we can be sure that we finally have WA(J ′ ) (t′ ) > 3cm for some J ′ and t′ (by the strict increase of this value with each iteration), which is a contradiction. Now consider the online instead of semi-online case. Using our doubling technique as a black box (Theorem 1), we are able to derive a 12-competitive algorithm. In this subsection we will give an improved 9.38-competitive algorithm by utilizing the e-competitive algorithm of Devanur et al. [9], which is actually used for the special case when p = 1. Theorem 10. There exists a 9.38-competitive algorithm for the online machine minimization problem when pj = p. 13 As m is unknown, we use the density ρ(t) as an estimation for the number of machines needed for the jobs released until time t, where ρ(t) = p · |{j ∈ J(t) | [rj , dj ] ⊆ [a, b]}| . b−a [a,b]⊆[0,dmax ] max It can be easily seen that for any interval [a, b], |{j ∈ J(t) | rj ≤ t, [rj , dj ] ⊆ [a, b]} represents the set of all the jobs that have been released until time t, and have to be finished within [a, b]. Thus ρ(t) serves as a lower bound on m(J(t)). Using ρ(t), we give the following algorithm (parameterized by α and c): Algorithm: For α-tight jobs, run EarlyFit, i.e., (non-preemptively) schedule a job immediately when it is released. For α-loose jobs, run EDF with cρ(t) machines. We show in the following that with some parameter c the algorithm gives a feasible schedule. Lemma 6. EarlyFit uses at most ⌊(1/α + 1)ρ(t)⌋ machines. Proof. Suppose the lemma is not true. Then at some time t the Early-Fit algorithm requires more than ⌊(α + 1)ρ(t)⌋ machines, which implies that by scheduling the α-tight jobs immediately, there are more than (1/α + 1)ρ(t) tight jobs overlapping at time t. Hence each of the α-tight job is released after t − p and has a deadline at most t + p/α. Therefore, it holds that ρ(t) > (1/α + 1) · ρ(t) · p = ρ(t), p/α + p which is a contradiction. From now on we only consider loose jobs and let ρ′ (t) be the density of these jobs. Let J be the set of all loose jobs and J ′ be the modified instance by replacing each loose job j ∈ J with p unit size jobs with feasible time window [rj , dj ]. We observe that instance J and J ′ share the same density ρ′ (t). Furthermore, there is an e-competitive algorithm for J ′ which uses ⌈eρ(t)⌉ machines. Let WJ (t) be the remaining workload of jobs by applying our algorithm to J with c ≥ e and WJ ′ (t) be the remaining workload of jobs by applying the e-competitive algorithm to J ′ . We have the following load inequality: Lemma 7. For every time t it holds that WJ (t) ≤ WJ ′ (t) + e · ρ′ (t) · p . Proof. We prove by induction on t. Obviously the lemma is true for t = 0 as WJ (0) = WJ ′ (0). Suppose the lemma holds for t ≤ k. We prove that WJ (k + 1) ≤ WJ ′ (k + 1) + e · ρ′ (k + 1) · p. Consider wJ (k), i.e., the workload processed during [k, k + 1] by our algorithm. If wJ (k) < ⌈e · ρ′ (t)⌉, then there exists a free machines, implying that there are at most e · ρ′ (t) jobs unfinished. Thus, we get WJ (k + 1) ≤ WJ ′ (k + 1) + e · ρ′ (k + 1) · p. Otherwise, we get wJ (k) ≥ ⌈e · ρ′ (t)⌉. Recall that the lemma is true for t = k. That means that we have WJ (k) ≤ WJ ′ (k) + e · ρ′ (k) · p. Since it holds that WJ (k + 1) = WJ (k) − wJ (k) ≤ WJ (k) − ⌈e · ρ′ (k)⌉, WJ ′ (k + 1) = WJ ′ (k) − wJ ′ (k) ≥ WJ ′ (k) − ⌈e · ρ′ (k)⌉ as well as ρ′ (k + 1) ≥ ρ′ (k), simple calculations show that the lemma is true. Using the above load inequality, we prove the following: Lemma 8. For c ≥ e · (1 + α)/(1 − α), EDF is a cρ′ (t)-competitive algorithm for online machine minimization if pj ≡ p and every job is α-loose. 14 Proof. Among those instances EDF fails at, we pick one with the minimum number of jobs. It can be easily seen that in such an instance there is only one job missed, and this job has the largest deadline. Let j be the missed job. Then we know that until time dj − p/α, every job is released, implying that ρ′ (t) does not change after time t = dj − ⌊p/α⌋. Let ρ′ (t) = ρ′max for t ≥ dj − ⌊p/α⌋. Furthermore the fact that job j is missed implies that during [dj − ⌊p/α⌋, dj ], there must exist at least ⌊p/α⌋ − p + 1 time units when every machine is busy. This means that WJ (dj − p/α) > cρ′max · (⌊p/α⌋ − p + 1) + p − 1. On the other hand, the load inequality implies that WJ (dj − ⌊p/α⌋) ≤ WJ ′ (dj − ⌊p/α⌋) + e · ρ′max · p ≤ ⌊p/α⌋ · ⌈eρ′max ⌉ + e · ρ′max . Simple calculations show that choosing c ≥ e(1 + α)/(1 − α) yields a contradiction. We can now prove the theorem. Proof of Theorem 10. Combining the two algorithms for tight and loose jobs, we derive an (e · (1 + α)/(1 − α) + 1/α + 1)-competitive algorithm. By taking α ≈ 0.33, we get a 9.38-competitive algorithm. 4.2 Non-preemptive scheduling We consider non-preemptive semi-online machine minimization with equal processing times and also show a 4-competitive algorithm. Let P = {0, p, 2p, . . . } be the set of all the multiples of the integer p. For any job j, we let Qj = [rj , dj ] be its feasible time window. We know that Qj ∩ P 6= ∅ since dj − rj ≥ p. We now define job j to be a critical job if |Qj ∩ P | = 1, and a non-critical job if |Qj ∩ P | ≥ 2. When we say we round a non-critical job j, we round up its release date rj to be its nearest value in P , and round down dj to be its nearest value in P . Algorithm: Open 2m machines to schedule the non-critical jobs on them. Upon the release of a new job, check if it is critical. If it is critical, schedule it using EarlyFit, i.e., schedule it immediately upon its release on a separate machine. Otherwise round it and add it to the set of all the noncritical jobs that have not been scheduled. At time τ p and for any integer τ , pick 2m jobs from the set via EDF and schedule them on the dedicated machines. We first prove the following lemma. Lemma 9. For every instance J, there exists a schedule that uses at most 2m machines such that every critical job is scheduled via EarlyFit, i.e., immediately, and every non-critical job is scheduled exactly in [τ p, (τ + 1) · p] for some integer τ . Proof. Consider the (offline) optimum schedule S for the instance J. We alter the schedule in the following way. Firstly, we schedule critical jobs immediately when they are released. Secondly, we move any non-critical job which is processed all the time during some [τ p − 1, τ p + 1] (for τ integer) either completely into [(τ − 1) · p, τ p] or into [τ p, (τ + 1) · p]. We claim that by doing so we increase the number of machines by at most m, which we show for each τ in the following. Consider any critical job j ′ whose feasible time window intersects with P at point τ p. We observe that in any feasible solution, and hence in the solution S, j ′ is being processed all the time during [τ p − 1, τ p + 1]. We let yc be the number of these jobs. Similarly, we let yc′ be the number of those critical jobs that intersect with P at (τ + 1) · p. 15 Consider non-critical jobs. Let ys be the number of non-critical jobs that are completely scheduled in [τ p, (τ + 1) · p] in S. Let yl be the number of non-critical jobs whose feasible time windows contain [τ p, (τ + 1) · p] and which are processed within [τ p, τ p + 1] in S but are not completely scheduled in [τ p, (τ + 1) · p]. We know that ys + yc + yl ≤ m(J). Similarly, let yr be the number of non-critical jobs whose feasible time windows contain [τ p, (τ +1)·p] and which are processed within [(τ + 1) · p, (τ + 1) · p − 1] in S but are not completely scheduled in [τ p, (τ + 1) · p]. We have ys + yc′ + yr ≤ m(J). Now after we alter the solution S, the maximum load during [τ p, (τ + 1) · p] is at most yc + yc′ + ys + yl + yr ≤ 2m(J). We observe that, in a schedule that satisfies the above lemma, all non-critical jobs could actually be viewed as unit-size jobs. The following lemma can be proved via a simple exchange argument as in [13]. Lemma 10. If there exists a feasible schedule for unit-size jobs that uses µ machines at time [t, t + 1], then applying EDF to schedule these jobs with µ machines also returns a feasible solution. We are now ready to prove the theorem. Theorem 11. For equal processing times, there exists a 4-competitive algorithm for non-preemptive semi-online machine minimization. Proof. Consider the algorithm defined above. Using Lemma 9 and 10, we get that EDF for noncritical jobs requires at most 2m machines. Furthermore, Lemma 9 also implies that 2m machines suffice to schedule the critical jobs via EarlyFit. Thus, we need at most 4m machines to schedule the whole instance. Using the Double as a black box (Theorem 1) for non-critical jobs, we directly obtain the following result. Theorem 12. For equal processing times, there exists a 10-competitive algorithm for nonpreemptive online machine minimization. Remark. Lemma 9 actually implies a 4-approximation algorithm for the offline scheduling problem, in which the instance is known in advance and the goal is to minimize the number of machines so as to schedule each job in a feasible way. Theorem 13. There exists a 4-approximation algorithm for non-preemptive offline machine minimization when the processing times of all jobs are equal. Proof. Let m be the (unknown) optimum value. We schedule critical jobs immediately when they are released. This requires at most 2m machines by Lemma 9. On separate machines we schedule non-critical jobs, and after rounding they are viewed as unit-size jobs which could be scheduled feasibly on additional 2m machines according to Lemma 9. In [13] an optimum algorithm is presented for the offline problem of scheduling unit size jobs, and by applying this algorithm we directly get a feasible schedule for non-critical jobs on at most 2m machines. Thus, the overall approximation ratio is 3. 16 5 Uniform deadlines Consider the special case of (semi-)online machine minimization with a uniform deadline, i.e., every job j ∈ J has the same deadline dj = d. 5.1 Preemptive Scheduling First look at the special case of preemptive semi-online deadline scheduling in which every job j ∈ J has the same deadline dj = d. We prove that running LLF with m machines yields a feasible solution and thus LLF is 1-competitive. Theorem 14. On instances with a uniform deadline, LLF is 1-competitive for preemptive semionline machine minimization. Proof. We prove via an exchange argument. Let SOPT be the feasible offline schedule that uses m machines, and SLLF be the schedule produced by LLF (and in SLLF some jobs may miss their deadlines). We show that we can inductively alter SOPT to SLLF and thereby maintain feasibility. To this end, suppose SOPT and SLLF coincide during [0, t] for t ≥ 0. Let j be any job which is chosen to be scheduled in SLLF during [t, t + 1] but preempted in SOPT . If there is still a free machine in SOPT , we can simply use one of them to schedule j. Otherwise every machine is occupied and there exists some j ′ so that during [t, t + 1] job j ′ is processed in SOPT but not in SLLF . Recall that in SLLF job j ′ is not processed in favor of job j. Thus their laxities satisfy ℓj ′ (t) ≤ ℓj (t), or equivalently, pj ′ (t) ≥ pj (t). Since in SOPT job j ′ is chosen to be scheduled in [t, t + 1] while job j is preempted, it follows that during [t + 1, d] in SOPT , there must exist some time t′ such that job j is scheduled, while job j ′ is not scheduled (either preempted or finished). We now alter SOPT by swapping the unit of j ′ processed during [t, t + 1] with the unit of j processed during [t′ , t′ + 1]. By doing so, the resulting schedule is still feasible. We conclude this subsection with the following result obtained using Theorem 1. Theorem 15. On instances with a uniform deadline, there is a 4-competitive algorithm for preemptive online machine minimization. 5.2 Non-preemptive Scheduling Consider non-preemptive semi-online machine minimization with a uniform deadline. Recall the definition of α-tight and α-loose jobs. Since dj = d in this special case, a job is α-tight if pj > α(d − rj ), and α-loose otherwise. We give a 5.25-competitive algorithm. Algorithm: We schedule (α-)tight and loose jobs separately. For tight jobs, we use EarlyFit, that is, schedule each job immediately when they are released. For loose jobs, we apply EDF with m/(1 − α)2 machines. Remark. Since jobs have the same deadline, EDF actually does not distinguish among jobs and thus represents any busy algorithm. Lemma 11. EarlyFit is a ⌈1/α⌉-competitive algorithm for (semi-)online machine minimization. Proof. Let k = ⌈1/α⌉ for simplicity. Then for any tight job j we have pj > 1/k · (d − rj ). Consider the solution produced by EarlyFit on tight jobs and assume it uses m′ machines. There exists some time t such that wEarlyFit (t) = m′ . Let S be this set of these m′ jobs processed at t. We claim that 17 any k + 1 jobs from S could not be put on the same machine in any feasible solution, yielding that m ≤ m′ /k. To see why the claim is true, suppose that there exist k +1 jobs from S that can be scheduled on one machine, and let them be job 1 to job k+1 for simplicity. We know that rj ≤ t for 1 ≤ j ≤ k+1, i.e., we get pj > 1/k · (d − rj ) ≥ 1/k · (d − t). Now consider the schedule where the k + 1 jobs are scheduled on one machine, and assume w.l.o.g. that job 1 is scheduled at first. Recall that even if job 1 is scheduled immediately after its release, it will be processed during [t, t + 1]. Thus job 2 to job k + 1, which are scheduled after job 1, could not start before time t + 1. Hence, they will be scheduled in [t + 1, d]. However, pj > 1/k · (d − t), which is a contradiction. We can now prove the following theorem: Theorem 16. There is a 5.25-competitive algorithm for non-preemptive semi-online machine minimization with a uniform deadline. Proof. For loose jobs, we know that the scheduling problem with same deadline jobs is a special case of scheduling with agreeable deadlines jobs. Hence according to Lemma 3, EDF is a 1/(1 − α)2 competitive semi-online algorithm. Combining the above lemma and setting α = 1/3, we derive the 5.25-competitive algorithm. Using Double as a black box (Theorem 1), we directly derive a 21-competitive algorithm for non-preemptive online machine minimization with a uniform deadline. However, since EarlyFit is already an online algorithm, we only need to apply the doubling technique to transform EDF into an online algorithm. This yields a (4/(1 − α)2 + ⌈1/α⌉)-competitive algorithm. This performance guarantee is optimized for α = 1/4, yielding the following result. Theorem 17. There is a 11 19 -competitive algorithm for non-preemptive online machine minimization with a uniform deadline. 6 A Preemptive O(log n)-competitive Algorithm We give a preemptive O(log n)-competitive semi-online algorithm and apply Double (Theorem 1). Assume for the remainder of this section that the optimal number of machines is known. 6.1 Description We fix some parameter α ∈ (0, 1). At any time t, our algorithm maintains a partition of J(t) into safe and critical jobs (at t), which we define as Lt = Lt−1 ∪ {j ∈ J(t) | pj (t) ≤ α(dj − t)} (L−1 = ∅) and Tt = J(t) \ Lt , respectively. In other words, once a job gets α-loose at some time, it gets classified as safe job from then on and is only considered as critical if it has always been α-tight. Our algorithm does the following. Once a job S is classified as safe it is taken care of by EDF on separate machines. More formally, consider L = t {jt | j ∈ Lt \ Lt−1 } , where jt is the residue of job j at time t, i.e., it is a job with processing time pj (t) and time window [t, dj ]. We run EDF on L using m(L)/(1 − α)2 machines. The critical jobs (at time t) require a more sophisticated treatment on Θ(m log |J(t)|) machines, which we describe below. Consider the set of critical jobs Tt at time t. We partition Tt into ht · µt different subsets, each of which is processed by EDF on a separate machine. If t is not a release date, we simply take 18 t t+1 j1 time ℓj1 (t) pj1 (t) j2 j3 j4 j5 j6 j7 dj1 t t+1 time m1 j9 j5 m2 j6 j2 m3 j7 j3 m4 j4 j8 j1 j8 j9 Figure 1: Visualization of jobs in set Si ⊂ Tt and their (temporal) distribution over machines. Left: Time window of each job with its processing volume pushed to the right. Right: resulting job-to-machine assignment. Assume α to be small enough that none of the jobs gets safe before completion as well as µt = 4 (the machines are called m1 , . . . , m4 ). over the partition from t − 1 and remove all the jobs that have become safe since then. Otherwise, assume w.l.o.g. that Tt = {1, . . . , |Tt |} with dj ≥ dj+1 , for all j, and first partition Tt into ht many sets S1 , . . . , Sht . We consider the jobs in increasing order of indices and assign them to existing sets or create new ones, as follows. Let a(i) be the job with the earliest deadline in an existing set Si . Then a job j is added to an arbitrary set Si such that the (remaining) length of the feasible time window of j is smaller than the laxity of ji , i.e., dj − t ≤ ℓa(i) (t). If no such set exists, we create a new set and add j. Consider an arbitrary Si . By construction, we could feasibly schedule this set of jobs on a single machine using EDF. However, doing so may completely use up the laxity of some job in Si , causing problems when new jobs are released in the future. We want to keep a constant fraction β ∈ (0, 1) (independent of t) of the initial laxity ℓj (rj ) for each j ∈ Si by distributing them carefully over µt > 1 machines. Consider again Si = {j1 , . . . , j|Si | } and assume an increasing order by deadlines. We further partition Si into µt different subsets Si1 , . . . , Siµt by setting Sik = {ji | i ≡ k − 1 mod µt } and schedule each of them on a separate machine via EDF. By the right choice of µt , this reduces the decrease in laxity sufficiently. The procedure is visualized in Figure 1. We know from the preliminaries that EDF on L requires m(L)/(1 − α)2 machines. Hence the algorithm uses O(m(L) + µt · ht ) machines. In Subsection 6.4, we prove that we can choose µt = O(log |J(t)|) so that a constant β as above exists and that ht = O(m), m(L) = O(m). The key to prove that lies in Subsection 6.3 where we characterize the relation between a decrease in the laxity and increase in the number of machines. Hereby, we use the compact representation of the optimum value presented in Subsection 6.2. In summary we need O(m) + O(m) · O(log |J(t)|) = O(log n) · m machines. 6.2 Strong Density – A Compact Representation of the Optimum The key to the design and analysis of online algorithms are good lower bounds on the optimum value. The offline problem is known to be solvable optimally in polynomial time, e.g., by solving a linear program or a maximum flow problem [11]. However, these techniques do not provide a quantification of the change in the schedule and the required number of machines when the job set changes. We derive an exact estimate of the optimum number of machines as an expression of workload that must be processed during some (not necessarily consecutive) intervals. Let I denote a set of k pairwise disjoint intervals [ah , bh ], 1 ≤ h ≤ k. We define the length of I 19 to be |I| = P 1≤h≤k |bh − ah | and its union to be ∪I = S 1≤h≤k [ah , bh ]. Definition 1 (Strong density). Let I be as above and Qj = [rj , dj ] be the feasible time window of job j. The contribution Γj (I) of job j to I is the least processing volume of j that must be scheduled within ∪I in any feasible schedule, i.e., Γj (I) = max{0, |(∪I) ∩ Qj | − ℓj } = max{0, |(∪I) ∩ Qj | − dj + rj + pj )}. The strong density ρs is defined as maximum total contribution of all jobs over all interval sets: Pn j=1 Γj (I) . ρs = max |I| I⊆{[t,t+1]|0≤t<dmax } Our main result in this section is that ⌈ρs ⌉ is the exact value of an optimal solution. We give a combinatorial proof, but we also note that it follows from LP duality. Theorem 18. m = ⌈ρs ⌉. Pn Proof. It is easy to see that ⌈ρs ⌉ is a lower bound on m since the volume of j=1 Γj (I) must be P scheduled in ∪I of length |I|. This yields a lower bound of ⌈ j Γj (I)/|I|⌉ for any I. It remains to show that m ≤ ⌈ρs ⌉. Given a schedule, we denote by χh the number of time slots [t, t + 1] during which exactly h machines are occupied. For any feasible schedule that uses m machines, we obtain a vector χ = (χm , · · · , χ0 ). We define a lexicographical order < on these vectors: we have χ < χ′ if and only if there exists some h with χh < χ′h and χi = χ′i , for all i < h. We pick the schedule whose corresponding vector is the smallest with respect to <. We now construct a directed graph G = (V, A) based on the schedule we pick. Let V = {v0 , . . . , vdmax −1 } where vt represents the slot [t, t + 1]. Let φt be the number of machines occupied during [t, t + 1]. An arc from vi to vk exists iff φi ≥ φk and there exists some job j with [i, i + 1] ∪ [k, k + 1] ⊆ Qj whereas j is processed in [i, i + 1] but not in [k, k + 1]. Intuitively, an arc from vi to vk implies that one unit of the workload in [i, i + 1] could be carried to [k, k + 1]. We claim that in G there is no (directed) path which starts from some vi with φi = m, and ends at some vℓ with φℓ ≤ m − 2. Suppose there exists such a path, say (vi1 , . . . , viℓ ) with φi1 = m and φiℓ ≤ m − 2. Then we alter the schedule such that we move one unit of the workload from [is , is + 1] to [is+1 , is+1 + 1], for all s < ℓ. By doing so, φi1 decreased and φiℓ increased by 1 each. By φi1 = m and φiℓ ≤ m − 2, we get that χm decreases by 1, contradicting the choice of the schedule. Consider Vm = {vi | φi = m} and let P (Vm ) = {vi1 , . . . , viℓ } be the set of vertices reachable from Vm via a directed path (trivially, Vm ⊆ P (VP m )). The above P arguments imply that for any vi ∈ P (Vm ), it holds that φi ≥ m − 1. We claim that j Γj (I) = h φih for I = {[ih , ih + 1]|1 ≤ h ≤ ℓ}. Note there is no arc going out from P (Vm ) (otherwise the endpoint of the arc is also reachable and would have been included in P (Vm )), i.e., we cannot move out any workload fromP∪I, meaning that the contribution of all jobs to I is included in the current workload in ∪I, i.e., h φih . Thus, P P h φih h φih = . ρs ≥ |I| |P (Vm )| Notice that φih is either m or m − 1, and among them there is at least one of value m, thus the right-hand side is strictly larger than m − 1, which implies that ⌈ρs ⌉ ≥ m. 20 6.3 The Power of Laxity Let J be an arbitrary instance and β ∈ (0, 1) be rational. We analyze the influence that the decrease in the laxity of each job by a factor of β has on the optimal number of machines. To this end, let Jβ = {jβ | j ∈ J} be the modification of J where we increase the processing time of each job by a (1 − β)-fraction of its initial laxity, i.e., [rjβ , djβ ] = [rj , dj ] and pjβ = pj + (1 − β)(dj − rj − pj ) (or equivalently ℓjβ = β · ℓj ). Using a standard scaling argument, we may assume w.l.o.g. that for a fixed β all considered parameters are integral. Obviously, we have m(Jβ ) ≥ m(J). In the following, we show m(Jβ ) ≤ O(1/β) · m(J) for instances J only consisting of sufficiently tight jobs. Theorem 19. For every J consisting only of (1/2)-tight jobs and β ∈ (0, 1), it holds that m(Jβ ) ≤ 4 · m(J). β In fact, we even show a slightly stronger but less natural result. More specifically, we split each job jβ ∈ Jβ into two subjobs: the left part of jβ , denoted jβ⊳ , and the right part of j, denoted jβ⊲ , where     β · ℓj , pjβ⊳ = (1 − β) · ℓj [rjβ⊳ , djβ⊳ ] = rj , rj + 1 − 2     β ⊲ ⊲ and [rjβ , djβ ] = rj + 1 − · ℓj , dj , pjβ⊲ = pj , 2 i.e., we split the former feasible time window at rj + (1 − β/2) · ℓj and distribute pjβ over both emerging jobs in such a way that the right part has the processing time of the original job j. The sets containing all of these subjobs are Jβ⊳ = {jβ⊳ | j ∈ Jβ } and Jβ⊲ = {jβ⊲ | j ∈ Jβ }, respectively. In the following, we show Theorem 19 even for Jβ⊳ ∪ Jβ⊲ instead of Jβ . This implies, as can be easily seen, the statement for Jβ . In the proof, we define two more jobs based on j and γ ∈ (0, 1), namely the γ-right-shortened and the γ-left-shortened variant of j, denoted j ←γ and j γ→ and contained in the sets J ←γ and J γ→ , respectively. We define [rj ←γ , dj ←γ ] = [rj , dj − (1 − γ) · ℓj ], pj ←γ = pj and [rj γ→ , dj γ→ ] = [rj + (1 − γ) · ℓj , dj ], pj γ→ = pj , which means that we drop an amount of (1 − γ) · ℓj from either side of the feasible time window while keeping the processing time. We then show the following lemma. Lemma 12. For every J and γ ∈ (0, 1), it holds that m(J ←γ ) ≤ 1 1 · m(J) and m(J γ→ ) ≤ · m(J). γ γ Proof. We representatively show the statement for J γ→ ; the argumentation for J ←γ is analogous. According to Theorem 18, there exists a set of k pairwise disjoint intervals I such that m(J γ→ ) = X Γj γ→ (I) j γ→ |I| . W.l.o.g, we assume that I = {[ah , bh ] | 1 ≤ h ≤ k} with Ih where ah < ah+1 (hence, bh < bh+1 ), for all h. To derive the relationship between m(J γ→ ) and m(J), we expand I into a set of element-wise 21 j ←γ rj j γ→ rj dj shorten right shorten left ℓj (t) j dj pj (t) rj drop laxity strictly harder for β = 2γ dj identical for β = 2γ jβ split ⊳ jβ ⊲ jβ rj rj dj dj Figure 2: The different types of jobs defined for the proof of Theorem 19 and their relations. We let γ = β/2 = 1/4 and pj = 2 · (dj − rj )/5 larger intervals ex(I) such that |I| ≥ | ex(I)|/γ. We show for each job j that Γj (ex(I)) ≥ Γj γ→ (I) and thus the lemma follows. The expanding works as follows. Given I as above, we expand each of the intervals [ah , bh ] to [a′h , bh ] with a′h ≤ ah the following way. We start at the rightmost interval Ik and try to set a′k = bk − (bk − ak )/γ for Ik′ . If this would, however, produce an overlap between Ik′ and Ik−1 , we set a′k = bk−1 , δk = bk−1 − (bk − (bk − ak )/γ) and try to additionally expand Ik−1 by δk instead. After that, we continue this procedure to the left but never expand an interval into negative time. More formally, we let b0 = δk+1 = 0 and set for all h       bh − ah bh − ah ′ + δh−1 and δh = max 0, bh−1 − bh − ( + δh−1 ) . ah = max bh−1 , bh − γ γ The following two facts can be easily observed. Observation 2. Consider I as above. One of the following statements is true: (i) We have ∪ ex(I) = [0, bk ] and |I| ≥ | ex(I)|/γ. h i (ii) We have ∪ ex(I) ⊆ a1 − |I|(1−γ) , b and |I| = | ex(I)|/γ. k γ Observation 3. If ∪I ⊆ ∪I ′ , then ∪ ex(I) ⊆ ∪ ex(I ′ ). We now consider any job j γ→ with Γj γ→ (I) > 0 and claim that Γj (ex(I)) ≥ Γj γ→ (I). First plug in the definition of contribution. We get Γj (ex(I)) = max{0, |(∪ ex(I)) ∩ Qj | − ℓj } and Γj γ→ (I) = max{0, |(∪I) ∩ Qj γ→ | − ℓj ′ } = max{0, |(∪I) ∩ Qj γ→ | − γℓj }. It thus suffices to prove that |(∪ ex(I)) ∩ Qj | − (1 − γ) · ℓj ≥ |(∪I) ∩ Qj γ→ |. Let I ′ = {I ∩ Qj γ→ | I ∈ I} where we let a′ be the leftmost point of it and b′ be the rightmost one. By Observation 3, it follows that ∪ ex(I ′ ) ⊆ ∪ ex(I), i.e., we can restrict to proving |(∪ ex(I ′ )) ∩ Qj | − (1 − γ) · ℓj ≥ |I ′ |. According to Observation 2, there are two possibilities. Case 1. We have ∪ ex(I ′ ) = [0, b′ ]. Given the fact that Qj = Qj γ→ ∪ [rj , rj + (1 − γ) · ℓj ] and rj < b′ , it follows that |(∪ ex(I ′ )) ∩ Qj | ≥ |I ′ | + (1 − γ) · ℓj . 22 Case 2. It holds that ex(I ′ ) takes up a length of |I ′ |/γ in the interval   |I ′ |(1 − γ) ′ ′′ ′ ′ ,b . [a , b ] = a − γ Hence for any x ≥ 0, it takes up a length of at least |I ′ |/γ − x in the interval [a′′ + x, b′ ]. Using Γj γ→ (I) = Γj γ→ (I ′ ) > 0, we get |I ′ | > ℓj γ→ = γℓj . Thus, if we let x = (|I ′ | − γℓj )(1 − γ)/γ, we get that ex(I ′ ) takes up a length of at least |I ′ |+(1−γ)·ℓj in the interval [a′′ +x, b′ ] = [a′ +(1−γ)·ℓj , b′ ]. Since [a′ + (1 − γ) · ℓj , b′ ] ⊆ Qj , we have |(∪ ex(I ′ )) ∩ Qj | ≥ |I ′ | + (1 − γ) · ℓj , which completes the proof. Proof of Theorem 19. We show that m(Jβ⊳ ∪ Jβ⊲ ) ≤ 4 · m(J)/β or, more specifically, that m(Jβ⊳ ) = m(Jβ⊲ ) = 2 · m(J)/β. For the first part, compare the two instances Jβ⊳ and J ←β/2 . We observe that [rjβ⊳ , djβ⊳ ] ⊆ [rj ←β/2 , dj ←β/2 ] and ℓjβ⊳ = ℓj ←β/2 , for all j ∈ J, where we use for the first part that j is (1/2)-tight. This implies that a schedule of J ←β/2 on m′ machines can be easily transformed into a schedule of Jβ⊳ on m′ machines. Hence, we get that m(Jβ⊳ ) ≤ m(J ←β/2 ) and the claim follows by Lemma 12. For the second part, we simply observe that Jβ⊲ = J β/2→ and apply Lemma 12 again. 6.4 Analysis For the sake of simplicity, we choose α ∈ (0, 1/2] such that 1/α is integral. We now analyze the performance of our algorithm. The goal of this subsection is proving the following theorem. Theorem 20. Our algorithm is an O(log n)-competitive algorithm for the machine minimization problem. S Recall that we apply EDF to schedule the safe jobs L = t {jt | j ∈ Lt \ Lt−1 }. Using Theorem 2, m(L)/(1 − α)2 = O(m(L)) machines are suffice to feasibly schedule all the safe jobs. Meanwhile at any time [t, t + 1], we partition Tt into ht subsets S1 , . . . , Sht and schedule µt jobs of each subset on a separate set of machines. We first prove that, if we choose a certain µt = O(log |J(t)|), the laxity of each job in Tt never drops below a constant fraction of its original laxity. This implies that our algorithm never misses a critical job. Hence our algorithm does not miss any job. Lemma 13. We can choose µt = O(log |J(t)|) such that at any time t and for any j ∈ Tt , ℓj (t) ≥ βℓj where β = 2 − π 2 /6 ∈ (0, 1). Proof. Let t′ ≤ t be an arbitrary time when the partition of Tt′ into the sets S1 , . . . , Sht′ is recomputed. Let Si ∋ j and w.l.o.g. Si = {1, . . . , |Si |} where dj ′ ≥ dj ′ +1 , for all j ′ . By the way the partition is constructed, we further have dj ′ +1 − t ≤ ℓj ′ (t′ ). Now let j ⋆ = j + µt′ and notice that, unless the partition is recomputed, the execution of j is only blocked by other jobs for at most dj ⋆ − t′ (if j ⋆ does not exist, j is immediately executed). Since every job in Tt′ is α-tight at t′ , this however means that the execution of j is only delayed by (1 − α)µt′ · ℓj (t′ ) ≤ (1 − α)µt′ · ℓj . Note that we can choose µt′ = O(log |J(t′ )|) in such a way that (1 − α)µt′ · ℓj ≤ ℓj /|J(t′ )|2 . To get the 23 total time j is at most delayed by, we have to sum over all such t′ . Recall that at least one job is released at any such time t′ , hence |J(t′ )| ≥ |J(t′ − 1)| + 1 and we have: |J(t)| ℓj (t) ≥ ℓj − X ℓj ≥ ℓj − (π 2 /6 − 1) · ℓj = (2 − π 2 /6) · ℓj . i2 i=2 Before proving the main theorem, we need an additional bound on ht . To this end, let T̂t = {jt | j ∈ Tt } be the set of residues of Tt at t, i.e., the jobs in Tt with remaining processing times and time windows. Lemma 14. At all times t, it holds that  2 ht ≤ 1 + 2 + α  · m(T̂t ). W.l.o.g., we let T̂t = {1, . . . , |T̂t |} where dj ≥ dj+1 , for all j. We first prove the following auxiliary lemma: Lemma 15. For any j and j ′ = j + 2m(T̂t )/α, we have dj ′ − t ≤ (dj − t)/2. Proof. Suppose there exists some j such that dj+h − t > (dj − t)/2 holds for any h with 0 ≤ h ≤ 2m(Tt )/α. Given that every job in Tt is α-tight at t, we get pj+h > α/2 · (dj − t). Thus, the total workload that has to be finished in the interval [t, dj ] is larger than α/2 · (dj − t) · 2m(T̂t )/α = (dj − t) · m(T̂t ), which contradicts the fact that m(T̂t ) machines are enough to accommodate T̂t . Proof of Lemma 14. Recall the construction of the different Si and consider the state of S1 , . . . , Sht −1 when Sht is opened. Then there exists some job j which could not be added into any of the subset S1 to Sht −1 . As before, we let λi be the earliest-deadline job from Si . Obviously job λi is added to Si before we consider job j, λi < j. According to Lemma 15, there are at least ht − 1 − 2 · m(T̂t )/α jobs among λ1 , . . . , λht −1 whose feasible time window has a length at least 2(dj − t), and has a remaining laxity no more than dj − t. Thus if we consider the interval [t, t+2(dj −t)], each of the ht −1−2·m(Tˆt )/α contribute at least a processing time of dj −t, implying that the workload that has to be finished in this interval is at least (ht − 1 − 2 · m(Tˆt )/α)(dj − t). On the other hand, as m(T̂t ) machines are enough to accommodate all the jobs, the workload processed during [t, t+2(dj −t)] is at most m(T̂t )·2(dj −t). Hence (ht −1−2·m(Tˆt )/α)(dj −t) ≤ m(T̂t )·2(dj −t), which implies the lemma. We are ready to prove the main theorem of this section: Proof of Theorem 20. Recall that the number of machines used by our algorithm is O(m(L)+ht ·µt ). Using Lemma 13, it only remains to bound m(L) and ht . We set β = 2 − π 2 /6 ∈ (0, 1). We first show ht ≤ 1 + (2 + 2/α) · 4m/β = O(m) for all t. According to Lemma 14, it suffices to prove that m(T̂t ) ≤ 4m/β. By Lemma 13, we know that for any job j, we have ℓj (t) ≥ βℓj . Consider the instance Jβ as defined in Subsection 6.3. Any feasible schedule of Jβ implies a feasible schedule of T̂t , i.e., we get m(T̂t ) ≤ m(Jβ ). Theorem 19 implies that m(Jβ ) ≤ 4m/β and the claim follows. Moreover, we show m(L) ≤ 4m/β = O(m). Consider any job jt ∈ L. If job j is released at time t, then ℓj (t) = ℓj . Otherwise we have ℓj (t − 1) ≥ βℓj according to Lemma 13. As j is α-tight at t − 1 and becomes α-loose at t, it follows that j is processed in [t − 1, t], implying that ℓj (t) = ℓj (t − 1) ≥ βℓj . Thus it holds that ℓj (t) ≥ βℓj . As a consequence, any feasible schedule of Jβ implies a feasible schedule of L, implying that m(L) ≤ m(Jβ ) ≤ 4m/β by Theorem 19. 24 7 Lower Bounds 7.1 Lower bound for LLF Phillips et al. [17] showed that the competitive ratio of LLF for (semi-)online machine minimization is not constant. We extend their results by showing that LLF requires Ω(n1/3 ) machines. Theorem 21. There exists an instance of n jobs with a feasible schedule on m machines for which LLF requires Ω(n1/3 ) machines. Proof. Let m be even. For any ĉ > 1, we give an instance at which LLF using ĉm = cm/2 machines fails. P Towards ithis, consider the integer sequence (x0 , x1 , x2 , . . . ) with x0 large enough and xr = x0 ∞ ≥ 1. Let Gt (t, r) be the set (more tight) jobs i=r+2 (1/c) , for all rP P∞of m/2 identical ∞ i i with feasible time window [t, t + x0 i=r (1/c) ] and laxity x0 i=r+1 (1/c) . Moreover, let Gl (t, xr ) be the set of cm/2 identical (more loose) jobs with feasbile time window [t, t + cxr ] and processing time xr . We construct the instance in k rounds (where k is yet to be specified) as follows. • Round 1. From time 0 to time x0 , we release Gt (0, 0) and Gl (t, x1 ) for t = icx1 where i = 0, 1, · · · , x0 /(cx1 )−1. It can be easily verified that LLF will always preempt jobs in Gt (0, 0) in favor of jobs in Gl (t, x1 ). Thus at time x0 , each job in Gt (0, 0) is preempted for exactly x1 · x0 /(cx1 ) = x0 /c time units, i.e., by time x0 there are still m/2 jobs in GtP (0, x0 ), each i having a remaining processing time of x0 /c to be scheduled within [x0 , x0 + x0 ∞ i=1 (1/c) ]. However, the optimum solution could finish all the jobs released so far by time x0 . Pr−2 • Round r > 1. Carry on the above procedure. Suppose at time x0 i=0 (1/c)i the optimum solution could finish all the jobs released so far while for LLF there are still (r −P1) · m/2 jobs,P each having a remaining processing time x0 /cr−1 to be scheduled within P Pr−1 r−2 r−2 ∞ i i i x0 i=0 (1/c)i , we [x0 i=0 (1/c)P , x0 i=0 (1/c) ]. Then from time x0 i=0 (1/c) Pr−2 to time r−2 i i release Gt (x0 i=0 (1/c) , r − 1) and Gl (t, xr ) for t =Px0 i=0 (1/c) + j · cxr where j = r−2 i there are in total (r)·m/2 0, 1, · · · , x0 /(cr xr ). It can be easily seen that at time x0 i=0 (1/c)P P r−2 i jobs having a processing time x0 /cr−1 to be scheduled within [x0 i=0 (1/c)i , x0 ∞ i=0 (1/c) ]. Each of these jobs will be preempted in favor of jobs in Gl (t, xr ). Thus until time Pr−2 x0 i=0 (1/c)i , it is preempted for xr · x0 /(cr xr ) = x0 /cr time units. This implies thatPthere are rm/2 having a processing time x0 /cr to be scheduled within P∞ jobs, each r−1 i i [x0 i=0 (1/c) , x0 i=0 (1/c) ]. However, the optimum solution could finish all the jobs released so far by time xr . We estimate the number of jobs released at each round by m + cm · x0 /(ck+2 xk+2 ) = c(c − 1)m + m = O(c2 m) = O(ĉ2 m). Thus, until round k we release in total O(kĉ2 m) jobs. It is easy to see that LLF requires O(km) machines for the remaining jobs and ĉm machines will be insufficient if we choose some k = O(ĉ). Thus it suffices to choose some n = O(ĉ3 ) for the lower bound, i.e., LLF requires Ω(cm) = Ω(n1/3 ) many machines. 7.2 Lower bound for Deadline-Ordered Algorithms Consider deadline-ordered algorithms that schedule jobs using only the relative order of jobs instead of their actual values. EDF belongs to this class of algorithms. Lam and To [15] derived a lower bound on the speed that is necessary to feasibly schedule jobs on m machines. We modify their instance and argumentation to give the following lower bound on the number of unit-speed machines. 25 Theorem 22. There are instances of n jobs with a feasible schedule on m machines for which any deadline-ordered algorithm requires at least n − 1 machines. Proof. We define a collection of instances with identical job sets that all can be feasibly scheduled on m machines. The only difference in the instances are the deadlines but the relative order is again the same. Thus, a deadline-ordered algorithm cannot distinguish the instances and must produce the same schedule for all of them. We show that this property enforces that (nearly) each job must run on its own machine. For each k ∈ {1, 2, . . . , n − m} we define the job set Jk as follows: k  m =: d¯k . For 1 ≤ j ≤ m : rj = 0, pj = 1, dj = m−1  j−m m For m + 1 ≤ j ≤ m + k : rj = 0, pj = , dj = d¯k . m−1  j−m n−m  m m ¯ , dj = =: d. For m + k + 1 ≤ j ≤ n : rj = 0, pj = m−1 m−1 For every instance Jk , k ∈ {1, 2, . . . , n−m}, there is a feasible solution on m machines. Schedule the first m+k jobs in order of their indices one after the other filling a machine up to the deadline d¯k before opening the next machine. Since every job has a processing time less than d¯k , no job will run simultaneously on more than one machine. The total processing volume is  k+1 m  k   k m+k ℓ −1 X X m−1 m m  =m+  = m · d¯k , −1=m pj = m + m m−1 m − 1 −1 j=1 ℓ=1 m−1 and thus, all jobs are feasibly scheduled on m machines. The remaining jobs are scheduled by the ¯ With a similar argumentation as above, this is a feasible same procedure in the interval [d¯k , d]. schedule. In particular, the total processing volume is  n−m  k ! n n−m−k X X  m ℓ+k m m =m − = m · (d¯ − d¯k ). pj = m−1 m−1 m−1 j=m+k+1 ℓ=1 We now show that any fixed schedule must use n − 1 machines to guarantee a feasible solution for all instances Jk . With the argumentation above this implies the lower bound for any deadlineordered algorithm. W.l.o.g. we may assume that the order of job indices is the order of deadlines. We could enforce this explicitly by adding a small value, but omit it for the sake of presentation. Any deadline-ordered solution must complete the first m + k jobs by time d¯k to be feasible for Jk for k ∈ {1, . . . , n − m}. Since in any instance Jk the largest among those jobs has processing time pm+k = d¯k , each job with index m + k must receive its exclusive machine. That means, we need n − m machines for jobs {m + 1, m + 2, . . . , n}. The remaining m jobs with unit processing m which requires m − 1 machines. In total, time must finish in instance J1 by time d¯1 = m−1 a deadline-ordered algorithm needs n − 1 machines whereas optimal solutions with m machines exist. Notice that this very fatal lower bound is achieved already by instances in which all jobs are released at the same time. Thus, it is not the lack of information about further job arrivals but the lack of precise deadline information that ruins the performance. 26 8 Concluding Remarks We contribute new algorithmic results for a fundamental online resource minimization problem. We give the first constant competitive algorithms for a major subclass in which jobs have agreeable deadlines, and also improve on upper bounds for the general problem. It remains as a major open question if the general preemptive problem admits a constant competitive ratio. We believe that some of our techniques may be useful for the closely related online throughput maximization problem, where we relax the requirement that all jobs must be scheduled (and fix a number of machines). It would also be interesting to quantify the tradeoff between the number of machines and the guaranteed throughput. Acknowledgment We thank Naveen Garg for discussions on deadline-ordered algorithms and his contribution to the lower bound in Theorem 22. Moreover, we thank Benjamin Müller for interesting discussions at an early stage of the project. As part of his Master’s thesis he contributed to Thm. 1 and part of Thm. 10. References [1] S. Albers, F. Müller, and S. Schmelzer. Speed scaling on parallel processors. Algorithmica, 68(2):404–425, 2014. [2] S. Anand, N. Garg, and N. Megow. Meeting deadlines: How much speed suffices? In Proceedings of the 38th International Colloquium on Automata, Languages and Programming (ICALP 2011), volume 6755 of LNCS, pages 232–243. Springer, 2011. [3] E. Angel, E. Bampis, and V. Chau. Low complexity scheduling algorithms minimizing the energy for tasks with agreeable deadlines. Discrete Applied Mathematics, 175:1–10, 2014. [4] N. Bansal, T. Kimbrel, and K. Pruhs. Speed scaling to manage energy and temperature. J. ACM, 54(1), 2007. [5] A. Borodin and R. El-Yaniv. Online Computation and Competitive Analysis. Cambridge University Press, 1998. [6] M. Chrobak and C. Kenyon-Mathieu. SIGACT news online algorithms column 10: Competitiveness via doubling. SIGACT News, 37(4):115–126, 2006. [7] J. Chuzhoy, S. Guha, S. Khanna, and J. Naor. Machine minimization for scheduling jobs with interval constraints. In Proceedings of the 45th Symposium on Foundations of Computer Science (FOCS 2004), pages 81–90. IEEE Computer Society, 2004. [8] M. Cieliebak, T. Erlebach, F. Hennecke, B. Weber, and P. Widmayer. Scheduling with release times and deadlines on a minimum number of machines. In Proceedings of the 3rd IFIP International Conference on Theoretical Computer Science (TCS 2004), pages 217–230, 2004. [9] N. R. Devanur, K. Makarychev, D. Panigrahi, and G. Yaroslavtsev. Online algorithms for machine minimization. CoRR, abs/1403.0486, 2014. 27 [10] M. R. Garey and D. S. Johnson. Two-processor scheduling with start-times and deadlines. SIAM J. Comput., 6(3):416–426, 1977. [11] W. A. Horn. Some simple scheduling algorithms. 21(1):177–185, 1974. Naval Research Logistics Quarterly, [12] L. Jeż, F. Li, J. Sethuraman, and C. Stein. Online scheduling of packets with agreeable deadlines. ACM Trans. Algorithms, 9(1):5:1–5:11, 2012. [13] M.-J. Kao, J.-J. Chen, I. Rutter, and D. Wagner. Competitive design and analysis for machineminimizing job scheduling problem. In Proc. of the 23rd International Symposium (ISAAC 2012), volume 7676 of LNCS, pages 75–84, 2012. [14] A. J. Kleywegt, V. S. Nori, M. W. P. Savelsbergh, and C. A. Tovey. Online resource minimization. In R. E. Tarjan and T. Warnow, editors, Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 576–585. ACM/SIAM, 1999. [15] T. W. Lam and K.-K. To. Trade-offs between speed and processor in hard-deadline scheduling. In Proc. of the 10th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 623–632, 1999. [16] C. A. Phillips, C. Stein, E. Torng, and J. Wein. Optimal time-critical scheduling via resource augmentation. In Proceedings of the 29th Annual ACM Symposium on the Theory of Computing (STOC), pages 140–149. ACM, 1997. [17] C. A. Phillips, C. Stein, E. Torng, and J. Wein. Optimal time-critical scheduling via resource augmentation. Algorithmica, 32(2):163–200, 2002. [18] B. Saha. Renting a cloud. In Proc. of the IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2013), volume 24 of LIPIcs, pages 437–448, 2013. [19] Y. Shi and D. Ye. Online bin packing with arbitrary release times. Theor. Comput. Sci., 390(1):110–119, 2008. [20] G. Yu and G. Zhang. Scheduling with a minimum number of machines. Oper. Res. Lett., 37(2):97–101, 2009. 28
8cs.DS
A new algorithm for fast generalized DFTs∗ Chloe Ching-Yun Hsu Caltech Chris Umans† Caltech arXiv:1707.00349v3 [cs.DS] 30 Mar 2018 April 2, 2018 Abstract We give an new arithmetic algorithm to compute the generalized Discrete Fourier Transform (DFT) over finite groups G. The new algorithm uses O(|G|ω/2+o(1) ) operations to compute the generalized DFT over finite groups of Lie type, including the linear, orthogonal, and symplectic families and their variants, as well as all finite simple groups of Lie type. Here ω is the exponent of matrix multiplication, so the exponent ω/2 is optimal if ω = 2. Previously, “exponent one” algorithms were known for supersolvable groups and the symmetric and alternating groups. No exponent one algorithms were known, even under the assumption ω = 2, for families of linear groups of fixed dimension, and indeed the previous best-known algorithm for SL2 (Fq ) had exponent 4/3 despite being the focus of significant effort. We unconditionally achieve exponent at most 1.19 for this group, and exponent one if ω = 2. Our algorithm also yields an improved exponent for computing the generalized DFT over general finite groups G, which beats the longstanding √ previous best upper bound, for any ω. In particular, assuming ω = 2, we achieve exponent 2, while the previous best was 3/2. ∗ † A version of this paper appeared in SODA 2018 as [HU18]. Supported by NSF grant CCF-1423544 and a Simons Foundation Investigator grant. 1 Introduction Let G be a finite group and let Irr(G) denote a complete set of irreducible representations. Given an element of the group algebra c ∈ C[G], a generalized DFT is a linear transform that takes c to X M ρ(g). cg · g∈G ρ∈Irr(G) This is the fundamental linear operation that maps the standard basis for the group algebra C[G] to the Fourier basis of irreducible representations of group G. It has applications in data analysis [Roc97], as a component in other algorithms (including fast operations on polynomials and in the Cohn-Umans matrix multiplication algorithms), and as the basis for quantum algorithms for problems entailing a Hidden Subgroup Problem [MR97b]. As one varies the underlying group G, the generalized DFT is a rich source of structured linear maps, which one can hope to compute in nearly-linear time, generalizing the famous Cooley-Tukey FFT for cyclic groups of order 2k . We typically speak of the complexity of computing this map in the (non-uniform) arithmetic circuit model and do not concern ourselves with finding the irreducible representations. The trivial algorithm thus requires O(|G|2 ) operations. The best-known algorithm that works for general finite groups G achieves O(|G|1.5 ) operations1 assuming the exponent of matrix multiplication is two (see Section 2). For a number of special cases, “exponent 1” algorithms are known: for abelian groups, the symmetric and alternating groups [Cla89], and the so-called supersolvable groups [Bau91]. A group that has resisted such exponent 1 algorithms despite a significant amount of work is SL2 (Fq ), where the best known algorithm achieves O(|G|4/3 ) [LR92]. This group was described as a “particularly interesting and thorny special case” by Maslen, Rockmore, and Wolff in [MRW16a]. In this paper we obtain exponent one for SL2 (Fq ) under the assumption that ω = 2 (ω is the exponent of matrix multiplication). Using the current best upper bound ω < 2.3729 [LG14], we obtain exponent 1.19 for SL2 (Fq ) unconditionally, which improves the previous 4/3 exponent. Our new algorithm is quite general and leads to a broad array of new results: • we achieve exponent ω/2 for essentially all linear groups including the general, orthogonal, and symplectic groups, and their special and projective versions, and for all finite groups with a split (B, N )-pair; we work out the most common cases explicitly in this paper in Section 5. • we achieve exponent ω/2 for all finite simple groups (see Theorem 24). • we achieve an exponent bound for general groups G which beats the longstanding previous best upper bound, for any ω (see Theorem 26). To do this we prove a structural result about arbitrary finite groups (Theorem 25) that relies on the Classification Theorem, which √ may be of independent interest. In particular, assuming ω = 2, we achieve exponent 2, while the previous best was 3/2. The main idea. At its core, the seminal Beth-Clausen fast generalized DFT is a recursive algorithm that computes a DFT with respect to G by computing several DFTs with respect to H, a subgroup of G. Each of the [G : H] many H-DFTs is lifted to G and then summed together. See Corollary 4. A bottleneck in this algorithm comes from the final summation step, which in general costs [G : H]|G|. Since there are groups whose largest subgroup H has index at least |G|1/2 , exponent 3/2 is the best possible within this approach. Improvements have generally come from using specific knowledge of how the induced representations from H up to G break up; this can sometimes be used to circumvent the bottleneck summation. In the case 1 Note that exercise 13.16 in [BCS97] claims that the exponent 1.5 can be reduced to 1.44 but this seems to be an error, as discussed in Section 2. 1 Group G SL2 (Fq ) GLn (Fq ) PSp2n (Fq ) O2n+1 (Fq ) + O2n (Fq ), n ≥ 4 Upper bound e O(q|G|) e n |G|) O(q e 5n−3 |G|) O(q e 5n−3 |G|) O(q e 5n−6 |G|) O(q Reference Theorem 1.1 in [LR92] Theorem 4.3 in [MRW16b] Theorem 5.14 in [MR97a] Theorem 5.14 in [MR97a] Theorem 5.14 in [MR97a] Figure 1: Previously best known running times for the generalized DFT over various families of e notation hides lower order terms and the dependence on n. linear groups. In this table, the O(·) of supersolvable groups and the symmetric and alternating groups, this has yielded exponent one algorithms [Bau91, Cla89]. In the case of solvable groups, one can obtain exponent ω/2 [Bet84, CB93]. In this paper we devise a more general way to circumvent the bottleneck summation, which depends on the structure of the group rather than knowledge of the representation theory. Our new recursive step permits us to decompose G via two subgroups H and K, and recurse on H and K. See Theorem 12. One side-effect is an alternative proof of the ω/2 exponent for solvable groups that does not require knowledge of the representation theory of the group, in Section 4. Our reduction bears some similarity to the double coset algorithm of [MR00]; a key difference seems to be the use of fast matrix multiplication at an opportune time in the procedure. 1.1 Past and related work A good description of past work in this area can be found in Section 13.5 of [BCS97]. The first algorithm generalizing beyond the abelian case is due to Beth in 1984 [Bet84]; this algorithm is described in Section 2 in a form often credited jointly to Beth and Clausen. This algorithm was the best known for the general case of an arbitrary finite group prior to this work. Two other milestones are the O(|G| log |G|) algorithm for supersolvable groups due to Baum [Bau91], and the O(|G| log3 |G|) algorithm for the symmetric group due to Clausen [Cla89]. The latter algorithm was improved to O(|G| log 2 |G|) by Maslen [Mas98], and very recently to linear for the special case of Sn−k -invariant functions on Sn with n > 2k [CH17]. Wreath products were studied by Rockmore [Roc95] who obtained exponent one algorithms in certain cases. In the 1990s, Maslen, Rockmore and coauthors, developed the so-called “separation of variables” approach, which relies on non-trivial decompositions along chains of subgroups via Bratteli diagrams and (again) detailed knowledge of the representation theory of the underlying groups. There is a rather large body of literature on this approach and it has been applied to a wide variety of group algebras and more general algebraic objects. For a fuller description of this approach and the results obtained, the reader is referred to the surveys [MR97b, MR97a, Roc02], and the most recent paper in this line of work [MRW16a]. For the present paper, important results for comparison are the previous best known results for linear groups of various sorts. We gather them in Figure 1. Notice that for each fixed dimension n, these all represent exponent α algorithms for α > 1. Our methods give exponent ω/2 algorithms for all of these groups, which translates to (the optimal) exponent 1 if ω = 2. Using the current best upper bounds on ω our methods give concrete improvements in small dimension, in all cases; we explicitly highlight only the case of SL2 (Fq ) in this paper. 1.2 Notation and preliminaries Throughout this paper we will use the phrase 2 “G has a generalized DFT using O(|G|α+ǫ ) operations, for all ǫ > 0” where G is a finite group and α ≥ 1 is a real number. We mean by this that there are universal constants cǫ independent of the group G under consideration so that for each ǫ > 0, the operation count is at most cǫ |G|α+ǫ . Such an algorithm will be referred to as an “exponent α” algorithm. This comports with the precise definition of the exponent of matrix multiplication, ω: that there are universal constants bǫ for which n × n matrix multiplication can be performed using at most bǫ nω+ǫ operations, for each ǫ > 0. Indeed we will often report our algorithms’ operation counts in terms of ω. In such cases matrix multiplication is always used as a black box, so, for example, an operation count of O(|G|ω/2 ) should be interpreted to mean: if one uses a fast matrix multiplication algorithm with exponent α (which may range from 2 to 3), then the operation count is O(|G|α/2 ). In particular, in real implementations, one might well use standard matrix multiplication and plug in 3 for ω in the operation count bound. All logarithms are base 2. We use Irr(G) to denote the complete set of irreducible representations of G being used for the DFT at hand. In the presentation to follow, we assume the underlying field is C; however our algorithms work over any field Fpk whose characteristic p does not divide the order of the group, and for which k is sufficiently large for Fpk to represent a complete set of irreducibles. P A basic fact is that ρ∈Irr(G) dim(ρ)2 = |G|, which implies that for all ρ ∈ Irr(G), we have dim(ρ) ≤ |G|1/2 . An inequality that we use repeatedly is this one: Proposition 1. For any real number α > 2, we have X O(dim(ρ)α ) ≤ O(|G|α/2 ). ρ∈Irr(G) Proof. Set ρmax to be an irrep of largest dimension. We have X X dim(ρ)2 = O(dim(ρmax )α−2 |G|) ≤ O(|G|α/2 ), O(dim(ρ)α ) ≤ O(dim(ρmax )α−2 ) ρ∈Irr(G) ρ∈Irr(G) where the last inequality used the fact that dim(ρmax ) ≤ |G|1/2 . We also need Lev’s Theorem: Theorem 2 ([Lev92]). Every finite group G has a proper subgroup H of order at least |G|1/2 , unless G is cyclic of prime order. This is easily seen to be tight by considering the cyclic group of order p2 , for p prime. In a few key places, we utilize the Kronecker product (or tensor product) of two matrices A and B, and there our convention is to name the indices of A ⊗ B so that (A ⊗ B)[(i, i′ ), (j, j ′ )] = A[i, j]B[i′ , j ′ ]. 2 The single subgroup reduction In this section we describe the recursive generalized DFT attributed to Beth and Clausen (see [BCS97]). Given a subgroup H of a finite group G, this reduction computes a DFT with respect to G via DFTs with respect to H. Our presentation makes use of fast matrix multiplication where possible and so the running time will be expressed in terms of ω. A key definition is that of an H-adapted basis for the irreps of G. This is a basis in which the restriction of each irrep of G to H respects the direct sum decomposition into irreps of H. In concrete terms, this means that for each irrep ρ ∈ Irr(G), while for general g ∈ G, ρ(g) is a dim(ρ) × dim(ρ) matrix, for g ∈ H, ρ(g) is a block-diagonal matrix with block sizes coming from the set {dim(σ) : σ ∈ Irr(H)}. 3 Theorem 3. Let G be a finite group and let H be a subgroup. Then we can compute a DFT with respect to G and an H-adapted basis, at a cost of [G : H] many H-DFTs plus X O(dim(σ)ω+ǫ ) [G : H]|G| + [G : H]2 σ∈Irr(H) operations, for all ǫ > 0. Proof. Let g1 , g2 , . . . , gt be a system of distinct right coset representatives of H in G, so t = [G : H]. Let c be an element of C[G]. We can write ! t X (i) X X ch h g i c= cg g = i=1 g∈G for some elements c(i) = P (i) h∈H ch h  si = h∈H ∈ C[H]. By computing an H-DFT for each i, we obtain X M (i) ch h∈H σ(h). σ∈Irr(H) Let si be the lift of si in which we repeat each σ ∈ Irr(h) as many times as it occurs in the irreps of G. We notice that   t X X M M ρ(g) = ρ(gi ) . cg si ·  g∈G ρ∈Irr(G) i=1 ρ∈Irr(G) Moreover, since we are using an H-adapted basis, each of the t matrix multiplications is the product of a block-diagonal matrix having blocks whose dimensions are those of the irreps of H, with a block diagonal matrix having blocks whose dimensions are those of the irreps of G. If nσ,ρ denotes the number of occurences of σ ∈ Irr(H) in ρ ∈ Irr(G), the cost of performing this structured matrix multiplication is at most X X X X dim(ρ) nσ,ρ dim(ρ) O(dim(σ)ω−1+ǫ ) = nσ,ρ O(dim(σ)ω+ǫ ) dim(σ) ρ∈Irr(G) σ∈Irr(H) σ∈Irr(H) ρ∈Irr(G) X O(dim(σ)ω−1+ǫ ) dim(σ)[G : H] = σ∈Irr(H) = X O(dim(σ)ω+ǫ )[G : H] σ∈Irr(H) where the second-to-last equality used Frobenius reciprocity: nσ,ρ P also equals the number of times ρ occurs in the induction of σ from H up to G, and then ρ nσ,ρ dim(ρ) is easily seen to be the dimension of the induced representation, which is dim(σ)[G : H]. We have to do [G : H] many of these structured multiplications, and then sum them up. The summing costs [G : H]|G| many operations, since the block-diagonal matrices we are summing have, in general, |G| nonzeros. We note that this final sum, which costs |G|[G : H] operations, cannot be accelerated by fast matrix multiplication, and this appears to have been overlooked in the claim in [BCS97] that by using fast matrix multiplication together with Theorem 2 one can achieve an upper bound of O(|G|1.44 ) for all finite groups G. Indeed when |H| = |G|1/2 , which it may be in the worst case, the |G|[G : H] term by itself is at least |G|3/2 . Our “double subgroup reduction” can be seen as a means to avoid having to directly compute this bottleneck sum. At the expense of a slightly coarser upper bound we can remove the requirement of an H-adapted basis, which will simplify our use of Theorem 3 in recursive algorithms later. 4 Corollary 4. Let G be a finite group and let H be a subgroup. Then we can compute a DFT with respect to G at a cost of [G : H] many H-DFTs plus O([G : H]2 |H|ω/2+ǫ ) operations, for all ǫ > 0. Proof. Using Proposition 1 with α = ω + ǫ, the cost from the statement of Theorem 3 can be upper bounded by X dim(σ)ω+ǫ ≤ 2[G : H]2 |H|ω/2+ǫ . (1) [G : H]|G| + [G : H]2 σ∈Irr(H) Note that in Theorem 3 the DFT is with respect to an H-adapted basis. At a cost of X O(dim(ρ)ω+ǫ ) ≤ O(|G|ω/2+ǫ ) (2) ρ∈Irr(G) operations (again using Proposition 1 with α = ω + ǫ), we can change an arbitrary basis to an H-adapted basis, to which we apply Theorem 3, and then change back to the original basis. Both expression (1) and expression (2) are upper bounded by O([G : H]2 |H|ω/2+ǫ ). The single-subgroup reduction works best when the subgroup H is large. Lev’s Theorem (Theorem 2) guarantees a subgroup of size at least |G|1/2 . Using this, one obtains the following recursive algorithm, whose bound, using only that ω ≤ 3, matches Theorem 13.48 in the presentation in [BCS97]. Theorem 5. For every finite group G, there is an exponent 1 + ω/4 algorithm computing the DFT with respect to G. Proof. Fix G. We apply Corollary 4 recursively. If G is a p-group, then we apply Theorem 14 (actually we only need to do this when G is cyclic of prime order). If G is the trivial group, then the DFT is trivial as well. Otherwise, according to Theorem 2, there is a subgroup H of size at least |G|1/2 , to which we apply Corollary 4. Set δ = min{ǫ, 0.1}, and give names to some constants: • Let Bδ be the constant hidden in the [G : H]2 · O(|H|ω/2+δ ) notation of Corollary 4. • Let B be the constant hidden in the O(|G| log |G|) notation of Theorem 14. Let T (n) denote an upper bound on the operation count of this recursive algorithm for any group G of order n. For each fixed ǫ > 0, we will prove by induction on n that, for a universal constant Cǫ , ω T (n) ≤ Cǫ n1+ 4 +ǫ log2 n. This clearly holds for the base case of a p-group or the trivial group, provided Cǫ > B. When we apply Corollary 4 recursively, the cost is at most [G : H] · T (|H|) + [G : H]2 · Bδ |H|ω/2+δ , where |H| ≥ |G|1/2 . If we set γ such that |H| = |G|γ , and thus 1/2 ≤ γ ≤ 1, and apply the induction hypothesis, we obtain T (n) ≤ < ω Cǫ n1−γ nγ(1+ 4 +ǫ) log2 (n/2) + Bδ n2(1−γ) nγ(ω/2+δ) ω δ Cǫ n1+ω/4+ǫ (log n)(log n − 1) + Bδ n1+ 4 + 2 ω which is at most Cǫ n1+ 4 +ǫ log2 n as long as Cǫ ≥ Bδ . 5 3 The double subgroup reduction This section contains our main algorithmic result. Given two subgroups H, K of a finite group G, we show how to compute a DFT with respect to G, via DFTs with respect to H and K. We first show how to obtain an intermediate representation in terms of tensor products of the irreps of H and the irreps of K: Lemma 6. Let H and K be subgroups of G and let c be an element of C[G] supported on HK. Fix a way of writing g = hk for each g ∈ HK (this is unique iff H ∩ K = {1}). We can compute X M σ(h) ⊗ τ (k), cg g=hk∈HK σ∈Irr(H),τ ∈Irr(K) by performing |H| many K-DFTs and |K| many H-DFTs. Proof. We can write c= X cg g = g∈G for some elements c(h) = for each h ∈ H: P h∈H  (h) k∈K X X h· (h) ck k k∈K ! ck k ∈ C[K]. We perform |H| many K-DFTs to compute sh = X (h) ck k∈K M τ (k). τ ∈Irr(K) We use the notation sh [τ, u, v] to refer to entry (u, v) of component τ in the direct sum. Then we perform |K| many H-DFTs to compute for each τ ∈ Irr(K) and u, v ∈ [dim(τ )], X M σ(h). tτ,u,v = sh [τ, u, v] h∈H σ∈Irr(H) Note that tτ,u,v [σ, x, y] is the ((x, u), (y, v)) entry of so we have computed: X M chk h,k P (h) h,k ck σ(h)⊗τ (k) σ∈Irr(H),τ ∈Irr(K) (h) and note that ck = chk , σ(h) ⊗ τ (k) as promised. The following is an important (and known) general observation (see, e.g., Lemma 4.3.1 in [HJ91]): Lemma 7. If A is an n1 × n2 matrix, B is an n2 × n3 matrix, and C is an n3 × n4 matrix, then the product ABC can be computed by multiplying A ⊗ C T (which is an n1 n4 × n2 n3 matrix) by B viewed as an n2 n3 -vector. Proof. Observe that (ABC)[i1 , i4 ] = X A[i1 , i2 ]B[i2 , i3 ]C[i3 , i4 ] i2 ,i3 and ((A ⊗ C T ) · B)[(i1 , i4 )] = X i2 ,i3 (A ⊗ C T )[(i1 , i4 ), (i2 , i3 )]B[(i2 , i3 )] = 6 X i2 ,i3 A[i1 , i2 ]C[i3 , i4 ]B[i2 , i3 ]. This n1 n4 × n2 n3 -matrix-vector multiplication costs O(n1 n4 n2 n3 ) operations. More importantly, we have: Corollary 8. If A and C are as above, and square (so n1 = n2 and n3 = n4 ), and we have several n2 × n3 matrices, B1 , B2 , . . . , Bℓ , then we can compute ABi C for all i from A ⊗ C T , at a cost of O((n2 n3 )ω−1+ǫ · max{n2 n3 , ℓ}). operations, for all ǫ > 0. Proof. Set N = n1 n4 = n2 n3 . If ℓ ≤ N , then this can be accomplished with a single N × N matrix multiplication, at a cost of O(N ω+ǫ ) operations, by the definition of ω. If ℓ > N , then this can be accomplished with ⌈ℓ/N ⌉ many N × N matrix multiplications, at a cost of O(ℓ · N ω−1+ǫ ) operations. Now we show how to lift from the intermediate representation to the space of irreducibles of G. We need some notation. For σ ∈ Irr(H), τ ∈ Irr(K), ρ ∈ Irr(G), let nσ,ρ be the number of occurences of σ in the restriction of ρ to H, and let mτ,ρ be the number of occurences of τ in the restriction of ρ to K. Lemma 9. There is a linear map Y φG,H,K : σ∈Irr(H),τ ∈Irr(K) L 2 C(dim(σ) dim(τ )) → L Y Cdim(ρ) 2 ρ∈Irr(G) that maps σ∈Irr(H),τ ∈Irr(K) σ(h) ⊗ τ (k) to ρ∈Irr(G) ρ(hk) for all h ∈ H, k ∈ K. Map φG,H,K can be computed using      X X O (dim(σ) dim(τ ))ω−1+ǫ · max dim(σ) dim(τ ), nσ,ρ mτ,ρ    ρ∈IrrG σ∈Irr(H),τ ∈Irr(K) X O(dim(ρ)ω+ǫ ) + ρ∈Irr(G) operations, for all ǫ > 0. Proof. Let Irr∗ (H) be the multiset of irreducibles of H in the multiplicities that they occur in the restrictions to H of Irr(G), and let Irr∗ (K) be the multiset of irreducibles of K in the multiplicities that they occur in the restrictions to K of Irr(G). Let S be the change of basis matrix taking ⊕σ∈Irr∗ (H) σ to ⊕ρ∈Irr(G) ρ and let T be the change of basis matrix taking ⊕τ ∈Irr∗ (K) τ to ⊕ρ∈Irr(G) ρ. Then for each h ∈ H, k ∈ K, we have     M M M ρ(hk). σ(h) S −1 T  τ (k) T −1 = S σ∈Irr∗ (H) ρ∈Irr(G) τ ∈Irr∗ (K) Set M = S −1 T , and consider the expression    M  σ(h) M  σ∈Irr∗ (H) M τ ∈Irr∗ (K)  τ (k) . (3) Note that both M and the above product are block-diagonal matrices with blocks of dimension dim(ρ) as ρ runs through Irr(G). Now, for each ρ ∈ Irr(G), a given σ ∈ Irr(H) occurs nσ,ρ times and a given τ ∈ Irr(K) occurs mτ,ρ times; therefore we are computing σ(h)Bi τ (k) for p 7 P distinct sub-matrices Bi of M , where p = ρ∈Irr(G) nσ,ρ mτ,ρ . By Corollary 8, each such batch can be computed by taking a product of σ(h) ⊗ τ (k)T with a matrix whose columns are the Bi sub-matrices, viewed as vectors. This is linear in the entries of σ(h) ⊗ τ (k), and costs      X nσ,ρ mτ,ρ  O (dim(σ) dim(τ ))ω−1+ǫ · max dim(σ) dim(τ ),   ρ∈Irr(G) operations. Finally, we need to L multiply (3) by S on the left and T −1 on the right; both maps are linear in the entries of σ∈Irr(H),τ ∈Irr(K) σ(h) ⊗ τ (k), and as block-diagonal matrix P multiplications, both cost ρ∈Irr(G) O(dim(ρ)ω+ǫ ) operations. Now we use elementary facts from representation theory to bound the complexity estimate in Lemma 9 in terms of |H|, |K|, |G|. Lemma 10. For all finite groups G and subgroups H, K, the expression      X X O (dim(σ) dim(τ ))ω−1+ǫ · max dim(σ) dim(τ ), nσ,ρ mτ,ρ    ρ∈IrrG σ∈Irr(H),τ ∈Irr(K) X O(dim(ρ)ω+ǫ ) + ρ∈Irr(G) is upper bounded by O((|H||K|)ω/2+ǫ/2 + |G|ω/2+ǫ/2 ). Proof. We use only the fact that for each ρ ∈ Irr(G), X dim(σ)nσ,ρ = dim(ρ), (4) σ∈Irr(H) and similarly X dim(τ )mτ,ρ = dim(ρ), (5) τ ∈Irr(K) together with the fact that the sum of the squares of the dimensions of the irreps of a group is the order of that group (which implies that the maximum dimension is at most the square root of the order of the group). We observe that by replacing the “max” with addition,      X X O (dim(σ) dim(τ ))ω−1+ǫ · max dim(σ) dim(τ ), nσ,ρ mτ,ρ    ρ∈IrrG σ∈Irr(H),τ ∈Irr(K)    X X ω−1+ǫ O (dim(σ) dim(τ )) · dim(σ) dim(τ ) + ≤ nσ,ρ mτ,ρ  ρ∈IrrG σ∈Irr(H),τ ∈Irr(K) We know that X σ∈Irr(H),τ ∈Irr(K) (dim(σ) dim(τ ))ω−1+ǫ · dim(σ) dim(τ )  = X σ∈Irr(H)   dim(σ)ω+ǫ  ·  X τ ∈Irr(K) 8  dim(τ )ω+ǫ  ≤ (|H||K|)ω/2+ǫ/2 . where the last inequality applied Proposition 1 twice, with α = ω + ǫ. Also, we know that   X X (dim(σ) dim(τ ))ω−1+ǫ ·  nσ,ρ mτ,ρ  σ∈Irr(H),τ ∈Irr(K) = X ρ∈Irr(G) ≤ = X ρ∈Irr(G) X ρ∈Irr(G)    ρ∈IrrG X σ∈Irr(H) dim(σ)ω−1+ǫ nσ,ρ  ·  |H|(ω−2+ǫ)/2 · |H|   (ω−2+ǫ)/2 |K| X σ∈Irr(H) X τ ∈Irr(K)  dim(τ )ω−1+ǫ mτ,ρ    dim(σ)nσ,ρ  · |K|(ω−2+ǫ)/2 · (ω−2+ǫ)/2 2 (ω−2+ǫ)/2 dim(ρ) = (|H||K|) X τ ∈Irr(K) |G| dim(τ )mτ,ρ  where the second-to-last equality used (4) and (5). If |H||K| ≤ |G| then this expression is at most ω/2+ǫ/2 |G|ω/2+ǫ/2 ; if |H||K| > |G| then this expression . Finally, we have P is at most (|H||K|) ω+ǫ ), is at most O(|G|ω/2+ǫ/2 ), that the final term in the main expression, ρ∈Irr(G) O(dim(ρ) by Proposition 1 with α = ω + ǫ, and the lemma follows. Our main theorems put everything together: Theorem 11. Let G be a finite group and let H, K be subgroups and let x ∈ G be any element. Fix a way of writing g = hk for each g ∈ HK (this is unique iff H ∩ K = {1}). Let c ∈ C[G] be supported on HKx. Then we can compute X M ρ(g) cg · g=hkx∈HKx ρ∈Irr(G) at the cost of |H| many K-DFTS, |K| many H-DFTs, plus O(|G|ω/2+ǫ + (|H||K|)ω/2+ǫ ) operations, for all ǫ > 0. Proof. Set c′g = cgx and notice that c′ is supported on HK. Apply Lemma 6 on c′ to compute X g=hk∈HK c′g M σ∈Irr(H),τ ∈Irr(K) σ(h) ⊗ τ (k). L P Next, apply the linear map φG,H,K to obtain (by linearity) g=hk∈HK c′g ρ∈Irr(G) ρ(hk), and P finally, multiply by ⊕ρ∈Irr(G) ρ(x) on the right, at a cost of ρ∈Irr(G) dim(ρ)2 ≤ O(|G|ω/2+ǫ ) operations (by Proposition 1 with α = ω + ǫ). The result is X M M X ρ(g ′ ), ρ(gx) = cg ′ c′g g=hk∈HK g′ ∈HKx ρ∈Irr(G) ρ∈Irr(G) as promised. By translating HK around, we cover all of G, leading to our main theorem: Theorem 12 (main). Let G be a finite group and let H, K be subgroups. Then we can compute the DFT with respect to G at the cost of |H| many K-DFTS, |K| many H-DFTs, plus ln(|G|) ) many times, for all ǫ > 0. O(|G|ω/2+ǫ + (|H||K|)ω/2+ǫ ) operations, all repeated r = O( |G||HK| If G = HK, then we may take r = 1. 9  Proof. We argue that there exist x1 , x2 , . . . , xr ∈ G so that ∪i HKxi = G. Then a G-DFT can be computed by applying Theorem 11 r times with these translations. The existence of the xi is a standard application of the probablistic method: for randomly chosen xi , the probability ∪i HKxi fails to contain a given g ∈ G is (1 − |HK|/|G|)r , and the r specified in the theorem statement makes this quantity strictly less than 1/|G|, so a union bound finishes the argument. 4 Exponent ω/2 for finite solvable groups We show how to derive algorithms for all solvable groups via our reduction, matching the exponent ω/2 algorithm of [Bet84, CB93]. An advantage of our approach is that we don’t need to rely on knowledge of the representation theory of G. We begin with a key definition: Definition 13. A finite group G is supersolvable if there is a sequence of subgroups {1} = G0 ⊳ G1 ⊳ G2 ⊳ · · · ⊳ Gk = G such that each Gi is normal in G, and for all i, Gi /Gi−1 is cyclic of prime order. A solvable finite group G is one in which the requirement that each Gi is normal in G (rather than just Gi+1 ) is removed. An early result in the area of fast generalized DFTs was Baum’s algorithm which gives a fast DFT for all supersolvable groups. Theorem 14 (Baum). There is an algorithm that uses O(|G| log |G|) operations to compute the generalized DFT over G, if G is supersolvable. An important class of supersolvable groups are p-groups. Together with this fact, the result of the previous section makes it quite easy to obtain an algorithm for all solvable groups. We need the following classical result of Hall: Theorem 15 (Hall). Let G be a finite solvable group of order ab, with (a, b) = 1. Then there exists a subgroup H ⊆ G of order a. From this we obtain: Theorem 16. Let G be a finite solvable group. Then a G-DFT can be computed in O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Proof. Take δ = ǫ/2. Let Aδ ≥ 1 be the constant hidden in the O(|G|ω/2+δ + (|H||K|)ω/2+δ ) notation in Theorem 12. Let B be the constant in the big-oh expression in the statement of Theorem 14. It suffices to prove that for any finite group G with |G| having k distinct prime factors, a G-DFT can be computed in (4Aδ )log k |G|ω/2+δ B log |G| operations, because for sufficiently large G, we have (4Aδ )log k B log |G| ≤ (4Aδ )log log |G| B log |G| ≤ |G|δ . The proof is by induction on the number of distinct prime factors in the order of G. For the base case of k = 1, G is a p-group, hence supersolvable, and we apply Theorem 14. Now, suppose |G| = pa1 1 . . . pakk , where p1 , . . . , pk are distinct primes, then |G| = ab, where a and b each has no more than k/2 distinct prime factors and (a, b) = 1. Applying Hall’s theorem (twice) there are subgroups H, K of order a and b respectively. Since (a, b) = 1, we must have H ∩ K = {1}, and then G = HK because |G| = ab. 10 We can then apply Theorem 12, to reduce to the case of computing |H| many K-DFTs and K many H-DFTs, at a cost of 2Aδ |G|ω/2+δ operations. But H and K are both solvable, and hence by the induction hypothesis, these two sets of DFTs cost at most |H| · (4Aδ )log(k/2) |K|ω/2+δ B log |K| + |K| · (4Aδ )log(k/2) |H|ω/2+δ B log |H| 2 ≤ (4Aδ )log k |G|ω/2+δ B log |G| 4Aδ operations. Together with the 2Aδ |G|ω/2+δ overhead, this is no more than (4Aδ )log k |G|ω/2+δ B log |G| operations, as required. 5 Exponent ω/2 for finite groups of Lie type One of the main payoffs of Theorem 12 is exponent ω/2 algorithms for finite groups of Lie type. This is because groups of Lie type have an “LDU -type” decomposition which is well-suited to Theorem 12. We describe these decompositions and the resulting DFT algorithms in this section. All of our “LDU -type” decompositions of groups of Lie type into three subgroups give rise to the following DFT algorithm: Theorem 17. Let H1 , H2 , H3 be subgroups of group G, and suppose all three are either p-groups or abelian. Moreover, suppose H1 H2 is a subgroup and H1 ∩ H2 = {1} and H1 H2 ∩ H3 = {1}. Then there is a generalized DFT for G that uses at most   |G| log |G| O |G|ω/2+ǫ |H1 ||H2 ||H3 | operations, for all ǫ > 0. Proof. We apply Theorem 12 to the pair H1 H2 and H3 at a cost of O(|G|ω/2+ǫ ) plus |H1 H2 | many H3 -DFTs and |H3 | many H1 H2 -DFTs. This is all repeated   |G| log |G| r=O |H1 ||H2 ||H3 | many times. The H3 -DFTs cost O(|H3 | log |H3 |) because H3 is abelian or a p-group (via Theorem 14). We apply Theorem 12 once more to H1 , H2 , at a cost of O(|H1 H2 |ω/2+ǫ ) plus |H1 | many H2 -DFTs and |H2 | many H1 -DFTs. Each H1 -DFT costs O(|H1 | log |H1 |) because H1 is abelian or a p-group, and the same is true for each H2 -DFT. Altogether, the cost is h r · O(|G|ω/2+ǫ ) + |H1 H2 | · O(|H3 | log |H3 |)  i + |H3 | · O(|H1 H2 |ω/2+ǫ ) + |H1 | · O(|H2 | log |H2 |) + H2 · O(|H1 log H1 |) which is as claimed. From Carter [Car89], we have that all finite simple groups of Lie type (except the Tits group) have a split (B, N )-pair, which implies the following structure: G = ⊔w∈W BwUw B and N are subgroups, W is the Weyl group (i.e. W = B/(B ∩ N )), and B = U T with T a maximal torus (hence abelian) and U, T are complements in B. The Uw are subgroups of U , and U is a p-group. This decomposition is “with uniqueness of expression” which implies that |BwUw | = |B||Uw | for each w. From this description we easily have the very general result: 11 Theorem 18. Let G be a finite group with a split (B, N )-pair, with associated Weyl group W . Then there is a fast DFT over G that uses O(|G|ω/2+ǫ |W |) operations, for all ǫ > 0. Proof. Fix the w maximizing the size of the double coset BwUw , and note that |BUww | = |BwUw | ≥ |G|/|W |. As noted this size is |B||Uw |, and hence B ∩ Uww = {1}. Also from the description above, B = U T with U ∩ T = {1}; T is abelian and U, Uww are p-groups. We are then in the position to apply Theorem 17, which yields the claimed operation count. As one can see from Figure 2, for families of finite simple groups of Lie type, the Weyl group always has order that is |G|o(1) , so this algorithm has exponent ω/2, which is best-possible if ω = 2. Next, we explicitly work out the more common cases of the general linear, orthogonal, and symplectic families, and their variants. The overhead coming from the parameter r in Theorem 12 in each case is somewhat smaller than the worst-case bound of O(|W | log |G|) coming from (the very general) Theorem 18; instead it approaches O(log |G|) as the underlying field size q approaches infinity. 5.1 The groups GLn (Fq ) and SLn (Fq ) The easiest example for applying Theorem 17 is the general linear group. Theorem 19. For each n and prime power q, there is a generalized DFT for the group G = GLn (Fq ) that uses O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Proof. The three subgroups H1 , H2 , H3 are the set of lower-triangular matrices with ones on the diagonal, the set of diagonal matrices, and the set of upper-triangular matrices with ones on 2 2 the diagonal, which have sizes q (n −n)/2 , (q − 1)n , and q (n −n)/2 , respectively. In the notation of Theorem 17, we have   n  q |G| log |G| ≤O (n2 log q) r=O |H1 ||H2 ||H3 | q−1 which can be absorbed into the |G|ǫ term. For SLn (Fq ) the only difference is that the diagonal matrices must have determinant one, so the size of that subgroup is (q − 1)n−1 instead of (q − 1)n ; the group itself is also smaller by a factor of q − 1. We obtain in exactly the same way as for Theorem 19: Theorem 20. For each n and prime power q, there is a generalized DFT for G = SLn (Fq ) that uses O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Since the two dimensional case has attracted a lot of attention, we record that result separately, for concreteness: Theorem 21. For each prime power q, there is a generalized DFT for G = SL2 (Fq ) that uses O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Proof. Let H1 be the set of lower triangular matrices with ones on the diagonal, H2 be the set of diagonal matrices with determinant 1, and H3 be the set of upper triangular matrices with ones on the diagonal. These are all subgroups, each pairwise intersection is {1}, and we have H1 H2 is a subgroup. All three subgroups are abelian, with orders q, q − 1, and q, respectively. Since |G| = q 3 − q we have in this case that |H1 H2 ||H3 | = |G| and hence H1 H2 H3 = G. We can perform the DFT by applying Theorem 12 to H1 H2 and H3 , and then to H1 and H2 . The overall cost is O(|G|ω/2+ǫ ) + |H1 H2 | · O(|H3 | log |H3 |)   + |H3 | · O(|H1 H2 |ω/2+ǫ ) + |H1 | · O(|H2 | log |H2 |) + H2 · O(|H1 log H1 |) 12 which simplifies to the claimed operation count. 5.2 The symplectic groups Sp2n (Fq ) A symplectic group of dimension 2n over Fq is the subgroup of invertible matrices that preserve a symplectic form; all symplectic forms are equivalent under a change of basis, so concretely we may take Sp2n (Fq ) to be the set of all matrices A ∈ GL2n (Fq ) such that   0 J T A QA = Q, where Q = −J 0 and J is the matrix with ones on the antidiagonal. Theorem 22. For each n and prime power q, there is a generalized DFT for G = Sp2n (Fq ) that uses O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Proof. Let L, U, D be the lower-triangular (with ones on the diagonal), upper-triangular (with ones on the diagonal), and diagonal subgroups of GL2n (Fq ), respectively. We view our group G as a subgroup of GL2n (Fq ) as well. It is well known that the order of G is 2 qn n Y 2 (q 2i − 1) ≤ q 2n +n . i=1 Now apply Theorem 17 with H1 = L ∩G, H2 = D ∩G and H3 = U ∩G. We note that H1 and H3 are p-groups and H2 is abelian (as before). Also, H1 H2 is a subgroup, and H1 ∩ H2 = {1} and H1 H2 ∩ H3 = {1}. It remains to bound the sizes of H1 , H2 , H3 . In order to lower bound the size of H3 , consider the following subgroups of GL2n (Fq ),    In M n×n H = : M ∈ Fq 0 In    A 0 : A, B upper triangular with ones on the diagonal . K = 0 B One can verify that H ∩ G is the subgroup in which M is a persymmetric matrix (symmetric about the anti-diagonal), and thus this subgroup has order q n(n+1)/2 . Similarly, one can verify that K ∩ G is the subgroup in which A is an arbitrary upper-triangular matrix with ones on the diagonal and B = J(AT )−1 J. Thus this subgroup has order q n(n−1)/2 . We have (H ∩ G)(K ∩ G) ⊆ H3 2 and so |H3 | ≥ q n(n+1)/2+n(n−1)/2 = q n . A symmetric argument shows that |H1 | has the same order. It is also easy to verify that |H2 | = (q − 1)n . In the notation of Theorem 17, we have   n  q |G| log |G| ≤O ((n2 + n) log q) r=O |H1 ||H2 ||H3 | q−1 which can be absorbed into the |G|ǫ term. 13 5.3 The orthogonal groups On (Fq ) An orthogonal group of dimension n over Fq is a subgroup of invertible matrices that preserve a nondegenerate symmetric quadratic form. There are several inequivalent quadratic forms and thus several non-isomorphic orthogonal groups. For simplicity, we work out only one case (the “plus type” orthogonal group of even dimension, in odd characteristic). A similar analysis can be easily carried out for the other non-isomorphic orthogonal groups. In our case, concretely, we may take On (Fq ) to be the set of all matrices A ∈ GLn (Fq ) such that   0 J T A QA = Q, where Q = J 0 and J is the matrix with ones on the antidiagonal. Theorem 23. For each even n and odd prime power q, there is a generalized DFT for G = On (Fq ) specified via the above quadratic form, that uses O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Proof. Let L, U, D be the lower-triangular (with ones on the diagonal), upper-triangular (with ones on the diagonal), and diagonal subgroups of GLn (Fq ), respectively. We view our group G 2 as a subgroup of GLn (Fq ) as well. It is well known that the order of G is at most 2q (n −n)/2 . Now apply Theorem 17 with H1 = L ∩G, H2 = D ∩G and H3 = U ∩G. We note that H1 and H3 are p-groups and H2 is abelian (as before). Also, H1 H2 is a subgroup, and H1 ∩ H2 = {1} and H1 H2 ∩ H3 = {1}. It remains to bound the sizes of H1 , H2 , H3 . In order to lower bound the size of H3 , first consider the following subgroups of GLn (Fq ),    In/2 M n/2×n/2 : M ∈ Fq H = 0 In/2    A 0 K = : A, B upper tri. with ones on the diagonal . 0 B One can verify that H ∩ G is the subgroup in which M is a “ skew-persymmetric” matrix (skew2 symmetric about the anti-diagonal), and thus this subgroup has order q ((n/2) −(n/2))/2 . Similarly, one can verify that K∩G is the subgroup in which A is an arbitrary upper-triangular matrix 2 2 with ones on the diagonal and B = J(AT )−1 J. Thus this subgroup has order q ((n ) −(n/2))/2 . We have (H ∩ G)(K ∩ G) ⊆ H3 2 and so |H3 | ≥ q (n/2) −(n/2) . A symmetric argument shows that |H1 | has the same order. It is also easy to verify that |H2 | = (q − 1)n/2 . In the notation of Theorem 17, we have r=O  |G| log |G| |H1 ||H2 ||H3 |  ≤O  q q−1 n/2 ((n2 − n) log q/2) which can be absorbed into the |G|ǫ term. We note that in all of the cases just considered in Sections 5.1, 5.2, 5.3, one obtains the same results for the special or projective (or both) variants, by following essentially the same argument. To obtain results for the projective cases, we observe that quotient-ing all of the groups in our decomposition by the center can only change the operation count by a factor of some constant multiple of the size of the center, which in these cases is itself a constant. Finally, we note that Theorem 18 and the surrounding discussion imply 14 Theorem 24. Let G be a finite simple group. Then there is a fast DFT over G that uses O(|G|ω/2+ǫ ) operations, for all ǫ > 0. Proof. As noted in the discussion before and after Theorem 18, all finite simple groups of Lie type (except the Tits group) have a split (B, N )-pair, and Weyl group of order |G|o(1) , so Theorem 18 yields exponent ω/2 algorithms for these families. By the Classification Theorem, the only other infinite families of finite simple groups are the alternating group and the abelian groups, both of which have exponent 1 algorithms. The sporadic groups and the Tits group are a finite set of exceptions that can be handled by choosing the constant in the big-oh notation sufficiently large. 6 A new exponent upper bound for all finite groups In this section we prove a structural result for all finite groups that allows us to make use of the reduction in Theorem 12. Just as Lev’s theorem regarding a large single subgroup allows one to use the single subgroup reduction of Section 2 to obtain a non-trival upper bound for all finite groups, the following theorem gives a pair of subgroups for use in the reduction of Theorem 12. √ Theorem 25. There exists a monotone increasing function f (x) ≤ 2c log x log log x for a universal constant c ≥ 1, for which the following holds: every finite group G that is not a p-group has proper subgroups H, K satisfying |HK| ≥ |G|/f (|G|). Proof. If G is simple then by the Classification Theorem, we have several cases: • G is cyclic of prime order. This case cannot arise since G is not a p-group. • G is the alternating group An . Then we choose H = An−1 and K = {1} and we have |HK| ≥ |G|/n, so as long as f (x) > log x, the theorem holds. • G is a finite group of Lie Type. Then G has a (B, N ) pair (the Tits Group is an exception; it does not have a (B, N ) pair, but it is a single finite group so it can be treated along with the sporadic groups in the next case). Let W = N/(B ∩ N ) be the Weyl group, and from the axioms of a (B, N ) pair, we have that the double cosets BwB with w ∈ W cover G (the w denotes a lift to N ⊆ G). Thus there is some double coset BwB of size at least |G|/|W |. Taking H = B w and K = B, we see that |HK| = |BwB| ≥ |G|/|W |. Now we verify that we can choose f so that for each of the families in Figure 2, f (|G|) > |W |. • G is one of the sporadic groups. Let C be the largest order of a sporadic group. Then by choosing f (x) > C, the theorem holds for H = K = {1} in this case. If G is not simple, then let N be a maximal normal subgroup of G, so that G/N is simple. We have two cases: • G/N is a p-group. Since G is not a p-group, we have that |G| = mpk for m > 1 and ′ (m, p) = 1. Let P be a p-Sylow subgroup of G. Then |P | = pk , and |N | = mpk for some k ′ < k. Then N P = G and both N and P are proper subgroups. • G/N is a simple group that is not a p-group. Then apply the previous case analysis for simple groups to obtain H/N, K/N , proper subgroups of G/N for which |(H/N )(K/N )| ≥ |G/N |/f (|G/N |). But then H, K are proper subgroups of G and |HK| = |(H/N )(K/N )||N | ≥ |G/N ||N |/f (|G/N |) = |G|/f (|G/N |) ≥ |G|/f (|G|), where the last inequality used the monotonicity of f . 15 Name Chevalley Exceptional Chevalley Steinberg Suzuki Ree Family Aℓ (q) Bℓ (q) Cℓ (q) Dℓ (q) E6 (q) E7 (q) E8 (q) F4 (q) G2 (q) 2 A (q 2 ) ℓ 2 D (q 2 ) ℓ 2 E (q 2 ) 6 3 D (q 3 ) 4 2 B (q), q = 22n+1 2 2 F (q), q = 32n+1 4 2 G (q), q = 32n+1 2 |W | (ℓ + 1)! 2ℓ ℓ! 2ℓ ℓ! 2ℓ−1 ℓ! O(1) O(1) O(1) O(1) O(1) 2⌈ℓ/2⌉ ⌈ℓ/2⌉! 2ℓ−1 (ℓ − 1)! O(1) O(1) O(1) O(1) O(1) |G| 2 q Θ(ℓ ) 2 q Θ(ℓ ) 2 q Θ(ℓ ) 2 q Θ(ℓ ) q Θ(1) q Θ(1) q Θ(1) q Θ(1) q Θ(1) 2 q Θ(ℓ ) 2 q Θ(ℓ ) q Θ(1) q Θ(1) q Θ(1) q Θ(1) q Θ(1) Figure 2: Families of finite groups G of Lie type, together with the size of their associated Weyl group W . These include all simple finite groups other than cyclic groups, the alternating groups, the 26 sporadic groups, and the Tits group. See [Lev92, Wik17] for sources. DFT Exponent 1.6 ω = 2.562 1.4 Previous Best Our Result Conjectured Optimal Lower Bound 1.2 1 2 2.2 2.4 2.6 2.8 3 ω Figure 3: Upper bound in Theorem 26 as a function of ω. The previous best bound is from Theorem 5. Assuming that some dependence on fast matrix multiplication is necessary, w/2 is a reasonable conjecture for the optimal dependence. Exponent one is of course a trivial lower bound. 16 Now we can use this theorem in a recursive algorithm that switches between the single subgroup reduction and the double subgroup reduction, as follows: √ 2 Theorem 26. For every finite group G, there is an exponent ω−2+ ω4 −4ω+36 algorithm com√ √ 4ω when ω ≥ 1+2 17 . In puting the DFT with respect to G when ω ≤ 1+2 17 , or exponent 4+ω √ particular, when ω = 2, the exponent is 2. To visualize these bounds, refer to Figure 3. Proof. We describe our general strategy before formally analyzing the complexity. For each possible value of ω, we pick a threshold β as a function of ω. This threshold will be used to switch between the single subgroup and the double subgroup reductions. Fix G. Consider the following recursive algorithm. If G is a p-group, then we apply Theorem 14. If G is the trivial group, then the DFT is trivial as well. Otherwise, let H, K be the subgroups guaranteed by Theorem 25. If |H|, |K| are both at most |G|β , then we apply Theorem 12 (the double subgroup reduction). Otherwise one of H, K has size at least |G|β (without loss of generality, assume it’s H) and we apply Corollary 4 (the single subgroup reduction). Let us now analyze the operation count in terms of β. After this analysis, we’ll pick the optimal β for each ω to minimize the operation count. For this purpose, set δ = min{ǫ, 0.1, 0.1ǫ β }, and give names to some constants: • Let Aδ be the constant hidden in the O(|G|ω/2+δ + (|H||K|)ω/2+δ ) notation of Theorem 12. • Let Bδ be the constant hidden in the [G : H]2 · O(|H|ω/2+δ ) notation of Corollary 4. • Let B be the constant hidden in the O(|G| log |G|) notation of Theorem 14. Let T (n) denote an upper bound on the running time of this recursive algorithm for any group G of order n. For each fixed ǫ > 0, we will prove by induction on n that, for a universal constant Cǫ , T (n) ≤ Cǫ nα+ǫ log2 n, where α is determined by β and ω. This clearly holds for the base case of a p-group or the trivial group, provided Cǫ > B and α ≥ 1. By choosing Cǫ sufficiently large, √ we may assume that |G| is at least some fixed constant size, c log |G| log log |G| · O(log |G|) term in the notation of Theorem and hence we may assume that 2 12 is bounded above by |G|ǫ/10 . In the case that we apply Theorem 12, the cost is at most   |H| · T (|K|) + |K| · T (|H|) + Aδ (|H||K|)ω/2+δ · |G|ǫ/10 , where |H|, |K| ≤ |G|β . Applying the induction hypothesis, we obtain:   T (n) ≤ 2Cǫ nβ nβ(α+ǫ) log2 (nβ ) + Aδ n2β(ω/2+δ) · nǫ/10 ǫ ≤ (2Cǫ β 2 + Aδ ) · nmax(β+βα+βǫ,ωβ+2βδ)+ 10 log2 n which can be bounded above by Cǫ nα+ǫ log2 n as long as the following constraints are satisfied: • β< √ 2 2 ≈ 0.707; β • α ≥ max( 1−β , ωβ); • Cǫ > Aδ 1−2β 2 . 17 In the case that we apply Corollary 4, the cost is at most [G : H] · T (|H|) + [G : H]2 · Bδ |H|ω/2+δ , where |H| ≥ |G|β and hence [G : H] ≤ |G|1−β . If we set γ such that |H| = |G|γ , and thus β ≤ γ ≤ 1, and apply the induction hypothesis, we obtain, T (n) ≤ Cǫ n1−γ nγ(α+ǫ) log2 (n/2) + Bδ n2(1−γ) nγ(ω/2+δ) < Cǫ nα+ǫ (log n)(log n − 1) + Bδ n2−(2−ω/2)β+δ which is at most Cǫ nα+ǫ log2 n as long as the following constraints are satisfied: • α ≥ 2 − (2 − ω/2)β; • Cǫ ≥ Bδ . To recap, the above induction proof holds when √ ω β 2 , ωβ, 2 − (2 − )β), and β < ≈ 0.707. α = max( 1−β 2 2 Now we solve √for the optimal β for each fixed ω. When ω ≥ 1+2 17 ≈ 2.562, the optimal is β∗ = When ω ≤ 7 4 4ω , α∗ = . 4+ω 4+ω √ 1+ 17 2 ≈ 2.562, the optimal is √ √ 10 − ω − ω 2 − 4ω + 36 ∗ ω − 2 + ω 2 − 4ω + 36 β∗ = ,α = . 2(4 − ω) 4 Conclusions There are two significant open problems that naturally follow from the results in this paper. First, can one obtain exponent ω/2 algorithms for all finite groups? This might be possible by proving a more sophisticated version of Theorem 25, which, for example, manages to upper bound |H ∩ K|. Also of interest would be a proof of Theorem 25 that does not need the Classification Theorem. A second question is whether the dependence on ω can be removed. Alternatively, can one show that a running time that depends on ω is necessary by showing that an exponent one DFT for a certain family of groups would imply ω = 2? Acknowledgements. We thank the SODA 2018 referees for their careful reading of this paper and many useful comments. References [Bau91] Ulrich Baum. Existence and efficient construction of fast Fourier transforms on supersolvable groups. computational complexity, 1(3):235–256, Sep 1991. [BCS97] P. Bürgisser, M. Clausen, and M. A. Shokrollahi. Algebraic Complexity Theory, volume 315 of Grundlehren der mathematischen Wissenschaften. Springer-Verlag, 1997. 18 [Bet84] Thomas Beth. Verfahren der schnellen Fourier-Transformation. Teubner, 1984. [Car89] Roger W Carter. Simple groups of Lie type, volume 22. John Wiley & Sons, 1989. [CB93] Michael Clausen and Ulrich Baum. Fast Fourier transforms. Wissenschaftsverlag, 1993. [CH17] Michael Clausen and Paul Hühne. Linear time fourier transforms of sn-k-invariant functions on the symmetric group sn. In Proceedings of the 2017 ACM on International Symposium on Symbolic and Algebraic Computation, ISSAC ’17, pages 101–108, New York, NY, USA, 2017. ACM. [Cla89] Michael Clausen. Fast generalized Fourier transforms. Theoretical Computer Science, 67(1):55–63, 1989. [HJ91] Roger A. Horn and Charles R. Johnson. Topics in Matrix Analysis. Cambridge University Press, 1991. [HU18] Chloe Ching-Yun Hsu and Chris Umans. A fast generalized DFT for finite groups of lie type. In Artur Czumaj, editor, Proceedings of the Twenty-Ninth Annual ACMSIAM Symposium on Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018, pages 1047–1059. SIAM, 2018. [Lev92] Arieh Lev. On large subgroups of finite groups. Journal of Algebra, 152(2):434–438, 1992. [LG14] François Le Gall. Powers of tensors and fast matrix multiplication. In Proceedings of the 39th international symposium on symbolic and algebraic computation, pages 296–303. ACM, 2014. [LR92] John D. Lafferty and Daniel Rockmore. Fast fourier analysis for SL2 over a finite field and related numerical experiments. Experiment. Math., 1(2):115–139, 1992. [Mas98] David Keith Maslen. The efficient computation of fourier transforms on the symmetric group. Math. Comput., 67(223):1121–1147, 1998. [MR97a] David Maslen and Daniel Rockmore. Separation of variables and the computation of Fourier transforms on finite groups, I. Journal of the American Mathematical Society, 10(1):169–214, 1997. [MR97b] David K Maslen and Daniel N Rockmore. Generalized FFTs – a survey of some recent results. In Groups and Computation II, volume 28, pages 183–287. American Mathematical Soc., 1997. [MR00] David K Maslen and Daniel N Rockmore. Double coset decompositions and computational harmonic analysis on groups. Journal of Fourier Analysis and Applications, 6(4):349–388, 2000. [MRW16a] David Maslen, Daniel N Rockmore, and Sarah Wolff. The efficient computation of Fourier transforms on semisimple algebras. arXiv preprint arXiv:1609.02634, 2016. To appear in Journal of Fourier Analysis and Applications. [MRW16b] David Maslen, Daniel N Rockmore, and Sarah Wolff. Separation of variables and the computation of Fourier transforms on finite groups, II. Journal of Fourier Analysis and Applications, pages 1–59, 2016. [Roc95] Daniel N. Rockmore. Fast Fourier transforms for wreath products. Applied and Computational Harmonic Analysis, 2(3):279 – 292, 1995. [Roc97] Daniel Rockmore. Some applications of generalized FFTs. In Proceedings of the 1995 DIMACS Workshop on Groups and Computation, pages 329–369. June, 1997. [Roc02] Daniel N Rockmore. Recent progress and applications in group FFTs. In Signals, Systems and Computers, 2002. Conference Record of the Thirty-Sixth Asilomar Conference on, volume 1, pages 773–777. IEEE, 2002. 19 [Wik17] Wikipedia. List of finite simple groups — wikipedia, the free encyclopedia, 2017. [Online; accessed 30-June-2017]. 20
4math.GR
1 Particle Swarm Optimization for Time Series Motif Discovery arXiv:1501.07399v1 [cs.LG] 29 Jan 2015 Joan Serrà and Josep Lluis Arcos Abstract—Efficiently finding similar segments or motifs in time series data is a fundamental task that, due to the ubiquity of these data, is present in a wide range of domains and situations. Because of this, countless solutions have been devised but, to date, none of them seems to be fully satisfactory and flexible. In this article, we propose an innovative standpoint and present a solution coming from it: an anytime multimodal optimization algorithm for time series motif discovery based on particle swarms. By considering data from a variety of domains, we show that this solution is extremely competitive when compared to the state-of-the-art, obtaining comparable motifs in considerably less time using minimal memory. In addition, we show that it is robust to different implementation choices and see that it offers an unprecedented degree of flexibility with regard to the task. All these qualities make the presented solution stand out as one of the most prominent candidates for motif discovery in long time series streams. Besides, we believe the proposed standpoint can be exploited in further time series analysis and mining tasks, widening the scope of research and potentially yielding novel effective solutions. Index Terms—Particle swarm, multimodal optimization, time series streams, motifs, anytime. I. I NTRODUCTION T IME SERIES are sequences of real numbers measured at successive, usually regular time intervals. Data in the form of time series pervade science, business, and society. Examples range from economics to medicine, from biology to physics, and from social to computer sciences. Repetitions or recurrences of similar phenomena are a fundamental characteristic of non-random natural and artificial systems and, as a measurement of the activity of such systems, time series often include pairs of segments of strikingly high similarity. These segment pairs are commonly called motifs [1], and their existence is unlikely to be due to chance alone. In fact, they usually carry important information about the underlying system. Thus, motif discovery is fundamental for understanding, characterizing, modeling, and predicting the system behind the time series [2]. Besides, motif discovery is a core part of several higher-level algorithms dealing with time series, in particular classification, clustering, summarization, compression, and rule-discovery algorithms (see, e.g., references in [2], [3]). Identifying similar segment pairs or motifs implies examining all pairwise comparisons between all possible segments in a time series. This, specially when dealing with long time series streams, results in prohibitive time and space complexities. It is for this reason that the majority of motif J. Serrà and J. Ll. Arcos are with IIIA-CSIC, the Artificial Intelligence Research Institute of the Spanish National Research Council, Campus de la UAB s/n, 08193 Bellaterra, Barcelona, Spain, email: {jserra,arcos}@iiia.csic.es. discovery algorithms resort to some kind of data discretization or approximation that allows them to hash and retrieve segments efficiently. Following the works by Lin et al. [1] and Chiu et al. [4], many of such approaches employ the SAX representation [5] and/or a sparse collision matrix [6]. These allow them to achieve a theoretically low computational complexity, but sometimes at the expense of very high constant factors. In addition, approximate algorithms usually suffer from a number of data-dependent parameters that, in most situations, are not intuitive to set (e.g., time/amplitude resolutions, dissimilarity radius, segment length, minimum segment frequency, etc.). A few recent approaches overcome some of these limitations. For instance, Castro & Azevedo [7] propose an amplitude multi-resolution approach to detect frequent segments, Li & Lin [8] use a grammar inference algorithm for exploring motifs with lengths above a certain threshold, Wilson et al. [9] use concepts from immune memory to deal with different lengths, and Floratou et al. [10] combine suffix trees with segment models to find motifs of any length. Nevertheless, in general, these approaches still suffer from other data-dependent parameters whose correct tuning can require considerable time. In addition, approximate algorithms are restricted to a specific dissimilarity measure between segments (the one implicit in their discretization step) and do not allow easy access to preliminary results, which is commonly known as anytime algorithms [11]. Finally, to the best of our knowledge, only [12]–[14] consider the identification of motif pairs containing segments of different lengths. This can be considered a relevant feature, as it produces better results in a number of different domains [13]. In contrast to approximate approaches, algorithms that do not discretize the data have been comparatively much less popular, with low efficiency generally. Exceptions to this statement achieved efficiency by sampling the data stream [15] or by identifying extreme points that constrained the search [16]. In fact, until the work of Mueen et al. [17], the exact identification of time series motifs was thought to be intractable for even time series of moderate length. In said work, a clever segment ordering was combined with a lower bound based on the triangular inequality to yield the true, exact, most similar motif. According to the authors, the proposed algorithm was more efficient than existing approaches, including all exact and many approximate ones [17]. After Mueen et al.’s work, a number of improvements have been proposed, the majority focusing on eliminating the need to set a fixed segment length [18]–[20]. Mueen himself has recently published a variable-length motif discovery algorithm which clearly outperforms the it- 2 II. T IME S ERIES M OTIF D ISCOVERY AS AN A NYTIME M ULTIMODAL O PTIMIZATION TASK A. Definitions and Task Complexity From the work by Mueen et al. [3], [17], we can derive a formal, generic similarity-based definition [2] of time series motifs. Given a time series z of length n, z = [z1 , . . . zn ], a normalized segment dissimilarity measure D, and a temporal window of interest between wmin and wmax samples, the topk time series motifs M = {m1 , . . . mk } correspond to the k wb a most similar segment pairs zw a = [za , . . . za+wa −1 ] and zb = [zb , . . . zb+wb −1 ], for wa , wb ∈ [wmin , wmax ], a ∈ [1, n−wa +1], and b ∈ [1, n − wb + 1] where, in order to avoid repeated and trivial matches [1], a + wa < b. Thus, the i-th motif can be fully described by the tuple mi = {a, wa , b, wb }. The motifs in M are non-overlapping1 and ordered from lowest to highest dissimilarity such that D(m1 ) ≤ D(m2 ) ≤ · · · ≤ wb a D(mk ) where D(mi ) = D({a, wa , b, wb }) = D(zw a , zb ). 1 Notice that, following [3], this definition can be trivially extended to different degrees of overlap. −15 MFCC1 erative search for the optimal length using [17] and, from the reported numbers, also outperforms further approaches such as [18]–[20]. This algorithm, called MOEN [3], is essentially parameter-free, and is believed to be one of the most efficient motif discovery algorithms available nowadays. However, its complexity is still quadratic in the length of the time series [3], and hence its applicability to large-scale time series streams remains problematic. Furthermore, in order to derive the lower bounds used, the algorithm is restricted with regard to the dissimilarity measure used to compare time series segments (Euclidean distance after z-normalization). In general, exact motif discovery algorithms have important restrictions with regard to the dissimilarity measure, and many of them still suffer from being non-intuitive and tedious to tune parameters. Moreover, few of them allow for anytime versions and, to the best of our knowledge, not one of them is able to identify motif pairs containing segments of different lengths. In this article, we propose a new standpoint to time series motif discovery by treating the problem as an anytime multimodal optimization task. To the best of our knowledge, this standpoint is completely unseen in the literature. Here, we firstly reason and discuss its multiple advantages (Sec. II). Next, we present SWARMMOTIF (Sec. III), an anytime algorithm for time series motif discovery based on particle swarm optimization (PSO). We subsequently evaluate the performance of the proposed approach using 9 different real-world time series from distinct domains (Sec. IV). Our results show that SWARMMOTIF is extremely competitive when compared to the state-of-the-art, obtaining motif pairs of comparable similarity in considerably less time and with minimum storage requirements (Sec. V). Moreover, we show that SWARMMOTIF is significantly robust against different implementation choices. To conclude, we briefly comment on the application of multimodal optimization techniques to time series analysis and mining, which we believe has great potential (Sec. VI). The data and code used in our experiments will available online. −17 −19 −21 0 100 200 300 400 500 600 i [samples] 700 800 900 Fig. 1. Example of a time series motif pair found in the W ILDLIFE time series of [21] using SWARMMOTIF and normalized dynamic time warping as the dissimilarity measure: a = 248, wa = 244, b = 720, and wb = 235. Note that wa 6= wb and, hence, a warping of the two segments needs to take place. This specific solution cannot be found by any of the approaches mentioned in Sec. I. An example of a time series motif pair from a real data set is shown in Fig. 1. It is important to stress that D needs to normalize with respect to the lengths of the considered segments. Otherwise, we would not be able to compare motifs of different lengths. There are many ways to normalize with respect to the length of the considered segments. Ratanamahatana & Keogh [22] list a number of intuitive normalization mechanisms for dynamic time warping that can easily be applied to other measures. For instance, in the case of a dissimilarity measure based on the Lp norm [23], we can directly divide by the segment length2 , using brute-force upsampling to the largest length [22] when wa 6= wb . From the definitions above, we can see that a brute-force search in the motif space for the most similar motifs is of O(n2 w∆ 2 ), where w∆ = wmax − wmin + 1 (for the final time complexity one needs to further multiply by the cost of calculating D). Hence, for instance, in a perfectly feasible case where n = 107 and w∆ = 103 , we have 1020 possibilities. Magnitudes like this challenge the memory and speed of any optimization algorithm, specially if we have no clue to guide the search [24]. However, it is one of our main objectives to show here that time series generally provide some continuity to this search space, and that this continuity can be exploited by optimization algorithms. B. Continuity A fundamental property of time series is autocorrelation, implying that consecutive samples in a time series have some degree of resemblance and that, most of the time, we do not observe extremal differences between them3 . This property, together with the established ways of computing similarity between time series [23], is what gives continuity to our search space. Consider a typical dissimilarity measure like dynamic time warping between z-normalized segments and the time series of Fig. 1. If we fix the motif starting points a and b to some random values, we can compute D(zia , zjb ) for i, j = wmin , . . . , wmax (Fig. 2A). We see that these two dimensions 2 The only exception is with L , which could be considered as already ∞ being normalized. 3 If a time series had no autocorrelation, we might better treat it as an independent random process. 3 220 230 B 0.1304 Random sampling Baseline reference Anytime algorithm 100 200 0.0749 300 240 400 250 200 210 220 230 240 250 i [samples] 500 0.0430 100 200 300 400 500 i [samples] D(mi) 210 j [samples] j [samples] A 200 0.0247 Fig. 2. Visualizations of the search space obtained with the W ILDLIFE time series [21] and dynamic time warping as the dissimilarity measure: (A) fixing a = 110 and b = 602 but i, j = 200, . . . 250 and (B) fixing wa = 222 and wb = 240 but i, j = 1, . . . 500. Darker colors corresponds to more similarity. j have a clear continuity, i.e., that D(zia , zjb ) ∼ D(zi+1 a , zb ) ∼ j+1 i i+1 j+1 D(za , zb ) ∼ D(za , zb ), and so forth. Similarly, if we fix the motif lengths wa and wb to some random values, we can wb a compute D(zw i , zj ) for i = 1, . . . n − wa and j = 1, . . . n − wb (Fig. 2B). We see that the remaining two dimensions of wb +j a the problem also have some continuity, i.e., D(zw )∼ i , zj wb wb wa wa wb wa D(zi+1 , zj ) ∼ D(zi , zj+1 ) ∼ D(zi+1 , zj+1 ), and so forth. The result is a four-dimensional, multimodal, continuous but noisy4 motif space, where the dissimilarity D acts as the fitness measure and the top-k valley peaks (considering dissimilarity) correspond to the top-k motifs in M. C. Anytime Solutions Finding an optimization algorithm that can locate the global minima of the previous search spaces faster than existing motif discovery algorithms can be a difficult task. However, we have robust and established algorithms for efficiently locating prominent local minima in complex search spaces [25]–[27]. Hence, we can intuitively devise a simple strategy: if we keep the best found minima and randomly reinitialize the optimization algorithm every time it stagnates, we should, sooner or later, start locating the global minima. In the meantime, we could have obtained relatively good candidates. This corresponds to the basic paradigm of anytime algorithms [11]. Anytime algorithms have recently been highlighted as “very beneficial for motif discovery in massive [time series] datasets” [19]. In an anytime algorithm for motif discovery, D(mi ) improves over time, until it reaches the top-k dissimilarity values D(mi )∗ obtained by a brute-force search approach. Thus, we gradually improve M until we reach the true exact solution M∗ . A good anytime algorithm will quickly find low D(mi ), ideally reaching D(mi )∗ earlier than its non-anytime competitors (Fig. 3). Note that a sufficiently good M may suffice in most situations, without the need that M = M∗ . This is particularly true for more exploratory tasks, where one is typically interested in data understanding and visual inspection (see [2]), and can also hold for other tasks, as top-k motifs can be very similar among themselves. In the latter situation, given a seed within 4 We use the term noisy here to stress that the continuity of the space may be altered at some points due to potential noise in the time series. It is not the case that we have a noisy, unreliable dissimilarity measurement D that could change in successive evaluations. 0.0142 0.0082 −1 10 0 10 10 1 10 2 3 10 4 10 t [s] Fig. 3. Schema of a plot to assess the performance of an anytime motif discovery algorithm (blue curve). Error bars indicate 5 and 95 percentiles of D(mi ), their central marker indicates the median, and the isolated dots indicate maximum and minimum values. The gray area at the bottom denotes the area where D(mi )∗ lie. The top-left black error bar acts as a reference and shows the range of D(mi ) obtained by random sampling the motif space. The bottom-right red error bar is placed at the time that the baseline algorithm spent in the calculations. Better performing anytime algorithms have a curve closer to the bottom left corner, quickly entering the gray area as their execution time increases. Notice that both axes are logarithmic. M∗ , we can easily and efficiently retrieve further repetitions via common established approaches [28], [29]. Thus, only non-frequent or singular motifs may be missed. These can be valuable too, as the fact that they are non-frequent does not imply that they cannot carry important information (think for example of extreme events of interest that perhaps only happen twice in a measurement). For those singular motifs, we can wait longer if using an anytime algorithm, or we can resort to the state-of-the-art if that is able to provide its output within an affordable time limit. D. Particle Swarm Optimization The continuity and anytime observations above (Secs. II-B and II-C) relax the requirements for the optimization algorithm to be employed in the considered motif spaces. In fact, if we do not have to assess the global optimality of a solution, we have a number of approaches that can deal with large, multimodal, continuous but noisy search spaces [25]–[27]. Among them, we choose PSO [30]–[34]. PSO is a populationbased stochastic approach for solving continuous and discrete optimization problems [33] which has been applied to multimodal problems [35]. It is a metaheuristic [27], meaning that it cannot guarantee whether the found solution corresponds to a global optimum. The original PSO algorithm cannot even guarantee the convergence to a local optimum, but adapted versions of it have been proven to solve this issue [36]. Other versions guarantee the convergence to the global optimum, but only with the number of iterations approaching infinity [36]. PSO has gained increasing popularity among researchers and practitioners as a robust and efficient technique for solving 4 difficult optimization problems. It makes few or no assumptions about the problem being optimized, does not require it to be differentiable, can search very large spaces of candidate solutions, and can be applied to problems that are irregular, incomplete, noisy, dynamic, etc. (see [30]–[35] and references therein). PSO iteratively tries to improve a candidate solution with regard to a given measure of quality or fitness function. Hence, furthermore, it can be considered an anytime algorithm. E. Advantages of an Optimization-Based Solution Using Particle Swarms Notice that treating time series motif discovery as an optimization problem naturally yields several advantages: 1) We do not require much memory, as we can basically store only the stream time series and preprocess the required segments at every fitness evaluation. 2) We are able to achieve a certain efficiency, as optimization algorithms do not usually explore the full solution space and perform few fitness evaluations [24]. 3) We can employ any dissimilarity measure D as our fitness function. Its only requirements are segment length independence and a minimal search space continuity. Intuitively, this holds for the high majority of time series dissimilarity measures that are currently used (Secs. II-A and II-B). Additionally, we can straightforwardly incorporate notions of ‘interestingness’, hubness, or complexity (see references in [23]). This flexibility is very uncommon in current time series motif discovery algorithms (Sec. I). 4) We do not need to force the two segments of the motif to be of the same length. The dissimilarity function D can expressly handle segments of different lengths or we can simply upsample to the largest length (see [22]). Although considering different segment lengths has been highlighted as an objectively better approach, practically none of the current time series motif discovery algorithms contemplates this option (Sec. I). 5) Since we search for the optimal wa and wb , together with a and b, we do not need to set the exact segment lengths as a parameter. Instead, we can use a more intuitive and easier to set range of lengths wa , wb ∈ [wmin , wmax ]. 6) We can easily modify our fitness criterion to work with different task settings. Thus, just by replacing D, we are able to work with multi-dimensional time series [37], detect sub-dimensional motifs [38], perform a constrained motif discovery task [16], etc. 7) We can incorporate notions of motif frequency to our fitness function and hence expand our similarity-based definition of motif to incorporate both notions [2]. For instance, instead of optimizing for individual motifs mi , weP can optimize sets of motifs M0i of size ri such that 1 mj ∈M0i D(mj ) is minimal. We can choose ri to be a ri minimum frequency of motif appearance or we can even decide to optimize it following any suitable criterion. In addition, using PSO has a number of interesting properties, some of which may be shared with other metaheurisics: 1) We have a straightforward mapping to the problem at hand (Sec. III-A). 2) By construction, we have an anytime algorithm (Sec. II-D). 3) We can obtain accurate and much faster solutions, as compared to the state-of-the-art in time series motif discovery (Sec. V-C). 4) We have an essentially parameter-free algorithm [33]. As will be shown, all our parameter choices turn out to be non-critical to achieve the most competitive performances (Secs. V-A and V-B). 5) We have an easily parallelizable algorithm. The agentbased nature of PSO naturally yields to parallel implementations [32]. 6) We still have the possibility to apply lower bounding techniques to D in order to reduce its computational cost [2], [29]. Among others, we may exploit the particles’ best-sofar values or spatially close dissimilarities. 7) All of these use a simple, easy to implement algorithm requiring low storage capabilities (Sec. III-B). III. SWARMMOTIF A. Main Algorithm Our PSO approach to time series motif discovery is based on the combination of two well-known extensions to the canonical PSO [31]. On one hand, we employ multiple reinitializations of the swarm on stagnation [39]. On the other hand, we exploit the particles’ “local memories” with the intention of forming stable niches across different local minima [40]. The former emulates a parallel multi-swarm approach [35] without the need of having to define the number of swarms and their communication. The latter, when combined with the former, results in a low-complexity niching strategy [35] that does not require niching parameters (see the related discussion in [41], [42]). SWARMMOTIF, the implementation of the two extensions, is detailed in Algorithm 1. SWARMMOTIF takes a time series z of length n as input, together with a segment dissimilarity measure D, and the range of segment lengths of interest, limited by wmin and wmax . The user also needs to specify k, the desired number of motifs, and tmax , the maximum time spent by the algorithm (in iterations5 ). SWARMMOTIF outputs a set of k nonoverlapping motifs M. We implement M as a priority queue, which typically stores more than k elements to ensure that it contains k non-overlapping motifs. This way, by sorting the motif candidates as soon as they are found, we allow potential queries to M at any time during the algorithm’s execution. In that case, we only need to dynamically check the candidates’ overlap (Sec. III-B). Notice that n, D, wmin , wmax , k, and tmax are not parameters of the algorithm, but requirements of the task (they depend on the data, the problem, and the available time). The only parameters to be set, as specified in Algorithm 1’s requirements, are the number of particles κ, the topology θ, the constriction constant φ, and the maximum amount of iterations at stagnation τ . Nevertheless, we will show that practically none of the possible parameter choices 5 The number of iterations is easy to infer from the available time as, for the same input, the elapsed time will be roughly directly proportional to the number of iterations. 5 Algorithm 1 SWARMMOTIF(z,D,wmin ,wmax ,k,tmax ) Algorithm 2 I NITIALIZE S WARM(n,wmin ,wmax ,κ) Input: Time series z of length n, dissimilarity measure D, minimum and maximum segment length wmin and wmax , number of motifs k, and maximum amount of time (number of iterations) tmax . Require: Number of particles κ, topology θ, constriction constant φ, and maximum amount of time at stagnation (number of iterations) τ . Output: A set of motifs M. 1: c0 , c1 , c2 ← G ET C ONSTANTS (φ) 2: X , V, S, P ← I NITIALIZE S WARM (n,wmin ,wmax ,κ) 3: Θ ← I NITIALIZE T OPOLOGY (θ,κ) 4: s∗ ← ∞ 5: M ← E MPTY P RIORITY Q UEUE () 6: for t = 1, . . . tmax 7: for i = 1, . . . κ 8: if VALID P OSITION(xi ) 9: d ← D(xi ) 10: if d < si 11: si ← d 12: pi ← xi 13: M.P USH(d,xi ) 14: if d < s∗ 15: s∗ ← d 16: tupdate ← t 17: for i = 1, . . . κ 18: g←i 19: for j in Θi 20: if sj ≤ sg 21: g←j 22: vi ← c0 vi + c1 u1 ⊗ (pi − xi ) + c2 u2 ⊗ (pg − xi ) 23: xi ← xi + vi 24: if t − tupdate = τ 25: X , V, S, P ← I NITIALIZE S WARM(n,wmin ,wmax ,κ) 26: s∗ ← ∞ 27: return N ON OVERLAPPING (M,k) Input: Time series length n, minimum and maximum segment length wmin and wmax , and number of particles κ. Output: Particle positions X , velocities V, best scores S, and best positions P. 1: for i = 1, . . . κ 2: xi,2 ← wmin + (wmax + 1 − wmin )u 3: xi,4 ← wmin + (wmax + 1 −√wmin )u 4: xi,1 ← 1 + (n − xi,2 )(1 − u) 5: xi,3 ← 1 + (n − xi,4 − (xi,1 + xi,2 ))u 6: x0 ← As in lines 2–5 7: vi ← x0 − xi 8: si ← ∞ 9: pi ← xi 10: return X , V, S, P introduces a significant variation in the reported performance (Sec. V-A). Having clarified SWARMMOTIF’s input, output, and requirements, we now elaborate on its procedures. Algorithm 1 starts by computing the velocity update constants (line 1) following Clerc’s constriction method [43], i.e., c0 = 2−φ− 2 p φ2 − 4φ and c1 = c2 = c0 φ/2. (1) Next, a swarm with κ particles is initialized (line 2). The swarm is formed by four data structures: a set of particle positions X = {x1 , . . . xκ }, a set of particle velocities V = {v1 , . . . vκ }, a set of particle best scores S = {s1 , . . . sκ }, and a set of particle best positions P = {p1 , . . . pκ } (the initialization of these four data structures is detailed in Algorithm 2). Particles’ positions xi and pi completely determine a motif candidate, and have a direct correspondence with mi (see Sec. III-B). A further data structure Θ indicates the indices of the neighbors of each particle according to a given social topology θ (line 3). Apart from the swarm, we also initialize a global best score s∗ (line 4) and the priority queue M (line 5). We then enter the main loop (lines 6–26). In it, we perform three main actions. Firstly, we compute the particles’ fitness and perform the necessary updates (lines 7–16). Secondly, we modify the particles’ position and velocity using their personal and neighborhood best positions (lines 17–23). Thirdly, we control for stagnation and reinitialize the swarm if needed (lines 24–26). Finally, when we exit the loop, we return the first k non-overlapping motif candidates from M (line 27). The particles’ fitness loop (lines 7–16) can be described as follows. For the particles that have a valid position within the ranges used for particle initializations (line 8; see also Algorithm 2 for initializations), we calculate their fitness D (line 9) and, if needed, update their personal bests si and pi (lines 10–12). As mentioned, D needs to be independent of the segments’ lengths, which is typically an easy condition for time series dissimilarity measures (Sec. II-A). In the case that the particles find a new personal best, we save the motif dissimilarity d and its position xi into M (line 13). Next, we update tupdate , the last iteration when an improvement of the global best score s∗ has occurred (lines 14–16). The particles’ update loop (lines 17–23) is straightforward. We first select each particle’s best neighbor g using the neighborhood personal best scores sj (lines 18–21). Then, we use the positions of the best neighbor’s personal best pg and the particle’s personal best pi to compute its new velocity and position (lines 22–23). We employ componentwise multiplication, denoted by ⊗, and two random vectors u1 and u2 whose individual components ui,j = U (0, 1), being U (l, h) a uniform real random number generator such that l ≤ U (l, h) < h. Note that by considering the particles’ neighborhood personal bests pg we follow the aforementioned local neighborhood niching strategy [40]. At the end of the loop we control for stagnation by counting the number of iterations since the last global best update and applying a threshold τ (line 24). Note that this is the mechanism responsible for the 6 aforementioned multiple reinitialization strategy [39]. The initialization of the swarm used in Algorithm 1 (lines 2 and 25) is further detailed in Algorithm 2. In it, for each particle, two random positions xi and x0 are drawn (lines 2–6) and the initial velocity is computed as the subtraction of the two (line 7). To obtain xi and x0 , uniform real random numbers u = U (0, 1) are subsequently generated. The personal best score si is set to infinite (line 8) and √ xi is taken as the current best position pi (line 9). Note that u (line 4) is used to ensure a uniform distribution of the particles across the triangular subspace formed by xi,1 and xi,3 (line 5; see also Sec. II-A). Algorithm 3 Variations to Algorithm 1: sociability (lines 1–2), stochastic (line 3), velocity clamping (lines 4–6), and craziness (lines 7–10). B. Implementation Details 7: 8: 9: 10: Some implementation details are missing in Algorithms 1 and 2. Firstly, positions xi are floored component-wise inside VALID P OSITION, D, and M (thus obtaining motif mi ). Secondly, the motif priority queue M is implemented as an associative container (logarithmic insertion time) that sorts its elements according to d and stores mi . Thirdly, the last visited positions are cached into a hash table (constant lookup time) in order to avoid some of the possible repeated dissimilarity computations. Fourthly, we incorporate the option to constrain the motif search by specifying a maximum segment stretch in Algorithm 2 and VALID P OSITION. Finally, the function that returns the non-overlapping top-k motifs employs a boolean array of size n in order to avoid O(k 2 ) comparisons between members of the queue (cf. [3]). Notice that we have a memoryefficient implementation, as we basically only need to store z and the boolean array (both of O(n) space), M (of O(k) space, k  n), and X , V, S, P, and Θ (all of them of O(κ) space, κ  n). The aforementioned hash table (optional) can be allocated in any predefined, available memory segment. For the sake of brevity, the interested reader is referred to the provided code for a full account of the outlined implementation details. C. Variants Given the main Algorithm 1, we consider a number of variations that may potentially improve SWARMMOTIF’s performance without introducing too much algorithmic complexity: • Sociability: We study whether a “cognitive-only” model, a “social-only” one, or different weightings of the two yield to some improvements [44]. To do so, we just need to introduce a parameter α ∈ [0, 1] controlling the degree of ‘sociability’ of the particles, and implement lines 1–2 of Algorithm 3 instead of Eq. 1. • Stochastic: We investigate the use of a random inertia weight [39]. This may alleviate the need of using the same c0 in different environments, providing a potentially more adaptive trade-off between exploration and exploitation (also controlled by α in the previous point). To consider this variant, we just need to replace line 22 in Algorithm 1 by line 3 in Algorithm 3. • Velocity clamping: In addition to constriction, we study limiting the maximum velocity of the particles [45]. Empirical studies have shown that the simultaneous consideration of a 1: 2: c1 ← c0 φ(1 − α) c2 ← c0 φα 3: vi ← (1−2(1−c0 ))uvi +c1 u1 ⊗(pi −xi )+c2 u2 ⊗(pg −xi ) vrange ← [n, w∆ , n, w∆ ]/2 for vjrange in vrange 6: vi,j ← min(vjrange , max(−vjrange , vi,j )) 4: 5: • v0i ← As in Algorithm 2 for vi,j in vi if u < ρ 0 vi,j ← vi,j . constriction factor and velocity clamping results in improved performance on certain problems [46]. To apply velocity clamping we add lines 4–6 of Algorithm 3 between lines 22 and 23 of Algorithm 1. Craziness: We introduce so-called “craziness” or “perturbation” in the particles’ velocities, as initially suggested by Kennedy & Eberhart [45]. In such variant, inspired by the sudden direction changes observed in flocking birds, the particles’ velocity is altered with a certain probability ρ, with the aim of favoring exploration by increasing directional diversity and discouraging premature convergence [47]. We coincide with [47] in that, in some sense, this can be seen as a mutation operation. To implement craziness we add lines 7–10 of Algorithm 3 between lines 22 and 23 of Algorithm 1. IV. E VALUATION M ETHODOLOGY To evaluate SWARMMOTIF’s speed and accuracy we consider plots like the one presented in Fig. 3. As a reference, we draw uniform random samples from the motif search space and compute their dissimilarities (we take as many samples as the length n of the time series). As a baseline, we use the top25 motifs found by MOEN [3], which we will denote by M∗ . Existing empirical evidence [3], [17] suggests that MOEN is the most efficient algorithm to retrieve the top exact similaritybased motifs in a range of lengths6 (Sec. I). Notice furthermore that here we are not that interested in obtaining all top-25 true exact motifs, but more concerned on obtaining good seed motifs within these using an anytime approach (Sec. II-C). As its competitors, MOEN has however some limitations (Sec. I). Thus, to fairly compare results, we have to apply some constrains to our algorithm. Since MOEN can only use the Euclidean distance between z-normalized segments, here we also adopt this formulation for D. In addition, as MOEN only considers pairs of segments of the same length (without resampling), we have to constrain SWARMMOTIF so 6 Besides, we could not find any other promising exact or anytime approach with some available code, nor with sufficient detail to allow a reliable implementation. 7 TABLE I C HARACTERISTICS OF THE TIME SERIES USED FOR EVALUATION , TOGETHER WITH THE CONSIDERED SEGMENT LENGTH RANGES . Name D OW J ONES C AR C OUNT I NSECT EEG F IELD R ECORDING W IND P OWER EOG R ANDOM WALK Duration 129 y 175 d 32 min 1h 3h 4y 32 months 9h - Sample Rate 1 d−1 1/5 min−1 38 Hz 50 Hz 21.5 Hz 1/6 min−1 1/5 min−1 25 Hz - n 35503 47534 73929 180214 226383 369138 410608 809948 1000000 wmin 30 270 300 150 50 200 250 150 100 wmax 300 320 500 250 150 280 620 200 250 that xi,2 = xi,4 . Therefore, the reported motif dissimilarities D(mi ) correspond to the Euclidean distance between two znormalized segments of the same length (we divide by the length of the segments to compare different segment lengths, Sec. II-A). In the reported experiments, SWARMMOTIF is run 10 times with k = 10. We stop its execution when we find 95% of D(mi ) within M∗ . This way, we assess the time taken to retrieve any 10 motifs from those with at least 95% confidence. All experiments are performed using a single core of an Intel R Xeon R CPU E5-2620 at 2.00 GHz. To demonstrate that SWARMMOTIF is not biased towards a particular data source, time series length, or motif length, we consider 9 different time series of varying length, coming from distinct domains, and a number of arbitrary but sourceconsistent motif lengths (Table I). As mentioned, we make these time series and our code available online (Sec. I). Four of the time series have been used for motif discovery in previous studies [17], [48], while the other five are employed here for the first time for this task: 1) D OW J ONES: The daily closing values of the Dow Jones average in the USA from May 2, 1885 to April 22, 2014 [49]. 2) C AR C OUNT: The number of cars measured for the Glendale on ramp for the 101 North freeway in Los Angeles, CA, USA [50]. The measurement was carried out by the Freeway Performance Measurement System7 and the data was retrieved from the UCI Machine Learning Repository [51]. Segments of missing values were manually interpolated or removed. 3) I NSECT: The electrical penetration graph of a beet leafhopper (circulifer tenellus) [17]. The time series was retrieved from Mueen’s website8 . 4) EEG: A one hour electroencephalogram (in µV) from a single channel in a sleeping patient [17]. The time series was retrieved from Mueen’s website9 and, according to the authors, was smoothed and filtered using domain-standard procedures. 5) F IELD R ECORDING: The spectral centroid (in Hz) of a field recording retrieved from Freesound10 [52]. We used the mean of the stereo channels and the spectral centroid 7 http://pems.dot.ca.gov 8 http://www.cs.ucr.edu/∼mueen/MK 9 http://www.cs.ucr.edu/∼mueen/OnlineMotif 10 http://www.freesound.org/people/JeffWojo/sounds/121250 (linear frequency) Vamp SDK example plugin from Sonic Visualizer [53]. We used a Hann window of 8192 samples at 44.1 KHz with 75% overlap. 6) W IND: The wind speed (in m/s) registered in the buoy of Rincon del San Jose, TX, USA, between January 1, 2010 and April 11, 2014. The time series was retrieved from the Texas Coastal Ocean Observation Network website11 . Segments of missing values were manually interpolated or removed. 7) P OWER: The electric power consumption (in KW) of an individual household12 . The data was retrieved from the UCI Machine Learning Repository [51]. We took the global active power, removed missing values, and downsampled the original time series by a factor of 5 using averaging and 50% overlap. 8) EOG: An electrooculogram tracking the eye movements of a sleeping patient [54]. We took the downsampled time series [48] from Mueen’s web page13 . 9) R ANDOM WALK: A random walk time series. This was artificially synthesized using zi+1 = zi + N (0, 1) for i = 2, . . . n and z1 = 0, where N (0, 1) is a real Gaussian random number generator with zero mean and unit variance. To assess the statistical significance of the differences between alternative parameter settings, we employ a two stage approach. First, we consider all settings at the same time and perform the Friedman’s test [55], which is a non-parametric statistical test used to detect differences in treatments across multiple test attempts. We use as inputs the median values for all settings for 25 equally-spaced time steps. In the case some difference between settings is detected (i.e., we reject the null hypothesis that the settings’ performances come from the same distribution), we proceed to the second stage. In it, we perform all possible pairwise comparisons between settings using the Wilcoxon signed-rank test [55], another non-parametric statistical hypothesis test used for comparing matched samples. To counteract the problem of multiple comparisons and control the so-called family-wise error rate, we employ the HolmBonferroni correction [56]. In all statistical tests, we consider a significance level of 0.01. V. R ESULTS A. Configuration In pre-analysis, and according to common practice, we set κ = 100, φ = 4.1, and τ = 2000. We then experimented with 6 different static topologies θ [57]: global best, local best (two neighbors), Von Neumann, random (three neighbors), wheel, and binary tree. The results showed the qualitative equivalence of all topologies except, perhaps, global best and wheel (Fig. 4). In some data sets, these two turned out to yield slightly worse performances for short-time runs of the algorithm (small t), although for longer runs they gradually became equivalent to the rest. However, in general, 11 http://lighthouse.tamucc.edu/pq 12 http://archive.ics.uci.edu/ml/datasets/Individual+household+electric+ power+consumption 13 http://www.cs.ucr.edu/∼mueen/DAME 8 0.1304 0.1219 Global best Local best Von Neumann Random Wheel Binary tree 0.0749 20 40 80 160 320 0.0742 0.0430 D(mi) D(mi) 0.0452 0.0247 0.0276 0.0142 0.0168 0.0102 0.0082 10 1 2 10 10 3 10 4 10 0 1 10 10 2 t [s] no systematic statistically significant difference was detected between topologies. With this in mind, we chose the local best topology to further favor exploration and parallelism, and to be more consistent with our local neighborhood design principle of Sec. III-A. Next, we studied the effect of the number of particles κ and the stagnation threshold τ . To do so, we kept the previous configuration with the local best topology and subsequently evaluated κ = {20, 40, 80, 160, 320} and τ = {500, 1000, 2000, 4000, 8000}. Essentially, we observed almost no performance changes under these alternative settings (Figs. 5 and 6). We only found a statistically significant difference in the case of the C AR C OUNT data set. Specifically, the performance with τ = 500 was found to be statistically significantly worse than τ ≥ 2000. Regarding κ, and after considering different n, w∆ and k, a partial tendency seemed to emerge: an increasing number of particles κ was slightly beneficial for increasing lengths n, increasing w∆ , and increasing k. Unfortunately, we could not obtain strong empirical evidence nor formal proof for this statement. Nonetheless, in subsequent experiments, we decided to use a value for κ and τ that dynamically adapts SWARMMOTIF’s configuration to such predefined task parameters. We arbitrarily set τ proportional to κ, and κ proportional to n and in direct relation to w∆ and k (we refer to the provided code for the exact formulation). To conclude our pre-analysis, we studied the influence of the constriction constant φ. Following common practice, we considered φ = {4.02, 4.05, 4.1, 4.2, 4.4, 4.8}. In this case, we saw that high values had a negative impact on performance (Fig. 7). In particular, values of φ ≥ 4.2 or φ ≥ 4.4, depending on the data set, statistically significantly increased the motif dissimilarities at a given t. Contrastingly, values 4 < φ < 4.2 yielded stable dissimilarities with no statistically significant variation (in some data sets, this range could be extended to 4 < φ ≤ 4.4). It is well-known that higher φ values favor exploitation rather than exploration [43]. Hence, it is not 3 4 10 t [s] Fig. 5. Effect of κ on the W IND time series. Equivalent results were observed with the other time series. 0.2012 500 1000 2000 4000 8000 0.1316 0.0860 D(mi) Fig. 4. Effect of θ on the EEG time series. Equivalent results were observed with the other time series. 10 0.0562 0.0368 0.0240 0 10 10 1 10 2 3 10 4 10 t [s] Fig. 6. Effect of τ on the F IELD R ECORDING time series. Equivalent results were observed with the other time series. strange to observe that low φ values are more appropriate for searching the large motif spaces we consider here. We finally chose φ = 4.05. Overall, the result of our pre-analysis suggests a high degree of robustness with respect to the possible configurations. The topology θ, the number of particles κ, the stagnation threshold τ , and the constriction constant φ have, in general, no significant influence on the obtained results. The only consistent exception is observed for values of φ ≥ 4.4, which are not the most common practice [34]. The global best and wheel topologies could also constitute a further exception. However, as we have shown, these become qualitatively equivalent to the rest as execution time t increases, yielding no statistically significant difference. We believe that the reported stability of SWARMMOTIF against the tested configurations and data sets justifies the use of our setting for finding motifs in diverse time series coming from further application domains. 9 0.0895 0.1304 4.02 4.05 4.1 4.2 4.4 4.8 0.0579 0 0.00001 0.0001 0.001 0.01 0.1 0.0749 0.0430 D(mi) D(mi) 0.0375 0.0243 0.0247 0.0157 0.0142 0.0102 0.0082 0 10 1 10 2 10 t [s] 10 3 4 10 10 1 2 3 10 10 4 10 t [s] Fig. 7. Effect of φ on the I NSECT time series. Equivalent results were observed with the other time series. Fig. 8. Effect of ρ on the EEG time series. Equivalent results were observed with the other time series. B. Variants C. Final Performance Using the configuration resulting from the previous section, we subsequently assessed the performance of the variations considered in Sec. III-C. We started with the sociability variant, experimenting with social-only models, α = 1, cognitive-only models, α = 0, and intermediate configurations, α = {0.2, 0.33, 0.66, 0.8}. Apart from the fact that no clear tendency could be observed, none of the previous settings was able to consistently reach the performance achieved by the original variant (α = 1/2, Eq. 1) in all time series. That is, none of the previous settings could statistically significantly outperform α = 1/2 in the majority of the data sets. Next, we experimented with the stochastic and the velocity clamping variants. While the former did not improve our results, the latter led to a statistically significant improvement for some time series. Because of that, we decided to discard the use of a stochastic variant but to incorporate velocity clamping to our main algorithm. The former could be difficult to justify while the latter has empirical evidence behind it (Sec. III-C). Finally, we experimented with craziness and its probability ρ. The results showed a similar performance for 0 ≤ ρ < 0.001, a slightly better performance for 0.001 ≤ ρ ≤ 0.01, and an increasingly worse performance for ρ > 0.01 (Fig. 8). A statistically significant difference was found between ρ ≤ 0.01 and ρ > 0.1, being ρ > 0.1 a consistently worse setting. These results were expected, as the swarm performs a more random search with increasing ρ, being completely random in the limiting case of ρ = 1. The slightly better performance for 0.001 ≤ ρ ≤ 0.01 was not found to be statistically significant under our criteria. However, it was visually noticeable for some data sets. For instance, with the EEG data set, we see that curves 33 and 34 hit the dissimilarities of the true exact motif set M∗ (gray area) two or three times earlier than curves 30, 31, and 32 (Fig. 8). With these results, and seeing that ρ values between 0.001 and 0.01 never harmed the performance of the algorithm, we chose ρ = 0.002. After extending SWARMMOTIF with velocity clamping and craziness, we assess its performance on all considered time series using the default parameter combination resulting from the previous two sections. As can be seen, the obtained motif dissimilarities are far from the random sampling in all cases (Fig. 9; notice the logarithmic axes). In addition, we see that SWARMMOTIF is able to already obtain dissimilarities within M∗ as soon as its execution begins. Specifically, motif dissimilarities in M start to overlap the ones in M∗ at t < 10 s for practically all time series. The only exceptions are EOG and R ANDOM WALK, where M starts to overlap with M∗ at t < 100 s. We hypothesize that taking a smaller number of particles κ could make M overlap with M∗ earlier, but leave the formal assessment of this hypothesis for future work. Finally, as execution time t progresses, we see that SWARMMOTIF consistently retrieves lower dissimilarities, up to the point that M ' M∗ (Fig. 9 and Table II). Following the condition we specify in Sec. IV, this means that the distances in the motif set obtained by SWARMMOTIF are not statistically worse than the ones of the true exact motif set. With respect to MOEN’s execution time, this happens 1487 (D OW J ONES), 184 (C AR C OUNT), 50 (I NSECT), 179 (EEG), 100 (F IELD R ECORDING), 241 (W IND), 286 (P OWER), 74 (EOG), and 287 (R ANDOM WALK) times faster. This implies between one and three orders of magnitude speedups (more than that for D OW J ONES). Overall, we believe this is an extremely competitive performance for an anytime motif discovery algorithm. VI. C ONCLUSION In this article, we propose an innovative standpoint to the task of time series motif discovery by formulating it as an anytime multimodal optimization problem. After a concise but comprehensive literature review, we reason out the new formulation and the development of an approach based on 10 0.1163 0.0766 0.0579 0.0602 0.0564 0.0375 0.0312 D(mi) C 0.0895 D(mi) B 0.1040 D(mi) A 0.2243 0.0415 0.0306 0.0162 0.0157 0.0225 0.0084 0 10 10 1 2 3 10 t [s] 10 0.0243 0.0102 10 0 1 10 10 2 3 10 10 0.1316 0.0742 0.0430 0.0860 0.0452 0.0247 D(mi) 0.0749 D(mi) F 0.1219 D(mi) E 0.2012 0.0562 0.0368 0.0142 10 10 3 10 10 1 2 10 t [s] 0.0276 3 4 10 t [s] 1 10 10 0.0800 0.0879 0.0380 0.0515 0.0482 0.0159 I D(mi) 0.0588 D(mi) H 0.1242 D(mi) G 0.0911 0.0246 0.0332 0.0213 0.0102 10 2 10 10 3 10 4 10 5 10 2 3 4 10 t [s] 10 0.1601 0.0264 0.0145 0.0137 1 4 10 0.0102 4 10 3 10 0.0168 0.0240 0.0082 2 2 10 t [s] t [s] D 0.1304 1 1 0.0080 1 10 10 2 t [s] 3 10 10 t [s] 4 10 5 2 10 10 3 4 10 5 10 t [s] Fig. 9. SWARMMOTIF performance on the considered time series: (A) D OW J ONES, (B) C AR C OUNT, (C) I NSECT, (D) EEG, (E), F IELD R ECORDING, (F) W IND, (G) P OWER, (H) EOG, and (I) R ANDOM WALK. evolutionary computation. We then highlight the several advantages of this new formulation, many of which relate to a high degree of flexibility of the solutions that come from it. To the best of our knowledge, such a degree of flexibility is unseen in previous works on time series motif discovery. We next present SWARMMOTIF, an anytime multimodal optimization algorithm for time series motif discovery based on particle swarms. We show that SWARMMOTIF is extremely competitive when compared to the best approach we could find in the literature. It obtains motifs of comparable similarities, in considerably less time, and with minimum memory requirements. This is confirmed with 9 independent real-world time series of increasing length coming from a variety of domains. Besides, we find that the high majority of the possible implementation choices lead to non-significant performance changes in all considered time series. Thus, given this robustness, we can think about the proposed solution as being parameter-free from the user’s perspective. Overall, if we add the aforementioned, unprecedented degree of flexibility, SWARMMOTIF stands out as one of the most prominent choices for motif discovery in long time series streams. Since the used data and code are available online (Sec. I), the research presented here is fully reproducible, and SWARMMOTIF is freely available to researchers and practitioners. We believe that the consideration of multimodal optimization algorithms is a relevant direction for future research in the field of time series analysis and mining. Not only with regard to motif discovery, but also in other tasks such as querying for segments of unknown length [28] or determining optimal alignments and similarities [23]. With regard to the latter, we envision powerful approaches to variable-length local similarity calculations, in the vein of existing dynamic programming approaches [58], [59]. Finally, we believe that considering the search spaces and the time constraints derived from time series problems can be a challenge for the evolutionary computation community. We look forward to exploring all these topics in forthcoming works, together with 11 TABLE II C OMPARISON BETWEEN MOEN AND SWARMMOTIF RESULTS . T HE LATTER ARE TAKEN AT THE TIME WHEN THE DEFINED STOPPING CRITERION IS MET (S EC . IV). R ESULTS FOR OTHER TIME STEPS ARE AVAILABLE ONLINE (S EC . I). Approach MOEN SWARMMOTIF Result t [s] D(mi )∗ median D(mi )∗ min D(mi )∗ max t [s] D(mi ) median D(mi ) 5th percentile D(mi ) 95th percentile D OW J ONES 2933.9 0.0147 0.0084 0.0191 2.0 0.0132 0.0087 0.0182 D ODGERS 838.0 0.0260 0.0225 0.0279 4.6 0.0259 0.0234 0.0278 I NSECT 9051.1 0.0140 0.0102 0.0168 180.0 0.0135 0.0121 0.0162 other multimodal optimization techniques that could be easily mapped to the problem of time series motif discovery. ACKNOWLEDGMENT We would like to thank all the people who contributed the data sets used in this study and Abdullah Mueen for additionally sharing his code. We would also like to thank Xavier Anguera for useful discussions that motivated the present work. This research has been funded by 2009-SGR-1434 from Generalitat de Catalunya, JAEDOC069/2010 from Consejo Superior de Investigaciones Cientı́ficas (JS), TIN2012-38450C03-03 from the Spanish Government, and E.U. Social and FEDER funds (JS). R EFERENCES [1] J. Lin, E. Keogh, S. Lonardi, and P. Patel, “Finding motifs in time series,” in Proc. of the Workshop on Temporal Data Mining, 2002, pp. 53–56. [2] A. Mueen, “Time series motif discovery: dimensions and applications,” WIREs Data Mining and Knowledge Discovery, vol. 4, no. 2, pp. 152– 159, 2014. [3] ——, “Enumeration of time series motifs of all lengths,” in Proc. of the IEEE Int. Conf. on Data Mining (ICDM), 2013, pp. 547–556. [4] B. Chiu, E. Keogh, and S. Lonardi, “Probabilistic discovery of time series motifs,” in Proc. of the ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining (KDD), 2003, pp. 493–498. [5] J. Lin, E. Keogh, L. Wei, and S. Lonardi, “Experiencing SAX: a novel symbolic representation of time series,” Data Mining and Knowledge Discovery, vol. 15, no. 2, pp. 107–144, 2007. [6] J. Buhler and M. Tompa, “Finding motifs using random projections,” Journal of Computational Biology, vol. 9, no. 2, pp. 225–242, 2002. [7] N. Castro and P. Azevedo, “Multiresolution motif discovery in time series,” in Proc. of the SIAM Int. Conf. on Data Mining (SDM), 2010, pp. 665–676. [8] Y. Li and J. Lin, “Approximate variable-length time series motif discovery using grammar inference,” in Proc. of the Int. Workshop on Multimedia Data Mining (MDM), 2010, p. 10. [9] W. Wilson, P. Birkin, and U. Aickelin, “The motif tracking algorithm,” International Journal of Automation and Computing, vol. 5, no. 1, pp. 32–44, 2008. [10] A. Floratou, S. Tata, and J. M. Patel, “Efficient and accurate discovery of patterns in sequence data sets,” IEEE Trans. on Knowledge and Data Engineering, vol. 23, no. 8, pp. 1154–1168, 2011. [11] S. Zilberstein, “Using anytime algorithms in intelligent systems,” AI Magazine, vol. 17, no. 3, pp. 73–83, 1996. [12] Y. Tanaka, K. Iwamoto, and K. Uehara, “Discovery of time-series motif from multi-dimensional data based on MDL principle,” Machine Learning, vol. 58, pp. 269–300, 2005. [13] D. Yankov, E. Keogh, J. Medina, B. Chiu, and V. Zordan, “Detecting time series motifs under uniform scaling,” in Proc. of the ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining (KDD), 2007, pp. 844–853. [14] H. Tang and S. S. Liao, “Discovering original motifs with different lengths from time series,” Knowledge-Based Systems, vol. 21, pp. 666– 671, 2008. EEG 21596.0 0.0119 0.0081 0.0131 120.6 0.0119 0.0090 0.0130 F IELD R ECORDING 76415.0 0.0301 0.0240 0.0347 764.8 0.0315 0.0239 0.0341 W IND 70727.2 0.0117 0.0102 0.0124 293.1 0.0117 0.0102 0.0122 P OWER 672161.9 0.0199 0.0102 0.0232 2346.5 0.0214 0.0142 0.0230 EOG 430790.3 0.0206 0.0137 0.0218 5807.7 0.0195 0.0163 0.0212 R ANDOM WALK 430676.6 0.0091 0.0080 0.0094 1497.3 0.0090 0.0079 0.0092 [15] J. Catalano, T. Armstrong, and T. Oates, “Discovering patterns in realvalued time series,” in Knowledge Discovery in Databases: PKDD 2006, ser. Lecture Notes on Artificial Intelligence, J. Fürnkranz, T. Scheffer, and M. Spiliopoulou, Eds. Berlin, Germany: Springer, 2006, vol. 4213, pp. 462–469. [16] Y. Mohammad and T. Nishida, “Constrained motif discovery in time series,” New Generation Computing, vol. 27, no. 4, pp. 319–346, 2009. [17] A. Mueen, E. Keogh, Q. Zhu, S. Cash, and B. Westover, “Exact discovery of time series motifs,” in Proc. of the SIAM Int. Conf. on Data Mining (SDM), 2009, pp. 473–484. [18] P. Nunthanid, V. Niennattrakul, and C. A. Ratanamahatana, “Discovery of variable length time series motif,” in Proc. of the Int. Conf. on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON), 2011, pp. 472–475. [19] S. Yingchareonthawornchai, H. Sivaraks, T. Rakthanmanon, and C. A. Ratanamahatana, “Efficient proper length time series motif discovery,” in Proc. of the IEEE Int. Conf. on Data Mining (ICDM), 2013, pp. 1265–1270. [20] Y. Mohammad and T. Nishida, “Exact discovery of length-range motifs,” in Intelligent Information and Database Systems, ser. Lecture Notes in Artificial Intelligence, N. T. Nguyen, B. Attachoo, B. Trawiski, and K. Somboonviwat, Eds. Cham, Switzerland: Springer Int. Publishing, 2014, vol. 8398, pp. 23–32. [21] A. Mueen and E. Keogh, “Online discovery and maintenance of time series motifs,” in Proc. of the ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining (KDD), 2010, pp. 1089–1098. [22] C. A. Ratanamahatana and E. Keogh, “Everything you know about dynamic time warping is wrong,” in ACM SIGKDD Workshop on Mining Temporal and Sequential Data, 2004, pp. 22–25. [23] J. Serrà and J. L. Arcos, “An empirical evaluation of similarity measures for time series classification,” Knowledge-Based Systems, vol. 67, pp. 305–314, 2014. [24] F. S. Hillier and G. J. Lieberman, Introduction to operations research, 9th ed. New York, USA: McGraw-Hill, 2010. [25] C. Blum and A. Roli, “Metaheuristics in combinatorial optimization: overview and conceptual comparison,” ACM Computing Surveys, vol. 35, no. 3, pp. 268–308, 2003. [26] Y. Jin and J. Branke, “Evolutionary optimization in uncertain environments: a survey,” IEEE Trans. on Evolutionary Computation, vol. 9, no. 3, pp. 303–317, 2005. [27] L. Bianchi, M. Dorigo, L. M. Gambardella, and W. J. Gutjahr, “A survey on metaheuristics for stochastic combinatorial optimization,” Natural Computing, vol. 8, no. 2, pp. 239–287, 2009. [28] T. Kahveci and A. K. Singh, “Optimizing similarity search for arbitrary length time series queries,” IEEE Trans. on Knowledge and Data Engineering, vol. 16, no. 4, pp. 418–433, 2004. [29] T. Rakthanmanon, B. Campana, A. Mueen, G. E. A. P. A. Batista, B. Westover, Q. Zhu, J. Zakaria, and E. Keogh, “Searching and mining trillions of time series subsequences under dynamic time warping,” in Proc. of the ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining (KDD), 2012, pp. 262–270. [30] M. Clerc, Particle swarm optimization. London, UK: ISTE, 2006. [31] R. Poli, J. Kennedy, and T. M. Blackwell, “Particle swarm optimization,” Swarm Intelligence, vol. 1, no. 1, pp. 33–57, 2007. [32] A. Banks, J. Vincent, and C. Anyakoha, “A review of particle swarm optimization. Part I: background and development,” Natural Computing, vol. 6, no. 4, pp. 467–484, 2007. [33] C. Blum and D. Merkle, Swarm intelligence. Berlin, Germany: Springer, 2008. [34] K. E. Parsopoulos and M. N. Vrahatis, Particle swarm optimization and 12 [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] intelligence: advances and applications. Hershey, USA: IGI Global, 2010. J. Barrera and C. Coello Coello, “A review of particle swarm optimization methods used for multimodal optimization,” in Innovations in Swarm Intelligence, ser. Studies in Computational Intelligence, C. P. Lim, L. C. Jain, and S. Dehuri, Eds. Berlin, Germany: Springer, 2009, vol. 248, pp. 9–37. F. van der Bergh and A. P. Engelbrecht, “A convergence proof for the particle swarm optimizer,” Fundamenta Informaticae, vol. 105, no. 4, pp. 341–374, 2010. M. C. Hao, M. Marwah, H. Janetzko, U. Dayal, D. A. Keim, D. Patnaik, N. Ramakrishnan, and R. K. Sharma, “Visual exploration of frequent patterns in multivariate time series,” Information Visualization, vol. 11, no. 1, pp. 71–83, 2014. D. Minnen, C. Isbell, I. Essa, and T. Starner, “Detecting subdimensional motifs: an efficient algorithm for generalized multivariate pattern discovery,” in Proc. of the IEEE Int. Conf. on Data Mining (ICDM), 2007, pp. 601–606. R. C. Eberhart and Y. Shi, “Tracking and optimizing dynamic systems with particle swarms,” in Proc. of the IEEE Congress on Evolutionary Computation (CEC), 2001, pp. 94–100. X. Li, “Niching without niching parameters: particle swarm optimization using a ring topology,” IEEE Trans. on Evolutionary Computation, vol. 14, no. 1, pp. 150–169, 2010. M. R. Bonyadi, X. Li, and Z. Michalewicz, “A hybrid particle swarm with a time-adaptive topology for constrained optimization,” Swarm and Evolutionary Computation, vol. 18, pp. 22–37, 2014. M. R. Bonyadi and Z. Michalewicz, “Locating potentially disjoint feasible regions of a search space with a particle swarm optimizer,” in Evolutionary Constrained Optimization. In press. Springer. M. Clerc and J. Kennedy, “The particle swarm - explosion, stability, and convergence in a multidimensional complex space,” IEEE Trans. on Evolutionary Computation, vol. 6, no. 1, pp. 58–73, 2002. J. Kennedy, “The particle swarm: social adaptation of knowledge,” in Proc. of the IEEE Int. Conf. on Evolutionary Computation (CEC), 1997, pp. 303–308. J. Kennedy and R. C. Eberhart, “Particle swarm optimization,” in Proc. of the IEEE Int. Conf. on Neural Networks (ICNN), 1995, pp. 1942– 1948. R. C. Eberhart and Y. Shi, “Comparing inertia weights and constriction factors in particle swarm optimization,” in Proc. of the IEEE Congress on Evolutionary Computation (CEC), 2000, pp. 84–88. P. C. Fourie and A. A. Groenwold, “Particle swarms in size and shape optimization,” in Proc. of the Int. Workshop on Multidisciplinary Design Optimization, 2000, pp. 97–106. A. Mueen, E. Keogh, and N. Bigdely-Shamlo, “Finding time series motifs in disk-resident data,” in Proc. of the IEEE Int. Conf. on Data Mining (ICDM), 2009, pp. 367–376. S. H. Williamson, “Daily closing value of the Dow Jones average, 1885 to present,” 2012. [Online]. Available: http://www.measuringworth.com/ datasets/DJA/index.php A. Ihler, J. Hutchins, and P. Smyth, “Adaptive event detection with timevarying Poisson processes,” in Proc. of the ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining (KDD), 2006, pp. 207–216. K. Bache and M. Lichman, “The UCI machine learning repository,” 2013. [Online]. Available: http://archive.ics.uci.edu/ml F. Font, G. Roma, and X. Serra, “Freesound technical demo,” in Proc. of the ACM Multimedia Int. Conf. (ACM-MM), 2013, pp. 411–412. C. Cannam, C. Landone, and M. B. Sandler, “Sonic Visualiser: an open source application for viewing, analysing, and annotating music audio files,” in Proc. of the ACM Multimedia Int. Conf. (ACM-MM), 2010, pp. 1467–1468. A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M. Hausdorff, P. C. Ivanov, R. G. Mark, J. E. Mietus, G. B. Moody, C.-K. Peng, and H. E. Stanley, “Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals,” Circulation, vol. 101, no. 23, pp. e215–e220, 2000. M. Hollander and D. A. Wolfe, Nonparametric statistical methods, 2nd ed. New York, USA: Wiley, 1999. S. Holm, “A simple sequentially rejective multiple test procedure,” Scandinavian Journal of Statistics, vol. 6, no. 2, pp. 65–70, 1979. R. Mendes, “Population topologies and their influence in particle swarm performance,” Ph.D. dissertation, Escola de Engenharia, Universidade do Minho, Braga, Portugal, 2004. T. F. Smith and M. S. Waterman, “Identification of common molecular subsequences,” Journal of Molecular Biology, vol. 147, pp. 195–197, 1981. [59] J. Serrà, X. Serra, and R. G. Andrzejak, “Cross recurrence quantification for cover song identification,” New Journal of Physics, vol. 11, no. 9, p. 093017, 2009. Joan Serrà is a postdoctoral researcher with the Dept. of Learning Systems of IIIA-CSIC, the Artificial Intelligence Research Institute of the Spanish National Research Council in Bellaterra, Barcelona, Spain. His research focuses on machine learning, data mining, time series, and complex networks with applications to computer audition, music information retrieval, multimedia annotation and, to a much lesser extent, the social and health sciences. He obtained his MSc (2007) and PhD (2011) in Computer Science from Universitat Pompeu Fabra, Barcelona, where he was also an adjunct professor with the Dept. of Information and Communication Technologies (2006–2011). He has been involved in more than 10 publicly-funded research projects and co-authored over 60 publications, some of them highly-cited and in top-tier journals and conferences of diverse scientific areas. He also regularly acts as a reviewer for some of those and other publications. Josep Lluis Arcos is a research scientist of the Artificial Intelligence Research Institute of the Spanish National Research Council (IIIA-CSIC), where he is a member of the Learning Systems Department. He received the MSc (1991) and PhD (1997) in Computer Science from the Technical University of Catalonia, Spain. He also received a MSc in Sound and Music Technology (1996) from the Pompeu Fabra University, Spain. He is co-author of more than 125 scientific publications with contributions on machine learning, case-based reasoning, multiagent systems, self-organizing systems, or AI and music. He is co-recipient of several awards at case-based reasoning and computer music conferences. Presently, he is working on machine learning and on its applications to health care, Internet, and music domains. He acts as a reviewer of several international journals and of top international conferences.
9cs.NE
MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS arXiv:1510.04124v2 [math.AG] 12 Sep 2016 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT Abstract. Matrix Schubert varieties are certain varieties in the affine space of square matrices which are determined by specifying rank conditions on submatrices. We study these varieties for generic matrices, symmetric matrices, and upper triangular matrices in view of two applications to algebraic statistics: we observe that special conditional independence models for Gaussian random variables are intersections of matrix Schubert varieties in the symmetric case. Consequently, we obtain a combinatorial primary decomposition algorithm for some conditional independence ideals. We also characterize the vanishing ideals of Gaussian graphical models for generalized Markov chains. In the course of this investigation, we are led to consider three related stratifications, which come from the Schubert stratification of a flag variety. We provide some combinatorial results, including describing the stratifications using the language of rank arrays and enumerating the strata in each case. Contents 1. Introduction 2. Stratifying three spaces of matrices 3. Matrix Schubert varieties and their analogs for symmetric and upper triangular matrices 4. Application to Gaussian Conditional Independence Models 5. On the combinatorics of the three stratifications References 1 4 12 17 24 33 1. Introduction An m-dimensional Gaussian random vector X = (X1 , . . . , Xm ) ∼ N (µ, Σ) has its conditional independence structure completely determined by rank conditions on its covariance matrix Σ, which is an m × m symmetric positive definite matrix. For a subset A of [m] := {1, 2, . . . , m}, let XA = (Xa )a∈A be the subvector of X indexed by A. For A, B ⊆ [m] let ΣA,B denote the submatrix of Σ = (σi,j )i,j∈[m] with row index set A and column index set B; that is ΣA,B = (σa,b )a∈A,b∈B . Proposition 1.1. Let X ∼ N (µ, Σ). Then for disjoint subsets A, B, C ⊆ [m], the conditional independence statement XA ⊥⊥ XB | XC (read “XA is independent of XB given XC ”) holds if and only if (1) rank ΣA∪C,B∪C = #C. 1 2 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT For the purposes of this paper, Proposition 1.1 can be taken as the definition of the conditional independence statement XA ⊥⊥ XB | XC , since this is the only fact we will need in our study. Note that we often use A ⊥⊥ B | C to denote the conditional independence statement XA ⊥⊥ XB | XC . A precise definition of conditional independence structures and the derivation of Proposition 1.1 can be found in [DSS09]. Since Σ is a positive definite matrix, the condition (1) can be replaced with (2) rank ΣA∪C,B∪C ≤ #C. without changing the resulting matrices that arise. Consequently, it is natural to use commutative algebra, in particular determinantal varieties, to study the conditional independence structure of a Gaussian random vector. An important problem in the abstract theory of conditional independence is to understand when collections of conditional independence constraints imply other constraints. For example, for Gaussian random variables, the two constraints X1 ⊥⊥ X3 and X1 ⊥⊥ X3 | X2 imply that either X1 ⊥⊥ (X2 , X3 ) or (X1 , X2 ) ⊥⊥ X3 (see Example 4.3 for a derivation). While a complete understanding of such implications is probably impossible [Sul09], one hopes that the study of determinantal varieties and their intersections might shed light upon conditional independence implications. In this direction, one associates to each conditional independence statement A ⊥⊥ B | C the conditional independence ideal JA⊥⊥B|C = h#C + 1 minors of ΣA∪C,B∪C i ⊆ C[Σ] and to a list of conditional independence statements, C = {A1 ⊥⊥ B1 | C1 , A2 ⊥⊥ B2 | C2 , · · · } the ideal JC = JA1 ⊥⊥B1 |C1 + JA2 ⊥⊥B2 |C2 + · · · . The set of conditional independence statements C for Gaussian random variables will imply the conditional independence statement A ⊥⊥ B | C if p JA⊥⊥B|C ⊆ JC . Many implications have the form of a disjunction; i.e. a collection of conditional independence statements C implies that one in a list of other statements must √ hold. Such implications are detected by computing the primary decomposition of JC . Given the inherent difficulty of computing primary decompositions of general ideals, it is natural to look for subfamilies of conditional independence statements where the ideals JC are radical and the primary decomposition is easy to compute. In the present paper, we restrict to a family of conditional independence ideals which define analogs of Fulton’s matrix Schubert varieties (see [Ful92], [KM05]) for symmetric matrices. These symmetric matrix Schubert varieties are indexed by permutations in the symmetric group Sm and are obtained by imposing rank conditions on North-East justified submatrices. These varieties are all reduced, and primary decomposition of their radical defining ideals can be computed using the combinatorics of Bruhat order on Sm . MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 3 Consequently, we obtain a combinatorial algorithm for decomposing conditional independence ideals when we restrict to certain families of “North-East” conditional independence constraints. A second and related problem concerns finding the vanishing ideals of Gaussian graphical models. Specifically, let G = ([m], B, D) be a mixed graph with B denoting a set of bidirected edges i ↔ j and D denoting a set of directed edges i → j. (This structure can be seen as an undirected graph ([m], B) and a directed graph ([m], D) sharing a vertex set.) For the specific results of the present paper, we will restrict to the case that the set of directed edges forms a directed acyclic graph, i.e. there are no directed cycles. This means we can reorder the vertices in such a way that if there is an edge i → j ∈ D then i < j. For each edge i → j ∈ D introduce a parameter λij ∈ R. Let Λ be the m × m matrix such that  λij if i → j ∈ D Λij = 0 otherwise. Let RD denote the set of all such matrices Λ. Let P Dm denote the set of m×m symmetric positive definite matrices. Let P D(B) := {Ω ∈ P Dm : Ωij = 0 if i 6= j and i ↔ j ∈ / B}. The Gaussian random vector associated to the mixed graph G with Λ ∈ RD and Ω ∈ P D(B) has X ∼ N (µ, Σ) where Σ = (I − Λ)−T Ω(I − Λ)−1 and A−T is shorthand for (A−1 )T . The Gaussian graphical model associated to G is the set of such positive definite covariance matrices that can arise: MG = {Σ = (I − Λ)−T Ω(I − Λ)−1 : Λ ∈ RD , Ω ∈ P D(B)}. One studies the vanishing ideals of these models, denoted JG = hf ∈ R[Σ] : f (Σ) = 0 for all Σ ∈ MG i. For general mixed graphs G, we currently know no explicit list of ideal generators of JG . In this paper, we find an explicit list of generators in the case where G is a generalized Markov chain (see Definition 4.14). To do this, we identify the varieties V(JG ) with symmetric matrix Schubert varieties. This is done by comparing parametrizations for Gaussian graphical models with parametrizations for symmetric matrix Schubert varieties (see Theorem 4.15). Symmetric matrix Schubert varieties play an important role in both of the abovedescribed statistics problems, and so a substantial portion of this paper is devoted to the study of these varieties and related varieties. We prove results about these varieties that are interesting for their own sake, and not directly related to the conditional independence applications. The paper is structured as follows: • In Section 2, we consider three spaces of matrices: generic m × m matrices, m × m symmetric matrices, and m×m upper triangular matrices. Each of these spaces of matrices has a stratification naturally induced by the Schubert stratification of an appropriate flag variety. The determinantal defining ideal of each closed stratum is 4 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT obtained by imposing rank conditions on North-East justified submatrices, SouthWest justified submatrices, and on vertical or horizontal bands of entries, and we write down the prime ideal defining each closed stratum. We also show that each poset of strata, ordered by inclusion, is isomorphic to a type A or C Bruhat interval (see Proposition 2.1). This material follows naturally from well-known facts about Schubert varieties. We provide a complete explanation so that the reader need not be familiar with the theory of Schubert varieties. • In Section 3, we turn our attention to matrix Schubert varieties. These are wellunderstood in the setting of generic matrices (see [Ful92], [KM05]): in this case, the defining ideals are prime, the natural generators form a Gröbner basis for any diagonal term order, and the intersection of a collection of matrix Schubert varieties is a reduced union of others. We show that the same results hold for matrix Schubert subvarieties of upper triangular1 and symmetric matrices. A key ingredient in our proof is to identify each matrix Schubert variety with a stratum from Section 2 in order to show that the determinantal defining ideals are prime – this is one of our main reasons for involving the more general stratification from Section 2. We then give parametrizations of matrix Schubert varieties for symmetric matrices; our parametrizations are analogous to the familiar parametrizations of (generic and upper triangular) matrix Schubert varieties by Chevalley generators (see Propositions 3.8, 3.9). • Our two applications of symmetric matrix Schubert varieties to Gaussian conditional independence appear in Section 4. • Though not necessary for our statistics applications, we end the paper with a further analysis of the combinatorics of the three stratifications from Section 2. Here we describe each defining determinantal ideal, and sums thereof, using certain rank arrays (see e.g. [Ful92], [KM05], [KLS13] for rank arrays in similar settings). We also enumerate the ideals that can appear by permutations with restricted positions, and give formulas for the number of these components for generic matrices, symmetric matrices, and upper triangular matrices (Propositions 5.6, 5.7). A surprise in the upper triangular case is that the number of components is enumerated by the median Genocchi numbers. Remark 1.2. Preliminary versions of this paper made significant use of the theory of Frobenius splitting, and many of our proofs can be rephrased in that language. The interested reader may see [BK05, Chapter 2], [KLS14], and [Knu09] for relevant related material on Frobenius splitting. 2. Stratifying three spaces of matrices Throughout the paper, we let K be a field. We focus on the following three spaces of matrices: n × n matrices Matn (K), n × n symmetric matrices Symn (K), and n × n upper triangular matrices, which we denote by Upn (K). In this expository section, we describe the three stratifications, one for each space of matrices, that are relevant for this paper. The stratifications are obtained by identifying each space of matrices with a Schubert cell 1The upper triangular Gröbner basis result can also be obtained by appealing to [WY12]. MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 5 or Schubert cell intersected with an opposite Schubert variety, and then stratifying by opposite Schubert varieties. We begin by setting up some conventions and notation: • Let Jn be the n × n matrix with ones along the antidiagonal and zeros elsewhere, let 0n be an n × n zero matrix, and let X, Σ, and Y be n × n generic, symmetric, and upper triangular matrices of indeterminates. Define the following 2n × 2n matrices:       J X J Σ J Y n n n e := e := (3) X , Σ , Ye := . 0 n Jn 0 n Jn 0 n Jn Let xij , yij , and σij be the (i, j)-entries of the matrices X, Y , and Σ, respectively. • Let v ∈ S2n , and let w0 denote the longest word in S2n , expressed in one line notation by 2n(2n − 1) · · · 321. We let P (v) denote the permutation matrix of w0 v, so that P (v) is the matrix which has a 1 in position (i, j) if and only if w0 v(i) = j. Though this notation is non-standard, we felt it the best choice for our purposes. • Let w ∈ S2n denote the “square word” permutation which is expressed in oneline notation by (n + 1) · · · (2n)1 · · · n, and let wup ∈ S2n denote the permutation expressed in one-line notation by 12 · · · n(2n)(2n − 1) · · · (n + 1). Observe that     Jn 0 n 0 n Jn (4) P (w ) = , P (wup ) = . 0 n Jn In 0 n Our three stratifications are explicitly described in the following proposition: Proposition 2.1. (1) There is a prime ideal in K[X] associated to each v in the Bruhat interval [1, w ] ⊆ S2n defined by e[1,i],[j,2n] | i, j ∈ [2n]i. Ifull (v) := hminors of size (1 + rank P (v)[1,i],[j,2n]) in X The sum of any two of these ideals is radical and is an intersection of others of the same type, and the poset of these ideals, ordered by inclusion, is isomorphic to the Bruhat interval [1, w ] ⊆ S2n . (2) Let Cn denote the set of permutations in S2n which satisfy the following condition: if v = a1 . . . a2n in one-line notation, then ai + a2n+1−i = 2n + 1, 1 ≤ i ≤ 2n. There is a prime ideal in K[Σ] associated to each v ∈ Cn ∩ [1, w ] defined by e [1,i],[j,2n] | i, j ∈ [2n]i. Isym (v) := hminors of size (1 + rank P (v)[1,i],[j,2n]) in Σ The sum of any two of these ideals is radical and is an intersection of others of the same type, and the poset of these ideals, ordered by inclusion, is isomorphic to the type C Bruhat interval [1, w ] ∩ Cn . (3) There is a prime ideal in K[Y ] associated to each v in the Bruhat interval [wup , w ] ⊆ S2n defined by: Iup (v) := hminors of size (1 + rank P (v)[1,i],[j,2n]) in Ye[1,i],[j,2n] | i, j ∈ [2n]i. The sum of any two of these ideals is radical and is an intersection of others of the same type, and the poset of these ideals, ordered by inclusion, is isomorphic to the Bruhat interval [wup , w ] ⊆ S2n . 6 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT The proof of this proposition is just a matter of identifying each ideal with the schemetheoretic defining ideal of a Kazhdan-Lusztig variety (i.e. an opposite Schubert variety intersected with a Schubert cell) in an appropriately chosen flag variety. We explain this for items (1) and (3) in Section 2.1. We justify item (2) in Section 2.2. Example 2.2. When n = 2, the poset of those I(v)full ⊆ K[X] from Proposition 2.1 is pictured below: Ifull (1) = h0i Ifull (s1 ) = hx12 i Ifull (s2 s1 ) = hx11 , x12 i Ifull (s2 ) = hdet Xi Ifull (s1 s2 ) = hx12 , x22 i Ifull (s2 s1 s2 ) = hx11 , x12 , x22 i Ifull (s1 s3 ) = hx12 , x21 i Ifull (s2 s1 s3 ) = hx11 , x12 , x21 i Ifull (s3 ) = hx21 i Ifull (s2 s3 ) = hx11 , x21 i Ifull (s1 s3 s2 ) = hx12 , x21 , x22 i Ifull (s3 s2 ) = hx21 , x22 i Ifull (s2 s3 s2 ) = hx11 , x21 , x22 i Ifull (s2 s1 s3 s2 ) = hx11 , x12 , x21 , x22 i Here si denotes the simple transposition (i, i + 1) and the covering relation is determined by ideal inclusion. It is easy to see that this poset is isomorphic to the Bruhat interval [1, w = 3412] ⊆ S4 . Observe also that the length of each permutation determines the codimension of the associated stratum in Matn (K). This follows from the fact that each of our strata can be identified with an opposite Schubert variety intersected with a Schubert cell (a.k.a. a Kazhdan-Lusztig variety). The ideals describing the closed strata of Symn (K) and Upn (K) are described below (on the left and right respectively): Isym (1) = h0i Isym (s1 s3 ) = hσ12 i Isym (s2 ) = hdet Σi Isym (s2 s1 s3 ) = hσ11 , σ12 i Isym (s1 s3 s2 ) = hσ12 , σ22 i Isym (s2 s1 s3 s2 ) = hσ11 , σ12 , σ22 i Iup (s3 ) = h0i Iup (s1 s3 ) = hy12 i Iup (s2 s3 ) = hy11 i Iup (s3 s2 ) = hy22 i Iup (s2 s1 s3 ) Iup (s1 s3 s2 ) Iup (s2 s3 s2 ) = hy11 , y12 i = hy12 , y22 i = hy11 , y22 i Iup (s2 s1 s3 s2 ) = hy11 , y12 , y22 i MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 7 The poset on the left is isomorphic to a Bruhat interval of type C; in particular, it is isomorphic to the poset of those v ∈ S4 which commute with the longest word, and which lie in the interval [1, w ] ⊆ S4 . Here the order is induced by ordinary Bruhat order on S4 . Again, length of a permutation (with the type C notion of length, so that, in particular, both s1 s3 and s2 have length 1) determines the codimension of the corresponding stratum in Symn (K). The poset on the right is isomorphic to the Bruhat interval [wup = 1243, w = 3412] ⊆ S4 . In this case, if v ∈ S4 has length l(v) (for the usual type A notion of length), then the codimension of the corresponding subvariety in Upn (K) is given by l(v) − 1. More generally, the codimension of the stratum of Upn (K) associated to v ∈ Sn is given by l(v) − #(entries below the diagonal). Remark 2.3. In the next two subsections, we assume that the field K is algebraically closed for simplicity. This added assumption is harmless; every property that we need to justify in Proposition 2.1 may be checked over the algebraic closure of the base field instead of over the original base field. 2.1. Type A Schubert varieties and our stratifications of Matn (K) and Upn (K). Here we briefly recall some facts about Schubert varieties in type A. These well-known results explain items (1) and (3) of Proposition 2.1. For more information, see one of the many references on the subject (eg. [Bri05], [BK05], [Ful97]). Let B + (respectively B − ) denote the Borel subgroup of upper triangular (resp. lower triangular) matrices in SL2n (K). We will work in the flag variety B − \SL2n (K). Schubert cells are B + -orbits and Schubert varieties are the closures of these orbits. Schubert cells and varieties are indexed by permutations in S2n : we use Xv◦ to denote the Schubert cell B − \B − P (v)B + , and will use Xv to denote its closure. Similarly, opposite Schubert cells are B − -orbits, and opposite Schubert varieties are their closures. These too are indexed by permutations in S2n , and we let X◦v denote the opposite Schubert cell B − \B − P (v)B − , and we let X v denote its closure. The collection of Schubert varieties (resp. opposite Schubert varieties) stratify the flag variety B − \SL2n (K); the intersection of any two Schubert varieties (resp. opposite Schubert varieties) is reduced, and is, scheme-theoretically, a union of other Schubert varieties (resp. opposite Schubert varieties). Containment of strata is determined by Bruhat order on S2n . In particular, with respect to our (non-standard) conventions, the containment on opposite Schubert varieties is given by: X v ⊆ X w if and only if v > w in Bruhat order. Of particular interest to us is the Schubert cell Xw◦  . This Schubert cell is isomorphic to the space of matrices    Jn Z F ull := : Z ∈ Matn (K) , 0 n Jn where, as above, Jn denotes the n × n permutation matrix with 1s along the antidiagonal and 0s elsewhere. The isomorphism from F ull to Xw◦  is induced by the natural map SL2n (K) → B − \SL2n (K). The Schubert cell Xw◦  has a stratification by opposite Schubert varieties X v , induced by the stratification by opposite Schubert varieties on B − \SL2n (K). In particular, the 8 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT (closed) strata of Xw◦  are all those non-empty intersections X v ∩ Xw◦  . We note that a Kazhdan-Lusztig variety X v ∩ Xw◦  is non-empty precisely when v ≤ w in Bruhat order. Each Kazhdan-Lusztig variety is isomorphic to a subvariety of F ull obtained by imposing conditions on the ranks of all North-East justified submatrices of   J X n e= X . 0 n Jn In particular, by [WY08], the ideal e[1,i],[j,2n] | i, j ∈ [2n]i Ifull (v) = hminors of size (1 + rank P (v)[1,i],[j,2n]) in X is prime and it scheme-theoretically defines Xv ∩ X◦w as a subvariety of F ull. In other words, X v ∩ Xw◦  ∼ = Spec K[X]/Ifull (v). It is useful to note that the ideal Ifull (v) has a much smaller generating set than the one given above. To a permutation matrix P (v) for v ∈ S2n , assign a 2n × 2n grid with a × in box (i, j) if and only if P (v) has a 1 in position (i, j). The set of boxes in the grid that have a × neither directly north nor directly east is the diagram of v. Fulton’s essential set Ess(v) is the set of those (i, j) in the diagram such that neither (i + 1, j) nor (i, j − 1) is in the diagram of v. It follows from [Ful92, §3] that e[1,i],[j,2n] | (i, j) ∈ Ess(v)i. Ifull (v) = h(1 + rank P (v)[1,i],[j,2n]) in X We refer to this smaller generating set as the set of essential minors. Proof of item (1) of Proposition 2.1. This is covered by the background material presented above. In particular, we have that each Ifull (v), v ∈ [1, w ], is prime. The statement that the sum of any two of these ideals is radical and the intersection of others of the same type is the statement that the intersection of two Schubert varieties is a reduced union of other Schubert varieties. The statement that the poset of these ideals, ordered by inclusion, is isomorphic to the Bruhat interval [1, w ] comes from the fact, also mentioned above, that X v ⊆ X w if and only if v > w in Bruhat order, together with the fact that X v ∩ Xw◦  is non-empty precisely when v ≤ w in Bruhat order.  We next turn our attention to the upper triangular situation. Recall that wup ∈ S2n is the permutation which in one-line notation by 1 · · · n(2n) · · · (n + 1) or by  is expressed  0 J the matrix P (wup ) = n n . Then, In 0 n e[1,i],[j,2n] | i, j ∈ [2n]i Ifull (wup ) = hminors of size (1 + rank P (wup)[1,i],[j,2n]) in X = hminors of size (n + 1) in X̃[1,n+i],[i+1,2n] | 1 ≤ i ≤ n − 1i = hxij | j < ii. Consequently, Ifull (wup ) defines the space of matrices    Jn Z Up := : Z ∈ Matn (K) is upper triangular , 0 n Jn MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 9 as a subvariety of F ull, and Up is isomorphic to the Kazhdan-Lusztig variety X wup ∩ Xw◦  . Because containment of opposite Schubert varieties is given by Bruhat order, the KazhdanLusztig varieties which are isomorphic to subvarieties of Up are those X v ∩ Xw◦  with v ∈ [wup , w ]. Using this, we prove item (3) of Proposition 2.1. Proof of item (3) of Proposition 2.1. We first check that each Iup (v) is prime. Since Ifull (wup ) = hxij | j < ii, we have that v ≥ wup in Bruhat order if and only if Ifull (v) contains hxij | j < ii. It then follows from the definitions of Ifull (v) and Iup (v) that K[X]/Ifull (v) ∼ = K[Y ]/Iup (v), for any v ∈ [wup , w ]. Since Ifull (v) is prime, so too is Iup (v). Next, observe that if v1 , v2 ∈ [wup , w ], then (5) K[X]/(Ifull (v1 ) + Ifull (v2 )) ∼ = K[Y ]/(Iup (v1 ) + Iup (v2 )) and so Iup (v1 ) + Iup (v2 ) is radical since Ifull (v1 ) + Ifull (v2 ) is radical. Furthermore, since we know that Ifull (v1 ) + Ifull (v2 ) is an intersection of ideals Ifull (w1 ) ∩ · · · ∩ Ifull (wr ) with each wi ∈ [wup , w ], equation (5) yields K[Y ]/(Iup (v1 ) + Iup (v2 )) ∼ = K[X]/(Ifull (w1 ) ∩ · · · ∩ Ifull (wr )). To see that Iup (v1 ) + Iup (v2 ) can actually be written as Iup (w1 ) ∩ · · · ∩ Iup (wr ), identify each upper triangular variable yij with xij ∈ K[X], i ≤ j. Observe that each Ifull (wi ) is generated by the essential minors of Iup (wi ) (which involve only those xij with i ≤ j) along with the variables xij , i > j. So, the intersection Ifull (w1 ) ∩ · · · ∩ Ifull (wr ) has a generating set which consists of generators of the intersection Iup (w1 ) ∩ · · · ∩ Iup (wr ) along with the collection of xij , i > j. That is, Ifull (w1 ) ∩ · · · ∩ Ifull (wr ) = (Iup (w1 ) ∩ · · · ∩ Iup (wr )) + hxij | i > ji, and the desired result follows. Finally, observe that the poset of ideals Iup (v), v ∈ [wup , w ], ordered by inclusion, is isomorphic to the Bruhat interval [wup , w ]. This follows immediately from the fact that the poset of ideals Ifull (v), v ∈ [wup , w ], ordered by inclusion, is isomorphic to the Bruhat interval [wup , w ].  Remark 2.4. Each ideal Iup (v), v ∈ [wup , w ], is generated by its essential minors. This follows since Ifull (v), v ∈ [wup , w ] is generated by its essential minors. 2.2. Type C Schubert varieties and our stratification of Symn (K). We now turn our attention to Schubert and opposite Schubert varieties in a type C flag variety. We use [LR08, Chapter 6] as our reference. Fix an integer n ≥ 1 and let E be the 2n × 2n matrix   0 Jn E := . −Jn 0 This matrix determines a non-degenerate, skew-symmetric bilinear form on K2n . The symplectic group Sp2n (K) may then be defined as Sp2n (K) = {A ∈ SL2n (K) | E(At )−1 E −1 = A}, 10 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT or, equivalently, as the fixed point set of the involution σ : SL2n (K) → SL2n (K), σ(A) = E(At )−1 E −1 . For convenience, we will sometimes use A−t to denote (At )−1 . As in [LR08], let H = SL2n (K) and let G = Sp2n (K) = H σ . The Borel subgroups + − BH and BH of upper triangular and lower triangular matrices in H are each stable under + + σ − + σ σ, and BG := (BH ) and BG := (BH ) are each Borel subgroups of G. The associated Weyl group Cn can be identified with the set of permutations v ∈ S2n which commute with the longest word w0 . That is, in one-line notation, elements in Cn take the form a1 · · · an an+1 · · · a2n with ai + a2n+1−i = 2n + 1 for each 1 ≤ i ≤ 2n. Bruhat order on Cn is induced by Bruhat order on S2n . − + We work in the flag variety BG \ G. Schubert cells are BG orbits and Schubert varieties − are their closures. Opposite Schubert cells are BG orbits and opposite Schubert varieties are their closures. Schubert (resp. opposite Schubert) cells and varieties are indexed by ◦ Weyl group elements. In particular, for v ∈ Cn , we use XG,v to denote the Schubert cell − − + BG \BG P (v)BG , and use XG,v to denote its closure. Similarly, we let X◦G,v denote the − − − opposite Schubert cell BG \BG P (v)BG , and we let X G,v denote its closure. For v, w ∈ Cn , G,v G,w the inclusion X ⊆ X holds if and only if v ≥ w in Bruhat order. Finally, the intersection of two opposite Schubert varieties is a reduced union of others (which is a general fact, not special to type A or C, following from the Frobenius splitting of the flag variety [BK05, Chapter 2]). Theorem 2.5. Let v ∈ Cn . (1) [LR08, Proposition 6.1.1.1] The Schubert cell Xv◦ is stable under σ and, further◦ ◦ more, (XH,v )σ = XG,v . − − (2) [LR08, Proposition 6.1.1.2] Under the natural inclusion BG \G ֒→ BH \H, there is the following (scheme-theoretic) equality: − X G,v = X H,v ∩ BG \G. The specific results that we will use now follow. Corollary 2.6. (1) The space of matrices    Jn Z Sym := : Z ∈ Matn (K) is symmetric 0 Jn ◦ is isomorphic to the Schubert cell XG,w .  (2) Let v ∈ Cn lie in the Bruhat interval [1, w ]. Then the ideal Isym (v) ⊆ K[Σ] is a non-trivial prime ideal which scheme-theoretically defines the intersection X G,v ∩ ◦ XG,w . Furthermore, the essential minors generate Isym (v).  Proof. We begin with (1), and proceed by showing that Sym is isomorphic to the invari◦ ants (XH,w )σ . First recall the isomorphism  ◦ πH : F ull → XH,w  given by identifying a matrix M in F ull with its coset B − M. Observe that, given − ◦ x ∈ XH,w , there is a unique M ∈ F ull such that x = BH M. It follows that σ(x) = x  − − − if and only if σ(BH M) = BH M. Now, for any b ∈ BH , we have that σ(bM) = MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 11 − (E(b ) E )(E(M ) E ). Since both BH and F ull are stable under σ, it follows − − that σ(BH M) = BH M if and only if E(M t )−1 E −1 = M. We now observe that the latter equality is the condition that M ∈ Sym: let M ∈ F ull so that   Jn A M= 0 Jn t −1 −1 t −1 −1 for some n × n matrix A. Then, t −1 E(M ) E −1 =   0 Jn −Jn 0  Jn A 0 Jn −t   0 Jn Jn = −Jn 0 −Jn At Jn   Jn At = , 0 Jn −1 0 Jn −Jn 0   0 0 −Jn Jn Jn 0 which is equal to M if and only if A = At . Thus, E(M t )−1 E −1 = M if and only ◦ if M ∈ Sym. Consequently, the map πH : F ull → XH,w induces an isomorphism from  ◦ σ Sym to (XH,w ) . By applying [LR08, Proposition 6.1.1.1], we see that Sym is isomorphic ◦ to the Schubert cell XG,w .  ◦ We now prove (2). As in type A, X G,v ∩ XG,w is non-empty precisely when v < w in  Bruhat order on Cn , and such non-empty intersections are reduced and irreducible. Thus, ◦ ◦ ∼ each variety X G,v ∩ XG,w , which is a closed subvariety of the affine space XG,w = Sym,   has a scheme-theoretic defining ideal which is prime. We now show that this prime ideal is indeed Isym (v) ⊆ K[Σ]. − By [LR08, Proposition 6.1.1.2], we have X G,v = X H,v ∩ BG \G (under the natural − − inclusion BG \G ֒→ BH \H). Then, − ◦ ◦ ◦ = (X H,v ∩ BG X G,v ∩ XG,w , = X H,v ∩ XG,w \G) ∩ XG,w    and we have the following pullback diagram: ◦ X H,v ∩ XG,w  ◦ X H,v ∩ XH,w  ◦ XG,w  ◦ XH,w  ◦ ◦ Since K[X] and K[Σ] are the coordinate rings of the Schubert cells XH,w and XG,w   ◦ respectively, and K[X]/Ifull (v) is coordinate ring of X H,v ∩ XH,w , we see that  ∼ (6) K[X]/Ifull (v) ⊗K[X] K[Σ] = K[Σ]/Isym (v) ◦ ◦ is the coordinate ring of the affine variety X H,v ∩ XG,w (= X G,v ∩ XG,w ). It also follows   from (6) that the essential minors of Isym (v) form a generating set of Isym (v), since the ideal Ifull (v) is generated by its essential minors.  Proof of item (2) of Proposition 2.1. The primality of Isym (v) for v ∈ [1, w ] ∩ Cn is given by Corollary 2.6. The rest of the proof of item (2) of Proposition 2.1 is the same as the proof of the analogous statements in item (1) of Proposition 2.1.  12 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT 3. Matrix Schubert varieties and their analogs for symmetric and upper triangular matrices In this section, we focus our attention on Fulton’s matrix Schubert varieties and their analogs for symmetric and upper triangular matrices. In each of the generic matrix, symmetric matrix, and upper triangular matrix settings, the associated matrix Schubert varieties are a subset of the strata described in the previous section. It turns out that there is a tight relationship between the matrix Schubert varieties in the three different settings, and that analogs of many standard results on usual matrix Schubert varieties also hold in the cases of symmetric and upper triangular matrices. We explain this in this section. Let w ∈ Sn and let w0 be the longest word in Sn . Like in the previous section, we let P (w) be the n × n permutation matrix of w0 w so that P (w) has a 1 in location (i, j) iff P P w0 w(i) = j. Let R(w) be the n × n matrix such that R(w)ij = ik=1 nl=j P (w)kl, the number of 1’s in P (w) above and to the right. To the permutation w, we associate ideals given by rank conditions induced by the rank matrix R(w) X Jfull (w) = hR(w)ij + 1 minors of X[1,i],[j,n]i ⊆ K[X]. ij We can define ideals similarly among symmetric and upper triangular matrices: X Jsym (w) = hR(w)ij + 1 minors of Σ[1,i],[j,n]i ⊆ K[Σ]. ij Jup (w) = X ij hR(w)ij + 1 minors of Y[1,i],[j,n]i ⊆ K[Y ]. The ideal J(w)full is often called a Schubert determinantal ideal. It is the defining ideal of a matrix Schubert variety. In analogy, we call Jsym (w) a symmetric Schubert determinantal ideal and call Jup (w) an upper triangular Schubert determinantal ideal. Proposition 3.1. For any w ∈ Sn , each of the ideals Jfull (w), Jsym (w), and Jup (w) are prime. Furthermore, with respect to any diagonal monomial order2, the essential minors form a Gröbner basis with squarefree initial terms. This result is known in the type A setting. In the case of generic matrices, the Gröbner basis result appeared first in [KM05]. The upper triangular case follows in a straightforward manner from the generic case, or can be seen from results in [WY12]. We explain this in the proof below. A key tool is the following observation about Gröbner bases. Note that NFG (f ) denotes the normal form obtained by applying polynomial long division of the polynomial f by the set of polynomials G, with respect to the chosen term order. Lemma 3.2. Let F = {f1 , . . . , fr } ⊆ K[x1 , . . . , xn , y1 , . . . , yn ] be a Gröbner basis for an ideal I with respect to a fixed term order < such that in< fi ∈ K[x1 , . . . , xn ] for all i. Let G = {y1 − g1 , . . . , yn − gn } be a Gröbner basis for an ideal J with respect to <, such that 2By a diagonal monomial order, we mean any monomial order satisfying the property that the leading term of the determinant of a submatrix is the product of the entries along the diagonal of that submatrix. MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 13 in< (yi − gi ) = yi for all i, and gi ∈ K[x1 , . . . , xn ]. Suppose that in< NFG (fi ) = in< fi for all i. Then the set NFG (F ) = {NFG (f1 ), . . . , NFG (fr )} is a Gröbner basis for the ideal it generates. Proof. First of all, our assumptions about the set of polynomials F and G guarantee that the set F ∪ G forms a Gröbner basis for the ideal they generate. This is because all S-polynomials formed from pairs of elements in F or G reduce to zero, by the Gröbner basis assumption, and any S-polynomial S(fi , yj − gj ) reduces to zero by Buchberger’s first criterion (see [BW93, Ch. 5.5]), since the initial terms of fi and yj − gj are relatively prime. Since it has the same leading terms, the set of polynomials NFG (F ) ∪ G is a Gröbner basis for the same ideal. By our assumptions, the set NFG (F ) is a subset of K[x1 , . . . , xn ]. Let f ∈ hNFG (F )i ⊆ K[x1 , . . . , xn ]. This polynomial reduces to zero by NFG (F ) ∪G since that set is a Gröbner basis for the ideal hNFG (F )∪Gi. However, since f ∈ K[x1 , . . . , xn ], it does not have any terms divisible by any leading term of a polynomial in G. So f reduces to zero by applying the division algorithm with NFG (F ). This implies that NFG (F ) is a Gröbner basis for hNFG (F )i.  Proof of Proposition 3.1. We first consider the ideals Jfull (w). Extend w ∈ Sn to a permutation w̃ ∈ S2n by w̃(i) = w(i), 1 ≤ i ≤ n, and w̃(i) = i, n + 1 ≤ i ≤ 2n. Then, w̃ ∈ [1, w ] ⊆ S2n . By definition of Jfull (w), it is clear that Jfull (w) ⊆ Ifull (w̃). For the reverse inclusion, we observe that the essential minors of I(w̃)full agree with the essential minors of Jfull (w). Thus Jfull (w) is prime and generated by its essential minors. The Gröbner basis statement appears in [KM05]. Next consider the ideals Jup (w). Extend w ∈ Sn to w̃ ∈ S2n where this time w̃(i) = w(i) when 1 ≤ i ≤ n and w̃(i) = 3n+1−i for n+1 ≤ i ≤ 2n. It is again clear by definition that Jup (w) ⊆ Iup (w̃). For the reverse inclusion, we use Remark 2.4 along with the observation that the essential minors of Iup (w̃) and the essential minors of Jup (w) agree. Thus, Jup (w) is prime and is generated by its essential minors. To obtain the Gröbner basis result, we apply Lemma 3.2 where F is the set of essential minors of Jfull (w) and G is the set of variables below the diagonal. The set NFG (F ) consists of the upper triangular minors which form a Gröbner basis by Lemma 3.2. Finally substitute yij variables for the remaining xij variables. Now consider the ideals Jsym (w). Extend each w ∈ Sn to a permutation w̃ ∈ Cn ⊆ S2n by w̃(i) = w(i) and w̃(2n + 1 − i) = 2n + 1 − w(i) for 1 ≤ i ≤ n. Then w̃ defines a prime Kazhdan-Lusztig ideal Isym (w̃). In fact Isym (w̃) = Jsym (w). Among the generators e [1,i],[j,2n] are not essential minors when i, j ≤ n or of Isym (w̃), the minors arising from Σ i, j ≥ n + 1. Those with i ≤ n and j ≥ n + 1 are the generators of Jsym (w), and those with i ≥ n + 1 and j ≤ n replicate these: the minors containing as many ones as possible e are the reflections in the main diagonal of Jsym (w), up to sign, from the Jn blocks in Σ and the other minors are redundant. Thus Jsym (w) is a prime ideal and is generated by its essential minors. To obtain the Gröbner basis result, we apply Lemma 3.2 where F is the set of essential minors of Jfull (w) and G = {xji − xij : 1 ≤ i < j ≤ n}. 14 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT To make this work, we extend our term order that picks the diagonal leading terms of the minors whose diagonals are above the main diagonal of X to a term order on all variables of X by always requiring the xji > xij for i < j. This assumption guarantees that the initial terms remain unchanged on computing normal forms. Upon computing the polynomials NFG (F ) and substituting xij = σij the resulting set of polynomials consists of the essential symmetric minors.  Remark 3.3. One might wonder if our method of proof extends to show that the essential minors of each ideal Isym (v) from Section 2 form a Gröbner basis. We do not see how to do this: in Proposition 3.1, the assumption that w is a permutation in Sn is used to guarantee that the leading term of each essential minor in Jfull (w) consists only of variables lying in the upper triangular part of X. This is what allows us to apply Lemma 3.2. Remark 3.4. The definition of Schubert determinantal ideals is often extended to include ideals determined by North-East ranks of partial permutation matrices. We note that one cannot make the analogous extension in the symmetric and upper triangular settings. This is for two reasons: the first is that there exist partial permutation matrices for which there are no upper triangular (resp. symmetric) matrices that satisfy the corresponding NorthEast rank conditions, and the second is that even when there are matrices which satisfy the given North-East rank conditions, the corresponding North-East rank ideals often fail to be prime. We provide examples of this below. Example 3.5. Let u be the 2 × 2 partial permutation matrix   0 0 u= . 1 0 Observe that there are no upper triangular (or symmetric) matrices M which have the property that M[1,i],[j,n] = w[1,i],[j,n], i, j ∈ [2]. Next consider the partial permutation matrix   0 1 v= . 0 0 If we extended the definition of upper triangular Schubert determinantal ideal to include ideals defined by partial permutation matrices, then, in this case, we would get the ideal generated by the determinant of Y (i.e. hy11 y22 i) which has two components. Finally, consider the partial permutation matrix   0 0 0 1  0 0 0 0  w=  1 0 0 0 . 0 0 0 0 If we extended the definition of symmetric Schubert determinantal ideal to include ideals defined by partial permutation matrices, then such an ideal for the partial permutation w would be generated by the 2 × 2 minors of its submatrices Σ[1,2],[1,4] and Σ[1,4],[2,4] . This ideal has two prime components. We provide futher explanation in Example 5.4. MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 15 Proposition 3.6. Let • denote one of “full”, “sym”, or “up”, and let v1 , v2 ∈ Sn . The sum J• (v1 ) + J• (v2 ) is reduced, and is the intersection of other ideals of the same type. That is, J• (v1 ) + J• (v2 ) = J• (w1 ) ∩ J• (w2 ) ∩ · · · ∩ J• (wk ) for some permutations w1 , . . . , wk ∈ Sn . Furthermore, the poset of all J• (v), ordered by inclusion, is isomorphic to the Bruhat poset of Sn . Proof. Both statements are known in the ordinary matrix Schubert variety setting [KM05]. We provide a proof here that works in each case. To get the first statement, we extend v1 and v2 in Sn to permutations ṽ, and w̃ in S2n in the same way as done in the proof of Proposition 3.1. Then, J• (vi ) = I• (ṽi ). Since each I• (ṽi ) is a Kazhdan-Lusztig ideal, J• (v1 ) + J• (v2 ) = I• (w1′ ) ∩ I• (w2′ ) ∩ · · · ∩ I• (wk′ ) where each I• (wi′ ) is a Kazhdan-Lusztig ideal. It remains to show that each wi′ ∈ S2n is actually equal to an extension w̃i ∈ S2n for some wi ∈ Sn . For this, we use a refinement of Proposition 2.1(a): if • denotes “full”, then the wi′ that appear in the decomposition above are the least upper bounds for ṽ1 and ṽ2 in Bruhat order. In particular, all wi′ are less than or equal to w . In the upper-triangular setting, Ifull (ṽ1 ) and Ifull (ṽ2 ) both contain hxij | i > ji, whence each of the Ifull (wi′ ) do as well. As above, the wi′ are also less than or equal to w . So they must have wi′ (j) = 3n + 1 − j for each j ≥ n + 1, i.e. they must be of the form w̃i . In the symmetric setting, we claim that all of the wi′ may be taken to lie in the set Cn of Proposition 2.1(b). Suppose some wi′ does not. Under the map πΣ : K[X] → K[Σ], xij 7→ σij from before, Ifull (wi′ ) and Ifull (w0 wi′ w0 ) have the same image, namely Isym (wi′ ). Therefore, in the “full” version of the decomposition, Ifull (wi′ ) is equal to Ifull (wi′ ) + Ifull (w0 wi′ w0 ), which in turn is equal to an intersection of ideals of form Ifull (wj′′ ) for some permutations wj′′ . Replace wi′ by the collection of wj′′ in the “sym” decomposition. Since each wj′′ is strictly greater than wi′ in Bruhat order and bounded above by w , only a finite number of successive replacements of this form will be possible, after which point all the permutations involved lie in Cn . Finally, being less than or equal to w , these permutations are all of the form w̃i . To obtain the last statement, just note that this is true in the ordinary matrix Schubert variety case [KM05], and the same inclusion order of ideals holds in the other two cases.  There are a number of important relationships between the ideals Jfull (w), Jsym (w), Jup (w) which will be useful when relating them to Gaussian graphical models. Proposition 3.7. For each w ∈ Sn , there are weight orders τsym and τfull so that Jup (w) = inτfull (Jfull (w)) and Jup (w) = inτsym (Jsym (w)). In Proposition 3.7, we mean to take the initial ideal, and then make an appropriate substitution of variables. 16 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT Proof. For the first statement, we choose the weighting on variables so that τfull (xij ) = 1 if i ≤ j and τfull (xij ) = 0 if i > j. This clearly has the effect in each of the minors that terms above the main diagonal will have weight the largest weight, so the leading term of a single such determinant will be the corresponding determinant of the upper triangular matrices. This implies that Jup (w) ⊆ inτfull (Jfull(w)). Since the resulting degeneration is compatible with the degeneration to the diagonal initial terms of these minors, and we have a Gröbner basis in that case, we deduce that Jup (w) = inτfull (Jfull (w)). A similar argument works in the symmetric case, but here we need to take the weight order τsym (σij ) = N − |j − i|, for some very large N. (Actually this would work in the generic case too.)  Let Vfull (w), Vsym (w), Vup (w) denote the vanishing sets of Jfull (w), Jsym (w), and Jup (w) respectively. Each of these varieties have nice parametrizations. For the ordinary matrix Schubert varieties and in the upper triangular case, these are well-known and we repeat them here. The parametrization for the symmetric case is related to the parametrization for the upper triangular matrix Schubert variety. We will need this to establish the relationship to Gaussian graphical models in the next section. Let s1 , . . . , sn−1 be adjacent transposition generators of the symmetric group Sn . Let w ∈ Sn and let (i1 , . . . , ik ) be a reduced word for w0 w, in particular w0 w = si1 · · · sik , and k = ℓ(w0 w), the length of w0 w. For each i ∈ [n − 1], let Xi (t) be the Chevalley generator of the unipotent group: Xi (t) = I + tei,i+1 , where ei,i+1 is the n × n matrix with a 1 in location (i, i + 1) and 0s elsewhere, and where I is the n × n identity matrix. If ℓ(w0 w) = k, let φw : Cn+k → Upn (C) be the map φ(a1 , . . . , an , t1 , . . . , tk ) = diag(a1 , . . . , an )Xik (tk ) · · · Xi1 (t1 ). Recall that Upn (C) denotes the set of upper triangular n × n complex matrices. This parametrization is due to Lusztig [Lus94] (see also Fomin and Zelevinsky’s result [FZ99, Theorem 4.4]). Proposition 3.8. For a permutation w, the closure of the image of φw is the upper triangular variety Vup (w) := V(Jup (w)). Proof. This is a straightforward application of [FZ99, Theorem 4.4]. After making changes to account for our permutation conventions, their statement specializes to the following: let w ∈ Sn and let (i1 , . . . , ik ) be a reduced word for w0 w. Then, φ(a1 , . . . , an , t1 , . . . , tk ) = diag(a1 , . . . , an )Xik (tk ) · · · Xi1 (t1 ). n+k is a biregular isomorphism from C6= 0 to a Zariski open subset of (B− P (w)B− ) ∩ B+ , where B− and B+ denote the sets of lower and upper triangular matrices respectively in GLn (C). Since the closure of B− P (w)B− ∩ B+ inside of Upn (C) is Vup (w), we get the desired result.  The description for the symmetric variety arises from taking a transform of the upper triangular variety. Proposition 3.9. Let ψ : Upn (C) → Symn (C), U 7→ U T U. Then ψ(Vup (w)) = Vsym (w). MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 17 Proof. First of all, we will show that ψ(Vup (w)) ⊆ Vsym (w). Indeed, we will show that Jsym (w) ⊆ I(ψ(Vup (w))). To see this, note that since U is upper triangular, in the matrix Σ = U T U, we have that T Σ[1,i],[j,n] = U[1,i],[1,i] U[1,i],[j,n]. Since rank U[1,i],[j,n] ≤ R(w)ij we deduce that rank Σ[1,i],[j,n] ≤ R(w)ij . Since w is a permutation and Vup (w) contains invertible matrices, we know that ψ(Vup (w)) contains positive definite matrices. The uniqueness of Cholesky decompositions implies that φ is generically finite to one on Vup (w). Since Vup (w) is a degeneration of Vsym (w) (Proposition 3.7) we deduce that Vup (w), ψ(Vup (w)), and Vsym (w) all have the same dimension. Since both ψ(Vup (w)) and Vsym (w) are irreducible of the same dimension and ψ(Vup (w)) ⊆ Vsym (w), they must be equal.  4. Application to Gaussian Conditional Independence Models In this section, we explain the applications of matrix Schubert varieties to the study of conditional independence structures for Gaussian random variables. We use Bruhat order on the symmetric group to study conditional independence implications, as well as characterize the vanishing ideals of Gaussian graphical models associated to a particular family of graphs, the generalized Markov chains. Let X = (X1 , . . . , Xn ) ∼ N (µ, Σ) be an n-dimensional Gaussian random vector, and let A, B, and C be disjoint subsets of [n]. Recall from the introduction that one associates to each conditional independence statement A ⊥⊥ B | C the conditional independence (CI) ideal JA⊥⊥B|C = h#C + 1 minors of ΣA∪C,B∪C i ⊆ C[Σ]. Proposition 4.1. Let A ⊥⊥ B | C be a conditional independence statement. Then the ideal JA⊥⊥B|C is a symmetric Schubert determinantal ideal if and only if one of the following two conditions are satisfied: (1) A = [1, i], B = [j, n] and C = ∅, for some i < j, or (2) A = [1, i], B = [j, n] and C = [i + 1, j − 1], for some i < j − 1. Proof. Each CI statement A ⊥⊥ B | C gives a rank condition on a submatrix of Σ. Since CI statements always concern invertible covariance matrices, we can restrict attention to the invertible components from Section 3. The resulting rank constraints that can arise have the form rank Σ[1,i],[j,n] ≤ r for some i and j and some r. There are two ways that such rank conditions can arise from conditional independence statements. If the matrix Σ[1,i],[j,n] does not intersect the diagonal of Σ, then it must be that r = 0, and this corresponds to the independence statement [1, i] ⊥⊥ [j, n]. If the matrix Σ[1,i],[j,n] does intersect the diagonal of Σ, then r = j −i+1 (the size of the diagonal overlap) and we have the conditional independence statement [1, j − 1] ⊥⊥ [i + 1, n] | [j, i]. These yield the two cases from the proposition.  We will sometimes use the term Schubert conditional independence ideal to refer to ideals that are simultaneously symmetric Schubert determinantal ideals and conditional independence ideals. Remark 4.2. We record here the permutation w associated to each Schubert CI ideal: 18 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT (1) if A, B, and C are as in type (1) of Proposition 4.1, then JA⊥⊥B|C = Jsym (w) where   #B + i, 1 ≤ i ≤ #A i − #A, #A + 1 ≤ i ≤ #A + #B w(i) =  i, #A + #B + 1 ≤ i ≤ n (2) if A, B, and C are as in type (2), then JA⊥⊥B|C = Jsym (w) where  1 ≤ i ≤ #C  i, #B + i, #C + 1 ≤ i ≤ #A + #C w(i) =  i − #A, #A + #C + 1 ≤ i ≤ n In light of Proposition 4.1, one can use Bruhat order to deduce conditional implications in certain cases. The following examples illustrate this: Example 4.3. Let m = 3 and consider the set of conditional independence C = {1 ⊥⊥ 3, 1 ⊥⊥ 3 | 2}. Both of the conditional independence ideal J1⊥⊥3 and J1⊥⊥3|2 satisfy the conditions of Proposition 4.1 and hence are symmetric Schubert determinantal ideals. We have JC = J1⊥⊥3 + J1⊥⊥3|2 = hσ13 , σ12 σ23 − σ13 σ22 i = hσ13 , σ12 i ∩ hσ13 , σ23 i = J1⊥⊥{2,3} ∩ J{1,2}⊥⊥3 . For gaussian random variables, we deduce the conditional independence implication {1 ⊥⊥ 3, 1 ⊥⊥ 3 | 2} =⇒ 1 ⊥⊥ {2, 3} or {1, 2} ⊥⊥ 3. In the language of symmetric Schubert determinantal ideals, J1⊥⊥3 =Jsym (213) and J1⊥⊥3|2 = Jsym (132). The decomposition is equivalent to the decomposition Jsym (213) + Jsym (132) = Jsym (312) ∩ Jsym (231).  Example 4.4. Here we consider a more complex example. Consider the family of conditional independence statements: C = {1 ⊥⊥ {3, 4, 5} | 2, {1, 2, 3} ⊥⊥ 5 | 4, 1 ⊥⊥ {4, 5}}. Translating into symmetric Schubert determinantal ideals yields: J1⊥⊥{3,4,5}|2 = Jsym (15234), J{1,2,3}⊥⊥5|4 = Jsym (13452), J1⊥⊥{4,5} = Jsym (31245). The least upper bounds of the set of elements {15234, 13452, 31245} are the two elements {35142, 51342} corresponding to the prime decomposition Jsym (15234) + Jsym (13452) + Jsym (31245) = Jsym (35142) ∩ Jsym (51342). Translating the ideals on the righthand side of this equation to conditional independence yields Jsym (35142) = J{1,2}⊥⊥{4,5} + J1⊥⊥{3,4,5}|2 + J{1,2,3}⊥⊥5|4 Jsym (51342) = J1⊥⊥{2,3,4,5} + J{1,2,3}⊥⊥5|4 .  MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 19 In each of the above examples, we had a sum of Schubert CI ideals equal to an intersection of symmetric Schubert determinantal ideals, where each symmetric Schubert determinantal ideal was itself a sum of Schubert CI ideals. As the next example illustrates, this is not true in general. Example 4.5. Consider the family of conditional independence statements C = {{1, 2} ⊥⊥ {5, 6}, {1, 2} ⊥⊥ {5, 6} | {3, 4}}. Translating into symmetric Schubert determinantal ideals yields: J{1,2}⊥⊥{5,6} = Jsym (341256), J{1,2}⊥⊥{5,6}|{3,4} = Jsym (125634). The sum of these two ideals has prime decomposition Jsym (341256) + Jsym (125634) = Jsym (345612) ∩ Jsym (561234) ∩ Jsym (351624). Now, each of the first two ideals in the above decomposition are CI ideals, namely Jsym (345612) = J{1,2,3,4}⊥⊥{5,6} , Jsym (561234) = J{1,2}⊥⊥{3,4,5,6} . However, the last ideal in the prime decomposition is not a sum of Schubert CI ideals; the permutation matrix P (351624) has an essential box above the main diagonal associated to a rank-1 constraint, and this cannot come from a conditional independence ideal (see Proposition 4.1). To characterize which symmetric Schubert determinantal ideals are sums of Schubert CI ideals, we recall Gasharov and Reiner’s permutations defined by inclusions (see [GR02] and also [UW13, Section 3.1]), which we define through the following theorem. Theorem 4.6. (see [GR02, Theorem 4.2] or [UW13, Theorem 3.1]) Let w ∈ Sn . The following are equivalent: (1) The permutation w is defined by inclusions. (2) If (i, j) ∈ Ess(w), then either (a) there are no 1s in P (w) weakly North-East of (i, j) (i.e. there is no k with k ≤ i and w(k) ≤ j); or (b) there are no 1s in P (w) strictly South-West of (i, j) (i.e. there is no k with k > i and w(k) > j). (3) The permutation w avoids (in the usual sense of permutation pattern avoidance) 1324, 31524, 24153, and 426153. Note that Theorem 4.6 has been translated from the versions that appear in [GR02] and [UW13] to match our unusual permutation conventions. Suppose w ∈ Sn is a permutation defined by inclusions. If (i, j) ∈ Ess(w) is as in item 2 (a) above, then we say it is an essential box of type 1. If (i, j) ∈ Ess(w) is as in 2 (b) above but not also as in 2 (a), we say it is a type 2 essential box. Lemma 4.7. Let w ∈ Sn . The symmetric Schubert determinantal ideal Jsym (w) is equal to a conditional independence ideal JA⊥⊥B|C with A, B, C ⊆ [n] if and only if w is defined by inclusions with exactly one element in its essential set Ess(w). More precisely, (1) Ess(w) has exactly one element and that element is of type 1 if and only if A = [1, i], B = [j, n], and C = ∅ for some i < j, and 20 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT (2) Ess(w) has exactly one element and that element is of type 2 if and only if A = [1, i], B = [j, n], and C = [i + 1, j − 1], for some i < j − 1. Proof. In light of Proposition 4.1, it suffices to prove items 1 and 2. Remark 4.2 allows one to easily verify the “ ⇐= ” directions of items 1 and 2. For the other direction of 1, note that if the single element of Ess(w) is of type 1, then this element must lie strictly above the main diagonal. Suppose it lies in position (i, j) with i < j. Then, Jsym (w) = JA⊥⊥B|C where A = [1, i], B = [j, n], and C = ∅. For the “ =⇒ ” direction of 2, note that if the single element of Ess(w) is of type 2, then this element (i, j) must lie on or below the main diagonal so that i ≥ j. Furthermore, i < n and j > 1 (else w would not be a permutation). One then checks that,  1 ≤k ≤i−j+1  k, k + n − i, i − j + 2 ≤ k ≤ i w(k) =  k + 1 − j, i + 1 ≤ k ≤ n Comparing this to the second type of permutation appearing in Remark 4.2, we see that in this case Jsym (w) = JA⊥⊥B|C where A = [1, j − 1], B = [i + 1, n], C = [j, i].  Proposition 4.8. Let w ∈ Sn , and suppose that Jsym (w) is a symmetric Schubert determinantal ideal. Then Jsym (w) is a sum of Schubert CI ideals if and only if w is a permutation defined by inclusions. Proof. Suppose w is defined by inclusions. Let Ess(w) = {(i1 , j1 ), . . . , (ir , jr )}. For each (ik , jk ), let wk be the minimal length permutation with (ik , jk ) in its essential set. This exists and is unique: start with the matrix P (w), and draw one horizontal line and one vertical line to partition P (w) into four blocks so that the South-West corner of the North-East block is (ik , jk ). Then re-arrange the 1s within each block so that all 1s in P (w) appear from North-East to South-West within block rows and within block columns, without changing the set of columns North of the horizontal line, or East of the vertical line, containing a 1. Observe that (ik , jk ) is the unique element in Ess(wk ) and that (ik , jk ) is of type 1 (respectively type 2) for wk whenever (ik , jk ) is of type 1 (resp. type 2) for the original permutation w. Furthermore, Jsym (w) = Jsym (w1 ) + · · · + Jsym (wr ). By Lemma 4.7, each of the above Jsym (wk ) is a Schubert CI ideal. Next suppose that Jsym (w) is a sum of Schubert CI ideals. Let Ess(w) = {(i1 , j1 ), . . . , (ir , jr )}, and let wk be the unique minimal length permutation with the unique essential box (ik , jk ). Then, Jsym (w) = Jsym (w1 ) + · · · + Jsym (wr ). By assumption, each Jsym (wk ) is a Schubert CI ideal, and so Jsym (wk ) = JA⊥⊥B|C for some disjoint subsets A, B, C ⊆ [n]. If (ik , jk ) is not a type 1 essential element of w, then C 6= ∅. So, by the proof of Lemma 4.7, we know that A = [1, jk − 1], B = [ik + 1, n], and C = [jk , ik ], ik ≥ jk . Thus, the rank of the North-East submatrix of wk consisting of rows [1, ik ] and columns [jk , n] is equal to #C = ik − jk + 1. The rank of the corresponding North-East submatrix of w is bounded above by this number. Since w is a permutation, the number of 1s in the North-West submatrix w[1,ik ],[1,jk −1] is at least jk − 1 and the MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 21 number of 1s in the South-East submatrix w[ik +1,n],[jk ,n] is at least n − ik . This leaves no 1s left to place strictly South-West of location (ik , jk ) (and indeed we have placed too many 1s already unless the North-East ranks for w and wk agree). Consequently, (ik , jk ) is a type 2 essential box of w.  Remark 4.9. We thank the anonymous referee for pointing out the connection between Schubert varieties defined by inclusions and conditional independence structure. Proposition 4.8 appears here because of the referee’s comments. Example 4.10. In Example 4.5, we can see that Jsym (351624) is not a sum of symmetric Schubert determinantal CI ideals since 351624 is not a permutation defined by inclusions. Indeed, 351624 does not avoid 31524 (and this pattern appears in bold in the first permutation). We now turn to the problem of finding the vanishing ideals of Gaussian graphical models. Specifically, let G = ([m], B, D) be a mixed graph with B denoting a set of bidirected edges i ↔ j and D denoting a set of directed edges i → j. We restrict to the case where the set of directed edges forms a directed acyclic graph, and we reorder the vertices in such a way that if there is an edge i → j ∈ D then i < j. For convenience, recall from the introduction that for each edge i → j ∈ D, one introduces a parameter λij ∈ R. Let Λ be the m × m matrix such that  λij if i → j ∈ D Λij = 0 otherwise. Let RD denote the set of all such matrices Λ. Let P Dm denote the set of m×m symmetric positive definite matrices. Let P D(B) := {Ω ∈ P Dm : Ωij = 0 if i 6= j and i ↔ j ∈ / B}. The Gaussian random vector associated to the mixed graph G with Λ ∈ RD and Ω ∈ P D(B) has X ∼ N (µ, Σ) where Σ = (I − Λ)−T Ω(I − Λ)−1 . and the Gaussian graphical model associated to G is the set of such positive definite covariance matrices that can arise: MG = {Σ = (I − Λ)−T Ω(I − Λ)−1 : Λ ∈ RD , Ω ∈ P D(B)}. We are interested in the vanishing ideals of these models, JG = hf ∈ R[Σ] : f (Σ) = 0 for all Σ ∈ MG i. While for general mixed graphs G, we know no explicit list of generators of JG , there is a natural list of determinantal constraints associated to the graph, induced by the t-separation criterion in G, as follows. Definition 4.11. Let G = (V, B, D) be a mixed graph. A trek from i to j in G consists of either (1) a directed path PL ending in i, and a directed path PR ending in j which have the same source, or 22 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT (2) a directed path PL ending in i, and a directed path PR ending in j such that the source of PL and PR are connected by a bidirected edge. Let T (i, j) denote the set of treks in G connecting i and j. In a trek from i to j we say that the set of vertices in PL is the left side and the set of vertices in PR is the right side of the trek. Note that in the case that PL and PR share a vertex that vertex is on both sides. Definition 4.12. Let G = ([m], B, D) be a mixed graph, and let A1 , A2 , C1 , C2 ⊆ [m] be four not-necessarily disjoint subsets of [m]. The pair (C1 , C2 ) is said to trek-separate (or t-separate) A1 and A2 if for all a1 ∈ A and a2 ∈ A2 , every trek in T (a1 , a2 ) intersects C1 on the left side or C2 on the right side. Theorem 4.13. [STD10] Let G = ([m], B, D) be a mixed graph and let A1 , A2 be two not necessarily disjoint subsets of [m]. The matrix ΣA1 ,A2 has rank at most r for all Σ ∈ MG if and only if there are subsets C1 , C2 ⊆ [m] with #C1 + #C2 ≤ r such that (C1 , C2 ) t-separate A1 and A2 . Theorem 4.13 gives a precise characterization of which minors of the symmetric matrix Σ belong to the vanishing ideal JG . Note that these determinantal constraints may or may not correspond to a conditional independence constraint. It is an interesting open problem to characterize when those determinantal constraints actually generate JG . Here we identify a class of mixed graphs for which JG is the vanishing ideal of a symmetric matrix Schubert variety, which will allow us to deduce that JG is generated by determinantal constraints in those cases. To do so, we compare the parametrization for graphical models to the parametrization for the symmetric matrix Schubert varieties. Note that for a given permutation w we can write the parametrization of the symmetric variety V (w)sym via the map: φ(a1 , . . . , an , t1 , . . . , tk ) = Xi1 (t1 )T · · · Xik (tk )T diag(a1 , . . . , an )Xik (tk ) · · · Xi1 (t1 ). On the other hand, we have the parametrization for the Gaussian graphical model Σ = (I − Λ)−T Ω(I − Λ)−1 where Λ ∈ RD and Ω ∈ P D(B). To construct examples of Gaussian graphical model that are symmetric matrix Schubert varieties, we should find mixed graphs G for which there exists a w such that two corresponding parametrizations yield the same matrices. Because of the structure of the parameterization of the symmetric matrix Schubert varieties, we can break this into two pieces: • which linear spaces in the space of symmetric matrices are symmetric matrix Schubert varieties? and • which families of matrices {(I − Λ)−1 : Λ ∈ Rd } can be realized by a parametrization as a product of Chevalley generators? Taking inverses and noting that the inverse of a Chevalley generator is a Chevalley generator, we can ask the same thing about the parametrization of upper triangular matrices I − Λ. This leads us to: Definition 4.14. A mixed graph G = ([n], B, D) is called a generalized Markov chain if MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 23 (1) i → j ∈ D then i < j, (2) i → j ∈ D then for all i ≤ k < l ≤ j k → l ∈ D, and (3) i ↔ j ∈ B and i < j then for all i ≤ k < l ≤ j, k ↔ l ∈ B. Theorem 4.15. Let G be a generalized Markov chain. Then JG is a symmetric Schubert determinantal ideal, in particular, JG is generated by the determinantal constraints arising from the t-separations implied by the graph G. Proof. We proceed to answer the two questions preceding the definition of a generalized Markov chain. First, the linear spaces in the space of symmetric matrices that are symmetric matrix Schubert varieties must have all rank conditions determined by setting zero entries in the symmetric matrix. These patterns of zeros will give rise to a symmetric matrix Schubert variety. Clearly, we must have that if there is a zero in the (i, j) position, then there must also be zeroes everywhere up and to the right from this position. This forces that the bidirected part G to satisfy condition (3) in the definition of a generalized Markov chain. Second, we need to determine for which directed acyclic graphs G = ([n], D) does the parametrization ξ : KD → Upn (K), Λ 7→ I − Λ parametrize an upper triangular matrix Schubert variety (technically, because of the ones on the diagonal, we might call this a unipotent matrix Schubert variety). To this end, we must ask, when could a pattern of zeros in I − Λ arise as the associated set of rank conditions induced by a permutation w. Clearly, we must have that if there is a zero in the (i, j) position, then there must also be zeroes everywhere up and to the right from this position. Equivalently, if (i, j) is a nonzero position, then all positions (k, l) where i ≤ k < l ≤ j must also have nonzero entries. The corresponding condition on the graph G is that it is a generalized Markov chain.  Remark 4.16. The symmetric and upper triangular matrix Schubert varieties that appear in the above proof are determined by the vanishing of a partition shape of coordinates in the North-East corner. Each such matrix Schubert variety is indexed by a 132-avoiding permutation. In the case of ordinary matrix Schubert varieties, these are pullbacks of Ding’s Schubert varieties [Din01]. Note that Theorem 4.15 does not give a complete characterization of the graphs such that JG is a symmetric Schubert determinantal ideal. Indeed, graphs with many edges will just give JG = h0i although the graph is not a generalized Markov chain. For example, if G = ([m], B, D) has B consisting of all edges, that JG is zero regardless of what D is. Example 4.17. Let G be the graph on [5] with only directed edges 1 → 2, 2 → 3, 3 → 4, 4 → 5, 1 → 3, 2 → 4. Then G is a generalized Markov chain and JG = J{1,2,3}⊥⊥5|4 + J1⊥⊥{4,5}|{2,3} . Example 4.18. Let G be the graph on [4] with directed edges 1 → 2, 1 → 3, 2 → 3, 3 → 4, and the bidirected edge 3 ↔ 4. This graph is a generalized Markov chain and JG = h|Σ12,34 |i. Note, in particular, that JG is not a sum of conditional independence ideals. 24 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT 5. On the combinatorics of the three stratifications We end with some combinatorics of the three stratifications (determined by three Bruhat intervals) from Proposition 2.1. • In subsection 5.1, we make explicit how to decompose sums of ideals from Proposition 2.1 using rank conditions on matrices. • In subsection 5.2, we provide formulas for the number of strata in our stratifications of Matn (K), Upn (K), and Symn (K). In the case of Upn (K), the numbers of strata are given by the median Genocchi numbers. 5.1. A lowbrow translation. Rank arrays have been used by many authors to study Schubert varieties and related varieties (see eg. [Ful92], [EL96]). We make use of them in this section. To set our conventions, define a rank array R to be a 2n × 2n array of naturals such that Ri,1 = i for 1 ≤ i ≤ 2n and R2n,j = 2n + 1 − j for 1 ≤ j ≤ 2n. We also make the conventions R0,j = R1,2n+1 = 0. A rank array R is of type C if Ri,j − R2n−i,2n+2−j = i − j + 1 for all 1 ≤ i, j ≤ 2n. To each rank array R is associated the rank ideal e[1,i],[j,2n] | i, j ∈ [2n]i Ifull (R) := hminors of size (1 + Rij ) in X and, if R is of type C, also the ideal e [1,i],[j,2n] | i, j ∈ [2n]i. Isym (R) := hminors of size (1 + Rij ) in Σ We adopt the natural conventions that an ideal of minors larger than the matrix containing them is the zero ideal, while an ideal of minors of size 0 or smaller is the unit ideal. The definitions of rank ideals are of course concocted so that a permutation w ∈ S2n has an associated rank array R(w) given by R(w)ij = rank P (v)[1,i],[j,2n] = i X n X P (w)kℓ , k=1 ℓ=j the number of 1s in P (w) above and to the right of position i, j, which makes Ifull (w) = Ifull (R(w)) and Isym (w) = Isym (R(w)) for all w for which the left sides of these equations are appropriate. We have not introduced separate rank array technology for the ideals Iup (w) as they are a subclass of the ideals Ifull (w), so the rank arrays for the latter can also be used to work with the former. Lemma 5.1. A permutation w ∈ S2n lies in [1, w ] if and only if −n ≤ (wi − i) ≤ n for all 1 ≤ i ≤ 2n. Proof. The given inequalities on the wi are equivalent to the equalities on the rank array R(w) that, for all 1 ≤ i ≤ n, R(w)i,n+1−i = i and R(w)n+i,2n+1−i = i; note that these are the maximal possible values of these entries of R. Indeed, it is clear that R(w)i,n+1−i = i and 2n + 1 − wi ≥ n + 1 − i are equivalent in the presence of R(w)i−1,n+2−i = i − 1; the others are symmetric in reflection about the antidiagonal. Recall that v ≥ w in Bruhat order if and only if Xv ⊆ Xw , which itself holds if and only if R(v) ≤ R(w) entrywise. So the content of the lemma is that, to check this containment MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 25 of w when v = w , it is enough to check that R(w)i,n+1−i = i and R(w)n+i,2n+1−i = i for each 1 ≤ i ≤ n. This is true because R(w ) is the unique entrywise minimum rank array satisfying these conditions. The inequalities R(w)i,j ≤ R(w)i+1,j , R(w)i,j−1, R(w)i−1,j + 1, R(w)i,j−1 + 1 hold of the rank array of any permutation, and if one uses these iteratively to produce lower bounds for R(w) the bounds one recovers are R(w ).  Remark 5.2. Lemma 5.1 is a special case of a result of Sjöstrand [Sjö07, Theorem 4], which identifies elements in a Bruhat interval [1, π], where π is a permutation defined by inclusions (see Theorem 4.6), with rook placements on an associated skew Ferrers board. For any rank array R, the ideal I(R) is in fact generated by minors of X. Let e[1,i],[j,2n]i I(R)i,j := hRij + 1 minors of X be one of its summands. It is easy to check that  hRij + 1 minors of X[1,i],[j−n,n]i    hR − n + j minors of X ij [n+2−j,i],[1,n]i (7) I(R)i,j =  hRij + n + 1 − i minors of X[1,n],[j−n,2n−i]i    hRij − i + j minors of X[n+2−j,n],[1,2n−i]i i ≤ n, j ≥ n + 1 i, j ≤ n i, j ≥ n + 1 i ≥ n + 1, j ≤ n. The above submatrices of X are only of positive size when n + 1 < i + j < 3n + 1. For the remaining pairs (i, j) our conventions arrange that I(R)ij is either zero or the unit ideal. It is zero for i + j ≤ n + 1 when Ri,j ≥ i, and for i + j ≥ 3n + 1 when Ri,j ≥ 2n + 1 − j, and the unit ideal in other cases. Deeming the unit ideal uninteresting, we lose no other generality in assuming that Ri,j = i for i + j ≤ n + 1 and Ri,j = 2n + 1 − j for i + j ≥ 3n + 1. Let us call these rank arrays hexagonal. The name reflects that the positions of entries which can vary in a hexagonal rank array form a hexagon. The next proposition illustrates the connection between the poset of hexagonal rank arrays and the collection of (intersections of) Kazhdan-Lusztig ideals. As just explained, the “hexagonal” assumption of the theorem is not an important restriction; its use in the proofs will be confined to a few instances. Proposition 5.3. Let R and S be hexagonal rank arrays. Then (a) If Ri,j > min{Ri+1,j , Ri,j−1 , Ri−1,j + 1, Ri,j+1 + 1}, and S is identical to R except that Si,j is equal to the displayed minimum, then Ifull (R) = Ifull (S). (b) Suppose that there are indices i and j such that Ri,j = Ri−1,j = Ri,j+1 = Ri−1,j+1 + 1 =: r. ′ Let S and S ′ be arrays identical to R except that Si−1,j = r − 1 and Si,j+1 = r − 1. ′ Then Ifull (R) = Ifull (S) ∩ Ifull (S ). (c) Ifull (R) + Ifull (S) = Ifull (min(R, S)). (d) If there are no indices i and j satisfying the hypotheses of (a) for Ifull (R) or Ifull (S), then then Ifull (R) ⊆ Ifull (S) if and only if R ≥ S entrywise. 26 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT (e) If there are no indices i and j satisfying the hypotheses of (a) or (b) for Ifull (R), then Ifull (R) is prime. (f) The primary components of Ifull (R) are the minimal ideals Ifull (T ) where T ranges over all arrays obtained from R by repeatedly making the replacements specified in (a) and (b) until neither is possible, using either of the two choices in (b). (g) Suppose Ifull (R) is nonzero. Then it is a sum of prime ideals of the form Ifull (w), as well as an intersection of such prime ideals. Moreover, suppose R and S are of type C. Then the above remain true when Ifull is replaced by Isym throughout, the “identical . . . except for” clauses in (a) and (b) have S and S ′ differ from R in two symmetrically-placed entries to retain the type C property, and (g) uses type C simple reflections. Example 5.4. Consider the hexagonal  1 1 2 2  3 3  4 4 R= 5 5 6 6  7 7 8 7 type C rank array  1 1 1 1 1 1 2 2 1 1 1 1  3 2 2 1 1 1  3 2 2 1 1 1 . 4 3 3 2 2 1 5 4 3 3 2 1  6 5 4 3 2 1 6 5 4 3 2 1 Pursuant to Remark 3.4, the ideal Isym (R) is the analogue of the North-East rank ideal Jsym (w) where w is the partial permutation with matrix   0 0 0 1  0 0 0 0    1 0 0 0 . 0 0 0 0 It is generated by the 3 × 3 minors of Σ and the 2 × 2 minors of its submatrices Σ[1,2],[1,4] and Σ[1,4],[2,4] . By part (g), the ideal Isym (R) is a sum of prime ideals of the form Isym (w), which can be recovered by the procedure in part (f). By part (e), Isym (R) is not itself prime, since the replacement in part (b) is possible, for (i, j) = (3, 4) and (6, 5). Concretely, take (i, j) = (3, 4). Then the two resulting arrays, called S and S ′ in (b), are respectively     1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1  2 2 2 1 1 1 1 1  2 2 2 2 1 1 1 1      3 3 3 2 2 1 1 1  3 3 3 2 1 1 1 1      4 4 3 2 2 1 1 1  4 4 3 2 2 1 1 1 R1 =   and R2 =  ,  5 5 4 3 3 2 2 1  5 5 4 3 2 2 2 1  6 6 5 4 3 2 2 1  6 6 5 4 3 3 2 1      7 7 6 5 4 3 2 1  7 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 in both of which two (underlined) entries have been replaced following the prescription at the end of the proposition, and we have Isym (R) = Isym (R1 ) ∩ Isym (R2 ). Now Isym (R1 ) is MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 27 prime by part (e), while Isym (R2 ) is subject to further replacements as in at (i, j) = (4, 4) or (6, 4). Taking the former, we produce    1 1 1 1 1 1 1 1 1 1 1 1 1 1  2 2 2 2 1 1 1 1 2 2 2 2 1 1     3 3 3 1 1 1 1 1 3 3 3 2 1 1     4 4 3 2 2 1 1 1 4 4 3 2 1 1 R3 =   and R4 =   5 5 4 3 2 1 2 1 5 5 4 3 2 2  6 6 5 4 3 3 2 1 6 6 5 4 3 3     7 7 6 5 4 3 2 1 7 7 6 5 4 3 8 7 6 5 4 3 2 1 8 7 6 5 4 3 with Isym (R2 ) = Isym (R3 ) ∩ Isym (R4 ). to the replacements of the sort in part and then (3, 3). These yield  1 2  3  4 R5 =  5 6  7 8 part (b), namely 1 1 1 1 2 2 2 2  1 1  1  1 , 1 1  1 1 Now Isym (R4 ) is prime, while Isym (R3 ) is subject (a), in fact twice in succession, with (i, j) = (2, 4) 1 2 3 4 5 6 7 7 1 2 2 3 4 5 6 6 1 1 1 2 3 4 5 5 1 1 1 2 2 3 4 4 1 1 1 1 1 2 3 3 1 1 1 1 1 2 2 2  1 1  1  1  1 1  1 1 with Isym (R3 ) = Isym (R5 ). By part (d), Isym (R1 ) ( Isym (R5 ), so the latter can be excluded from the primary decomposition, but there are no other comparabilities between the primes produced. We conclude that the primary decomposition of Isym (R) is Isym (R) = Isym (R1 ) ∩ Isym (R4 ) = Isym (16472538) ∩ Isym (15672348). Proof of Proposition 5.3. We prove the parts out of order. In particular the proof of part (b) will come late; don’t be misled by the fact that we refer to the operation on arrays it invokes before proving what effect this replacement has on ideals. For both Ifull and Isym , part (a) follows from containments among ideals of minors, since the r-minors of X̃[1,i],[j,2n] are included among the r-minors of a larger matrix, and are generated by the (r − 1)-minors of a matrix one row or column smaller, by expansion along that row or column. Part (c) is also easy, since the minors generating Ifull (R) + Ifull (S) appear among those generating Ifull (min(R, S)) and the other generators of the former are larger minors, which are redundant. For Isym the argument is the same. We will show part (e) by comparing to the description of the Kazhdan-Lusztig varieties in Proposition 2.1. Define a 2n × 2n array w by wi,j = Ri,j − Ri,j+1 − Ri−1,j + Ri−1,j+1 . If no replacement as in part (a) is possible in R, then Ri,j − Ri,j+1 ∈ {0, 1}, so that wi,j , which is the difference of two such differences, equals −1 or 0 or 1. If further no replacement as in part (b) is possible, the only state of affairs allowing wi,j = −1 is ruled 28 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT out, so wi,j ∈ {0, 1}. Also 2n X i=1 wi,j = Ri,j − Ri,j+1 − Ri−1,j + Ri−1,j+1 = 1 so there is a unique 1 in every column of w; by a symmetric argument there is a unique 1 in every row of w. So w is a permutation matrix. Lastly, the hexagonality condition implies that no 1 in w has |wi −i| > n, so that w ∈ [1, w ] by Lemma 5.1. So I(R) = I(w) is one of the prime ideals of Proposition 2.1. As for Isym , if R is of type C then from the definition we get wi,j = w2n+1−i,2n+1−j , which implies that w commutes with w0 so that Isym (R) = Isym (w) is again a prime ideal appearing in Proposition 2.1. To prove part (g), we will show that every nonzero ideal Ifull (R) or Isym (R) is a sum of prime ideals of the form Ifull (w) or Isym (w) accordingly. This implies that Ifull (R) resp. Isym (R) is the ideal of an intersection of Kazhdan-Lusztig varieties, by part (c). Such intersections are unions of Kazhdan-Lusztig varieties T as well. To identify them precisely, the cells Xv◦ ∩ X◦w that appear in an intersection i (Xwi ∩ X◦w ) are just those where v is greater than or equal to each wi in Bruhat order, and less than or equal to w . Thus Ifull (R) is the intersection of any collection of Ifull (w) = Ifull (R(w)) where w ranges over a set of permutations including all the minimal such v and perhaps some greater ones. The ◦ analogue is also true for cells XG,v ∩ X◦G,w in the notation of Section 2.2, giving the type C statement. We begin with Ifull (R). We may assume to start with that R allows no replacements as in part (a), since making them leaves R unchanged. Our claim is that by making replacements “dual” to those in parts (a) and (b), we eventually resolve R into a collection of rank arrays R(w) where these substitutions are no longer possible. The precise replacements in question are these: if (8) Ri,j < max{Ri+1,j − 1, Ri,j−1 − 1, Ri−1,j , Ri,j+1 } then change the array by incrementing the (i, j) entry; and if (9) Ri,j = Ri−1,j = Ri,j+1 = Ri−1,j+1 + 1 = r then make two altered copies of the array, one in which the (i, j) entry is incremented and another in which the (i − 1, j + 1) entry is. Observe that these replacements are possible in exactly the same conditions as are those of parts (a) and (b), so that the process will indeed terminate at rank arrays of permutations by part (e). Let the resulting arrays be S1 , . . . , Sm . Each Sk is entrywise greater than or equal to R by construction. Now, by assumption the first replacement made to R is one of type (9). Let S and S ′ be the rank arrays obtained after making all possible replacements of type (8) on the results thereof, so that in S the (i, j) entry has been incremented and in S ′ the (i − 1, j + 1) entry has. Consider S. It is not difficult to show inductively, using the fact that replacements (8) did not apply to R, that in the course of producing S, after an entry at position (i′ , j ′ ) is incremented, the only entries newly in the conditions (8) and therefore subject to be incremented are those at positions (i′ −1, j ′ ) and (i′ , j ′ + 1). Therefore, all entries in which S differs from R are weakly South-West of (i, j). MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 29 ′ Similarly, all entries in which S differs from R are weakly North-East of (i − 1, j + 1). So these sets of entries are disjoint, and in each position at least one of S and S ′ agrees with R. By induction on the number of replacements, for every position (i, j) in R there exists a k so that (Sk )i,j = Ri,j . It follows that R is the entrywise minimum of all the Sk . Therefore, by part (c), the ideal Ifull (R) is a sum of Kazhdan-Lusztig prime ideals, which is what we needed above. In adjusting this argument for Isym , we must make the replacements (8) and (9) in symmetrical pairs to retain the type C property. Then the only remaining thing to check is that that S and S ′ still differ in disjoint sets of entries. Let us take the case that (i, j) sits above the main diagonal. The entries of S ′ which differ from R are still all restricted to the positions weakly North-East of (i−1, j +1), or the mirror image, weakly South-West of (2n+1−i, 2n+1−j). So we need to establish that the entries of S which differ from R don’t impinge on the positions weakly South-West of (2n + 1 − i, 2n + 1 − j). But these entries are all rs in R which get changed to (r + 1)s in S, and form a Ferrers shape with its corner in the South-West, so neither of the positions (2n+1−i, 2n+1−j) or (2n+1−i, 2n+1−j) may be among them because R2n−i,2n+2−j = R2n+1−i,2n+2−j − 1 = R2n−i,2n+1−j − 1, and thus neither may (2n + 1 − i, 2n + 1 − j) or positions further South-West. For part (d), it is clear from the generators that Ifull (R) ⊆ Ifull (S) when R ≥ S. Inversely, if R 6≥ S, it is enough to produce primes Ifull (v) contained in Ifull (R) and Ifull (w) containing Ifull (S) for which Ifull (v) 6⊆ Ifull (w). Choose (i, j) so that Ri,j < Si,j . As argued above, there is a way of repeatedly applying replacements (8) and (9) to R to yield the rank array R(v) of a prime ideal without changing the value at position (i, j). In the “dual” fashion R(w) can be produced from S by applying the replacements (a) and (b) without changing the value at position (i, j). But then R(v)i,j < R(w)i,j implies v 6≥ w in Bruhat order, so Ifull (v) 6⊆ Ifull (w) as desired. The argument for Isym is exactly analogous. We move on to part (b). Using part (g) it is enough to show that a prime Ifull (w) contains Ifull (R) if and only if it contains either Ifull (S) or Ifull (S ′ ), or the same for Isym . Using part (d), this translates to showing that a rank array R(w) is less than R if and only if it’s less than one of S or S ′ . The “only if” direction follows because S and S ′ are less than R. The “if” direction holds because no R(w) can agree in all four entries (i, j), (i, j + 1), (i − 1, j) and (i − 1, j + 1) with R by part (e), since a replacement of type (b) is possible otherwise, so one of these entries must be lesser; in fact one of the (i, j + 1) or (i − 1, j) entries must be lesser, since a replacement of type (a) is possible if only one or both of the (i, j) and (i − 1, j + 1) entries are. Finally, part (f) is an immediate consequence of parts (a), (b), and (e).  5.2. Enumeration. Let x(n), y(n), and σ(n) denote the number of irreducible strata in the stratifications of Matn (K), Upn (K), and Symn (K) from Proposition 2.1. Equivalently, x(n) is the number of permutations in the Bruhat interval [1, w ] ⊆ S2n , y(n) is the number of permutations in the Bruhat interval [wup , w ] ⊆ S2n , and σ(n) is the number of permutations in [1, w ]∩Cn . A noteworthy feature of these sets of permutations is that the Bruhat order conditions on them may all be reinterpreted as rook placement problems on variously shaped boards. See [Sta12, Ch. 2] for a basic overview of enumeration of rook placements. 30 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT Remark 5.5. Interpreting certain Bruhat intervals in terms of rook placements is not a new idea. For example, Sjöstrand did this for certain intervals [1, π] in [Sjö07] (as we discussed in Remark 5.2). Furthermore, in light of results in [Sjö07], it is not surprising that rook placements play an important role in the proof of our next result. Proposition 5.6. The number x(n) is given by x(n) = n+1 X k=1 ((k − 1)! S(n + 1, k))2 where S(n, k) denotes the Stirling number of the second kind. The number σ(n) is given by n+1 X σ(n) = (k − 1)! S(n + 1, k). k=1 Proof. According to Lemma 5.1, in order to find the number x(n) we need to count the permutations w ∈ S2n such that |w(i) − i| ≤ n (10) For the symmetric case, we need permutations in S2n satisfying the same condition plus the extra symmetry condition w(i) + w(2n + 1 − i) = 2n + 1. To explain one solution to this counting problem, we consider the problem of constructing the permutation matrices that satisfy these conditions. We represent these permutation matrices as block matrices   A B P (w) = . C D The condition (10) on a permutation w, recalling our conventions for permutation matrices from Section 2, is equivalent to requiring that the nonzero entries of matrix A fall on or below the antidiagonal, and those of matrix D fall on or above the antidiagonal. Note that taking an allowable permutation w and looking at the induced matrix A gives a rook placement of some number k of non-attacking rooks on a Ferrers board of staircase shape, i.e. with 1 box in the first row, 2 boxes in the second, . . ., and n boxes in the nth row. According to Corollary 2.4.2 of [Sta12], the number of such rook placements with k rooks is S(n + 1, n + 1 − k). Note that if A has exactly k ones in it, D must also have exactly k ones in it, and by symmetry also gives a nonattacking rook placement in a tableau of the same shape. Finally, once we have specified A and D each with k ones, we get unique (n − k) × (n − k) submatrices of B and C where we can put a permutation matrix, to complete the permutation matrix Pw . Summing over k yields the total number of permutations n X ((n − k)! S(n + 1, n + 1 − k))2 , k=0 which is the desired formula after reindexing. In the symmetric case choosing one matrix A completely determines the matrix D, and the matrix B determines the matrix C. This removes the square from the formula.  Proposition 5.7. The number y(n) is the median Genocchi number H2n+1 . MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 31 2̄ 1̄ 0̄ 1 2 3 1̄ 2̄ 3̄ 4 3 2 Figure 1. A board for the rook placement problem for y(3). Let P (n) be the poset on {1, . . . , n, 1̄, . . . , n̄} whose covering relations are those of the · ī. That is, P (n) is the product of chains of lengths forms ī > · i, i + 1 > · i, and i + 1 > n and 2. Let Pe(n) be the poset on the larger set {1, . . . , n + 1, 0̄, . . . , n̄} with the order defined in the analogous way. Lemma 5.8. The prime components counted by y(n) are in bijection with the set   ordered lists of disjoint chains in P (n), G(n) = . each chain containing both barred and unbarred elements Proof. According to Proposition 2.1 (3), y(n) is the number of permutations in the Bruhat interval [wup , w ]. As before, the matrices of these permutations can be interpreted as the solutions to a rook placement problem on a certain board. The disallowed cells are those (i, j) where |i − (2n + 1 − j)| > n, enforcing the upper bound of the interval, and those where i + (2n + 1 − j) ≤ n, enforcing the lower bound. Figure 1 depicts an example. Given a rook placement on such a board, we bijectively construct an element of G(n). Label the rows and columns of the board with elements of Pe(n): the rows get labels n, . . . , 1, 0̄, . . . , n − 1 right to left, and the columns 1̄, . . . , n̄, n + 1, . . . , 2 top to bottom, again as depicted in Figure 1. Now construct the finest partition of Pe(n) such that, for every rook not in the lower-left (speckled) quadrant of the board, its row and column indices lie in the same part. Because the column label exceeds the row label for each of these rooks, this gives a partition of Pe(n) into chains. Discarding the chains containing n + 1 and 0̄ leaves a set g of disjoint chains on P (n), all containing both barred and unbarred elements. The number of rooks outside the lower-left quadrant comprising these chains is 2n−|g|; that is, |g| rooks remain in the lower-left quadrant, placed unrestrictedly in the unoccupied rows and columns. Reading these rooks as a permutation determines an order on the chains of g, and g together with this order gives an element of G(n).  Proof of Proposition 5.7. Using Lemma 5.8, what is left to show is that the numbers |G(n)| are the median Genocchi numbers. We will prove that they satisfy the Seidel triangle recurrence: see for instance [ES00, §2]. Define the numbers sk,i for k ≥ 0, 1 ≤ i ≤ (k + 3)/2 by s0,1 = 0, and otherwise s2k−1,i = s2k−2,i + s2k−1,i−1 , s2k,i = s2k−1,i + s2k,i+1, 32 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT where summands s with out-of-range indices should be interpreted as 0. Then s2n,1 is the nth median Genocchi number. The first sk,i are tabulated below. i\k 0 1 2 3 4 5 6 1 1 1 2 2 8 8 56 2 1 1 3 6 14 48 3 3 3 17 34 17 17 4 In fact, we will show that the entry s2n,i of the Seidel triangle is the number of elements of G(n) such that the unbarred elements 1, . . . , i − 1 are each contained in a chain. For instance, of the 8 elements of G(2), 6 of them have a chain containing 1, and 3 of them have both a chain containing 1 and a chain containing 2 (possibly the same chain). Equivalently, s2n−1,i will count the elements of G(n) such that 1, . . . , i − 1 are each contained in a chain, but (if i ≤ n) i is not. We exhibit a bijection between G(n + 1) and o n , (g, i, j) : g ∈ G(n), 1 ≤ i ≤ n + 2, 1 ≤ j ≤ i, and in g the elements 1, . . . , j − 1 are each contained in a chain such that if g ′ is put in bijection with (g, i, j), then in g ′ the elements 1, . . . , i − 1 are contained in a chain, but i is not. (The condition on i is vacuous if i = n + 2.) This corresponds to the recurrence among the numbers s2k,i : indeed, g ′ is one of the elements counted by s2n+1,i , while g is one of those counted by s2n,j , so the bijection realizes s2n+1,i as the partial sum of the s2n,j for j ≤ i. Given g ′ , we construct (g, i, j). First, i is determined by g ′ as above: it’s the least unbarred index not contained in a chain of g ′ , or n + 2 otherwise. Let h be obtained from g ′ by deleting i and ī (or n + 1 and n + 1 if i = n + 2), and then decrementing all labels greater than i, barred and unbarred, so that h is an ordered list of chains on P (n). We break the construction of g and j into several cases for the purpose of sketching the reverse bijection hereafter. Case 1: If i < n + 2 and ī is contained in no chain in g ′ , then we let g = h and j = i. Otherwise there is a chain C in g ′ which contains ī (if i < n + 2) or n + 1 (if i = n + 2). Case 2: If C has more than one barred element, then we let g = h and j be the greatest unbarred element of C. Case 3: If C has only one barred element but is the last chain in the ordered list g ′, then we let g be h with the chain that is the remnant of C deleted, and j be the least (unbarred) element of C. Otherwise, C has only one barred element, and is followed in g ′ by another chain D. Case 4: If the least element of C is greater than the least element of D, let g be h with the remnant of C deleted, and j be the greatest unbarred element of D. Case 5: If the least element of C is less than the least element of D (call this d), then let g be h with all the elements of C less than d inserted into the image of D and the remainder of C deleted, and let j be the greatest element of C less than d. MATRIX SCHUBERT VARIETIES AND GAUSSIAN CONDITIONAL INDEPENDENCE MODELS 33 We describe the inverse of this bijection more summarily. Let (g, i, j) be in the image of the bijection. Let h′ be the list of chains of P (n + 1) obtained from g by incrementing the labels in g that are greater than or equal to i, whether barred or not. Then g ′ will equal either h′ or a small modification thereof. If j = i and i < n + 2, we are in Case 1 above, and g ′ = h′ . Otherwise, if j is not in a chain of g, including if j = n + 2, we are in Case 3, and g ′ is obtained from h′ by appending the chain containing ī and all unused unbarred labels strictly less than i. If j is in a chain D of g but is not the greatest unbarred element thereof, we are in Case 5, and g ′ is obtained from h′ by removing the unbarred elements less than or equal to j from D, and inserting before D a new chain containing ī, these removed elements, and any unused unbarred labels strictly less than i. If j is the greatest unbarred element of a chain D of g, we are in Case 2 if every element 1, . . . , i − 1 is in some chain of g, in which case g ′ is obtained from h′ by inserting ī into D. Otherwise we are in Case 4, and g ′ is obtained from h′ by inserting before D the chain containing ī and all unused unbarred labels strictly less than i.  Acknowledgements. We thank Allen Knutson for pointing out the connection between symmetric matrices and the symplectic Grassmannian, and an anonymous referee for several valuable suggestions. In particular, Proposition 4.8 and all connections to Gasharov and Reiner’s work [GR02] appears because of the referee’s comments. Seth Sullivant was partially supported by the David and Lucille Packard Foundation and the US National Science Foundation (DMS 0954865). References [BK05] Michel Brion and Shrawan Kumar, Frobenius splitting methods in geometry and representation theory, Progress in Mathematics, vol. 231, Birkhäuser Boston, Inc., Boston, MA, 2005. MR 2107324 (2005k:14104) [Bri05] Michel Brion, Lectures on the geometry of flag varieties, Topics in cohomological studies of algebraic varieties, Trends Math., Birkhäuser, Basel, 2005, pp. 33–85. MR 2143072 (2006f:14058) [BW93] Thomas Becker and Volker Weispfenning, Gröbner bases, Graduate Texts in Mathematics, vol. 141, Springer-Verlag, New York, 1993, A computational approach to commutative algebra, In cooperation with Heinz Kredel. MR 1213453 [Din01] Kequan Ding, Rook placements and classification of partition varieties B\Mλ , Commun. Contemp. Math. 3 (2001), no. 4, 495–500. MR 1869101 [DSS09] Mathias Drton, Bernd Sturmfels, and Seth Sullivant, Lectures on algebraic statistics, Oberwolfach Seminars, vol. 39, Birkhäuser Verlag, Basel, 2009. MR 2723140 (2012d:62004) [EL96] Kimmo Eriksson and Svante Linusson, Combinatorics of Fulton’s essential set, Duke Math. J. 85 (1996), no. 1, 61–76. MR 1412437 [ES00] Richard Ehrenborg and Einar Steingrı́msson, Yet another triangle for the Genocchi numbers, European J. Combin. 21 (2000), no. 5, 593–600. MR 1771988 (2001h:05008) [Ful92] William Fulton, Flags, Schubert polynomials, degeneracy loci, and determinantal formulas, Duke Math. J. 65 (1992), no. 3, 381–420. MR 1154177 (93e:14007) [Ful97] , Young tableaux, London Mathematical Society Student Texts, vol. 35, Cambridge University Press, Cambridge, 1997, With applications to representation theory and geometry. MR 1464693 (99f:05119) [FZ99] Sergey Fomin and Andrei Zelevinsky, Double Bruhat cells and total positivity, J. Amer. Math. Soc. 12 (1999), no. 2, 335–380. MR 1652878 [GR02] V. Gasharov and V. Reiner, Cohomology of smooth Schubert varieties in partial flag manifolds, J. London Math. Soc. (2) 66 (2002), no. 3, 550–562. MR 1934291 34 ALEX FINK, JENNA RAJCHGOT, AND SETH SULLIVANT [KLS13] Allen Knutson, Thomas Lam, and David E. Speyer, Positroid varieties: juggling and geometry, Compos. Math. 149 (2013), no. 10, 1710–1752. MR 3123307 , Projections of Richardson varieties, J. Reine Angew. Math. 687 (2014), 133–157. [KLS14] MR 3176610 [KM05] Allen Knutson and Ezra Miller, Gröbner geometry of Schubert polynomials, Ann. of Math. (2) 161 (2005), no. 3, 1245–1318. MR 2180402 (2006i:05177) [Knu09] Allen Knutson, Frobenius splitting, point-counting, and degeneration, 2009. [LR08] Venkatramani Lakshmibai and Komaranapuram N. Raghavan, Standard monomial theory, Encyclopaedia of Mathematical Sciences, vol. 137, Springer-Verlag, Berlin, 2008, Invariant theoretic approach, Invariant Theory and Algebraic Transformation Groups, 8. MR 2388163 (2008m:14095) [Lus94] G. Lusztig, Total positivity in reductive groups, Lie theory and geometry, Progr. Math., vol. 123, Birkhäuser Boston, Boston, MA, 1994, pp. 531–568. MR 1327548 [Sjö07] Jonas Sjöstrand, Bruhat intervals as rooks on skew Ferrers boards, J. Combin. Theory Ser. A 114 (2007), no. 7, 1182–1198. MR 2353118 [Sta12] Richard P. Stanley, Enumerative combinatorics. Volume 1, second ed., Cambridge Studies in Advanced Mathematics, vol. 49, Cambridge University Press, Cambridge, 2012. MR 2868112 [STD10] Seth Sullivant, Kelli Talaska, and Jan Draisma, Trek separation for Gaussian graphical models, Ann. Statist. 38 (2010), no. 3, 1665–1685. MR 2662356 (2011f:62076) [Sul09] Seth Sullivant, Gaussian conditional independence relations have no finite complete characterization, J. Pure Appl. Algebra 213 (2009), no. 8, 1502–1506. MR 2517987 (2010k:13045) [UW13] Henning Ulfarsson and Alexander Woo, Which Schubert varieties are local complete intersections?, Proc. Lond. Math. Soc. (3) 107 (2013), no. 5, 1004–1052. MR 3126390 [WY08] Alexander Woo and Alexander Yong, Governing singularities of Schubert varieties, J. Algebra 320 (2008), no. 2, 495–520. MR 2422304 (2009j:14063) [WY12] , A Gröbner basis for Kazhdan-Lusztig ideals, Amer. J. Math. 134 (2012), no. 4, 1089– 1137. MR 2956258
10math.ST
Machine Code Optimization – Improving Executable Object Code Clinton F. Goss Westport, CT, USA. Email: [email protected] ARTICLE INFORMATION ABSTRACT Initial publication: June 1986 This dissertation explores classes of compiler optimization techniques that are applicable late in the compilation process, after all executable code for a program has been linked. I concentrate on techniques which, for various reasons, cannot be applied earlier in the compilation process. In addition to a theoretical treatment of this class of optimization techniques, this dissertation reports on an implementation of these techniques in a production environment. I describe the details of the implementation which allows these techniques to be re-targeted easily and report on improvements gained when optimizing production software. Advisor: Edmond Schonberg Institution: Courant Institute, NYU Web publication: March 2011 This revision: August 22, 2013 This work is licensed under the Creative Commons AttributionNoncommercial 3.0 license. Keywords: I begin by demonstrating the need for optimizations at this level in the UNIX programming environment. I then describe a Machine Code Optimizer that improves code in executable task files in that environment. The specific details of certain algorithms are then described: code elimination to remove unreachable code, code distribution to re-order sections of code, operand reduction to convert operands to use more advantageous addressing modes available on the target architecture, and macro compression to collapse common sequences of instructions. I show that the problem of finding optimal solutions for code distribution to be NP-Complete and discuss heuristics for practical solutions. I then describe the implementation of a Machine Code Optimizer containing the code elimination, code distribution, and operand reduction algorithms. This optimizer operates in a production environment and incorporates a machine-independent architecture representation that allows it to be ported across a large class of machines. Compiler optimization; Machine code; Code elimination; Operand Reduction; Macro compression I demonstrate the portability of the Machine Code Optimizer to the Motorola MC68000 and the Digital VAX-11 instruction sets. Finally, metrics on the improvements obtained across architectures and across the optimization techniques are provided along with proposed lines of further research. The metrics demonstrate that substantial reductions in code space and more modest improvements in execution speed can be obtained using these techniques. Preface 1. Introduction This revised edition of my 1986 Ph.D. dissertation was originally authored on a CDC 66001 using TROFF with TBL and EQN. The text for this edition was provided courtesy of The Internet Archive and initially published online in March, 2011. This revised PDF edition was published online August 22, 2013. The topic of compiler optimization covers a wide range of program analysis methods and program transformations which are applied primarily to improve the speed or space efficiency of a target program. These techniques are typically applied to a representation of the target program which is, to some degree, removed from the program representation executed by the hardware. The representations on which optimization techniques are applied include source-to-source transformations ([Parts 83], [Schn 73]) down to optimizations on assembly code ([Fras 84], [Lower 69], [McKee 65]). 1 The same CDC 6600 that a group from the Transcendental Students took hostage in 1970 in an anti-war protest. Some of the students, possibly members of the Weathermen, attempted to destroy the computer with incendiary devices. However, several staff and faculty, including Peter D. Lax, managed to disable the devices and save the machine. However, in many program development environments, some significant optimization techniques cannot be performed on any program representation prior to the Citation for this article: Goss C. 1986/2013. Machine Code Optimization – Improving Executable Object Code. Ph.D. dissertation, Technical Report #246, Courant Institute of Mathematical Sciences, New York University, June 1986. Revised August 22, 2013. 41 pages. http://www.ClintGoss.com/mco/. Retrieved [Date-of-Retrieval]. Goss Machine Code Optimization representation executed by the hardware, without general redesign of that environment. It is my thesis that the application of optimization techniques at this level is warranted and can be shown to yield a significant decrease in code space and a more modest improvement in execution speed. As a result, this dissertation describes two aspects of this area in parallel. I explore analysis and optimization techniques from a theoretical viewpoint. Some of these are new and some are extensions of techniques which have been applied in other phases of the compilation process. In addition, I report on the implementation of a production quality Machine Code Optimizer. This optimizer represents the first time that these techniques have been brought together in this fashion and at this level. The performance of this optimizer substantiates the expected speed and space improvements on two target architectures. In this chapter, I demonstrate the need for optimizations at this level and suggest that such optimizations can he carried out despite the lack of auxiliary information which would normally be available to an optimizer. I also survey existing work in closely related areas and outline the remainder of this dissertation. 1.1. Background As a working example throughout this dissertation, I will consider the compilation and optimization of programs under UNIX and UNIX-like program development environments. These environments will be considered specifically for machines based on architectures such as the Digital Equipment Corporation VAX-11 ([DEC 77]), Motorola MC68000 ([Motor 84a]), and the Texas Instruments TI32000 ([Texas 85]). I will, unless specifically noted, rely only on features of UNIX which are generally available in program development environments. The scope of architectures considered in this research is discussed later in this section. In source form, a program consists of a number of modules, each containing one or more subprograms (subroutines, functions, etc.). A compiler for the given high level language reads the source code of a single module, possibly translating into one or more internal forms over which optimization techniques are performed, and produces a single object file. This file contains machine code consisting of instructions to be executed by the hardware, data objects which are operated on by the instructions, and other information. The architectures to be considered here have a memory area consisting of locations with an associated linear ordering. The locations are numbered sequentially by addresses that follow the ordering. Each instruction on these 2 architectures has an opcode which names the operation to be performed and a number of operands which yield values or give the address of data objects or memory locations to be operated on. Each operand requires an area, called an extension word, in the instruction to hold information on the value or machine address which the operand represents. The bit representations of the instructions and data objects in an object file are identical to those which will appear in memory when the program is executed, except that references to code and data objects in other modules as well as references to absolute addresses in the current object file are not set. Such references are called relocatable references. Any operand of an instruction containing a relocatable reference is called a relocatable operand and the address it references is called the effective address. Information regarding where relocatable references are and what they refer to is contained in the relocation information in each object file. The location of a relocatable reference, as specified by the relocation information, is called its relocation point. When all modules of a program are compiled, the object files are supplied to a system linker. The linker produces a task file which can be directly loaded into memory and executed by the hardware. Such a task file contains areas of code, data objects, and optionally, relocation information. Each area, or segment, is formed by catenating the corresponding areas from each object file, in the order they were supplied to the linker, and resolving relocatable references by installing the actual machine address in each reference. For a particular high level language, it is typical to organize a set of object files that implement the primitives of the language (e.g. SIN(x) in BASIC, Indexed Read in COBOL, and printf() in C) into a library. Such libraries can be given to the linker, which selects only those object files that contain code or data referenced by other modules already linked into the task file. This general approach reduces the compilation work necessary to effect small changes in a program: only the affected modules need be recompiled. Since linking object files is far faster than re-compiling the whole program from source, this system greatly speeds development of highly modularized programs. However, this general approach results in a number of inefficiencies in the code in the task files. Furthermore, the optimization techniques that might remove these inefficiencies must be performed after the link phase on the given architecture. Goss Machine Code Optimization The first inefficiency arises when linking an object file which contains code for several subprograms. If any of the subprograms or data objects in such an object file is referenced, the entire object file is linked into the task file. This situation frequently arises in UNIX environments where large libraries implementing primitives of various types are linked into an application. Furthermore, it cannot be avoided prior to the link phase, except by restructuring the offending object files. Another inefficiency deals with the use of the instruction set itself. The given architectures all have a set of addressing modes which can be used to represent the semantics of instruction operands. Included in this set are a number of location-relative modes which yield an effective address by giving an offset from the location of the operand or the start of the instruction. Often, the location-relative modes require less space and yield an effective address that is decoded (by the hardware) faster than absolute modes which simply name the effective address. However, the short offset employed limits the effective address to within a specified distance from the operand. This limitation is called the span of the mode. For example, many machines have several addressing modes for operands of branch instructions. Each addressing mode has its own span restrictions. Often, the most general form allows an arbitrary branch target, but is the most expensive in terms of space and execution speed. Shorter and more efficient forms of branch operands compute their target address relative to the memory address of the branch instruction itself, together with an offset from the start of the instruction. However, the offset must be small, allowing only relatively local branch targets. Often, these location-relative modes cannot be used in UNIX task files due to the method of linking. After an object file is produced, the sizes of instructions do not change; the linker merely fills in resolved addresses in relocatable operands. Again, this allows a fast linker to perform minimal work when code to a single module is changed. However, relocatable effective addresses which cannot be confined within the span of a location-dependent mode must be implemented using the most general and usually most expensive addressing mode. Under the UNIX scheme, this includes references to code in other modules as well as all references to static data, since the data appears in memory after all code and can be arbitrarily far away from an operand. Finally, the installation of location-relative modes is itself limited by the order in which object files are linked. Typically, libraries containing code for primitives are linked in at the end of the text segment. Thus, they tend to be far 3 away from the code which uses them. In many high level languages, primitives tend to be the most frequently referenced routines, and locating them at the end of the text segment may significantly reduce an optimizer's ability to install location-relative modes in operands. Such high-use subprograms need to be placed near their references. Conversely, code generated from the user's source appears at the beginning, far removed from the data segment containing referenced global variables. This code should appear near the end of the text segment, as close to the data segment as possible. The inefficiencies described thus far are common across a variety of architectures. These generally include machines with a linear address space which provide several interchangeable addressing modes to access this space. Other than the MC68000, VAX-11, and TI32000 mentioned earlier, the Digital PDP-11 ([DEC 75]), Interdata 8/32, IBM 1130, CDC 6600 Peripheral Processor, and the Prime 400 (see [Bell 71] for a general discussion) are in this class. The above remarks do not apply to architectures with a purely segmented architecture such as the Intel 8086 ([Russ 80]). The generic techniques for handling the inefficiencies described above are applicable across this full class of architectures. However, the implementation of these techniques for a given architecture is highly dependent on the specifics of the instruction set, addressing structure, and memory model of the target machine. A straightforward implementation of these techniques will be riddled with specific references to the architecture. Therefore, it is of special interest to develop, in conjunction with generic techniques for handling these inefficiencies, a technology for instantiating those techniques in an architecture-independent fashion. 1.2. Related Work The general topic of compiler optimization has received much attention, with the bulk of the work concentrating on transformations applicable to some intermediate representation between source code and executable code. I have borrowed a number of high level concepts and techniques from a number of sources, applying them with greater effectiveness at the machine code level. While the specific work in each area is reviewed in detail in the relevant sections which follow, I outline the major references in each area: A number of the inefficiencies described above can be partially removed by means of techniques applied at a higher program level. These include the implementation of code elimination of various forms, as described in [Aho 77], the handling of span-dependent instructions at the assembly code level in [Szym 78], and the compression of repeated code sequences at the assembly code level in [Fras 84]. Goss Machine Code Optimization Many techniques appear in the literature which deal with low-level constructs, but are not applicable to machine code optimization due to their effectiveness on an intra-module basis. Thus they are more efficiently applied before the machine code level so that work is not repeated on a given module. These techniques include ordering basic blocks to minimize the number of branches [Raman 84], chaining span-dependent jumps [Lever 80], and peephole optimization [McKee 65]. Comparatively little work has been done on optimizations at the machine code level. The works known to the author are those by [Dewar 79a] on compressing an interpretive byte stream and [Rober 79] on distribution of data throughout the code segment as described in Chapter 4. 4 machine code, and outputs another task file which is semantically equivalent. Briefly, the MCO operates in the following sequential phases: The input task file is read and augmented by a set of dynamic data structures which hold information about the instructions and data of the program. These are built up during instruction parsing in which the byte stream containing program code is partitioned into machine instructions and data areas. This list of instructions and data areas is then partitioned into subprograms during text blocking. The next phase, called operand linking, is responsible for identifying all relocatable operands and determining what they refer to. 1.3. Organization of the Dissertation In response to the inefficiencies described in Section §1.1 and building on the work surveyed in the last Section, a Machine Code Optimizer (MCO) was constructed to make machine code smaller and faster. The remainder of this dissertation deals mainly with the design, implementation, and performance of the MCO. I concentrate on describing those techniques which, for various reasons, cannot be applied before the link phase of compilation. The first optimization performed is code elimination in which unreferenced areas of code and subprograms are removed from the dynamic data structures. The next Chapter gives an overview of the organization of the MCO and outlines the design of particular areas. Operand reduction converts each instruction operand to use the least expensive addressing mode which can represent the operand on the given architecture. This operates in two sub-phases: MINIMIZE contracts all operands to use the least expensive applicable addressing mode and LENGTHEN expands minimized operands as necessary to satisfy constraints on the addressing modes. Chapter 3, Chapter 4, and Chapter 5 expand on the specific techniques for removing the inefficiencies in Section §1.1. References to related work in each area are given as well as the specific algorithms and their analysis. Chapter 6 describes a number of techniques relating to recognizing and compressing common sequences of code. These are not used in the current MCO for various implementation or efficiency reasons, but the experience gained is of interest to compiler constructors. Chapter 7 presents statistics on the space and speed improvements gained by the MCO on VAX-11 and MC68000 code for various high level languages. Statistics on the space and time cost of the MCO itself are also presented as well as the effort of re-targeting the MCO from the 68000 to the VAX architecture. Finally, Chapter 8 reviews the work, summarizes the results obtained, and proposes lines of future research. 2. Design of the MCO The MCO reads an input task file containing executable machine code, data, and relocation information data for a given architecture, applies various techniques for improving Then, code distribution is performed. Sections of code and data are re-ordered to reduce the average distance between instruction operands and the effective addresses they reference. This transformation by itself does not improve the code, but makes the next technique more effective. Finally, the code relocation phase installs changes in the bit patterns of instructions as a result of the improvement techniques applied and writes the output task file. One of the design goals of the MCO is to ease the onus of re-targeting the MCO to various architectures. Toward this goal, most of the relevant information about the target architecture is kept in a set of static data structures. They describe the details of the instruction set and addressing modes of the target architecture which are needed by the MCO, especially during Operand Reduction. The static data structures allow the MCO to be largely table driven in areas where re-targeting is an issue. In this chapter, I give a more detailed description of the dynamic data structures and the phases of the MCO I have just outlined. Particular attention is given to how the phases interface and what their effects are on the dynamic data structures. Certain algorithms as well as the static data structures are described and analyzed in later chapters. Goss Machine Code Optimization 2.1. Input Input to the MCO consists of a single task file. This file contains the following areas of information: The Header: A fixed-size structure containing the sizes of the other areas, the program load address where the program is loaded into memory, and the entry point giving the location of the first instruction to be executed. The Text Segment: A byte stream containing the machine code instructions of the program, possibly interspersed with areas of program data. At execution time, the byte stream is loaded into memory (possibly in a virtual fashion) by a system loader, beginning at the program load address specified in the header. The address at which an instruction is loaded into memory is called that instruction's load address. The Data Segment: A byte stream similar to the text segment, but containing only program data. It is loaded by the system loader either directly after the text segment or at some address specified in the header. The rules as to where the data segment may be loaded in relation to the text segment (e.g. at the next 64-byte boundary) vary depending on the environment. The location where the data is loaded into memory is the data load address. The Symbol Table: A list of structures which map symbolic names onto symbol types and machine addresses. Relocation Information: A list of locations in the text and data segments which reference machine addresses. These may be instruction operands which specify the address of an object in the data segment or a pointer in the data segment initialized to point to another piece of data or an instruction. Each such area specified is the size of a pointer on the target architecture. Except for the last area, the information required by the MCO in a task file is standard in that such information is logically required for a system loader to be able to load a program into memory. The Relocation Information is optionally provided by the UNIX linker, which links together object files. On some systems, the linker cannot provide this information in the task file. However, the relocation information is simply distilled by the UNIX linker from similar information in each of the object files it links together. This information must be present in some form in object files in order for a linker to assign proper values to pointers. In this case, the MCO can extract and distill it in the same way that the UNIX linker does. 5 2.2. Instruction Parsing and Internal Representations After opening the input task file and reading the header, the MCO begins parsing the text and data segments to build an internal representation of the program. First, the contents of the text and data segments are read into buffers in memory. Then the MCO creates a list of text and data nodes in memory to hold relevant information about the program. Each text node describes a single machine instruction and each data node is associated with a single area of contiguous data. The last node on the list is always a data node which represents the data segment. Appendix A provides a detailed description of the fields in a text node and what they represent. Figure 2.1 summarizes the fields of a text node using an example of an instruction on the 68000 architecture as they would appear after instruction parsing. In this example, the target address, S, is represented using the absolute long mode. Instruction: 0A00 0A06 ... 0C20 jsr S S: Text Node: OPC: o_jsr -- instruction opcode SIZE: sz_none -- size of object being -- operated on IADDR: 0A00 -- address of start of -- instruction FADDR: (NULL) -- used for operand reduction INSTR: 4EB900000C20 -- instruction bytes NEXT: -- text node of instruction -- at addr 0A06 IBYTES: 6 -- Initial # of instruction bytes NBYTES: 6 -- Current # of instruction bytes REF: 0 -- # of references to this instr JSR: 0 -- # of calls to this instr OP[0]: -- operand descriptor for -- first operand ADDR: 0 -- relocatable address referenced TARGET: -- target text node of operand MODE: am_abs -- current addressing mode OFFSET: 2 -- byte offset of operand bytes REG: NULL -- identity of register(s) used Figure 2.1 Example Text Node Each data node holds information pertaining to a single contiguous block of data. The data may be in the text or data segments. Data notes have IADDR, FADDR, NEXT, NBYTES, and REF fields which are identical to text nodes. They also Goss Machine Code Optimization have a DATA field which serves the same purpose as the INSTR field in the text notes. The dynamic data structures are built up by an instruction parsing routine. This routine is given a pointer to a location in the input text segment and determines the information needed to initialize a single text or data node for the instruction or data area beginning at that location. The instruction parsing routine depends heavily on the architecture and takes a significant portion of the processing time of the MCO. For the 68000, the logic of parsing instructions is embedded in a large routine (28 pages of C source) which was tightly coded for speed. When re-targeting to the VAX architecture, a data-driven scheme was used. This routine was small (2 pages of C source), developed and debugged quickly, but still runs about as fast as the 68000 version. This was possible due to the greater orthogonality of the VAX instruction set.2 6 Text blocking is performed in a single pass over the code. A pair of text nodes containing an unconditional branch or subprogram return followed by an instruction with its JSR field set constitutes a partition point. At these points, a new block is formed. Thus, a block is typically one or several subprograms in the text segment where each block is independent and linked only via the block nodes. After text blocking, the two-level data structure is processed by all subsequent algorithms, rather than the initial single list of text nodes. Figure 2.2 demonstrates this transformation. The specific fields of a block node are described in detail in Appendix A. 2.3. Text Blocking Instruction parsing organizes the text and data nodes into a single linked list, in the order they were read in. This single list is broken down into a two-level data structure during text blocking. The text and data nodes are partitioned into blocks, each of which is assigned a block node. 2 One complication of instruction parsing is that no data can appear in the text segment. It is usually straightforward to get the compiler to place constant tables, switch tables, indexed jump tables, etc. into the data segment. However, the VAX implementation was complicated by the presence of register masks at the start of each subprogram. These are arbitrary bit patterns that specify, when control is passed to the subprogram, which registers are to be preserved. If the instruction parser were called with a pointer to a register mask, the resulting text node would be meaningless since the register mask is pure data. Hence, instruction parsing on the VAX cannot be done in a single sequential pass, as it is on the 68000. The VAX implementation runs in two passes. The first pass processes the code sequentially, building a list of known register mask locations from call instructions which are parsed. Any calls to forward targets alert this first pass that register masks exist. However, it is not until the second pass that text nodes are built, when register masks have been marked. This is a source of potential error in the current MCO for the VAX. If the first pass encounters an unmarked register mask, it could misparse instructions badly enough to miss another call instruction to a routine which is called only once This routine would then have an unmarked register mask, which would cause problems in the second pass. In practice, the first phase re-synchronizes very quickly (5–10 bytes) and this has not caused problems. For unreferenced subprograms, the instruction parser does attempt to parse register masks during the second pass. However, the text nodes from this parsing will be eliminated during subprogram elimination. A better solution to this problem is to have the compiler or assembler emit a short illegal instruction prior to each register mask. Since execution never flows into a register mask, the marker will do no harm at execution time and can serve as a flag to the instruction parser. Figure 2.2. Text Blocking Text blocking is done for two reasons. First, the code distribution algorithm reorders sections of code. After text blocking, it simply deals with block nodes rather than lists of text and data nodes. Second, several of the algorithms performed on the dynamic data structures have a worst-case performance which is quadratic in the number of text nodes since they have to perform linear searches for a node with a given IADDR. In these cases, we search through the list of block nodes to find the correct block and then examine the text and data nodes in that block. In this way, the quadratic algorithms run in reasonable time for all but pathological or contrived input. 2.4. Operand Linking After the instructions have been parsed and the dynamic data structures built, the relocatable operands are identified Goss Machine Code Optimization and linked to their targets. This operand linking is done in two passes over the dynamic data structures. The first pass identifies all relocatable operands. This is done by a pair of co-routines which pass over the text and data nodes and over the relocation information in the input task file. The first co-routine processes instructions up to the next relocation point specified by the second co-routine. The second co-routine processes the relocation information to determine the next text or data node which has a relocatable operand. The first co-routine marks any operand which uses some location-relative addressing mode as relocatable and the effective address is stored in the ADDR field of the operand. At a relocation point, we determine whether the address specified as being relocatable is in a text node or a data node. If it is in a text node, the operand of the instruction specified by the relocation information is identified and again marked as relocatable by setting its ADDR field. Since no relocation information is kept in data nodes, relocation directives specifying relocatable references in data nodes are ignored. Note that, except for location-relative addressing modes, it is crucial to use the relocation information to identify relocatable operands. If we rely on the apparent nature of the operand based on its addressing mode, operands could not be unambiguously identified as relocatable. Consider an instruction which loads the address of its operand. Although this operand appears to be relocatable, the idioms lea moval val,An val,Rn (on the 68000) and (on the VAX) are often used to load constant (non-relocatable) values. Conversely, a comparison with an immediate operand may be a constant, but could also be comparing a value with the (relocatable) address of a routine. After the first operand linking pass, all operands which are relocatable have their ADDR field set. The second pass sets the TARGET field for all such operands. This field is set to point to the text or data node containing the code or data that will be loaded at the ADDR address. Note that the ADDR field need not refer to the start of the code or data in the referenced node; the referenced node must simply contain the target. It is this second pass which runs in quadratic time in the number of block nodes. However, due to the blocked data structure employed, the second pass runs with reasonable speed (see Section §7.2). 7 In addition to setting the TARGET field, the REF field of any text node referenced by a relocatable operand anywhere in a text or data node is incremented during pass 2. Also, the JSR field is incremented if the relocatable operand is the operand of some subprogram call instruction. Thus, at the end of operand linking, the ADDR and TARGET fields are set for all and only those operands which are relocatable. Also, the REF field contains an exact count of the number of relocatable references to a text or data node. The JSR field contains a lower bound on the number of call instructions which refer to a given text node. Due to indirect calls through pointers to procedures, some text nodes which may be the target of a call instruction at execution time cannot be identified. However, such nodes will always have a non-zero REF field. Figure 2.3 depicts the text nodes from Figure 2.1 after the operand linking phase. Instruction: 0A00 0A06 ... 0C20 jsr S S: Text Node: OPC: o_jsr SIZE: sz_none IADDR: 0A00 FADDR: (NULL) INSTR: 4EB900000C20 NEXT: -- text node of instruction at -- addr 0A06 IBYTES: 6 NBYTES: 6 REF: 0 JSR: 0 TN: Text Node at operand target: OP[0]: ADDR: 0C20 OPC: ?? TARGET: TN IADDR: 0C20 MODE: am_abs ... OFFSET: 2 REF: 1 -- # references REG: NULL JSR: 1 -- # of calls Figure 2.3 Example Text Node After Operand Linking 2.5. Code Elimination The first code improvement performed by the MCO is the elimination of code which can never be executed. As previously described, we wish to eliminate sections of code as well as entire subprograms which are never referenced. The code elimination algorithm is an augmented version of unreferenced code elimination ([Aho 77]). It relies on the Goss Machine Code Optimization 8 REF and JSR fields set during the previous phase to determine what code can safely be eliminated. This is done in a single forward pass over the code. The algorithm removes unreferenced code as well as certain referenced sections which are not reachable from the program entry. that are unsuitable due to some span-dependent constraint on the mode. Again, we form the set of possible opcode/addressing mode substitutions. We now choose the least expensive one which satisfies all semantic as well as span-dependent constraints. The algorithm and the restrictions on what input programs it operates on are given in Chapter 3. Again, no change is made to instruction bit patterns, but sufficient space is maintained in the text node to store the full instruction. 2.6. Code Distribution As mentioned in the introduction, one of the inefficiencies in the way UNIX task images are linked arises from the order in which subprograms in the text segments are arranged. Both the order of subprograms in a module and the order in which modules are supplied to the linker give no consideration to placing span-dependent operands near their targets. The operand reduction algorithm is implemented in a largely machine-independent fashion using static data structures to describe the necessary attributes of the instruction set and addressing modes of the target architecture. The details of these static data structures and the associated algorithms outlined above are given in Chapter 5. The code distribution phase re-orders subprograms in the text segment to place span-dependent operands near their targets. The target might be in another subprogram or in the data segment at the end of the program. In Chapter 4, I discuss the general problems of reordering sections of the data segment as well as the text segment from a theoretical viewpoint and show these problems to be difficult to solve. Due to these results, I employ efficient heuristics to distribute the blocks. These heuristics are described in Chapter 4, along with other related optimization techniques not employed in the current MCO. 2.7. Operand Reduction After code elimination and distribution, the operand reduction algorithm is employed. This algorithm makes aggressive use of the addressing modes available on the target architecture to transform existing instruction operands to make them smaller and faster. The general operand reduction algorithm is loosely based on the one proposed by [Szym 78] for assembling code for architectures with span-dependent instructions. The correctness and termination arguments in that paper apply in a similar fashion to operand reduction. As with the assembler algorithm of [Szym 78], we perform operand reduction in two phases. The first phase, MINIMIZE, makes a single pass over the code. For instructions and operands which can potentially be reduced (all relocatable operands and certain others with specified addressing modes), we form the set of all legal opcode/addressing mode pairs which can yield a semantically equivalent instruction. We then choose the shortest combination and install it. After MINIMIZE, the LENGTHEN phase iterates over the code identifying operands which employ addressing modes 2.8. Code Relocation The final phase of the MCO, code relocation, installs the changes made during earlier code improvements in the bit patterns of each instruction and data area and produces an output task file. First, a single pass is made over the code to install new bit patterns in instruction opcodes and operands which were subject to operand reduction. The lengths of instructions are correctly maintained by MINIMIZE and LENGTHEN, so no reallocation of buffers to hold instruction bytes is needed during code relocation. Next, the relocation information in the input task file is re-scanned to find any relocation directives referring to relocatable addresses in the data nodes. We then modify the pointer value in the referenced data node to contain the FADDR of the node whose IADDR was equal to the input pointer value. If the input pointer referenced an instruction, we make sure that it points to the start of the instruction. An input pointer to the middle of a data area can safely be translated since data nodes are never contracted or expanded. We simply add the same offset to the FADDR address that the original pointer was offset from the IADDR of the target data node. Finally, a file header for the output task file is written, followed by the contents of each text and data node. To satisfy the requirements of UNIX debuggers, a copy of the input symbol table modified to reflect the changes in the machine address for each symbol is also output. 3. Code Elimination The code elimination phase of the MCO removes subprograms which can never be invoked. It uses an augmented version of a simple single-pass code elimination algorithm that employs a good heuristic to test which sections of the flow graph have circularities but are not Goss Machine Code Optimization connected to the program entry point. In this way, entire subprograms, especially ones with loops, can be eliminated in a single pass. This chapter begins by describing the limitations to which the input program must be subject in order for this technique to be applicable. I then give a classification of existing code elimination techniques and present my algorithm in light of these. 3.1. Restrictions on the Input Program In general, the problem of code elimination on machine code is complicated by two considerations: First, since we are not improving code from a given high-level source language, we cannot rely on any rules of program structure (e.g. a task image compiled from PASCAL source would never have a jump into the middle of a subprogram). Rather, we must accept any valid machine code generated from any high-level language. This problem is handled by the MCO by using the relocation information to set the REF field of all instructions whose IADDR is referenced by some operand. Hence, each instruction is treated separately and no assumptions regarding program structure need be made. The second problem arises since arbitrary machine code can appear. For example, it is possible to compute a jump address from non-relocatable operands without having the computed address named in the relocation information. The problem of identifying these situations is undecidable, since the expression that computes a referenced address may be arbitrarily complex and take arbitrary inputs. Consider the following pseudo-machine code: load add jump addr(X), regl 17, regl *regl In this scheme, the node containing X will have its REF field set since the load instruction has a relocatable reference to it. However, the node at X – 17 will not be marked as referenced, and could be erroneously subject to code elimination. Hence, I restrict the target of all (direct and indirect) control transfers to conform to the following definition: A branch address is simple if it is identical to the initial address of some operand or data area specified as relocatable by the relocation information. This requires that the compiler generate only simple branch addresses in order for the REF field of nodes to be accurate. 9 Note that the definition of a simple branch target does not rule out constructs such as: Jumping to an address which was extracted from an array. Such code is typically generated for the BASIC ONGOTO, Fortran Computed-GOTO, and C switch statements. Since each entry in the array referring to an address is specified as a relocatable data area, all possible targets of such high-level statements will be marked as referenced. Pointers to code and procedure parameters. Such code appears in C procedure pointers and Fortran ASSIGN statements. The pointer values are generally loaded from a data area, as above, or by some code such as load addr(X), reg in which case the first operand of the load will be marked as relocatable. Interrupts and service routines. Although these routines are called asynchronously in response to some event, their address appears somewhere in the task file. Typically, some interrupt vector or table needs to be initialized when the program begins. This is done either by installing the address of the routine in a table using executable code (the address would then appear as a relocatable operand of an instruction), passing the address of the routine to a system function (again, the parameter passing mechanism would contain the relocatable operand), or by initializing the table directly in the data segment (a relocatable data item would be in the data segment). Hence, I do not feel that the requirement for simple branch operands is a practical restriction on compilers for most high-level languages. In fact, the MCO has been used with production compilers for full ANSI COBOL ([Phil 85co]), FORTRAN 77 ([Phil 85ft]), C ([Phil 85c]), and two versions of BASIC ([Phil 84cb], [Phil 84mb]). None of the code generators or any of the library code for the language primitives had to be modified to accommodate this restriction. 3.2. Current Code Elimination Techniques I define several methods for performing code elimination, with increasing degrees of effectiveness: Unlabeled code elimination removes code which follows an unconditional branch and is not labeled. This can be done using a single forward pass over the code. Unreferenced code elimination eliminates code following an unconditional branch which is either unlabeled or is prefaced with a label which is not referred to. After reference counts are tabulated on labels, unreferenced code is Goss Machine Code Optimization 10 eliminated by a series of converging forward passes over the code. consistency. When a candidate for unreferenced code elimination is detected, we perform the following algorithm: Unreachable code elimination eliminates code to which there is no flow path from the entry point of the program. It is capable of eliminating, for example, mutually recursive subprograms whereas unlabeled and unreferenced code elimination are not. Typically, this technique is implemented by building a flow graph for the program and removing disconnected subgraphs which do not contain the entry point. 1. Let SUB1 be an unreferenced instruction following an unconditional branch, return, etc. Let LOOP be the first referenced instruction following SUB1 and let SUB2 be the first instruction with its JSR field set at or after LOOP. Perform basic unreferenced code elimination and remove SUB1~LOOP. 3.3. Subprogram Elimination For purposes of the MCO, unlabeled code elimination is not effective since every instruction is potentially labeled. Unreachable code elimination, although the most aggressive technique, is also not applicable. In the presence of an indirect jump through a quantity in a register, the MCO would need to trace all possible values in the register to determine the possible successors to a flow graph node. Failing this, all nodes would need to be labeled as successors, rendering the entire flow graph connected. Such jumps often arise when generating code for high level constructs such as C switch statements and COBOL perform statements, so this technique would yield poor results. Due to the presence of reliable reference counts, unreferenced code elimination is most suitable for the MCO. However, it fails to fully eliminate a subprogram that has a loop in it. Consider the following code: return SUB1: instr instr LOOP: instr instr jump LOOP instr return SUB2: instr where SUB1 is an unreferenced instruction, LOOP is referenced due to the loop, and SUB2 is the beginning of the next subprogram which is referenced. Basic unreferenced code elimination removes code from SUB1 up to, but not including, LOOP (denoted SUB1~LOOP). However, LOOP up to SUB2 (LOOP~SUB2) is not eliminated since LOOP is referenced. In order to eliminate such routines, I implement an augmented version of unreferenced code elimination called subprogram elimination. This eliminates likely sections of code on a trial basis and checks the resulting program for 2. Decrement the reference count of any instruction which is the target of an operand of an instruction in LOOP~SUB2. 3. Scan LOOP~SUB2 and determine if any instructions are still referenced. 4. If no instructions in LOOP~SUB2 are referenced, then any instructions in LOOP~SUB2 which were referenced before step 2 were the target of operands within LOOP~SUB2. The instructions in LOOP~SUB2 can he eliminated and further code elimination continue at SUB2. 5. Otherwise, some operand outside the range LOOP~SUB2 has the referenced instruction found in Step 3 as a target. The instructions in LOOP~SUB2 cannot be eliminated and we must repair the damage done to the reference counts in Step 2. Further code elimination proceeds from the jump to LOOP. Whenever an instruction is removed during the subprogram elimination algorithm, we decrement the reference count of any targets of operands of the instruction. (This is handled differently in steps 2, 4, and 5 above, but the net effect is the same). If the resulting reference count goes to zero and the target is not currently being eliminated (precedes LOOP in the above algorithm), another opportunity for code elimination has occurred. However, since subprogram elimination works by forward passes only, this opportunity will not be caught on this forward pass. Hence, we repeat subprogram elimination until no such situations arise. 4. Code Distribution The code distribution phase of the MCO re-orders sections of a program to improve the effectiveness of operand reduction. I divide the task of re-ordering a program into two problems: Goss Machine Code Optimization Problem 4.1 (Data Distribution) Partition the data segment into independent data objects, each of which can be moved without regard for the load location of other independent data objects. Then reallocate these objects in slots in the code segment which are not on an execution path (e.g. following a return or unconditional branch) in order to place them closer to operands which reference them. ¤ Problem 4.2 (Code Distribution) Re-order the code blocks created during text blocking to reduce the distance between inter-block branches and their targets. ¤ This division corresponds to improving the effectiveness of operand reduction as it deals with two distinct types of operands; those which reference targets in the data segment and those which reference other code blocks. In this chapter, I examine both these problems as implemented in [Rober 79] and the MCO, respectively. 4.1. Data Distribution Given the class of code improvements to which the MCO is addressed (those which can only be done at or after the link phase), an algorithm for data distribution would be appropriate in the MCO. However, a number of problems prevent it from being implemented in this application. The first problem is the lack of a reliable way of partitioning the data segment into independent data objects, which preserves the semantics of the input program. The input data segment is seen as a single block of data. No information is provided regarding what areas of the data segment must remain in a fixed position relative to other areas. For example, it is unclear where one array ends and another begins. To obtain a complete partitioning, information as to the layout of the data segment would have to be provided by the compiler for each module in the task file. This is feasible, but is outside the current design of the MCO. The second problem with data distribution concerns the ramifications of placing modifiable program data in the same area in memory as program code or constant data. All code currently generated by the compilers with which the MCO operates is reentrant, thus allowing the text segment to be shared in a multi-task environment. Data distribution renders the code non-reentrant since data would be interleaved in the text segment. Thus it could not be used where text is shared or on a system where the text segment is protected by hardware support. 11 Another problem with data distribution concerns the expectation, on the part of the programmer, that the data segment will be laid out in the order that static data is declared in the source code. Although the layout of static data is usually unspecified in language standards, compilers have had no reason to allocate data in other than the input order. As a result, the folklore for certain languages dictates that certain programming constructs which rely on the order of static data are acceptable. For example, a well-known technique in FORTRAN for building a zero-based array of integers is to declare as follows: INTEGER INTEGER DUMMY A(99) where DUMMY becomes an alias for A(0). Although illegal, this usage is not detectable in general, not flagged as an error even in specific cases where it is detectable (e.g. constant subscript), and actually works on all FORTRAN compilers known to the author (FTN [Contr 75], FORTRAN System/370 [IBM 74], Philon FAST/FORTRAN [Phil 85ft]). Finally, there are the issues of actually performing data distribution in reasonable time and space. The problem of data distribution was first examined in [Rober 79] from a theoretical viewpoint. He showed that the problem of finding an optimal solution to Problem 4.1 is NP-Complete [Garey 79]. Furthermore, the problem of finding a solution which is within a (non-trivial) constant factor of the optimal solution is also NP-Complete. Thus, the best we could hope for is a well-tuned heuristic which places variables well. In the UNIX environment, where data resides at the end of the text segment, even a simple heuristic could improve the code substantially. For example, one might go through the independent data objects in order, placing each in the slot which maximizes the number of references to it which can be made short at the time. In the absence of the problems already mentioned (e.g. on a single-user dedicated machine with no memory protection), such a heuristic might be worthwhile. 4.2. Complexity of Code Distribution The problem of code distribution as stated at the beginning of this Chapter is characterized in graph theoretic terms as follows: A directed graph G = (V, E) consists of a finite set V of vertices and a finite collection of edges, E: V × V, where each edge connects a pair of distinct vertices in V. The collection of edges of a graph may have duplicates (parallel edges) but the set of vertices may not. Edges are denoted μ→ν where Goss Machine Code Optimization μ,ν ∈ V. If μ→ν ∈ E then vertex μ is adjacent to ν. The set of all vertices adjacent to vertex ν is denoted adj(ν). A weighted graph W = (V, E, Wv, We) is a directed graph with functions Wv: V → (N = {0, 1, …}) and We: E → N × N × N × N. In characterizing code distribution, we map the code blocks of the text segment onto the vertices of a weighted graph and use the edges to represent the inter-block references. 12 span(μ→ν) = endpoints(μ→ν) + interposed(μ→ν) endpoints(μ→ν) = if ψ(μ) < ψ(ν) then We(μ→ν)(2) + We(μ→ν)(3) else We(μ→ν)(1) + We(μ→ν)(4) We allow parallel edges since a block may reference another block many times, but we allow no self-loops (edges must connect distinct vertices) since intra-block references are not considered. The weight function on vertices, Wv, gives the size, in bytes, of the code block as read in from the text segment. The weight function on edges is formulated from the position of the source and destination of the inter-block reference within their respective blocks. In Figure 4.1, the source of the reference is offset s bytes in code block α and the target is at position t in code block γ. Thus, We(α→γ) = (s, s′, t, t′). The span of an inter-block reference must account for the location of the source and destination of the reference in their respective blocks (the endpoints() function) as well as the size of all intervening blocks in the ordering of code blocks (the interposed() function). Given a weighted graph W = (V, E, Wv, We), a permutation ψ: V↔{1, 2, …, |V|}, and a threshold T, we define the threshold cost function: TCF(W, ψ, T) = |μ→ν ∈ E : span(μ→ν) ≥ T| The problem of code distribution is analogous to the problem MINLTA: Problem 4.3 (MINLTA - Minimum Linear Threshold Arrangement) Given a weighted graph W = (V, E, Wv, We), we wish to find a permutation ψ: V↔{1, 2, …, |V|} which orders the vertices such that the threshold cost function, TCF(W, ψ, T), for a given threshold T, is minimized. ¤ MINLTA relates to code distribution as follows: We wish to order the code blocks in the text segment to minimize the number of inter-block references whose span exceeds a certain threshold T. For example, in Figure 4.2, if blocks α and γ are ordered with block β between them, then the span of α→γ is the sum of s′, r, and t. In MINLTA, the s′ and t are incorporated in endpoints(α→γ) while r is represented in interposed(α→γ). Figure 4.1. Inter-block Reference The goal of code distribution is to find a permutation of the vertices, ψ: V↔{1, 2, …, |V|}, which keeps the number of edges requiring a long addressing mode to a minimum. Given a permutation, ψ, for each edge μ→ν, we define: I now show that the decision version of MINLTA is NPComplete [Garey 79] by 1. showing that the problem can be solved nondeterministically in polynomial time and 2. by polynomially reducing instances of a related problem, MINLA, to instances of MINLTA such that MINLTA yields the same answer as MINLA would have. Goss Machine Code Optimization 13 This cost function is identical to the span(μ→ν) function given for MINLTA with Wv(ν) = 1 and We(μ→ν) = (0, 0, 0, 0) for all vertices and edges, respectively. ¤ A simpler version of Problem 4.5, in which the graph was undirected, was shown to be NP-Complete in [Even 75] and [Even 79] by a two-stage reduction from the maximum cut set problem on graphs. Theorem 4.1 The decision version of MINLTA is NP-Complete. Proof: First, we assert that MINLTA can be solved nondeterministically in polynomial time. This is done by nondeterministically choosing the appropriate permutation, Π, from the O(|V|!) permutations of the vertices and evaluating TCF(W, Π, T). Next, we reduce instances of MINLA to instances of MINLTA: Given an instance of MINLA consisting of G = (V′, E′) and an integer k, we define an instance of Problem 4.4 as follows: The vertices V of W are the same as those of V′ of G. For each edge e ∈ E', E contains a bundle of |V|–1 edges e1, e2, …, e|V|–1. The weight of an edge We(ei) = (i, i, i, i). The weight of all vertices Wv(v) = 2 (see Figure 4.3). Figure 4.2. Computing the Span of a Reference Problem 4.4 (Decision Version of MINLTA) Given a weighted graph W = (V, E, Wv, We), a threshold T, and an integer k, is there a permutation ψ: V↔1, 2, …, |V| which orders the vertices such that TCF(W, ψ, T) ≤ k. ¤ Problem 4.5 (MINLA - Minimum Linear Arrangement) Given a directed graph G = (V, E) and a positive integer k, is there a permutation ψ: V↔1, 2, …, |V| which orders the vertices such that the additive cost function, ACF(G, ψ) ≤ k, where: Figure 4.3. Mapping MINLA onto MINLTA Goss Machine Code Optimization I propose that any ordering function, p, on V will yield the same value for TCF(W, Π, 2|V|-2) under MINLTA as ACF(G, Π) under MINLA. Case 1 Consider two vertices, α and β, which are placed sequentially by Π. Under MINLA, an edge α→β between them contributes one to ACF(G, Π). Under MINLTA, exactly one of the edges between α and β from among those generated from α→β yields a span ≥ 2|V|-2 (the edge with weight (|V|–1, |V|–1, |V|–1, |V|–1)) so one is added to TCF(W, Π, 2|V|–2). The basic approach is to build a tuple of code blocks starting at the end nearest the data segment. At each step, we choose the best block from among those yet to be placed, according to a heuristic which evaluates unplaced blocks. This block is added to the start of the tuple. This basic scheme is summarized in the algorithm: proc basic_code_distribution(); unplaced := {set of blocks}; set_of_spans := {spans for addressing modes of this architecture}; placed : = []; Case 2 Under MINLA, if there are n vertices interposed between the endpoints of α→β, then the edge α→β adds n–1 to ACF(G, Π). Likewise, under MINLTA, exactly n–1 edges from the bundle of edges generated from α→β would be included in TCF(W, Π, 2|V|–2). Those are the edges with weights (|V|– n–1, |V|–n–1, |V|–n–1, |V|–n–1) through (|V|–1, |V|–1, |V|–1, |V|–1). Hence, an ordering, Π, of V′ yields ACF(G, Π) ≤ k if and only if that ordering of V yields TCF(W, Π, 2|V|–2) ≤ k. while unplaced ≠ {} do bestworth := -1; (∀ bl ∈ unplaced) w := 0; (∀ span ∈ set_of_spans) w -:= worth(bl, unplaced, placed, span); end ∀; if w > bestworth then bestworth := w; bestbl := bl; end if; end ∀; Q.E.D. In the light of these results and the expectation that the number of code blocks in a text segment is on the order of the number of subprograms, an algorithm for code distribution which yields an optimal solution is not likely to run in polynomial or reasonable time on a deterministic processor. However, it should be noted that there are some differences between MINLTA and the problem of code distribution: Since current architectures often have location-relative modes using byte, word, and long offsets, the real-world code distribution problem could be required to deal with several thresholds rather than just one. In code distribution, the size of a code block is not fixed, but depends on the placement function itself. MINLTA simplifies this by assigning a span value for an edge which is determined solely from the initial conditions of the problem, while the operand reduction algorithm must be applied for each placement function to determine the span of an edge. In MINLTA, we allow the weights on edges to be arbitrary positive numbers, while in practice they would be limited to the weights of their corresponding vertices. It is not known whether this more restrictive version of MINLTA is NPComplete. 4.3. Heuristics for Code Distribution Since the possibilities for an efficient optimal algorithm for code distribution are dim, the MCO applies a heuristic to order the code blocks. 14 placed := [bl] + placed; unplaced less:= bl; end while; end proc; Of course, the effectiveness of this algorithm depends on the worth(bl, unplaced, placed, span) function. The MCO currently uses two heuristic functions in combination: σ0 This function evaluates references in bl to the data segment. The following multiplicative factors constitute σ0: σ01 The number of references in bl to the data segment. σ02 The fraction of the data segment that the average reference (i.e. one at the center of bl) would reach under the given span if bl were placed at the head of the placed list. σ03 The number of bytes saved by installing the addressing mode associated with span over the addressing mode with no span restrictions. σ04 The inverse of the size of bl (larger blocks are penalized). This may be thought of in combination Goss Machine Code Optimization with σ01 to produce a single factor which denotes the density of data references per byte of code. σ1 This function evaluates references between bl and blocks already placed in the list. The following factors constitute σ1: σ11 The number of code references in bl which would reach their targets under the given span in the placed list if bl were placed at the head of the list. σ12 The number of code references in the list which would reach the average target in bl under the given span. These functions are designed to choose heuristically what would seem to be the best block from among the remaining unplaced blocks when running the inner loop of basic_code_distribution(). The σ0 function accounts for expected gains from operand reduction due to references to data. Likewise, σ1, predicts gains from references to the code already in the list. Within each of these functions, σ01, through σ04, and σ11 and σ12 can be balanced to give the best results. These functions are implemented efficiently by attaching the following information to each block node, bl: REF 15 $ now out of range. update_ties(bl, placed); w := 0; (∀ span ∈ set_of_spans) w -:= worth(bl, unplaced, placed, span, plsize); end ∀; if w > bestworth then bestworth := w; bestbl := bl; end if; end ∀; placed := [bl] + placed; plsize +:= size(bl); unplaced less:= bl; end while; end proc; The MCO allows any combination of σ0 and σ1, to be used during a run. The relative effectiveness of these heuristics is reported in Chapter 6. 5. Operand Reduction For each span, the number of references to text nodes in bl from blocks in the placed list which reach bl under the span. RELOC The number of relocatable operands in text nodes in bl which reach nodes in block in the placed list under each span. DRELOC The number of relocatable operands in text nodes in bl which reach nodes in the data segment. These fields are maintained by the following expanded algorithm: proc code_distribution(); unplaced := (set of blocks}; $ Set the DRELOC field of each block. set_dreloc(unplaced); placed := []; plsize := 0; while unplaced ≠ {} do bestworth := -1; (∀ bl ∈ unplaced) $ Modify REF and RELOC to account for $ the most recent $ block added to the list and $ references which are As described in Section §2.7, operand reduction installs, in each operand, the least expensive addressing mode which satisfies all constraints imposed by the architecture. This Chapter begins by describing the data structures which represent the attributes of the target architecture needed for operand reduction. This is followed by a discussion and analysis of the algorithms which implement the two phases of operand reduction. 5.1. Static Data Structures At the heart of the MINIMIZE and LENGTHEN phases, the following problem arises: Problem 5.1. (Build Translation Class) Given an instruction, i, and an operand of that instruction, op, form the set of (opcode, addressing mode) pairs which can be used in place of the existing opcode of i and addressing mode of op (OPC(i), MODE(op)). This set is called the TRANSLATE_CLASS(i, op). ¤ The remainder of this section describes how the TRANSLATE_CLASS is built. First I describe what types of restrictions the target architecture places on membership in this set. Then I give a set-theoretic description of how the TRANSLATE_CLASS set is formed. Finally, I discuss a space and speed efficient implementation of the set formers. Goss Machine Code Optimization The set-formers and algorithms in this Chapter are presented in the set-theoretic language SETL ([Dewar 79b]) to elucidate the concepts involved. Lower level versions, coded in C ([Kern 78]), may be found in Appendices B and C. 16 For the given instruction and operand of that instruction, this is the set of addressing restrictions of the machine for that instruction and operand and the semantic restrictions imposed by the existing addressing mode. For an opcode/addressing mode pair (opc, am) to belong to the set TRANSLATE_CLASS(i, op), it must satisfy the following restrictions: Addressing Restrictions: Under the rules of the target architecture, am must be a legal addressing mode for an operand of opcode opc in operand position OPNUM(op). Furthermore, the new opcode must accept the same number of operands as the existing opcode and, for each operand, op′, of i other than the operand being considered. MODE(op′) must also be legal for the new opcode in that operand position. Semantic Restrictions: Each addressing mode on the given architecture performs a function such as yielding a value of some type or operating on a register. The function of am must be equivalent to that of MODE(op). Likewise, the function of the new opcode, opc, must be equivalent to the existing opcode, OPC(i). Span Restrictions: If am is a location-relative mode, then the effective address which op yields must be within the span of am. To form a TRANSLATE_CLASS which complies with the addressing and semantic restrictions, we begin with the following sets defined across all opcodes, opc, and addressing modes, am: ADDRESSING_CLASS(opc, opnum) For each operand position, opnum, corresponding to an operand of opc, the set of addressing modes which are legal on the target architecture. This is the set of opcodes which are equivalent to the current opcode and which allow at least one addressing mode in the OPERAND_TRANSLATE_CLASS() for the given opcode. Also, the current addressing mode in operands we are not scrutinizing must be allowed in the operand position of each opcode in this set. Finally, we combine the intermediate sets to form the TRANSLATE_CLASS() as defined above, satisfying addressing and semantic restrictions, but not span restrictions. In practice, we do not form the OPERAND_TRANSLATE_CLASS and OPCODE_TRANSLATE_CLASS sets, but construct TRANSLATE_CLASS directly. The following algorithm presents a high level view of how FORM_TC is implemented: OPERAND_EQUIV_CLASS(am) The set of addressing modes which perform an equivalent function to am. OPCODE_EQUIV_CLASS(opc) The set of opcodes which perform an operation which is equivalent to opc. For a given instruction, i, and operand, op, the TRANSLATE_CLASS(i, op) is formed, as needed, by the following set constructors: proc FORM_TC(i, op) TRANSLATE.CLASS := {}; (∀ opc ∈ OPCODE_EQUIV_CLASS(OPC(i))) if opc ≠ OPC(i) then $ Check that the operands of opc other $ than op accept the current $ addressing modes in i. (∀ opnum ∈ [l..NOPER(opc)] | opnum ≠ OPNUM(op)) if MODE(opnum) ∉ ADDRESSING_CLASS(opc, opnum) then continue opc; end if; end ∀; Goss Machine Code Optimization end if; (∀ am ∈ ADDRESSING_CLASS(opc, OPNU.VI(op))) $ Check that this new mode is $ semantically equivalent to the $ existing mode. if am ∈ OPERAND_EQUIV_CLASS(MODE(op)) then TRANSLATE_CLASS with:= [opc, am]; end if; end ∀; end ∀; end proc; I now represent the data structures and algorithms for FORM_TC in a lower level implementation. The data structures were designed to conserve space and be accessible with reasonable speed. The version of FORM_TC as coded in C is presented in Appendix C. In order to represent the ADDRESSING_CLASS, OPERAND_EQUIV_CLASS, and OPCODE_EQUIV_CLASS sets, a set of static data structures are built for the given architecture. The static data structures consist of a pair of tables, one for addressing modes and one for opcodes, and various arrays as described below. First, we examine the addressing mode table. This is an array of addressing mode descriptors, one for each distinct addressing mode on the target architecture. Two addressing modes in two different instructions are considered distinct if they are represented differently in the two instructions or are not semantically equivalent. In particular, modes which are represented using different bit patterns or the same pattern in different locations in instructions must be distinct. Consider the Data Register Direct addressing mode on the 68000 mov instruction. As a source operand, this mode is the same for mov as for the first operand of a cmp instruction. However, a distinct addressing mode must be used for a destination operand of mov which uses Data Register Direct since the location of the bits to specify the mode and register are in a different location in the instruction. Each addressing mode descriptor contains the following fields which are relevant to this discussion: SIZE, SPEED Values used to evaluate the cost of using an addressing mode. These are relative values used for purposes of evaluating cost functions and are related to the clock cycles and size in bytes above a basic opcode for the use of the addressing mode. 17 OEC Pointer to an array of nodes, each containing the code of an addressing mode in the same OPERAND_EQUIV_CLASS of this mode. All modes in the same OEC have the same effect on the relevant aspects of the machine state when evaluated. SPAN_OK A pointer to a predicate which determines, given an instruction and an operand of the instruction, whether the addressing mode would satisfy span restrictions if installed. INSTALL A pointer to a routine to install the addressing mode in a given instruction and operand. This routine is invoked during code relocation. The opcode table contains a single opcode descriptor for each distinct opcode on the target architecture. As with addressing modes, a single operator is sometimes broken down into several opcodes for purposes of operand reduction even though the bit patterns of the instructions may be identical. This occurs in multi-operand operators since the addressing mode in the ADDRESSING_CLASS(opc, opnum) must all be valid regardless of addressing modes employed in other operands. Operators such as the 68000 sub instruction must be broken down into two opcodes: a sub_d opcode which allows a large class (source class) of addressing modes as a first operand and a data register for a second operand and a sub_m opcode whose first operand is a data register and whose second operand can be represented using another set of addressing modes (memory alterable class). To implement these using a single opcode would imply that the sub instruction allows any source class mode and any memory alterable mode in its two operands, which is not the case. An opcode descriptor contains the following relevant fields: NOPER Number of operands accepted by this instruction. SPEED Used in evaluating opcode/addressing mode pairs. This is the speed relative to other instructions in the operand equivalence class. OPEC An opcode which is in the same OPCODE_EQUIV_CLASS as this opcode. The OPEC fields of all opcodes in a nonsingleton OPCODE_EQUIV_CLASS set form a circular linked list using this field. Goss Machine Code Optimization CLASS An array of pointers, one for each operand of the opcode. Each pointer names an array of nodes containing the codes of addressing modes in the ADDRESSING_CLASS of this opcode and operand. The structure of these tables is summarized in Figure 5.1. I show an example of the static data structures of two instructions on the Motorola 68000: jmp and bra. These instructions are semantically equivalent, so their OPEC fields form a ring. However, the sets of addressing modes allowed for their respective operands are disjoint. Each of the addressing modes is described by an addressing mode descriptor. Finally, the semantic meanings of addressing modes are related in the operand equivalence classes. Through this data structure, a jmp using the absolute long addressing mode can be converted to a bra using the disp8 mode. 5.2. Minimize and Lengthen The purpose of operand reduction is to find an optimal solution to the following problem: Problem 5.2. (Operand Reduction) Install the least expensive addressing mode in each operand of each instruction so that all addressing, semantic, and span 18 restrictions are satisfied.¤ In the last section, I presented a general algorithm to find all opcode/addressing mode substitutes for a given instruction and operand that satisfy addressing and semantic constraints. The remaining problem of operand reduction is to satisfy span constraints. This problem is examined in [Rich 71] and [Fried 76]. In [Szym 78], two algorithms are presented which produce optimal solutions. I will briefly describe the requirements and complexity of each before presenting my solution. The first, which I call Algorithm Sz1, builds a graph to represent the program. Each operand of each instruction which can employ a location-relative mode is represented by a node in the graph.3 A directed arc A→B is installed if the instruction for B lies between A and a target which references an operand of A in the program. In each node, information similar to our own text node is maintained. In addition, for each operand, the distance from the instruction to the target of the operand (the operand's range) is maintained. All operands represented by nodes are initially assigned a minimum length location-relative addressing mode. We then process nodes in the graph whose range exceeds the span of the current addressing mode. A longer addressing mode with a larger span is then installed and all predecessors of such nodes in the graph (i.e. nodes whose range depends on the size of the expanded instruction) have their ranges increased to accommodate the longer addressing mode. The node may then be removed from the graph if a maximum-length addressing mode has been installed. The algorithm terminates when no more nodes need to be expanded. Algorithm Sz1 produces an optimal assignment of addressing modes using a graph with O(n) nodes and O(n2) arcs. [Szym 78] claims that the running time, with suitable low-level data structures, is at worst O(n) since each node must be visited at most once for each addressing mode. In practice. Algorithm Sz1 is useful for the application described in [Szym 78] jump or subprogram call operands on the Digital Equipment Corporation PDP-11 ([DEC 75]). Under this instruction set, a single location-relative addressing mode whose span is approximately ±256 bytes is available for such operands. This limits the out-degree of nodes in the dependency graph to 255 for contrived pathological cases. In practice, the average out-degree is 3.5 Figure 5.1. Static Data Structures for 68000 jmp and bra 3 Since Szymanski applied his technique to assembly language before it was assembled, he only considered operands of branch and subprogram call instructions. Goss Machine Code Optimization (across a large sample of application code) which allows Sz1 to operate rapidly in practical cases. However, each of the target architectures, in addition to the PDP-11 mode described above, has location-relative modes with spans of approximately ±32,767 bytes. This allows the out-degree of nodes to be at most 16,381 (assuming a minimum of two bytes per instruction) and an average of 896 in practice. These figures render Sz1 impractical for our use, especially since we wish to process not only branch operands, but all relocatable operands. Algorithm Sz2 is similar to Sz1, except that the arcs are not represented in the graph. Instead of adjusting the range of predecessors in the graph, whenever an operand is expanded, a brute-force scan of the instructions is made to find operands whose range need adjustment. This reduces the space requirements to O(n) but the running speed goes to O(n2). Again, since the maximum span of an addressing mode is ±254 bytes on the PDP-11, only a small area of code needs to be scanned when an operand is expanded. However, for this application, the re-scanning often requires a large portion of the program, thus rendering the running time quadratic in practice. My algorithm builds on Sz2 with the same worst-case space and time complexity, but runs in linear time in practice. Rather than maintaining the range of an operand, the range value is computed as necessary. This can be done since the TARGET field has been set for all such operands during operand linking. As with Sz1 and Sz2, the operand reduction algorithm begins with MINIMIZE, which performs a single pass over the code. For each instruction, i, and relocatable operand, op, we change the opcode and addressing mode to the pair from TRANSLATE_CLASS(i, op) which yields the shortest instruction: proc MINIMIZE() (∀ b ∈ BLOCK_LIST) if c < bestcost then bestcost := c; newpair := [opc, am]; end if; end ∀; if newpair ≠ [OPC(tx), MODE(op)] then contract(tx, op, newpair); end if; end ∀; end ∀; end ∀; end proc; After MINIMIZE, the LENGTHEN phase installs larger addressing mode in operands using a series of passes over the code. The first step in each pass is to set the FADDR field of each text and data node to reflect its current load location based on the sizes of all instructions before it. This is the field we will later use to determine the ranges for operands. We then process each relocatable operand of each text node. If a location-relative addressing mode, am, is currently in use, the range of the operand is computed using the FADDR field of the instruction and the FADDR field of the TARGET node of the operand. The predicate SPAN_OK(am) is then evaluated for the range to determine if the operand needs expansion. If so, we compute the TRANSLATE_CLASS(instruction, operand). From this we choose the least-cost opcode/addressing mode pair for which SPAN_OK(am), evaluated for the range, indicates that the new mode satisfies all span restrictions. This phase is summarized in the following algorithm: proc LENGTHEN() change := true; while (change) do change := false; $ Set FADDR fields of all nodes. tc := FOR.M_TC(tx, op); bestcost := MAXCOST; addr := IADDR(TEXT(BLOCK_LIST(l))(l)); (∀ b ∈ BLOCK_LIST) (∀ tx ∈ b) FADDR(tx) := addr; addr += NBYTES(tx); end ∀; end ∀; (∀ [opc, am] ∈ tc) $ Expand operands as necessary. (∀ tx ∈ TEXT(b) | tx is a text node) (∀ op ∈ OP(tx)) c := cost(tx, op, opc, am); 19 (∀ b ∈ BLOCK_LIST)) Goss Machine Code Optimization (∀ tx ∈ b | tx is a text node) $ Get all relocatable operands $ (ones with TARGET set) which $ might need expansion. (∀ op ∈ OP(tx) | TARGET(op) ≠ Ω and loc_relative(MODE(op))) range := FADDR(TARGET(op)) – FADDR(tx); if SPAN_OK(MODE(op))(range) then continue; end if; tc := FORM_TC(tx, op); bestcost := MAXCOST; (∀ [opc, am] ∈ tc) c := cost(tx, op, opc, am); if c < bestcost then bestcost := c; newpair := [opc, am]; end if ; end ∀; if [OPC(tx), MODE(op)] * newpair then expand(tx, op, newpair); ehange := true; end if; end ∀; end ∀; end ∀; end while; end proc; This algorithm performs well in practice since range values are changed only at the start of each pass and are done through the TARGET pointer rather than maintaining explicit range values in operand descriptors. The TARGET field generally requires O(n2) time to compute but, during operand linking, we compute these efficiently using the blocked dynamic data structure (see Section §2.3). Likewise, O(n) passes could be made through the code during LENGTHEN, giving an O(n2) worst case. In practice, the algorithm converges in 2–5 iterations (see Section §7.2). 5.3. Register Tracking The design of operand reduction, as described thus far, falls short in one major area: it utilizes index modes which use only the program counter, while many architectures allow indexing off other registers. For example, on the 20 Motorola 68000, even if a target is not within the span of a PC-indexed mode, if an address register points in the vicinity of the target, an address register-indexed mode is available which costs the same space and time as the PC-indexed mode. Hence, an improvement to the current operand reduction algorithm would be to provide a data structure which maintains the known values in all registers which can be indexed. In addition, known values in non-indexable registers may be useful since such registers can replace addressing modes which yield constant values. A number of approaches can be taken in handling this data structure: 1. Have the compiler set aside a single address register as a base register, thus mimicking segmented architectures such as the Intel 8086. This register could be initialized by the MCO to point to an advantageous location and references to all targets which fall within the span of this location could be improved. This is essentially the scheme taken in the Macintosh operating system ([Apple 85]) for the Macintosh 68000-based computer. However, on the Macintosh, all data references must be made using the base register; this limits global data to 32,767 bytes on this machine. 2. Allocate base registers on a less global level. Information as to which registers are unused over ranges in the code would have to be obtained. These could then be initialized and used as local base registers if there were sufficient references in the range which could index off the address register. 3. Information as to which registers have known values in ranges of the code could be obtained by techniques similar to constant propagation [Aho 77]. These registers could be used as base registers in the proper ranges without initialization. On architectures such as the Motorola MC68020 [Motor 84b] where a number of registers can be combined with scaling factors and constant offsets, registers could be used in linear combinations to produce the least expensive addressing mode. 6. Macro Compression Until this point, I have described optimizations and techniques that are employed in the MCO and that are, to varying degrees, successful toward the goals of optimizing task files and furthering this research. In this Chapter I reflect upon a class of techniques that are also consonant with this research but which did not yield satisfactory results in some Goss Machine Code Optimization 21 dimension of performance and were removed from the production version of the MCO. 6.1. Background Common code compression is a class of optimization techniques in which common sequences of code are identified by various analysis methods and removed by altering the code or providing information to a translator that is converting the code to a lower level. This class of techniques includes common subexpression elimination, available expression elimination, very busy expression hoisting, and code hoisting and sinking (see [Aho 86] for a general discussion of these). These techniques are generally more suitable to earlier phases of the compilation process than the link phase. Figure 6.1. Example Suffix Tree The technique of macro compression recognizes common code sequences and replaces each occurrence of the common code with a call to a code macro or subprogram containing the common code. This data structure allows us to find the subsequence beginning at any position and ending at $ by following the path of edges from the root to the leaf with the proper label. This space optimization was first used in [Dewar 79a] to conserve space in an interpretive byte stream. The language used an 8-bit opcode but only had 80 operators. The remaining 176 opcodes were used to represent frequently occurring byte sequences beginning on instruction boundaries. In practice, only multi-bytes instructions or part instructions were subject to macro compression, but the savings remained substantial. The theoretical aspects of this problem were studied in [Golum 80]. The assumptions were: 1. A byte stream was to be minimized; 2. A macro call consisted of a single byte; 3. Exactly m macros of length ≤ k were to be chosen. Optimal polynomial-time solutions were obtained which characterized potential macro choices within the byte sequence using an interval or overlap graph (depending on two slight variations of the problem). However, these algorithms were very costly in practice. 6.2. Assembly Code Compression A more recent approach [Fras 84] has been to apply pattern matching techniques to assembly code to identify repeated subsequences. A suffix tree ([McCr 76]) is built for the input code to be compressed. The suffix tree for a list of instructions, i, is a tree whose |i| leaf nodes are labeled with the locations in i and whose arcs are labeled with subsequences of i. For example, if a, b, and c are instructions and $ is the unique end marker, the instruction list abcab$ would have the tree shown in Figure 6.1. More importantly for macro compression, each non-leaf (internal) node represents a common subsequence: the text of the subsequence is found by following the edges from the root to the internal node and the number and location of the subsequences are represented by all leaves whose path to the root goes through the internal node. Once the suffix tree is built (in linear time — see [McCr 76]) the internal nodes of the suffix tree are evaluated for validity under the semantic rules of macro compression for the given assembly language and for payoff if they were replaced. Valid subsequences are ordered in a priority queue by some criterion and the items of the queue are processed in order, installing a code macro and calls to it at each step. An optimizer for assembly code was built by [Fras 84] and was reported to run efficiently and perform well. However, no statistics were given on the amount of compression achieved. 6.3. A First Attempt A preliminary optimizer for assembly language was built along these lines for the purpose of gathering statistics. As expected, the effectiveness of macro compression heavily depended on the size of the assembly code file. In assembly files generated from languages such as COBOL ([ANSI 74]), a good deal of compression was obtained since the entire user program is generated in a single assembly code file. However, for languages such as C where a high degree of modularity tends to be observed, almost no compression was obtained. Furthermore, code for language primitives, since they are relatively small and selectively linked modules, were never compressed. Goss Machine Code Optimization The next stage was to build an analyzer which maintained statistics on common sequences across assembly language files. If, for a given language and compiler, many common sequences appeared repeatedly across different programs, a database of those sequences could be made available to a peephole optimizer [McKee 65]. It would replace them in linear time [Knuth 77] and with small space overhead. A call to a macro body would be substituted on the expectation that the sequence would appear enough times in the various modules of the program to make substitution worthwhile, on the average. The macro bodies would then be selectively linked in from a large library of these subprograms. However, it was found that, while a single program may have many common subsequences within itself, the same sequences were, for the most part, not shared between programs. Table 6.1 gives a summary of common sequences in two test programs we will describe in detail in Chapter 7. These programs are called p1.68 and p2.68 when compiled for the 68000. A breakdown is given for various sized subsequences for p1.68, p2.68, and sequences which appeared in both. In each case, I report the number of common sequences as well as the average number of occurrences of each sequence in the programs. In the last column, I report the average occurrences in both programs combined. These figures show that even though the same compiler was used and the same code for language primitives was linked in, few sequences were common to both program in comparison to the program treated separately. This happens since many of the common sequences contain code which refers to program-specific global data or subprograms. Table 6.1 Tabulation of Common Sequences Size 50–60 40–48 30–38 20–28 18 16 14 12 10 8 6 Total p1.68 # occur 1 2 1 2 3 2 4 2.25 3 2.00 6 3.33 9 4.00 12 3.17 17 6.65 32 6.00 41 13.46 129 p2.68 # occur 2 2 2 2 2 2 4 3.25 4 7.00 4 2.75 7 5.71 13 6.07 13 7.30 48 7.96 61 16.84 160 p1.vx # occur 0 0 0 0 0 0 1 4.00 2 4.50 0 10 17.80 14 52.29 27 22 6.4. Macro Compression in the MCO The results of the assembly code macro compressor indicated that a macro compressor which operated on all the modules in a single program would compress the most macros. This, the macro compressor was recoded to operate on task files, and this became the first version of the MCO. It operated with essentially the same instruction parser and code relocation algorithm described earlier, but without any other optimizations described so far. There were a number of significant additions to the MCO implementation beyond that of [Fras 84]: 1. The user had the choice of two priorities when inserting sequences into the priority queue: they could be inserted in order of the number of bytes saved by the substitution of the sequence (assuming no overlap with earlier substitutions) or they could be inserted based on the number of bytes in the sequence (‘value’ priority versus ‘length’ priority). 2. The MCO was more aggressive in salvaging sequences which would have been discarded as invalid: if the sequence referenced the stack, the macro body was constructed so that the return location was not stored on the stack: if the sequence modified the stack in certain simple ways, similar transformations were applied to the macro body; If some code in the sequence would have caused the sequence to be discarded and that code appeared near the end of the sequence, it was shortened and reinserted into the priority queue. 3. Since [Fras 84] does not describe the data structures in detail, it is not clear how their suffix tree was represented internally. The MCO maintained the tree in virtual memory. The initial implementation had a pointer from each internal node to the first child and a pointer from each node to its sibling. This simple data structure was very compute intensive during the construction of the suffix tree (48:07 for p1.68) and a hash table was installed to represent the parent-child relation between the root node and the second level of the tree (reducing the time to 3:22 for p1.68). The statistics relating to this version of the MCO are reported in Tables 7.2 for the execution time of macro compression, 7.5 for the size improvement in the text segment, and 7.6 for the degradation in the target program's execution speed. From these results it was decided that macro compression was not desirable in the production version of the MCO because of the costs in the following areas: Goss Machine Code Optimization Compressor Speed The macro compressor required several times the compute resources of the other optimizations combined. The total speed of about 125 bytes/sec was very close to the speed of the [Fras 84] implementation, but we were dealing with the entire task file on each run of the optimizer. 23 run-time in these systems to produce object code, rather than a straightforward decoding. Hence, the translation was slow, required a very large ‘decoder’, and could not achieve a high level of object code optimization. To elaborate on these ideas, I describe the items in memory at execution time in more detail: Dynamic Memory Requirements G-Code The suffix tree nearly doubled the dynamic memory required by the MCO. The generative code is a representation of the text segment of the original program in which a series of transformations have been applied to translate original instruction and sequences of instructions into G-code instructions. The first set of transformations modifies certain types of instruction operands. In general, references to registers or registers with displacements are unaffected. However, references to instructions or data in the original code are converted to references to the corresponding instructions or data in the G-code. Execution Speed Degradation When running a program after macro compression, the task image is smaller, but the CPU must spend time executing the macro calls. On p1.68, the compressed program took 15% more CPU time than the original (with macro compression and operand reduction). In real time, the compressed file took 7% more time - probably due to the fact that the operating system treats smaller task files with a higher priority. This speed degradation is not as severe if the length priority is used rather than value priority (see Section §7.5). With value priority 913 calls to macros were installed whereas for length priority 821 calls to macros were installed. Thus, fewer macro calls are made and execution speed is not affected as much with length priority. In addition, value priority saved a total of 2,310 bytes while length priority saved 2,384 bytes. 6.5. G-Code and G-Compression G-compression takes the concept of macro compression to extremes. First, the text segment is converted into a very compact generative code or G-code. At execution time this is loaded into memory along with the data segment for the program, a decoder, and 68 an execution buffer. The decoder is responsible for re-constituting sections of G-code into their original native code and placing them in the execution buffer. Code is executed in the execution buffer until a new section of code needs to be re-constituted, at which time control returns to the decoder. If enough space is allocated for the execution buffer and a good allocation algorithm is used, the decoder will be called infrequently compared to execution of native code in the buffer. Even if the processor spends half its time in the decoder, this is substantially better than the 10 to 40 times speed degradation experienced in typical interpretive systems, with the potential for a greater savings of space. This approach is similar in concept to ‘throw-away compiling’. This technique compiles frequently interpreted sections of code at run-time ([Brown 76], [Brown 79], [Hans 74]). However, the task of code generation was employed at Each reference to an instruction in the original text segment (original text reference) is replaced by the bit address of the start of the corresponding (j-code instruction relative to the start of the sequence of G-code instructions (soft text reference). Thus the number of bits to represent a soft text reference depends on the size of the G-code. Each reference to a byte in the original data segment (original data reference) is replaced by the byte offset of the referenced data byte from the start of the data segment (soft data reference). The number of bits for a soft data reference depends on the size of the data segment. Any immediate operand which refers to the address of an instruction in the original text segment is replaced by the soft text address of the corresponding G-code instruction. An immediate operand which refers to an original data item is converted to a byte offset from the start of the data segment. In general, the set of operand addressing modes defined for native code and G-code differ in order to accommodate these transformations. Also, since there are no byte-boundary limitations imposed by the decoder, operands can occupy any number of bits and can even vary in size. Native code designs incorporating some of these features such as bitaligned instructions and variable sized operands have been developed in the Intel 432 architecture ([Tyner 81]) and the design of the Burroughs B1700 ([Wiln 72]). The second transformation applied to the original text segment is solely for the purpose of compressing the instruction sequence. The criteria are that it must be decodable starting at any instruction boundary and that the decoding must be done in real time (requiring no look-ahead) Goss Machine Code Optimization [Peter 61]. This can be accomplished by one or a combination of: 1. A straightforward Huffman encoding ([Knuth 73], p. 402) of the G-code. 2. A partial Huffman encoding in which the main instruction word is encoded but words which contain addresses and displacements are not affected. 3. A macro compression scheme in which common code sequences are collapsed into a macro table (which becomes part of the G-code) and replaced with short non-instructions from a Huffman encoding list. First, the priority queue is ordered by the number of times a sequence appears, rather than by the length or value of a sequence. Then all sequences which appear more than once are inserted into the queue. When processing the queue, sequences are replaced by bit encodings of increasing length. These encodings are assigned in the way that Huffman codes are built [Gall 78] so that minimum space is required. Data Segment This is identical to the data segment which would be 24 loaded with the original version of the program, except that it is not necessarily loaded at the same address. Pointers in the data segment to other data addresses are relocated based on the new base address for the data segment. Text addresses are translated to their corresponding soft address. Decoder and Execution Buffer The decoder is a fixed section of code which runs on the native hardware. Its job is to re-constitute G-code into machine code. It takes sections of G-code which needs to be executed and decodes them into a variable-sized execution buffer. The decoded native code is essentially the same as the original native code in the text segment. The differences are that addresses which refer to the data segment are adjusted to point to the new data segment and text addresses are converted back from soft addresses into the hard addresses of the decoded section, if the code at the target text address is already in the execution buffer. Otherwise, a branch to a nondecoded code section consists of a push of the soft address and a call back to the decoder. The decoder has the following entry points: MAIN: This is the entry point from outside the program. The first section of code is re-constituted, the user's stack, registers, and arguments are initialized, and the first section of code is called. TRANSFER: Branch to this entry point to re-constitute and execute code beginning at the soft address which is on top of the stack. All branches to TRANSFER which are preceded by a push of this soft address are then converted to a branch directly to the newly re-constituted native code. EXTEND: Append a new section of native code after the last executed block. Two items are on the stack: the soft address of the new code and the hard address to begin placing the hard-code. Accessed from unconditional branches in the original program code which are at the end of a re-constituted block, this is really a special case of TRANSFER which can optimize speed by eliminating unconditional branches. CALL: Same as TRANSFER, except that a subprogram call has been made. The contents of memory during program execution is summarized in Figure 6.2. Figure 6.2. Memory Organization for G-Compression Aside from a straight executable program, the G-code scheme can be used in ways more closely tied to the machine. For example, G-code might be the actual language of the machine, while the decoder resides in microcode itself. The macro bodies themselves would be read in when the program is loaded. The rudiments of such a scheme are employed in the VAX-11 architecture ([DEC 77]), which Goss Machine Code Optimization allows the microcode for certain instructions to he read in by the user during system initialization. 7. Measurement and Evaluation of Performance The current implementation of the MCO is written in C ([Kern 78]) and runs on a VAX-11/750 ([DEC 77]) under Berkeley UNIX Version 4.1c ([UNIX 80]). It optimizes task files containing 68000 and UNIX machine code generated from C source code compiled with the Philon FAST/C compilers [Phil 85c]. These files run under Uniplus-UNIX [Instr 81] on the 68000 and Berkeley UNIX on the VAX-11, respectively. This chapter reports on performance measurements taken on the MCO. Figures do not include measurements of macro compression, unless specifically noted. I give statistics in five areas: the running speed and size of the MCO, the space and speed improvements gained for each target machine, and the programmer time required to retarget from the 68000 to the VAX. 7.1. Test Input For purposes of the statistics in this chapter, two sample input files were used, compiled for the 68000 and the VAX. They are production versions of two passes of a compiler for a dialect of BASIC [Phil 84cb]. They are called p1.68 and p2.68 when compiled for the 68000 and p1.vx and p2.vx when compiled for the VAX. They are ideal for statistical purposes since they are production programs which execute a mix of computation and I/O bound code in a batch mode. Also, p1 contains most of its code within the 32,767 span limitation of these machines and p2 exceeds that limit by almost a factor of 2. The sizes of the text and data segments for the four task images are given in Table 7.1. Table 7.1 Sizes of the Test Programs Program p1.68 p2.68 p1.vx p2.vx Text bytes 33,684 57,482 29,296 47,104 Data bytes 12,664 11,054 13,800 11,496 7.2. Speed of the MCO First I report on the time required to run the various phases of the MCO on the sample input programs. Table 7.2 gives this information in terms of CPU time on a VAX11/750. This is a measure, by the operating system, of how much time the CPU spent executing instruction in that phase. In parenthesis, I/O time is given for phases which had significant I/O usage. These figures give the amount of time 25 that the operating spent performing I/O operations on behalf of that phase. Table 7.2 is clarified by the following points: 1. The task of parsing the instruction sequence is, by far, the most time-consuming aspect of the first phase. On the 68000, this is done by a large routine (28 pages of source code) to disassemble the byte sequence. For the VAX, parsing is done by a tiny routine which relies almost entirely on the static tables which describe the architecture. The interpretation of those tables greatly speeded development of the instruction parser for the VAX and did not slow the routine. The execution time of that phase for VAX input doubled because instructions on the VAX are parsed twice (see Section §2.2). 2. The I/O time required for operand linking is spent reading the relocation information from the input task file. 3. Most of the time spent in the MINIMIZE phase of operand reduction is in building and processing the translate class. The VAX, which has larger translate classes for instructions due to the more orthogonal Table 7.2 Execution time for the MCO on a VAX 11/750 Phase p1.68 Input & Instr 0:24 Parse (0:02) Text Blocking 0:00 Operand 0:11 Linking (0:17) Code 0:02 Elimination Code Distribution σ0 0:06 σ1 1:29 σ 0 + σ1 1:24 Minimize 0:12 Lengthen 0:21 Code 0:02 Relocation 0:12 Output (0:29) 2:48 Total (σ0 + σ1) (0:48) Macro Compression Build suffix 3:22 tree Build prio 0:15 queue Modify code 0:52 p2.68 0:46 (0:04) 0:01 0:20 (0:21) p1.vx 0:50 (0:02) 0:00 0:07 (0:03) p2.vx 1:30 (0:05) 0:01 0:13 (0:05) 0:05 0:01 0:02 0:10 3:01 3:07 0:19 0:39 0:05 1:04 1:07 0:37 0:35 0:08 2:03 2:16 0:54 0:42 0:03 0:02 0:03 0:16 (0:46) 5:36 (1:14) 0:08 (0:17) 3:27 (0:22) 0:10 (0:23) 5:51 (0:33) Goss Machine Code Optimization addressing mode structure, requires about three times longer in this phase. 4. Conversely, the LENGTHEN phase builds a translate class only if a span restriction is exceeded. Most of the time here is spent passing over the code until all span restrictions are satisfied. While this convergence could require many passes, in practice few passes are needed. These test cases required three passes for p1.68 and four passes for the others. No program run through the MCO during testing or production use has ever required more than 5 passes. 7.3. Space Requirements of the MCO The size of the MCO is reported in two aspects: the static space needed for program code and data and the dynamic space required for the dynamic data structures as a function of the input program size. 26 Table 7.4 Dynamic Space Required by the MCO Bytes for … Total mem required Size of task image Dynamic memory required Text in test prog Dynamic data per target byte 68.mco p1.68 p2.68 vx.mco p1.vx p2.vx 515,032 854,592 420,264 639,704 -50,656 -50,656 -56,864 -56,864 464,376 803,936 363,400 582,840 33,684 37,482 29,696 47,104 13.79 13.98 12.24 12.37 The following points should be noted in reference to these statistics: Table 7.3 lists the number of bytes used for the 68000 and VAX versions of the MCO. 1. The code elimination statistics are dependent on the way runtime libraries are structured on a given language and compiler can vary greatly. Table 7.3 Static Space Required by the MCO 2. As expected, code distribution is far more useful on programs whose text segment exceeds a span restriction imposed by the architecture. Size of … Text bytes Data bytes – tables Other data bytes Total static size 68.mco 34,816 4,832 10,992 50,656 vx.mco 31,744 15,496 9,608 56,864 Note that the text segment of the VAX version is smaller due to the table driven instruction parser described in the last section. This is reflected in the substantially larger space required to store the static data structures. Table 7.4 reports on the space required to represent all the dynamic data structures which are built. 3. The savings of about 1% for code distribution on files which exceed 32K bytes of text does not seem to justify the time required for this phase of the MCO (see Table 7.2). However, given that C code is typically written with heavy reliance on stack based data rather than static data, task images generated from other source languages would probably benefit more from this optimization. These figures represent the total number of bytes for dynamic data with no effort to free this space. For example, these figures reflect no space savings for free space as a result of code elimination. These figures show that the MCO requires 12-14 times as much memory as the text segment of the input program. Of course, the MCO could be modified to maintain these structures on secondary storage. 7.5. Effect on Program Speed To test the speed of the original and optimized version of the test programs, they were run on their target machines and timed. The VAX target machine was a VAX-11/750 and the 68000 was a Pixel 100/AP [Instr 81] with a 10 MHz CPU. Since the input code was the first two passes of a BASIC compiler, each was run on the same 123 line, 3,988 character source file. 7.4. Effect on Program Space This section presents statistics on the reduction in the size of the text segment for the input programs. Table 7.6 reports the CPU time statistics returned by UNIX as described earlier. The I/O time was affected more by system load than by any optimization performed, and is not reported in this table. Table 7.5 gives the number of bytes saved by each phase of the MCO. For code elimination, I give the savings with unlabeled elimination and the additional savings with subprogram elimination. The basic thing to note about these figures is that the improvement on the 68000 version was much greater than the VAX. I conjecture that, due to an instruction buffer maintained by the VAX instruction decoder, the processing of semantically equivalent memory references is not done Goss Machine Code Optimization 27 Table 7.5 Effect of MCO on Size of Text Segment Phase p1.68 p2.68 p1.vx p2.vx Initial text bytes 33,684 57,482 29,696 47,104 Unlabeled Elimination 2,458 -7.3% 4,900 -8.5% 2,639 -8.9% 5,154 -10.9% Added Subprogram Elimination 682 -2.0% 596 -1.0% 799 -2.7% 931 -2.0% Code Distribution σ0 + σ1 104 -0.3% 652 -1.1% 46 -0.2% 486 -1.0% σ0 -58 428 -36 374 σ1 24 470 43 383 Operand Reduction 2,624 -7.8% 3,476 -6.1% 3,632 -12.2% 4,207 -8.9% Total (σ0 + σ1) 5,868 9,624 7,116 10,778 Text segment reduced 17.4% 16.7% 24.0% 22.9% Macro Compression 2,310 -6.9% Table 7.6 Effect of the MCO on Program Speed Program run Original program MCO with no code distr MCO with σ0 + σ1 Macro Compression p1.68 6.73 6.41 4.8% 6.32 6.1% 7.73 (neg. 14.9%) faster for shorter operands. This is supported in the survey of VAX instruction timings reported in [Shiel 84]. 8. Conclusions It is my thesis that a class of optimization techniques, which can be performed only at the machine code level, is effective toward the goals of program optimization. Furthermore, these techniques can be implemented in a straightforward manner and in a reasonably machineindependent fashion. I begin by reviewing the implementation and theoretical work done on the MCO, describing other proposed ideas for optimizations at this level, and suggest areas for future research. 8.1. Review of Work Done The core of this work has been to define a class of inefficiencies which exist on certain architectures and environments and build an optimizer, the MCO, to remove these inefficiencies. The inefficiencies relate mainly to programs which consist of many modules and which are linked using a linker which cannot resolve inter-module references efficiently. Generally, when a single module is compiled, the most general and most costly addressing mode must be used for inter-module references since no information as to the relative or absolute location of the target is available. Hence, I deal with inefficiencies which can only be removed during or after the link phase of compilation. p2.68 p1.vx p2.vx 2.85 6.08 2.62 2.46 13.7% 5.95 2.1% 2.55 2.7% 2.48 13.0% 5.92 2.6% 2.50 4.6% A basic inefficiency is the presence of unreferenced subprograms in the task file. I review existing techniques for eliminating such code and develop and implement an augmented version of one of them, called subprogram elimination. Another inefficiency concerns the order in which code and data appear in a task file. I review the problem of data distribution, which places data objects throughout the code segment of the program and cite earlier work which shows the problem to be NPComplete. I also review the problem of code distribution, which shuffles the subprograms of the code segment to reduce the distance between operands and their targets in the code segment. I show this problem to be NP-Complete also. I then implement efficient heuristics for code distribution which improve the ordering of subprograms in the code segment. I then approach the problem of installing addressing modes in operands of instructions which take advantage of the proximity of targets. I develop an algorithm, called operand reduction, for installing the minimum sized addressing mode for any given operand. This algorithm is largely machine-independent; it relies almost entirely on a set of data structures which describe the machine architecture. I then discuss a technique, macro compression, which reduces the storage requirements of a program, but which carries an associated speed penalty. I describe earlier work Goss Machine Code Optimization and report on the results of a trial implementation of macro compression. A more aggressive technique, called Gcompression, which carries a larger speed penalty but offers the possibility of much greater code compaction, is also described, although no attempt at implementation was made. Finally, statistics are reported on the performance of the MCO and its effect on target programs. The results indicate that the MCO yields a substantial space improvement and smaller speed improvements. I conclude that the techniques applied by the MCO attain many of the performance advantages of segmented architectures on linear address space machines without imposing restrictions on addressing. 8.2. Proposals for Further Investigation In the light of the effectiveness of the current MCO, a number of areas deserve further investigation: 1. Investigate improved algorithms and heuristics for code distribution. subprogram if no call to that subprogram needs that register as live. 2. If a constant operand is used often enough, space can be saved on some architectures by building local tables of these constants which can be accessed by some span-dependent addressing mode. However, this degrades execution speed on many architectures. 3. Subprograms which are called once can be moved inline. Local repair and optimization can then be done at the entry and exit points to save stack manipulation. Appendix A. Definition of Text and Block Node Fields This Appendix provides a description of the fields in text nodes and block nodes and their contents. For each instruction, the text node contains the following fields: OPC 2. Implement some version of register tracking as described in Section §5.3. Also, the performance improvement from adding register tracking to operand reduction should be measured. 3. Implement a G-code scheme, as described in Section §6.5, to determine the space savings and speed degradation involved. This scheme could be useful in applications where interpreters are currently used to deal with severe memory restrictions. 4. Investigate algorithms for improved recognition of common subsequences. These algorithms could relax the definition of ‘common subsequence’ to allow instructions which are out of order, renaming of registers, etc. 5. Investigate a macro compression scheme which would allow code macros to take parameters. This could be used to allow non-conforming subsequences to be replaced by macro calls by supplying an argument to the macro body. In addition, a number of the following techniques may be applicable to the MCO: 1. The full implementation of register tracking implies the need for algorithms similar to data-flow algorithms on higher-level program representations. The implementation of such algorithms on machine code to track live-dead information on registers should be investigated. Also, such algorithms can be used to implement other transformations. For example, a register does not need to be saved and restored in a 28 The opcode for this instruction. This number is independent of the actual bit pattern for the instruction: it is an ordinal index into the static data structures which describe the instruction set on the target architecture. SIZE A code which denotes the number of bytes being operated on by this instruction. This field is used to reduce the number of opcodes by combining instructions which perform similar operations on different sized objects into a single opcode. IADDR, FADDR The initial and final addresses for the instruction. The IADDR field gives the load address at which this instruction would have been loaded as specified in the input task file. FADDR specifies the load address for the instruction in the output task file; it is initialized to IADDR and gets incrementally changed as the code is improved. INSTR A pointer to the bytes of the instruction. As instructions are parsed, this field is initialized to point directly into the image of the text segment read into memory. However, if an instruction is ever expanded past its original length, the bytes must be stored elsewhere (in a dynamically allocated buffer). IBYTES, NBYTES The initial and current number of bytes in the instruction. IBYTES is needed so that the INSTR field can be reset Goss Machine Code Optimization properly if the instruction needs to be expanded beyond its original length. REG An array of register descriptors giving the machine registers used by this operand. The significance of each element of the array depends on the addressing mode in use. NEXT A pointer to the next text or data node on the list. Initially, all the text and data nodes are linked together in a single list in the order they appear in the input file. During code distribution, the original list is partitioned into a set of lists which are re-ordered. REF, JSR The count of the number of times the instruction is referenced and how many times it is referred to as the target of a subprogram call instruction. A reference could consist of a jump to or a call of the instruction, a pointer to the instruction in some data area, or a constant in an instruction operand or data area which names the instruction. In addition, each operand has an operand position, OPNUM(op), associated with it which is simply that operand's position in the OP array of descriptors. Each block node has the following fields: SADDR, EADDR The IADDR of the first node in the subprogram and the SADDR of the next block (zero for the last block). TEXT A pointer to a linked list of text and data nodes for this block. The last node on this list has a NULL NEXT field. OP An array of operand descriptors. Each operand descriptor holds information for a single operand of the instruction and has the following fields: INEXT, NEXT Pointers to successor block nodes as they appear textually in the source code. We maintain the initial successor and the successor as modified by later optimizations. ADDR For relocatable operands, this field holds the effective address which this operand referenced when it was initially read in. This reference might be to another instruction or to a data item in some data area. For non-relocatable operands, this field is used during operand reduction to preserve the value specified by the operand while the addressing mode of the operand is being altered. Refer to Chapter 5 for the specifics. TARGET A pointer to a text or data node that contains the object referenced by a relocatable operand. This field is NULL if the operand is non-relocatable. MODE A code giving the addressing mode used by the operand. Like the OPC field, this code is used to index into the static data structures which describe the addressing modes on this architecture. OFFSET An index into the bytes of the instruction telling where any extension word associated with this operand begins. This field is updated whenever some code improvement changes the addressing mode of the operand. 29 REF, RELOC, DRELOC Fields used during the code distribution algorithm. Appendix B. Low Level Implementation of Data Structures In this appendix, I present the low level implementation of the data structures involved in forming the TRANSLATE_CLASS and the operand reduction algorithm. They are coded in C ([Kern 78]) and appear as they do in the production version, except for the following modifications, which hold for this and following appendices: Certain type declarations have been simplified for ease of reading this section of code independently from the rest of the MCO. All debugging, tracing, and much of the assertion checking has been removed. This code actually appears in several separate modules in the production version. The comment conventions have been altered as well as other cosmetic and typographic changes. ----- The following "m_" constants and types describe the basic parameters of the architecture whose programs we are optimizing (the "target machine" Goss Machine Code Optimization -- architecture). -- The size of an object needed for a -- (virtual) address on the architecture we -- are optimizing (the target machine). #if TVAX11 typedef short m_opc; #endif -- The type of an addressing mode descriptor. #if TM68000 or TVAX11 or TTI32000 typedef long m_addr; #endif -- The maximum number of operands an -- instruction can have. #if TM68000 or TTI32000 #define m_opcount 2 #endif #if TVAX11 -- The value given here does not take into -- account the caseb. casew, and casel -- instructions on the VAX architecture. -- These are handled as separate cases -- in mcoinstr.c #define m_opcount 6 #endif -- The maximum number of registers which -- any single operand of a machine -- instruction can reference. #if TM68000 -- The 68000 can address up to two registers -- in an index mode, but an additional -- bit is needed to tell whether the index -- register is long or word. #define m_maxreg 3 #endif #if TTI32000 or TVAX 11 #define m_maxreg 2 #endif -- The type of a register descriptor. -- Objects of this type are used to name -- one of the machine registers. #if TM68000 or TVAX11 or TTI32000 typedef byte m_reg; #endif -- The type of an opcode descriptor. #if TM68000 or TTI32000 typedef byte m_opc, #endif #if TM68000 or TTI32000 or TVAX11 typedef byte m_mode; #endif -- These inform the operand reduction -- algorithm what possibilities exist for -- span-dependent instructions and what -- the range of spans is for each -- possibility. Note that spans are -- given relative to different positions -- for each target architecture. These are noted below. #if TM68000 -- The 68000 has 2, 4, and 6 byte branches: -- Two byte conditional and -- unconditional branches to targets in the -- range .-span8min to .-span8max; -- Four byte conditional and unconditional -- branches to targets in the range -- .-spanl6min to .+span16max; Six byte -- unconditional branches to any address. --------- Note also the specialized branches which exceed the maximum span-dependent range of spanl6max - these are handled by the addressing modes am_cvlong and am_dvlong (see mcocodes.h). These values give the offsets from the start of the instruction containing the span-dependent addressing mode. #define spanSmm (-126) #define spanSmax 129 #define spanl6min (-32766) #dcfine spanl6max 32769 #endif #if TVAX11 -- We have a minor problem on the VAX: -- the span of a location-relative -- addressing mode does not bear any relation -- to the start of the instruction, -- but is relative to the address following -- the operand extension word! -- However, since the operand reduction -- algorithms deal with span values -- independent from a particular addressing 30 Goss Machine Code Optimization -- mode, we cannot take the -- size of the addressing mode into account -- when computing a span. -- of a non-relocatable operand -- so that it can be restored correctly by -- the relocate phase. -- Hence, we compute all spans on the VAX -- from the beginning of the -- span-dependent operand itself. m_addr op_addr; --------- ------- This means that the range of span values given here is slightly reduced to allow all possible sizes of addressing modes which can be used for that span. This means that some boundary cases where a shorter addressing mode could be used will he missed, but se la vie. If the operand is relocatable, this field contains a pointer to the text or data node containing the effective address to which this operand refers. This field is NULL if the operand is non-relocatable. Struct tx_tag *op_target; ------ #define spanSmin (-128+2) #define spanSmax 127 -- For word-relative addressing modes, the -- minimum span increases by four. The addressing mode used by this operand. This is an integer index into the array of addressing mode descriptors (am_table[]). These codes are defined in mcocodes.h m_mode op_mode; #define spanl6min (-32768+4) #define spanl6max 32767 ------ -- This span is used for the am_lit -- addressing mode on the VAX. #define span6min #define span6max 63 #endif If any extension bytes are required to represent this operand, this field contains the byte position of the start of those extension bytes in the instruction. byte op_offset; ------ -- DYNAMIC DATA STRUCTURES -- These data structures are allocated as -- needed to represent the program -- being optimized. An array of register descriptors giving the registers used by this operand. The order and significance of the registers named here are defined in mcocodes.h. m_reg op_reg[m_maxreg]; } operand; -- Operand Descriptor -- Text Nodes -- These structures describe operands of a -- target machine instruction. typedef struct { -- If this operand is relocatable, this -- field contains the effective -- address which this operand referenced -- when it was initially input. -- Note that the reference may have been -- done using any addressing mode -- available for the operand. If this -- operand is not relocatable, this field -- is NULL before the minimize phase of the -- MCO. After minimize, this -- field is used to store the extension word 31 ----- Data structures for describing an instruction. Instances of these structures are allocated for each instruction in the machine language input file. typedef struct tx_tag { -------- The instruction identifier. This field gives an index into our static table of instruction descriptors (id_table[]). This field also serves to distinguish between text and data nodes (this field has the value o_data for data nodes). Goss Machine Code Optimization m_opc tx_opc; #if TM68000 -------------- The instruction size. This field is conceptually part of the opcode field, but is kept separate to reduce redundant information in the tables. It tells how big the operand of the instruction is. This field is often used in conjunction with the opcode field. For example, instructions with different opcodes are not considered equivalent (even if they are in the same instruction equivalence class) unless the size fields are the same. byte tx_size; -- Size indicators for the size field on the -- 68000 architecture. #define #define #define #define #endif siz_byte siz_word siz_long siz_illegal 0 1 2 3 --------- points to the bytes of the instruction directly in the input buffer. If we need to lengthen the instruction beyond its initial allocation. we must specifically allocate a buffer to hold the new bytes. or else risk writing over the next instruction in the text segment. byte tx_ibytes; -- The current number of bytes in the -- instruction byte tx_nhytes; -------- The count of the number of references to this node made by other text nodes. This is a count of how many relocatable operands refer to this node. This count includes relocatable addresses in data areas which refer to this node. byte tx_ref; -- Pointer to the bytes of the instruction. ------ byte *tx_instr; byte tx_jsr; -- Pointers to the next node in this linked -- list of text nodes. struct tx_tag *tx_next; -- The initial address assigned to this -- instruction in memory in the input -- task file. m_addr tx_iaddr; ----- The final address assigned to this instruction at the end of the algorithms which manipulate the text and data blocks. Count of subroutine-call instructions referring to this node. This is used to divide the input text segment into subprogram blocks in preparation for code distribution. #if OPSYMBOL -- The name of a symbol pointing to this -- address. This pointer points -- directly into the symbol table of the -- input file which is read -- m gettext(). This field is used only for -- tracing. char *tx.label; #endif ------ An array of operand descriptors. The number of elements in this array is bogus: we allocate only as many operand descriptors as needed for this instruction. m_addr tx_faddr; ----- The number of bytes in this instruction when it was initially read in. This must be kept for the following reason: the tx_instr field operand tx_op[l]; } tx_node: -- Data Nodes 32 Goss ------------ Machine Code Optimization Data structure for describing an area of program data. Each instance of this structure describes an area of data whether it lives in the text or data segment. Note that the layout of the leading portion of this structure is identical to the tx_node structure above. This allows us to cheat in certain sections of code and not differentiate whether we are dealing with a text or data node. #define nbytes_of(tx) (((tx)→tx_opc == o_data) ? (tx)→dt_nhytes : (tx)→tx_nhytes) #define ibytes_of(tx) (((tx)→tx_opc == o_data) ? (tx)→dt_nbytes : (tx)→tx_ibytes) -- Identity of the node. #define is_text(tx) ((tx)→tx_opc != o_data) #define is_data(dt) ((dt)→dt_opc == o_data) -- Macros which specify how the data -- segment must he aligned on various machines. typedef struct dt_tag { -- This field flags this node as a data -- node. The field always has the value -- o_data. #if TM68000 #define dalign(a) (a) #endif #if TVAX11 m_opc dt_opc; -- Pointer to the bytes of the data. byte *dt_data; -- Pointer to the next data or text node -- on this list. -- Align the data segment on a 1024-byte -- boundary. #define dalign(a) (((a) - 0x03FF) bitand OxFFFFFC00) #endif -- Block Nodes. struct dt_tag *dt_next; -- The initial address assigned to the -- start of this area in memory. ----- One of these structures is allocated for each block of code and/or data. These blocks are arranged in better order during code distribution. m_addr dt_iaddr; typedef struct bl_tag { ----- The ftnal address assigned to the start of this area at the end of the algorithms which manipulate the text and data blocks. -- Pointer to linked list of text and/or -- data nodes. tx_node *bl_text; m_addr dt_faddr; ----- The current number of bytes in the data area. Note that this field does NOT correspond to the nbytes field of text nodes. long dt_nbytes; } dt_node; -- Macros which are useful when dealing with -- a heterogeneous list of text and -- data nodes. -- Number of bytes described by the node. 33 -- Pointer to the initial successor block -- to this one. struct bl_tag *bl_inext; -- Pointer to the real successor block, -- after code distribution -- is performed. struct bl_tag *bl_next; ----- The start address for the block. This is the initial address of the first text node on the list of text and data node belonging to this block. Goss Machine Code Optimization m_addr bl_saddr; -- STATIC DATA STRUCTURES -------- The ending address for this block. This is the first machine address past the last initial address used by the last text or data node in this block. If there is a following block, it is the same as the bl_saddr value for that block. m_addr bl_eaddr; -- The remaining fields are used during -- code distribution. -- The number of references to other -- unplaced blocks. long bl_ubreloc; -- Number of references from unplaced -- blocks to this block. ----- Instances of these structures are allocated in the mcodatac module to represent the particulars of the target architecture. --------- Addressing mode descriptor. This structure describes the details of a particular addressing mode on the target machine. An array of these structures is kept (am_table[ ]) which describes all the addressing modes on the target machine. This table is indexed by the am_*** macros. typedef struct am_tag { -- The number of extension bytes required -- by this addressing mode over -- and above the number of bytes for the -- basic instruction. long bl_ubref; byte am_size; -- The total number of references to nodes -- in this block from the leftmost -- block on the list. ------- long bl_ref; -- The total number of relocatable operands -- in this block referring to the -- leftmost block on the list. long bl_reloc; ----- The number of relocatable references which refer to the last node in the original block list which holds the data segment. long bl_dreloc; } bl_node; The relative speed of this mode. This value indicates the execution time cost of this addressing mode above that required for the basic instruction. This value is usually expressed in terms of machine cycles. byte am_speed; ----- The initial and final counts of how many occurrences of this addressing mode appear in the code. These fields are filled in by mix(). long am_icount; long am_fcount; -- The name of this addressing mode. text *am_name; -------- This macro is used to loop through the text and data nodes after they have been partitioned into blocks It saves an extra level of indentation when looping through the two-level block/text node data structure. This macro should he invoked only with l-values! #define for_all_text(bl,tx) for(bl=bl_first; bl; bl = bl→bl_next) for(tx=bl→bl_next; tx; tx = tx→tx_next) ------- The operand equivalence class. This is a pointer to a list of addressing modes which are semantically equivalent to this addressing mode. If this field is NULL, no other addressing modes are equivalent. m_mode *am_oec; -- A pointer to a routine to determine 34 Goss Machine Code Optimization ------- whether the addressing mode described by the current descriptor can be installed in a given operand. If the addressing mode can be used for any relocatable operand, this field may be NULL. ------ This routine is declared as follows: predicate routine(tx, op) tx_node *tx; Node for instruction being evaluated. short op; Operand number to evaluate. char *id_name; Relative speed of this basic instruction. This field is used simply for comparing various instructions and choosing the best one. Therefore, this field does not need to be absolutely correct on the hardware: it should be as relatively correct as possible. Instructions are deemed equivalent by the MCO if their opcodes are in the same instruction equivalence class and they share a common size value. ----------- -- Pointer to the name of this instruction. -------- ----- For each operand, a pointer to the addressing class which describes the addressing modes allowed syntactically for that operand. m_modc •id_class[m_opcount|; typedef struct id_tag { byte id_noper; For each instruction equivalence class, the id_iec fields for the instructions in the class form a ring of references to each other. ----- Instruction descriptor. This structure describes the details of a particular instruction on the target architecture. An array of these structures is kept (id_table[]) which describes all the instructions on the target machine. This table is indexed by the o_*** macros. -- Number of operands for this instruction. ----- m_opc id_iec; bool *(am_span_ok()); } am_node; -------- 35 For each operand, a flag telling whether the operand can be a source and/or a destination. A source is defined as any operand whose value is examined. A destination is any value changed. Note that we are referring only to the contents of the final effective address. Also note that an operand can be both a source and a destination. bool id_source[m_opcount]; bool id_dest[m_opcount]; } id_node; ------- The structure of an element of the TRANSLATE_CLASS. Each element describes a possibility for translating a given instruction and a particular operand of that instruction to a new opcode and addressing mode for that instruction. typedef struct tc_tag { byte id_speed; -- Initial and final count fields for this -- instruction. These fields -- are filled in by mixf). -- The opcode associated with this -- translation possibility. m_opc tc_opc; short id_icount; short id_fcount; -- The addressing mode to which we can -- translate the scrutinized operand. ----- m_mode tc_mode; The instruction equivalence class. This field gives the next instruction in the instruction equivalence class to which this instruction belongs. -- The registers associated with a new mode, -- if any. Goss Machine Code Optimization m_reg tc_reg[m_ma.xreg]; } tc_node; ---------- Appendix C. Low Level Implementation of Algorithms In this appendix, I present the low-level implementation of the routines FORM_TC and LENGTHEN. 36 Check that the new instruction is OK with respect to the operands which we are NOT scrutinizing in this routine. We must make sure that the addressing modes used by the other operands are syntactically legal in the corresponding operands of the new opcode. This is done only for a true change in opcode. -- The translate class buffer. if (opc != firstopc) { tc_node tc[max_tc]; ----- -- Loop through all operands which are -- not the ones being examined This routine builds a translation class, given an instruction and an operand to scrutinize. It deposits the set in the global tc[] array. for (j = 0; j < id_table[opc].id_noper; --j) { if (i == j) { continue; } form_tc(tx. i) tx_node *tx; ---long i; -- Pointer to instruction for which we are forming translations Operand number to scrutinize am = tx→tx_op[j].op_mode; -- See if we can find this addressing -- mode in the addressing -- class of the new opcode. { tc_node *tcptr; --m_opc firstopc; --m_opc ope; -m_mode am; --m_mode *oec; ---m_mode *oecptr; -m_mode *acptr; --bool found; long j; Work pointer to elements of the translate class Original opcode of the instruction Opcode we are trying now Addressing mode being tested out Pointer to operand equivalence class for modes Working oec pointer Pointer to addressing classes found = false; for (acptr = id_table[opc].id_class[j]; *acptr; - -acptr) ( if (*acptr == am) { found = true; break; } } -- Here to check if this opcode is -- legal. if (not found) { goto ncxt_instr; } -- Initialize pointers to build the -- translation class set directly. } } tcptr = &tc[0]; firstopc = tx→tx_opc; opc = firstopc; oec = am_table[tx→tx_op[i].op_mode].am_oec; -- Loop through all instructions which are -- in this instruction's -- equivalence class. -- Here if the new instruction is -- generically legal to try out the -- possible addressing modes. for (acptr = id_table[opc].id_class[i]; *acptr; --acptr) ( oecptr = oec; forever { -- Reject this addressing mode if it is Goss Machine Code Optimization ----------- not semantically equivalent to the addressing mode in the instruction. That is, if it is not in the operand equivalence class of the addressing mode of the instruction operand we are scrutinizing. Note that, if the operand equivalence class is a singleton, the pointer is allowed to be NULL. found = false; if (oecptr) { while (*oecptr) { if (*oecptr++ == *acptr) { found = true: break; } } ) else if (tx→tx_op[i].op_mode == *acptr) { found = true; } if (not found) { -- This addressing mode is not in the -- intersection of the -- addressing class of the new opcode -- and the semantic operand -- equivalence class of the existing -- addressing mode. } ------ Otherwise, move instruction and around the ring instructions to instruction. onto the next see if we have looped of equivalent our initial opc = id_table[opc].id_iec; if (opc == firstopc) { break; } } -- Terminate the translate class with a -- node which has the opcode o_none. tcptr→tc_opc = o_none; } ----- This routine processes the data built up for the operands and determines which span-dependent operands need to be lengthened. lengthen() { bool change; tx_node *tx; bl_node *bl; continue; } m_mode am; -- Here if this is an OK addressing mode -- to build a new element in -- the translation class. short alter; tcptr→tc_opc = opc; tcptr→tc_mode = *acptr; tcptr--; 37 short i, j, k; long span; byte cond; ---------------- Passes are made through code until change=false Node currently being processed Pointer to blocks of text and data nodes Addressing mode being examined Number of bytes to add to the current sdo Loop counters Span value for each operand Bit pattern for condition in conditional branch } -- Here to move onto the next instruction -- in this instruction -- equivalence class. next_instr: -- If the instruction equivalence class -- contains only this instruction, -- the id_iec field will be NULL. If so, -- we are finished. tc_node *tcptr; --tc_node *besttc;--long bestcost; --long newcost; -short oldsize; --- Working pointer to translate class elements Pointer to best translate class element so far Cost associated with best element Cost of current element Size of instruction before being expanded change = true; if (id_table[opc].id_iec == NULL) { break; -- Keep making passes through the linked Goss Machine Code Optimization 38 -- list until it stabilizes. -- class buffer, tc[]. while (change) { form_tc(tx, i); change = false; --st_npasses; ----- -- Reset the final address field based on -- the number of bytes in each instruction. We must now find another opcode/addressing mode combination to use in place of the current one which must be expanded. set_faddr(); besttc = NULL; bestcost = 99999; -- Process each instruction in each block -- of text and data nodes. for (tcptr = &tc[0]; tcptr→tc_opc != o_none; --tcptr) { for_all_text(bl, tx) { -- Assign a cost to this -- opcode/addressing mode -- combination. if (is_data(tx)) { continue; } newcost = id_table[tcptr→tc_opc].id_speed + am_table[tcptr→tc_mode].am_speed + am_table[tcptr→tc_mode].am_size; -- Start off with no additional bytes -- for this instruction. alter = 0; if (newcost ≥ bestcost) { continue; } for (i = 0; i < id_table[tx→tx_opc].id_noper; --i) { ------- ----- Process only relocatable operands or non-relocatable operands with addressing modes which have extension words which were shortened during the minimize() phase. Remember this translation if the opdmode combination is OK. It is never OK if it was the original combination. if (tcptr→tc_opc == tx→tx_opc and tcptr→tc_mode == am) { continue; } if (not tx→tx_op[i].op_addr) { continue; } else if (span_ok(tx, i, tcptr, span)) { -- Check if the operand needs -- expansion. -- Remember this newly found best -- element of the translate class. if (*(am_table[tx→tx_op[i].op_mode]. am_span_ok)(tx, i)) { continue; } bestcost = newcost; besttc = tcptr; } } -- We come here only if we have an -- operand which needs to be -- expanded. ----- Build the Translate Class for this instruction and operand. The translate class is placed m the single translate -- Install the newly found best -- opcode/mode combination. tx→tx_opc = besttc→tc_opc; tx→tx_op[i].op_mode = besttc→tc_mode; change = true; } Goss Machine Code Optimization ----- After changing modes, we may need to change the offsets of the operands and reset the number of bytes in the instruction. if (change) { oldsize -= tx→tx_nbytes; expand_offsets{tx); alter = tx→tx_nbytes - oldsize; assert(2791, alter ≥ 0); st_lengthen -= alter; } } } } Bibliography [Aho 77] A. V. Aho and J. D. Ullman, Principles of Compiler Design. Addison-Wesley. Reading, Mass., 1977, 604 p. [Apple 85] Inside Macintosh. Apple Computer, Inc., 1985. [Ankl 82] P. Anklam, D. Cutler, R. Heincn, and M. D. MacLaren, Engineering a Compiler. Digital Press, 1982, 269 p. [ANSI 74] American National Standard Programming Language COBOL, ANSI X3.23-1974. [Bell 71] C. G. Bell and A. Newell, Computer Structures: Readings and Examples. McGraw- Hill Book Co., 1971, 668 p. [Brown 76] P. J. Brown, “Throw-away Compiling”, Software-Practice and Experience, Vol. 6, No. 3, pp. 423434. [Brown 79] P. J. Brown, Writing Interactive Compilers and Interpreters, John Wiley and Sons, Ltd., 1975, 265 p. [Contr 75] Fortran Extended. Version 4. Reference Manual. Control Data Corp., 1975. 39 [Dewar 79b] R. B. K. Dewar, A. Grand, S. Liu, J. T. Schwartz, and E. Schonberg, “Program by Refinement, as Exemplified by the SETL Representation Sublanguage”, ACM Transactions on Programming Languages and Systems. Vol. 1, No. 1 (July 1979), pp. 27-49. [Even 75] S. Even and Y. Shiloach, “NP-Completeness of Several Arrangement Problems”, Technical Report #43. Dept. of Comp. Sci., Technion, Haifa, Israel, Jan 1975. [Even 79] S. Even, Graph Algorithms. Computer Science Press, 249 p., 1979. [Fras 84] C. W. Fraser, E. W. Myers, and A. L. Wendt. "Analyzing and Compressing Assembly Code", Proceedings of the SIGPLAN '84 Symposium on Compiler Construction. SIGPLAN Notices, Vol. 19. No. 6 (June 1984), pp. 117-121. [Fried 76] G. Frieder and H. J. Saal, “A Process for the Determination of Addresses in Variable Length Addressing”, Communications of the ACM. Vol. 19, No. 6 (June 1976), pp. 335-338. [Gall 78] R. G. Gallager, “Variations on a Theme of Huffman”, IEEE Transactions on Information Theory. Vol. IT-24. No. 6 (Nov 1978), pp. 668-674. [Garey 76] .M. R. Garey, D. S. Johnson, and L. J. Stockmeyer, “Some Simplified NP-Complete Graph Theory Problems”, Theoretical Computer Science, Vol. 1, 1976, pp. 237-267. [Garey 79] M. R. Garey and D. S. Johnson, A Guide to the Theory of NP-Completeness. Wit. Freeman, San Francisco, 1979. [Gieg 83] R. Giegerich, “A Formal Framework for the Derivation of Machine-Specific Optimizers”, ACM Transactions on Programming Languages and Systems, Vol. 5, No. 3 (July 1983), pp. 478-498. [Golum 80] M. C. Golumbic, C. F. Goss, and R. B. K. Dewar, “Macro Substitutions in .MICRO SPITBOL - A Combinatorial Analysis”, Congressus Numerantium. Vol. 29 (1980), pp. 485-495. [DEC 75] PDP-11 Processor Handbook. Digital Equipment Corporation, Maynard. Mass. 1975. [Hans 74] G. J. Hansen. Adaptive Systems for the Dynamic Run Time Optimization nj Programs. Ph. D. Dissertation, Carnegie-Mellon University, Pittsburgh, Pa. [DEC 77] VAX 11/780 Architecture Handbook, Digital Equipment Corporation, Maynard, Mass. 1977. [IBM 74] IBM System/360 and System/370 FORTRAN IV Language. Eleventh Edition. May 1974, 169 p. [Dewar 79a] R. B. K. Dewar, M. C. Golumbic, and C. F. Goss, “MICRO SPITBOL”, Computer Science Technical Report No. 11. New York University, 19 p. 1979. [Instr 81] The Pixel 100:AP User's Manual. Instrumentation Laboratory, 1981. [Kern 78] B. W. Kernighan and D. M. Ritchie. The C Programming Language. Prentice-Hall, Inc., 1978, 228 p. Goss Machine Code Optimization [Knuth 73] D. E. Knuth. The Art of Computer Programming. Vol 1. Fundamenlal Algorithms, Second Edition, Addison-Wesley, Reading, Mass., 1973. [Knuth 77] D. E. Knuth, J. H. Morris, Jr, and V. R. Pratt, “Fast Pattern Matching in Strings”, SIAM Journal of Computing, Vol. 6, No. 2 (1977), pp. 323-350. [Lever 80] B. Leverett and T. G. Szymanski, “Chaining Span-Dependent Jump Instructions”, ACM Transactions on Programming Languages and Systems, Vol. 2, No. 3 (July 1980), pp. 274-289. [Lower 69] E. S. Lowery and C. W. Medlock, “Object Code Optimization”, Communications of the ACM. Vol 12. No. 1 (Jan 1969), pp. 13-22. [McCr 76] E. M. McCreight, “A Space-Economical Suffix Tree Construction Algorithm”, Journal of the ACM. Vol. 23, No. 2 (April 1976), pp. 262-272. [McKee 65] W. M. McKeeman, “Peephole Optimization”. Communications of the ACM. Vol. 8, No. 7 (July 1965). pp. 443-444. [Motor 84a] M68000 16/32-Bit Microprocessor Programmer's Reference Manual, Motorola, Inc., Fourth Edition, 1984, 217 p. [Motor 84b] M68000 32-Bit Microprocessor User's Manual. Motorola, Inc., Prentice-Hall. 1984. [Parts 83] H. Partsch and R. Steinbruggen, “Program Transformation Systems”, ACM Computing Surveys, Vol. 15, No. 3 (Sept 1983), pp. 199-236. [Peter 61] W. W. Peterson, Error-Correcting Codes, The M. I. T. Press and John Wiley & Sons, 1961, 285 p. [Phil 85c] Philon FAST/C for the MC68000 Under Unix. Philon, Inc., New York, N.Y., 1985. [Phil 85co] Philon FAST/COBOL for the MC68000 Under Unix. Philon. Inc., New York, N.Y. 1985. [Phil 85ft] Philon FAST/FORTRAN for the MC68000 Under Unix. Philon, Inc., New York, N.Y., 1985. [Phil 84cb] Philon FAST/BASIC-C for the MC68000 Under Unix. Philon, Inc., New York, N.Y., 1984. 40 [Rober 79] E. L. Robertson, “Code Generation and Storage Allocation for Machines with Span- Dependent Instructions”, ACM Transactions of Programming Languages and Systems. Vol. 1, No. 1 (July 1979) pp. 7183. [Russ 80] R. Rector and G. Alexv, The 8086 Book. Osborne, McGraw-Hill, 1980. [Schn 73] P. B. Schneck and E. Angel, “A Fortran to Fortran Optimizing Compiler”, Computer Journal. Vol. 16, No. 4 (April 1973), pp. 322-330. [Shiel 84] L. D. Shields, Measuring SETL Performance. Ph. D. Dissertation. September 1983, 173 p. [Szym 78] T. G. Szymanski, “Assembling Code for Machines with Span-Dependent Instructions”, Communications of the ACM. Vol. 21, No. 4, pp. 300308. [Texas 85] TI32000 Programmer's Reference Manual. Texas Instruments, 1985. [Tyner 81] P. Tyner, iAPX 432 General Data Processor Architecture Reference Manual. Intel Corp., 1981. [UNIX 80] UNIX Programmer's Manual. Seventh Edition. Virtual VAX-11 Version, November 1980. [Wiln 72] W. T. Wilner, “Design of the Burroughs B1700”, Proceedings of the AFIPS 1972 Fall Joint Computer Conference. Vol 41, AFIPS Press, Montvale, N. J., pp. 489-497. [Wulf 75] W. Wulf, R. K. Johnsson, C. B. Weinstock, S. O. Hobbs, C. M. Geschke, The Design of an Optimizing Compiler. Elsevier North-Holland, 1975, 165 p. Addenda This section contains additional references that were inadvertently omitted from the original 1986 publication. [Aho 86] A. V. Aho, Ravi Sethi, and J. D. Ullman, Compilers: Principles, Techniques, and Tools. AddisonWesley. Reading, Mass., 1986. [Raman 84] M. V. S. Ramanath and M. Solomon, “Jump Minimization in Linear Time”, ACM Transactions on Programming Languages and Systems. Vol. 6, No. 4 (October 1984), pp. 527-545. [Phil 84mb] Philon FAST/BASIC-M for the MC68000 Under Unix. Philon, Inc., New York, N.Y., 1984. [Rich 71] D. L. Richards, “How to Keep the Addresses Short”, Communications of the ACM. Vol. 14, No. 5 (May 1971), pp. 346-349.  The incorrect references to [Lowry 69] and [McKee 67] in Section 1, ¶1 in the original were corrected to [Lower 69] and [McKee 65]. In addition, the following editorial changes were made:  Commas were added to some numbers to enhance readability. For example: 33,684 rather than 33684. Goss Machine Code Optimization  Typography was changed to enhance readability.  Expressions that are inline in the text were typeset in italics to improve readability.  Footnotes were re-numbered and were place in-line in the text, immediately below the paragraph that references them.  Some minor spelling corrections were made (“targetted” ⇒ “targeted”, “ellucidate” ⇒ “elucidate”, “exsiting” ⇒ “existing”).  References to the author were changed from plural to singular. 41
6cs.PL
arXiv:1706.05331v3 [math.ST] 12 Apr 2018 S3T: An Efficient Score Statistic for Spatio-Temporal Surveillance Junzhuo Chen, Seong-Hee Kim and Yao Xie H. Milton Stewart School of Industrial Engineering Georgia Institute of Technology April 13, 2018 Abstract We present an efficient score statistic, called the S3 T statistic, to detect the emergence of a spatially and temporally correlated signal from either fixed-sample or sequential data. The signal may cause a men shift and/or a change in the covariance structure. The score statistic can capture both spatial and temporal structures of the change and hence is particularly powerful in detecting weak signals. The score statistic is computationally efficient and statistically powerful. Our main theoretical contribution are accurate analytical approximations on the false alarm rate of the detection procedures, which can be used to calibrate the threshold analytically. Numerical experiments on simulated and real data demonstrate the good performance of our procedure for solar flame detection and water quality monitoring. 1 Introduction Detection the emergence of a signal in noisy background arises in many multi-sensor spatio-temporal surveillance applications. When the monitored process is in-control, sensors observe noise. When the monitored process is out of control, a signal is added to the noise, which typically possesses particular spatial and temporal correlation structure. One application is the environmental sensor network, which is used to monitor of river systems to detect a potential contaminant hazard [Kim et al., 2017]. When the signal 1 emerges, observations from sensors may have a time-varying mean and a complicated spatio-temporal correlation structure due to water flow. Exploiting spatio-temporal structures of the change may enable us to detect weak signals. However, most existing methods only capture either spatial correlation [Healy, 1987, Crosier, 1988, Jiang et al., 2011, Lee et al., 2014, 2015] or temporally correlation [Xie and Siegmund, 2012]. It is still not clear how to jointly capturing the spatial and temporal information in detection statistics. Moreover, computational complexity is often a concern for sensor network applications since there can be a large number of sensors. One issue with the classic likelihood ratio statistic is that in forming the statistics, one has to invert its sample covariance matrix, which causes both computational instability and complexity. An alternative to the likelihood ratio statistic is the score statistic, which has also been used for developing detection procedures. When the hypothesis test is for a univariate parameter, the score test is the locally most powerful test [Rao and Poti, 1946]. We propose a new efficient score statistic for spatial-temporal surveillance, which we call the S3 T statistic. The S3 T statistic can capture both spatial and temporal correlation of a possible change signal. Hence, it can react quickly to a change in the mean and/or in the spatio-temporal covariance. An appealing feature of the score statistic is that it avoids computing the inversion of a sample covariance matrix, which leads to high computational efficiency for high-dimensional problems. Our main theoretical contributions are accurate analytic approximations for the false detection rate in the offline case or the average run length for the online case, so calibrating thresholds to control the false alarm rate of our procedure can be done efficiently without resorting to onerous numerical simulation. This is useful in practice, as the usual trial-and-error approach to calibrate thresholds by simulation can be quite time-consuming, especially in the high-dimensional setting. When we have scalar observations (the dimension of the observation is one), our statistic S3 T reduces to the score detector considered in [Xie and Siegmund, 2012]. In this sense, our work provides a novel and highly nontrivial extension of [Xie and Siegmund, 2012] when there are both spatial and temporal correlations. The rest of the paper is organized as follows. Section 2 formulates the problem. Section 3 presents our S3 T statistic for offline detection and contains theoretical approximation for the significance level and verifies its accuracy by simulations. Section 4 extends our detection procedure to the online setting and presents accurate approximation to the average-run-length. Section 5 contains numerical results that demonstrate the good performance of our 2 procedure for solar flare detection and water quality monitoring using sensor networks. Finally, Section 6 concludes the paper. 2 Problem Formulation Consider a sequence of samples y` ∈ Rp , ` = 1, 2, · · · , N , where p is the dimension, N is the sample size, which is fixed in the offline setting, and is growing in the online setting. We assume that under the null hypothesis, {y` } forms a temporally i.i.d. random noise process with spatial correlation that is caused by, for instance, either sensor measurement errors or background noises from the environment. At some time k, which corresponds to the unknown change-point, a signal emerges over the observation noise. The change may alter not only the mean of {y` } but also the spatio-temporal correlation structure. We first consider an offline detection setting, with the goal to detect the emergence of a change in retrospect using offline samples. Formally, this can be formulated as the following hypothesis test: H0 :  y` = w` , ` = 1, 2, · · · , N, y` = w` , ` = 1, 2, · · · , k, H1 : y` = x` + w` , ` = k + 1, · · · , N i.i.d. where w` ∼ N (0, Σ) and Σ is the spatial covariance matrix of the noise. Before the change, there is no temporal correlation among the samples. This is a reasonable, because usually we have plenty of data before change to estimate the temporal correlation and perform “whitening” to remove the temporal correlation when there is no change. Below we describe models for the underlying signal {x` } when the change occurs. The signal can be spatially and temporally correlated. For temporal correlation, we use various multivariate time-series models. For instance, we consider the first-order vector autoregressive VAR(1) model [Brockwell and Davis, 1987], x` = µx + θx`−1 + ` , , ` = 1, 2, . . . where θ ∈ R and ` ∈ Rp is the process noise which drives the randomness of the signal. Another example is the VARMA(1, 1) model, which is given by x`+1 + φx` = µx + η` + `+1 , 3 where η ∈ R and φ ∈ R. For spatial correlation, we adopt standard spatial statistics models [Gaetan and Guyon, 2010]. Denote E[x` ] = µ` ∈ Rp and Var(x` ) = γΛ ∈ Rp×p , where Λ is the spatial correlation matrix of the signal x` , and γ ∈ R ≥ 0 is the magnitude of the covariance of the signal. Here we assume stationarity of the spatial covariance and that the structure of Λ is known but the parameter value is unknown. This is a common practice in spatial statistic, because once a spatial correlation model is assumed, Λ is specified by the location of the samples and the unknown value of parameters in the spatial model. In particular, each entry of the spatial covariance Λ is determined by a correlation function, C(d|ρ), which is a function of the distance d between two samples (in our case, sensors) and is parameterized by (unknown valued) ρ. Moreover, we assume the signal magnitude γ is unknown. Some commonly used spatial models are as follows. Let 1{A} denotes the indicator function which takes value 1 when the indicated event A is true and 0 otherwise. 1. Spherical model [Lee et al., 2014]: √ ρ C(d|ρ) = 11{d = 0} + ρ1{d = 1} + 1{d = 2}, 2 ρ ∈ [0, 1]. (1) 2. Exponential model [Gaetan and Guyon, 2010]: C(d|ρ) = 11{d = 0} + e−d/ρ 1{d > 0}, ρ > 0. 3. Matérn model [Gaetan and Guyon, 2010]: C(d|ρ) = 11{d = 0}+ √ 1/2 √ 1/2 1 v ( 2v d/ρ) K ( 2v d/ρ)1{d > 0}, v 2v−1 Γ(v) where the parameters ρ > 0 and θ > 0, Γ(·) is the gamma function, Kv (·) is the modified Bessel function of the second kind [Ripley, 2005], v is the order of the Matérn model, which determines the degree of smoothness of the correlation function. Note that when v = p + 0.5, p ∈ R+ , the Matérn model can be written as a product of an exponential and a polynomial of order p. When v = 0.5, the Matérn model is equivalent to the exponential model, and when v → ∞, it converges to the squared exponential covariance function. 4 ρ > 0. Now we derive our detection statistic. For an assumed change location k, let τ = N − k denote the number of post-change samples. Define a vector by stacking all post-change samples: | | | y(k+1:N ) = [yk+1 , · · · , yN ] ∈ Rpτ , (2) where a| denotes the transpose of a vector a. Define x(k+1:N ) and w(k+1:N ) in a similar fashion. Then we have y(k+1:N ) = x(k+1:N ) + w(k+1:N ) . Now the covariance matrix of the stacked observation vector can be shown to consist of two terms that are due to the signal and the noise, respectively: Var[y(k+1:N ) ] = γVτ (θ) + Στ , where Στ = Var[w(k+1:N ) ], γVτ (θ) = Var[x(k+1:N ) ] and θ is the parameter related to the temporal correlation which we will specify in the next paragraph. The second term in the covariance matrix is given by Στ = Iτ ⊗ Σ ∈ Rpτ ×pτ , (3) where Iτ is a τ -by-τ identity matrix and ⊗ denotes the Kronecker product. Through the definition in (2), the spatial and temporal correlation of the signal is jointly captured by the matrix Vτ (θ) and its form can be specified explicitly. For instance, for VAR(1), we have Vτ (θ) = Rτ (θ) ⊗ Λ, (4) where Rτ (θ) ∈ Rτ ×τ and [Rτ (θ)]i,j = θ|i−j| , ∀i, j ∈ {1, · · · , τ }. Similarly, if the signal follows the VARMA(1,1) model, the matrix V can be parameterized by θ , (φ, η) with the following form: Vτ (θ) = Rτ (φ, η) ⊗ Λ, (5) where Rτ (φ, η) ∈ Rτ ×τ ; [Rτ (φ, η)]i,j = 1+η 2 −2φη, if i = j and [Rτ (φ, η)]i,j = φ|i−j|−1 (φ − η)(1 − φη), otherwise. For the more general models, similar forms of Vτ will hold, i.e., the temporal dependence of the signal is captured by some matrix Rτ , while the spatial dependence by Λ, and the spatial-temporal covariance is a Kronecker product of corresponding spatial covariance and temporal covariance matrices [Genton, 2007]. 5 Using the representation above, the detection problem can be reformulated as the following hypothesis test:   H0 : y(1:k) ∼ N 0, Σk , y(k+1:N ) ∼ N 0, Στ ,  (6) H1 : y(1:k) ∼ N 0, Σk , y(k+1:N ) ∼ N µ(k+1:N ) , γVτ (θ) + Στ , where µ(k+1:N ) = [µ|k+1 , · · · , µ|T ]| ∈ Rpτ and γ ∈ R > 0. Note that the above hypothesis test is equivalent to the following simpler form that will enable us to derive the score statistic: H0 : γ = 0, µ(k+1:N ) = 0, H1 : γ > 0, µ(k+1:N ) 6= 0, where a 6= 0 denotes an element-wise inequality. 3 S3T Statistic for Offline Detection In this section we derive the S3 T statistic for detection for the offline setting, i.e., all samples are collected and we aim to distinguish two hypothese. The log-likelihood function of the hypothesis test in (6) is given by 1 1 log(2π) − log γVτ (θ) + Στ 2 2 1 − (y(k+1:N ) − µ(k+1:N ) )| (γVτ (θ) + Στ )−1 (y(k+1:N ) − µ(k+1:N ) ). 2 (7) To coping with unknown parameters, one may construct a detection procedure using the generalized likelihood ratio (GLR) statistic based on (7). However, the GLR statistic involves the calculation of the inverse of a pτ by-pτ dimensional matrix γVτ (θ) + Στ . Moreover, since the change-point location unknown, when forming the generalized likelihood ratio statistic, we have to search over all possible change-point locations, for k = 1, . . . , N . However, for each k value, calculating (γVτ (θ) + Στ )−1 is expensive when the dimensionality of samples p or the sample size N is large. Below, we show an alternative approach based on the score statistic can avoid this issue. `(γ, µ, τ, θ) = − 3.1 Quadratic score statistic We now derive the score-statistic for detection. The efficient score of the model is calculated by taking the derivative of `(γ, µ, τ, θ) with respect to γ 6 and µ and evaluated at γ = 0 and µ = 0: #  "  1 |  ∂` −1 −1 − 21 tr Σ−1 ∂γ µ=0,γ=0 τ Vτ (θ) + 2 y(k+1:N ) Στ Vτ (θ)Στ y(k+1:N ) , = ς(τ, θ) = ∂` Σ−1 τ y(k+1:N ) ∂µ µ=0,γ=0 (8)  where tr · denotes the trace of a matrix. The derivation of (8) is given in the Appendix. It can be verified that the mean of the efficient score vector E[ς(k, θ)] is 0 under the null hypothesis, where 0 represents a vector of zeros. It can be shown that the covariance of the score vector ς(τ, θ) is given by   # " 1 −1 −1 tr Σ V (θ)Σ V (θ) 0 τ τ τ τ . Cov[ς(τ, θ)] = 2 0 Σ−1 τ As suggested by the seminal work of Radhakrishna Rao [1948], when the likelihood function depends on multiple parameters, the score statistic corresponds to a quadratic function of the efficient score vector. In our case, this corresponds to S(τ, θ) = ς(τ, θ)0 Cov[ς(τ, θ)]−1 ς(τ, θ) h i2 | −1 −1 y(k+1:N Σ V (θ)Σ y − c(τ, θ) τ (k+1:N ) τ ) τ | −1 = + y(k+1:N ) Στ y(k+1:N ) , d(τ, θ)   −1  (9) −1 −1 where c(τ, θ) = tr Στ Vτ (θ) , and d(τ, θ) = 2tr Στ Vτ (θ)Στ Vτ (θ) . Note that the computation of S(τ, θ) is relatively easy and much less expensive than the GLR statistic. The only place requires matrix inversion is the inversion of Στ . The matrix Στ defined in (3) has a simple block diagonal structure Στ = Iτ ⊗ Σ. Hence, its inversion only requires to compute Σ−1 , with a computational complexity of O(p3 ) (which is much smaller than O(pτ )3 , if we have to directly invert Στ ). Moreover, since Σ is assumed known and fixed, its inversion can be pre-computed and does not cause an issue for the online computation of the detection statistic. Since S(τ, θ) has an increasing mean as the change location τ decreases, it needs to be normalized to have mean 0 and variance 1 under the null hypothesis. We refer to the resulting detection statistic as the quadratic score statistic,   S(τ, θ) − E S(τ, θ) e θ) = q S(τ,   . (10) Var S(τ, θ) 7   It can be shown that the mean is given by E S(τ, θ) = pτ + 1, and the variance is given by    c(τ, θ)  −1 −1 −1 V (θ) V (θ)Σ Var S(τ, θ) =2pτ + 10 − 24 V (θ)Σ tr Σ τ τ τ τ τ τ d(τ, θ)2   48 −1 −1 −1 −1 tr Στ Vτ (θ)Στ Vτ (θ)Στ Vτ (θ)Στ Vτ (θ) . + d(τ, θ)2 e θ), which Then we may construct an offline detection procedure using S(τ, detects a signal when the maximum standardized score statistic over all possible θ and τ exceeds a pre-specified threshold b: max θ∈Θ, 1≤τ ≤N e θ) ≥ b, S(τ, where Θ is the set of possible values of the parameter θ. 3.2 S3 T statistic for offline change-point detection Although it is claimed by [Radhakrishna Rao, 1948] that the quadratic score statistic achieves the maximum discrimination between the null and the alternative, the statistic is too complicated to perform theoretical analysis and difficult to calibrate the threshold b. In this section, we propose a simpler statistic, namely S3 T statistic, which is the score with respect to γ only, which is given by ∂` ∂γ µ=0,γ=0 W (τ, θ) = q  ∂` Var ∂γ µ=0,γ=0 | −1 −1 y(N −τ +1:N ) Στ Vτ (θ)Στ y(N −τ +1:N ) − c(τ, θ) p = .  d(τ, θ) (11) Under the null hypothesis, the detection statistic W (τ, θ) has mean 0, and variance 1. Similarly, the procedure claims to detect a signal if the maximum score statistic exceed a pre-specified threshold b, max θ∈Θ, 1≤τ ≤N 3.3 W (τ, θ) ≥ b. (12) Control false alarms of offline statistic In this section, we present a theoretical approximation for the significance level of the detection procedure defined in (12), which avoid the time-consuming simulation when deciding the appropriate b. 8 −1/2 −1/2 Below, let Aτ (θ) = Σ−1 Vτ (θ)Στ . Let Ip τ Vτ (θ), and Bτ (θ) = Στ denote a p by p identity matrix. Denote the standard normal density function by φ(x) and its distribution function by Φ(x), and define a special function [Siegmund and Yakir, 2007]: h  1i 2 x Φ −2 x 2 . ν(x) = x x  (13) x Φ + φ 2 2 2 Define the following quantities, which are useful for the statement of the theorem # "  tr Aτ +1 (θ)Aτ +1 (θ)  −1 , (14) µ(τ, θ) = τ tr Aτ (θ)Aτ (θ) ∂ 2 E[W (τ, θ)W (τ, s)] , ∂ 2s s=θ  exp − ξ0 (τ, θ)b + ψ(ξ0 (τ, θ) √ g(τ, θ) = , σξ0 2π 2ξBτ (θ) c(τ, θ) 1 ψ(ξ) = −ξ p − log Ipτ − p . d(τ, θ) 2 d(τ, θ) H(τ, θ) = − (15) (16) (17) Note that ψ(ξ) is the cumulant generating function of the detection statistic W (τ, θ). The following theorem is one of the main theoretical contribution, which provides an analytical approximation for significance level of the detection procedure defined in (12). Theorem 1 (Approximation for significance level). When the threshold b → ∞ and θ ∈ Θ ⊂ Rd , under the null hypothesis, the probability of false detection for the procedure defined in (12) is given by   PH0 max W (τ, θ) ≥ b θ∈Θ 1≤τ ≤N = N Z X 1 d (2π) 2 τ =1 θ∈Θ d  2 1 b µ(τ, θ) [bξ0 (τ, θ)] 2 g(τ, θ)|H(τ, θ)| 2 ν ξ0 (τ, θ) 2τ r b2 µ(τ, θ)  dθ + o(1), τ (18) where σξ20 −1  −1   2ξ0 Bτ (θ) 2ξ0 Bτ (θ) = d(τ, θ) tr Ipτ − p Bτ (θ) Ipτ − p Bτ (θ) , d(τ, θ) d(τ, θ) −1 9 and ξ0 (τ, θ) is the solution to h  2ξ0 Bτ (θ) i−1 1 p tr Ipτ − p Bτ (θ) − Aτ (θ) = b. d(τ, θ) d(τ, θ) (19) The main proof technique for Theorem 1 involves the change-of-measure to evaluating the boundary hitting probability of random process [Siegmund, 2013, Yakir, 2013]. See the Appendix for the derivation of (17) and the proof of Theorem 1, when the dimension of parameter θ is 1 (i.e., d = 1), and the proof for one-dimensional parameter space can be generalized to the multi-dimensional case using similar proof techniques. We verify the accuracy of the approximation in Theorem 1 by comparing the approximated significance levels with simulated ones. In the experiment, we assume that the temporal correlation structure of the signal {x` } follows a VAR(1) model, x` = µx + θx`−1 + ` , where θ ∈ R, which means Vτ (θ) has the form in (4). We further assume the spatial correlation of the signal follows a spherical model, as defined in (1), with parameter ρ = 0.3. We set N = 50. The search space of θ is set as a uniform grid from 0.1 to 0.9 with a step size 0.1. We vary the dimension of the signal p. In addition, the covariance matrix of the noise process Σ is assumed to be a p-by-p identity matrix. Simulation results are based on 5000 independent replications. Both simulated and approximated false alarm rates are reported in Table 1. As one can observe, the approximation is quite accurate. Table 1: Simulated and approximated significance level when the signal {x` } follows a VAR(1) model (θ ∈ [0.1, 0.9], N = 50 and ρ = 0.3). p=2 b Simulated 3.5 4 4.5 5 5.5 6 6.5 0.097 0.063 0.038 0.033 0.022 0.015 0.006 p=9 Approx. Simulated 0.097 0.068 0.047 0.032 0.021 0.014 0.009 0.065 0.036 0.018 0.011 0.005 0.003 0.002 10 p = 36 Approx. Simulated 0.057 0.030 0.019 0.012 0.007 0.004 0.002 0.036 0.013 0.006 0.003 0.002 0.0004 0.0002 Approx. 0.042 0.019 0.008 0.003 0.001 0.0005 0.0002 4 S3T for online change-point detection In this section, we present an online change-point detection procedure based on the S3 T statistic. In the online detection setting, the total sample size N is not fixed, and new observations are sequentially collected. A signal may occur at some unknown change-point k, and our goal is to detect the emergence of the signal as soon as it occurs. The model can be described as, H0 :  y` = w` , ` = 1, 2, · · · , y` = w` , ` = 1, 2, · · · , k, H1 : y` = x` + w` , ` = k + 1, · · · , Here we adopt a sliding window approach for the online detection procedure. We construct detection statistics using the most recent ω samples at each time, where ω is a pre-specified window length (demonstrated in Figure ?? in the appendix). We did not search for the unknown change-point location to reduce computational complexity (since this has to be done for each time t). This corresponds to a type of Shewhart chart [Shewart, 1931]. Given a current time t, the detection statistic constructed using the most recent ω samples is given by | −1 y(t−ω+1:t) Σ−1 ω Vω (θ)Σω y(t−ω+1:t) − c(ω, θ) p Wt (ω, θ) = . d(ω, θ) (20) The detection procedure is a stopping time, which raises an alarm when the detection statistic exceeds a threshold for the first time:   T = inf t : max Wt (ω, θ) ≥ b , (21) θ∈Θ where b is a pre-specified threshold. 4.1 Control false alarm rate for online statistic In the online detection setting, the performance metric used for characterizing false alarm rate is the average-run-length (ARL), which is the expected stopping time of the procedure when there is no signal, denoted as EH0 (T ). The following theorem provides an approximation on EH0 (T ) of the detection procedure defined in (21). 11 Theorem 2 (Approximation of average-run-length). Assume that b → ∞. For the stopping rule defined in (21), the approximation on EH0 (T ) is given by !−1 r Z d  b2 µ(ω, θ)    2 d 1 b µ(ω, θ) [bξ0 (ω, θ)] 2 g(ω, θ)|H(ω, θ)| 2 ν dθ 1 + o(1) . EH0 (T ) = (2π) 2 ξ0 (ω, θ) 2ω ω θ∈Θ (22) The derivation of Theorem 2 uses the similar technique as in the derivation of Theorem 1. By Theorem 1, we can first obtain an approximation of the probability PH0 (T ≤ m), where m is fixed and sufficiently large:     PH0 T ≤ m = PH0 max Wt (ω, θ) ≥ b θ∈Θ 1≤t≤m m Z X d  2 1 b µ(ω, θ) [bξ0 (ω, θ)] 2 g(ω, θ)|H(ω, θ)| 2 ν ξ0 (ω, θ) 2ω r b2 µ(ω, θ)  = (2π) dθ ω t=1 θ∈Θ (23) As argued in Siegmund and Venkatraman [1995] and Siegmund and Yakir [2008], the stopping time T is asymptotically exponentially distributed and is uniformly integrable. Hence, for large m, PH0 (T ≤ m) − [1 − exp(−λm)] → 0, where λ is equal to the right hand side of (23) divided by m. Thus EH0 (T ) ≈ λ−1 , which is equivalent to (22). The accuracy of Theorem 2 is verified by comparing simulated and approximated EH0 (T ). In the experiments, the signal {x` } is generated by a VAR(1) model, x` = µx + θx`−1 + ` , where θ ∈ R. Hence, Vτ (θ) has the form in (4). Meanwhile, we assume that the spatial correlation of the signal follows a spherical model, as defined in (1), with parameter ρ = 0.3. The search space of parameter θ is a uniform grid from 0.1 to 0.9 with interval 0.1. In addition, the covariance matrix of the noise process Σ is assumed to be a p-by-p identity matrix. The results based on 5000 replications are presented in Figure 1. The comparison between simulated and approximated ARLs shows that the approximation in Theory 2 is quite accurate. − d2 5 Numerical Examples and Power Study In this section, we demonstrate the performance of the proposed detection statistic by comparing with other methods on simulated data, on a real-data 12 ! + o(1). 12000 6000 4000 10000 8000 ARL 8000 2000 4.5 12000 Simulation Approximation 10000 ARL ARL 10000 12000 Simulation Approximation 6000 4000 5.5 6 8000 6000 4000 2000 5 Simulation Approximation 4 4.5 5 5.5 2000 3.8 4 4.2 4.4 Threshold Threshold Threshold (a) (b) (c) 4.6 4.8 Figure 1: Comparison of approximated and simulated ARL for (a) p = 1, (b) p = 2, and (c) p = 9. example of solar flare detection, and on a synthetic example simulated from realistic setting for water quality monitoring. We focus on performance comparison for online change-point detection, since it is the most relevant setting for our targeted application. The performance comparison for offline change-point detection will be similar. We adopt the commonly used performance metric for online setting, the expected detection delay (EDD) after a change has occured. There is a tradeoff in the average run length (ARL) when there is no change and the EDD. Typically, we choose the threshold for each procedure so that its ARL meets a pre-specified large value (e.g., 5000 or 10000), so that there is rarely a false alarm. 5.1 Simulation The detection procedure defined in (21) is compared with two other procedures: (i) an online detection procedure defined in a similar way as (21) using the e θ), and (ii) a multivariate cumulative sum quadratic score statistic S(τ, (MCUSUM) procedure [Healy, 1987]. In the MCUSUM procedure, at each time step, a T 2 type of statistic [Hotelling, 1947] is calculated, and a CUSUM procedure is constructed based on the T 2 statistic. In the experiment, the signal is generated from a VAR(1) model, x` = µx + θx`−1 + ` , with sample dimensionality p = 2 and parameter θ = 0.5. The spatial model of the signal follows the spherical model defined in (1) with ρ = 0.3. For the two procedures based on S3 T and the quadratic score statistic, we use window length ω = 50 and search space for the parameter θ, {0.1, 0.2, · · · , 0.9}. Thresholds for all three procedures are calibrated so 13 that EH0 (T ) = 100. The change occurs at t = 1. We keep the mean of the signal µx = E[x` ] as a constant (not time-varying) vector with all elements equal to µ. We explore different values of µ for the mean shift and γ for the magnitude of covariance matrix of the signal. If µ = 0 and γ > 0, then the signal only causes change in covariance; if both µ and γ are positive, then there are both mean shift and covariance change. Hence, the experiments demonstrate that the proposed detection procedure is suitable for cases where there is either mean shift or covariance change, or both. Table 2 reports the simulated EDD of three procedures based on 5000 replications. The smallest EDD values for each setting are marked bold. The comparison shows that the two score type of procedures which capture both spatial and temporal correlation, i.e., S3 T and the quadratic score statistic outperform the MCUSUM procedure( which only captures the spatial correlation information). Such advantage is more significant when the signal is weak, i.e., when γ or µ are small. This demonstrates that incorporating temporal correlation information indeed improves detection performance. We also find that S3 T outperforms the quadratic score statistic in many cases. Given that S3 T enjoys tractable theoretical analysis and an accurate approximation for its false alarm rate, it is a good option for practitioners. Table 2: Simulated expected detection delay. S3 T γ\µ 0.01 0.05 0.1 0.2 0.5 1 5.2 0 0.1 Quadratic score statistic 0.5 97.27 59.08 6.37 96.28 57.96 5.95 72.93 53.16 6.04 65.32 46.16 5.96 39.40 30.32 5.81 20.91 19.42 5.65 1 2 0 0.1 0.5 1 MCUSUM 2 0 0.1 0.5 1 2 2.80 1.49 98.05 65.82 6.45 2.77 1.51 98.37 77.67 9.43 2.72 1.49 95.32 63.19 6.74 2.81 1.52 96.79 71.97 9.28 2.78 1.50 82.49 56.78 6.74 2.86 1.49 80.70 65.16 9.21 2.77 1.50 74.87 48.83 6.28 2.78 1.47 67.33 55.17 9.02 2.78 1.56 37.07 33.42 6.07 2.80 1.50 41.52 35.87 8.36 2.75 1.51 22.75 20.51 5.64 2.76 1.55 23.71 21.31 7.45 3.56 3.54 3.54 3.52 3.47 3.45 1.79 1.79 1.78 1.79 1.78 1.77 Solar flare detection We apply our detection procedure on a dataset from the Solar Data Observatory [NASA, Retrieved 7-30-2012]. The data is a video sequence that contains an abrupt emergence of a solar flare occurs around time t = 227. In this video, the normal states are slowly drifting image of sun surface, and the anomaly 14 is a much brighter transient solar flare. A snapshot from this dataset during a solar flare at t = 227 is shown in the Figure 2. Size: 20 x 20 Scan Figure 2: Detection of solar flare at t = 227: (left) snapshot of the original SDO data at t = 227; (right) overlapping image patches for dimensionality reduction. The size of the images is × 292 pixels. After vectoring the image this leads to 67744 dimensional vectors. Due to high dimensionality, It is computationally expensive to directly apply our detection procedure on the original images. Hence, we apply spatial scanning by breaking the original image into overlapping patches of dimension 20 × 20, as demonstrated in the right figure of Figure 2 in the appendix. The detection statistic is calculated for each image patch (of dimension p = 400), and we take the maximum among all patches as the detection statistic. We assume that before the solar flare, the data form a white noise process with no spatial and temporal correlation. The mean and variance of the noise process are estimated by the first 50 samples in the sequence. Online detection is implemented with window length ω = 10. Figure 3(a) and Figure 3(b) plot values of S3 T and the quadratic score statistic on a logarithmic scale, respectively. As we can observe, both statistics obtain peak detection statistics at around t = 227, indicating both statistics can successfully detect the emergence of a solar flare. 5.3 Water quality monitoring In this section, we consider a real-time water quality monitoring example for a sensor network deployed along a complex river system. The goal is to quickly detect contaminant spills that cause pollution of the river. 15 10 15 log S(τ, θ) log W(τ, θ) 8 6 4 2 50 10 5 100 150 200 250 50 300 (a) S3 T 100 150 200 250 300 t t (b) Quadratic score statistic Figure 3: Detection statistics on logarithmic scale. We study the Altamaha River in Georgia, United States. The shape of the river is shown in Figure 4(a). The nodes in the river network represent monitoring locations where concentration data is collected. The contaminant concentration data for such a river network is simulated by the Storm Water Management Model (SWMM) developed by the United States Environmental Protection Agency. SWMM requires geologic, geometric and fundamental hydrodynamics data to construct a river network. Given rainfall information, and the location, intensity, and duration of a contaminant spill, SWMM simulate the contaminant transport process through the river over a period. In the river dynamic simulation systems, rain events bring randomness to the contaminant transport. We use the same data as used in [Telci and Aral, 2011] to generate rain events. The Altamaha River watershed is divided into ten sub-catchments as shown in Figure 4(b). The rainfall measurements are obtained from different United States Geological Survey stations close to these ten sub-catchments in 2006. Based on statistical analysis of these measurements, five rain patterns are generated for each sub-catchment. Each rain pattern describes time-dependent rainfall events and keeps changing hydrologic conditions in each-catchment during the simulation. Note that the rain patterns for each sub-catchment are different and thus there are 510 possible combinations for the entire watershed. Due to the nature of hydrodynamics, there is strong spatial correlation among the concentration data collected at different locations in the river network. However, the shape of the network and direction of the stream impose constraints on modeling such spatial correlation. For example, there should not be correlation for data collected at two locations that do not share a common flowing. A reasonable spatial correlation model is critical here. We adopt the so-called “tail-up” spatial model for stream networks, which 16 i=9 i=8 i=7 i=5 s3 i=6 s2 i=4 i=3 i=2 s1 i=1 Flow (a) (b) (c) Figure 4: Water quality monitoring using sensor network: (a) shape and monitoring locations, (b) ten sub-catchments of the Altamaha River Telci and Aral [2011], and (c) an example of stream network with nine stream segments (i = 1, · · · , 9) and three locations s1 , s2 , s3 . is proposed based on moving average constructions in [Ver Hoef and Peterson, 2010]. The tail-up models have the following desired properties: (i) they use stream distance rather than the Euclidean distance, which is defined as the shortest distance along the stream network between two locations; (ii) statistical independence is imposed on the observations located on stream segments that do not share flowing water; (iii) proper weighting is incorporated on the entries of covariance matrix when the line segments in the network is splitting into multiple segments to ensure that the resulting covariance is stationary. To explain the tail-up models, we first introduce some notations. A stream network consists of a finite number of stream segments and we index them with i = 1, 2, · · · . Denote the index set of stream segment as I, and the locations on the network as sj , j = 1, 2, · · · . Let Dsj ⊆ I be the index set of all stream segments that are downstream of location sj (which means water from sj flows into these segments), including the segment containing sj . Figure 4(c) illustrates a simple stream network with I = {1, 2, · · · , 9}, Ds1 = {1}, Ds2 = {1, 3, 5} and Ds3 = {1, 3, 4, 6}. Two locations, sj and sk are said to be “flow-connected” if Dsj ∩ Dsk = Dsj or Dsk . Finally, define  Bsj ,sk = (Dsj ∩ Dsk ) ∩ (Dsj ∪ Dsk ), if sj and sk are flow-connected; ∅, otherwise. 17 Here Bsj ,sk is the set of stream segments between two locations, including the segment for the upstream location but excluding the one for the downstream location. For example, Bs1 ,s3 = {3, 4, 6} and Bs2 ,s3 = ∅. To ensure the stationarity of the variances, Ver Hoef and Peterson [2010] suggests assigning weights to each stream segments in the network. In a stream network, one segment splits into two segments when it goes up-stream. For example, segment 1 splits into segments 2 and 3 in Figure 4(c). One way to weight the segments is based on the flow volume of each segments. For example, we weight segments 2 and 3 by w2 and w3 , where w2 + w3 = 1 and w2 /w3 is equal to the ratio of the flow volume between segments 2 and 3. Using tail-up models, the covariance between two locations, sj and sk on the stream network is given by  if sj and sk are not flow-connected;  0, ζ1 , C(sj , sk |ζ) =  if sj = sk , √  Q w ζ ρ d(s , s )/ζ i 1 j k 2 , otherwise; i∈Bsj ,sk (24) where d(sj , sk ) is the stream distance between sj and sk , ζ1 is the variance parameter, ρ(·|ζ2 ) is the correlation function with parameter ζ2 , and wi is the weights on segment i. The correlation function ρ(·|ζ2 ) can be derived from many commonly used spatial models that we have discussed in Section 2. For illustration, consider the example in Figure 4(c). If an exponential model is used for spatial correlation, the covariance matrix of s1 , s2 and s3 can be constructed based on (24) as follows,     √ √ ζ0 + ζ1 ζ1 e−d(s1 ,s2 )/ζ2 ζ1 e−d(s1 ,s3 )/ζ2 w3 w5 w3 w4 w6 1  √ w3 w5   ζ1 e−d(s1 ,s2 )/ζ2 1 0 ζ0 + ζ1 ζ1 e−d(s2 ,s3 )/ζ2  , √ −d(s1 ,s3 )/ζ2 −d(s2 ,s3 )/ζ2 w3 w4 w6 0 1 ζ1 e ζ1 e ζ0 + ζ1 where denotes the Hadamard (element-wise) product operation between two matrices. In our case study, we use the tail-up model with exponential correlation function to model the data collected at different nodes on the Altamaha river network. The spatial covariance matrix for p = 100 nodes on the river network are constructed based on the stream distance and flow volume information. We use SWMM to generate in-control data and obtain the maximum likelihood estimator of the parameters in the model, ζ̂1 = 0.027 and ζ̂2 = 0.68. The covariance matrix is illustrated in Figure 5. For temporal correlation, we use a VAR(1) model x` = µx + θx`−1 + ` , where θ ∈ R 18 to capture the temporal correlation of a contaminant spill as suggested by Clement and Thas [2007], Clement et al. [2006]. Figure 5: (a) Visualization of the spatial covariance matrix using the tail-up model for 100 sensor network over the river system; the spatial covariance matrix has a block structure, with blocks in the matrix correspond to the branches of the river with matching colors in (b), and (c): nodes indexes of the Altamaha river network and potential spill locations marked by red stars. We apply the online change-point detection procedure based on S3 T to detect contaminant spills in the Altamaha river network. We also compare it with two other methods: (i) online detection based on the quadratic score statistic, and (ii) the Hotelling’s T 2 chart. Among the 100 nodes on the river network, 10 of them (nodes 1, 15, 19, 33, 36, 50, 58, 67, 84, 95, marked by red stars in Figure 5(c)) are used as possible contaminant spill locations, and the rest 90 nodes are used for collecting measurements every 15 minutes. In each replication, we run SWMM to simulate the river network during a 10-day period. A single instantaneous spill with a spill location randomly selected from the ten possible locations is generated. The spill starting time is uniformly distributed between the first 15 to 20 hours. The intensity of the contaminant spills follows uniform distribution, and we consider three different levels: U(10, 100) (low), U(100, 250) (medium), and U(250, 500) (high) in units of gram/liter. The thresholds for the three detection procedures are adjusted so that the in-control ARLs are 10 days (960 samples). For the two procedures based on S3 T and the quadratic score statistic, the length of the sliding window is chosen as 12.5 hours (50 samples). Table 3 reports the average and standard error of detection delays obtained from 100 simulated spills. For spills with high intensity, all three methods achieve similar performance in terms of detection delay, as strong signals are easier 19 to be detected. However, when the signal is relatively weak (low and medium spill intensity), the proposed detection statistic S3 T significantly outperforms the other two methods. Table 3: Simulated expected detection delay in hours (Numbers in parentheses are standard errors). spill intensity low medium high 6 S3 T Quadratic score statistic T2 38.285 (3.655) 26.301 (1.679) 25.519 (1.697) 45.822 (4.675) 28.522 (1.873) 25.489 (1.667) 52.959 (5.035) 30.753 (2.192) 25.563 (1.860) Conclusions In this paper, we propose a novel efficient score statistic S3 T to detect the emergence of a spatial-temporal signal from a noisy background. The statistic is able to jointly capture the spatial and temporal correlation and enjoys relatively low computational cost. An accurate approximation for its probability of a false alarm is presented. Numerical results on a simulated vector time series model and real applications show that the proposed statistic has a clear advantage when the signal is weak. Acknowledgement The work is partially supported by NSF CMMI-1538746. References Seong-Hee Kim, Mustafa M Aral, Yongsoon Eun, Jisu J Park, and Chuljin Park. Impact of sensor measurement error on sensor positioning in water quality monitoring networks. Stochastic Environmental Research and Risk Assessment, 31(3):743–756, 2017. John D Healy. A note on multivariate cusum procedures. Technometrics, 29 (4):409–412, 1987. 20 Ronald B Crosier. Multivariate generalizations of cumulative sum qualitycontrol schemes. Technometrics, 30(3):291–303, 1988. Wei Jiang, Sung Won Han, Kwok-Leung Tsui, and William H Woodall. Spatiotemporal surveillance methods in the presence of spatial correlation. Statistics in Medicine, 30(5):569–583, 2011. Mi Lim Lee, David Goldsman, Seong-Hee Kim, and Kwok-Leung Tsui. Spatiotemporal biosurveillance with spatial clusters: control limit approximation and impact of spatial correlation. IIE Transactions, 46(8):813–827, 2014. Mi Lim Lee, David Goldsman, and Seong-Hee Kim. Robust distribution-free multivariate cusum charts for spatiotemporal biosurveillance in the presence of spatial correlation. IIE Transactions on Healthcare Systems Engineering, 5(2):74–88, 2015. Yao Xie and David Siegmund. Spectrum opportunity detection with weak and correlated signals. In 2012 Conference Record of the Forty Sixth Asilomar Conference on Signals, Systems and Computers (ASILOMAR), pages 128–132. IEEE, 2012. C Radhakrishna Rao and S Janardhan Poti. On locally most powerful tests when alternatives are one sided. Sankhyā: The Indian Journal of Statistics, pages 439–439, 1946. Peter J. Brockwell and Richard A. Davis. Time Series: Theory and Methods. Springer-Verlag New York, 1987. Carlo Gaetan and Xavier Guyon. Spatial Statistics and Modeling. Springer, New York, 2010. Brian D Ripley. Spatial statistics, volume 575. John Wiley & Sons, 2005. Marc G. Genton. Separable approximations of space-time covariance matrices. Environmetrics, 18(7):681–695, 2007. ISSN 1099-095X. doi: 10.1002/env. 854. URL http://dx.doi.org/10.1002/env.854. C. Radhakrishna Rao. Large sample tests of statistical hypotheses concerning several parameters with applications to problems of estimation. Mathematical Proceedings of the Cambridge Philosophical Society, 44(1):50–57, 1948. doi: 10.1017/S0305004100023987. 21 D. Siegmund and B. Yakir. The statistics of gene mapping. Springer, 2007. David Siegmund. Sequential analysis: tests and confidence intervals. Springer Science & Business Media, 2013. Benjamin Yakir. Extremes in random fields: A theory and its applications. John Wiley & Sons, 2013. W. A. Shewart. Economic control of quality of manufactured product. 1931. David Siegmund and ES Venkatraman. Using the generalized likelihood ratio statistic for sequential detection of a change-point. The Annals of Statistics, pages 255–271, 1995. David Siegmund and Benjamin Yakir. Detecting the emergence of a signal in a noisy image. Statistics and Its Inference, 1:3–12, 2008. Harold Hotelling. Multivariate quality control. Techniques of statistical analysis, 1947. NASA. SDO instruments, Retrieved 7-30-2012. Ilker T Telci and Mustafa M Aral. Contaminant source location identification in river networks using water quality monitoring systems for exposure analysis. Water Quality, Exposure and Health, 2(3-4):205–218, 2011. Jay M Ver Hoef and Erin E Peterson. A moving average approach for spatial statistical models of stream networks. Journal of the American Statistical Association, 105(489):6–18, 2010. L. Clement and O. Thas. Estimating and modeling spatio-temporal correlation structures for river monitoring networks. Journal of Agricultural, Biological, and Environmental Statistics, 12(2):161, Jun 2007. ISSN 15372693. doi: 10.1198/108571107X197977. URL https://doi.org/10.1198/ 108571107X197977. L. Clement, O. Thas, P.A. Vanrolleghem, and J.P. Ottoy. Spatio-temporal statistical models for river monitoring networks. Water Science and Technology, 53(1):9–15, 2006. ISSN 0273-1223. doi: 10.2166/wst.2006.002. URL http://wst.iwaponline.com/content/53/1/9. 22 David Siegmund. Approximate tail probabilities for the maxima of some random fields. The Annals of Probability, pages 487–501, 1988. Hyune-Ju Kim and David Siegmund. The likelihood ratio test for a changepoint in simple linear regression. Biometrika, pages 409–423, 1989. Appendix A: Derivation of ∂` ∂µ µ=0,γ=0 . The following propositions are used in the derivation of ∂` . ∂µ µ=0,γ=0 Proposition 3. Let M (t) be a nonsingular square matrix whose elements are functions of a scalar parameter α. Then, ∂M (t)−1 ∂M (t) = −M (t)−1 M (t)−1 . ∂α ∂α Proposition 4. Let M (t) be a nonsingular square matrix whose elements are functions of a scalar parameter α. Then,   ∂|M (t)| −1 ∂M (t) = |M (t)|tr M (t) . ∂α ∂α By Proposition 3, we can calculate, log γVτ (θ) + Στ ∂γ   1 γVτ (θ) + Στ tr (γVτ (θ) + Στ )−1 Vτ (θ) γVτ (θ) + Στ  = tr Σ−1 V (θ) . τ τ = µ=0,γ=0 γ=0 For convenience, here we use y and µ to denote y(k+1:N ) and µ(k+1:N ) . By Proposition 4, we have, ∂(y − µ)| (γVτ (θ) + Στ )−1 (y − µ) ∂γ = (y − µ)| µ=0,γ=0 ∂(γVτ (θ) + Στ )−1 (y − µ) ∂γ µ=0,γ=0 = −y | (γVτ (θ) + Στ )−1 Vτ (θ)(γVτ (θ) + Στ )−1 y γ=0 = −y 23 | −1 Σ−1 τ Vτ (θ)Στ y. Hence we have, ∂` ∂µ µ=0,γ=0  1 | −1 1 V (θ) + y Στ Vτ (θ)Σ−1 = − tr Σ−1 τ τ y, τ 2 2 as appeared in equation (8). Appendix B: Derivation of Equation (17). Here we present the derivation of the cumulant generating function of W (τ, θ) under the null hypothesis, i.e. equation (17).  −1 Let z = Στ 2 y(k+1:N ) . Under the null hypothesis, z ∼ N 0, Ipτ . For −1 −1 convenience, here we use B to denote the pτ by pτ matrix Στ 2 Vτ (θ)Στ 2 , and use c and d to denote c(τ, θ) and d(τ, θ), respectively. Then, we have W (τ, θ) = z | Bz − c √ . d Under the null hypothesis, the cumulant generating function of W (τ, θ) can be calculated as h   z | Bz − c i √ ψ(ξ) = log E[exp(ξW (τ, θ))] = log E exp ξ d h  ξz | Bz i c √ = −ξ √ + log E exp d d Z  1  ξz | Bz  1  c | √ = −ξ √ + log exp exp − z z dz pτ 2 (2π) 2 d d z Z  1  c 1 2ξB   | √ z dz = −ξ √ + log exp − z I − pτ pτ 2 d d z (2π) 2 1 − c 2ξB 2 , = −ξ √ + log Ipτ − √ d d which is equivalent to equation (17). Note that the last equation uses the fact that Z  1  1 2ξB   2ξB − 12 | √ √ exp − z I − z dz = I − . pτ pτ pτ 2 d d z (2π) 2 24 Appendix C: Proof of Theorem 1 After discretizing the parameter space, W (τ, θ) can be treated as a twodimensional Gaussian random field, which can be completely characterized by its covariance function. The following lemma computes the covariance function of W (τ, θ). Lemma 5. Under the null hypothesis, the covariance function of W (τ, θ) is  tr An (θ1 )An (θ2 ) Cov[W (n, θ1 ), W (m, θ2 )] = h  i1/2 , tr An (θ1 )An (θ1 ) tr Am (θ2 )Am (θ2 ) (25) where n ≤ m. The following lemma shows that the first order approximation of the covariance function in (25) does not have any cross product term. Thus, the two-dimensional random field is further decomposed as a sum of two independent one-dimensional random processes. Lemma 6. Assuming that δ and i ∈ Z are small relative to θ and τ , respectively, the first order approximation of the covariance function in (25) is given as, Cov[W (τ, θ), W (τ + i, θ + δ)] ≈ 1 − γ 2 (τ, θ)δ 2 − where µ(τ, θ) i + o(δ 2 ) + o(i), 2τ (26)  tr Ȧτ (θ)Aτ (θ) , γ(τ, θ) = tr Aτ (θ)Aτ (θ) (27) µ(τ, θ) is defined in (14), and Ȧτ (θ) = ∂Aτ (θ)/∂θ. The following two Lemmas are needed in the proof. Both Lemmas are proved in Xie and Siegmund [2012]. ξ b Lemma 7. Assume ξ → ∞, b → ∞, N → ∞, with h b ≈ 1 and N ≈ c,where i c > 0 is some constant. The discretized process b W τ + i, θ + √∆N j − ξ , where i is an integer and j ≥ 0, conditioned on W (τ, θ) = ξ can be written as a sum of two independent processes:  h   i ∆  b W τ + i, θ + √ j − ξ W (τ, θ) = ξ = Si + Vj , N 25 where Si = Pi l=1 a` with  a` ∼ N and  µ(τ, θ) 2 µ(τ, θ) 2 − b, b , 2τ τ √ b2 b 2γ(τ, θ) √ ∆jV − γ 2 (τ, θ) ∆2 j 2 , N N with V ∼ N (0, 1). µ(τ, θ) and γ(τ, θ) are defined in (14) and (27), respectively. Vj = 2 Lemma 8. Assume x1 , x2 , · · · are i.i.d. N (−µ P1i, σ1 ) random variables (µ1 > 0). Define the random walk S0 = 0, Si = l=1 xl , i = 1, 2, · · · , and the 2 smooth varying random process Vj = β∆jV − β2 ∆2 j 2 , for some constants ∆ > 0, β > 0. As ∆ → 0, for some constant α, we have         Z |β| 2µ21 2µ1 1 ∞ −αx ∆→0 e P max Si ≤ −x P max Si + max Vj ≤ −x dx −−−→ √ ν , i≥1 i≤0 j≥1 ∆ 0 σ1 2π σ12 where ν(x) is defined in (13). In the following, we go through the main steps that lead to the approximation of the false alarm rate in Theorem 1 for the case of d = 1. Step 1: We first discretize the parameter θ ∈ [θ1 , θ2 ] by a rectangular mesh grid of size √∆N , where ∆ > 0 is a small number. Note that the discretization mentioned here is used for asymptotic analysis only. The probability of false alarm can be approximated as    ∆  ≥b , (28) P max W i, j √ (i,j)∈D N where D is the index set n o ∆ √ D = (i, j) : 1 ≤ i ≤ N, θ1 ≤ j ≤ θ2 , N which covers the entire parameter space. Let J(i0 , j0 ) denote everything to the “future” of the current index (i0 , j0 ) in the parameter space, i.e., J(i0 , j0 ) = {(i, j) ∈ D : j ≥ j0 , or i ≥ i0 and j = j0 }. n   Using the similar approach as in (Siegmund [1988]), the event max(i,j)∈D W i, j √∆N ≥ o b can be decomposed into a series of “last hitting events”, for which (i0 , j0 ) 26   is the “last” location where W i, j √∆N hits the threshold b. Then, the prob  ability in (28) can be written as the sum of probabilities of W i, j √∆N last hits b at (i0 , j0 ) over all possible (i0 , j0 ):       X ∆  ∆  ∆  max W i, j √ ≥b ≈ ≥ b, max W i, j √ <b P W i0 , j0 √ (i,j)∈D (i,j)∈J(i0 ,j0 ) N N N (i0 ,j0 )∈D Z  ∞  X ∆  x = P W i0 , j0 √ =b+ b N (i0 ,j0 )∈D 0    ∆  ∆  x  dx ·P max W i, j √ < b W i0 , j0 √ =b+ . (i,j)∈J(i0 ,j0 ) b b N N (29) Step 2: In the following, we obtain an approximation on the probabil  x dx ∆ √ ity P W i0 , j0 N = b + b b . To simplify the notation, we denote   W i0 , j0 √∆N as W here. The key idea is to approximate W as a Gaussian random field. The Gaussian approximation performs well when the probability of interest is close to the mean of the true distribution, but suffers from deviation if the probability is in the tail of the true distribution. Hence, we apply the change-of-measure technique to shift the mean of the random field W to the threshold b. Denote the cumulant generating function of W as ψ(ξ) = log E[exp(ξW )]. To construct the new probability measure, we first choose a ξ0 > 0 such that ψ 0 (ξ) = b. The new probability measure dFξ0 is constructed using exponential embedding, as follows  dFξ0 = exp ξ0 W − ψ(ξ0 ) dF,  P where dF is the original distribution of W . Let Eξ0 and Pξ0 denote the expectation and probability under the new measure dFξ0 , respectively. It can be verified that under the new measure   ∂eψ(ξ) Eξ0 [W ] = E W exp ξ0 W − ψ(ξ0 ) = e−ψ(ξ0 ) ∂ξ = ψ 0 (ξ) = b, ξ=ξ0 namely, the mean of W is close to the threshold b under the new probability measure. 27 The threshold crossing probability can be rewritten as    x 1 x P W =b+ = Eξ0 1{ W = b + } b exp[ξ0 W − ψ(ξ0 )] b (30) h  x i  x = exp ψ(ξ0 ) − ξ0 b + Pξ 0 W = b + . b b   Now we can apply the Gaussian approximation to obtain Pξ0 W = b + xb and use (30) to get the original probability. By treating W as a normal random variable with mean b and variance σξ20 , we have    1 −x2 1 x =√ exp ≈√ . Pξ0 W = b + 2 2 b 2b σξ0 2πσξ0 2πσξ0 Note that in (29), the integrands with smaller x values contribute more to the integration, since the integrand decays exponentially  fast with x. Now, when b → ∞, x b → 0 for small x, and hence exp −x2 2b2 σξ2 → 1. The above 0 argument is similar to those used for Laplace’s method. The cumulant generating function of W can be calculated as  1/2 1/2 tr Σ−1 V (θ) 2ξΣτ Vτ (θ)Στ 1 τ τ ψ(ξ) = −ξ h log I − − pτ h i1/2 2 i1/2 . −1 −1 −1 −1 2tr Στ Vτ (θ)Στ Vτ (θ) 2tr Στ Vτ (θ)Στ Vτ (θ) Hence ξ0 can be obtained by solving the following equation numerically, h  1 2ξ0 Bτ (θ) i−1 p tr Ipτ − p Bτ (θ) − Aτ (θ) = b. d(τ, θ) d(τ, θ) Eventually, we have    ξ    x ∆  0 ≈ g i0 , j0 exp − x , P W i0 , j0 √ =b+ b b N (31) where g() follows the definition in (16).    Step 3: Next we tackle with the conditional probability P max(i,j)∈J(i0 ,j0 ) W i, j √∆N <    ∆ x √ b W i0 , j0 N = b + b . The first order expansion of the covariance function given by Lemma 6 does not have any cross product term, which implies that 28 if we approximate W (τ, θ) as a Gaussian random field, it can be decomposed as a sum of two independent one dimensional random processes. By Lemma 7, the conditional probability can be written in terms of the decomposed random processes using the techniques in Siegmund [1988] and Kim and Siegmund [1989] as follows,  P   ∆  x ∆  < b W i0 , j0 √ =b+ max W i, j √ (i,j)∈J(i0 ,j0 ) b N     N     ∆ ∆  x ∆ − W i0 , j0 √ ≤ −x W i0 , j0 √ =b+ =P max b W i, j √ (i,j)∈J(i0 ,j0 ) b N N N     ≈ P max Si ≤ −x P max Si + max Vj ≤ −x . i≥1 i≤0 j≥1 (32) (4) Combine the approximations in (31) and (32), the approximated false alarm rate becomes,   ∆  ≥b max W i, j √ (i,j)∈D N √ Z  ξ  X  ∆  ∆ N ∞ 0 √ ≈ g i0 , j0 √ exp − x b N N ∆b 0 (i0 ,j0 )∈D     · P max Si ≤ −x P max Si + max Vj ≤ −x dx.  P i≥1 i≤0 (33) j≥1 Lemma 8 enables us to find an expression√for the integration in (33). b2 and Finally, by Lemma 8 with α = ξb0 , β = 2γ(τ, θ) √bN , µ1 = µ(τ,θ) 2τ σ12 = µ(τ,θ) 2 b, τ we have the approximated significance level   2 ∆ 1 ∆ b µ(i0 , j0 √N ) √ g i0 , j0 √ ·ν N − i0 2 π N (i0 ,j0 )∈D s b2 µ(i0 , j0 √∆N ) !   ∆ ∆ √ . γ i0 , j0 √ N − i0 N N (34) As ∆ → 0, the Riemann sum (34) converges to the approximation in Theorem 1. X 29 Appendix D: Proof of Lemma 5. −1 Proof. Let Cτ (θ) = Σ−1 τ Vτ (θ)Στ , and rewrite Cm (θ2 ) as,   C11 (θ2 ) C12 (θ2 ) Cm (θ2 ) = . C21 (θ2 ) Cn (θ2 ) Denote y(T −τ +1:T ) as Yτ , and let   Y Ym = ∆ . Yn We have, E[Yn| Cn (θ1 )Yn Ym| Cm (θ2 )Ym ] − E[Yn| Cn (θ1 )Yn ]E[Ym| Cm (θ2 )Ym ] . 2(tr{An (θ1 )An (θ1 )}tr{Am (θ2 )Am (θ2 )})1/2 (35) The first term in the numerator is, Cov[W (n, θ1 ), W (m, θ2 )] = E[Yn| Cn (θ1 )Yn Ym| Cm (θ2 )Ym ] = E[(Yn| Cn (θ1 )Yn )(Y∆| C11 (θ2 )Y∆ + Yn| Cn (θ2 )Yn + Yn| C21 (θ2 )Y∆ + Y∆| C12 (θ2 )Yn )] = E[Yn| Cn (θ1 )Yn Yn| Cn (θ2 )Yn ] + E[Yn| Cn (θ1 )Yn ]E[Y∆| C11 (θ1 )Y∆ ] = 2tr{An (θ1 )An (θ2 )} + tr{An (θ1 )}tr{An (θ2 )} + E[Yn| Cn (θ1 )Yn ]E[Y∆| C11 (θ1 )Y∆ ]. (36) Note that we have utilized the fact that under null hypothesis, Y∆ and Yn are independent and E[Y∆ ] = 0. The second term in the numerator is, E[Yn| Cn (θ1 )Yn ]E[Ym| Cm (θ2 )Ym ] = E[Yn| Cn (θ1 )Yn ]E[Y∆| C11 (θ2 )Y∆ + Yn| Cn (θ2 )Yn + Yn| C21 (θ2 )Y∆ + Y∆| C12 (θ2 )Yn ] = E[Yn| Cn (θ1 )Yn ]E[Yn| Cn (θ2 )Yn ] + E[Yn| Cn (θ1 )Yn ]E[Y∆| C11 (θ1 )Y∆ ] = tr{An (θ1 )}tr{An (θ2 )} + E[Yn| Cn (θ1 )Yn ]E[Y∆| C11 (θ1 )Y∆ ]. (37) By combining (35), (36), (37), we obtain the covariance function in Lamma 5. 30 Appendix E: Proof of Lemma 6. Proof. We approximate the covariance function by expanding each term in (25) at θ and keeping only the first order terms. The numerator in (25) is approximated as,    tr Aτ (θ + δ)Aτ (θ) ≈ tr Aτ (θ)Aτ (θ) + δtr Ȧτ (θ)Aτ (θ)  (38) = tr Aτ (θ)Aτ (θ) (1 + δγ(τ, θ)). Partition the matrix Aτ +i (θ + δ) as the follows,   A11 (θ + δ) A12 (θ + δ) Aτ +i (θ + δ) = . A21 (θ + δ) Aτ (θ + δ) Then rewrite the second term in the denominator in (25) as,  tr Aτ +i (θ + δ)Aτ +i (θ + δ)   = tr A11 (θ + δ)A11 (θ + δ) + tr A12 (θ + δ)A21 (θ + δ)   + tr A21 (θ + δ)A12 (θ + δ) + tr Aτ (θ + δ)Aτ (θ + δ) . After expanding each term at θ, the denominator in (25) can be approximated as, h √  i1/2 √ tr Aτ (θ)Aτ (θ) tr Aτ +i (θ+δ)Aτ +i (θ+δ) ≈ tr Aτ (θ)Aτ (θ) 1 + 2δa 1 + b, (39) where     tr Ȧ11 (θ)A11 (θ) + tr Ȧ12 (θ)A21 (θ) + tr Ȧ21 (θ)A12 (θ) + tr Ȧτ (θ)Aτ (θ)    , a= tr A11 (θ)A11 (θ) + tr A12 (θ)A21 (θ) + tr A21 (θ)A12 (θ) + tr Aτ (θ)Aτ (θ) (40) and    1 tr Aτ +i (θ)Aτ +i (θ) − tr Aτ (θ)Aτ (θ) 2i 2iτ  . (41) b= 1 τ tr A (θ)A (θ) τ τ 2 τ  As i and δ are small compared to τ and θ, the terms tr Ȧ (θ)A (θ) and τ τ  tr Aτ (θ)Aτ (θ) are relatively larger than the subdiagonal elements in (40), and hence, a can be further approximated as,  tr Ȧτ (θ)Aτ (θ) . a≈ (42) tr Aτ (θ)Aτ (θ) 31    1 tr Aτ +i (θ)A Meanwhile, we approximate the term τ +i (θ) −tr Aτ (θ)Aτ (θ) iτ   in (41) using τ1 tr Aτ +1 (θ)Aτ +1 (θ) − tr Aτ (θ)Aτ (θ) , and then we have, b≈ i µ(τ, θ). τ (43) The argument for the above approximation is as follows. First note that −1 Aτ +i (θ) = Σ−1 τ +i Vτ +i (θ) = (Iτ +i ⊗ Σ) (Rτ +i (θ) ⊗ Λ) = Rτ +i (θ) ⊗ (Σ−1 Λ). Then we have,   tr Aτ +i (θ)Aτ +i (θ) = tr (Rτ +i (θ) ⊗ (Σ−1 Λ))(Rτ +i (θ) ⊗ (Σ−1 Λ))  = tr (Rτ +i (θ)Rτ +i (θ)) ⊗ (Σ−1 ΛΣ−1 Λ)   = tr Rτ +i (θ)Rτ +i (θ) tr Σ−1 ΛΣ−1 Λ XX = tr Σ−1 ΛΣ−1 Λ [Rτ +i (θ)]2jk j k ! = tr Σ−1 ΛΣ−1 Λ  X XX [Rτ +1 (θ)]2jk + [Rτ +1 (θ)]2jk i j |j−k|>τ k ! ≈ tr Σ−1 ΛΣ−1 Λ  i XX [Rτ +1 (θ)]2jk . j k The last approximation is due to the fact that (j, k)th element of Rτ +1 (θ) such that |j − k| > τ is small. 1 Combining (38), (39), (42) (43) and the Taylor expansion √1+x ≈ 1− 1 x + o(x), we obtain the approximation in (26). 2 32
10math.ST
1 Convolutional Recurrent Neural Networks for Dynamic MR Image Reconstruction arXiv:1712.01751v2 [cs.CV] 26 Jan 2018 Chen Qin*† , Jo Schlemper*, Jose Caballero, Anthony N. Price, Joseph V. Hajnal and Daniel Rueckert Fellow, IEEE In order to accelerate MRI acquisition, most approaches consider undersampling the data in k-space (frequency domain). Due to the violation of the Nyquist sampling theorem, undersampling introduces aliasing artefacts in the image domain. Images can be subsequently reconstructed by solving an optimisation problem that regularises the solution with assumptions on the underlying data, such as smoothness, sparsity or, for the case of dynamic imaging, spatio-temporal redundancy. Past literature has shown that exploiting spatiotemporal redundancy can greatly improve image reconstruction quality compared to compressed sensing (CS) based single frame reconstruction methods [1], [2]. However, the limitations of these optimisation based approaches are the following: firstly, it is non-trivial to propose an optimisation function without introducing significant bias on the considered data. In addition, the manual adjustments of hyperparameters are nontrivial. Secondly, these optimisation problems often involve highly nonlinear, non-convex terms. As a consequence, the majority of approaches resort on iterative algorithms to reconstruct the images, in which often neither attaining the global minimum nor convergence to a solution is guaranteed. Furthermore, the reconstruction speeds of these methods are often slow. Proposing a robust iterative algorithm is still an active area of Index Terms—Recurrent neural network, convolutional neural research. network, dynamic magnetic resonance imaging, cardiac image In comparison, deep learning methods are gaining popularity reconstruction for their accuracy and efficiency. Unlike traditional approaches, the prior information and regularisation are learnt implicitly from data, allowing the reconstruction to look more natural. I. I NTRODUCTION However, the limitation is that so far only a handful of AGNETIC Resonance Imaging (MRI) is a non-invasive approaches exist [3], [4] for dynamic reconstruction. Hence, the imaging technique which offers excellent spatial reso- applicability of deep learning models to this problem is yet to be lution and soft tissue contrast and is widely used for clinical fully explored. In particular, a core question is how to optimally diagnosis and research. Dynamic MRI attempts to reveal both exploit spatio-temporal redundancy. In addition, most deep spatial and temporal profiles of the underlying anatomy, which learning methods do not exploit domain-specific knowledge, has a variety of applications such as cardiovascular imaging which potentially enables the networks to efficiently learn data and perfusion imaging. However, the acquisition speed is representation by regulating the mechanics of network layers, fundamentally limited due to both hardware and physiological hence boosting their performances. constraints as well as the requirement to satisfy the Nyquist In this work, we propose a novel convolutional recurrent sampling rate. Long acquisition times are not only a burden neural network (CRNN) method to reconstruct high quality for patients but also make MRI susceptible to motion artefacts. dynamic MR image sequences from undersampled data, termed CRNN-MRI, which aims to tackle the aforementioned prob† Corresponding author: Chen Qin. (Email address: [email protected]) lems of both traditional and deep learning methods. Firstly, *These authors contributed equally to this work. we formulate a general optimisation problem for solving C. Qin, J. Schlemper, J. Caballero and D. Rueckert are with the Biomedical Image Analysis Group, Department of Computing, Imperial College London, accelerated dynamic MRI based on variable splitting and SW7 2AZ London, UK. alternate minimisation. We then show how this algorithm J. V. Hajnal, and A. N. Price are with with the Division of Imaging Sciences and Biomedical Engineering Department, King’s College London, St. Thomas’ can be seen as a network architecture. In particular, the Hospital, SE1 7EH London, U.K. proposed method consists of a CRNN block which acts as the Abstract—Accelerating the data acquisition of dynamic magnetic resonance imaging (MRI) leads to a challenging ill-posed inverse problem, which has received great interest from both the signal processing and machine learning communities over the last decades. The key ingredient to the problem is how to exploit the temporal correlations of the MR sequence to resolve aliasing artefacts. Traditionally, such observation led to a formulation of a non-convex optimisation problem, which was solved using iterative algorithms. Recently, however, deep learning based-approaches have gained significant popularity due to their ability to solve general inverse problems. In this work, we propose a unique, novel convolutional recurrent neural network (CRNN) architecture which reconstructs high quality cardiac MR images from highly undersampled k-space data by jointly exploiting the dependencies of the temporal sequences as well as the iterative nature of the traditional optimisation algorithms. In particular, the proposed architecture embeds the structure of the traditional iterative algorithms, efficiently modelling the recurrence of the iterative reconstruction stages by using recurrent hidden connections over such iterations. In addition, spatio-temporal dependencies are simultaneously learnt by exploiting bidirectional recurrent hidden connections across time sequences. The proposed method is able to learn both the temporal dependency and the iterative reconstruction process effectively with only a very small number of parameters, while outperforming current MR reconstruction methods in terms of computational complexity, reconstruction accuracy and speed. M 2 proximal operator and a data consistency layer corresponding Furthermore, these methods are not able to exploit the prior to the classical data fidelity term. In addition, the CRNN knowledge that can be learnt from the vast number of MRI block employs recurrent connections across each iteration step, exams routinely performed, which should be helpful to further allowing reconstruction information to be shared across the guide the reconstruction process. multiple iterations of the process. Secondly, we incorporate Recently, deep learning-based MR reconstruction has gained bidirectional convolutional recurrent units evolving over time popularity due to its promising results for solving inverse and to exploit the temporal dependency of the dynamic sequences compressed sensing problems. In particular, two paradigms and effectively propagate the contextual information across have emerged: the first class of approaches proposes to use time frames of the input. As a consequence, the unique CRNN convolutional neural networks (CNNs) to learn an end-to-end architecture jointly learns representations in a recurrent fashion mapping, where architectures such as SRCNN [10] or U-net evolving over both time sequences as well as iterations of the [11] are often chosen for MR image reconstruction [12], [13], reconstruction process, effectively combining the benefits of [14], [15]. The second class of approaches attempts to make traditional iterative methods and deep learning. each stage of iterative optimisation learnable by unrolling the To the best of our knowledge, this is the first work applying end-to-end pipeline into a deep network [9], [16], [17], [18], RNNs for dynamic MRI reconstruction. The contributions of [19]. For instance, Hammernik et al. [9] introduced a trainable this work are the following: Firstly, we view the optimisation formulation for accelerated parallel imaging (PI) based MRI problem of dynamic data as a recurrent network and describe reconstruction termed variational network, which embedded a a novel CRNN architecture which simultaneously incorporates CS concept within a deep learning approach. ADMM-Net [17] the recurrent relationship of data over time and iterations. was proposed by reformulating an alternating direction method Secondly, we demonstrate that the proposed method shows of multipliers (ADMM) algorithm to a deep network, where promising results and improves upon the current state-of-the-art each stage of the architecture corresponds to an iteration in dynamic MR reconstruction methods both in reconstruction the ADMM algorithm. More recently, Schlemper et al. [18] accuracy and speed. Finally, we compare our architecture to 3D proposed a cascade network which simulated the iterative CNN which does not impose the recurrent structure. We show reconstruction of dictionary learning-based methods and were that the proposed method outperforms the CNN at different later extended for dynamic MR reconstructions [3]. Most undersampling rates and speed, while requiring significantly approaches so far have focused on 2D images, whereas only a few approaches exist for dynamic MR reconstruction [3], [4]. fewer parameters. While they show promising results, the optimal architecture, training scheme and configuration spaces are yet to be fully II. R ELATED W ORK explored. One of the main challenges associated with recovering an More recently, several ideas were proposed, which integrate uncorrupted image is that both the undersampling strategy deep neural networks with model-based optimisation methods and a-priori knowledge of appropriate properties of the image to solve inverse problems [20], [21]. In contrast to these papers, need to be taken into account. Methods like k-t BLAST and which proposed to deal with a fidelity term and a regularisation k-t SENSE [5] take advantage of a-priori information about term separately, we integrate the two terms in a single deep the x-f support obtained from the training data set in order network, so that the network can be trained end-to-end. In to prune a reconstruction to optimally reduce aliasing. An addition, as we will show, we integrate a hidden connection alternative popular approach is to exploit temporal redundancy over the optimisation iteration to enable the information used to unravel from the aliasing by using CS approaches [1], [6] or for the reconstruction at each iteration to be shared across all CS combined with low-rank approaches [2], [7]. The class of stages of the reconstruction process, aiming for an iterative methods which employ CS to the MRI reconstruction is termed algorithm that can fully benefit from information extracted at as CS-MRI [8]. They assume that the image to be reconstructed all processing stages. As to the nature of the proposed RNN has a sparse representation in a certain transform domain, and units, previous work involving RNNs only updated the hidden they need to balance sparsity in the transform domain against state of the recurrent connection with a fixed input [22], [23], consistency with the acquired undersampled k-space data. For [24], while the proposed architecture progressively updates instance, an example of successful methods enforcing sparsity the input as the optimisation iteration increases. In addition, in x-f domain is k-t FOCUSS [1]. A low rank and sparse previous work only modelled the recurrence of iteration or time reconstruction scheme (k-t SLR) [2] introduces non-convex [25] exclusively, whereas the proposed method jointly exploits spectral norms and uses a spatio-temporal total variation norm both dimensions, yielding a unique architecture suitable for in recovering the dynamic signal matrix. Dictionary learning the dynamic reconstruction problem. approaches were also proposed to train an over-complete basis of atoms to optimally sparsify spatio-temporal data [6]. These III. C ONVOLUTIONAL R ECURRENT N EURAL N ETWORK methods offer great potential for accelerated imaging, however, FOR MRI RECONSTRUCTION they often impose strong assumptions on the underlying data, requiring nontrivial manual adjustments of hyperparameters A. Problem Formulation depending on the application. In addition, it has been observed Let x ∈ CD denote a sequence of complex-valued MR that these methods tend to result in blocky [9] and unnatural images to be reconstructed, represented as a vector with reconstructions, and their reconstruction speed is often slow. D = Dx Dy T , and let y ∈ CM (M << D) represent the 3 undersampled k-space measurements, where Dx and Dy are width and height of the frame respectively and T stands for the number of frames. Our problem is to reconstruct x from y, which is commonly formulated as an unconstrained optimisation problem of the form: argmin R(x) + λky − Fu xk22 x (1) Here Fu is an undersampling Fourier encoding matrix, R expresses regularisation terms on x and λ allows the adjustment of data fidelity based on the noise level of the acquired measurements y. For CS and low-rank based approaches, the regularisation terms R often employed are `0 or `1 norms in the sparsifying domain of x as well as the rank or nuclear norm of x respectively. In general, Eq. 1 is a non-convex function and hence, the variable splitting technique is usually adopted to decouple the fidelity term and the regularisation term. By introducing an auxiliary variable z that is constrained to be equal to x, Eq. 1 can be reformulated to minimize the following cost function via the penalty method: argmin R(z) + λky − Fu xk22 + µkx − zk22 (2) individually parameterise each step. In our formulation, we model each optimisation stage (i) as a learnt, recurrent, forward encoding step fi (x(i−1) , z(i−1) ; θ, y, λ, Ω). The difference is that now we use one model which performs proximal operator, however, it also allows itself to propagate information across iteration, making it adaptable for the changes across the optimisation steps. The detail will be discussed in the following section. The different strategies are illustrated in Fig 1. B. CRNN for MRI reconstruction RNN is a class of neural networks that makes use of sequential information to process sequences of inputs. They maintain an internal state of the network acting as a "memory", which allows RNNs to naturally lend themselves to the processing of sequential data. Inspired by iterative optimisation schemes of Eq. 3, we propose a novel convolutional RNN (CRNN) network. In the most general scope, our neural encoding model is defined as follows, xrec = fN (fN −1 (· · · (f1 (xu )))), (5) x,z where µ is a penalty parameter. By applying alternate minimisation over x and z, Eq. 2 can be solved via the following iterative procedures: z(i+1) = argmin R(z) + µkx(i) − zk22 (3a) x(i+1) = argmin λky − Fu xk22 + µkx − z(i+1) k22 (3b) z in which xrec denotes the prediction of the network, xu is the sequence of undersampled images with length T and also the input of the network, fi (xu ; θ, λ, Ω) is the network function for each iteration of optimisation step, and N is the number of iterations. We can compactly represent a single iteration fi of our network as follows: x where x(0) = xu = FH u y is the zero-filled reconstruction taken as an initialisation and z can be seen as an intermediate state of the optimisation process. For MRI reconstruction, Eq. 3b is often regarded as a data consistency (DC) step where we can obtain the following closed-form solution [18]: (i−1) x(i) + CRNN(x(i−1) rnn = xrec rec ), x(i) rec = DC(x(i) rnn ; y, λ0 , Ω), (6a) (6b) where CRNN is a learnable block explained hereafter, DC (i) is the data consistency step treated as a network layer, xrec is the progressive reconstruction of the undersampled image λ0 H (i) H (i) (0) (i) x(i+1) = xu at iteration i with xrec = xu , xrnn is the intermediate ( DC(z ; y, λ0 , Ω) = F ΛFz + 1+λ0 Fu y, reconstruction image before the DC layer, and y is the 1 if k 6∈ Ω Λkk = 1 acquired k-space samples. Note that the variables xrec , xrnn are if k ∈ Ω 1+λ0 (4) analogous to x, z in Eq. 3 respectively. Here, we use CRNN in which F is the full Fourier encoding matrix (a discrete to encode the update step, which can be seen as one step Fourier transform in this case), λ0 = λ/µ is a ratio of of a gradient descent in the sense of objective minimisation, regularization parameters from Eq. 4, Ω is an index set of the or a more general approximation function regressing the (i+1) − x(i) , i.e. the distance required to move acquired k-space samples and Λ is a diagonal matrix. Please difference z refer to [18] for more details of formulating Eq. 4 as a data to the next state. Moreover, note that in every iteration, consistency layer in a neural network. Eq. 3a is the proximal CRNN updates its internal state H given an input which is operator of the prior R, and instead of explicitly determining discussed shortly. As such, CRNN also allows information to the form of the regularisation term, we propose to directly be propagated efficiently across iterations, in contrast to the learn the proximal operator by using a convolutional recurrent sequential models using CNNs which collapse the intermediate feature representation to z(i) . neural network (CRNN). In order to exploit the dynamic nature and the temporal Previous deep learning approaches such as Deep-ADMM net [17] and method proposed by Schlemper et al. [18] unroll the redundancy of our data, we further propose to jointly model the traditional optimisation algorithm. Hence, their models learn a recurrence evolving over time for dynamic MRI reconstruction. sequence of transition x(0) → z(1) → x(1) → · · · → z(N ) → The proposed CRNN-MRI network and CRNN block are shown x(N ) to reconstruct the image, where each state transition at in Fig. 2(a), in which CRNN block comprised of 5 components: stage (i) is an operation such as convolutions independently 1) bidirectional convolutional recurrent units evolving over parameterised by θ, nonlinearities or a data consistency step. time and iterations (BCRNN-t-i), However, since the network implicitly learns some form of 2) convolutional recurrent units evolving over iterations only proximal operator at each iteration, it may be redundant to (CRNN-i), 4 (a) Traditional Optimisation (c) CRNN-MRI (𝑖) argmin (𝑖) 𝑥𝑟𝑒𝑐 CRNN 𝑥𝑟𝑒𝑐 𝐳 ⨁ 𝐳 DC 𝑖 DC 𝑖 𝐳 (b) CNN (0) 𝑥𝑟𝑒𝑐 CNN(1) 𝐳 1 DC (𝑖−1) … CNN(i) 𝑥𝑟𝑒𝑐 𝐳 𝑖 DC Fig. 1: (a) Traditional optimisation algorithm using variable splitting and alternate minimisation approach, (b) the optimisation unrolled into a deep convolutional network incorporating the data consistency step, and (c) the proposed architecture which models optimisation recurrence. 1 𝑖 𝐱 𝑟𝑒𝑐 (a) CRNN-MRI Ω DC ⨁ k-space samples 𝐱 𝑟𝑒𝑐 2 𝐱 𝑟𝑒𝑐 DC DC DC ⨁ ⨁ ⨁ (1) 𝐇5 (2) 𝐇5 𝐇5 Unfolding (iteration) (1) 𝐇4 (1) 𝐇3 (1) 𝐇2 (1) 𝐇𝟏 𝐇4 CRNN 𝑁 𝐱 𝑟𝑒𝑐 (b) (2) (N) Layer 5 (CNN) (N) Layer 4 (CRNN-i) (N) Layer 3 (CRNN-i) (N) Layer 2 (CRNN-i) (N) Layer 1 (BCRNN-t-i) 𝐇4 .. CNN 𝐇3 (2) 𝐇3 .. CRNN-i 𝐇2 (2) 𝐇2 .. CRNN-i 𝐇1 (2) 𝐇1 CRNN-i 𝐱 𝑟𝑒𝑐 𝐇𝑙,𝑡−1) 𝐇𝑙,𝑡 𝑖 (c) 𝑖−1 𝐱 𝑟𝑒𝑐 Feed-forward convolution Recurrent convolution (iteration) Recurrent convolution (time) 1 𝐱𝑢 BCRNN-t-i 𝑖 𝑖 … 𝐇 𝑙,𝑡−1 … 𝐇𝑙,𝑡−1 𝑖−1 𝑖−1 𝐇𝑙,𝑡 𝑖 𝐇𝑙,𝑡+1 𝑖 𝑖−1 … 𝐇 𝑙,𝑡+1 … 𝑖 𝐇𝑙,𝑡 𝐇𝑙,𝑡+1 𝐇𝑙 𝑖 𝑖 𝐇 𝑙,𝑡 𝑖 𝐇𝑙,𝑡−1 𝑁−1 𝐱 𝑟𝑒𝑐 𝐇𝑙,𝑡+1 𝑖 𝐇𝑙−1, 𝑡−1 𝑖 𝐇𝑙−1,𝑡 𝑖 𝐇𝑙 𝐇𝑙 𝑖 𝑖 𝑖 𝐇𝑙−1, 𝑡+1 Fig. 2: (a) The overall architecture of proposed CRNN-MRI network for MRI reconstruction. (b) The structure of the proposed (0) network when unfolded over iterations, in which xrec = xu . (c) The structure of BCRNN-t-i layer when unfolded over the time sequence. The black arrows indicate feed-forward convolutions. The blue arrows and red arrows indicate recurrent convolutions over iterations and the time sequence respectively. 3) 2D convolutional neural network (CNN), 4) residual connection and 5) DC layers. We introduce details of the components of our network in the following subsections. 1) CRNN-i: As aforementioned, we encapsulate the iterative optimisation procedures explicitly with RNNs. In the CRNNi unit, the iteration step is viewed as the sequential step in the vanilla RNN. If the network is unfolded over the iteration dimension, the network can be illustrated as in Fig. 2(b), where information is propagated between iterations. Here we use H to denote the feature representation of our sequence of frames (i) throughout the network. Hl denotes the representation at layer l (subscript) and iteration step i (superscript). Therefore, at (i−1) iteration (i), given the input Hl−1 and the previous iteration’s (i−1) (i) hidden state Hl , the hidden state Hl at layer l of a CRNNi unit can be formulated as: (i) (i) (i−1) Hl = σ(Wl ∗ Hl−1 + Wi ∗ Hl + Bl ). (7) Here ∗ represents convolution operation, Wl and Wi represent the filters of input-to-hidden convolutions and hiddento-hidden recurrent convolutions evolving over iterations 5 (i) respectively, and Bl represents a bias term. Here Hl is backward direction. Therefore, for the formulation of BCRNNthe representation of the whole T sequence with shape t-i unit, given (1) the current input representation of the l-th (batchsize, T, nc , Dx , Dy ), where nc is the number of channels layer at time frame t and iteration step i, which is the output which is 2 at the input and output but is greater while processing representation from (l − 1)-th layer H(i) l−1,t , (2) the previous inside the network, and the convolutions are computed on the iteration’s hidden representation within the same layer H(i−1) , l,t → − (i) last two dimensions. The latent features are activated by the (3) the hidden representation of the past time frame H l,t−1 , and rectifier linear unit (ReLU) as a choice of nonlinearity, i.e. ← −(i) the hidden representation of the future time frame H l,t+1 , then σ(x) = max(0, x). of the current l-th layer of time The CRNN-i unit offers several advantages compared to the hidden state representation (i) frame t at iteration i, H with shape (batchsize, nc , Dx , Dy ), l,t independently unrolling convolutional filters at each stage. can be formulated as: Firstly, compared to CNNs where the latent representation − →(i) − → − → (i) (i−1) from the previous state is not propagated, the hidden-to-hidden H l,t = σ(Wl ∗ Hl−1,t + Wt ∗ H il,t−1 + Wi ∗ Hl,t + B l ), ← −(i) ← −(i) ← − iteration connections in CRNN-i units allow contextual spatial (i) (i−1) H l,t = σ(Wl ∗ Hl−1,t + Wt ∗ H l,t+1 + Wi ∗ Hl,t + B l ), information gathered at previous iterations to be passed to the − →(i) ← −(i) (i) Hl,t = H l,t + H l,t , future iterations. This enables the reconstruction step at each (8) iteration to be optimised not only based on the output image Similar to the notation in Section III-B1, W represents the t but also based on the hidden features from previous iterations, evolving over time. When where the hidden connection convolutions can "memorise" the filters of recurrent convolutions (1) l = 1 and i = 1, H = x , that is the t-th frame of u t 0,t useful features to avoid redundant computation. Secondly, as undersampled input data, and when l = 1 and i = 2, ...T , the iteration number increases, the effective receptive field of a (i) (i−1) H = x , which stands for the t-th frame of the rec t 0,t CRNN-i unit in the spatial domain also expands whereas CNN intermediate reconstruction result from iteration i − 1. For resets it at each iteration. This property allows the network to − (i) ← −(i) (0) → H , and , they are set to be zero initial hidden H H l,t l,0 l,T +1 further improve the reconstruction by allowing it to have better states. contextual support. In addition, since the weight parameters The temporal connections of BCRNN-t-i allow information are shared across iterations, it greatly reduces the number to be propagated across the whole T time frames, enabling it to of parameters compared to CNNs, potentially offering better learn the differences and correlations of successive frames. The generalization properties. filter responses of recurrent convolutions evolving over time In this work, we use a vanilla RNN to model the recurrence express dynamic changing biases, which focus on modelling due to its simplicity. Note this can be naturally generalised the temporal changes across frames, while the filter responses to other RNN units, such as long short-term memory (LSTM) of recurrent convolutions over iterations focus on learning the and gated recurrent unit (GRU), which are considered to have spatial refinement across consecutive iteration steps. In addition, better memory properties, although using these units would we note that learning recurrent layers along the temporal significantly increase computational complexity. direction is different to using 3D convolution along the space 2) BCRNN-t-i: Dynamic MR images exhibit high temporal and temporal direction. 3D convolution seeks invariant features redundancy, which is often exploited as a-priori knowledge to across space-time, hence several layers of 3D convolutions are regularise the reconstruction. Hence, it is also beneficial for the required before the information from the whole sequence can network to learn the dynamics of sequences. To this extent, we be propagated to a particular time frame. On the other hand, propose a bidirectional convolutional recurrent unit (BCRNN- learning recurrent 2D convolutions enables the model to easily t-i) to exploit both temporal and iteration dependencies jointly. and efficiently propagate the information through time, which BCRNN-t-i includes three convolution layers: one on the input also yields fewer parameters and a lower computational cost. which comes into the unit from the previous layer, one on In summary, the set of hidden states for a CRNN block −(i) → − (i) the hidden state from the past and future time frames and (i) (i) ← to update at iteration i is H = {Hl , Hl,t , H l,t , H l,t }, for the one on the hidden state from the previous iteration of l = 1, . . . , L and t = 1, . . . , T , where L is the total number of the unit (Fig. 2(c)). Note that we simultaneously consider layers in the CRNN block and T is the total number of time temporal dependencies from past and future time frames, and frames. the encoding weights are shared for both directions. The output for the BCRNN-t-i layer is obtained by summing the feature maps learned from both directions. The illustration figure of C. Network Learning the unit when it is unfolded over time sequence is shown in Given the training data S of input-target pairs (xu , xt ), the Fig. 2(c). network learning proceeds by minimizing the pixel-wise mean As we need to propagate information along temporal squared error (MSE) between the predicted reconstructed MR dimensions in this unit, here we introduce an additional index t image and the fully sampled ground truth data: in the notation to represent the variables related with time frame X 1 2 (i) L (θ) = kxt − xrec k2 (9) t. Here Hl,t represents feature representations at l-th layer, n S → − (i) (xu ,xt )∈S time frame t, and at iteration i, H l,t denotes the representations calculated when information is propagated forward inside the where θ = {Wl , Wi , Wt , Bl }, l = 1 . . . L, and nS stands ← −(i) BCRNN-t-i unit, and similarly, H l,t denotes the one in the for the number of samples in the training set S. Note that 6 the total number of time sequences T and iteration steps N assumed by the network before performing the reconstruction is a free parameter that must be specified in advance. The network weights were initialised using He initialization [26] and it was trained using the Adam optimiser [27]. During training, gradients were hard-clipped to the range of [−5, 5] to mitigate the gradient explosion problem. The network was implemented in Python using Theano and Lasagne libraries. aliasing artefact. The evaluation was done via a 3-fold cross validation. The minibatch size during the training was set to 1, and we observed that the performance can reach a plateau within 6 × 104 backpropagations. B. Evaluation Method We compared the proposed method with the representative algorithms of the CS-based dynamic MRI reconstruction, such as k-t FOCUSS [1] and k-t SLR [2], and two variants of IV. E XPERIMENTS 3D CNN networks named 3D CNN-S and 3D CNN in our experiments. The built baseline 3D CNN networks share the A. Dataset and Implementation Details same architecture with the proposed CRNN-MRI network but The proposed method was evaluated using a complexall the recurrent units and 2D CNN units were replaced with valued MR dataset consisting of 10 fully sampled short-axis 3D convolutional units, that is, in each iteration, the 3D CNN cardiac cine MR scans. Each scan contains a single slice block contain 5 layers of 3D convolutions, one DC layer and a SSFP acquisition with 30 temporal frames, which have a residual connection. Here 3D CNN-S refers to network sharing 320 × 320 mm field of view and 10 mm thickness. The weights across iterations, however, this does not employ the raw data consists of 32-channel data with sampling matrix hidden-to-hidden connection as in the CRNN-i unit. The 3D size 192 × 190, which was then zero-filled to the matrix size CNN-S architecture was chosen so as to make a fair comparison 256 × 256. The raw multi-coil data was reconstructed using with the proposed model using a comparable number of network SENSE [28] with no undersampling and retrospective gating. parameters. In contrast, 3D CNN refers to the network without Coil sensitivity maps were normalized to a body coil image weight sharing, in which the network capacity is N = 10 times and used to produce a single complex-valued reconstructed of that of 3D CNN-S, and approximately 12 times more than image. In experiments, the complex valued images were backthat of our first proposed method (Proposed-A). transformed to regenerate k-space samples, simulating a fully Reconstruction results were evaluated based on the followsampled single-coil acquisition. The input undersampled image ing quantitative metrics: MSE, peak-to-noise-ratio (PSNR), sequences were generated by randomly undersampling the structural similarity index (SSIM) [29] and high frequency k-space samples using Cartesian undersampling masks, with error norm (HFEN) [30]. The choice of the these metrics was undersampling patterns adopted from [1]: for each frame the made to evaluate the reconstruction results with complimentary eight lowest spatial frequencies were acquired, and the sampling emphasis. MSE and PSNR were chosen to evaluate the overall probability of k-space lines along the phase-encoding direction accuracy of the reconstruction quality. SSIM put emphasis was determined by a zero-mean Gaussian distribution. Note on image quality perception. HFEN was used to quantify the that the undersampling rates are stated with respect to the quality of the fine features and edges in the reconstructions, matrix size of raw data, which is 192 × 190. and here we employed the same filter specification as in [30], The architecture of the proposed network used in the [31] with the filter kernel size 15 × 15 pixels and a standard experiment is shown in Fig. 2: each iteration of the CRNN deviation of 1.5 pixels. For PSNR and SSIM, it is the higher block contains five units: one layer of BCRNN-t-i, followed the better, while for MSE and HFEN, it is the lower the better. by three layers of CRNN-i units, and followed by a CNN unit. For all CRNN-i and BCRNN-t-i units, we used a kernel size k = 3 and the number of filters was set to nf = 64 for C. Results Proposed-A and nf = 128 for Proposed-B in Table I. The CNN The comparison results of all methods are reported in Table I, after the CRNN-i units contains one convolution layer with where we evaluated the quantitative metrics, network capacity k = 3 and nf = 2, which projects the extracted representation and reconstruction time. Numbers shown in Table I are mean back to the image domain which contains complex-valued values of corresponding metrics with standard deviation of images expressed using two channels. The output of the CRNN different subjects in parenthesis. Bold numbers in Table I block is connected to the residual connection, which sums indicate the better performance of the proposed methods than the output of the block with its input. Finally, we used DC the competing ones. Compared with the baseline method (k-t layers on top of the CRNN output layers. During training, the FOCUSS and k-t SLR), the proposed methods outperform them iteration step is set to be N = 10, and the time sequence by a considerable margin at different acceleration rates. When for training is T = 30. Note that this architecture is by no compared with deep learning methods, note that the network means optimal and more layers can be added to increase the capacity of Proposed-A is comparable with that of 3D CNN-S ability of our network to better capture the data structures. and the capacity of Propose-B is around one third of that of 3D While the original sequence has size 256 × 256 × T , we extract CNN. Though their capacities are much smaller, both Proposedpatches of size 256 × Dpatch × T , where Dpatch is the patch A and Proposed-B outperform 3D CNN-S and 3D CNN for size and the direction of patch extraction corresponds to the all acceleration rates by a large margin, which shows the frequency-encoding direction. Note that since we only consider competitiveness and effectiveness of our method. In addition, Cartesian undersampling, the aliasing occurs only along the we can see a substantial improvement of the reconstruction phase encoding direction, so patch extraction does not alter the results on all acceleration rates and in all metrics when the 7 TABLE I: Performance comparisons (MSE, PSNR:dB, SSIM, and HFEN) on dynamic cardiac data with different acceleration rates. MSE is scaled to 10−3 . The bold numbers are better results of the proposed methods than that of the other methods. Method k-t FOCUSS k-t SLR 3D CNN-S 3D CNN Proposed-A Proposed-B - - 338,946 3,389,460 262,020 1,040,132 6× MSE PSNR SSIM HFEN 0.592 (0.199) 32.506 (1.516) 0.953 (0.040) 0.211 (0.021) 0.371( 0.155) 34.632 (1.761) 0.970 (0.033) 0.161 (0.016) 0.385 (0.124) 34.370 (1.526) 0.976 (0.008) 0.170 (0.009) 0.275 (0.096) 35.841 (1.470) 0.983 (0.005) 0.138 (0.013) 0.261 (0.097) 36.096 (1.539) 0.985 (0.004) 0.131 (0.013) 0.201 (0.074) 37.230 (1.559) 0.988 (0.003) 0.112 (0.010) 9× MSE PSNR SSIM HFEN 1.234 (0.801) 29.721 (2.339) 0.922 (0.043) 0.310(0.041) 0.846 (0.572) 31.409 (2.404) 0.951 (0.025) 0.260 (0.034) 0.929 (0.474) 30.838 (2.246) 0.950 (0.016) 0.280 (0.034) 0.605 (0.324) 32.694 (2.179) 0.968 (0.010) 0.215 (0.021) 0.516 (0.255) 33.281 (1.912) 0.972 (0.009) 0.201 (0.025) 0.405 (0.206) 33.379 (2.017) 0.979 (0.007) 0.173 (0.021) 11× MSE PSNR SSIM HFEN 1.909 (0.828) 27.593 (2.038) 0.880 (0.060) 0.390 (0.023) 1.237 (0.620) 29.577 (2.211) 0.924 (0.034) 0.327 (0.028) 1.472 (0.733) 28.803 (2.151) 0.925 (0.022) 0.363 (0.041) 0.742 (0.325) 31.695 (1.985) 0.960 (0.010) 0.257 (0.029) 0.688 (0.290) 31.986 (1.885) 0.964 (0.009) 0.248 (0.033) 0.610 (0.300) 32.575 (1.987) 0.968 (0.011) 0.227 (0.030) 15s 451s 8s 8s 3s 6s Capacity Time images and their corresponding error maps from different reconstruction methods. As one can see, our proposed model (Proposed-B) can produce more faithful reconstructions for those parts of the image around the myocardium where there are large temporal changes. This is reflected by the fact that RNNs effectively use a larger receptive field to capture the characteristics of aliasing seen within the anatomy. For the 3D CNN approaches, it is also observed that it is not able to denoise the background region. This could be explained by the fact that 3D CNN only exploits local information due to the small filter sizes it used, while in contrast, the proposed CRNN improves the denoising of the background region because of its larger receptive field sizes. Their temporal profiles at x = 120 are shown in Fig. 5. Similarly, one can see that the proposed model has overall much smaller error, faithfully modelling the dynamic data. This suggests its capability to learn motion Fig. 3: Mean PSNR values (Proposed-B) vary with the number compensation implicitly between frames although the network of iterations at test time on data with different acceleration is trained for the dynamic image reconstruction. It could be rates. Here ac stands for acceleration rate. due to the fact that spatial and temporal features are learned separately in the proposed model while 3D CNN seeks invariant feature learning across space and time. number of network parameters is increased for the proposed In terms of speed, the proposed RNN-based reconstruction method (Proposed-B), and therefore we will only show the is faster than the 3D CNN approaches because it only results from Proposed-B in the following. The number of performs convolution along time once per iteration, removing iterations used by the network at test time is set to be the the redundant 3D convolutions which are computationally same as the training stage, which is N = 10, however, if expensive. Reconstruction time of 3D CNN and the proposed the iteration number is increased up to N = 17, it shows an methods reported in Table I were calculated on a GPU GeForce improvement of 0.324dB on average. Fig. 3 shows the model’s GTX 1080, and the time for k-t FOCUSS and k-t SLR were performance varying with the number of iterations at test time. calculated on CPU. In fact, for accelerated imaging, higher undersampling factors significantly add aliasing to the initial zero-filled reconstruction, V. D ISCUSSION AND CONCLUSION making the reconstruction more challenging. This suggests that while the 3D CNN possesses higher modelling capacity owing In this work, we have demonstrated that the presented to its large number of parameters, it may not necessarily be network is capable of producing faithful image reconstructions an ideal architecture to perform dynamic MR reconstruction, from highly undersampled data, both in terms of various presumably because the simple CNN is not as efficient as quantitative metrics as well as inspection of error maps. propagating the information across the whole sequence. In contrast to unrolled deep network architectures proposed A comparison of the visualization results of a reconstruction previously, we modelled the recurrent nature of the optimisation from 9× acceleration is shown in Fig. 4 with the reconstructed iteration using hidden representations with the ability to 8 Fig. 4: The comparison of reconstructions on spatial dimension with their error maps. (a) Ground Truth (b) Undersampled image by acceleration factor 9 (c,d) Proposed-B (e,f) 3D CNN (g,h) 3D CNN-S (i,j) k-t FOCUSS (k,l) k-t SLR Additionally, current analysis only considers a single coil setup. In the future, we will also aim at investigating such methods in a scenario where multiple coil data from parallel MR imaging can be used jointly for higher acceleration acquisition. To conclude, inspired by variable splitting and alternate minimisation strategies, we have presented an end-to-end deep learning solution, CRNN-MRI, for accelerated dynamic MRI reconstruction, with a forward, CRNN block implicitly learning iterative denoising interleaved by data consistency layers to Fig. 5: The comparison of reconstructions along temporal enforce data fidelity. In particular, the CRNN architecture is dimension with their error maps. (a) Ground Truth (b) Under- composed of the proposed novel variants of convolutional sampled image by acceleration factor 9 (c,d) Proposed-B (e,f) recurrent unit which evolves over two dimensions: time and iterations. The proposed network is able to learn both the 3D CNN (g,h) 3D CNN-S (i,j) k-t FOCUSS (k,l) k-t SLR temporal dependency and the iterative reconstruction process effectively, and outperformed the other competing methods in retain and propagate information across the optimisation steps. terms of computational complexity, reconstruction accuracy Compared with 3D CNN models, the proposed methods have a and speed for different undersampling rates. much lower network capacity but still have a higher accuracy, reflecting the effectiveness of our architecture. This is due to R EFERENCES the ability of the proposed RNN units to increase the receptive [1] H. Jung, J. C. Ye, and E. Y. Kim, “Improved k–t BLAST and k–t SENSE field size while iteration steps increase, as well as to efficiently using FOCUSS,” Physics in medicine and biology, vol. 52, no. 11, p. propagate information across the temporal direction. In addition, 3201, 2007. our network also offers very fast reconstruction on a GPU [2] S. G. Lingala, Y. Hu, E. Dibella, and M. Jacob, “Accelerated dynamic MRI exploiting sparsity and low-rank structure: K-t SLR,” IEEE GeForce GTX 1080 compared with other competing methods. Transactions on Medical Imaging, vol. 30, no. 5, pp. 1042–1054, 2011. In this work, we modeled the recurrence using the relatively [3] J. Schlemper, J. Caballero, J. V. Hajnal, A. Price, and D. Rueckert, “A simple (vanilla) RNN architecture. For the future work, we will deep cascade of convolutional neural networks for dynamic MR image reconstruction,” arXiv preprint arXiv:1704.02422, 2017. explore other recurrent units such as LSTM or GRU. As they are [4] D. Batenkov, Y. Romano, and M. Elad, “On the global-local dichotomy trained to explicitly select what to remember, they may allow in sparsity modeling,” arXiv preprint arXiv:1702.03446, 2017. the units to better control the flow of information and could [5] J. Tsao, P. Boesiger, and K. P. Pruessmann, “k-t BLAST and k-t SENSE: Dynamic MRI with high frame rate exploiting spatiotemporal reduce the number of iterations required for the network to correlations,” Magnetic Resonance in Medicine, vol. 50, no. 5, pp. 1031– generate high-quality output. In addition, we have found that the 1042, 2003. majority of errors between the reconstructed image and the fully [6] J. Caballero, A. N. Price, D. Rueckert, and J. V. Hajnal, “Dictionary learning and time sparsity for dynamic MR data reconstruction,” IEEE sampled image lie at the part where motion exists, indicating Transactions on Medical Imaging, vol. 33, no. 4, pp. 979–994, 2014. that motion exhibits a challenge for such dynamic sequence [7] R. Otazo, E. Candès, and D. K. Sodickson, “Low-rank plus sparse reconstruction, and CNNs or RNNs trained for reconstruction matrix decomposition for accelerated dynamic MRI with separation of background and dynamic components,” Magnetic Resonance in Medicine, loss cannot fully learn such motion compensation implicitly vol. 73, no. 3, pp. 1125–1136, 2015. during training. Thus it will be interesting to explore the [8] M. Lustig, D. L. Donoho, J. M. Santos, and J. M. Pauly, “Compressed benefits of doing simultaneous motion compensation and image sensing mri,” IEEE signal processing magazine, vol. 25, no. 2, pp. 72–82, reconstruction for the improvement in the dynamic region. 2008. 9 [9] K. Hammernik, T. Klatzer, E. Kobler, M. P. Recht, D. K. Sodickson, T. Pock, and F. Knoll, “Learning a variational network for reconstruction of accelerated MRI data,” arXiv preprint arXiv:1704.00447, 2017. [10] C. Dong, C. C. Loy, K. He, and X. Tang, “Learning a deep convolutional network for image super-resolution,” in European Conference on Computer Vision. Springer, 2014, pp. 184–199. [11] O. Ronneberger, P. Fischer, and T. Brox, “U-Net: Convolutional Networks for Biomedical Image Segmentation,” Medical Image Computing and Computer-Assisted Intervention, pp. 234–241, 2015. [12] D. Lee, J. Yoo, and J. C. Ye, “Deep artifact learning for compressed sensing and parallel MRI,” arXiv preprint arXiv:1703.01120, 2017. [13] Y. S. Han, J. Yoo, and J. C. Ye, “Deep learning with domain adaptation for accelerated projection reconstruction MR,” arXiv preprint arXiv:1703.01135, 2017. [14] S. Wang, Z. Su, L. Ying, X. Peng, and D. Liang, “Exploiting deep convolutional neural network for fast magnetic resonance imaging,” in ISMRM 24th Annual Meeting and Exhibition, 2016. [15] S. Wang, N. Huang, T. Zhao, Y. Yang, L. Ying, and D. Liang, “1D Partial Fourier Parallel MR imaging with deep convolutional neural network,” in ISMRM 25th Annual Meeting and Exhibition, vol. 47, no. 6, 2017, pp. 2016–2017. [16] J. Adler and O. Öktem, “Learned primal-dual reconstruction,” arXiv preprint arXiv:1707.06474, 2017. [17] J. Sun, H. Li, Z. Xu et al., “Deep ADMM-Net for compressive sensing mri,” in Advances in Neural Information Processing Systems, 2016, pp. 10–18. [18] J. Schlemper, J. Caballero, J. V. Hajnal, A. Price, and D. Rueckert, “A deep cascade of convolutional neural networks for MR image reconstruction,” arXiv preprint arXiv:1703.00555, 2017. [19] J. Adler and O. Öktem, “Solving ill-posed inverse problems using iterative deep neural networks,” arXiv preprint arXiv:1704.04058, 2017. [20] K. Zhang, W. Zuo, S. Gu, and L. Zhang, “Learning deep cnn denoiser prior for image restoration,” arXiv preprint arXiv:1704.03264, 2017. [21] J. Chang, C.-L. Li, B. Póczos, B. Kumar, and A. C. Sankaranarayanan, “One network to solve them all—solving linear inverse problems using deep projection models,” arXiv preprint arXiv:1703.09912, 2017. [22] K. Gregor, I. Danihelka, A. Graves, D. Rezende, and D. Wierstra, “Draw: A recurrent neural network for image generation,” in Proceedings of The 32nd International Conference on Machine Learning, 2015, pp. 1462–1471. [23] M. Liang and X. Hu, “Recurrent convolutional neural network for object recognition,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 3367–3375. [24] J. Kuen, Z. Wang, and G. Wang, “Recurrent attentional networks for saliency detection,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 3668–3677. [25] Y. Huang, W. Wang, and L. Wang, “Bidirectional recurrent convolutional networks for multi-frame super-resolution,” in Advances in Neural Information Processing Systems, 2015, pp. 235–243. [26] K. He, X. Zhang, S. Ren, and J. Sun, “Delving deep into rectifiers: Surpassing human-level performance on imagenet classification,” in Proceedings of the IEEE international conference on computer vision, 2015, pp. 1026–1034. [27] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. [28] K. P. Pruessmann, M. Weiger, M. B. Scheidegger, P. Boesiger et al., “SENSE: sensitivity encoding for fast MRI,” Magnetic resonance in medicine, vol. 42, no. 5, pp. 952–962, 1999. [29] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, “Image quality assessment: from error visibility to structural similarity,” IEEE transactions on image processing, vol. 13, no. 4, pp. 600–612, 2004. [30] S. Ravishankar and Y. Bresler, “Mr image reconstruction from highly undersampled k-space data by dictionary learning,” IEEE transactions on medical imaging, vol. 30, no. 5, pp. 1028–1041, 2011. [31] X. Miao, S. G. Lingala, Y. Guo, T. Jao, M. Usman, C. Prieto, and K. S. Nayak, “Accelerated cardiac cine mri using locally low rank and finite difference constraints,” Magnetic resonance imaging, vol. 34, no. 6, pp. 707–714, 2016.
1cs.CV
Adversarial and Clean Data Are Not Twins Zhitao Gong 1 Wenlu Wang 1 Wei-Shinn Ku 1 arXiv:1704.04960v1 [cs.LG] 17 Apr 2017 Abstract Adversarial attack has cast a shadow on the massive success of deep neural networks. Despite being almost visually identical to the clean data, the adversarial images can fool deep neural networks into wrong predictions with very high confidence. In this paper, however, we show that we can build a simple binary classifier separating the adversarial apart from the clean data with accuracy over 99%. We also empirically show that the binary classifier is robust to a secondround adversarial attack. In other words, it is difficult to disguise adversarial samples to bypass the binary classifier. Further more, we empirically investigate the generalization limitation which lingers on all current defensive methods, including the binary classifier approach. And we hypothesize that this is the result of intrinsic property of adversarial crafting algorithms. 1. Introduction Deep neural networks have been successfully adopted to many life critical areas, e.g., skin cancer detection (Esteva et al., 2017), auto-driving (Santana & Hotz, 2016), traffic sign classification (CireşAn et al., 2012), etc. A recent study (Szegedy et al., 2013), however, discovered that deep neural networks are susceptible to adversarial images. Figure 1 shows an example of adversarial images generated via fast gradient sign method (Kurakin et al., 2016; Kurakin et al., 2016) on MNIST. As we can see that although the adversarial and original clean images are almost identical from the perspective of human beings, the deep neural network 1 Auburn University, Auburn, AL. Correspondence to: Zhitao Gong <[email protected]>. will produce wrong predictions with very high confidence. Similar techniques can easily fool the image system into mistaking a stop sign for a yield sign, a dog for a automobile, for example. When leveraged by malicious users, these adversarial images pose a great threat to the deep neural network systems. Although adversarial and clean images appear visually indiscernible, their subtle differences can successfully fool the deep neural networks. This means that deep neural networks are sensitive to these subtle differences. So an intuitively question to ask is: can we leverage these subtle differences to distinguish between adversarial and clean images? Our experiment suggests the answer is positive. In this paper we demonstrate that a simple binary classifier can separate the adversarial from the original clean images with very high accuracy (over 99%). However, we also show that the binary classifier approach suffers from the generalization limitation, i.e., it is sensitive 1) to a hyper-parameter used in crafting adversarial dataset, and 2) to different adversarial crafting algorithms. In addition to that, we also discovered that this limitation is also shared among other proposed methods against adversarial attacking, e.g., defensive retraining (Huang et al., 2015; Kurakin et al., 2016), knowledge distillation (Papernot et al., 2015b), etc. We empirically investigate the limitation and propose the hypothesis that the adversarial and original dataset are, in effect, two completely different datasets, despite being visually similar. This article is organized as follows. In Section 2, we give an overview of the current research in adversarial attack and defense, with a focus on deep neural networks. Then, it is followed by a brief summary of the state-of-the-art adversarial crafting algorithms in Section 3. Section 4 presents our experiment results and detailed discussions. And we conclude in Section 5. Adversarial and Clean Data Are Not Twins 0 (1.00) 1 (1.00) 2 (1.00) 3 (1.00) 4 (1.00) 5 (1.00) 6 (1.00) 7 (1.00) 8 (1.00) 9 (1.00) 2 (1.00) 2 (1.00) 7 (1.00) 5 (1.00) 9 (1.00) 9 (1.00) 5 (1.00) 3 (1.00) 9 (1.00) 7 (1.00) Figure 1. The adversarial images (second row) are generated from the first row via iterative FGSM. The label of each image is shown below with prediction probability in parenthesis. Our model achieves less then 1% error rate on the clean data. 2. Related Work The adversarial image attack on deep neural networks was first investigated in (Szegedy et al., 2013). The authors discovered that when added some imperceptible carefully chosen noise, an image may be wrongly classified with high confidence by a well-trained deep neural network. They also proposed an adversarial crafting algorithm based on optimization. We will briefly summarize it in section 3. They also proposed the hypothesis that the adversarial samples exist as a result of the high nonlinearity of deep neural network models. However, (Goodfellow et al., 2014) proposed a counter-intuitive hypothesis explaining the cause of adversarial samples. They argued that adversarial samples are caused by the models being too linear, rather than nonlinear. They proposed two adversarial crafting algorithms based on this hypothesis, i.e., fast gradient sign method (FGSM) and least-likely class method (LLCM) (Goodfellow et al., 2014). The least-likely class method is later generalized to target class gradient sign method (TGSM) in (Kurakin et al., 2016). (Papernot et al., 2015a) proposed another gradient based adversarial algorithm, the Jacobian-based saliency map approach (JSMA) which can successfully alter the label of an image to any desired category. The adversarial images have been shown to be transferable among deep neural networks (Szegedy et al., 2013; Kurakin et al., 2016). This poses a great threat to current learning systems in that the attacker needs not the knowledge of the target system. Instead, the attacker can train a different model to create adversar- ial samples which are still effective for the target deep neural networks. What’s worse, (Papernot et al., 2016) has shown that adversarial samples are even transferable among different machine learning techniques, e.g., deep neural networks, support vector machine, decision tree, logistic regression, etc. Small steps have been made towards the defense of adversarial images. (Kurakin et al., 2016) shows that some image transformations, e.g., Gaussian noise, Gaussian filter, JPEG compression, etc., can effectively recover over 80% of the adversarial images. However, in our experiment, the image transformation defense does not perform well on images with low resolution, e.g., MNIST. Knowledge distillation is also shown to be an effective method against most adversarial images (Papernot et al., 2015b). The restrictions of defensive knowledge distillation are 1) that it only applies to models that produce categorical probabilities, and 2) that it needs model retraining. Adversarial training (Kurakin et al., 2016; Huang et al., 2015) was also shown to greatly enhance the model robustness to adversarials. However, as discussed in Section 4.2, defensive distillation and adversarial training suffers from, what we call, the generalization limitations. Our experiment suggests this seems to be an intrinsic property of adversarial datasets. 3. Crafting Adversarials The are mainly two categories of algorithms to generate adversarial samples, model independent and model dependent. We briefly summarize these two classes of methods in this section. Adversarial and Clean Data Are Not Twins By conventions, we use X to represent input image set (usually a 3-dimension tensor), and Y to represent the label set, usually one-hot encoded. Lowercase represents an individual data sample, e.g., x for one input image. Subscript to data samples denotes one of its elements, e.g., xi denotes one pixel in the image, yi denotes probability for the i-th target class. f denotes the model, θ the model parameter, J the loss function. We use the superscript adv to denote adversarial related variables, e.g., xadv for one adversarial image. δx denotes the adversarial noise for one image, i.e., xadv = x + δx. For clarity, we also include the model used to craft the adversarial samples where necessary, e.g., xadv(f1 ) denotes the adversarial samples created with model f1 . D denotes the image value domain, usually [0, 1] or [0, 255]. And  is a scalar controlling the scale of the adversarial noise, another hyper-parameter to choose. 3.1. Model Independent Method A box-constrained minimization algorithm based on L-BFGS was the first algorithm proposed to generate adversarial data (Szegedy et al., 2013). Concretely we want to find the smallest (in the sense of L2 -norm) noise δx such that the adversarial image belongs to a different category, i.e., f (xadv ) 6= f (x). δx = argmin ckrk∞ + J(x + r, y adv ) r Equation 2.  δx =  sign dJ(x, y) dx  (2) Originally (Kurakin et al., 2016) proposes to generate adversarial samples by using the true label i.e., y adv = y true , which has been shown to suffer from the label leaking problem (Kurakin et al., 2016). Instead of true labels, (Kurakin et al., 2016) proposes to use the predicted label, i.e., y = f (x), to generate adversarial examples. This method can also be used iteratively as shown in Equation 3. Iterative FGSM has much higher success rate than the one-step FGSM. However, the iterative version is less robust to image transformation (Kurakin et al., 2016).   dJ(xadv adv adv k , yk ) xk+1 = xk +  sign dx (3) adv x0 = x yk = f (xadv k ) TA R G E T C L A S S G R A D I E N T S I G N M E T H O D (TGSM) This method tries to modify the input towards the direction where p(y adv | x) increases. (1) s.t. x + r ∈ D 3.2. Model Dependent Methods There are mainly three methods that rely on model gradient, i.e., fast gradient sign method (FGSM) (Kurakin et al., 2016), target class method (Kurakin et al., 2016; Kurakin et al., 2016) (TGSM) and Jacobianbased saliency map approach (JSMA) (Papernot et al., 2015a). We will see in Section 4 that despite that they all produce highly disguising adversarials, FGSM and TGSM produce compatible adversarial datasets which are complete different from adversarials generated via JSMA. FA S T G R A D I E N T S I G N M E T H O D ( F G S M ) FGSM tries to modify the input towards  the direction adv where J increases, i.e., dJ(x, y ) dx , as shown in  δx = − sign dJ(x, y adv ) dx  (4) Originally this method was proposed as the least-likely class method (Kurakin et al., 2016) where y adv was chosen as the least-likely class predicted by the model as shown in Equation 5. y adv = OneHotEncode (argmin f (x)) (5) And it was extended to a more general case where y adv could be any desired target class (Kurakin et al., 2016). JAC O B I A N - BA S E D S A L I E N C Y M A P APPROACH (JSMA) Similar to the target class method, JSMA (Papernot et al., 2015a) allows to specify the desired target class. However, instead of adding noise to the whole input, Adversarial and Clean Data Are Not Twins Table 1. Accuracy on adversarial samples generated with FGSM/TGSM. f1 Dataset MNIST CIFAR10 SVHN Xtest f2 adv(f1 ) Xtest 0.0213 0.1500 0.2453 1.00 0.99 1.00 Xtest 0.9914 0.8279 0.9378 JSMA changes only one pixel at a time. A saliency score is calculated for each pixel and pixel with the highest score is chosen to be perturbed. ( 0 if st < 0 or so > 0 s(xi ) = st |so | otherwise (6) X ∂yj ∂yt so = st = ∂xi ∂xi j6=t Concretely, st is the Jacobian value of the desired target class yt w.r.t an individual pixel, so is the sum of Jacobian values of all non-target class. Intuitively, saliency score indicates the sensitivity of each output class w.r.t each individual pixel. And we want to perturb the pixel towards the direction where p(yt | x) increases the most. 4. Experiment Generally, we follow the steps below to test the effectiveness and limitation of the binary classifier approach. 1. Train a deep neural network f1 on the original clean training data Xtrain , and craft adversarial dataset from the original clean data, Xtrain → adv(f ) adv(f ) Xtrain 1 , Xtest → Xtest 1 . f1 is used to generate the attacking adversarial dataset which we want to filter out. 2. Train a binary classifier f2 on the combined (shufadv(f ) fled) training data {Xtrain , Xtrain 1 }, where adv(f ) Xtrain is labeled 0 and Xtrain 1 labeled 1. adv(f1 ) 3. Test the accuracy of f2 on Xtest and Xtest respectively. , 4. Construct second-round adversarial test data, adv(f ) adv(f ) {Xtest , Xtest 1 } → {Xtest , Xtest 1 }adv(f2 ) adv(f1 ) {Xtest }adv(f2 ) 1.00 1.00 1.00 0.00 0.01 0.00 Xtest adv(f1 ) adv(f2 ) } {Xtest 1.00 1.00 1.00 and test f2 accuracy on this new adversarial dataset. Concretely, we want to test whether we could find adversarial samples 1) that can successfully bypass the binary classifier f2 , and 2) that can still fool the target model f1 if they bypass the binary classifier. Since adversarial datasets are shown to be transferable among different machine learning techniques (Papernot et al., 2016), the binary classifier approach will be seriously flawed if f2 failed this second-round attacking test. The code to reproduce our experiment are available https://github.com/gongzhitaao/ adversarial-classifier. 4.1. Efficiency and Robustness of the Classifier We evaluate the binary classifier approach on MNIST, CIFAR10, and SVHN datasets. Of all the datasets, the binary classifier achieved accuracy over 99% and was shown to be robust to a second-round adversarial attack. The results are summarized in Table 1. Each column denotes the model accuracy on the corresponding dataset. The direct conclusions from Table 1 are summarized as follows. adv(f ) 1. Accuracy on Xtest and Xtest 1 suggests that the binary classifier is very effective at separating adversarial from clean dataset. Actually during our experiment, the accuracy on Xtest is aladv(f ) ways near 1, while the accuracy on Xtest 1 is either near 1 (successful) or near 0 (unsuccessful). Which means that the classifier either successfully detects the subtle difference completely or fails completely. We did not observe any values in between. adv(f ) 2. Accuracy on {Xtest 1 }adv(f2 ) suggests that we were not successful in disguising adversarial Adversarial and Clean Data Are Not Twins samples to bypass the the classifier. In other words, the binary classifier approach is robust to a second-round adversarial attack. 3. Accuracy on {Xtest }adv(f2 ) suggests that in case of the second-round attack, the binary classifier has very high false negative. In other words, it tends to recognize them all as adversarials. This, does not pose a problem in our opinion. Since our main focus is to block adversarial samples. 4.2. Generalization Limitation Before we conclude too optimistic about the binary classifier approach performance, however, we discover that it suffers from the generalization limitation. 1. When trained to recognize adversarial dataset generated via FGSM/TGSM, the binary classifier is sensitive to the hyper-parameter . 2. The binary classifier is also sensitive to the adversarial crafting algorithm. In out experiment, the aforementioned limitations also apply to adversarial training (Kurakin et al., 2016; Huang et al., 2015) and defensive distillation (Papernot et al., 2015b). SENSITIVITY TO  Table 2 summarizes our tests on CIFAR10. For brevity, we use f2 =0 to denote that the classifier f2 is trained on adversarial data generated on f1 with  = 0 . The binary classifier is trained on mixed clean data and adversarial dataset which is generated via FGSM with  = 0.03. Then we re-generate adversarial dataset via FGSM/TGSM with different  values. adversarial data are generated with  < 1 . Results on MNIST and SVHN are similar. This phenomenon was also observed in defensive retraining (Kurakin et al., 2016). To overcome this issue, they proposed to use mixed  values to generate the adversarial datasets. However, Table 2 suggests that adversarial datasets generated with smaller  are superset of those generated with larger . This hypothesis could be well explained by the linearity hypothesis (Kurakin et al., 2016; Warde-Farley & Goodfellow, 2016). The same conclusion also applies to adversarial training. In our experiment, the results of defensive retraining are similar to the binary classifier approach. D I S PA R I T Y A M O N G A D V E R S A R I A L SAMPLES In our experiment, we also discovered that the binary classifier is also sensitive to the algorithms used to generate the adversarial datasets. Specifically, the binary classifier trained on FGSM adversarial dataset achieves good accuracy (over 99%) on FGSM adversarial dataset, but not on adversarial generated via JSMA, and vise versa. However, when binary classifier is trained on a mixed adversarial dataset from FGSM and JSMA, it performs well (with accuracy over 99%) on both datasets. This suggests that FGSM and JSMA generate adversarial datasets that are far away from each other. It is too vague without defining precisely what is being far away. In our opinion, they are far away in the same way that CIFAR10 is far away from SVHN. A well-trained model on CIFAR10 will perform poorly on SVHN, and vise versa. However, a well-trained model on the the mixed dataset of CIFAR10 and SVHN will perform just as well, if not better, on both datasets, as if it is trained solely on one dataset. Table 2.  sensitivity on CIFAR10 f2  Xtest 0.3 0.1 0.03 0.01 0.9996 0.9996 0.9996 0.9996 =0.03 adv(f ) Xtest 1 1.0000 1.0000 0.9997 0.0030 As shown in Table 2, f2 =0 can correctly filter out adversarial dataset generated with  ≥ 0 , but fails when The adversarial datasets generated via FGSM and TGSM are, however, compatible with each other. In other words, the classifier trained on one adversarial datasets performs well on adversarials from the other algorithm. They are compatible in the same way that training set and test set are compatible. Usually we expect a model, when properly trained, should generalize well to the unseen data from the same distribution, e.g., the test dataset. In effect, it is not just FGSM and JSMA are incompati- Adversarial and Clean Data Are Not Twins Figure 2. Adversarial training (Huang et al., 2015; Kurakin et al., 2016) does not work. This is a church window plot (Warde-Farley & Goodfellow, 2016). Each pixel (i, j) (row index and column index pair) represents a data point x̃ in the input space and x̃ = x+hj +vi , where h is the direction computed by FGSM and v is a random direction orthogonal to h. The  ranges from [−0.5, 0.5] and (·) is the interpolated value in between. The central black dot represents the original data point x, the orange dot (on the right of the center dot) represents the last adversarial sample created from x via FGSM that is used in the adversarial training and the blue dot represents a random adversarial sample created from x that cannot be recognized with adversarial training. The three digits below each image, from left to right, are the data samples that correspond to the black dot, orange dot and blue dot, respectively. ( ) represents the data samples that are always correctly (incorrectly) recognized by the model. represents the adversarial samples that can be correctly recognized without adversarial training only. And represents the data points that were correctly recognized with adversarial training only, i.e., the side effect of adversarial training. ble. We can generate adversarial data samples by a linear combination of the direction computed by FGSM and another random orthogonal direction, as illustrated in a church plot (Warde-Farley & Goodfellow, 2016) Figure 2. Figure 2 visually shows the effect of adversarial training (Kurakin et al., 2016). Each image represents adversarial samples generated from one data sample, which is represented as a black dot in the center of each image, the last adversarial sample used in adversarial training is represented as an orange dot (on the right of black dot, i.e., in the direction computed by FGSM). The green area represents the adversarial samples that cannot be correctly recognized without adversarial training but can be correctly recognized with adversarial training. The red area represents data samples that can be correctly recognized without adversarial training but cannot be correctly recognized with adversarial training. In other words, it represents the side effect of adversarial training, i.e., slightly reducing the model accuracy. The white (gray) area represents the data samples that are always correctly (incorrectly) recognized with or without adversarial training. As we can see from Figure 2, adversarial training does make the model more robust against the adversarial sample (and adversarial samples around it to some extent) used for training (green area). However, it does not rule out all adversarials. There are still adversarial samples (gray area) that are not affected by the adversarial training. Further more, we could observe that the green area largely distributes along the horizontal direction, i.e., the FGSM direction. In (Nguyen et al., 2014), they observed similar results for fooling images. In their experiment, adversarial training with fooling images, deep neural network models are more robust against a limited set of fooling images. However they can still be fooled by other fooling images easily. 5. Conclusion We show in this paper that the binary classifier is a simple yet effective and robust way to separating adversarial from the original clean images. Its advantage over defensive retraining and distillation is that it serves as a preprocessing step without assumptions about the model it protects. Besides, it can be readily deployed without any modification of the underlying systems. However, as we empirically showed in the experiment, the binary classifier approach, defensive retraining and distillation all suffer from the generalization limitation. For future work, we plan to extend our current work in two directions. First, we want to investigate the disparity between different adversarial crafting methods and its effect on the generated adversarial space. Second, we will also carefully examine the cause of adversarial samples since intuitively the linear hypothesis does not seem right to us. References CireşAn, Dan, Meier, Ueli, Masci, Jonathan, and Schmidhuber, Jürgen. Multi-column deep neural network for traffic sign classification. 32:333–338, 2012. Esteva, Andre, Kuprel, Brett, Novoa, Roberto A., Ko, Justin, Swetter, Susan M., Blau, Helen M., and Thrun, Sebastian. Dermatologist-level classifica- Adversarial and Clean Data Are Not Twins tion of skin cancer with deep neural networks. advance online publication, Jan 2017. ISSN 14764687. URL http://dx.doi.org/10.1038/ nature21056. Letter. Goodfellow, I. J., Shlens, J., and Szegedy, C. Explaining and Harnessing Adversarial Examples. December 2014. Huang, Ruitong, Xu, Bing, Schuurmans, Dale, and Szepesvári, Csaba. Learning with a strong adversary. abs/1511.03034, 2015. URL http:// arxiv.org/abs/1511.03034. Kurakin, A., Goodfellow, I., and Bengio, S. Adversarial Examples in the Physical world. July 2016. Kurakin, Alexey, Goodfellow, Ian J., and Bengio, Samy. Adversarial machine learning at scale. abs/1611.01236, 2016. URL http://arxiv. org/abs/1611.01236. Nguyen, Anh Mai, Yosinski, Jason, and Clune, Jeff. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. abs/1412.1897, 2014. URL http://arxiv. org/abs/1412.1897. Papernot, N., McDaniel, P., and Goodfellow, I. Transferability in Machine Learning: From Phenomena To Black-Box Attacks Using Adversarial Samples. May 2016. Papernot, Nicolas, McDaniel, Patrick, Jha, Somesh, Fredrikson, Matt, Celik, Z. Berkay, and Swami, Ananthram. The limitations of deep learning in adversarial settings. abs/1511.07528, 2015a. URL http://arxiv.org/abs/1511.07528. Papernot, Nicolas, McDaniel, Patrick Drew, Wu, Xi, Jha, Somesh, and Swami, Ananthram. Distillation as a defense to adversarial perturbations against deep neural networks. abs/1511.04508, 2015b. URL http://arxiv.org/abs/1511.04508. Santana, Eder and Hotz, George. Learning a driving simulator. abs/1608.01230, 2016. URL http:// arxiv.org/abs/1608.01230. Szegedy, Christian, Zaremba, Wojciech, Sutskever, Ilya, Bruna, Joan, Erhan, Dumitru, Goodfellow, Ian J., and Fergus, Rob. Intriguing properties of neural networks. abs/1312.6199, 2013. URL http: //arxiv.org/abs/1312.6199. Warde-Farley, D and Goodfellow, I. Adversarial Perturbations of Deep Neural Networks. 2016.
9cs.NE
arXiv:1712.01934v1 [stat.ML] 5 Dec 2017 Concentration of weakly dependent Banach-valued sums and applications to kernel learning methods Gilles Blanchard∗ , Oleksandr Zadorozhnyi† Karl-Liebknecht Str. 24-25 14469 Potsdam, Germany e-mail: [email protected] [email protected] Abstract: We obtain a new Bernstein-type inequality for sums of Banachvalued random variables satisfying a weak dependence assumption of general type and under certain smoothness assumptions of the underlying Banach norm. We use this inequality in order to investigate in asymptotical regime the error upper bounds for the broad family of spectral regularization methods for reproducing kernel decision rules, when trained on a sample coming from a τ −mixing process. 1. Introduction Let (Xk )k∈N+ be an integrable and centered stochastic process taking values in a separable Banach space (B, k·k). Define Sn = X1 + X2 + . . .+ Xn . In this work, we are interested in the non-asymptotic behaviour of the deviations of Sn from zero in B; more precisely, we investigate exponential concentration inequalities for events of the type {kSn k ≥ t}, for t > 0. In the simplest situation where (X1 , X2 , . . . , Xn ) are mutually independent and real-valued, the celebrated Hoeffding’s [20] and Bernstein’s inequalities [4] are available. Vector-valued analogues (in finite or infinite dimension) of those concentration inequalities for norms of sums of independent random variables were first established for the case of bounded independent random variables in Hilbert spaces by Yurinskyi [39]. The situation differs in an arbitrary Banach space. There, the distribution of kSn k (in particular its expectation) heavily depends on the geometry of the underlying Banach space, and moment (Bernstein-like) conditions for the individual variables Xi are generally not sufficient for a generic control of kSn k around zero (see [40], Example 3.0.1). Still, under assumptions on the ”smoothness” of the underlying Banach norm (reflected by boundedness of its first two Gâteaux-derivatives), one can control the deviations of kSn k around zero. Corresponding concentration inequalities have been obtained in [31] and [29]. Of interest for many applications is the case where random samples are generated from some non-trivial stochastic process with (sometimes infinite) mem∗ Supported † Supported by the DFG FOR-1735 research group “Structural Inference in Statistics” by the SFB 1294 “Data Assimilation” 1 G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 2 ory. The generalization of Hoeffding’s inequality for real-valued martingales and martingale differences together with its application to least squares estimators in linear and smooth autoregressive models are presented in [37]. An extension of the Hoeffding-Azuma inequalities for the weighted sum of uniformly bounded martingale differences can be found in [33]. Generalizations of the exponential inequalities for the case of real-valued supermartingales were obtained in [18] and recently generalized in [16], where the authors use change of probability measure techniques, and give applications for estimation in the general parametric (real-valued) autoregressive model. Extensions of [18] for the case of supermartingales in Banach spaces were obtained in [30]. Beyond the (super)martingale setting, the need to handle more general processes which have some ”asymptotic independence” assumptions led to the concept of mixing. Definitions of (strong) α−, φ− and ρ− mixing were introduced in [35], [21],[22], we refer also to [9] for a broad survey about the properties and relations between strong mixing processes. However, there are examples of dynamical systems [12] generated by uniformly expanding maps that are not even α−mixing (considered the weakest form of strong mixing assumptions). Such type of processes include mixingales [2, 27], associated processes [15, 17], various notions of weak dependence [5, 13] which was firstly mentioned in [32]. In this paper, we consider the analysis of inherent dependency of the random sample by means of a general type of weakly dependent process. In this general framework, many techniques used in the case of independent data scenario were improved and combined with other methods to obtain concentration inequalities for the sum of real-valued random variables. For example, generalizations of Bernstein’s inequality for φ-mixing random processes were obtained combining the entropy method with the blocking technique in [36]; using a similar blocking technique ensuring asymptotic independence, Bernstein-type inequalities for geometrically α−mixing processes and moderate deviation principles were derived in [28]; deviation inequalities for real-valued sums of variables from general α−mixing processes were obtained in [8] through approximation by independent random sums and the blocking technique. Moreover, in [19] the blocking technique together with majorization of joint distribution by means of the marginals and a general Chernoff’s bounding principle are used to obtain Bernstein-type inequalities for real functions of C−mixing processes. In [24], the martingale difference method is used to establish general McDiarmid-type concentration inequalities for real-valued Lipschitz functions of dependent random sequences on a countable state space. Using logarithmic Sobolev inequalities and the contractivity condition related to Dobrushin and Shlosman’s strong mixing assumptions, general non-product measure concentration inequalities were obtained in [25]. Most of the above mentioned inequalities characterize the deviations of sums of real-valued random variables. A few results concern the concentration of realvalued functional of weakly dependent variables over somewhat general spaces, and can be applied to norms of sums of vector-valued variables. This is the case for the measure concentration result in [24] for so-called η−mixing (which is implied by φ−mixing) random variables, but a condition called Ψ-dominance G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 3 [23] must hold (it is satisfied if the underlying variable space is countable, or is a closed subspace of the real line). This result implies Hoeffding-Azuma type of inequalities for norms of sums. Still, to the best of our knowledge, it is unknown how these mixing assumptions are connected to α−, β− or ΦC −mixing, or whether they can be applied to norms in arbitrary Banach spaces. The aforementioned measure concentration results of [25] for distributions of dependent real variables with continuous density imply concentration of the norm of their sum (which is a Lipschitz function in Euclidean distance) in an Euclidean space. However, the question becomes more challenging when one considers concentration of the norm of random variables in a separable, infinite-dimensional space. Furthermore, in this paper we are interested in sharper Bernstein-type rather than Hoeffding-type bounds. This paper is organized as follows: in Section 2, we recall the setting for stochastic processes with values in a Banach space. We recall the definition from [26] to consider a general type of weakly dependent processes. In Section 3, we pose the main assumptions about the structure of the underlying infinite dimensional Banach space and present in a general form the new Bernstein-type inequalities for C−mixing processes. Furthermore, here we also provide specific corollaries for the cases of either exponentially (geometrically) or polynomially mixing decay rates. We compare our results to the former inequalities on the concentration of real-valued C-mixing processes. As an application, in Section 4 we investigate the (asymptotical) error bounds for reproducing kernel learning algorithms using a general form of spectral regularization when the sample is drawn from a process which satisfies the so-called τ -mixing assumption. All proofs can be found in the Appendix. 2. Preliminaries and Notations Let (Ω, F , P) be a probability space. We recall that (B, k·k) is some separable Banach space and X ⊂ B an arbitrary closed subset containing 0. We use the standard notions of p-integrable and essentially bounded real functions spaces and use the notation Lp (P) := Lp (Ω, F , P) and L∞ := L∞ (Ω, F , P). Following [26], we define mixing processes with respect to a class a of real-valued functions. Let C(·) be a semi-norm over a closed subspace C of the Banach space of bounded real-valued functions f : X 7→ R. We define the C-norm by kf kC := kf k + C(f ), where k·k is the supremum norm on C, and introduce C1 = {f ∈ C, C(f ) ≤ 1}. Define Mj = σ(Xi : 1 ≤ i ≤ j), j ∈ N to be the sigma-algebra generated by the random variables X1 , . . . , Xj . Definition 2.1. For k ∈ N>0 we define the C-mixing coefficients as  ΦC (k) = sup E[Y ϕ(Xi+k )] − E[Y ]E[ϕ(Xi+k )] | i ≥ 1, Y ∈ L1 (Ω, Mi , P), kY kL1 (P) ≤ 1, ϕ ∈ C1 . We say that the process (Xi )i≥1 is ΦC −mixing (or simply C-mixing) if lim ΦC (k) = k→∞ 0. If ΦC (k) ≤ c exp(−bk γ ) for some constants b, γ > 0, c ≥ 0 and all k ∈ N, G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 4 then a stochastic process (Xk )k≥1 is said to be exponentially (or geometrically) C-mixing. If ΦC (k) ≤ ck −γ for all k ∈ N and for some constants c ≥ 0, γ > 0, then the stochastic process (Xk )k≥1 is said to be polynomially C-mixing. As discussed in [26], C-mixing describes many natural time-evolving systems and finds its application for a variety of dynamical systems. The authors of [19] use a slighty different definition of ΦC -mixing coefficient, where supremum norm is taken over the class of functions {f : kf kC ≤ 1}. Thus, dependency coefficients ΦC are characterized by the control over correlations between the past and one moment in the future of the process, for functions of bounded supremum norm from class C1 . A fundamental result ([26], Lemma 1.1.2 ) claims that Definition 2.1 can be equivalently stated as following: Definition 2.2 (Equivalent to Definition 2.1).  ΦC (k) = sup kE[ϕ(Xi+k )|Mi ] − E[ϕ(Xi+k )]k∞ | ϕ ∈ C1 , i ≥ 1 , where k·k∞ is the the L∞ (P) norm. In our theoretical analysis we will use Definition 2.2 for processes which are assumed to be C−mixing. We first describe some examples of semi-norms C. Example 2.3. Let CLip be the set of bounded Lipschitz functions over X . Consider   |f (s) − f (t)| s, t ∈ X , s 6= t . CLip (f ) := kf kLip(X ) = sup ks − tk It is easy to see that CLip (f ) is a semi-norm. With this choice of class C and semi-norm C(·), we obtain the so-called τ −mixing coefficients (see [12] and [38] for the real-valued case), which will be denoted τ (k) := ΦC (k), k ≥ 1. Examples of τ −mixing sequences Consider a Banach-valued auto-regressive process of order 1: Xi = ρ(Xi−1 ) + ξi , for i ∈ Z, where (ξi )i∈Z is an i.i.d. sequence such that kξk ≤ 1 almost surely, and ρ : X 7→ X is a linear operator with kρk⋆ < 1, where k·k⋆ is the operator norm. Due to the Ps−1 linearity of ρ, we can write Xt+s = Xt,s +ρs (Xt ), where Xt,s = l=0 ρl (ξt+s−l ). For the τ -mixing coefficients, by using this decomposition and the independence Xt,s and Xt , we get: τ (s) = sup {kE[f (Xt+s )|Mt ] − E[f (Xt+s )]k∞ } f ∈C1 = sup {kE[f (Xt,s + ρs (Xt ))|Mt ] − E[f (Xt,s + ρs (Xt ))]k∞ } f ∈C1 = sup {kE[f (Xt,s + ρs (Xt )) − f (Xt,s )|Mt ] f ∈C1 − E[f (Xt,s + ρs (Xt )) − f (Xt,s )]k∞ } s ≤ 2kρs (Xt )k∞ ≤ kρk⋆ kXt k∞ → 0, G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 5 when s → ∞, as Xt is almost surely bounded. From this we observe that (Xt )t≥1 is exponentially τ −mixing Banach-valued process. Repeating arguments from [1] (in the real-valued case), one can show that this process is not always α−mixing (in particular when ξi has a discrete distribution). Similarly to the aforementioned argument, it is easy to check, that a Hilbert-valued version of the moving-average process of finite order q < ∞: Wi = µ + q X j=0 θi−j ψi−j , for i ∈ Z, where (ψj )j∈Z is independent and centered noise process and µ is some fixed element in Hilbert space, is an exponentially τ −mixing process. Furthermore, one can straightforwardly checked that (Wi )i∈Z is not a martingale. Remark. We observe, that τ −mixing property of the process (Xt )t≥0 is preserved under Lipschitz map with function which Lipschitz norm is bounded by 1. More precisely, let φ : X 7→ H be a 1−Lipschitz transformation of the original process (Xt )t≥0 to some Polish space (H, k·kH ). Then, it is straightforward to check that the process (φ(Xt ))t≥0 is again τ −mixing. This ”propagation” of mixing property due to the Lipschitzness and theconcentration inequality of Theorem 3.4 allow in Section 4 to obtain the qualitative results about the statistical properties (error bounds) of the estimators of regression function in reproducing kernel Hilbert space. The key idea here is that the estimators of the target function are based on the non-linear mapping of the corresponding training data sequence. Example 2.4. Assume X ⊂ R to be an interval on the real line, let CBV := BV (X ) be the set of functions over X whose total variation is bounded and CBV (·) be the total variation seminorm: CBV (f ) := kf kT V = sup n X (x0 ,...,xn )∈△ i=1 |f (xi ) − f (xi−1 )|, where △ = {(x0 , x1 , . . . , xn ) ∈ X n | x0 < x1 < . . . < xn }. It is known that BV (X ) endowed with the norm kf kBV = kf k∞ + CBV (f ) is a Banach space. With this choice of (C, C(·)) we obtain the so-called φ̃-mixing processes, described in [32]. 3. Main assumptions and results 3.1. Assumptions Following [29], we introduce suitable hypotheses pertaining to the geometry of the underlying Banach space (B, k·k), the distribution of the norm of coordinates kXi k, and additional conditions on the considered C(·)-semi-norm. We recall briefly the concept of Gâteaux derivative: for a real-valued function f : X → R we say that f is Gâteaux differentiable at point x ∈ int(X ) in the G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 6 direction v ∈ B, if t 7→ f (x + tv) is differentiable in 0. We then denote δv f (x) = d dt f (x + tv). t=0 We say that the function f is Gâteaux-differentiable at point x if all the directional derivatives exist and form a bounded linear functional, i.e. an element Dx f in the dual X ∗ such that ∀v ∈ B: f (x + tv) − f (x) = hDx f, vi. t→0 t In this case Dx f is called Gâteaux derivative of function f at point x. Assumption A1. The norm k·k in the Banach space B is twice Gâteaux differentiable at every nonzero point in all directions and there exist constants A1 , A2 > 0 such that the following conditions are fulfilled for all x, v ∈ B, x 6= 0: lim |δv (kxk)| ≤ A1 kvk, or equivalently (Dx k·k) 2 |δv,v (kxk)| ≤ A2 ⋆ ≤ A1 ; kvk , kxk where δv,v denotes the second Gâteaux differential in the direction v and k·k⋆ is the norm in the dual space B ⋆ . We recall the following examples of Banach spaces that fulfill the desired properties (see [29]): Example 3.1. Let B = H be a separable infinite dimensional Hilbert space with scalar product h·, ·iH and norm k·kH . Then by the Cauchy-Schwartz inequality, it holds:  d p δg (kf kH ) = hf + tg, f + tgi ≤ kgkH , dt t=0 and also ! 2 2 kgkH d hf, gi + tkgkH ≤ , δg,g (kf kH ) = dt kf + tgkH kf kH t=0 hence H satisfies Assumption A1 with constants A1 = A2 = 1. Example 3.2. Let B = Lp (Ω, F , P), p ≥ 2. Then for any f, g ∈ B such that f 6= 0, it holds:  Z  p1  Z d 1−p p |f + tg| dP δg (kf kp ) = = kf kp |f |p−2 f gdP dt t=0 1−p ≤ kf kp p−1 kf kp kgkp = kgkp , because of Hölder’s inequality; similarly: Z 2 ! Z 1−2p p−2 2 p−2 δg,g (kf kp ) = (p − 1)kf kp kf kp |f | g dP − |f | f gdP ≤ (p − 1−2p 1)kf kp  kf kp Z |f | p−2 2 g dP  2 −1 ≤ (p − 1)kgkp kf kp . G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 7 Thus for p ≥ 2 an Lp -space satisfies conditions of Assumption A1 with constants A1 = 1, A2 = p − 1. The conditions in Assumption A2 are common in the framework of Bernsteintype inequalities. Assumption A2. There exist positive real constants c, σ 2 so that for all i ∈ N: kXi k ≤ c, P-almost surely;  2 E kXi k ≤ σ 2 . Finally, throughout this work, being in the framework of the general Definition 2.2, we will consider functional classes C with a seminorm C(·) satisfying the following assumption. Assumption A3. Let, as it was assumed before, C(f ) be a seminorm defined on a subspace (C, k·kC ) of real bounded functions {f : X 7→ R}. For each s ∈ B ⋆ 2 define h1,s : x 7→ hs, xi for each s ∈ B ⋆ and h2 : x 7→ kxk , where B ⋆ is the dual ⋆ space of B. Define B(r), B (r) to be the closed balls of radius r centered in zero in B and B ⋆ , respectively. It is assumed that h1,s ∈ C for all s ∈ B ⋆ ; h2 ∈ C, and: sup C(h1,s ) ≤ C1 , s∈B ⋆ (1) C(h2 ) ≤ C2 , for some fixed constants C1 , C2 ∈ R+ . Example 2.1 (continued). For the Lipschitz class CLip considered in Example 2.3 we have :   hs, x1 − x2 i ≤ 1, sup CLip (h1,s ) = sup kh1,s kLip(B(c)) = sup kx1 − x2 k s∈B ⋆ (1) s∈B ⋆ (1) s∈B ⋆ (1) x1 ,x2 ∈B(c) and CLip (h2 ) = kh2 kLip(B(c)) = sup x1 ,x2 ∈B(c)  2 2 kx1 k − kx2 k kx1 − x2 k  ≤ 2c. Example 2.2 (continued). For the BV functional class CBV considered in Example 2.2, and X = [−c, c] ⊂ R we get similarly: sup C(h1,s ) = s∈B ⋆ (1) sup kh1 kBV (B(c)) = s∈B ⋆ (1) sup sup n X s∈B ⋆ (1) (x0 ,...,xn )∈△ i=1 ≤ 2c sup kskB⋆ ≤ 2c. |hs, xi − xi−1 i| s∈B ⋆ (1) where in the case B = R the functional s is just a multiplication by a constant. Lastly, CBV (h2 ) = kh2 kBV (B(c)) = sup n X (x0 ,...,xn )∈△ i=1 x2i − x2i−1 ≤ 2c2 . G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 8 3.2. Main result and corollaries Our main result is a Bernstein-type inequality for norms of sums of Banachvalued random variables which are generated by some centered ΦC −mixing Pn process. We begin with a general bound on the deviations of the norm of i=1 Xi . Theorem 3.3. Let (Ω, F , P) be an arbitrary probability space, (B, k·k) a Banach space such that Assumption A1 holds and X = B(c). Let (Xi )ni≥1 be an X -valued, centered, C-mixing random process on (Ω, F , P) such that Assumptions A2,A3 are satisfied. Then for each pair of positive integers (ℓ, k), ℓ ≥ 2, such that n = ℓk + r, r ∈ {0, · · · , k − 1}, and any ν > 0, it holds: # " r n 4cν B(σ 2 + C2 ΦC (k))ν 1X Xi ≥ 4A1 C1 ΦC (k) + 4 ≤ 2 exp(−ν), + P n i=1 ℓ 3ℓ (3.1) where B = A21 + A2 and the constants A1 , A2 , C1 , C2 are given by the assumptions.   Remark. Since the choice of k and ℓ is free subject to k = nℓ , one can optimize the obtained deviation bound over the choice of ℓ in order   to reach the most favorable trade-off between the first term of order ΦC ( nℓ ) which is nondecreasing in ℓ, and the following ”Bernstein-like” terms. This trade-off is a direct consequence of the so-called blocking technique used in the proof of the above result: the sample is divided into k blocks of size ℓ or ℓ + 1, such that the distances between two neighbor points in a same block is exactly k. The Bernstein-like deviation terms are similar to the ones found in the i.i.d. case, but with the total sample size n replaced by the block size ℓ. The terms involving ΦC reflect the lack of independence inside a block. This trade-off leads us to the notion of effective sample size. For a given n and constants c, σ 2 we define the positive integer number ℓ⋆ : j n k c n σ o ≤ ∨ √ ∪ {1}. ℓ⋆ := max 1 ≤ ℓ ≤ n s.t. ΦC (3.2) ℓ ℓ ℓ Observe that ℓ⋆ is a function of n, but we omit this dependence to simplify notation. The following consequence of Theorem 3.3 is formulated in terms of the effective sample size: Theorem 3.4. Assume the conditions of Theorem 3.3 are satisfied, and the effective sample size ℓ⋆ is as given by (3.2). Then for any ν ≥ 0:   √ n 1X σ(R + Q1 ν) c(R + M1 ν) √ P Xi ≥ ≤ 2 exp(−ν), (3.3) + n i=1 ℓ⋆ ℓ⋆ √ √ where R = 4C1 A1 , Q1 = 6 B, M1 = 2 + 2 B(1 + 2 Cc2 ). Furthermore, we can give more explicit rates by lower bounding the effective sample size in the specific cases of exponentially or polynomially C−mixing process. G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 9 Proposition 3.5. For an exponentially C−mixing centered process on (Ω, F , P) with rate ΦC (k) := χ exp(−θk γ ) (χ > 0, θ > 0, γ > 0), the effective sample size satisfies l n   χn −2/γ m log , ℓ⋆ ≥ 2 c  provided n ≥ n0 = ⌈ χc exp 1θ ⌉. For a polynomially C−mixing centered process with rate ΦC (k) = ρk −γ , the effective sample size satisfies ℓ⋆ ≥ max 2γ m l γ 2 1  l σ  2γ+1  n  2γ+1 c  γ+1 n  γ+1 m , . ρ 2 ρ 2 Remark. In the application section, we will use the obtained concentration framework for sums of Hilbert-space valued random variables. In this particular case, we have A1 = 1, A2 = 1 and correspondingly B = 2. Considering the case where the underlying data generating process is τ −mixing (see Example 2.3) we get C1 = 1 and C2 = 2c. This gives us the following consequence for the concentration of norm in the case of process that satisfies τ −mixing conditions mentioned in Example 2.1. Corollary 3.6 (Concentration result for Hilbert-valued τ −mixing processes). Under the assumptions of Theorem 3.4 with a Hilbert-valued τ −mixing sample {Xi }ni=1 , for any 0 ≤ η ≤ 12 , with probability at least 1 − η it holds:    n 21c 1X 13σ 2 √ + ⋆ , Xi ≤ log n i=1 η ℓ ℓ⋆ (3.4) where the choice of ℓ⋆ is given by (3.2). Remark. To ensure the conditions of of Proposition 3.5 for exponentially mixing processes, we pose certain assumptions on the the minimum size of actual sample (reflected in the bound in n0 ). 3.3. Discussion of results We highlight aspects in which our results differ from previous work. We first restrict our attention to the real-valued case (B = R). We consider the general type of ΦC −mixing processes as in [19], where the authors require the additional assumption on the semi-norm C(·) that the inequality C(ef ) ≤ kf k∞ C(f ) should hold for all f ∈ C. Instead, we only pose the assumption that the underlying class C contains linear forms and the function x 7→ kxk2 , plus a.s. boundedness. The reason is that the proof of the main result essentially relies on the representation of the norm by means of its second order Taylor expansion. This allows us to recover results analogous to [19] (in the sense of the order of the effective sample size) for geometrically ΦC −mixing processes. In this case, a broad overview and comparison to existing literature is given in [19]; we omit reproducing this G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 10 detailed discussion here and refer the reader to that work. As a further contribution with respect to [19] we derive new results for the exponential concentration of the sum for polynomially ΦC −mixing processes. In the general Banach-valued case, the norm can be seen as a particular case of general functionals of the sample. As mentioned in the introduction, while the literature on concentration of general functionals in the independent case is flourishing, it is rather scarce under the setting of weak dependence. In the work [24], the authors obtain general Hoeffding-type concentration inequalities for functionals of the sample satisfying the bounded difference assumption (AzumaMcDiarmid type setting) under the so-called η−mixing assumption (which is related to, but weaker than, ϕ-mixing). Our results are specific to concentration of the norm of the sum under certain geometrical assumptions, but are of Bernstein-type, and valid under a much weaker dependence assumption. The core proof technique in our results as well as in [24] is the martingale difference approach. The strongest assumption (besides those concerning the geometry of B and the class C) we make is the a.s. boundedness of the random variable. Clearly, this result includes the case of independent noise process, considered in [31] and [39] (where boundedness was also assumed). Since our results apply in particular random variables with values in a separable Hilbert space, we can use them for the analysis of statistical properties of kernel-based algorithms in machine learning which are trained on the dependent sample. This analysis will be the cornstone of the next section. 4. Application to reproducing kernel regularization methods Let X be a Polish space and Y = R. Let as before (Zi )i≥1 be a stationary stochastic process over some probability space (Ω, F , P) with values in X × Y, and define ν as the common marginal distribution of the Zi s, and µ as its X-marginal. We will also denote ν(y|x) a regular conditional probability distribution of Yi conditional to Xi . In the general framework of learning from examples, the goal is to find a prediction function f : X 7→ Y such that for a new pair (X, Y ) ∼ ν, the value f (X) is a good predictor for Y . Let n z := {xi , yi }ni=1 ∈ (X × Y) be the observed training sample from the n first coordinates of the process (Zi )i≥1 , and fz be an estimated prediction function belonging to some model class H. We will assume (Zi )i≥1 to be a τ −mixing stationary process (as in Example 2.2) on (Ω, F , P). We consider the least squares regression problem where   the goal is to minimize the averaged squared loss E(f ) := Eν (f (X) − Y )2 . Equivalently, we want to find fz that approximates the regression function fν (x) = E[Y |X = x] well in the sense of being close to optimal risk E(f ) over the considered model class. We investigate the statistical properties of reproducing kernel learning methods, i.e., we consider as a model class a separable real reproducing kernel Hilbert space (RKHS) H = Hk ⊂ L2 (X, µ) which is induced by a measurable kernel k over X 2 . In the next pages we recall the setting and notation used in this G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 11 framework and therefore reiterate in shortened form some of the corresponding content of [3, 7]; for more details see also [10, 34]. We assume the kernel to be bounded by a positive constant κ = 1, i.e. p supx∈X k(x, x) ≤ 1. This implies that any f ∈ Hk is measurable and bounded in the supremum norm. As Hk is a subset of L2 (X , µ), let Sk : Hk 7→ L2 (X , µ) be the inclusion operator; and Sk⋆ : L2 (X , µ) 7→ Hk its adjoint. Using the definition of the adjoint, Sk⋆ can be written as: Z   kx g(x)µ(dx), Sk⋆ g = Eµ g(X)kX := X where kx is the element k(x, ·) ∈ Hk . Similarly, for x ∈ X denote Tx = kx ⊗ kx⋆ , then the covariance T : Hk 7→ Hk has the following representation: Z   T := Eµ TX = h·, kx iHk kx µ(dx), X where the last integrals are understood in the Bochner sense and T, TX both are self-adjoint and trace-class. We use the notation HS(Hk ) for the space of HilbertSchmidt operators over Hk , so that the former implies that T, TX ∈ HS(Hk ). We obtain the empirical analogues of the operatorsP T , Sk , Sk⋆ by replacing n the measure µ with its empirical counterpart µ̂x = n1 i=1 δxi . We define the following empirical operators: Sx :Hk 7→ Rn , (Sx f )j = hf, kxj i, n 1X yj kxj , Sx⋆ y = n j=1 Sx⋆ :Rn 7→ Hk , n Tx := Sx⋆ Sx :Hk 7→ Hk , Tx f = 1X kx kxj , f , n j=1 j where we used the notation y = (y1 , . . . , yn ) ∈ Rn . We now specify classes of distributions which correspond to a certain regularity of the learning problem in relation to the RKHS Hk , and on which we will aim at establishing error bounds. We start with the following assumption on the underlying distribution ν and the corresponding regression function fν . Assumption B1. There exist 0 < R ≤ 1, Σ > 0 such that the distribution ν belongs to the set D(R, Σ) of distributions satisfying: i) |Y | ≤ R, ν-almost surely. ii) The regression function fν belongs to the RKHS Hk , i.e. for µ-almost all x ∈ X it holds Z   ydν(y|x) = fν (x), fν ∈ Hk . E Y |X = x := y∈Y G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 12 iii) For µ−almost all x:  Var Y |X = x = Z y∈Y 2 (y − fν (x)) dν(y|x) ≤ Σ2 . The two next assumptions are: a decay rate condition for the discrete spectrum (ζi )i≥1 (ordered in decreasing order) of the covariance operator T , and a so-called Hölder source condition (see e.g. [11]) that describes the smoothness of the regression function fν . Denoting P to be the set of all probability distributions on X ; we will thus assume that the X marginal distribution µ belongs to  P < (b, β) := µ ∈ P : ζj ≤ βj −b , ∀j ≥ 1 ; secondly, we assume that fν ∈ Ω(r, D), where  Ω(r, D) = f ∈ Hk |f = T r g, kgkHk ≤ D , (4.1) which in the inverse problems literature is called the standard Hölder source condition for the linear embedding problem. Joining all assumptions, we consider the following class of marginal generating distributions: M(R, Σ, r, D, β, b) :=  ν(dx, dy) = ν(dy|x)µ(dx) : ν ∈ D(R, Σ), µ ∈ P < (b, β), fν ∈ Ω(r, D) . (4.2) In the forthcoming results we will consider two types of mixing coefficients decay rates. Namely, for the case of exponentially mixing process we fix r > 0, b > 1 and β > 0 and consider MΣ,R,D := M(r, D, P < (b, β)) where the parameter vector (Σ, R, D) varies in R3 . For the polynomially mixing process we disregard the exact influence of any distribution parameters (Σ, R, D) when investigating the statistical properties of kernel estimators. For estimation of the target regression function fν , we consider the following class of kernel spectral regularization methods: fz,λ = Fλ (Tx )Sx⋆ y, (4.3) where Fλ : [0, 1] 7→ R is a family of functions defining the regularization method (which we also call regularization function), depending on the parameter λ ∈ (0, 1], and for which the following conditions hold: i) There exists a constant B < ∞ such that, for any 0 < λ ≤ 1: sup tFλ (t) ≤ B. t∈(0,1] ii) There exists a constant E < ∞ such that sup tFλ (t) ≤ E/λ. t∈(0,1] G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 13 iii) There exists a constant γ0 such that the residual rλ (t) := 1 − Fλ (t)t is uniformly bounded, i.e. sup rλ (t) ≤ γ0 . t∈(0,1] iv) For some positive constant γq there exists a maximal q, which is called the qualification of the regularization such that sup rλ (t)tq ≤ γq λq . t∈(0,1] The above conditions are standard in the framework of inverse problems and in asymptotic framework are sufficient (see [3]) in order to obtain consistent learning algorithms in case of independent examples. Many known regularization procedures (including Tikhonov regularization, spectral cut-off, Landweber iteration) may be obtained via appropriate choice of the regularization function Fλ and satisfy conditions i)−iv) for appropriate parameters. We refer the reader to [14], [3] and [34] for a variety of different examples as well as the discussion in the context of learning from independent examples. We restrict our attention to the case of τ −mixing processes. Obtaining probabilistic results for Hilbert-valued random estimators based on the training sample (analogous in the spirit to those in [7]), we derive the upper bounds on the estimation error of fν by the regularized kernel learning estimators fz,λ in the case of learning from τ -mixing under different decay rates and in the certain range of norms. A key technical tool used in the previous works for such analysis (see [3, 7] for the i.i.d. case ) is a quantitative statement of the concentration of the centered (and possibly suitably rescaled) Hilbert-space valued variables (Sx∗ y − Tx fν (x)) and (Tx − T ) around 0. Observe that these variables are empirical sums (of elements kxi (yi − fν (xi )) ∈ Hk and (kxi ⊗ kx⋆i − T ) ∈ HS(Hk ), respectively). Thus, a very natural way to proceed in the analysis is to use the concentration results established in Section 3 for the Hilbert spaces to replace the i.i.d. analogues, and in other steps follow the proof strategy of those earlier works. Assuming the sample z = {xi , yi }ni=1 is a realization from a τ −mixing process (Zi )j≥1 , in order to apply the concentration inequality from Section 3 we should ensure that the corresponding Hilbert-valued quantities are forming τ mixing sequence themselves. As pointed out earlier, the τ -mixing property is obviously preserved (up to constant) via mapping through a Lipschitz functional. Lemma A.5 in Appendix A establishes this Lipschitz property for the kernel maps under mild assumptions (uniformly bounded mixed second derivative of the kernel). Using the inequality from Corollary 3.6, in Lemma 4.1 we obtain high probability inequalities for deviations of the correspondent random elements. The proof of the Lemma is put into the Appendix B. To simplify the exposition, we specify the results for the cases of either exponentially or polynomially mixing process. Further extensions are possible using the same general proof scheme as a blueprint, described in Appendix B, together with the result of Theorem 3.4 on the effective sample size. G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 14 Lemma 4.1. Let X p, Y and Hk be all as defined before. Assume that the kernel k satisfies supx∈X k(x, x) ≤ 1 and admits a mixed partial derivative ∂1,2 k : X × X 7→ R which is uniformly bounded by some positive constant K. Let (Zj = (xj , yj ))j≥1 be a τ −mixing process with rate τ (k), satisfying Assumption (B1). For any η ∈ (0, 1/2] the probability of each one of the following events is at least 1 − η:    Σ 2R ⋆ −1 p + Tx fν − Sx y ≤ 21 log 2η ; ℓ1 ℓ1   p 1  Σ N (λ) 2λ− 2 R − 21 ⋆ −1 p + ; (T + λ) (Tx fν − Sx y) ≤ 21 log 2η ℓ2 ℓ2 (4.4) p  −1/2  N (λ) 2λ −1/2 √ (T + λ) (T − Tx ) ≤ 21 log 2η −1 ; + ℓ3 ℓ3  L T − Tx ≤ log 2η −1 √ , ℓ4 where L is some large numerical constant, that does not depend on n; N (λ) := −1 T r (T + λ) T is the so-called effective dimension; ℓ1 , ℓ2 , ℓ3 , ℓ4 are in each case the bounds on the effective sample size. For exponentially and polynomially τ −mixing rates, corresponding bounds for effective sample sizes are given in Table 1. For exponentially τ -mixing variables, an additional constraint ni on the minimal (true) sample size must be satisfied, given in Table 2. Table 1 Bounds on effective samples sizes for (4.4). τ (k) = χ exp(−θk γ ) ℓ1  ℓ2  ℓ3 ℓ4 n  2  n max(1,K(R+2))χ 2 log γ 2R 2  2 log γ  n n max(1,K(R+2))χ 2R n  2 log 2 γ (nKχ) n 2 2 log γ (nKχ)       " Σ max(1,K(R+2))ρ √ Σ λ τ (k) = ρk −γ  2 2γ+1 N (λ) −1 2 max(1,K(R+2))ρ " √ N (λ) 2Kρλ  −1 2 1 Kρ    2 2γ+1 2 2γ+1 n 2 2 2γ+1 n 2  n 2  2γ 2γ+1  n 2 2γ 2γ+1 2γ 2γ+1   2γ 2γ+1 # #  Remark. The first inequality will not be used in the statistical analysis to follow and is presented here for completeness. Armed with the above probabilistic results, we derive upper bounds for the errors of estimation of fν by means of the general regularized kernel learning estimators (4.3). The main tool is the following lemma, giving a high probability inequality on the deviation of the estimation error. The gist of this result and of its proof is to follow the approach of [7], wherein the sample size in the i.i.d. case is replaced by the effective sample size, the rest of the argument being essentially the same. G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 15 Table 2 Sufficient sample sizes ni to ensure conditions Theorem 3.5 for an exponentially τ -mixing process. n1 n2 n3 n4 τ (k) = χ exp(−θk γ )   1 2R exp( θ ) max(1,K(R+2))χ  2R exp( 1 θ) max(1,K(R+2))χ   1 exp( θ ) Kχ 1 exp( θ ) Kχ    Lemma 4.2. Consider the same assumptions as in Lemma 4.1. Assume that fν ∈ Ω(r, D) (defined by (4.1)) for some positive numbers r, D. Also, let fz,λ be the regularized estimator as in 4.3, with a regularization satisfying conditions (i)-(iv) with qualification q ≥ r + s. Fix numbers η ∈ (0, 1] and λ ∈ (0, 1] and denote: γ := max(γ0 , γq ), ℓ0 := C0 λ−1 max(N (λ), 1) log2   8 , η where we recall that γ0 , γq are the constants from conditions iii)-iv) and C0 some positive constant. Then with probability at least 1 − η, the inequality kT s (fHk − fz,λ )kHk ≤ Cr,s,B,E,γ log(8η ′ −1 s )λ   1 r γD λ + √ ′ + ℓ R + ℓ′ λ r Σ2 N (λ) ℓ′ !! , (4.5) ′ holds with ℓ = min{ℓ2 , ℓ3 , ℓ4 }, provided that ℓ ≥ ℓ0 and all ℓi are as in Table 1. For an exponentially τ -mixing process with rate τ (k) = χ exp(−θk γ ), the 2 exp( 1 ) additional constraint n ≥ Kχ θ on the actual sample size has to be fulfilled. We remark that the choice s = 0 corresponds to the estimation error in the space Hk , whereas s = 12 corresponds to the prediction error in the space L2 (X , µ). Finally, we establish the asymptotic error bounds for the family of regularized estimators of the type (4.3), when learning from a τ −mixing sequence, under appropriate choice of regularization parameter sequence λn . We separate the analysis between the cases of exponentially and polynomially τ −mixing processes. For exponentially τ −mixing process (xi , yi )i≥1 with mixing rate τ (k) = G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums χ exp(−θk γ ), we consider the following parameter sequence:   b   2br+b+1  2 2 γ 4nKχ 2Σ log R    , 1. λn,(Σ,D) := min 2 D n ′ Setting ℓg := n 2 2(log( 4nKχ )) γ R 16 (4.6) , we observe (by straightforward calculation, using ′ the fact that R ≤ 1 ) that the constraint ℓg ≤ min{ℓ2 , ℓ3 , ℓ4 } is fullfilled. With ′ this choice of ℓg and of λn , we are able to formulate the next statement: Theorem 4.3. Assume the data generating distribution ν belongs to the class M(Σ, R, D), and fz,λn is a kernel spectral regularization estimator (4.3) with qualification q ≥ r + s, where λn is given by (4.6). Fix some η ∈ (0, 1] and br ′ ′ choose n0 large enough so that both inequalities log(8η −1 ) ≤ C (ℓg ) 2br+b+1 and ′ 2 exp( 1 ) n0 ≥ Kχ θ hold for given choice of ℓg and constants of the model. Then for n ≥ n0 , it holds with probability at least 1 − η: kT s (fν − fz,λn )kHk  2b(r+s)  2br+b+1 Σ ≤ C⋆ log(8η −1 )D q  , D ℓ′g (4.7) where C⋆ := Cr,s,B,E,γ,b,β is some factor depending on regularization and smoothness parameters. We establish an analogous result for a polynomially τ −mixing process (xi , yi )i≥1 with mixing rate τ (k) = ρk −γ , without precisely tracking the effects of the constants (Σ, D). We consider the following parameter sequence:   −bγ λn := min n (2γ+1)rb+γ(b+1)+b , 1 , (4.8) Similarly to the case of an exponential decay rate, we Lemma 4.2 with the choice  2γ 2 ′ ′ ℓ := ℓp = (λn N (λn )) 2γ+1 n2 2γ+1 , which depends on the regularization and on the effective dimension; by arguments similar to Theorem 4.3 we then obtain: Theorem 4.4. Assume the data generating distribution ν belongs to the class M(Σ, R, D), and fz,λn is a kernel spectral regularization estimator (4.3) with qualification q ≥ r + s, where λn is given by (4.8). For any fixed η ∈ [0, 1] and ′ brγ all n > n0 (where n0 is such that log(8η −1 ) ≤ C n0(2γ+1)br+γ(b+1)+b holds with C being some numerical constant), we have with probability at least 1 − η: b(r+s)γ   (2γ+1)br+γ(b+1)+b 1 kT s (fν − fz,λn )k ≤ C△ log(8η −1 ) , n ′ (4.9) where C△ := CR,Σ,D,r,s,B,E,γ,b,β is some factor depending on regularization and smoothness parameters of the model. G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 17 Let us briefly discuss the upper bounds for the risk of the general regularization methods, described in Theorems 4.3 and 4.4. Asymptotic in nature, those results are based on the concentration inequality (3.4) which allows the control of an error on the exponential scale. Comparing the result of Theorem 4.3 to risk bounds obtained for i.i.d. scenario (e.g. in [7]), we observe that in the case of exponentially mixing process the upper bounds are optimal up to a logarithmic factor. Since we describe the explicit dependence of the sequence λn on Σ and D, further analysis can be conducted exploring other regimes in which either Σ or D may depend on n. Appendix A: Proofs of the results We need the following auxiliary results to complete the proof of Theorem 3.4. We will use repeatedly the shorthand notation π(x) := ex − x − 1. Lemma A.1. Assume that (Xi )i≥1 is a C−mixing stochastic process with values in closed subspace X = B(c) of separable Banach space (B, k·k) such that Assumptions A1,A2,A3 hold. Let furthermore (i1 , . . . , ik ) be a k-tuple of nonnegative integers, such that i1 < i2 . . . < ik , λ ≥ 0 and S̃k := Xi1 + Xi2 + . . . + Xik . Then the following holds:  k−1    π(λc) Y (1 + p(dj , λ)) , E exp λ S̃k ≤ 2 1 + Bσ 2 2 c j=1 where p(k, λ) := λÃ1 ΦC (k) + B C2 ΦC (k) + σ 2 j ≥ 2, and B := A21 + A2 , Ã1 = C1 A1 .  π(λc) c2 , dj := ij − ij−1 for all Lemma A.2. Assume that (Xi )ni=1 is a random sample from a X -valued centered ΦC −mixing process, such that Assumptions A1,A2,A3 hold. For n = ℓk+r, where ℓ, k > 1 are some integers and r ∈ {0, 1, . . . , k − 1}, and any λ ≥ 0 we have:    n i   λc  h  1X B 2 Xi ≤ 2 exp 2 (ℓ + 1)σ + C2 ℓΦC (k) π + λÃ1 ΦC (k) . E exp λ n i=1 c ℓ (A.1) where Ã1 and B are defined as in Lemma A.1. Lemma A.3. If all the conditions of Lemma A.2 hold then the following (exponential) inequality holds: ! n 1 X  ℓ t2 − 4m̃t  , P Xi ≥ t ≤ 2 exp − tc n i=1 4 3 + σ̃ 2 B where m̃ := Ã1 ΦC (k) and σ̃ 2 := σ 2 + C2 ΦC (k). Alternatively, for any ν > 0 it can be written as: r   n B σ̃ 2 ν 1X 4 cν P Xi ≥ 4m̃ + 4 ≤ 2 exp(−ν). + n i=1 ℓ 3 ℓ G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 18 Proof of Lemma 1. Since by Assumption A2 the norm of the variables Xi , i ≥ 1, are almost surely bounded by c, we can without loss of generality restrict (up to a modification on a negligible set) to the case X = B(c). The backbone of the proof follows the technical approach of [29]. Use as a first step E[exp(λkS̃k k)] ≤ 2E[cosh(λkS̃k k)]. The next step consists in bounding iteratively, going from S̃k to S̃k−1 by conditional expectation. To this end, we first need some (deterministic) bounds relating cosh(λks + xk) to cosh(λksk). Let s, x be elements of X . Introduce the following functions for t ∈ [0, 1]: h(t) := ks + txk . f (t) := cosh(λh(t)) , For any t ∈ [0, 1] such that h(t) 6= 0, it holds f ′ (t) = λ sinh(λh(t))h′ (t) = λ sinh(λh(t)) Ds+tx k·k, x . (A.2) If for some t0 , it holds h(t0 ) = 0, then h itself may not be differentiable in t0 , however f ′ (t) exists, and is equal to 0, in this case. Namely, if x = 0 then h must be identically zero, otherwise h(t) 6= 0 for t 6= t0 , and (A.2) holds for any t 6= t0 , implying by Assumption A1 |f ′ (t)| ≤ A1 λkxk sinh(λh(t)); this implies differentiability in t0 since the limit of the derivative exists (and is equal to 0) as t → t0 , and the function f (t) is continuous. Similarly, for any t ∈ [0, 1] with h(t) 6= 0, and using Assumption A1: f ′′ (t) = λ2 cosh(λh(t))h′ (t)2 + λ sinh(λh(t))h′′ (t) = λ2 cosh(λh(t)) Ds+tx k·k, x 2 + λ sinh(λh(t))δx,x ≤ A21 λ2 kxk2 cosh(λh(t)) + A2 λkxk2 s + tx sinh(λh(t)) h(t)  ≤ λ2 kxk2 B cosh(λh(t)) , where we have used sinh(x) ≤ x cosh(x). We conclude that f ′ (t) is absolutely continuous: unless f (t) is identically 0, there exists at most a single point t0 ∈ [0, 1] where h(t0 ) = 0 and where f may not be differentiable. We can therefore use the Taylor expansion: Z 1 f (1) = f (0) + f ′ (0) + (1 − t)f ′′ (t)dt , (A.3) 0 and the integral rest can be bounded using the previous inequality on f ′′ together with the triangle inequality, the elementary inequality cosh(a + b) ≤ cosh(a) exp(b) for b ≥ 0, and recalling kxk ≤ c: Z 1 Z 1 2 (1 − t) cosh(λ(ksk + tkxk))dt (1 − t)f ′′ (t)dt ≤ λ2 kxk B 0 0 2 2 ≤ λ kxk B cosh(λksk) 2 = kxk B cosh(λksk) Z 1 0 (1 − t) exp(λtc)dt π(λc) . c2 G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 19 Combining this with (A.3) and (A.2) we get for s 6= 0:   2 π(λc) , (A.4) cosh(λks + xk) = f (1) ≤ cosh(λksk) 1 + λhDs k.k, xi + kxk B 2 c where we have used sinh a ≤ cosh a in (A.2). The above inequality remains true for s = 0 if we formally define D0 k.k as 0, due to f ′ (0) = 0 in this case, as argued earlier.   We now go back to our initial goal of controlling E cosh λ S̃k . We use the notation Ej−1 [·] := E[·|Mij−1 ] where Mij−1 = σ(Xl : 1 ≤ l ≤ ij−1 ), l ∈ N using s := S̃k−1 , x = Xik then taking conditional expectations in (A.4), we obtain   Ek−1 cosh λ S̃k       2  π(λc) 1 + λEk−1 DS̃k−1 k.k, Xik + Ek−1 kXik k B 2 ≤ cosh λ S̃k−1 . c (A.5) In order to control the conditional expectation of the duality product on the right-hand side of (A.5) we make use of the following lemma: Lemma A.4. Assume X , Y, T are three Polish spaces. Let F be a measurable real-valued function defined on X × T , and let (X, Y ) be a X × Y-valued random variable (X × Y being endowed with its Borel sigma-algebra) on an underlying probability space (Ω, F , P). Denote through B(t, ǫ) an open ball of radius ǫ, centered at point t ∈ T . Assume that F (X, t) is P-integrable for all t ∈ T and that the following holds: 1. For all t ∈ T , kE[F (X, t)|Y ] − E[F (X, t)]k∞ ≤ C < ∞ ; 2. The mapping t 7→ F (x, t) is continuous in t for all x ∈ X ; 3. There exists ε > 0 and for all t ∈ T a measurable function Lt (x) : X → R+ such that for all x ∈ X , supt′ ∈B(t,ε) |F (x, t′ )| ≤ Lt (x), and Lt (X) is Pintegrable. Then, there is is a version of the conditional expectations E[F (X, t)|Y ] such that for P-almost all y ∈ Y, we have:   ∀t ∈ T E[F (X, t)|Y = y] − E F (X, t) ≤ C . (A.6) In particular, if T = Y, under the previous assumptions we conclude that   e Y )|Y E[F (X, Y )|Y ] − E F (X, e is a copy of X which is independent of Y . where X ∞ ≤C, (A.7) (Observe that the whole point of this lemma is the inversion of quantificators “for all t, for almost all y” between its assumption (1) and the conclusion (A.6).) G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 20 Proof. Since X is Polish, there exists a regular conditional probability P(X ∈ ·|Y = ·), and we choose as a particular version of all conditional expectations the pointwise integral with respect to this stochastic kernel. By uniform local domination and continuity of F in t (Assumptions 2-3), the function t 7→ E[F (X, t)] is continuous. Therefore, replacing F by Fe(x, t) := F (x, t)−E[F (X, t)] and Lt by 2Lt , we can assume without loss of generality that E[F (X, t)] = 0 for all t ∈ T . Since T is assumed to be Polish, it is in particular separable; let Te be a countable dense subset of T . From assumption (1), for  each t̃ ∈ Te there exists a measurable set At̃ ⊂ Y with P Y ∈ At̃ = 1, such that R F (x, t̃)dP(x|Y = y) ≤ C for all y ∈ At̃ . RFurthermore, for any t̃ ∈ Te , since X the function Lt̃ (X) is P-integrable, it holds X Lt̃ (x)dP(x|Y = y) < ∞ for all  y ∈ Bt̃ ⊂ Y with P Y ∈ Bt̃ = 1. T This together with countability implies that the set A := t̃∈Te (At̃ ∩ Bt̃ ) is  R such that P Y ∈ A = 1 and for all (y, t̃) ∈ A × Te , we have X F (x, t̃)dP(x|Y = y) ≤ C and x → Lt̃ (x) is P(·|Y = y)-integrable. For an arbitrary t ∈ T , let t̃n be a sequence of points in Te converging to t in T . We can assume without loss of generality that for all n, d(t̃n , t) < ε/2 (where ε > 0 is from Assumption 3), so that d(t̃n , t̃n′ ) ≤ ε for all n, n′ , implying that supn |F (x, tn )| ≤ Lt̃1 (x) holds (by Assumption 3). Now for all y ∈ A, using continuity (Assumption 2) we have for the conditional expectation under the regular conditional probability P(·|Y = y), and by dominated convergence: Z Z lim F (x, t̃n )dP(x|Y = y) F (x, t)dP(x|Y = y) = X n→∞ X Z F (x, t̃n )dP(x|Y = y) = lim n→∞ ≤C. X In the case T = Y, we note that (A.6) implies (A.7) by choosing t = y. We now use Lemma A.4 with Y = X ∗ , F (x, y) = hy, xi, and (X, Y ) = (Xik , DS̃k−1 k·k). By linearity of scalar product and expectation, and because the process (Xi )i≥1 is centered, we have for fixed y ∈ X ∗ : E[hy, Xik i] = 0. Obviously F is continuous in its first argument. Since by Assumptions A2 Ds k·k is uniformly bounded and X = B(c), we can restrict the domain of F to X × B ⋆ (A1 ), and F is then bounded uniformly, so that conditions (2) and (3) of Lemma A.4 are satisfied. Because of the Assumption A3 it follows that we have kF (y, ·)kC ≤ C1 kF (y, ·)k∞ ≤ C1 A1 . Finally, due to conditions on ΦC mixing coefficients, we have that condition (1) is fulfilled with the constant C = A1 C1 ΦC (dk ) := Ã1 ΦC (dk ), so from (A.7) we conclude, that:   ≤ Ã1 Φ(dk ) . Ek−1 DS̃k−1 k.k, Xik (A.8) We turn to the control of the second conditional expectation on the right-hand side of (A.5). Using the ΦC -mixing assumption and Assumptions A2,A3 again, G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 21 we have almost surely (recalling dk := ik − ik−1 ):         Ek−1 kXik k2 ≤ Ek−1 kXik k2 − E kXik k2 + E kXik k2 ≤ C2 ΦC (dk ) + σ 2 , 2 since by Assumption A3 x 7→ kxk bounded in semi-norm C(f ) on B(c) by some constant C2 . Putting this bound together with (A.8) in the inequality (A.5), we get:    ≤ cosh λ S̃k−1 (1 + p(dk , λ)) , Ek−1 cosh λ S̃k   . where we recall p(k, λ) := λÃ1 ΦC (k) + B C2 ΦC (k) + σ 2 π(λc) 2 c Iteratively repeating the aforementioned argument and considering that the bound on conditional expectation Ek−1 [·] holds almost surely, one obtains :      = E Ek−1 cosh λ S̃k E cosh λ S̃k   ≤ E cosh λ S̃k−1 (1 + p(dk , λ)) k  Y  (1 + p(dj , λ)). ≤ E cosh λ Xi1 j=2   For bounding E cosh λ Xi1 we use A.4 with s = 0 and obtain:   σ2 2 π(λc) ≤ 1 + 2 Bπ(λc) , E[coshkXi1 k] ≤ E 1 + kXi1 k B 2 c c which implies the claim. To proceed in the proof, we use the classical ([8],[38],[19]) approach to divide the sample (X1 , . . . , Xn ) into blocks, such that the distance between two neighbor elements in a given block will be large enough to ensure small dependence. We partition the set {1, 2, . . . , n} into k blocks in the following way. Write n = ℓk + r, 0 ≤ r ≤ k − 1 and define ( {i, i + k, . . . , i + ℓk}, if 1 ≤ i ≤ r , Ii = {i, i + k, . . . , i + (ℓ − 1)k}, if r + 1 ≤ i ≤ k . Denote through |Ii | the number of elements in the i−th block; it holds |Ii | = ℓ+1 Pk for 1 ≤Pi ≤ r, |Ii | = ℓ for r+1 ≤ i ≤ k, and i=1 |Ii | = n. Introduce the notation SIi = j∈Ii Xj . Now me may use Lemma A.1 for each of the constructed blocks Ii , 1 ≤ i ≤ k to prove Lemma A.2. Pk Proof of Lemma 2. By the triangle inequality kSn k ≤ j=1 SIj , implying for any λ > 0, via the convexity of the exponential function:    X    X k k i h λ SIj λ rj E exp rj ≤ , SIj kSn k ≤ E exp λ E exp n |Ij | |Ij | j=1 j=1 (A.9) G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 22 P |I | where rj := nj , with kj=1 rj = 1. Now for each summand in the last sum, we apply Lemma A.1 for the index tuple given by the ordered elements of Ij , yielding   |Ij |−1 h  λ i  σ 2  λc   . E exp ≤2 1+B 2π 1 + p k, |Iλj | SIj |Ij | c |Ij | Using this last bound into (A.9), we obtain:   k h λ  i |Ij |−1 X σ 2  λc   E exp rj 1 + B 2 π 1 + p k, |Iλj | kSn k ≤ 2 n c |Ij | j=1    Bσ 2  λc  exp ℓp k, λℓ , π rj exp ≤2 2 c ℓ j=1 k X where we twice used the inequality 1 + x ≤ exp(x), the condition ℓ ≤ |Ij | ≤ ℓ + 1, and the fact that p(k, ·) is non-decreasing in function for fixed k. The last quantity is equivalent to the claim of the lemma. Proof of Lemma 3. Using Chernoff’s bound and Lemma A.2, we obtain for any λ > 0: i i h h  P n1 kSn k ≥ t = P exp n1 λSn ≥ exp(λt) h i ≤ exp(−λt)E exp nλ kSn k (A.10)     (ℓ + 1)B λc ≤ 2 exp −λ(t − m̃) + σ̃ 2 , π c2 ℓ where m̃ := Ã1 ΦC (k) and σ̃ 2 := σ 2 + C2 ΦC (k) . First we get the upper bound on the value of the function π( λc l ). By using the Taylor series decomposition, simple inequality 2 · 3k−2 ≤ k! for k ∈ N and summing the geometric series we obtain:  λc π ℓ  ≤ = j ∞  X λc j=2 ℓ 1 2 · 3j−2 λ2 c2 1 , 2ℓ2 1 − λc 3ℓ where we assume, that 0 < λ < 3ℓ c . Inserting this inequality into A.10 and simplifying the terms we get:   i h 1 2 2 3(ℓ + 1)B 1 kS k ≥ t ≤ 2 exp −λ(t − m̃) + σ̃ λ . (A.11) P n n 2ℓ 3ℓ − λc G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums Now we put λ = tℓ tc 2 3 +σ̃ B 23 . Clearly, by this choice of λ we have: λ = ℓ tc 3 t 3 ≤ 2 c + σ̃ B Thus, the choice of λ satisfies the assumption and into the exponent of the right hand side of A.11 we obtain: 3 (ℓ + 1)B 2 1 − λ(t − m̃) + σ̃ 2 λ 2 ℓ 3ℓ − λc tℓ(t − m) 3 2 (ℓ + 1)B t2 ℓ 2 1 = − tc + σ̃  2 tℓc 2 tc 2 ℓ + σ̃ 2 B 3ℓ − tc +σ̃2 B 3 + σ̃ B 3 3 2 tℓ(t − m̃) 1 (ℓ + 1)t = − tc + tc 2 2 3 + σ̃ 2 B 3 + σ̃ B =− (ℓ − 1)t2 − 2ℓm̃t  2 2 tc 3 + σ̃ B Putting this into the exponent bound and upper bounding ℓ with 2(ℓ − 1), for ℓ ≥ 2, we get the claim of the lemma. Proof of Theorem 3.3. From the very last claim of the Lemma A.3 we have: ! n i h 1X ℓ t2 − 4m̃t  . P Xi ≥ t ≤ 2 exp − tc n i=1 4 3 + σ̃ 2 B Setting P ℓ(t2 −4m̃t) 2 4( tc 3 +σ̃ B )  := ν and solving the last equation in terms of t, we obtain: n 1X Xi ≥ 4Ã1 ΦC (k) + 4 n i=1 r  4 cν B σ̃ 2 ν ≤ 2 exp(−ν). + ℓ 3 ℓ (A.12) which proves the claim of the Theorem. Proof of the Theorem 3.4. From the Theorem 3.3 for the effective sample size ℓ⋆ we obtain straightforwardly with probability at least 1 − 2 exp(−v): v    u u B σ 2 + C c ∨ √σ   n ν X ⋆ 2 t ⋆ ℓ c 1 σ 4 cν ℓ Xi ≤ 4C1 A1 ⋆ ∨ √ + . +4 ⋆ n i=1 ℓ ℓ 3 ℓ⋆ ℓ⋆ (A.13) Define L̃ := 4C1 A1  c σ ∨√ ℓ⋆ ℓ⋆  +4 v   u u B σ2 + C c ∨ 2 ℓ⋆ t ℓ⋆ √σ ℓ⋆  ν + 4 cν . 3 ℓ⋆ G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 24 For a, b > 0 using the obvious inequality a ∨ b ≤ a + b and AM-GM we obtain: √ √ √   σ 4 cν Bνσ BC2 cν BC2 σν c +4 p √ + +4 √ +4 L̃ ≤ 4C1 A1 ⋆ + √ ⋆ ⋆ ⋆ ℓ ℓ 3 ℓ⋆ ⋆ ⋆ ℓ ℓ ℓ ℓ √ √     √ C2 c σ σ Bνσ Bν(C2 + c) 2cν √ ≤ 4C1 A1 ⋆ + √ + 2 + +4 √ +2 + ⋆ Bν ⋆ ⋆ ⋆ ⋆ ⋆ ℓ ℓ ℓ ℓ ℓ ℓ ℓ     √ √ √ σ c C2 ≤ √ . 4C1 A1 + 6 Bν + ⋆ 2ν + 2 Bν + 4C1 A1 + 4 Bν ℓ c ℓ⋆ Finally, observe that the inequality   n √ √  √ C2 σ  1X c Xi ≤ √ , 4C1 A1 + 6 Bν + ⋆ 2ν + 2 Bν + 4C1 A1 + 4 Bν n i=1 ℓ c ℓ⋆ trivially holds also for ℓ⋆ = 1 despite the restriction ℓ ≥ 2 in the general result of Theorem 3.3. Thus, we can always assume that ℓ⋆ ≥ 2, such that the constraint on ℓ in the Theorem 3.3 with ℓ = ℓ⋆ is satisfied. The last claim implies the statement of the Theorem. Now we are equipped with all technical tools in order to prove the exponential bounds for different decay rates of the mixing coefficients. Proof of Proposition 3.5. We choose the reasonable bound ℓg on effective sample n < size ℓ⋆ in the case of geometrical mixing. Since ΦC (·)is nonincreasing and 2ℓ n n σ c ⌈ ℓ ⌉, so it is sufficient to choose ℓg , such that ΦC 2ℓ is smaller then ℓ ∨ √ . g g ℓg Moreover, in the  case of geometrical mixing, it is sufficient  to choose ℓg , such c n that only ΦC 2ℓg < ℓg (trivially this implies that ΦC 2ℓng < ℓcg ∨ √σ ). We ℓg    n for all n ≥ n0 = ⌈ χc exp θ1 ⌉. It is easy to check, that choose lg = 2 log2/γ ( nχ c ) in this case we get      n χn 2 ℓ g ΦC ≤ nχ exp −θ log 2ℓg c    χn  1 log ≤ nχ exp −θ · θ c = c, which together with the result of Theorem 3.4 implies the first claim of Proposition. For the case of polynomially mixing process we have the coefficient’s decay rate ΦC (k) = ρk −γ . Similarly as above we choose the bound ℓp for effective sample size ℓ⋆ so that the conditions of Theorem 3.4 are satisfied. Analogously, it G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums is sufficient to choose ℓp such that ΦC  n 2ℓp  ≤ √σ ∨ ℓcp . Solving ΦC ℓp n 2l in ℓ for given n, σ, c, ρ results in the following choice: 2   2γ+1  1 2γ   γ   n  2γ+1 σ c γ+1  n  γ+1 ℓp = max , , ρ 2 ρ 2  ≤ σ √ ℓ 25 ∨ cℓ (A.14) which matches exactly the one from the claim of the Proposition. For (xi , yi ) ∈ X × Y and fHk ∈ Hk we define ξ1,i = yi kxi − kxi hkxi , fHk i, ξ2,i = kxi ⊗ kx⋆i . Recall that HS(Hk ) is the space of Hilbert-Schmidt operators over Hilbert space Hk ; thus we have that ξ2,i ∈ HS(Hk ). As mentioned in the main body of the paper, in order to make use of the concentration inequalities for the sums of random variables in HS(Hk ) and in Hk we should assure, that the correspondent functions of the τ −mixing random variables are again τ −mixing. This claim is ensured by the following statement. Lemma A.5. We assume p that spaces X , Y and Hk , continuously differentiable kernel k (with supx∈X k(x, x) ≤ 1) are as defined before and constant R is as in assumption B1. Additionally, let the mixed partial derivative of kernel ∂1,2 k : X × X 7→ R be uniformly bounded by absolute constant K > 0. Consider the τ −mixing process (Zi = (xi , yi ))i≥1 with mixing coefficients τ (k). Then, the sequences of random variables (ξ1,i )i≥1 and (ξ2,i )i≥1 are also τ −mixing processes with mixing coefficients τξ1 (k) = max(K(R + 2), 1)χτ (k) and τξ2 (k) = 2Kτ (k). Proof of the Lemma A.5. We observe that if (Xt )t≥0 is τ −mixing then (kxt )t≥0 is also a τ −mixing sequence. Because of the assumption on the uniform boundedness of the (mixed) partial derivative of the kernel k and Lemma 3.3 from [6] we deduce, that kx is K−Lipschitz as map X 7→ Hk . Now, for every real-valued g : Hk 7→ R, such that kgkLip(Hk ) ≤ 1, and for all x1 , x2 ∈ X we have : |g(kx1 ) − g(kx2 )| ≤ kkx1 − kx2 kHk ≤ Kkx1 − x2 kX , (A.15) which approves the observation. In the similar vein, we show that both maps x 7→ kx hkx , ·i and (y, x) 7→ ykx ∈ Hk are the Lipschitz functions and calculate their Lipschitz seminorms. For arbitrary x1 , x2 we obtain: kx1 ⊗ kx⋆1 − kx2 ⊗ kx⋆2 2 HS 2 = kx1 ⊗ kx⋆1 − kx1 ⊗ kx⋆2 + kx1 ⊗ kx⋆2 − kx2 ⊗ kx⋆2 HS  2 2 = kx1 ⊗ kx⋆1 − kx⋆2 HS + (kx1 − kx2 ) ⊗ kx⋆2 HS  + 2 kx1 ⊗ kx⋆1 − kx⋆2 , (kx1 − kx2 ) ⊗ kx⋆2 2 2 2 ≤ kkx1 kHk kx⋆1 − kx⋆2 H + kkx1 − kx2 kHk kx⋆2 k q 2 + 2 kkx1 kHk kkx2 k2Hk kkx1 − kx2 k2Hk 2 Hk 2 ≤ 4K 2 kx1 − x2 k , (A.16) G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 26 where we used the properties of Hilbert-Schmidt norm of tensor product operator, Cauchy-Schwartz inequality in the third line, and the assumptions 2 about boundedness of the kernel kkx kHk = k(x, x) ≤ 1 and that the map kx is K−Lipschitz in the last line. We obtained that kx1 ⊗ kx⋆1 − kx2 ⊗ kx⋆2 HS ≤ 2Kkx1 − x2 k, so 2K is the Lipschitz constant of the map x 7→ kx hkx , ·i. This approves the form of the mixing rate for the sequence ξ2,i . Quite analogously, for any (x1 , y1 ), (x2 , y2 ) ∈ X ×Y and the map (x, y) 7→ ykx we have: ky1 kx1 − y2 kx2 kHk = ky1 kx1 − y1 kx2 + y1 kx2 − y2 kx2 kHk = ky1 (kx1 − kx2 ) + kx2 (y1 − y2 )kHk ≤ KRkx1 − x2 kX + |y1 − y2 | (A.17) ≤ max(KR, 1)(kx1 − x2 kX + |y1 − y2 |). The latter implies that the map (x, y) 7→ ykx is Lipschitz and its Lipschitz norm is max(KR, 1). Then ξ1 : X × Y 7→ HS(Hk ) which is defined as ξ1 (x, y)[·] := ykx − kx hkx , ·i is a Hilbert-Schmidt operator. By gathering bounds from (A.16) and (A.17), we deduce: kξ1 kLipHS(H k) (X ×Y) ≤ max(1, K(R + 2)), which finally approves the claim of the lemma. Sketch of the proof of Lemma 4.2. The proof is analogous in form and spirit to that of Proposition 5.8 for the i.i.d case given in [7]. The main difference is reflected in using high probability upper bounds from Lemmata 4.1 ( (2),(3), (4)) and B.1 instead of their i.i.d. counterparts, which in each case invlolve ′ the knowledge of the bounds on the effective sample size ℓ . The appropriate choice of the latter is assured by the two conditions from the Theorem. Namely, ′ ℓ ≥ ℓ0 implies the claim of Lemma B.1 (which is the τ −mixing counterpart of ′ the Lemma 5.4 from [7]). On the other hand, the condition ℓ ≤ min{ℓ2 , ℓ3 , ℓ4 } ′ implies that all inequalities from 4.1 hold for ℓ . The remaining reasoning is the same as in Proposition (5.8) from [7]. Proof of Theorem 4.3 . The proof of the first part of the Theorem is in the essense the direct extension of the proof of Corollary 5.9 in [7] to the case of τ −mixing stationary sequence. As the marginal distribution µ belongs to the class P < (b, β) (by assumption), from the Proposition 3 in [11] for any choice of parameter λ ∈ (0, 1] we obtain: 1 N (λ) ≤ C̃b,β λ− b . ′ (A.18) For a given choice of parameter λn and ℓg as function of n it is easy to check by straightforward calculation that the assumption of the Lemma B.1 holds G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums br  ′  2br+b+1 ′ and n ≥ provided n is such that both log(8η −1 ) ≤ C ℓg 2 exp( θ1 ) . Kχ 27 This ′ implies, that ℓg ≥ ℓ0 , where ℓ0 is defined as in Lemma 4.2 with the choice of the parameter sequence which is given by the equation (4.6). ′ Thus, as the given quantity ℓg fullfills all the requirements of Lemma 4.2, from this result we have with probability at least 1 − η: kT s (fν − fz,λn )kHk ≤ C̃ log(8η −1 )λsn  1  R D λrn + q + + ′ ℓg λn ℓ′g s Σ2 (λn )− ℓ′g b+1 b ! , where C̃ := Cr,s,b,β,γ,E,B,χ,γ . By direct computation, we check that the choice of regularization parameter ′ −1 ′ sequence λn implies that ℓg = o(λrn ). Therefore, if we take ℓg large enough and multiply the front factor with 2, we can asymptotically disregard the term ′ −1/2 in the above bound. Moreover, by doing further computations we can ℓg ′ −1/2 − b+1  check that ℓ′Rλ = o ℓg λn 2b , so we can drop this term when comparg n ′ ing to the doubled second term for sufficiently large ℓg . This implies that we can disregard corresponding terms of smaller order and consider only the main terms for the asymptotical analysis. Finally, the proposed choice of parameter λn balances precisely the last two terms and leads to the conclusion. Proof of Theorem 4.4. Repeating the similar arguments to the ones from Theorem 4.3 we have: −1 N (λn ) ≤ C̃b,β λn b . (A.19) Disregarding the effects of the constants R, K in the formulas for the effective sample size from the Table 1, the choice of the bound for effective sample size  2γ 2 ′ ′ ℓp = (λn N (λn )) 2γ+1 n2 2γ+1 assures that condition ℓ ≤ min{ℓ2 , ℓ3 , ℓ4 } is full′ ′ filled with ℓ = ℓp (which can be checked by straightforward computation) and λn as defined by (4.8). Furthermore, for n > n0 , where n0 is as specified in the statement of the Theorem, we obtain : brγ log η −1 ≤ Cb,β,Σ,D,ρ,R n (2γ+1)br+γ(b+1)+b , which, by plugging in the quantities for λn , N (λn ) into the condition of the ′ Lemma B.1 implies that ℓ ≥ ℓ0 (with somewhat different numerical constant, which effect will not be tracked in precise ). Thus, without tracking in precise the multiplicative constants in case of polynomially mixing with the rate τ (k) = ρk −γ for n > n0 : kT s (fν − fz,λn )kHk   ≤ C̃η λsn Dλrn + 1 −( b−1 2b ) 2γ+1 λn γ n 2γ+1  γ − 1b γ(b+1)+b R 2γ+1 + n− 2γ+1 , + λn 1 2γ 1+ 2γ+1 ( b−1 b ) λn n 2γ+1  G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 28 where C̃η = C̃ log(8η −1 ), with C̃ being some absolute constant . We observe, b−1 −( ) 1 λn 2b 2γ+1 that the choice of regularization parameter λn implies that = γ n 2γ+1 o(λrn ). Therefore, similarly to the case of exponentially τ −mixing process, taking n large enough and multiplying the front factor with 2 we can for big n −( b−1 ) 1 2b 2γ+1 in the above bound. Similarly, one can check disregard the term λn γ that: n 2γ+1   1 γ(b+1)+b γ − b 2γ+1 R − 2γ+1 , n = o λ n 1 2γ 1+ 2γ+1 ( b−1 b ) 2γ+1 n λn (A.20) so this term can be similarly asymptotically disregarded (again, multiplying the second term by 2). Therefore, we can concentrate the analysis on the remaining −1 γ(b+1)+b γ main terms which are λrn and λn b 2γ+1 n− 2γ+1 . The choice of λn balances exactly these terms and the computations lead to the conclusion. References [1] Andrews, D. (1984). Non-strong mixing autoregressive processes. J.Appl. Prob 21 930-934. [2] Andrews, D. (1988). Laws of large numbers for independent non identically distributed random variables. Econometric Theory 4 458-467. [3] Bauer, F., Pereversev, S. and Rosasco, L. (2009). On regularization Algorithms in Learning Theory. Journal of Complexity 1 53-72. [4] Bernstein, S. (1924). On a modification of Chebyschev’s inequality and of the error formula of Laplace. Ann. Sci. Inst. Sav. Ukraine, Sect. Math 4. [5] Bickel, P. and Buehlmann, P. (1999). A new mixing motivation and functional central limit theorems for a sieve bootstrap in times series. Bernoulli 5 413-446. [6] Blanchard, G., Lee, G. and Scott, G. (2011). Generalizing from Several Related Classification Tasks to a New Unlabeled Sample. [7] Blanchard, G. and Mücke, N. (2017). Optimal Rates for Regularization of Statistical Inverse Learning Problems. Foundations of Computational Mathematics. [8] Bosq, P. (1993). Bernstein-type large deviations inequalities for partial sums of strong mixing processes. Statistics 24 59-70. [9] Bradley, R. (2005). Basic Properties of Strong Mixing Conditions. Probability Surveys 2 107–144. [10] Caponetto, A. and De Vito, E. (2007). Optimal Rates for the Regularized Least-Squares Algorithm. Foundations of Computational Mathematics 7 331-368. G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 29 [11] De Vito, E., Caponetto, A. and Rosasco, L. (2006). Discretization Error Analysis for Tikhonov Regularization in Learning Theory. Analysis and Applications (1). [12] Dedecker, J., Doukhan, P., Lang, G., Leon, R., Louhichi, S. and Prieur, C. (2007). Weak dependence with examples and applications. Springer, New York. [13] Doukhan, P. and Louhichi, S. (1999). A new weak dependence condition and application to moment inequalities. Stoch. Proc. Appl. 84 313-342. [14] Engl, H. W., Hanke, M. and Neubauer, A. (1996). Regularization of inverse problems. Mathematics and its Applications 375. [15] Esary, J., Proschan, F. and Walkup, D. (1985). Association of random variables with applications. Ann. Math. Statist. 38 1466-1476. [16] Fan, X., Grama, I. and Liu, Q. (2015). Exponential inequalities for martingales with applications. Electron. J. Probab. 20 1-22. [17] Fortuyn, C., Kastelyan, P. and Ginibre, J. (1971). Correlation inequalities in some partially ordered sets. Com. Math. Phys. 74 119-122. [18] Freedman, D. (1975). On Tail Probabilities for Martingales. Ann. Probab. 3 100-118. [19] Hang, H. and Steinwart, I. (2017). A Bernstein-type Inequality for Some Mixing Processes and Dynamical Systems with Application to Learning. Ann. Statist. 1 2. [20] Hoeffding, W. (1963). Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association 58 13-30. [21] Ibragimov, I. A. (1959). Some limit theorem for stochastic processes stationary in strict sense. Dolk. Akad. Nauk.SSSR 125 711-714. [22] Kolmogorov, A. and Rozanov, J. (1960). On strong mixing conditions for stationary Gaussian process. Theo. Prob. Appl. 5 204-208. [23] Kontorovich, L. (2006). Metric and mixing sufficient conditions for concentration of measure. Preprint, arxiv.org/abs/math/0610427. [24] Kontorovich, L. and Ramanan, K. (2008). Concentration inequalities for dependent random variables via the martingale method. The Annals of Probability 36 2126-2158. [25] Marton, K. (2004). Measure concentration for euclidean distance in the case of dependent random variables. The Annals of Probability 32 25262544. [26] Maume-Deschamps, V. (2006). Exponential inequalities and functional estimations for weak dependent data; applications to dynamical systems. Stoch. Dyn. 6 535-560. [27] Mc Leish, D. (1975). Invariance principles and mixing random variables. Econometric Theory 4 165-178. [28] Merlevede, F., Peligrad, M. and Rio, E. (2009). Bernstein inequality and moderate deviations under strong mixing conditions. High dimensional probability 5 273-292. [29] Pinelis, I. (1992). An Approach to Inequalities for the Distributions of Infinite-Dimensional Martingales. Probability in Banach Spaces 8 138-134. [30] Pinelis, I. (1994). Optimum bounds for the distributions of martingales G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 30 in Banach spaces. Ann. Prob. 22 1679-1706. [31] Pinelis, I. and Sakhanenko, A. I. (1986). Remark on Inequalities for Large Deviation Probabilities. Theory Probab. Appl 30 143-148. [32] Rio, E. (1996). Sur le théoreme de Berry-Esseen pour les suites faiblement dépendantes. Probab. Th. Rel. Fields 104 255-282. [33] Rio, E. (2013). Extensions of the Hoeffding-Azuma. Electron. Commun. Probab. 18 1-6. [34] Rosasco, L., Belkin, M. and De Vito, E. (2010). On learning with integral operators. Journal of Machine Learning Research 2 905-934. [35] Rosenblatt, M. (1956). A central limit theorem and a strong mixing condition. Proc. Natl. Acad. Sci USA 42 43-47. [36] Samson, P. (2000). Concentration of measure inequalities for markov chains and Φ-mixing processes. Ann.Probab 28 416-461. [37] van de Geer, S. (2002). On Hoeffding’s inequality for dependent random variables. In Empirical Process Techniques for Dependent Data 161-170. Biirkäuser Boston. [38] Wintenberger, O. (2010). Deviation inequalities for sums of weakly dependent time series. Electronic Communications in Probability 15 489-503. [39] Yurinskyi, V. (1970). On an infinite-dimensional version of S.N. Bernstein inequalities. Theory Probab. Appl. 15 108-109. [40] Yurinskyi, V. (1995). Sums and Gaussian Vectors. Springer, Berlin. Appendix B: Proofs of auxiliary lemmata Proof of Lemma 4.1. Consider the random variable: ξ1 (x, y) := ykx − kx hkx , fν i, with values in Hk . It holds 0. By Assumption B1, 1 n Pn i=1 ξ(xi , yi ) = Sx∗ y−Tx fν , as well as E[ξ1 (x, y)] = kξ1 (x, y)k = kykx − kx hkx , fν ikHk ≤ kkx k|y − fν (x)| ≤ 2R. Due to Assumption B1 and restriction on the values of kernel function, we obtain the following bound on the variance: i Z h 2 hkx (y − fν (x)), kx (y − fν (x))idν(x, y) E kξ1 (x, y)k = X ×Y Z Z 2 = dµ(x)k(x, x) (y − fν (x)) dν(y|x) ≤ Σ2 . X Y Because of Lemma A.5 if (xi , yi )i≥1 is τ −mixing with rate τ (k), the sequence ξ1 (xi , yi )i≥1 is τ −mixing with rate τ (k) = max(1, K(R + 2))τ (k). Using the result of Corollary 3.6 with the aforementioned bounds on the norm, variance and G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 31 multiplicative correction for the decay rate, we obtain:   2R Σ ⋆ −1 , kSk y − T fHk k ≤ 21 log(2η ) √ + ℓ1 ℓ1 where the bound on the effective sample size ℓ1 is chosen by straightforward plugging-in the bounds for the norm, second moment and the form of mixing coefficients of the sequence ξ1 (xi , yi ) (which as mentioned depends on its Lipschitz norm) in the general form given by Proposition 3.5 and is given by 2   2γ+1  2γ n 2γ+1 Σ , for polynomially mixing process with rate ℓ1 = max(1,K(R+2)))ρ 2 τ (k) = ρk −γ and ℓ1 = n 2 2 log γ ( n max(1,K(R+2))χ ) 2R γ , for the exponentially mixing pro- cess with rate τ (k) = χ exp(−θk ) correspondingly . The upcoming inequalities will be derived in a similar way. We introduce the random variable: 1 ξ2 (x, y)[fν ] = (T + λ)− 2 (kx y − kx hkx , fν i), Quite analogously, we can check that E[ξ2 (x, y)[fν ]] = 0. Repeating similar steps we get: 1 (T + λ)− 2 (kx y − kx hkx , fν i) 1 Hk ≤ (T + λ)− 2 k(kx y − kx hkx , fν i)kHk 1 ≤ 2λ− 2 R. For the second moment of the norm of ξ2 (x, y)[fHk ] we get: Z D E h i −1 2 −1 E kξ2 (x, y)[fν ]k = (T + λ) 2 kx (y − fν (x)), (T + λ) 2 kx (y − fHk (x)) dν(x, y) X ×Y = Z − 21 (T + λ) X ≤Σ 2 kx 2 dµ(x) Z 2 (y − fν (x)) dν(y|x) Y Z   −1 T r (T + λ) 2 kx ⊗ kx⋆ dµ(x) X  p 2 = Σ N (λ) . Using Lemma A.5 for function ξ2 (x, y) one can readily check that: 1 1 kξ2 [fν ]kLip(X ) ≤ λ− 2 · max(1, K(R + 2)) = λ− 2 max(1, K(R + 2)), from which we can imply, that if {(xi , yi )}ni≥1 if a mixing sequence with rate 1 τ (k), then (ξ2 (xi , yi ))i≥1 is τ −mixing with the rate λ− 2 max(1, K(R + 2))τ (k). So finally, by using the Corollary 3.6 we obtain with probability at least 1 − η: ! p   1 2 −1 Σ N (λ) 2λ− 2 R − 12 ⋆ √ + κ , (T + λ) (Tx fHk − Sx y) ≤ 21 log η ℓ2 ℓ2 G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 32 where as before the choice ℓ2 is obtained by Proposition 3.5 for either polynomially or exponentially mixing process through considering bounds on the norm, second moment and Lipschitz norm of the elements of sequence ξ2 (xi , yi ). We define the map ξ3 : X 7→ HS(H) (here, as mentioned before, through HS(H) we denote the space of Hilbert-Schmidt operators on Hk ) by: −1 ξ3 (x) := (T + λ) (Tx − T ), where we defined Tx = kx ⊗ kx⋆ for some x ∈ X . Taking expectation we get: Z −1 E[ξ3 ] = (T + λ) (Tx − T )dµ(x) = 0. X So that we have: n (T + λ) −1 (T − Tx ) = 1X ξ3 (xi ) . n i=1 Verifying the conditions as before we have: kξ3 (x)kHS ≤ (T + λ)−1 kT − Tx kHS(Hk ) ≤ 2λ−1 , and   h i Z −2 2 T r (Tx − T )(T + λ) (Tx − T ) µ(dx) E kξ3 (x)kHS = ZX     −2 −2 T r Tx (T + λ) Tx µ(dx) − T r T(T + λ) T = X Z   −1 −1 ≤ kT + λk kTx kT r (T + λ) Tx µ(dx) ≤ λ−1 N (λ). X We can check that Lipschitz norm of ξ3 is bounded by: ξ3 LipHS (X ) ≤ 2λ−1 K, which analogously implies, that (ξ3 (xi , yi ))i≥1 is τ −mixing with rate 2λ−1 Kτ (k). We remark, that we use the notation k·kLipHS (X ) for the Lipschitz norm of HS(Hk )-valued variable which can be defined analogously to the real-valued case. Pn We use the result of the Theorem 3.4 applies for the quantity n1 i=1 ξ3 (xi ) and with probability at least 1 − η we have: !   −1/2 p  −1 λ N (λ) 2λ−1 2 √ + T +λ T − T x ≤ 21 log . η ℓ3 ℓ3 G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 33 where ℓ3 is chosen following the standard ”plug-in” scheme as before. Finally, define ξ4 (x) := (kx ⊗ kx⋆ − T ). Again the random variables ξ4 (xi ) are centered and we have: n Tx − T = 1X ξ4 (xi ). n i=1 Repeating the sceme we get: kξ4 (x)kHS(H) ≤ 2, i 2 E kξ4 (x)kHS(H) ≤ 4, h Also, as ξ4 (xi )i≥0 is τ −mixing with rate 2Kτ (k), using general deviation bound from Corollary 3.6 according to the same principle as before, we obtain with probability at least 1 − η:    2 2 2 √ + T − T x ≤ 21 log η ℓ4 ℓ4   42 log η2 Lη √ := √ , ≤ ℓ4 ℓ4 where ℓ4 is chosen according to the mixing rate and bounds on the norm, variance term and Lipschitz constants as before. Lemma B.1. Let that η ∈ (0, 1) and λ ∈ (0, 1] chosen such that it satisfies √ ′ p ℓ λ ≥ 60 log(2η −1 ) max(N (λ), 1), ′ with ℓ chosen to be the minimum of ℓ2 , ℓ3 , ℓ4 as in the Lemma 4.1. Then, with probability at least 1 − η holds: (Tx + λ)−1 (T + λ) ≤ 2. Proof of Lemma B.1. By means of the Neumann series decomposition we write: −1 (Tx + λ) −1 (T + λ) = (I − Tx (λ)) −1 = ∞ X Txj (λ), j=0 with Tx (λ) = (T + λ) (T − Tx ). If kTx (λ)k < 1 then the last series converges −1 and the norm of (Tx + λ) (T + λ) is bounded by the sum of the series of norms. By the Lemma 4.1 we have: ! r 3 N (λ) + ′ , kTx (λ)k ≤ Cη λℓ′ λℓ G.Blanchard and O.Zadorozhnyi/Concentration of C−mixing Banach-valued sums 34 where we put Cη = 21 log(2η −1 ) for η ∈ (0, 1) Using the lemma’s assumption and the fact that Cη > 10 for η ∈ (0, 1) we obtain: √ ′ p λℓ ≥ 3Cη max(N (λ), 1) ≥ 3Cη ≥ 30. This implies that 1 1 1 √ ′ ≤ . ′ ≤ λℓ 90Cη 30 λℓ Putting these pieces together we obtain:   1 1 1 < . + kTx (λ)k ≤ Cη 3Cη 90Cη 2 This implies, that with probability at least 1 − η: (Tx + λ) −1 (T + λ) ≤ 2.
10math.ST
1 Feedback Design for Multi-Antenna K -Tier Heterogeneous Downlink Cellular Networks arXiv:1708.03861v2 [cs.IT] 22 Nov 2017 Jeonghun Park, Namyoon Lee, and Robert W. Heath Jr. Abstract We characterize the ergodic spectral efficiency of a non-cooperative and a cooperative type of Ktier heterogeneous networks with limited feedback. In the non-cooperative case, a multi-antenna base station (BS) serves a single-antenna user using maximum-ratio transmission based on limited feedback. In the cooperative case, a BS coordination set is formed by using dynamic clustering across the tiers, wherein the intra-cluster interference is mitigated by using multi-cell zero-forcing also based on limited feedback. Modeling the network based on stochastic geometry, we derive analytical expressions for the ergodic spectral efficiency as a function of the system parameters. Leveraging the obtained expressions, we formulate feedback partition problems and obtain solutions to improve the ergodic spectral efficiency. Simulations show the spectral efficiency improvement by using the obtained feedback partitions. Our major findings are as follows: 1) In the non-cooperative case, the feedback is only useful in a particular tier if the mean interference is small enough. 2) In the cooperative case, allocating more feedback to stronger intra-cluster BSs is efficient. 3) In both cases, the obtained solutions do not change depending on instantaneous signal-to-interference ratio. J. Park and R. W. Heath Jr. are with the Wireless Networking and Communication Group (WNCG), Department of Electrical and Computer Engineering, The University of Texas at Austin, TX 78701, USA. (E-mail: { jeonghun, rheath} @utexas.edu) N. Lee is with Dept. of Electrical Engineering, POSTECH, 37673, Republic of Korea. (Email:[email protected]). This material is based upon work supported in part by the National Science Foundation under Grant No. NSF-CCF-1319556. A special case of this paper (feedback design in a cooperative single-tier network) appeared in IEEE Globecom Workshop 2016 [1]. 2 I. I NTRODUCTION A. Motivation In heterogeneous networks (HetNets), different types of base stations (BSs) are densely deployed to aggressively reuse the spectrum. One bottleneck in achieving the full gains of HetNets is interference. Compared to conventional single-tier cellular networks, a HetNet has various interference sources including intra-tier BSs and also cross-tier BSs. As a result, small network tiers such as femto (whose transmit power is small) are vulnerable to the interference. In dealing with interference in multiple antenna systems, channel state information at transmitters (CSIT) is necessary. In frequency division duplex (FDD) downlink cellular systems, limited knowledge of CSI is conventionally given to a base station (BS) by using limited feedback, where its accuracy is determined by the amount of feedback to quantize CSI. For this reason, it is important to use appropriate amount of feedack for providing high throughput. Determining the right amount of feedback is not easy, though. The main reason is that the feedback performance depends on the signal-to-interference plus noise ratio (SINR), which is intricately determined by the various system parameters of the HetNet. For this reason, revealing the relationship between the feedback performance and the system parameters should be preceded prior to determine the amount of feedback. To clarify this relationship, in this paper, we model a HetNet based on stochastic geometry, allowing us to analyze the rate performance as a function of the key system parameters and the amount of feedback. Leveraging the obtained analytical expressions, we formulate feedback partition problems and propose solutions to maximize the ergodic spectral efficiency. The presented feedback partitions show how the feedback should be allocated depending on the density, the number of antennas, the transmit power, and the biasing factor of each tier in the HetNet. B. Prior Work There has been some prior work on determining appropriate amount of feedback in various network environments. In [2], [3], it was assumed that single-tier BSs form a coordination set and use multi-cell zero-forcing to serve multiple users. In this setting, feedback allocating methods were proposed to obtain constant rate-loss compared to the perfect CSIT case. Similarly, in [4], an adaptive feedback strategy was proposed for maximizing the achievable rate of coordinated beamforming in a HetNet. Prior work also studied effects of limited feedback on the 3 achievable spatial degrees of freedom (DoF) [5]–[7]. For example, in [7], the achievable DoF was characterized as a function of the feedback in a HetNet, where a macro BS serves multiple users and pico BSs serve a single user. A common limitation of the prior work [2]–[7] is that a small network model is assumed, where only a few neighboring BSs and users are considered and their locations are deterministic. In this network model, it is hard to evaluate system-level performance obtained by averaging over many user’s and BS’s locations in a large size cellular network. To overcome the small-network limitation of the prior work [2]–[7], a Poisson point process (PPP) has been used to model a large size network. There is also prior work that explored limited feedback in a random network model based on a PPP. In [8], a BS cluster is randomly formed and the feedback is adaptively partitioned for this clustering. In [9], several closest BSs to a user were included in a cluster and the signal-to-interference plus noise ratio (SINR) performance with limited feedback was analyzed. In [10], the optimal feedback rate was obtained to maximize the net spectral efficiency, defined as the downlink rate normalized by the uplink feedback overheads. In [11], assuming an interference-limited ad-hoc network, the achievable rate was analyzed when spatial division multiple access is used with limited feedback. Similar to [11], in [12], an interference-limited device-to-device network was considered and the ergodic spectral efficiency of single-user maximum ratio transmission (MRT) was characterized as a function of the feedback. The prior work [8]–[12], however, assumed a single-tier network where all the BSs use the same transmit power and the BSs are distributed by the same density. In HetNets, there are multiple tiers whose transmit power and densities are different, and this heterogeneity changes rate coverage expressions as shown in [13]. For this reason, our case requires a new approach. C. Contributions In this paper, we characterize the ergodic spectral efficiency of multi-antenna K-tier downlink HetNets with limited feedback. We consider non-cooperative and cooperative HetNet operations. In both cases, the locations of each tier’s BS are modeled as mutually independent PPPs. In our non-cooperative case, each BS obtains limited feedback sent from an associated singleantenna user. Based on the obtained limited CSIT, a BS uses MRT precoding to serve a single user. We assume that the same amount of feedback is used in the same network tier’s BSs. We note that this assumption is only for the non-cooperative case; our cooperative case allows to 4 use different amount of feedback to the same tier BSs. In this particular scenario, we derive the signal-to-interference (SIR) complementary cumulative distribution function (CCDF) and the ergodic spectral efficiency as functions of the system parameters, such as the number of antennas, the biasing factor, the transmit power, the density, and the allocated feedback of each tier. Leveraging the obtained expressions, we formulate an optimization problem to determine the amount of feedback used for each tier to maximize a lower bound on the sum ergodic spectral efficiency. Subsequently, we propose a solution of the formulated problem. In our cooperative case, the BSs form a coordination set by using dynamic clustering, and mitigate the intra-cluster interference by using multi-cell ZF based on the limited feedback. Dynamic clustering is applied across the tiers in the HetNet, so that a coordination set can include different tiers’ BSs. Unfortunately, analyzing the performance of the considered BS coordination is not straightforward since the performance of the cluster can be different depending on the tiers of the BSs included in the cluster. For example, assuming that a cluster has L BSs in a K-tier HetNet, there can be K L possibilities of the cluster’s configuration. For this reason, we should consider all the cases to completely characterize the performance of the L-size cluster. To resolve this complexity, we derive a lemma showing that the intensity measure of received signal power in a HetNet can be transformed to the intensity measure of signal power in a statistically equivalent single-tier network by rescaling each tier’s density. By exploiting this lemma, we obtain the SIR CCDF and the ergodic spectral efficiency as a function of the relative system parameters such as the cluster size, the transmit power, the biasing factor, the relative signal power of the intra-cluster BSs, and the used feedback. Assuming that each intra-cluster BS uses the same number of antennas, we formulate and solve an optimization problem to partition the feedback. In addition, to overcome the restricted antenna assumption, we also investigate a general antenna case where each intra-cluster BS uses different number of antennas. As a special case, we study a single-tier cooperative network with limited feedback. Numerical results show the spectral efficiency gains obtained by using the proposed feedback partitions compared to the equal feedback partition. Our major findings are summarized as follows: 1) In the non-cooperative case, the feedback is only useful in a particular tier if the mean interference in the corresponding tier is small enough. 2) In the cooperative case, more feedback is allocated to the BSs whose signal powers are larger. 3) If a single-tier network is assumed, the effective cluster size increases as the square root of the total feedback. 4) In both cases, the proposed feedback partitions do not change depending on instantaneous SIR. 5 The paper is organized as follows. Section II introduces the system models in non-cooperative and cooperative HetNet operation. In Section III, the performance of a HetNet in the noncooperative case is characterized and the feedback partitions are obtained based on the ergodic spectral efficiency. In Section IV, the same task is performed in the cooperative HetNet case. Section V provides numerical results and Section VI concludes the paper. II. S YSTEM M ODEL In this section, we introduce the system model assumed in the paper. We first describe the network model using stochastic geometry, and explain how the typical user associated with a BS. Then we illustrate the clustering model that uses dynamic clustering in the considered HetNet. Next, we introduce the feedback model for quantifying the channel quantization error due to limited feedback. Performance metrics are defined in the following subsection. A. Network and Cell Association Model We consider a K-tier downlink HetNet. Focusing on the k-th tier for k ∈ K = {1, 2, · · · K}, BSs equipped with Nk antennas are spatially distributed according to a homogeneous PPP,  Φk = dki ∈ R2 , i ∈ N with density λk . All the BSs in the k-th tier use the same transmit power Pk and biasing factor Sk . Equivalently, the k-th tier network may be represented as a k marked PPP, ΦM k = {di , Pk , Sk , Nk , i ∈ N} with density λk where Pk , Sk , and Nk are the same marks for all the points in Φk . Without loss of generality, we assume that dki ≤ dkj if i < j; thereby dk1 indicates the nearest BS location to the origin in the k-th tier. Spatial locations of BSs in different tiers are assumed to be mutually independent. Using the superposition property of independent PPPs, we compactly represent the K-tier HetNet as an unified marked PPP P M Φ̃M = k∈K ΦM = {di , π(i), Pπ(i) , Sπ(i) , Nπ(i) , i ∈ N}, where π(i) ∈ K is an k . We write Φ̃ index function indicating the tier of the corresponding point di . Assuming that kdi k ≤ kdj k if i < j, di means the i-th nearest BS location to the origin among all the tiers and π(i) indicates that the tier of that BS. For example, assuming that the nearest BS to the origin is in the k-th tier, i.e., d1 = dk1 , then π(1) = k. Single-antenna users are distributed according to a homogeneous PPP, ΦU = {ui , i ∈ N}, which has density λU  λk for k ∈ K. Since the user density is far larger than the BS density, we assume that there is no empty cell with high probability, so that all the cells are occupied. We note that in HetNets, the BSs can be densely deployed so that empty cells can exist, which is 6 a topic for future work. We focus on the typical user located on u1 = 0 per Slivnyak’s theorem [14]. We consider an open access policy wherein a user is able to communicate with all the BSs in any tier k for k ∈ K. For cell association, the typical user measures the biased average received power and associates with the BS whose the measured power is maximum. For instance, the user associates with the BS located at dk1 if k = arg maxk0 ∈K Pk0 Sk0 dk1 0 −β , where β is the path-loss exponent. Since we are interested in a HetNet sharing the spectrum among all the tiers, we assume that the path-loss exponent is same in all the tiers. Considering different path-loss exponents in each tier [13] or multi-slope path-loss model [15] is future work. We note that biasing factor Sk is mainly used for offloading in HetNets [?], [13]. For example, as Sk increases, the number of users associated with the k-th tier BS also increases, which relieves the number of users associated with the other tiers. This allows other tiers to allocate more resources per one user. Typically, a small network tier such as femto tends to have large biasing factor to save the resources of the macro tier. Jointly considering feedback design and offloading will be interesting future work. B. Clustering Model Dynamic BS coordination is used to form a BS cluster. With the cluster size L, the typical user connects to the L BSs that provides L strongest biased average received power. Denoting the BS coordination set C = {i1 , ..., iL }, we have Pπ(i1 ) Sπ(i1 ) kdi1 k−β ≥ Pπ(i2 ) Sπ(i2 ) kdi2 k−β ≥ ... ≥ Pπ(iL ) Sπ(iL ) kdiL k−β , (1) where Pπ(iL ) Sπ(iL ) kdiL k−β ≥ Pπ(j) Sπ(j) kdj k−β for all j ∈ N\C. According to the association rule, the typical user associates with the BS located at di1 and receives the desired signal from it. We note that L = 1 indicates the non-cooperative case, and L ≥ 2 is the cooperative-case. To mitigate the intra-cluster interference by using multi-cell ZF in the cooperative case, we assume L ≤ mink∈K Nk . Using the described dynamic clustering, a cooperative region is mathematically defined by using the notion of the L-th order weighted Voronoi region, which is an extended version of the 7 typical Voronoi region [17], [18]. For example, the weighted Voronoi region corresponding to the coordination set C = {i1 , ..., iL } is defined as Vw L (di1 , ..., diL ) n n o o 1 1 = d ∈ R2 | ∩L`=1 (Pπ(i` ) Sπ(i` ) )− β kd − di` k < (Pπ(j) Sπ(j) )− β kd − dj k , j ∈ / {i1 , ..., iL } . (2) The users located in Vw L (di1 , ..., diL ) are connected to the coordination set C. Naturally, the typical w user is also located in Vw L (di1 , ..., diL ), i.e., o ∈ VL (di1 , ..., diL ). By allocating the orthogonal time-frequency resources to adjoint Voronoi regions, a conflict between any two different clusters can be prevented so that each cluster can serve the connected users simultaneously. Optimizing the resources allocated to each Voronoi region is a challenging yet important problem, and will be interesting future work. We note that in a simple case K = 1 and L = 2, this problem can be solved by using cooperative base station coloring [?]. C. Signal Model We assume a synchronous narrowband signal model. In this setting, each BS encodes the information symbol separately and sends it to the associated user. When transmitting the symbol, the BS at di uses a linear beamforming vector vi ∈ CNπ(i) and kvi k = 1. Assuming that the typical user is associated with a BS located at di1 ∈ Φ̃M , the received signal at the typical user is X p p Pπ(i` ) kdi` k−β/2 (h1,i` )∗ vi` si` y1 = Pπ(i1 ) kdi1 k−β/2 (h1,i1 )∗ vi1 si1 + i` ∈C\i1 X p + Pπ(j) kdj k−β/2 (h1,j )∗ vj sj + z1 , (3) j∈N\C where h1,i ∈ CNπ(i) is the downlink channel coefficient vector from the BS at di ∈ Φ̃M to the typical user, β > 2 is the path-loss exponent, and z1 ∼ CN (0, σ 2 ) is additive Gaussian noise.   The symbol energy is normalized as E |si |2 = 1 for i ∈ N. Each entry of the channel coefficient vector h1,i is drawn from independent and identically distributed (IID) complex Gaussian random variables CN (0, 1) indicating Rayleigh fading. The beamforming vector vi is designed based on the CSIT obtained by using limited feedback. 8 D. Feedback Model We explain the feedback process focusing on the typical user. This process is applied to other users equivalently. Let us assume that the typical user feeds back the channel information to a BS located at di . First, the typical user estimates the channel coefficient vector h1,i . To focus on the effect of limited feedback, we assume that the channel estimation is perfect. Once the typical user learns the channel coefficient vector h1,i , it quantizes the channel direction information h̃1,i = h1,i / kh1,i k by using a predefined quantization codebook Q. The codebook Q is shared with the BS at di and the typical user. Assuming that B bits are used for quantizing h̃1,i , the codebook Q is constructed as Q = {w1 , ..., w2B }, where each codeword wj is a Nπ(i)  dimensional unit norm vector, i.e., kwj k = 1 for j ∈ 1, ..., 2B . Then, the codeword that has maximum inner product with h̃1,i is selected, namely jmax = arg max (h̃1,i )∗ wj . (4) j=1,...,2B The chosen index jmax is sent to the BS at di and the BS recovers the quantized channel direction information from this index. We denote the quantized channel direction as ĥ1,i = wjmax . For analytical tractability, we adopt the quantization cell approximation [10], [16], [17] instead of using a specific limited feedback strategy. This approximates each quantization cell as a Voronoi region of a spherical cap [18]. In this technique, assuming that B-bits feedback is used, the area of the quantization cell is 2−B and this leads to an expression of the CDF of quantization error   2B xNπ(i) −1 , 0 ≤ x ≤ δ 2 Fsin θi (x) = ,  1, δ≤x where sin2 θi = 1 − (h̃1,i )∗ ĥ1,i 2 −N and δ = 2 B π(i) −1 (5) . In isotropic channel distribution, this approximation technique provides an upper bound of the quantization performance, while the gap to a lower bound provided by random vector quantization is reasonably small [10]. E. Performance Metrics Since cellular systems are usually interference limited [19], we focus on the SIR. We consider two cases depending on the coordination set size L. Non-cooperative case: In this case with L = 1, there is no coordination among the BSs. The BS uses single-user MRT precoding based on the quantized channel direction, vi1 = ĥ1,i1 . We 9 assume that all the users in the k-th tier use the Bk bits feedback, so that the total feedback P used on average in an unit area is Btotal = K k=1 λk Bk . The instantaneous SIR of the typical user is written by 2 SIRNC Pπ(i1 ) kdi1 k−β (h1,i1 )∗ ĥ1,i1 =P . −β |(h1,j )∗ vj |2 j∈N\i1 Pπ(j) kdj k (6) Conditioning on that di1 = dk1 (or π(i1 ) = k), i.e., the typical user is associated with a BS in the k-th tier, we denote the conditioned SIR as SIRNC|k . The CCDF of the conditioned SIR is defined as    c FSIR β, λ̄ , N̄ , B̄ , P̄ , S̄ ; γ = P SIR ≥ γ , K K K K K NC|k NC|k (7) with a set of the densities: λ̄K = {λ1 , ..., λK }, a set of the antennas: N̄K = {N1 , ..., NK }, a set of the feedback: B̄K = {B1 , ..., BK }, a set of the transmit power: P̄K = {P1 , ..., PK }, and a set of the biasing factor: S̄k {S1 , ..., SK }. The conditioned ergodic spectral efficiency is defined as    RNC|k β, λ̄K , N̄K , B̄K , P̄K , S̄K = E log2 1 + SIRNC|k . (8) Cooperative case: In this case with L ≥ 2, the BSs in C are coordinated. The beamforming vector is designed as multi-cell ZF to mitigate the intra-cluster interference. Specifically, vi1 satisfies (ĥ`,i1 )∗ vi1 = 0, ` ∈ C\1, (9) where h̄`,i1 is the quantized channel coefficient vector from the BS at di1 to the user ` associated with the BS di` . The solution of (9) always exists if L ≤ mini` ∈C Nπ(i` ) . We denote that the feedback used for i` -th BS in the coordination set as Bi` . Since the feedback information is only used for managing the intra-cluster interference, the typical user does not send the feedback to its P associated BS, i.e., Bi1 = 0. The total feedback used in one coordination set is Btotal = L`=2 Bi` . Note that we slightly abuse the notation of the feedback in the non-cooperative case and the cooperative case. Specifically, in the non-cooperative case, Bk means the feedback used in the kth tier BS. In the cooperative case, Bi` means the feedback used in the i` -th BS in the coordination set. For analytical simplicity, we assume that all the BSs in the same coordination set C use only L antennas for multi-cell ZF, so that effectively the typical user has L-dimensional channel to each intra-cluster BS. Since we only use a part of the antennas, our analysis may indicate a lower bound on the spectral efficiency that can be achieved by using the full antennas. Using 10 the full antennas, the BSs in the coordination set can mitigate the intra-cluster interference and also increase the desired signal power by coordinated beamforming. This case will be further investigated later. Due to the inaccurate channel feedback, the intra-cluster interference is not perfectly nullified. Considering the remaining intra-cluster interference, the instantaneous SIR is where IIn Pπ(i1 ) kdi1 k−β |(h1,i1 )∗ vi1 |2 SIRC = , (10) IIn + IOut P P = i` ∈C\i1 Pπ(i` ) kdi` k−β |(h1,i` )∗ vi` |2 , IOut = j∈N\C Pπ(j) kdj k−β |(h1,j )∗ vj |2 , each of which indicates the remaining intra-cluster interference and the out-of-cluster interference, respectively. Similar to the non-cooperative case, we denote SIRC|m as the instantaneous SIR conditioned on that the typical user is associated with a BS in the m-th tier, i.e., π(i1 ) = m. The CCDF of the conditioned SIR is defined as    c FSIR β, λ̄K , N̄K , B̄L , P̄K , S̄K ; γ = P SIRC|m ≥ γ , C|m (11) where a set of the feedback B̄L = {Bi2 , ..., BiL }. The ergodic spectral efficiency is defined as    RC|m β, λ̄K , N̄K , B̄L , P̄K , S̄K = E log2 1 + SIRC|m . (12) We clarify the difference in the total feedback constraint between the non-cooperative and the cooperative cases. In the non-cooperative case, the total feedback used on average in an unit P area is limited, so that Btotal = K k=1 λk Bk . In the cooperative case, the total feedback used in P one BS coordination set is fixed, so that Btotal = L`=2 Bi` , where Bi` is the feedback allocated to the BS at di` . The rationale of this difference is as follows. In the non-cooperative case, the typical user sends the feedback to its associated BS only, so that the density directly affects the totally feedback use in an unit area. Specifically, a dense network tier consumes more feedback in an unit area, therefore it is reasonable that the total feedback constraint is a weighted sum of the used feedback in each tier. In the cooperative case, the typical user user sends the feedback to all the intra-cluster BSs but not its associated BS. Further, the intra-cluster BSs’ tiers can be different depending on the condition of the coordination set. For this reason, if a total feedback constraint is defined as a function of the density as in the non-cooperative case, each coordination set has a different total feedback constraint. This makes it difficult to provide a general feedback partition solution, which is applicable in the cooperative case regardless of the cluster members’ tiers. As a result, it is more convenient to set the total feedback constraint for each coordination set. 11 III. N ON -C OOPERATIVE C ASE In this section, we characterize the performance of a non-cooperative HetNet and formulate a feedback partition problem based on the performance characterization. Subsequently, we propose a solution for the problem to determine Bk . A. Performance Characterization In this subsection, we analyze the SIR CCDF and the ergodic spectral efficiency. To this end, we first introduce the following lemma. Lemma 1. If the typical user is associated with the BS belonging to the k-th tier, the PDF of the distance between the typical user and the serving BS, i.e., dk1 , is  2/β 2/β !  K K X X Pi S i Pi S i fkdk k (r) = 2π λi r exp −π λi r2 , 1 P S P S k k k k i=1 i=1 (13) Proof. See Lemma 3 in [13]. By leveraging Lemma 1, we derive the SIR CCDF in the following theorem. Theorem 1. When the typical user is associated with the k-th tier BS, the SIR CCDF is c FSIR NC|k  β, λ̄K , N̄K , B̄K , P̄K , S̄K ; γ = N k −1 X m=0 ∂ m LI/ cos2 θ1 (s) γm (−1)m m! ∂sm , (14) s=γ where LI/ cos2 θ (s) is − Z LI/ cos2 θ1 (s) = 0 2 Bk Nk −1  2/β P Pi Si λ 2Bk (Nk − 1)xNk −2 K i i=1 Pk Sk    i dx,  h 2/β PK Sk Pi Si s 1 + D( 1−x Si , β) i=1 λi Pk Sk (15) with   2x 2 2 D(x, y) = 2 F1 1, 1 − , 2 − , −x . y−2 y y (16) Proof. See Appendix A. Remark 1. Although we assume an open access policy in this paper, it is also possible to use a closed access policy. In this remark, we study how the SIR CCDF (14) changes when the k-th tier BSs use a closed access policy. Specifically, we assume the probability of a k-th tier BS being open access as pk < 1, so that the density of the accessible k-th tier BSs is pk λk . For 12 convenience of expression, we define p1 = ... = pk−1 = pk+1 = ... = pK = 1. Then, the PDF of the distance to the serving BS (13) is modified as 2/β 2/β !   K K X X Pi S i Pi Si r exp −π r2 . fkdk k,closed (r) = 2π pi λi pi λi 1 P S P S k k k k i=1 i=1 (17) Next, we calculate the SIR CCDF in the closed access case. The Laplace transform of the interference LI/ cos2 (θ1 ) (s) in (15) is modified as LI/ cos2 θ1 ,closed (s) " K  2/β    ! Y Pi Si s Sk = ER,cos2 θ1 exp −πpi λi R2 D ,β 2θ P S cos S k k 1 i i=1 2/β  ! #  2π 2π s csc · exp −π(1 − pk )λk R2 2 cos (θ1 ) β β − Z 2 Bk Nk −1 Bk 2 (Nk − 1)x = Nk −2 Z 0 0 ∞ fkdk k (r)· 1 2    ! s Sk Pi Si β 2 exp −π pi λi r D ,β · Pk Sk 1 − x Si i=1  !  2/β 2π s 2π exp −π(1 − pk )λk r2 csc drdx. 1−x β β K X  (18) Plugging (18) into (14) produces the SIR CCDF in the closed access case. Next, we obtain the ergodic spectral efficiency. Before proceeding further, we introduce two useful lemmas. The first one is for characterizing the Laplace transform of the desired signal power as a function of the used feedback; the second one is for obtaining the ergodic spectral efficiency by using the Laplace transform of the desired signal and the interference. Lemma 2. Assume that the typical user is associated with the k-th tier BS. We denote hk1,i as the channel coefficient between the k-tier BS located at dki and the typical user. When using MRT with Bk feedback, the Laplace transform of the desired signal power is  Nk −1   h 2i   1 1 −s|(hk1,i )∗ ĥk1,i |     . E e =  Bk s+1  − N −1 k 1+s 1−2 Proof. See Lemma 1 in [10]. (19) 13 Lemma 3. For the non-negative and independent random variables X and Y , we have    Z ∞ −z     X e E ln 1 + = 1 − E e−zX E e−zY dz. Y +1 z 0 (20) Proof. See Lemma 1 in [20] By exploiting Lemma 2 and 3, we derive the sum spectral efficiency in the following corollary. Corollary 1. When the typical user is associated with a k-th tier BS, the ergodic spectral efficiency is   RNC|k β, λ̄K , N̄K , B̄K , P̄K , S̄K = log2 (e) ∞ Z 0  PK λi 2/β h i=1  P K i=1 λi  Pi Si Pk Sk 1 1 − z  Nk −1   Pi S i Pk S k  1 z+1     1  2/β 1 + D(z Bk k −1 −N 1+z 1−2     ·    Sk Si  , β)  i  dz, (21) and D(x, y) is defined as (16). Proof. In the proof of Theorem 1, we find the Laplace transform of the aggregated interference LI (s). The Laplace transform of the desired signal power is obtained in Lemma 2. Plugging the obtained Laplace transforms into Lemma 3 completes the proof. B. Adaptive Feedback Partition in Non-Cooperative HetNets We now determine Bk , k ∈ K to maximize the ergodic sum spectral efficiency defined as RΣ = K X  λk RNC|k β, λ̄K , N̄K , B̄K , P̄K , S̄K . (22) k=1 The sum spectral efficiency measures the average spectral efficiency provided in an unit area. Unfortunately, directly maximizing (22) is not easy since the ergodic spectral efficiency RNC|k in (21) has a complicated integral form. For this reason, we rather maximize a lower bound on the sum spectral efficiency:   RNC|k β, λ̄K , N̄K , B̄K , P̄K , S̄K ≥ RNC,lb|k β, λ̄K , N̄K , B̄K , P̄K , S̄K !   Bk exp(ψ(N )) − N −1 = log2 1 + 1 − 2 k , PK i=1 E[Ii ] (23) 14 where ψ(·) is the digamma function defined as Z ∞ −t e e−xt ψ(x) = − dt t 1 − e−t 0 (24) and the inequality follows from Corollary 1 of [10]. The mean interference of the i-th iter E[Ii ] is calculated as follows # Z ∞ P (a) i r−β+1 dr E [Ii ] = ER 2πλi Rβ P S Pk ( P i Si )1/β R k k 2/β    Sk 2λi PPki SSik Si = 2/β ,  PK Pi Si (β − 2) i=1 λi Pk Sk " where (a) follows that each interference fading (hi1,j )∗ vji 2 (25) is an exponential random variable with unit mean. By summing up from i = 1 to K, the following is obtained as  2/β   P Sk Pi Si K λ 2 K X i i=1 Pk Sk Si E[Ii ] = .   2/β PK Pi Si i=1 (β − 2) i=1 λi Pk Sk For simplicity, we denote that PK i=1 (26) E[Ii ] = Imean . Then a lower bound on the ergodic sum spectral efficiency is RΣ,lb = K X  λk RNC,lb|k β, λ̄K , N̄K , B̄K , P̄K , S̄K . (27) k=1 Leveraging (27), a feedback partition is obtained in the following proposition. Proposition 1. In the non-cooperative case, the feedback partition that maximizes the lower bound is    (B̃k? )NC   = (Nk − 1) log2    exp(ψ(N )) Nk − 1 − (Nk − 1) exp(ψ(N )) + 1 µ    . !     2/β  P Sk Pi S i λ 2 K  i i=1 Pk Sk Si (β−2) PK i=1 λi  Pi Si Pk Sk 2/β The parameter −1/µ is the maximum value that satisfies       K exp(ψ(N )) Nk − 1 − µ1 X     ≤ Btotal , ! λk (Nk − 1) log2       PK Pi Si 2/β Sk 2 i=1 λi P S   Si k=1 k k (Nk − 1) exp(ψ(N )) +  2/β PK P S (β−2) where Btotal is the total feedback constraint per unit area. i=1 λi i i Pk Sk (28) (29) 15 Proof. Using (27), we formulate the feedback partition problem as K X maximize + Bk ∈Z ,k∈{1,...,K} subject to  λk RNC,lb|k β, λ̄K , N̄K , B̄K , P̄K , S̄K , k=1 K X λk Bk ≤ Btotal . (30) k=1 Avoiding integer programming, we relax the feasible field of a solution to R+ . Then the corresponding Lagrangian function is L(B̄K , µ) = K X  λk RNC,lb|k β, λ̄K , N̄K , B̄K , P̄K , S̄K + µ k=1 K X ! λk Bk − Btotal . (31) k=1 According to the KKT condition, we have ∂L(B̄K , µ) = ∂Bk Bk k −1 −N λk 2 exp(ψ(N ))     + λk µ, Bk − N −1 (Nk − 1) Imean + 1 − 2 k exp(ψ(N )) (32) K ∂L(B̄K , µ) X λk Bk − Btotal = 0. = ∂µ k=1 (33) Solving the first condition (32), we have    (B̃k? )NC   = (Nk − 1) log2    exp(ψ(N )) Nk − 1 − (Nk − 1) exp(ψ(N )) + 1 µ      2/β   !  . PK Sk Pi S i 2 i=1 λi P S  Si k k (β−2) PK i=1 λi  Pi Si Pk Sk 2/β The parameter −1/µ is determined as the maximum value that satisfies       K exp(ψ(N )) Nk − 1 − µ1 X    ≤ Btotal . ! λk (Nk − 1) log2      2/β   PK Sk Pi Si 2 λ   i i=1 Pk Sk Si k=1 (Nk − 1) exp(ψ(N )) + 2/β  PK P S (β−2) i=1 λi (34) (35) i i Pk Sk This completes the proof. Remark 2. Since the feedback has an positive integer value in practice, we have to perform further processes to the relaxed solution (B̃k? )NC . We introduce two possible methods. First, we can use the round function b(B̃k? )NC e. With the round function, it is possible that PK ? k=1 λk b(B̃k )NC e ≥ Btotal , therefore the manual feedback adjustment is necessary after applying the round function. Second, we can iteratively add a feedback bit to each tier. For example, starting with the floored solution, we iteratively find which tier is the best choice for adding a 16 remaining feedback bit by computing the sum ergodic spectral efficiency. Subsequently, we add a feedback bit to the selected tier. We repeat this until the used feedback equals to Btotal . More detail processes for supplementing the floor function are described in Remark 3 and 4 of [21]. Due to space limitation we do not explore these methods in this paper. Remark 3. We observe that Proposition 1 is a water-filling type solution where −1/µ determines the water level. As in a conventional water-filling method, −1/µ can be found by an iterative algorithm. Moreover, the iterative algorithm does not have to be performed frequently since Proposition 1 only depends on the system parameters that do not change often, for example the number of antennas Nk , the transmit power Pk , the biasing factor Sk , the density λk , and the path-loss exponent β. In particular, Proposition 1 does not change depending on instantaneous SIR, so that the complexity required for Proposition 1 is low. Remark 4. When there is no biased association, i.e., Si = 1 for i ∈ K, the proposed strategy becomes  (B̃k? )NC = (Nk − 1) log2   1 µ   exp(ψ(N )) Nk − 1 −  ,  2 (Nk − 1) exp(ψ(N )) + β−2 (36) which is a function of the number of antennas Nk and the path-loss exponent β. This result matches with [13], which showed that when there is no biased association in a single antenna K-tier HetNet, the spectral efficiency is only a function of the path-loss exponent β. Remark 5. In the proposed feedback partition strategy (28), we observe that the feedback for single-user MRT in a particular tier is useful only if the corresponding mean interference Imean is small enough. Specifically, recalling (26), (B̃k? )NC ≥ 1 only if   − N 1−1 1 (Nk − 1 − µ )2 k exp(ψ(Nk ))  − 1 ≥ Imean . Nk − 1 (37) Since −1/µ is proportional to Btotal , if the amount of mean interference is too large compared to Btotal , it is beneficial not to allocate the feedback to the corresponding tier. As the mean interference increases, the SIR becomes low and this makes the spectral efficiency improved marginally by using the feedback. For this reason, saving the feedback of the corresponding tier for other tiers is more beneficial. 17 IV. C OOPERATIVE C ASE In the previous section, if a particular tier’s user experiences a large amount of interference, single-user MRT based on the limited feedback is not useful to improve the spectral efficiency. In this case, we can use the feedback information to mitigate the other BS interference through multi-cell coordination. In this section, we analyze the performance of BS coordination in a HetNet and propose a feedback partition by leveraging the derived expressions. A. Performance Characterization In the performance characterization of the cooperative case, a challenging part is obtaining the distribution of the distance to the BS at diL (the PDF of kdiL k). This indicates the distance of the BS located furthest from the typical user in the coordination set C. It is important because it determines a boundary between the intra-cluster interference and the out-of-cluster interference, which is necessary for the feedback allocation. The main source of the difficulty is that each tier uses a different transmit power and biasing factor, so that the intensity measure of aggregated signal power of each tier has different features. Due to this heterogeneity, ordering the BSs according to their biased power across the tiers is complicated. To resolve this, we first derive the following lemma that transforms a K-tier HetNet to a statistically equivalent single-tier network. Lemma 4 (Transformation lemma). Consider the `-th tier network for ` ∈ K denoted as ΦM = {d`i , P` , S` , i ∈ N} with density λ` . The intensity measure of biased signal power ` ` of ΦM ` received by the typical user, i.e., P` S` di −β , is statistically equivalent to that of `→k , Pk , Sk , i ∈ N} with density λ̃` , provided that the density λ̃` is scaled to ΦM `→k = {di 2  P` S` β . λ̃` = λ` Pk Sk (38) Proof. By the displacement theorem [14], the intensity measure of biased signal power of ΦM ` experienced by the typical user is  X Λ` ((0, t]) = E  β d`i 1 P` S` d`i ∈ΦM ` ! <t  1 (a) Z = 2πλ` (P` S` t) β rdr 0 = πλ` (P` S` )2/β t2/β (39) 18 where (a) follows Campbell’s theorem [14]. Similarly, the intensity measure of biased signal power of ΦM `→k is Λ`→k ((0, t]) = π λ̃` (Pk Sk )2/β t2/β . For this reason, if λ̃` = λ`  P` S` Pk Sk  β2 (40) , the two biased signal power becomes equivalent. This completes the proof. The implication of Lemma 4 is that by rescaling each density as λ̃` = λ`  P` S ` Pk S k  β2 for ` ∈ K, a K-tier HetNet can be transformed to a statistically equivalent network where the transmit power and the biasing factor are same as Pk and Sk . Leveraging this, we obtain the PDF of kdiL k in the following lemma. Lemma 5. Assume that the furthest BS of the coordination set C belongs to the k-th tier, i.e., π(iL ) = k. Then the PDF of the distance kdiL k is  2/β L  PK Pi Si  2/β ! r2 2 π i=1 λi Pk Sk K X Pi S i exp −π λi r2 . fkdi k (r) = L rΓ(L) Pk S k i=1 (41) Proof. We first transform a K-tier HetNet to a single-tier network whose transmit power and biasing factor are equal to Pk and Sk . By exploiting Lemma 4, we rescale the density as `→k λ` ((P` S` ) / (Pk Sk ))2/β . By doing this, we transform the `-th tier network to ΦM , Pk , Sk , i ∈ `→k = {di N} with density λ` ((P` S` ) / (Pk Sk ))2/β . Note that the original `-th tier network ΦM ` and the transformed `-th tier network ΦM `→k are statistically equivalent as shown in Lemma 4. Then, by P the superposition theorem [14], the aggregated network `∈K ΦM is a homogeneous network `→k 2/β P PK . Since `∈K ΦM with transmit power Pk , biasing factor Sk , and density i=1 λi PPki SSik `→k is a homogeneous network, we can use the conventional PDF of the distance presented in [22]. In a homogeneous PPP with density λ, the PDF of the L-th closest point to the origin is f (r) = Plugging PK i=1 λi  Pi Si Pk Sk 2/β 2(λπr2 )L −λπr2 e . rΓ (L) (42) into λ completes the proof. Remark 6. When L = 1, i.e., the non-cooperative case, the obtained PDF in Lemma 5 boils down to (13), which describes the PDF of the closest BS conditioned on that the typical user is associated with the k-th tier BS. This implies that our transformation lemma can be applied to characterize a general distance distribution in a K-tier HetNet. 19 Next, we define the intra-cluster BS geometry parameter δ1,` , ` ∈ {2, ..., L} to characterize the relative intra-cluster interference power. We define the geometric parameter δ1,` as the ratio between the path-loss of the home BS and the `-th closest BS for ` ∈ {2, ..., L}, i.e.,     δ1,` = Pπ(i` ) kdi` k−β / Pπ(i1 ) kdi1 k−β . We note that the geometric parameter δ1,` is originally introduced in [23], and is generalized for HetNets in our work. As explained in [23], δ1,` measures the relative intra-cluster interference power coming from di` , so that a large value of δ1,` means large amount of intra-cluster interference. When each biasing factor is same, i.e., S1 = ... = SK , δ1,`1 > δ1,`2 if `1 < `2 by the definition. For general biasing factors, however, this is not necessarily guaranteed. We denote a set of the geometric parameters as δ̄1,L = {δ1,2 , ..., δ1,L }, and analyze the performance of the cooperative case under the assumption that the relative intra-cluster interference power is fixed, while out-of-cluster interference is random as in [23]. By using Lemma 5 and the intra-cluster BS geometry, we derive the following theorem that presents the SIR CCDF of the cooperative case. Theorem 2. Assume that δ̄1,L , B̄L is given, and also π(i1 ) = m, π(iL ) = k. Then, the conditioned SIR CCDF of a K-tier HetNet in the cooperative case is  c m β, λ̄K , N̄K , B̄L , P̄K , S̄K , δ̄1,L ; γ FSIR = C L  2/β   PK Pi Si Y i=1 λi Pk Sk 1      ,    i  h   Bi 2/β P ` − L−1 K Sk Pi Si 1 + γδ1,` 2 i` ∈C\i1 1 + D γδ1,L · Si , β i=1 λi Pk Sk (43) where   2x 2 2 D(x, y) = 2 F1 1, 1 − , 2 − , −x , y−2 y y (44) with 2 F1 (·, ·, ·, ·) is the Gaussian hypergeometric function. Proof. See Appendix B. We summarize the conditions presented in Theorem 2. The SIR CCDF is derived under the conditions that (i) π(i1 ) is fixed as m, (ii) π(iL ) is fixed as k, and (iii) δ̄1,L is fixed, so that the relative intra-cluster interference power is given. Now the ergodic spectral efficiency is derived as an integral form in Corollary 2. 20 Corollary 2. Assume that δ̄1,L , B̄L is given and π(iL ) = k. Then, the ergodic spectral efficiency of a K-tier HetNet in the cooperative case is  m β, λ̄K , N̄K , B̄L , P̄K , S̄K , δ̄1,L = RC Z log2 (e) 0  ∞ 1 Y  1+z i` ∈C\i1 1 Bi ` − L−1 1 + zδ1,` 2   P K i=1 PK λi   Pi Si Pk Sk 2/β L i=1 λi  2/β h    i  dz, Pi S i 1 + D zδ1,L · SSki , β Pk Sk (45) where D(x, y) is defined as (44). Proof. From Theorem 2, we get the Laplace transform of the intra-cluster and the out-of-cluster interference. Plugging them into Lemma 3 completes the proof. B. Adaptive Feedback Partition in Cooperative HetNets Now we determine Bi` for ` ∈ {2, ..., L} to maximize the ergodic spectral efficiency (45). Proposition 2. In the cooperative case, the feedback partition that maximizes the ergodic spectral  m β, λ̄K , N̄K , B̄L , P̄K , S̄K , δ̄1,L is efficiency RC   (Bi?` )C = Btotal δ1,`   + (L − 1) log2   1 .  QL L−1 L−1 `=2 δ1,` (46) We refer Remark 2 to make (Bi?` )C be a positive integer. Proof. We first formulate the optimization problem for maximizing the SIR CCDF (43). Since the Laplace transform of the out-of-cluster interference is independent to the feedback, we can treat this as a constant and omit it in the problem. Then the problem is   Y 1  , maximize Bi ` Bi` ∈Z+ ,`∈{2,...,L} − L−1 1 + γδ1,` 2 i` ∈C\i1 subject to L X `=2 Bi` ≤ Btotal . (47) 21 Since (47) is integer programming which is hard to solve, we first relax the feasible field of B` to R+ and apply the floor function to the solution later. We rewrite (47) as   L Bi X ` − L−1 , minimize ln 1 + γδ1,` 2 + Bi` ∈R ,`∈{2,...,L} subject to `=2 L X Bi` ≤ Btotal . (48) `=2 B − L−1 Since the function f (B) = ln(1 + C2 ) is monotonically increasing function and convex for any positive C, we apply a convex optimization technique to solve (48). At first, the corresponding Lagrangian function of the objective function in (48) is !   L L Bi X X ` − L−1 ln 1 + γδ1,` 2 L(B̄L , µ) = +µ Bi` − Btotal , `=2 (49) `=2 where µ denotes the Lagrangian multiplier. Solving the KKT conditions for (49) leads to   (Bi?` )C = δ1,` Btotal   + (L − 1) log2   1 .  L−1 QL L−1 `=2 δ1,` (50) Since the obtained feedback partition (50) is not a function of a specific threshold γ, this is optimal for any threshold, which means it is optimal for maximizing the ergodic spectral  m efficiency RC β, λ̄K , N̄K , B̄L , P̄K , S̄K , δ̄1,L . This completes the proof. Remark 7. Proposition 2 implies that the feedback is allocated proportional to the intra-cluster interference power, i.e., Bi` ∝ δ1,` . Note that this is similar to the previous results [3], [8], in which adaptive feedback allocation is proposed in a homogeneous cooperative network for minimizing the rate gap to perfect CSIT case. To use the prior work [3], [8], however, not only the relative intra-cluster BS power but also the exact instantaneous SINR should be obtained. On the contrary, Proposition 2 only depends on relative intra-cluster BS power while it does not change depending on instantaneous SIR. C. A General Number of Antennas Case In this subsection, we study feedback allocation in a general number of antennas case, where different tier BSs use different number of antennas. The intra-cluster BSs are equipped with Nπ(i1 ) , ..., Nπ(iL ) antennas, where Nπ(i` ) ≥ L, ` ∈ {1, ..., L}. Using the additional antennas, we use coordinated beamforming, which mitigates the intra-cluster interference and also increases 22 the desired signal power. Specifically, the beamforming vector vi1 (kvi1 k = 1) used in the BS di1 is designed by solving the following optimization problem. We denote that h`,i1 ∈ CNπ(i1 ) is a channel vector from the BS at di1 to the intra-cluster user associated with the BS at di` . maximize |(h1,i1 )∗ vi1 |2 , subject to (h`,i1 )∗ vi1 = 0, ` ∈ C\1. (51) The solution of (51) always exists when Nπ(i1 ) ≥ L. The other beamforming vector vi` where ` ∈ {2, ..., L} can be designed in the similar way. Due to limited feedback, the quantized channel h̃`,i1 is used in (51) instead of perfect channel h`,i1 , whose accuracy is determined by the feedback amount. Now we propose a heuristic feedback design method applicable in the general number of antennas case. Note that Bi1 > 0 in the general number of antennas case while we suppose Bi1 = 0 in our previous assumption. P First, we assume that B̃total = Btotal − Bi1 = L`=2 Bi` is given. Then, the feedback Bi2 , ..., BiL can be determined by solving the following problem, which is modified from the optimization problem (48) L X minimize Bi` ∈R+ ,`∈{2,...,L} subject to −N ln 1 + γδ1,` 2 Bi ` π(i` ) −1 ! , `=2 L X Bi` ≤ B̃total . (52) `=2 The corresponding Lagrangian function is L(B̄other , µ) = L X −N ln 1 + γδ1,` .2 Bi ` π(i` ) −1 ! +µ `=2 L X ! Bi` − B̃total . (53) `=2 By the KKT condition, we have γδ1,` ln(2) ! B γδ1,` + 2 and PL `=2 i` Nπ(i ) −1 ` =µ (54) (Nπ(i` ) − 1) Bi` = B̃total . Solving (54), we have  ln(2) = (Nπ(i` ) − 1) log2 (γδ1,` ) + (Nπ(i` ) − 1) log2 −1 . (55) µ(Nπ(i` ) − 1) P The parameter µ is determined as the minimum value that satisfies L`=2 Bi?` ≤ B̃total . Note Bi?` C,gen   from (55) is that the SIR threshold γ remains in the solution. In the previous case, the parameter γ vanishes during the optimization process, so that the solution (50) is optimal for all the SIR 23 threshold. This implies that the solution (50) is also optimal for the ergodic spectral efficiency. On the contrary, in the general number of antennas case, the obtained solution (55) is optimal for a particular SIR threshold, not for the ergodic spectral efficiency. It might be more straightforward to directly optimize the ergodic spectral efficiency (45). Unfortunately, this is infeasible since the ergodic spectral efficiency is an complicated integral form as shown in (45). As an alternative, we select an appropriate value of γ by using simulations. For example, with (55), we examine various values of γ and then select a proper value of γ that provides the maximum ergodic spectral efficiency. The next step is determining Bi1 . We use a line search method relying on simulations. Specifically, we first assume Bi1 = 0. Then, we allocate feedback Bi2 , ..., BiL using (55). Then we iterate this process by increasing Bi1 . After searching over a whole region, i.e., 0 ≤ Bi1 ≤ Btotal , we select Bi?1 that provides the maximum ergodic spectral efficiency. We summarize the whole feedback design procedure in the following proposition. Proposition 3. Assume the general number of antennas case, where the intra-cluster BSs have different number of antennas Nπ(i1 ) , ..., Nπ(iL ) . Then, a heuristic way to allocate feedback is as follows. 1) Assume Bi1 = 0. 2) With B̃total = Btotal − Bi1 , allocate feedback by using (55). The parameter γ is selected so as to provide the maximum ergodic spectral efficiency. 3) Iterate 1) and 2) by increasing Bi1 until Bi1 ≤ Btotal . 4) Select Bi?1 , ..., Bi?L that provides the maximum ergodic spectral efficiency. We will evaluate Proposition 3 in the later section. D. A Single-Tier Case In this subsection, we consider a case where |K| = 1, i.e., when coordination is applied in a single-tier network. For ease of understanding, we enumerate the features of the single-tier case as follows. First, the coordination set C = {i1 , ..., iL } boils down to C = {1, ..., L}. Specifically, the typical user is connected to the L closest BSs located at d1 , ..., dL since in a single-tier network, the L BSs whose biased signal powers are strongest is the same as the L closest BSs to the typical user. Second, δ1,` simplifies to kd` k−β / kd1 k−β since all the BSs use the same transmit power. Third, the biasing factor is neglected since it is only useful in a HetNet scenario. 24 We note that Proposition 2 is general for the number of the tiers |K|, whereby it is applied without any modification for a case of a single-tier network, i.e., |K| = 1. In this single-tier network, we present an approximate feedback partition that does not need δ̄1,L . Proposition 4. Assume |K| = 1 and the intra-cluster geometry δ̄1,L is unknown. In that case, an approximate feedback partition as an alternative of (46) is L β(L − 1) β X Btotal − H`−1 + = H`−1 , L−1 2 ln 2 2 ln 2 `=2 P where H` is the `-th harmonic number defined as H` = `i=1 1i . (B̃`? )C (56) Proof. If δ̄1,L is unknown, a possible alternative is taking the expectation to (46) with regard to δ̄1,L . To calculate this, we use the probability density function (PDF) of kd1 k , kd` k presented in Lemma 1 of [23] as f kd1 k (x) = 2(` − 1)x(1 − x2 )`−2 . (57) kd` k Since δ1,` =  kd1 k kd` k β , we compute the following by exploiting (57). E [(B`? )C ] = (B̃`? )C L h i i X h 1 1 Btotal E log2 (δ1,` ) β = + β(L − 1)E log2 (δ1,` ) β − β L−1 `=2 L β(L − 1) β X Btotal H`−1 , (58) − H`−1 + = L−1 2 ln 2 2 ln 2 `=2 h  i P kd1 k where (a) follows that E log2 kd` k = − 2 ln1 2 H` with H` = 11 + 12 +· · ·+ 1` . Since L`=2 (B̃`? )C = (a) Btotal , (56) is a feasible feedback partition. This completes the proof. Remark 8. The feedback partition in Proposition 4 is only a function of the path-loss exponent β and the index of the intra-cluster BS `, so that no instantaneous SIR is needed to be measured. Similar to Proposition 2, Proposition 4 also implies that allocating more feedback to closer intra-cluster BSs is beneficial since (B̃`?1 )C ≥ (B̃`?2 )C if `1 < `2 . Now we investigate the relationship between the effective BS coordination set size and the total feedback Btotal . This is important because if the cluster size is too large compared to the total feedback Btotal , some intra-cluster BSs (particularly far BSs) are not allocated enough feedback. Those BSs only increase overheads associated with channel estimation, and are not 25 helpful in mitigating the interference due to the lack of the feedback. Unfortunately, this is hard to be analyzed because the existing feedback partition is a function of particular intra-cluster BS power, so that a general relationship cannot be extracted. To resolve this, we use Proposition 4, which is independent to particular intra-cluster BS power. As a stepping stone to reveal the relationship, we first define the effective cluster size Leff as the BS’s index that satisfies (B̃L? eff )C ≤ 1, (59) which means that the BS’s index whose allocated feedback is less than 1. Recalling that Proposition 4 gives fewer feedback to a further BS, the `-th closest BS for ` > Leff also has less than 1-bit feedback. For this reason, increasing the cluster size over Leff does not provide spectral efficiency gain. In the following corollary, with Proposition 4, we investigate the scaling behavior of Leff depending on the total feedback Btotal and the path-loss exponent β Corollary 3. Assume that Proposition 4 is used. Under this assumption, if the total feedback Btotal is large enough, the effective cluster size Leff in Proposition 4 is r ln 2 2β ln 2 Leff ≥ Btotal + 1 − +1 β ln 2 β √ Btotal & √ . β (60) Proof. Since the effective cluster size satisfies (59), we have (B̃L? eff )C ≤ 1 L eff β(Leff − 1) β X Btotal − HLeff −1 + H`−1 ≤ 1. ⇔ Leff − 1 2 ln 2 2 ln 2 `=2 (61) The harmonic number H` is tightly approximated as H` ' γEuler + ln `, where γEuler is the Euler-Mascheroni constant. With this approximation, (61) is L eff Btotal β(Leff − 1) β X − (γEuler + ln(Leff − 1)) + (γEuler + ln(` − 1)) ≤ 1 Leff − 1 2 ln 2 2 ln 2 `=2 Btotal β −1≤ ln ⇔ Leff − 1 2 ln 2  (Leff − 1)(Leff −1) (Leff − 1)! (62)  . (63) By using the Stirling’s approximation, we have ln(Leff − 1)(Leff −1) − ln((Leff − 1)!) + O(ln(Leff − 1)) = Leff − 1, (64) 26 where O(·) is defined as follows: f (x) = O(g(x)) as x → a if and only of lim supx→a |f (x)/g(x)| < ∞. If Btotal is large enough, the approximation is tight. Then (62) is 0≤ β (Leff − 1)2 + (Leff − 1) − Btotal . 2 ln 2 (65) Solving the quadratic equation, Leff is Leff ln 2 ≥ β r 2β ln 2 Btotal + 1 − + 1. ln 2 β For large enough Btotal , (66) is further approximated as √ √ √ Btotal Btotal Leff & 2 ln 2 √ ≥ √ . β β (66) (67) This completes the proof. Remark 9. A major finding in Corollary 3 is that the effective cluster size Leff scales with the square root of the total feedback Btotal , and inversely with the square root of the path-loss exponent β. This provides a system guideline on how to determine Leff depending on Btotal and √ β. The intuition of the former relationship (Leff ∝ Btotal ) is natural since the larger effective cluster size is supported as the total feedback increases. The rationale of the latter relationship (Leff ∝ √1 ) β is as follows. When the path-loss exponent increases, the interference power coming from far BSs decays fast, so that there is no need to allocate feedback to those BSs. This shrinks the effective cluster size. V. S IMULATION R ESULTS In this section, we provide simulation results to show the spectral efficiency improvement by using our feedback partitions presented in Proposition 1, 2, and 4. First, we assume the non-cooperative case. The area spectral efficiency comparison between Proposition 1 and the baseline method is depicted in Fig. 1. We note that the area spectral efficiency in Fig. 1 is generated by using an exact expression (21), not a lower bound (23). The baseline method is the per-tier equal partition, where the feedback of the k-tier is determined as Bk = Btotal /K/λk , so that the feedback consumed in each tier is same each other, i.e., λ1 B1 = ... = λK BK = Btotal /K. The other system parameters assumed in the simulations are described in the caption of Fig. 1. The main difference between Fig. 1-(a) and (b) is the densities, where Fig. 1-(b) assumes more dense HetNets. As shown in Fig. 1, Proposition 1 increases the area spectral efficiency by 11.3% in Fig. 1-(a) and by 12% in Fig. 1-(b). In both cases, we observe 66 m 2) 64 2 Area spectral efficiency (bps/Hz/100 Area spectral efficiency (bps/Hz/100 2 m 2) 27 62 60 58 56 54 52 50 Proposition 1 Equal partition 48 46 50 100 150 200 B total (bits/100 2 m 2) (a) 250 300 130 120 110 100 90 Proposition 1 Equal partition 80 50 100 150 200 250 300 350 400 B total (bits/100 2 m 2) (b) Fig. 1. An area spectral efficiency comparison in a non-cooperative HetNet. A 3-tier HetNet is assumed. The simulation parameters are as follows. In (a), N̄K = {8, 6, 6}, λ̄K = {0.5λref , 5λref , 40λref } where λref = 10−4 /π, P̄K = {20, 15, 10}dBm, S̄K = {0, 3, 5}dB, and β = 4. In (b), the other parameters are same with (a) except λ̄K = {0.5λref , 10λref , 80λref }. that Proposition 1 provides the meaningful gains compared to the equal partition. We expect that more gains can be obtained when a HetNet becomes dense, i.e., if λ3  λ1 . This is because, assuming that λ3 is large, only a few amount of feedback is allocated to the third tier in the equal partition. This causes that the BSs in the third tier only provides marginal spectral efficiency due to lack of accurate CSIT. On the contrary, in Proposition 1, the appropriate amount of feedback can be allocated to the third tier even when λ3 is large, leading to the spectral efficiency gain. As described in Remark 3, Proposition 1 does not depend on instantaneous SIR, so that there is no need to change the allocated feedback frequently depending on instantaneous SIR. For this reason, the complexity of Proposition 1 is almost equivalent to that of the equal partition. Next, we assume the cooperative case. We compare the ergodic spectral efficiency of Proposition 2 and the baseline method in Fig. 2, whose caption includes the simulation setting. Similar to the non-cooperative case, the baseline method is the equal partition, where the total feedback is equally partitioned to each of intra-cluster BS, i.e., B2 = .. = BL = Btotal /(L − 1). In Fig. 2-(a), we have 38.2% spectral efficiency gain by using Proposition 2 at Btotal = 10, and in Fig. 2-(b), we have 56.2% gain at Btotal = 10. We observe that Proposition 2 provides more gains when 1) L increases or 2) Btotal decreases. This is because, when L increases or Btotal decreases, the equal partition allocates smaller amount of feedback to the strong BSs whose δ1,` is large. 28 6.5 Ergodic spectral efficiency (bps/Hz) Ergodic spectral efficiency (bps/Hz) 8 7.5 7 6.5 6 5.5 5 4.5 4 10 Proposion 2 Equal partition 20 30 40 50 60 6 5.5 5 4.5 4 3.5 3 2.5 Proposion 2 Equal partition 20 B total (bits) (a) 40 60 80 100 B total (bits) (b) Fig. 2. The ergodic spectral efficiency comparison in a cooperative HetNet. A 3-tier HetNet is assumed. The simulation parameters are as follows: In (a), N̄K = {L, L, L}, L = 4, λ̄K = {1λref , 10λref , 20λref } where λref = 10−4 /π, P̄K = {20, 15, 10}dBm, S̄K = {0, 3, 5}dB, δ̄1,L = {0.1, 0.01, 0.001}, π(i1 ) = 1, π(iL ) = 2, and β = 4. In (b), the other parameters are same except that L = 5 and δ̄1,L = {0.2, 0.04, 0.008, 0.0016}. Then, due to lack of sufficient feedback, the interference from those strong BSs is not mitigated well, resulting in significant spectral efficient loss. On the contrary, by using Proposition 2, the appropriate amount of feedback is allocated to each BS proportional to δ1,` , so that considerable spectral efficiency gain is obtained even when L increases or Btotal decreases. Subsequently, we consider the general antenna case. The result is depicted in Fig. 3 and the parameter setting is described in its caption. Since it is hard to obtain an analytical expression for the general antenna case, we rely on numerical simulation to produce results. In the simulation, we assume that the intra-cluster conditions are fixed, so that δ̄1,L and Nπ(i1 ) , ..., Nπ(iL ) are given. As shown in Fig. 3-(a), the ergodic spectral efficiency is maximized at Bi?1 = 10 with γ = 10dB. The feedback for the other intra-clutser BSs is {Bi?2 , Bi?3 , Bi?4 } = {6, 0, 0}. Compared to the reduced number of antennas case, the general antenna case with Proposition 3 increases the ergodic spectral efficiency by 25%. In Fig. 3-(b), the ergodic spectral efficiency is maximized at Bi?1 = 16 and there is no observable difference in γ. Since Bi?1 = Btotal , no feedback is used for the other intra-cluster BSs. The performance gains of the general antenna case compared to the reduced number of antennas case is 41.2%. We point out that the main difference between Fig. 3-(a) and (b) is the number of antennas of the associated BS. Specifically, in Fig. 3-(a), 3.4 Ergodic spectral efficiency (bps/Hz) Ergodic spectral efficiency (bps/Hz) 29 3.3 3.2 3.1 3 2.9 General antenna case, = 0 dB General antenna case, = 10 dB General antenna case, = 20 dB Reduced antenna case 2.8 2.7 2.6 2 4 6 8 10 Bi (a) 1 12 14 16 3.8 3.6 3.4 3.2 3 General antenna case, = 0 dB General antenna case, = 10 dB General antenna case, = 20 dB Reduced antenna case 2.8 2.6 2.4 2 4 6 8 10 Bi 12 14 16 1 (b) Fig. 3. The ergodic spectral efficiency comparison in the general number of antennas case. A 3-tier HetNet is assumed. The simulation parameters are as follows: In (a), N̄K = {8, 6, 4}, L = 4, λ̄K = {1λref , 5λref , 20λref } where λref = 10−4 /π, P̄K = {20, 15, 10}dBm, S̄K = {0, 3, 5}dB, δ̄1,L = {0.1, 0.01, 0.001}, π(i1 ) = 2, π(i2 ) = 3, π(i3 ) = 2, π(i4 ) = 1 and β = 4. The total feedback is Btotal = 16. In (b), the other parameters are same except that π(i1 ) = 1, π(i2 ) = 1, π(i3 ) = 2, π(i4 ) = 3. In the reduced number of antennas case, we assume N̄K = {L, L, L} and use Proposition 2. the number of the associated BS is 6, and 8 in Fig. 3-(b). For this reason, the potential desired channel gain is large in (b), leading to allocate more feedback to the associated BS, i.e., Bi1 increases. Finally, we consider the single-tier case. We compare the ergodic spectral efficiency of Proposition 2, Proposition 4, and the equal partition in a single-tier network. We depict the results in Fig. 4, whose caption includes the simulation setting. As shown in Fig. 4, at Btotal = 10, Proposition 2 provides 23.1% spectral efficiency gain in Fig. 4-(a) and 49.1% gain in Fig. 4-(b). Proposition 4 provides smaller gain than Proposition 2, specifically 13.2% gain in Fig. 4-(a) and 17.1% gain in Fig. 4-(b). The main reason of this performance gap is that Proposition 2 allocates feedback more dynamically than Proposition 4. Specifically, since Proposition 2 allocates feedback depending on intra-cluster geometry, two different clusters have different feedback allocation unless they have the same intra-cluster BSs’ conditions. On the contrary, Proposition 4 allocates feedback only depending on intra-cluster BSs’ indices, therefore two different clusters have the same feedback allocation even if their intra-cluster geometries are different. Despite of the decreased gain, Proposition 4 can be useful since it uses fixed amount of feedback to each BS independent to the intra-cluster BS power. Since Proposition 4 is a 30 10 4.4 Ergodic spectral efficiency (bps/Hz) Ergodic spectral efficiency (bps/Hz) 4.6 4.2 4 3.8 3.6 3.4 3.2 3 Proposition 2 Proposition 4 Equal partition 2.8 2.6 10 15 20 25 30 35 40 45 50 9.5 9 8.5 8 7.5 7 6.5 6 Proposition 2 Proposition 4 Equal partition 5.5 5 10 15 20 B total (bits) 25 30 35 40 45 50 B total (bits) (a) (b) Fig. 4. The ergodic spectral efficiency comparison in a single-tier cooperative scenario. A 3-tier HetNet is assumed. The simulation parameters are as follows: In (a), N = L = 4, λ = 10−4 /π, P = 20dBm, δ̄1,L = {0.2, 0.04, 0.008}, and β = 4. In (b), the other parameters are same except that δ̄1,L = {0.05, 0.0025, 0.0001}. function of β and Btotal , we do not have to modify the allocated feedback unless β or Btotal change. VI. C ONCLUSIONS In this paper, we studied adaptive feedback partition problems in K-tier HetNets. We considered the non-cooperative and cooperative HetNet operations. Using stochastic geometry, we characterized the SIR CCDF and the ergodic spectral efficiency mainly as functions of the feedback and other relevant system parameters. Leveraging the obtained expressions, we formulated the feedback partition problems and proposed solutions. The simulation results showed that the proposed feedback partitions bring some gains in the spectral efficiency compared to the equal partition. Our major findings are summarized as follows. In the non-cooperative case, the feedback is useful only if the corresponding mean interference is small enough. In the cooperative case, allocating the feedback proportional to the intra-cluster BS power is efficient. We also showed that the proposed feedback allocation in the cooperative case is also useful for the general antenna case. Further, assuming a single-tier network as a special case, the effective cluster size increases with the square root of the total feedback. 31 There are several possible directions for future work. One is to consider the channel quality information (CQI) feedback. Specifically, the obtained CQI can be exploited to select a preferred user, so that scheduling is also involved [24]. Interpreting this in a random network model is promising. In another direction, different sources of CSIT inaccuracy can be considered. While we only focus on the limited feedback, feedback delay [25] or the channel estimation error [26] also degrades the CSIT accuracy, so that it is interesting to incorporate their effects into the performance characterization. A PPENDIX A P ROOF OF T HEOREM 1 Pi dij ∈Φi \dk1 Pk β −β 2 (hi1,j )∗ vji , we rewrite the SIR CCDF (7) as " # K K X X 2  γ 2 ∗ P hk1,1 ĥk1,1 > γ Ii = P hk1,1 > Ii cos2 θ1 i=1 i=1 ## ! " " N −1 P PK k m X I ) I γ γm ( K (a) i=1 i i=1 i cos2 θ1 , {Ii }i=1,...,K exp − =E E 2m θ 2θ m! cos cos 1 1 m=0 Defining Ii = " (b) = P N k −1 X m=0 dk1 dij # m 2 γm m ∂ LI/ cos θ1 (s) (−1) m! ∂sm where (a) follows that hk1,1 2 , (68) s=γ follows the Chi-squared distribution with 2Nk degrees of freedom   and (b) follows the derivative property of the Laplace transform, which is E X m e−sX = P (−1)m ∂ m LX (s)/∂sm and I = K i=1 Ii . Now we obtain LI/ cos2 θ1 (s).  β PK P −β 2 Pi − s2 kdk1 k di (hi1,j )∗ vji | s | i=1 Pk k j k di ∈Φi \dk cos θ1 1 j LI/ cos2 θ1 (s) = E e , Denoting z = , cos2 θ1    K Y Y 1 (a) = ER,cos2 θ1 EΦi  dk1 = R, cos2 θ1  Pi β i −β 1 + z Pk R dj i=1 dij ∈Φi \dk1 " ! !# Z ∞ K Y 1 rdr , (69) = ER,cos2 θ1 exp −2πλk 1− Pi β −β 1 + z Pk R r Ri i=1 32 where Ri =  Pi S i Pk Sk 1/β R and (a) follows the independence between each tier. By leveraging the proof of Theorem 1 in [13], (69) is calculated as "  2/β    !# K Y Pi Si s Sk LI/ cos2 θ1 (s) = ER,cos2 θ1 exp −πλi R2 D ,β 2 Pk Sk cos θ1 Si i=1  2/β Bk PK Pi Si Z 2− Nk −1 λ i=1 i Pk Sk 2Bk (Nk − 1)xNk −2 · = (70)  2/β h   i dx. PK Sk Pi S i s 0 1 + D( 1−x Si , β) i=1 λi Pk Sk  This completes the proof. A PPENDIX B P ROOF OF T HEOREM 2 For the desired channel, since vi1 is independent to h∗1,i1 and isotropic, h∗1,i1 vi1 2 follows the exponential distribution with unit mean. For the intra-cluster interference IIn (2 ≤ ` ≤ L),   2 h∗1,i` vi` is equivalent to kh1,i` k2 sin2 θi` β 1, Nπ(i` ) − 2 , where β 1, Nπ(i` ) − 2 is a Beta  random variable that follows Beta 1, Nπ(i` ) − 2 and sin2 θi` follows (5). We note that this is from the derivation in [?]. By the distribution of a product of a Gamma random variable  and a Beta random variable [27], kh1,i` k2 sin2 θi` β 1, Nπ(i` ) − 2 boils down to Γ (1, δ) with −N δ=2 Bi ` π(i` ) −1 . Since we assume that the intra-cluster BS only uses L antennas, Nπ(i` ) = L for 2 i` ∈ C. Accordingly, the Laplace transform of the intra-cluster interference fading h∗1,i` vi` is   2 1 −s h∗1,i vi` ` = (71) E e Bi . ` − L−1 1 + s2 Finally, for the out-of-cluster interference links IOut (L ≤ `), h∗1,i` vi` 2 is an exponential random variable with unit mean due to the random beamforming effect. By leveraging these results, the SIR CCDF (11) is written as follows " # 2 Pπ(i1 ) kdi1 k−β h∗1,i1 vi1 P ≥γ IIn + IOut     Pπ(j) β 2 2 −β Y −γδ h∗ v Y −γ P (a) kdi k kdj k |h∗1,j vj |  = E e 1,` 1,i` i`  · E  e π(i1 ) 1 i` ∈C\i1 j∈N\C  (b)  1 Y =  i` ∈C\i1 | Bi ` − L−1 1 + γδ1,` 2 {z (c) K Y · i=1 }|   ER E    1 Y  dij ∈Φi \B(0,Ri ) 1 + γδ1,L PPii Rβ kdi k−β L {z   kdiL k = R } (d) (72) 33 where Ri =  Pi Si Pk Sk 1/β R with kdiL k = R. We explain each step of the above derivation 2 as follows: (a) follows that the desired link’s signal power ( h∗1,i1 vi1 ) is distributed as the exponential distribution with unit mean and there is independence between the intra-cluster interference and the out-of-cluster interference. (b) comes from (71) and h∗1,i` vi` 2 ∼ exp(1) for ` ≥ L. We note that (c) indicates the Laplace transform of the intra-cluster interference IIn and (d) is the Laplace transform of the out-of-cluster interference. Since we assume the fixed intra-cluster BSs’ conditions, (c) involves no randomness. Focusing on (d), we assume that the furthest BS in the coordination set C is included in the k-th tier, i.e., π(iL ) = k. Then, we have the following due to the probability generating functional of the PPP. "  2/β    !# K X P S Sk i i (d) = ER exp − πλi R2 D γδ1,L ,β , Pk Sk Si i=1 (73) where D (·, ·) is defined in (16). Now we marginalize (73) with respect to R, whose the distribution function is obtained in Lemma 5. The Laplace transform of the out-of-cluster interference is " ER exp − K X πλi R2  i=1  PK 2/β    !# Pi Si Sk D γδ1,L ,β Pk Sk Si L  2/β λi PPki SSki   2/β h    i  , K Pi S i 1 + D γδ1,L SSki , β i=1 λi Pk Sk  = P i=1 (74)  which completes the proof. R EFERENCES [1] J. Park and R. W. Heath, “Adaptive feedback partitions in dynamic zero-forcing beamforming based on stochastic geometry,” in Proc. IEEE Workshop on Global Comm. Conf., Dec. 2016, pp. 1–6. [2] R. Bhagavatula and R. Heath, “Adaptive bit partitioning for multicell intercell interference nulling with delayed limited feedback,” IEEE Trans. Sig. Proc., vol. 59, no. 8, pp. 3824–3836, Aug. 2011. [3] N. Lee and W. Shin, “Adaptive feedback scheme on K-cell MISO interfering broadcast channel with limited feedback,” IEEE Trans. Wireless Comm., vol. 10, no. 2, pp. 401–406, Feb. 2011. [4] F. Yuan, C. Yang, G. Wang, and M. Lei, “Adaptive channel feedback for coordinated beamforming in heterogeneous networks,” IEEE Trans. Wireless Comm., vol. 12, no. 8, pp. 3980–3994, Aug. 2013. [5] P. de Kerret and D. Gesbert, “Degrees of freedom of the network mimo channel with distributed csi,” IEEE Trans. Info. Th., vol. 58, no. 11, pp. 6806–6824, Nov. 2012. [6] X. Rao, L. Ruan, and V. K. N. Lau, “Limited feedback design for interference alignment on MIMO interference networks with heterogeneous path loss and spatial correlations,” IEEE Trans. Sig. Proc., vol. 61, no. 10, pp. 2598–2607, May 2013. 34 [7] Q. Niu, Z. Zeng, T. Zhang, Q. Gao, and S. Sun, “Interference alignment and bit allocation in heterogeneous networks with limited feedback,” in Proc. IEEE Symp. on Wireless Pers. Multimedia Comm., Sep. 2014, pp. 514–519. [8] S. Akoum and R. W. Heath, “Interference coordination: Random clustering and adaptive limited feedback,” IEEE Trans. Sig. Proc., vol. 61, no. 7, pp. 1822–1834, Apr. 2013. [9] C. Li, J. Zhang, M. Haenggi, and K. B. Letaief, “User-centric intercell interference nulling for downlink small cell networks,” IEEE Trans. Comm., vol. 63, no. 4, pp. 1419–1431, Apr. 2015. [10] J. Park, N. Lee, J. G. Andrews, and R. W. Heath, “On the optimal feedback rate in interference-limited multi-antenna cellular systems,” IEEE Trans. Wireless Comm., vol. 15, no. 8, pp. 5748–5762, Aug. 2016. [11] M. Kountouris and J. G. Andrews, “Downlink SDMA with limited feedback in interference-limited wireless networks,” IEEE Trans. Wireless Comm., vol. 11, no. 8, Aug. 2012. [12] J. Park and R. W. Heath, “Multiple-antenna transmission with limited feedback in device-to-device networks,” IEEE Wireless Comm. Lett., vol. 5, no. 2, pp. 200–203, Apr. 2016. [13] H. S. Jo, Y. J. Sang, P. Xia, and J. G. Andrews, “Heterogeneous cellular networks with flexible cell association: A comprehensive downlink SINR analysis,” IEEE Trans. Wireless Comm., vol. 11, no. 10, pp. 3484–3495, Oct. 2012. [14] F. Baccelli and B. Blaszczyszyn, Stochastic Geometry and Wireless Networks, Volume I - Theory, ser. Foundations and Trends in Networking. Now Publishers, 2009, vol. 3. [15] X. Zhang and J. G. Andrews, “Downlink cellular network analysis with multi-slope path loss models,” IEEE Trans. Comm., vol. 63, no. 5, pp. 1881–1894, May 2015. [16] K. K. Mukkavilli, A. Sabharwal, E. Erkip, and B. Aazhang, “On beamforming with finite rate feedback in multiple-antenna systems,” IEEE Trans. Info. Th., vol. 49, no. 10, pp. 2562–2579, Oct. 2003. [17] S. Zhou, Z. Wang, and G. B. Giannakis, “Quantifying the power loss when transmit beamforming relies on finite-rate feedback,” IEEE Transactions on Wireless Communications, vol. 4, no. 4, pp. 1948–1957, Jul. 2005. [18] A. Gersho, “Asymptotically optimal block quantization,” IEEE Trans. Info. Th., vol. 25, no. 4, pp. 373–380, Jul. 1979. [19] H. S. Dhillon, R. K. Ganti, F. Baccelli, and J. G. Andrews, “Modeling and analysis of K-tier downlink heterogeneous cellular networks,” IEEE Jour. Select. Areas in Comm., vol. 30, no. 3, pp. 550–560, Apr. 2012. [20] K. A. Hamdi, “A useful lemma for capacity analysis of fading interference channels,” IEEE Trans. Comm., vol. 58, no. 2, pp. 411–416, Feb. 2010. [21] J. Park, S. Park, A. Yazdan, and R. W. Heath, “Optimization of mixed-ADC multi-antenna systems for cloud-RAN deployments,” IEEE Trans. Comm., vol. PP, no. 99, pp. 1–1, 2017. [22] M. Haenggi, “On distances in uniformly random networks,” IEEE Trans. Info. Th., vol. 51, no. 10, pp. 3584–3586, Oct. 2005. [23] N. Lee, D. Morales-Jimenez, A. Lozano, and R. W. Heath, “Spectral efficiency of dynamic coordinated beamforming: A stochastic geometry approach,” IEEE Trans. Wireless Comm., vol. 14, no. 1, pp. 230–241, Jan. 2015. [24] B. Khoshnevis, W. Yu, and Y. Lostanlen, “Two-stage channel quantization for scheduling and beamforming in network MIMO systems: Feedback design and scaling laws,” IEEE Jour. Select. Areas in Comm., vol. 31, no. 10, pp. 2028–2042, Oct. 2013. [25] C. Hao and B. Clerckx, “Achievable sum DoF of the K-user MIMO interference channel with delayed CSIT,” IEEE Trans. Comm., vol. 64, no. 10, pp. 4165–4180, Oct. 2016. [26] A. Zaib, M. Masood, A. Ali, W. Xu, and T. Y. Al-Naffouri, “Distributed channel estimation and pilot contamination analysis for massive MIMO-OFDM systems,” IEEE Trans. Comm., vol. 64, no. 11, pp. 4607–4621, Nov. 2016. [27] S. Nadarajah and S. Kotz, “On the product and ratio of Gamma and Beta random variables,” Allgemeines Statistisches Archiv, vol. 89, no. 4, pp. 435–449, 2005.
7cs.IT
Practical Inlining of Functions with Free Variables Lars Bergstrom John Reppy Nora Sandler Matthew Fluet Rochester Institute of Technology [email protected] arXiv:1306.1919v1 [cs.PL] 8 Jun 2013 University of Chicago {larsberg,jhr,nlsandler}@cs.uchicago.edu Abstract A long-standing practical challenge in the optimization of higherorder languages is inlining functions with free variables. Inlining code statically at a function call site is safe if the compiler can guarantee that the free variables have the same bindings at the inlining point as they do at the point where the function is bound as a closure (code and free variables). There have been many attempts to create a heuristic to check this correctness condition, from Shivers’ kCFA-based reflow analysis to Might’s ∆CFA and anodization, but all of those have performance unsuitable for practical compiler implementations. In practice, modern language implementations rely on a series of tricks to capture some common cases (e.g., closures whose free variables are only top-level identifiers such as +) and rely on hand-inlining by the programmer for anything more complicated. This work provides the first practical, general approach for inlining functions with free variables. We also provide a proof of correctness, an evaluation of both the execution time and performance impact of this optimization, and some tips and tricks for implementing an efficient and precise control-flow analysis. 1. Introduction Inlining is a program transformation that replaces a function call with the code body from the target of the call. This transformation can directly improve performance by eliminating both function call overheads — such as stack management, argument passing, and the jump instruction — and runtime overheads, such as garbage collection checks. Inlining can also indirectly improve performance by optimizing the code body with respect to actual arguments. In higher-order languages, function calls can also be made indirectly through a closure, which is a runtime value that contains a code pointer and an environment containing the values of bound variables; inlining of first-class functions gains additional potential performance improvements through removal of the closure value. Unfortunately, inlining of functions with free variables requires additional safety analysis. Optimizing compilers must ensure that the dynamic environment at the static location where the code can potentially be inlined is the same as the dynamic environment at all of the closure capture locations that flow to it, up to the free variables of the function to inline. This problem is critical, as inlining of functions with free variables comes up in idiomatic uses of most higher-order languages. Consider the definition of the map function in ML, annotated with a superscript label at an interesting call site: val x = 3 fun g i = i + x fun map f l = case l of l::ls => (f l)1 ::(map f ls) | _ => [] val res = map g [1,2,3] Assuming that there are no other calls to the function map, we would like to inline the function g that increments its integer argument by three into the map function at the call site labeled 1. After inlining, constant propagation, and a round of useless variable elimination, we would obtain the following code: fun map l = case l of l::ls => (l+3)::(map ls) | _ => [] val res = map [1,2,3] While safe in this specific example, inlining of functions such as g is not safe in general because of its free variables, x and (less obviously) +. The potential lack of safety comes from these free variables which, when inlined, may have had a different binding at their original capture point than they have at the inlining point. Most modern functional compilers make this simple, idiomatic example work by ignoring any free variables that are bound at the top level when making inlining decisions. The following example1 exhibits the importance of reasoning about environments when performing inlining on functions with free variables. The function f takes a boolean and a function of type unit -> bool, returning a function of that same type. If the boolean argument to f is true, it will return a new function that simply calls the function it was passed. If the argument was false, then that parameter is captured in a closure and returned. fun f (b, k) = if b then (fn () => (k ())1 ) else (fn () => b)2 val arg = f (false, (fn () => false)) val res = f (true, arg) val final = res () First, the function f is called with false, in order to capture the variable b in a closure. Then, f is called again, this time with [Copyright notice will appear here once ’preprint’ option is removed.] 1 Inspired by one from Might’s Ph.D. dissertation [Mig07]. the result of the first call, to produce a new closure — in an environment with a different binding for b — that wraps the one from the first call. Finally, we call that closure. At the call site labeled 1, control-flow analysis can determine that only the anonymous function labeled 2 will ever be called. Unfortunately, if we inline the body of the anonymous function at that location, as shown in the example code below, the result value final will change from false to true. The problem is that the binding of the variable b is not the same at the potential inline location as it was at its original capture location. followed by a section that describes our novel, practical solution. Finally, we provide empirical data and conclude. Source code for our complete implementation and all the benchmarks described in this paper is available at: http://smlnj-gforge.cs.uchicago.edu/ projects/manticore/. 2. Practical Control-Flow Analysis This section provides an overview of our specific implementation of control-flow analysis, placing it in context with other implementations, both theoretical and practical. For a more general introduction to control-flow analysis, in particular the 0CFA style that we use, the book by Nielson et al. provides a comprehensive introduction to both static program analysis and 0CFA [NNH99]. While many others have implemented control-flow analysis in their compilers [Ser95, CJW00, AD98], our analysis is novel in its tracking of a wider range of values, including datatypes, and its lattice coarsening to balance performance and precision. fun f (b, k) = if b then (fn () => ((fn () => b) ())1 ) else (fn () => b)2 val arg = f (false, (fn () => false)) val res = f (true, arg) val final = res() While this example is obviously contrived, this problem occurs regularly and the inability to handle the environment problem in general severely limits most compilers. This final example shows a slightly more complicated program that defeats simple heuristics but in which inlining is safe and the techniques presented in this work enable. 2.1 General algorithm Using the terminology of Midtgaard’s comprehensive survey of control-flow analysis [Mid12], our implementation is a zerothorder control-flow analysis (0CFA). A 0CFA computes a finite map from all of the variables in a program to a conservative abstraction of the values that they can take on during the execution of the code. Ours does this by starting from an empty map and iterating over the intermediate representation of the program, merging value flow information into the map based on the expressions until the map no longer changes. In our experience, the key to keeping performance acceptable while still maintaining high precision lies in carefully choosing (and empirically tuning) the tracked abstraction of values. let val y = m () fun f _ = y fun g h = (h ())1 in g f end At the call site labeled 1, it is clearly safe to inline the body of the function f, since y has the same binding at the inline location as the capture location. Since it is not a trivial idiomatic example, however, it is not commonly handled. This work shows how to use control-flow analysis (CFA) to handle many more inlining situations than are possible in either type-directed optimizers or simpler heuristics-based optimizers. By reformulating this environmental consonance problem as a graph reachability problem instead of a partial flow analysis, we have reduced this analysis to a single linear-log time analysis, independent of the number of potential inlining sites. This reformulation makes higher-order inlining in the presence of free variables practical, results in better code performance, and is now on by default in the Manticore system. Our contributions are: 2.2 Tuning the lattice Each time we evaluate an expression whose result is bound to a variable, we need to update the map with a new abstract value that is the result of merging the old abstract value and the new value given by the analysis. In theory, if all that we care about in the analysis is the mapping of call sites to function identifiers, we could use a straightforward domain for the value map (V), based on the powerset of the function identifiers: V : VarID 7→ 2FunID Unfortunately, this domain is insufficiently precise because of the presence of tuples and datatypes as well as the default Standard ML calling convention, in which all arguments are passed as a single argument that is a tuple containing those arguments. Without tracking more complicated data structures, we will only be able to track values in trivial code without datatypes or multi-argument functions. The representation we use for abstract values therefore is a recursive datatype, as shown in Figure 1. The special > (TOP) and ⊥ (BOT) elements indicate either all possible values or no known values, respectively. A TUPLE value handles both the cases of tuples and ML datatype representations, which by this point in the compiler have been desugared into either raw values or tagged tuples. The LAMBDAS value is used for a set of variable identifiers, all of which are guaranteed to be function identifiers. A lattice over these abstract values uses the > and ⊥ elements as usual, and treats values of TUPLE and LAMBDAS type as incomparable. When two LAMBDAS values are compared, though, the subset relationship provides an ordering. It is this ordering that allows us to incrementally merge flow information, up to a fixed limit. The most interesting portion of our implementation is in our handling of merging two TUPLE values. In the trivial recursive solution, the analysis will fail to terminate, due to the presence of recursive datatypes • A practical heuristic for inlining functions with free variables. • Proof of correctness of that heuristic. • Timing results for both the cost of whole-program higher-order inlining analysis (< 3% of compilation time) and its impact on program performance (up to 8% speedup). • An additional optimization, branch elimination, that is both effective and nearly cost-free when already performing controlflow analysis. Roadmap First, in the next section we provide a brief introduction to control-flow analysis and present novel information about tuning the analysis with respect to recursive datatypes. Section 3 provides an overview of the Manticore compiler, with a focus on the continuation-passing style intermediate representation of the compiler, on which this work is based. The following sections discuss some of the basic optimizations performed using the results of control-flow analysis and introduce a straightforward optimization — branch elimination — that takes advantage of a small extension to the control-flow analysis. Section 6 discusses the analysis challenges presented by environments in some more detail, and is 2 2013/6/11 first-order representation suitable for code generation. CPS transformation is performed in the Danvy-Filinski style [DF92]. This representation is a good fit for a simple implementation of controlflow analysis because it transforms each function return into a call to another function. The uniformity of treating all control-flow as function invocations simplifies the implementation. We also have an implementation of control-flow analysis on the BOM directstyle representation, which was used for some Concurrent MLspecific optimizations [RX07]. The BOM-based implementation is almost 10% larger in lines of code, despite lacking the optional features, user-visible controls, and optimizations described in this paper. The primary datatypes and their constructors are shown in Figure 3. Key features of this representation are: datatype value = TOP | TUPLE of value list | LAMBDAS of CPS.Var.Set.set | BOT Figure 1. Abstract values. (e.g., on each iteration over a function that calls the cons function, we will wrap another TUPLE value around the previous value). In practice for typical Standard ML programs, we have found that limiting the tracked depth to 5 and then failing any further additions to the > value results in good balance of performance and precision. Note that unlike some other analyses, such as sub-zero CFA, we do not limit the maximum number of tracked functions per variable [AD98]. If the only use of our CFA were inlining, then we could also limit our CFA to a single potential function; however, as we discuss further in Section 4, this implementation of CFA is used for several optimizations that can still be performed when multiple functions flow to the same call site. Further, we did not notice any change in the runtime of the analysis when reducing the number of tracked function variables, but it severely impacts our ability to perform some of those other optimizations. • Each expression has a program point associated with it, which serves as a unique label. • It has been normalized so that every expression is bound to a variable. • The rhs datatype, not shown here, contains only immediate primitive operations. • The CPS constraint is captured in the IR itself — Apply and are non-recursive constructors, and there is no way to sequence an operation after them. Throw 2.3 Adding booleans for additional flow-sensitivity Normally, CFA does not track booleans and other raw values, so they are represented by the > value. To track booleans, we add true and false to our list of abstract values, and update CFA to account for their place in the lattice. When both true and false values flow to the same variable, we promote its abstract value to >. The updated datatype is shown in Figure 2. datatype exp = Exp of (ProgPt.ppt * term) and term = Let of (var list * rhs * exp) | Fun of (lambda list * exp) | Cont of (lambda * exp) | If of (cond * exp * exp) | Switch of (var * (tag * exp) list * exp option) | Apply of (var * var list * var list) | Throw of (var * var list) and lambda = FB of { f : var, params : var list, rets : var list, body : exp } and . . . datatype value = TOP | TUPLE of value list | LAMBDAS of CPS.Var.Set.set | BOOL of bool | BOT Figure 2. Abstract values with boolean tracking. 3. Manticore Figure 3. Manticore CPS intermediate representation. In order to provide more details on both the implementation of control-flow analysis and the optimizations that rely on it, we provide some background on the host compiler and relevant intermediate representation. The compiler operates on the whole program at once, reading in the files in the source code alongside the sources from the runtime library. As covered in more detail in an earlier paper [FFR+ 07], there are six distinct intermediate representations (IRs) in the Manticore compiler: 4. In Manticore, we use the data from control-flow analysis (CFA) to augment some of our optimizations. In this section, we list some of those optimizations and describe the differences between purely type-directed optimizations and those that rely on the results of CFA. 1. Parse tree — the product of the parser. 2. AST — an explicitly-typed abstract-syntax tree representation. 4.1 3. BOM — a direct-style normalized λ-calculus. Argument flattening The default calling convention in Standard ML (and many other functional languages) involves heap-allocating all arguments to a function and passing a pointer to that heap-allocated data to the function. As has been described in the Haskell literature, we could analyze the type of the function and then, based on the calling convention of that type, place the arguments in appropriate registers and evaluate the function [MP04]. In many cases, when combined with inlining and other optimizations, we can then avoid allocating some arguments in the heap. By instead using CFA as the basis for our optimizations, we can not only specialize the calling convention but have several additional optimization opportunities: 4. CPS — a continuation passing style λ-calculus. 5. CFG — a first-order control-flow-graph representation. 6. MLTree — the expression tree representation used by the MLRISC code generation framework [GGR94]. The work in this paper is performed on only the CPS representation. 3.1 Basic Optimizations CPS Continuation passing style (CPS) is the final high-level representation used in the compiler before closure conversion generates a 3 2013/6/11 the true case. After that branch elimination and a useless variable elimination, we are left with the following program: 1. If the target function or functions only use a few of the parameters, we can change their calling convention and type to only pass those parameters. fun f () = g 3 2. We adjust both callers and callees to flatten tuples in the case where the caller performs the allocation and the callee simply extracts members of that tuple. Since this optimization relies on information already computed by the control-flow analysis and requires only a single pass over the intermediate representation, as shown in Section 8, it has nearly zero cost. This work has been described in detail in an earlier paper [BR09]. 4.2 Calling conventions There are two interesting optimizations related to CFA in the Manticore implementation of calling conventions. In the following example, even in a type-directed optimizer, inlining will cause g to be inlined and thus the call to f will become known and eligible for a direct jump: 6. Some optimizations that are straightforward in a first-order language when combined with control-flow analysis are not safe in a higher-order language using only the results of a zeroth-order CFA as described in Section 2. In that description of the CFA, the abstraction of the environment is a single, global map for each variable to a single value from the lattice. This restriction means that the CFA results alone do not allow us to reason separately about bindings to the same variable that occur along different controlflow paths of the program. This restriction impedes inlining. Inlining a function is a semantically safe operation when a call site is to a unique function and that function has no free variables. But, in a higher-order language, inlining of a function with free variables is only safe when those free variables are guaranteed to have the same bound value at the capture location and inlining location, a property which Shivers called environmental consonance [Shi91]. For example, in the following code, if CFA determines that the function g is the only one ever bound to f, then the body of g may be inlined at the call site labeled 1. let fun f x = x + 1 fun g (h, i) = h i in g (f, 3) end But, if g is too large to inline and if there are any other functions of the same type as f, it will be unclear to the compiler what functions could be bound to the variable h, forcing it to make an indirect call through a pointer to invoke f. In Manticore, we use CFA to recognize that f is known and perform a direct jump to it within the body of g. Even in the case where f has free variables, and thus we need to pass a closure, an additional optimization is still available. Typically, closures include both a code pointer and the associated environment data. In this case, though, we replace the closure with just the environment data and instead perform a direct jump. Both of these optimizations remove just a single pointer indirection and a few bytes of allocation, but the availability of these optimizations means that users of the system do not have to transform their code by hand to get good performance in key inner loops. 5. val x = 3 fun g i = i + x fun map f l = case l of l::ls => (f l)1 ::(map f ls) | _ => [] Branch elimination val res = map g [1,2,3] In Section 2.3, we showed an extension of the lattice of abstract values computed by control-flow analysis that also tracks boolean values. In this section, we describe a compiler optimization that eliminates conditional branches that will never be taken based on these values. Consider the following function: While many compilers special-case this particular situation, in which all free variables of the function are bound at the top level, even small changes break these fragile optimizers, as shown in the following code: fun wrapper x = let fun g i = i + x fun map f l = case l of l::ls => (f l)$ˆ1$::(map f ls) | _ => [] in map g [1,2,3] end val res1 = wrapper 1 val res2 = wrapper 2 fun f (boolean) = if boolean then g 3 else g 4 If the value of boolean is known, we can eliminate the conditional statement and leave only the relevant branch. Early in the compilation process of Manticore, between the AST and BOM phases described in Section 3, the if construct on a boolean is converted into a case over booleans with constant values. The example above is therefore translated into roughly the following code, in direct-style instead of continuation-passing style for consistency with the rest of the examples in this paper: fun f case of | Environment problems Performing the inlining operation is again safe, but the analysis required to guarantee that the value of x is always the same at both the body of the function wrapper and in the call location inside of map is beyond simple heuristics. (boolean) = boolean 0x0 => g 4 0x1 => g 3 Copy propagation A similar operation that has the identical problem is copy propagation. In this operation, instead of inlining the body of the function (e.g., because it is too large), we are attempting to remove the creation of a closure by turning an indirect call through a variable into a direct call to a target function. In the following code, the function g is passed as an argument to map and called in its body. Suppose this function occurs in a larger program that only calls with arguments whose values are true. In that case, the controlflow analysis will have an abstract value of BOOL(true) associated with the variable boolean. Then, the branch elimination pass can eliminate all but the arm of the case expression that corresponds to f 4 2013/6/11 variables of the function, since those are the ones that will be rebound when the function is called through a closure. A second node is labeled with all of the parameters to the function, since they will also be bound when the function is called. Finally, any letbinding in the control-flow graph will be labeled with the variable being bound. Augmentation of the call sites is done using the results of the control-flow analysis described in Section 2. In the intermediate representation, all targets of call sites are variables. In the trivial case, that variable is the name of a function identifier, and we can simply add an edge from the call site to that function’s entry point. Otherwise, that variable is of function type but can be bound to many possible functions. In that case, the control-flow analysis will provide one of three results: fun map f l = case l of l::ls => (f l)::(map f ls) | _ => [] val res = map g [1,2,3] When g either has no free variables or we know that those free variables will always have the same values at both the capture and inlining location, we can substitute g, potentially removing a closure and enabling the compiler to optimize the call into a direct jump instead of an indirect jump through the function pointer stored in the closure record. Interactions These optimizations are not only important because they remove an indirect call. If the variable that previously held the closure is no longer used, then the useless variable elimination pass will remove it from all calls and as a parameter to the function, as shown in the code below, reducing register pressure. • The value ⊥, indicating that the call site can never be reached in any program execution. No changes are made to the program graph in this case. fun map l = case l of l::ls => (g l)::(map ls) | _ => [] • The value >, indicating that any call site may be reached. In this case, we add an edge to a special node that represents any call site, whose optimization is discussed in Section 7.4. val res = map [1,2,3] • A set of function identifiers. Here, we add one edge from the call site per function, to that function’s entry point. 7. Reflow At this point, the graph is complete and enables us to reformulate the safety property. We can now simply ask: does there exist a path between the closure capture location and the target call site in the graph that passes through a rebinding location for the free variables of the function that we want to inline? A theoretical solution to this environment problem that enables a suite of additional optimizations is reflow analysis [Shi91]. Traditional reflow analysis requires re-running control-flow analysis from the potential inlining point and seeing if the variable bindings for all relevant free variables are uniquely bound with respect to that sub-flow. Unfortunately, this operation is potentially quite expensive (up to the same complexity as the original CFA, at each potential inlining site) and no compiler performs it in practice. We use a novel analysis that builds upon the static control-flow graph of the program. Our goal was to build up a data structure that could perform — in less than linear time — the same test used in reflow analysis. The optimizations from Section 6 are safe when the free variables of the target function are guaranteed to be the same at its closure creation point and at the target call site. In the original work by Shivers, this question was answered by checking whether a binding for a variable had changed between those two locations via a re-execution of control-flow analysis. Our analysis instead turns that question into one of graph reachability: in the graph corresponding to the possible executions of this program, is there any possible path between those two locations through a rebinding of the free variables? This graph is built in two steps. First, build a static control-flow graph for each function, ignoring function calls, annotated with variable bindings and rebindings. Then, augment those individual function graphs with edges from the call sites to the potential target functions, as determined by the control-flow analysis. Though we discuss only our implementation of 0CFA in this work, this approach to reflow analysis also works with other control-flow analyses. The variable bindings and rebindings in a program written in the continuation-passing style (CPS) representation defined in Figure 3 happen in two cases: 7.1 Safe example We first revisit the first complicated, but safe, example from the introduction, annotated with additional labels for use in the graph: let val y2 = 2 fun f3 _ = y4 fun g5 h7 = (h ())1 in (g f)6 end In the first stage of building the graph, we create the static controlflow graph for each function. That graph is shown in Figure 4. Nodes in this graph represent the labeled expressions from the source program, and edges are the static control-flow. We also create a separate function for toplevel bindings and the program’s control-flow from the entry point. Then, we augment that graph with edges from each of the call sites to the target functions, based on the results of CFA. That graph appears in Figure 5. Revisiting the question of whether it is safe to inline the body of the function f at the call site labeled 1, we now turn it into a graph question. Does there exist a path from the closure capture location (node 5), through either of the rebinding sites for the free variable y (nodes 2 and 4), that terminates at the potential inlining site (node 1)? Since one does not exist in this graph, the inlining is safe to perform. • At the definition of the variable, which is either a let-binding or as a parameter of a function. • In the case when a free variable of a function was captured in a closure and this captured value is restored for the execution of that function. 7.2 Unsafe example For a negative case, we revisit the unsafe example from the introduction, with additional labeling added. We capture both of these conditions through labeled nodes in the graph for each function. One node is labeled with all of the free 5 2013/6/11 main y 2 f 3 g 5 main g h 7 f 1 arg 3 b,k 8 2 4 5 7 f y f fn () => k() 10 4 k 1 6 res Figure 4. Control-flow graph for a safe example, before adding edges for call sites. main y 2 12 final g h 9 11 fn () => b b 6 7 Figure 6. Control-flow graph for an unsafe example, before adding edges for call sites. f g 3 1 interest. In the direct-style code we have used in this example, the outgoing edge from each of them corresponds to the return point of the function. In the continuation-passing style IR used in the compiler for this analysis, those have been translated into calls to functions that correspond to the return point. In this example, we were investigating whether it was safe to inline the anonymous function defined at label 2 at the call site labeled 1.2 So, in the graph in Figure 7, does there exist a path from the closure capture location (2) to the potential inlining point (1) that passes through a binding location for b (4 or 6)? Since we can find such a path in the graph (e.g., 2 → 7 → 10 → 4 → 5 → 9 → 12 → 1), this inlining is potentially (and actually) unsafe, so it is disallowed under the reflow condition tested in our system. 5 f y 4 6 Figure 5. Control-flow graph for a safe example, with edges for call sites. 7.3 Computing graph reachability quickly This question about the existence of paths between nodes in the graph is a reachability problem. There are off-the-shelf O(n3 ) algorithms such as Warshall’s algorithm for computing graph reachability [War62], but those are far too slow for practical use. On even small graphs of thousands of nodes, they take seconds to run. Other optimized algorithms have runtimes on the order of O(n ∗ log n), but this is the runtime for each query and we might perform up to O(n) queries for a particular program. Therefore, we use an approach that collapses the graph quickly into a map we can use for logarithmic-time queries of the reacha- fun f3 (b, k)4 = if b then (fn () => (k ())1 )5 else (fn () => b6 )2 val arg7 = (f (false, (fn () => false)))8 val res9 = (f (true, arg))10 val final11 = (res ())12 Again, first we build a graph of the static control-flow for each function, shown in Figure 6. Then, we augment that graph with edges from each of the call sites to the target functions, based on the results of CFA. That graph appears in Figure 7. The nodes labeled 2, 5, and 6 are of particular 2 Knowing that V (k) = { (fn () => b) } instead of a larger set requires an analysis more precise than 0CFA, such as our RC-CFA [Ber09] or Might’s ΓCFA [MS06b]. 6 2013/6/11 main f arg Algorithm 1 Compute DAG reachability for a graph DAG for node ∈ DAG do Done(node) ← false if #points ∈ node = 1 then R(node) ← {} else R(node) ← {node} end if end for leaves ← all leaves in DAG while leaves is not empty do leaf ← a leaf in leaves leaves ← leaves − leaf Done(leaf ) ← true for p ∈ parents(leaf ) do R(p) ← R(p) ∪ R(leaf ) ∪ {leaf } if (∀c ∈ Children(p))(Done(c) = true) then leaves ← leaves ∪ {p} end if end for end while f 3 b,k 8 2 4 5 7 fn () => k() 10 res 1 9 12 final k 11 fn () => b b 7.4 Handling imprecision In practical implementation, we also need to handle a variety of sources of imprecision. C foreign function calls, the entry and exit point of the generated binary itself (i.e., the main function), and the limited lattice size all contribute to situations where a call site may be through a variable whose target is >, or unknown. The obvious way to handle this situation when creating the graph is to add an edge from any call site labeled > to every possible function entry point. Unfortunately, that frequently connects the entire graph, preventing the compiler from inlining any function at all. Instead, we take advantage of the fact that a call to any function is really only a call to any function where not all its callers are known. We therefore add an edge from any call site labeled > to any function whose callers are not all known. Since those functions are a relatively small set, the graph remains useful. 6 Figure 7. Control-flow graph for an unsafe example, with edges for call sites. bility between two nodes. The approach we use performs two steps. First, we take the potentially cyclic graph and reduce it into a set of strongly-connected components, which takes O(n ∗ log n). Then, we use a bottom-up approach to compute reachability in the resulting DAG, which is O(n). All queries are then performed against the resulting map from source component to set of reachable components. The membership test within that set takes O(log n). The overall complexity of our algorithm is therefore O(n ∗ log n). 7.5 Safety We prove safety of this algorithm by building on the conditions of correctness for inlining functions with free variables from Might and Shivers in their work on ∆CFA [MS06a]. In that work, they prove that two conditions are sufficient for semantics-preserving inlining of a function: Strongly-connected components We use Tarjan’s algorithm for computing the strongly-connected components [Tar72], as implemented in Standard ML of New Jersey by Matthias Blume. This produces a directed acyclic graph (DAG). There are two interesting types of components for this algorithm: those that correspond to only one program point and those that correspond to more than one program point. In the single point case, control-flow from that point cannot reach itself. When there are multiple points, controlflow can reach itself. This distinction is crucial when initializing the reachability map. 1. All closures invoked at the given call site are to the same function. 2. The environment at the call site is equivalent up to the free variables of that function to the environment within any captured closure that reaches it. To show the correctness of our algorithm, we therefore need to show that there is no case where our algorithm will attempt to perform an inlining operation, but the two ∆CFA inlining conditions do not hold. For contradiction, assume that there exists such an invalid inlining operation from our algorithm. Then, there are two cases to handle: Reachability in a DAG Starting from the leaf components of the graph, we add those components and everything that they can reach to the reachability set associated with each of their parent components. As those leaves are handled and removed from the worklist, their parents become leaves and we handle them iteratively until there are no components remaining in the graph. A more detailed description is shown in Algorithm 1. 7.5.1 Same function By construction, our 0CFA-based algorithm has more conservative (i.e., coarser) results than the idealized ∆CFA algorithm. Therefore, whenever we identify a call site as only invoking closures of a given function, so must ∆CFA. 7 2013/6/11 7.5.2 Environment equivalence This work has been implemented, tested, and is part of the current Manticore compiler’s default optimization suite. In addition to inlining, we also perform copy propagation, which replaces a variable that calls a function through a closure with the name of the function itself and requires an identical safety condition. For the captured free variables in one of the closures to be different between its capture point and inlining location, there must have been a change in those variable bindings between those two locations along a path in the control-flow graph. A variable binding can either have been superseded by a newer binding or reverted to an older binding. We know that the binding cannot have been superseded because we have added all of the binding locations for the variables in the program to our control-flow graph and then only allow inlining in the case where there is no path from the closure capture location to one of these binding locations and then on to the inlining point. Reversion to an earlier binding happens when a different binding to a variable has been captured in a closure which is then restored through the application of that closure. However, the controlflow graph for each function is augmented with a program point annotated with any free variables used in the function. These program points are also treated as binding locations, so we allow inlining only if no path from capture location to inlining location passes through such a binding location. Note that we are in a CPS-based representation and function calls never return. In a direct-style intermediate representation, the control-flow graph would similarly need rebinding locations for all of the variables that return into scope at each return point. 7.6 8.2 Limitations While safe, this analysis necessarily is more limited than general formulations of higher-order inlining as shown by Shivers’ kCFA framework (for larger values of k than 0) or Might’s ∆CFA approach [Shi91, MS06a]. Both of those analyses are able to distinguish environments created by different control-flow paths through the program. Our analysis collapses all different control-flow paths to each function, resulting in a potential loss of precision. For example, in the following program, which is an extension of the motivating example from the introduction, our attempt to inline at the call site labeled 1 will fail. After the first call to callsG, the function confounding is in the abstract possible set of functions that can be bound to the parameter k. Even though in the first call the boolean tracking avoids analyzing g and adding confounding to the list of possible values for h, when the second call comes through, the function f is added to the possible set of values for k and then both of those are added to the set of values that could be bound to h. Fundamentally, this problem is the one that stronger forms of control-flow analysis handle, though clearly there are some heuristics that could be used to increase the precision on this specific case. 8.3 Evaluation 8.1 Experimental method Compilation performance In Table 1, we have broken down the compilation time of these parallel benchmarks. While we have included the number of lines of code of the benchmarks, Manticore is a whole-program compiler, including the entire basis library. Therefore, in addition to the lines of code, we have also reported the number of expressions, where an expression is an individual term from the intermediate representation shown in Figure 3. By that stage in the compilation process, all unreferenced and dead code has been removed from the program. The most important results are: • Control-flow analysis and branch elimination are basically free. • The reflow analysis presented in this work (which represents let val y = 2 fun f _ = y fun confounding _ = raise Fail "" fun g h = h1 () fun callsG b k = if b then g k else 0 val bad = callsG false confounding in callsG true f end 8. Benchmarks For our empirical evaluation, we use six benchmark programs from our parallel benchmark suite. Each benchmark is written in a pure, functional style. The Barnes-Hut benchmark [BH86] is a classic N-body problem solver. Each iteration has two phases. In the first phase, a quadtree is constructed from a sequence of mass points. The second phase then uses this tree to accelerate the computation of the gravitational force on the bodies in the system. Our benchmark runs 20 iterations over 400,000 particles generated in a random Plummer distribution. Our version is a translation of a Haskell program [GHC]. The Raytracer benchmark renders a 2048 × 2048 image as twodimensional sequence, which is then written to a file. The original program was written in ID [Nik91] and is a simple ray tracer that does not use any acceleration data structures. The Mandelbrot benchmark computes the Mandelbrot set, writing its output to an image file of size 2048 × 2048. The Quickhull benchmark determines the convex hull of 8,000,000 points in the plane. Our code is based on the algorithm by Barber et al. [BDH96]. The Quicksort benchmark sorts a sequence of 5,000,000 integers in parallel. This code is based on the N ESL version of the algorithm [Sca]. The SMVM benchmark is a sparse-matrix by dense-vector multiplication. The matrix contains 3,005,788 elements, the vector contains 10,000, and the multiplication is iterated 25 times. the majority of the time spent in both the copy propagation and inlining passes) generally makes up 1-2% of the overall compilation time. • Time spent in the C compiler, GCC, generating final object code is the longest single stage in our compiler. 8.4 Benchmark performance Across our already tuned benchmark suite, we see several improvements and only one statistically significant slowdown, as shown in Table 2. The largest challenge with analyzing the results of this work is that for any tuned benchmark suite, the implementers will have already analyzed and removed most opportunities for improvement. When we investigated the usefulness of these optimizations on some programs we ported from a very highly tuned benchmark suite, the Computer Language Benchmark Game [CLB13], we could find zero opportunities for further optimization. All three of the major optimizations described in this paper — branch elimination, copy propagation, and higher-order inlining — Our benchmark machine has two 8 core Intel Xeon E5-2687 processors running at 3.10 GHz. It has 64 GB of physical memory. This machine runs x86 64 Ubuntu Linux 11.10, kernel version 3.0.0-30. We ran each benchmark experiment 30 times, and we report the median runtime and standard deviation in our tables. Times are reported in seconds. 8 2013/6/11 Benchmark Barnes-hut Raytracer Mandelbrot Quickhull Quicksort SMVM Lines 334 501 85 196 74 106 Expressions 17,400 12,800 9,900 15,200 11,900 13,900 Total (s) 8.79 6.54 5.06 7.67 5.49 7.25 CFA (s) 0.042 0.019 0.013 0.039 0.022 0.033 Branch Elim. (s) 0.003 0.002 0.006 0.003 0.001 0.002 Copy Prop. (s) 0.175 0.112 0.091 0.182 0.111 0.131 Inline (s) 0.198 0.124 0.098 0.177 0.122 0.123 GCC (s) 2.56 2.64 1.70 2.05 1.11 2.52 Table 1. Benchmark program sizes, both in source lines and total number of expressions in our whole-program compilation. Costs of the analyses and optimizations are also provided, in seconds. are applied to the optimized version, and none of them are present in the baseline. We run copy propagation before inlining in the compiler because that enables us to re-use the control-flow analysis information. If we performed inlining first, we would have to run CFA an additional time or manually update that information during the transformations before we could perform copy propagation. Mandelbrot especially benefits from these optimizations, with a 12% improvement on one processor and 7.8% improvement in parallel. In this program, there is only one possible function that can be performed on any parallel process — the one that renders a given pixel in the output image. Since control-flow analysis is able to determine that, the runtime’s scheduler libraries themselves become specialized via copy propagation to jump directly to that function, rather than relying on an indirect jump through the workstealing structures. This transformation also frees up many other variables that were kept by the scheduler to track the work in progress. While this program is certainly a special case, it is a good example of the usefulness of these optimizations in a wholeprogram compiler, as it allows specializations that are not available to the application author. The only statistically significant negative performance impact is on the one-processor version of Quicksort. This benchmark, unfortunately, shows one of the risks of these optimizations. Copy propagation and inlining can potentially extend the live range of variables. In the one processor version of this benchmark, the live range of one variable that would otherwise have been copied into a closure once and forgotten is extended into a another function that did not previously reference it. This extension not only increases the size of that function’s closure, but also requires the value be captured many times. In cases with more processors, the other optimizations balance out this one bad case, but it does demonstrate one of the risks of inlining or performing copy propagation on functions with free variables. value, opening up the possibility of several optimizations similar to this one [Mig10]. Reps, Horowitz, and Sagiv were among the first to apply graph reachability to program analysis [RHS95], focusing on dataflow and spawning an entire field of program analyses for a variety of problems, such as pointer analysis and security. While they also present an algorithm for faster graph reachability, theirs is still polynomial time, which is far too slow for the number of nodes in our graphs. A different algorithm for graph reachability that has even better asymptotic performance than the one we present in Section 7.3 is also available [Nuu94], computing reachability at the same time that it computes the strongly-connected components. However, it relies on fast language implementation support for mutation, which is not the case in our compiler’s host implementation system, Standard ML of New Jersey [AM91], so we use an algorithm that better supports the use of functional data structures. Serrano’s use of 0CFA in the Bigloo compiler is the most similar to our work here [Ser95]. It is not discussed in this paper, but we similarly use the results of CFA to optimize our closure generation. In that paper, he does not discuss the need to track function identifiers within data types (e.g., lists in Scheme) or limit the depth of that tracking, both of which we have found crucial in ML programs where functions often are at least in tuples, due to the default calling convention. Bigloo does not perform inlining of functions with free variables. Waddell and Dybvig use a significantly more interesting inlining heuristic in Chez Scheme, taking into account the potential impact of other optimizations to reduce the size of the resulting code, rather than just using a fixed threshold, as we do [WD97]. While they also will inline functions with free variables, they will only do so when either those variables can be eliminated or they know the binding at analysis time. Our approach differs from theirs in that we do not need to know the binding at analysis time and we support whole-program analysis, including all referenced library functions. 9. 10. Related Work Conclusion In this work, we have demonstrated the first practical and general approach to inlining and copy propagation that reasons about the environment. We hope that this work ushers in new interest and experimentation in environment-aware optimizations for higherorder languages. Additionally, we have presented tuning techniques for a control-flow analysis that tracks datatypes and an optimization — branch elimination — that is both useful and nearly free in a compiler that already performs control-flow analysis. The problem of detecting when two environments are the same with respect to some variables is not new. It was first given the name environment consonance in Shivers’ Ph.D. thesis [Shi91]. He proposed checking this property by re-running control-flow analysis (CFA) incrementally — at cost polynomial in the program size — at each inlining point. Might revisited the problem in the context of his Ph.D. thesis, and showed another form of analysis, ∆CFA, which more explicitly tracks environment representations and can check for safety without re-running the analysis at each inlining point [MS06a]. Unfortunately, this approach also only works in theory, as while its runtime is faster in practice than a full 1CFA (which is exponential), it is not scalable to large program intermediate representations. Might also worked on anodization, which is a more recent technique that identifies when a binding will only take on a single 10.1 Future work We have not investigated other optimizations, such as rematerialization, that were presented in some of Might’s recent work on anodization [Mig10] and might have an analog in our framework. An obvious extension to branch elimination is case statement specialization based on the flow of datatypes through the program. In this 9 2013/6/11 1 Processor Benchmark Barnes-hut Mandelbrot Quickhull Quicksort Raytracer SMVM Speedup 0% 12% 0.8% -3.3% 0.1% 0.3% Median 17.2 7.97 2.86 14.05 15.26 6.175 16 Processors Std. Dev. 0.03 0.019 0.003 0.02 0.01 0.005 Speedup -1.6% 7.8% 1.3% 0.2% 4.4% -0.6% Median 2.1 0.646 0.232 1.18 1.160 0.669 Std. Dev. 0.048 0.0445 0.012 0.025 0.074 0.019 Optimizations Branch Copy Elim. Prop. Inlined 3 14 0 1 3 0 3 14 0 1 5 0 1 3 0 2 8 5 Table 2. Performance results from branch elimination, copy propagation, and higher-order inlining optimizations. Medians and standard deviation are for the optimized version, reported in seconds. optimization, we could take an ML function that pattern matches across a datatype’s constructors and remove the arms of the pattern match that we can statically guarantee will never flow to that function. Additionally, our control-flow analysis needs further optimizations, both to improve its runtime and its precision. We have previously investigated Hudak’s work on abstract reference counting, which resulted in improvements in both runtime and precision,3 but that implementation is not yet mature [Hud86]. [DF92] Danvy, O. and A. Filinski. Representing control: A study of the CPS transformation. MSCS, 2(4), 1992, pp. 361–391. [FFR+ 07] Fluet, M., N. Ford, M. Rainey, J. Reppy, A. Shaw, and Y. Xiao. Status Report: The Manticore Project. In ML ’07. ACM, October 2007, pp. 15–24. [GGR94] George, L., F. Guillame, and J. Reppy. A portable and optimizing back end for the SML/NJ compiler. In CC ’94, April 1994, pp. 83–97. [GHC] GHC. Barnes Hut benchmark written in Haskell. Available from http://darcs.haskell.org/packages/ndp/ examples/barnesHut/. [Hud86] Hudak, P. A semantic model of reference counting and its abstraction (detailed summary). In LFP ’86, Cambridge, Massachusetts, USA, 1986. ACM, pp. 351–363. [Mid12] Midtgaard, J. Control-flow analysis of functional programs. ACM Comp. Surveys, 44(3), June 2012, pp. 10:1–10:33. [Mig07] Might, M. Environment Analysis of Higher-Order Languages. Ph.D. dissertation, Georgia Institute of Technology, Atlanta, GA, USA, 2007. [Mig10] Might, M. Shape analysis in the absence of pointers and structure. In VMCAI ’10, Madrid, Spain, 2010. Springer-Verlag, pp. 263– 278. [MP04] Marlow, S. and S. Peyton Jones. Making a fast curry: Push/enter vs. eval/apply for higher-order languages. In ICFP ’04. ACM, September 2004. [MS06a] Might, M. and O. Shivers. Environment analysis via ∆CFA. In POPL ’06, Charleston, South Carolina, USA, 2006. ACM, pp. 127–140. [MS06b] Might, M. and O. Shivers. Improving flow analyses via ΓCFA: abstract garbage collection and counting. In ICFP ’06, Portland, Oregon, USA, 2006. ACM, pp. 13–25. [Nik91] Nikhil, R. S. ID Language Reference Manual. Laboratory for Computer Science, MIT, Cambridge, MA, July 1991. [NNH99] Nielson, F., H. R. Nielson, and C. Hankin. Principles of Program Analysis. Springer-Verlag, New York, NY, 1999. [Nuu94] Nuutila, E. An efficient transitive closure algorithm for cyclic digraphs. IPL, 52, 1994. [RHS95] Reps, T., S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In POPL ’95, San Francisco, 1995. ACM. [RX07] Reppy, J. and Y. Xiao. Specialization of CML message-passing primitives. In POPL ’07. ACM, January 2007, pp. 315–326. [Sca] Scandal Project. A library of parallel algorithms written NESL. Available from http://www.cs.cmu.edu/ ˜scandal/nesl/algorithms.html. [Ser95] Serrano, M. Control flow analysis: a functional languages compilation paradigm. In SAC ’95, Nashville, Tennessee, United States, 1995. ACM, pp. 118–122. [Shi91] Shivers, O. Control-flow analysis of higher-order languages. Ph.D. dissertation, School of C.S., CMU, Pittsburgh, PA, May 1991. Acknowledgments David MacQueen, Matt Might, and David Van Horn all spent many hours discussing this problem with us, and without their valuable insights this work would likely have languished. This material is based upon work supported by the National Science Foundation under Grants CCF-0811389 and CCF-1010568, and upon work performed in part while John Reppy was serving at the National Science Foundation. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of these organizations or the U.S. Government. References [AD98] Ashley, J. M. and R. K. Dybvig. A practical and flexible flow analysis for higher-order languages. ACM TOPLAS, 20(4), July 1998, pp. 845–868. [AM91] Appel, A. W. and D. B. MacQueen. Standard ML of New Jersey. In PLIP ’91, vol. 528 of LNCS. Springer-Verlag, New York, NY, August 1991, pp. 1–26. [BDH96] Barber, C. B., D. P. Dobkin, and H. Huhdanpaa. The quickhull algorithm for convex hulls. ACM TOMS, 22(4), 1996, pp. 469– 483. [Ber09] Bergstrom, L. Arity raising and control-flow analysis in Manticore. Master’s dissertation, University of Chicago, November 2009. Available from http://manticore.cs. uchicago.edu. [BH86] Barnes, J. and P. Hut. A hierarchical O(N log N ) force calculation algorithm. Nature, 324, December 1986, pp. 446–449. [BR09] Bergstrom, L. and J. Reppy. Arity raising in Manticore. In IFL ’09, vol. 6041 of LNCS. Springer-Verlag, September 2009, pp. 90–106. [CJW00] Cejtin, H., S. Jagannathan, and S. Weeks. Flow-directed closure conversion for typed languages. In ESOP ’00. Springer-Verlag, 2000, pp. 56–71. [CLB13] CLBG. The computer language benchmarks game, 2013. Available from http://benchmarksgame.alioth.debian. org/. 3 Best results were achieved when using a maxrc of 1. 10 2013/6/11 [Tar72] Tarjan, R. Depth-first search and linear graph algorithms. SIAM JC, 1(2), 1972, pp. 146–160. [War62] Warshall, S. A theorem on boolean matrices. JACM, 9(1), January 1962. [WD97] Waddell, O. and R. K. Dybvig. Fast and effective procedure inlining. In SAS ’97, LNCS. Springer-Verlag, 1997, pp. 35–52. 11 2013/6/11
6cs.PL
Max-size popular matchings and extensions Telikepalli Kavitha arXiv:1802.07440v1 [cs.DS] 21 Feb 2018 Tata Institute of Fundamental Research, Mumbai, India [email protected] Abstract. We consider the max-size popular matching problem in a roommates instance G = (V, E) with strict preference lists. A matching M is popular if there is no matching M 0 in G such that the vertices that prefer M 0 to M outnumber those that prefer M to M 0 . We show it is NP-hard to compute a max-size popular matching in G. This is in contrast to the tractability of this problem in bipartite graphs where a max-size popular matching can be computed in linear time. We define a subclass of max-size popular matchings called strongly dominant matchings and show a linear time algorithm to solve the strongly dominant matching problem in a roommates instance. We consider a generalization of the max-size popular matching problem in bipartite graphs: this is the max-weight popular matching problem where there is also a weight function w : E → R and we seek a popular matching of largest weight. We show this is an NP-hard problem and this is so even when w(e) ∈ {1, 2} for every e ∈ E. We also show an algorithm with running time O∗ (2n/4 ) to find a max-weight popular matching matching in G = (A ∪ B, E) on n vertices. 1 Introduction Consider a matching problem in G = (A ∪ B, E) where each vertex has a strict ranking of its neighbors. The goal is to find an optimal way of pairing up vertices: stability is the usual notion of optimality in such a setting. A matching M is stable if M admits no blocking edge, i.e., an edge (a, b) such that a and b prefer each other to their respective assignments in M . Stable matchings always exist in G and can be computed in linear time [11]. In applications such as matching students to advisers or applicants to training posts, we would like to replace the notion of “no blocking edges” with a more relaxed notion of “global stability” for the sake of obtaining a matching that is better in a social sense, for instance, a matching of larger size. For this, we need to formalize the notion of a globally stable matching; roughly speaking, a globally stable matching should be one such that there is no matching where more people are happier. This is precisely the notion of popularity introduced by Gärdenfors [13] in 1975. We say a vertex u ∈ A ∪ B prefers matching M to matching M 0 if either (i) u is matched in M and unmatched in M 0 or (ii) u is matched in both M, M 0 and u prefers M (u) to M 0 (u). For any two matchings M and M 0 , let φ(M, M 0 ) be the number of vertices that prefer M to M 0 . Definition 1. A matching M is popular if φ(M, M 0 ) ≥ φ(M 0 , M ) for every matching M 0 in G, i.e., ∆(M, M 0 ) ≥ 0 where ∆(M, M 0 ) = φ(M, M 0 ) − φ(M 0 , M ). In an election between M and M 0 where vertices cast votes, φ(M, M 0 ) is the number of votes for M versus M 0 and φ(M 0 , M ) is the number of votes for M 0 versus M . A popular matching never loses an election to another matching: thus it is a weak Condorcet winner [4] in the corresponding voting instance. Although (weak) Condorcet winners need not exist in a general voting instance, popular matchings always exist in a bipartite graph with strict preference lists, since every stable matching is popular [13]. All stable matchings match the same subset of vertices [12] and the size of a stable matching can be as low as |Mmax |/2, where Mmax is a max-size matching in G. One of the main motivations to relax stability to popularity is to obtain larger matchings and it is known that a max-size popular matching has size at least 2|Mmax |/3. Polynomial time algorithms to compute a max-size popular matching in G = (A ∪ B, E) are known [16,22]. A roommates instance is a graph G = (V, E), that is not necessarily bipartite, with strict preference lists. Stable matchings need not always exist in G and there are several polynomial time algorithms [19,26,27] to determine if a stable matching exists or not. The definition of popularity (Definition 1) carries over to roommates instances — though popular matchings need not exist in G, popular mixed matchings, i.e., probability distribution over matchings, always exist in G and can be efficiently computed [21]. Observe that stable mixed matchings need not always exist in a roommates instance (see the Appendix). We currently do not know the complexity of the popular matching problem in a roommates instance, i.e., does G admit a popular matching? The complexity of finding a max-size popular matching in G was also an open problem so far and we show its hardness here. Theorem 1. The max-size popular matching problem in a roommates instance G = (V, E) with strict preference lists is NP-hard. We show the above problem is NP-hard even in instances that admit stable matchings. Note that a stable matching is a min-size popular matching [16]. All the polynomial time algorithms that compute popular matchings in bipartite graphs [11,16,22] compute either stable matchings or dominant matchings. A popular matching M is dominant if M is more popular than every larger matching [7], thus M is a max-size popular matching. Though the name “dominant” was given to this class of matchings in [7], dominant matchings in bipartite graphs first appeared in [16], which gave the first polynomial time max-size popular matching algorithm in bipartite graphs. More precisely, a matching satisfying Definition 2 was constructed in the given bipartite graph. For any matching M , call an edge (u, v) negative to M if both u and v prefer their assignments in M to each other. Definition 2. A matching M is strongly dominant in G = (V, E) if there is a partition (L, R) of the vertex set V such that (i) M ⊆ L × R, (ii) M matches all vertices in R, (iii) every blocking edge to M is in R × R, and (iv) every edge in L × L is negative to M . Consider the complete graph on 4 vertices a, b, c, d where a’s preference list is b  c  d (i.e., top choice b, followed by c and then d), b’s preference list is c  a  d, c’s preference list is a  b  d, and d’s preference list is a  b  c. This instance has no stable matching. M1 = {(a, d), (b, c)} and M2 = {(a, c), (b, d)} are two strongly dominant matchings here: the corresponding partitions are L1 = {b, d}, R1 = {a, c} and L2 = {c, d}, R2 = {a, b}. A strongly dominant matching M with vertex partition (L, R) is an R-perfect stable matching in the bipartite graph with L on the left, R on the right and edge set E ∩ (L × R). It is also important to note that any blocking edge to M in G is in R × R and all edges in L × L are negative to M . It was shown in [7] that a popular matching M is dominant if and only if there is no augmenting path with respect to M in the subgraph obtained by deleting all negative edges with respect to M . In bipartite graphs, dominant matchings and strongly dominant matchings are equivalent [7]. Moreover, such a matching always exists in a bipartite graph and can be computed in linear time [22]. It can also be shown [22] that every strongly dominant matching in G = (V, E) is dominant. However in non-bipartite graphs, not every dominant matching is strongly dominant. The complexity of the dominant matching problem in a roommates instance is currently not known. Here we efficiently solve the strongly dominant matching problem. Theorem 2. There is a linear time algorithm to determine if an instance G = (V, E) with strict preference lists admits a strongly dominant matching or not and if so, return one. 1.1 Bipartite instances A natural generalization of the max-size popular matching problem in a bipartite instance G = (A ∪ B, E) is the max-weight popular matching problem, where there is a weight function w : E → R and we seek a popular matching of largest weight. Several natural popular matching problems can be formulated with the help of edge weights: these include computing a popular matching with as 2 many of our “favorite edges” as possible or an egalitarian popular matching (one that minimizes the sum of ranks of partners of all vertices). Thus a max-weight popular matching problem is a generic problem that captures several optimization problems in popular matchings. The max-weight stable matching problem is well-studied and there are several polynomial time algorithms [8,9,10,20,25,27,28] to compute such a matching or its variants in a bipartite graph with strict preference lists. We show the following result here. Theorem 3. The max-weight popular matching problem in G = (A ∪ B, E) with strict preference lists and a weight function w : E → {1, 2} is NP-hard. A 2-approximate max-weight popular matching in G = (A ∪ B, E) with strict preference lists and non-negative edge weights can be computed in polynomial time. We also show the following fast exponential time algorithm, where n = |A ∪ B|. Theorem 4. A max-weight popular matching in G = (A ∪ B, E) with strict preference lists and a weight function w : E → R can be computed in O∗ (cn ) time, where c = 21/4 ≈ 1.19. 1.2 Background and Related results Algorithmic questions for popular matchings were first studied in the domain of one-sided preference lists [1] in a bipartite instance G = (A∪B, E) where it is only vertices in A that have preferences over their neighbors. Popular matchings need not always exist here, however popular mixed matchings always exist [21]. This proof extends to the domain of two-sided preference lists (with ties) and to non-bipartite graphs. Popular matchings always exist in G = (A ∪ B, E) with two-sided strict preference lists. An O(mn0 ) algorithm to compute a max-size popular matching here was shown in [16], where m = |E| and n0 = min(|A|, |B|). A linear time algorithm for the max-size popular matching problem in such an instance G was shown in [22]. A linear time algorithm was shown in [7] to determine if there is a popular matching in G = (A ∪ B, E) that contains a given edge e. It was also shown in [7] that dominant matchings in G = (A ∪ B, E) are equivalent to stable matchings in a larger bipartite graph. This equivalence implies a polynomial time algorithm to solve the max-weight popular matching problem in a complete bipartite graph. A description of the popular half-integral matching polytope of G = (A ∪ B, E) with strict preference lists was given in [23]. It was shown in [18] that the popular fractional matching polytope (from [21]) for such an instance G = (A ∪ B, E) is half-integral. The half-integrality of the popular fractional matching polytope also holds for roommates instances [18]. When preference lists admit ties, the problem of determining if a bipartite instance admits a popular matching or not is NP-hard [2,6]. It is NP-hard to compute a least unpopularity factor matching in a roommates instance [17]. It was shown in [18] that it is NP-hard to compute a maxweight popular matching problem in a roommates instance with strict preference lists and it is UGC-hard to compute a Θ(1)-approximation. The complexity of finding a max-weight popular matching in a bipartite instance with strict preference lists was left as an open problem in [18]. This problem along with the complexity of finding a max-size popular matching in a roommates instance are two of the three open problems in popular matchings listed in [5] and we answer these two questions here. 1.3 Techniques Our results are based on LP-duality. Every popular matching M in an instance G = (V, E) is a max-cost perfect matching in the graph G with self-loops added and with edge costs given by a function costM (these costs depend on the matching M ). Any optimal solution to the dual LP will be called a witness to M ’s popularity. Our hardness results. Witnesses for popular matchings in bipartite graphs first appeared in [21] and they were used in [23,18,3]. Roughly speaking, these algorithms dealt with matchings that had an 3 element in {±1}n as a witness. Note that a stable matching has 0n as a witness. For general popular matchings, there is no such “parity agreement” among the coordinates of any witness and we use this to show that the max-weight popular matching problem in bipartite graphs is NP-hard. All max-size popular matchings in a bipartite instance match the same subset of vertices [15], however the rural hospitals theorem does not necessarily hold for max-size popular matchings in roommates instances. Such an instance forms the main gadget in the proof of NP-hardness for max-size popular matchings in a roommates instance. Our algorithms. We generalize the max-size popular matching algorithm for bipartite graphs [22] to solve the strongly dominant matching problem in all graphs. We show a surprisingly simple reduction from the strongly dominant matching problem in G = (V, E) to the stable matching problem in a new roommates instance G0 = (V, E 0 ). Thus Irving’s stable matching algorithm [19] in G0 solves our problem in linear time. Our reduction is similar to an analogous correspondence in the bipartite case from [7]. However the graph G0 in [7] on 3|A| + |B| vertices is asymmetric with respect to vertices in A and B of G = (A ∪ B, E). Now our new graph G0 may be regarded as the bidirected version of G, i.e., each edge (u, v) in G is replaced by two edges (u+ , v − ) and (u− , v + ) in G0 . Our fast exponential time algorithm for max-weight popular matchings in G = (A ∪ B, E) formulates the convex hull P(r) of all popular matchings with at least 1 witness whose parities agree with a given vector r ∈ {0, 1}k . Here k is the number of components of size 4 or more in a subgraph FG , whose edge set is the union of all popular matchings in G. Our formulation of P(r) is based on the popular fractional matching polytope PG [21]. We use r to tighten several of the constraints in the formulation of PG and introduce new variables sandwiched between 0 and 1 to denote fractional parities and formulate a polytope. We use methods from [18,27] along with some new ideas to show that our polytope is integral, more precisely, it is P(r). This leads to the O∗ (2k ) (where k ≤ n/4) algorithm. Organization of the paper. Witness vectors for popular matchings in bipartite and roommates instances are defined in Section 2. Our algorithm for the strongly dominant matching problem in a roommates instance G = (V, E) is given in Section 3. Section 4 shows that finding a max-size popular matching in G is NP-hard. Section 5 shows the NP-hardness of the max-weight popular matching problem in a bipartite instance G = (A∪B, E). Our fast exponential time algorithm for this problem is given in Section 6. 2 Witness of a popular matching Let M be any matching in our input instance G = (V, E). In order to determine if M is popular or not, we need to check if ∆(N, M ) ≤ 0 for all matchings N in G (see Definition 1). Computing maxN ∆(N, M ) reduces to computing a max-cost perfect matching in a graph G̃ with edge costs that are defined below. The graph G̃ is the graph G augmented with self-loops — we assume that every vertex is at the bottom of its own preference list. Adding self-loops allows us to view any matching M in G as a perfect matching M̃ in G̃ by including self-loops for all vertices left unmatched in M . We now define a function costM on the edge set of G̃. For any edge (u, v) ∈ E, define:   if (u, v) is a blocking edge to M̃ 2 costM (u, v) = −2 if (u, v) is a negative edge to M̃   0 otherwise Recall that an edge (u, v) is negative to M̃ if both u and v prefer their partners in M̃ to each other. Thus costM (u, v) is the sum of votes of u and v for each other over M̃ (u) and M̃ (v), respectively, where for any vertex u and neighbors v, v 0 of u: u’s vote for v versus v 0 is 1 if u prefers v to v 0 , it is −1 if u prefers v 0 to v, else it is 0 (i.e. v = v 0 ). Observe that costM (u, v) = 0 for any edge (u, v) ∈ M . We now define costM for self-loops as well. For any u ∈ V , costM (u, u) = 0 if u is unmatched in M , else costM (u, u) = −1. Thus costM (u, u) is u’s vote for itself versus M̃ (u). 4 Claim 1 For any matching N in G, ∆(N, M ) = costM (Ñ ). Proof. We will use the function vote(·, ·) here. For any vertex u and neighbors v, v 0 of u in G̃, recall that voteu (v, v 0 ) is 1 if u prefers v to v 0 , it is -1 if u prefers v 0 to v, it is 0 otherwise (i.e., v = v 0 ). Let M̃ (u) be u’s partner in M̃ . Observe that costM (a, b) = votea (b, M̃ (a)) + voteb (a, M̃ (b)). Also, costM (u, u) = voteu (u, M̃ (u)). We have the following equality from the definitions of ∆(·, ·) and vote(·, ·). X ∆(N, M ) = voteu (Ñ (u), M̃ (u)) u∈A∪B X = (votea (b, M̃ (a)) + voteb (a, M̃ (b))) + (a,b)∈N This sum is exactly P (a,b)∈N X voteu (u, M̃ (u)). (u,u)∈Ñ costM (a, b) + P (u,u)∈Ñ costM (u, u), which is costM (Ñ ). t u Thus M is popular if and only if every perfect matching in G̃ has cost at most 0. 2.1 Bipartite instances Let G = (A ∪ B, E) be a bipartite instance with strict preference lists. Consider the max-cost perfect matching LP in G̃: this is LP1 given below. The set Ẽ is the edge set of G̃ and Ẽ(u) is the set of edges incident to u in G̃. The linear program LP2 is the dual of LP1. max X costM (e) · xe (LP1) min e∈Ẽ s.t. X αu (LP2) u∈A∪B X xe = 1 s.t. ∀u ∈ A ∪ B αa + αb ≥ costM (a, b) αu ≥ costM (u, u) e∈Ẽ(u) xe ≥ 0 ∀ (a, b) ∈ E ∀ u ∈ A ∪ B. ∀ e ∈ Ẽ. M is popular if and only if the optimal value of LP1 is at most 0 (by Claim 1); in fact, the optimal value is exactly 0 since M̃ is a perfect matching in G̃ and costM (M̃ ) = 0. Thus M is popular if and only if the optimal value of LP2 is 0 (by LP-duality). Definition 3. For any popular matching M , an optimal solution α to LP2 above is called a witness of M . P A popular matching M may have several witnesses. For any witness α, u∈A∪B αu = 0 since α is an optimal solution to LP2 and the optimal value of LP2 is 0. Let n = |A ∪ B|. Lemma 1 ([23]). Every popular matching M in G = (A ∪ B, E) has a witness in {0, ±1}n . 2.2 Roommates instances Here our input is a graph G = (V, E) with strict preference lists. As done earlier, we will formulate the max-cost perfect matching problem in G̃ with cost function costM as our primal LP. The dual LP (LP3 given below) will be useful to us. Here Ω is the collection of all odd subsets S of V of size at least 3 and E[S] is the set of all (u, v) ∈ E such that u, v ∈ S. A matching M is popular in G = (V, E) if and only if the optimal value of LP3 is 0. minimize X αu + u∈V X S∈Ω 5 b |S|/2 c · zS (LP3) subject to αu + αv + P S∈Ω u,v∈S zS ≥ 0 ∀S ∈ Ω zS ≥ costM (u, v) ∀ (u, v) ∈ E and αu ≥ costM (u, u) ∀ u ∈ V. Definition 4. For any popular matching M , an optimal solution (α, z) to LP3 is called a witness of M . P P For any witness (α, z), we have u∈V αu + S∈Ω b|S|/2c · zS = 0. Note that any stable matching in G has (0, 0) as witness. Theorem 5 gives a characterization of strongly dominant matchings in terms of a special witness (α, z). We will use this characterization of strongly dominant matchings in Section 3. Theorem 5. A matching M is strongly dominant in G if and only if there exists a feasible solution (α, z) to LP3 such that αu P = ±1 for all vertices u matched in M , αu = 0 for all u unmatched in M , zS = 0 for all S ∈ Ω, and u∈V αu = 0. Proof. Let M be a strongly dominant matching in G = (V, E). So V can be partitioned into L ∪ R such that properties (i)-(iv) in Definition 2 are satisfied. Set zS = 0 for all S ∈ Ω. We will now construct α as follows. For u ∈ V : – if u ∈ R then set αu = 1 – else if u is matched in M then set αu = −1 else set αu = 0. Since M matches all vertices in R, all vertices unmatched in M are in L. Thus αu = 0 for all u unmatched in M and αu = ±1 for all u matched in M . P For any edge (u, v) ∈ M , since M ⊆ L × R, (αu , αv ) ∈ {(1, −1), (−1, 1)} and so αu + αv = 0. Thus u∈V αu = 0. We will now show that (α, 0) satisfies the constraints of LP3. We have αu ≥ costM (u, u). This is because αu = 0 = costM (u, u) for u left unmatched in M and αu ≥ −1 = costM (u, u) for u matched in M . We will now show that all edge covering constraints are obeyed. – Since costM (e) ≤ 2 for any edge e and αu = 1 for all u ∈ R, all edges in R × R are covered. – We also know that any edge in L × L is a negative edge to M , i.e., costM (u, v) = −2 for any edge (u, v) ∈ L × L. Since αu ≥ −1 for any u ∈ L, edges in L × L are covered. – We also know that all blocking edges to M are in R × R and so costM (u, v) ≤ 0 for all (u, v) ∈ L × R. Since αu ≥ −1 and αv = 1, all edges in L × R are covered. We will now show the converse. Let M be a matching with a witness (α, 0) as given in the statement of the theorem. To begin with, M is popular since the objective function of LP3 evaluates to 0. We will now show that M is strongly dominant. For that, we will obtain a partition (L, R) of V as follows: R = {u : αu = 1} and L = {u : αu is either 0 or -1}. Since M̃ is an optimal solution of the max-cost perfect matching problem in G̃, complementary slackness conditions imply that if (u, v) ∈ M then αu + αv = costM (u, v) = 0. Since u, v are matched, αu , αv ∈ {±1}; so one of u, v is in L and the other is in R. Thus M ⊆ L × R. We have costM (u, v) ≤ αu + αv for every (u, v) ∈ E. There cannot be any edge between 2 vertices left unmatched in M as that would contradict M ’s popularity. So costM (u, v) ≤ −1 for all (u, v) ∈ E ∩ (L × L). Since costM (u, v) ∈ {0, ±2}, costM (u, v) = −2 for all edges (u, v) in L × L. In other words, every edge in L × L is negative to M . Moreover, any blocking edge can be present only in R × R since costM (u, v) ≤ 1 for all edges (u, v) ∈ L × R. Finally, since αu = costM (u, u) = 0 for all u unmatched in M (by complementary slackness conditions on LP3) and every vertex u ∈ R satisfies αu = 1, it means that all vertices in R are matched in M . t u 6 3 Strongly dominant matchings In this section we show an algorithm to determine if a roommates instance G = (V, E) admits a strongly dominant matching or not. We will build a new roommates instance G0 = (V, E 0 ) and show that any stable matching in G0 can be projected to a strongly dominant matching in G and conversely, any strongly dominant matching in G = (V, E) can be mapped to a stable matching in G0 . The vertex set of G0 is the same as that of G. Though there is only one copy of each vertex u in G0 , for every (u, v) ∈ E, there will be 2 parallel edges in G0 between u and v; we will call one of these edges (u+ , v − ) and the other (u− , v + ). Thus E 0 = {(u+ , v − ), (u− , v + ) : (u, v) ∈ E}. A vertex v appears in 2 forms, as v + and v − , to each of its neighbors. We will now define preference lists in G0 . For any u ∈ V , if u’s preference list in G is v1  v2  · · ·  vk then u’s preference list in G0 is v1−  v2−  · · ·  vk−  v1+  v2+  · · ·  vk+ . Thus u prefers any neighbor in “− form” to any neighbor in “+ form”. As an example, consider the roommates instance on 4 vertices a, b, c, d described in Section 1, where d was the least preferred vertex of a, b, c. Preference lists in the instance G0 are as follows: a : b−  c−  d−  b+  c+  d+ b : c−  a−  d−  c+  a+  d+ c : a−  b−  d−  a+  b+  d+ d : a−  b−  c−  a+  b+  c+ – A matching M 0 in G0 is a subset of E 0 such that for each u ∈ V , M 0 contains at most one edge incident to u, i.e., at most one edge in {(u+ , v − ), (u− , v + ) : v ∈ Nbr(u)} is in M 0 , where Nbr(u) is the set of u’s neighbors in G. – For any matching M 0 in G0 , define the projection M of M 0 as follows: M = {(u, v) : (u+ , v − ) or (u− , v + ) is in M 0 }. It is easy to see that M is a matching in G. Definition 5. A matching M 0 is stable in G0 if for every edge (u+ , v − ) ∈ E 0 \ M 0 : either (i) u is matched in M 0 to a neighbor ranked better than v − or (ii) v is matched in M 0 to a neighbor ranked better than u+ . We now present our algorithm to find a strongly dominant matching in G = (V, E). 1. Build the corresponding roommates instance G0 = (V, E 0 ). 2. Run Irving’s stable matching algorithm in G0 . 3. If a stable matching M 0 is found in G0 then return the projection M of M 0 . Else return “G has no strongly dominant matching”. In Irving’s algorithm in G0 , it is possible that a vertex u proposes to some neighbor vt twice: first to vt− and later to vt+ . During u’s first proposal, vt receives a proposal from u+ and during u’s second proposal, vt receives a proposal from u− . We describe Irving’s stable matching algorithm [19] along with an example in the Appendix. We will now prove the correctness of the above algorithm. We will first show that if our algorithm returns a matching M , then M is a strongly dominant matching in G. Lemma 2. If M 0 is a stable matching in G0 then the projection of M 0 is a strongly dominant matching in G. Proof. Let M be the projection of M 0 . In order to show that M is a strongly dominant matching in G, we will construct a witness (α, 0) as given in Theorem P5. That is, we will construct α as shown below such that (α, 0) is a feasible solution to LP3 and u∈V αu = 0. Set αu = 0 for all vertices u left unmatched in M . For each vertex u matched in M : – if (u+ , ∗) ∈ M 0 then set αu = 1; else set αu = −1. 7 P Note that u∈V αu = 0 since for each edge (a, b) ∈ M , we have αa + αb = 0 and for each vertex u that is unmatched in M , we have αu = 0 . We also have αu ≥ costM (u, u) for all u ∈ V since (i) αu = 0 = costM (u, u) for all u left unmatched in M and (ii) αu ≥ −1 = costM (u, u) for all u matched in M . We will now show that for every (a, b) ∈ E, αa + αb ≥ costM (a, b). Recall that costM (a, b) is the sum of votes of a and b for each other over their respective assignments in M . 1. Suppose (a+ , ∗) ∈ M 0 . So αa = 1. We will consider 3 subcases here. – The first subcase is that (b+ , ∗) ∈ M 0 . So αb = 1. Since costM (a, b) ≤ 2, it follows that αa + αb = 2 ≥ costM (a, b). – The second subcase is that (b− , ∗) ∈ M 0 . So αb = −1. If (a+ , b− ) ∈ M 0 then costM (a, b) = 0 = αa + αb . So assume (a+ , c− ) and (b− , d+ ) belong to M 0 . Since M 0 is stable, the edge (a+ , b− ) does not block M 0 . Thus either (i) a prefers c− to b− or (ii) b prefers d+ to a+ . Hence costM (a, b) ≤ 0 and so αa + αb = 0 ≥ costM (a, b). – The third subcase is that b is unmatched in M . So αb = 0. Since M 0 is stable, the edge (a+ , b− ) does not block M 0 . Thus a prefers its partner c− in M 0 to b− and so costM (a, b) = 0 < αa + αb . 2. Suppose (a− , ∗) ∈ M . There are 3 subcases here as before. The case where (b+ , ∗) ∈ M is totally analogous to the case where (a+ , ∗) and (b− , ∗) are in M . So we will consider the remaining 2 subcases here. – The first subcase is that (b− , ∗) ∈ M 0 . So αb = −1. Let (a− , c+ ) and (b− , d+ ) belong to M 0 . Since M 0 is stable, the edge (a+ , b− ) does not block M 0 . So b prefers d+ to a+ . Similarly, the edge (a− , b+ ) does not block M 0 . Hence a prefers c+ to b+ . Thus both a and b prefer their respective partners in M to each other, i.e., costM (a, b) = −2. So we have αa + αb = −2 = costM (a, b). – The second subcase is that b is unmatched in M . Then the edge (a+ , b− ) blocks M 0 since a prefers b− to c+ (for any neighbor c) and b prefers to be matched to a+ than be left unmatched. Since M 0 is stable and has no blocking edge, this means that this subcase does not arise. 3. Suppose a is unmatched in M . Then (b+ , ∗) ∈ M 0 (otherwise (a− , b+ ) blocks M 0 ); moreover, b prefers its partner d− in M 0 to a− . So we have costM (a, b) = 0 < αa + αb . Thus we always have αa +αb ≥ costM (a, b) and hence (α, 0) is a valid witness of M . Since α satisfies the conditions in Theorem 5, M is a strongly dominant matching in G. We will now show that if G0 has no stable matching, then G has no strongly dominant matching. Lemma 3. If G admits a strongly dominant matching then G0 admits a stable matching. Proof. Let M be a strongly dominant matching in G = (V, E). Let (α, 0) be a witness of M as given in Theorem 5. That is, αu = 0 for u unmatched in M and αu = ±1 for u matched in M . Moreover, for each (u, v) ∈ M , αu + αv = costM (u, v) = 0 by complementary slackness on LP3; so (αu , αv ) is either (1, −1) or (−1, 1). We will construct a stable matching M 0 in G0 as follows. For each (u, v) ∈ M : – if (αu , αv ) = (1, −1) then add (u+ , v − ) to M 0 ; else add (u− , v + ) to M 0 . We will show that no edge in E 0 \ M 0 blocks M 0 . Let (a+ , b− ) ∈ / M 0 . We consider the following cases here: Case 1. Suppose αb = 1. Then (b+ , d− ) ∈ M 0 where d = M (b). Since b prefers d− to a+ , (a+ , b− ) is not a blocking edge to M 0 . Case 2. Suppose αb = −1. Then (b− , d+ ) ∈ M 0 where d = M (b). We have 2 sub-cases here: (i) αa = 1 and (ii) αa = −1. Note that αa 6= 0 as the edge (a, b) would not be covered by αa + αb then. This is because if αa = 0 then a is unmatched in M and costM (a, b) = 0 while αa + αb = −1. 8 – In sub-case (i), some edge (a+ , c− ) belongs to M 0 . We know that costM (a, b) ≤ αa + αb = 0, so either (1) a prefers M (a) = c to b or (2) b prefers M (b) = d to a. Hence either (1) a prefers c− to b− or (2) b prefers d+ to a+ . Thus (a+ , b− ) is not a blocking edge to M 0 . – In sub-case (ii), some edge (a− , c+ ) belongs to M 0 . We know that costM (a, b) ≤ αa + αb = −2, so a prefers M (a) = c to b and b prefers M (b) = d to a. Thus b prefers d+ to a+ , hence (a+ , b− ) is not a blocking edge to M 0 . Case 3. Suppose αb = 0. Thus b was unmatched in M . Each of b’s neighbors has to be matched in M to a neighbor that it prefers to b, otherwise M would be unpopular. We have αa + αb ≥ costM (a, b) = 0, hence it follows that αa = 1. Thus (a+ , c− ) ∈ M 0 where c is a neighbor that a prefers to b. So (a+ , b− ) is not a blocking edge to M 0 . t u Lemmas 2 and 3 show that a strongly dominant matching is present in G if and only if a stable matching is present in G0 . This finishes the proof of correctness of our algorithm. Since Irving’s stable matching algorithm in G0 can be implemented to run in linear time [19], we can conclude Theorem 2 stated in Section 1. 4 The max-size popular matching problem in a roommates instance In this section we prove the NP-hardness of the max-size popular matching problem in a roommates instance. We will show a reduction from the vertex cover problem. Let H = (VH , EH ) be an instance of the vertex cover problem and let VH = {1, . . . , nH }, i.e., VH = [nH ]. We will build a roommates instance G as follows: (see Fig. 1) – corresponding to every vertex i ∈ VH , there will be 4 vertices ai , bi , ci , di in G and – corresponding to every edge e = (i, j) ∈ EH , there will be 2 vertices uei and uej in G. di 11 00 00 11 001 11 a11 j 00 3 3 a1 i 0 0 1 0 1 1 2 1 3 00 00 11 b11 i 2 11 00 00 11 1 1 2 11 00 00ci 11 2 bj 1 1 0 0 1 0 1 dj 0 1 0 1 0 11 2 2 11 0 0c 1 j 11 0 3 1 0 0 1 2 111 00 00 2 11 00 11 uei uej Fig. 1. The graph G restricted to the adjacent vertices i and j in H: the vertices at , bt , ct , dt in G correspond to vertex t ∈ {i, j} in H and the vertices uei and uej in G correspond to the edge e = (i, j) in H. Vertex preferences in G are indicated on the edges. The preferences of the vertices ai , bi , ci , di are as follows, where e1 , . . . , ek are all the edges in H with vertex i as an endpoint. ai : bi  ci  di bi : ai  uei 1 · · ·  uei k  ci ci : ai  bi di : ai . The order among the vertices uei 1 , . . . , uei k in the preference list of bi is arbitrary. The preference list of vertex uei is uej  bi , where e = (i, j) (see Fig. 1). Observe that G admits a stable matching S = {(ai , bi ) : 1 ≤ i ≤ nH }∪{(uei , uej ) : e = (i, j) ∈ EH }. This is the set of blue edges in Fig. 1. Lemma 4. Let M be a popular matching in G. – For any i ∈ [nH ], either (ai , bi ) ∈ M or {(ai , di ), (bi , ci )} ⊆ M . 9 – The set C = {i ∈ [nH ] : (ai , bi ) ∈ M } is a vertex cover of H. Proof. The vertex ai is the top choice neighbor of all its neighbors bi , ci , di . Thus ai has to be matched in the popular matching M . 1. If ai is matched to bi then (ai , bi ) ∈ M . 2. If (ai , di ) ∈ M , then ci also has to be matched — otherwise we get a more popular matching by replacing the edge (ai , di ) with (ai , ci ). Since ci has degree 2, it has to be the case that {(ai , di ), (bi , ci )} ⊆ M . 3. Suppose (ai , ci ) ∈ M . Since ai prefers bi to ci , this means that bi has to be matched in M . Other than ai and ci (which are matched to each other), bi ’s neighbors are uei for all edges e incident to i in H. So (bi , uei ) ∈ M for some e = (i, j) ∈ EH . We will now construct a new matching M 0 as follows: – replace the edges (ai , ci ), (bi , uei ), (uej , M (uej )) in M with the edges (ai , bi ) and (uei , uej ). So ci and M (uej ) are unmatched in M 0 , hence these 2 vertices prefer M to M 0 ; however the 4 vertices ai , bi , uei , uej prefer M 0 to M . Thus M 0 is more popular than M , a contradiction to the popularity of M . Hence (ai , ci ) ∈ / M. We now show the second part of the lemma. Let (i, j) ∈ EH . We need to show that either (ai , bi ) ∈ M or (aj , bj ) ∈ M . Suppose not. Then by the first part of this lemma, (ai , di ), (bi , ci ) are in M and similarly, (aj , dj ), (bj , cj ) are in M . Also (uei , uej ) ∈ M . Consider the matching M 0 obtained by replacing the 5 edges (ai , di ), (bi , ci ), (aj , dj ), (bj , cj ), and (uei , uej ) in M with the 4 edges (ai , ci ), (bi , uei ), (aj , cj ), and (bj , uej ) (see Fig. 1). Among the 10 vertices involved here, the 6 vertices ai , bi , ci and aj , bj , cj prefer M 0 to M while the 4 vertices di , uei and dj , uej prefer M to M 0 . Thus M 0 is more popular than M , a contradiction to the popularity of M. Hence for each edge (i, j) ∈ EH either (ai , bi ) ∈ M or (aj , bj ) ∈ M . In other words, the set U = {i ∈ [nH ] : (ai , bi ) ∈ M } is a vertex cover of H. t u Theorem 6. For any 1 ≤ k ≤ nH , the graph H = (VH , EH ) admits a vertex cover of size k if and only if G has a popular matching of size at least mH + 2nH − k, where |EH | = mH . Proof. Suppose H = (VH , EH ) admits a vertex cover U of size k. We will now build a popular matching M in G of size mH + 2nH − k. – Add all edges (uei , uej ) in G to M . – For every i ∈ U , add the edge (ai , bi ) to M . – For every i ∈ / U , add the edges (ai , di ), (bi , ci ) to M . The size of M is mH + |U | + 2(nH − |U |) = mH + 2nH − k. We will prove M is popular by showing a witness (α, z) for it. To begin with, initialize zS = 0 for all S ∈ Ω. – For every i ∈ U : set αai = αbi = αci = αdi = 0. – For every i ∈ / U : set αai = 1 and αbi = αci = αdi = −1; also set zSi = 2 where Si = {ai , bi , ci }. – For every edge e = (i, j) ∈ EH : if i ∈ U then set αuei = −1 and αuej = 1; else set αuei = 1 and αuej = −1. It is easy to check that the above setting of (α, z) covers all edges of G. In particular, for i ∈ U , we have costM (bi , uei ) = −1 − 1 = −2 while αbi = 0 and αuei = −1, thus αbi + αuei ≥ costM (bi , uei ). Similarly, when i ∈ / U , costM (bi , uei ) = 1 − 1 = 0 and we have αbi = −1 and αuei = 1 here. Moreover, X X X X αv + b|S|/2c · zS = −2 + 2 = 0. (1) v∈V S∈Ω i∈U / i∈U / This is because αv = 0 for all vertices v unmatched in M and αu +αv = 0 for all edges (u, v) ∈ M except the edges (bi , ci ) where i ∈ / U . For each i ∈ / U , we have αbi + αci = −2 and we also have zSi = 2 where Si = {ai , bi , ci }. The sum in Equation (1) is 0 and so M is a popular matching. Hence G has a popular matching of size mH + 2nH − k. 10 We will now show the converse. Let M be a popular matching in G of size at least mH + 2nH − k. We know that U = {i ∈ [nH ] : (ai , bi ) ∈ M } is a vertex cover of H (by Lemma 4). We will show that |U | ≤ k. It follows from Lemma 4 that all edges (uei , uej ) belong to any popular matching. So these account for mH many edges in M . We also know that for every i ∈ VH , either (ai , bi ) ∈ M or {(ai , di ), (bi , ci )} ⊆ M (by Lemma 4). Thus |M | = mH +|U |+2(nH −|U |). Since |M | ≥ mH +2nH −k, it follows that |U | ≤ k. Thus the graph G has a vertex cover of size k. t u We can now conclude Theorem 1 stated in Section 1. Remark. The rural hospitals theorem [24] for stable matchings in a roommates instance G says that every stable matching in G matches the same subset of vertices. Such a statement is not true for max-size popular matchings in a roommates instance as seen in the instance on 10 vertices in Fig. 1. This instance has two max-size popular matchings (these are of size 4): one leaves ci and di unmatched while another leaves cj and dj unmatched. 5 Max-weight popular matchings in bipartite instances In this section we will prove the NP-hardness of the max-weight popular matching problem in a bipartite instance G = (A ∪ B, E) on n vertices and with edge weights. Call any e ∈ E a popular edge if there is a popular matching N in G such that e ∈ N . Let M be a popular matching in G = (A ∪ B, E). Observe that for any popular matching N in G, the perfect matching Ñ in G̃ is an optimal solution of LP1 (see Section 2) and a witness α of M is an optimal solution of LP2. Lemma 5 follows from complementary slackness conditions on LP1. Lemma 5. Let M be a popular matching in G and let α ∈ {0, ±1}n be a witness of M . 1. For any popular edge (a, b) ∈ E, the parities of αa and αb have to be the same. 2. If u is a vertex in G that is left unmatched in a stable matching in G (call u unstable) then αu = costM (u, u); thus αu = 0 if u is left unmatched in M , otherwise αu = −1. Proof. Let (a, b) be a popular edge. So (a, b) ∈ N for some popular matching N . Since N is popular, ∆(N, M ) = 0 and the perfect matching Ñ is an optimal solution to the max-cost perfect matching LP in the graph G̃ with cost function costM (see LP1 from Section 2). Since α is an optimal solution to the dual LP (see LP2), it follows from complementary slackness that αa + αb = costM (a, b). Observe that costM (a, b) ∈ {±2, 0} (an even number). Hence the integers αa and αb have the same parity. This proves part 1. Part 2 also follows from complementary slackness. Let S be a stable matching in G and let u be a vertex left unmatched in S. So the perfect matching S̃ contains the edge (u, u). Since S̃ is an optimal solution to LP1, we have αu = costM (u, u) by complementary slackness. Thus when u is left unmatched in M , αu = 0, else αu = −1. t u The popular subgraph. We will define a subgraph FG = (A ∪ B, EF ) called the popular subgraph of G, where EF is the set of popular edges in E. The subgraph FG need not be connected: let C = {C1 , . . . , Ch } be the set of connected components in FG . Each component Cj that is a singleton set consists of a single unpopular vertex, i.e., one left unmatched in all popular matchings. Every non-singleton component Ci has an even number of vertices. This is because a max-size popular matching matches all vertices except the ones in singleton sets in C and vertices in Ci are matched to each other [15]. It is also known that all stable vertices (those matched in stable matchings in G) have to be matched in every popular matching [16]. Let M be any popular matching in G and let α ∈ {0, ±1}n be a witness of M ’s popularity. The following lemma will be useful to us. Lemma 6. For any connected component Ci in FG , either αu = 0 for all vertices u ∈ Ci or αu = ±1 for all vertices u ∈ Ci . Moreover, if Ci contains one or more unstable vertices, either all the unstable vertices in Ci are matched in M or none of them is matched in M . 11 Proof. Let u and v be any 2 vertices in Ci . Since u, v are in the same connected component in FG , there is a u-v path ρ in G such that every edge in ρ is a popular edge. The endpoints of each popular edge have the same parity in α (by part 1 of Lemma 5), hence αu and αv have the same parity. Thus either αu = αv = 0 or both αu , αv ∈ {±1}. Let Ci be a connected component with one or more unstable vertices, i.e., those left unmatched in a stable matching. Since all α-values in Ci have the same parity, either (i) all vertices v in Ci satisfy αv = 0 or (ii) all vertices v in Ci satisfy αv = ±1. For any unstable vertex u, we have αu = costM (u, u) (by part 2 of Lemma 5), hence in case (i), all unstable vertices in Ci are left unmatched in M and in case (ii), all unstable vertices in Ci are matched in M . t u The NP-hardness reduction. Given a graph H = (VH , EH ) which is an instance of the vertex cover problem, we will now build an instance G = (A ∪ B, E) with strict preference lists such that the vertex cover problem in H reduces to the max-weight popular matching problem in G. Let VH = {1, . . . , nH }. – For every edge e ∈ EH , there will be a gadget De in G on 6 vertices se , te , s0e , t0e , s00e , t00e . – For every vertex i ∈ VH , there will be a gadget Ci in G on 4 vertices ai , bi , a0i , b0i . – There are 2 more vertices in G: these are a0 and b0 . Thus A = {a0 } ∪ {ai , a0i : i ∈ VH } ∪ {se , s0e , s00e : e ∈ EH } and B = {b0 } ∪ {bi , b0i : i ∈ VH }∪ {te , t0e , t00e : e ∈ EH }. We now describe the edge set of G. We first describe the preference lists of the 6 vertices in De , where e = (i, j) and i < j (see Fig. 2). s0e : t0e  te s00e : t00e  te se : t0e  bj  t00e t0e : s0e  se t00e : s00e  se te : s00e  ai  s0e Here s0e and t0e are each other’s top choices and similarly, s00e and t00e are each other’s top choices. The vertex se ’s top choice is t0e , second choice is bj , and third choice is t00e . For te , the order is s00e , followed by ai , and then s0e . Recall that e = (i, j) and i < j. 00 a11 00 11 0 00 11 11 00 00b0 11 se 1 0 1 0 11t 00 11 e 00 0 ai 1 0 1 0 1 1 0 0 1 0bi 1 s0e 1 0 0 1 0 1 11 00 0 00 11 00te 11 0 00 a11 i 00 11 0 11 00 00bi 11 s00e 1 0 0 1 00 1 0 0te 1 Fig. 2. To the left is the gadget Ci on vertices ai , bi , a0i , b0i and to the right is the gadget De on vertices se , te , s0e , t0e , s00e , t00e ; the vertices a0 and b0 are adjacent to bi and ai , respectively. We now describe the preference lists of the 4 vertices ai , bi , a0i , b0i in Ci (see Fig. 2). a0i : bi  b0i ai : bi  b0i  b0  · · · b0i : bi : ai  a0i  a0  · · · ai  a0i – Both a0i and ai have bi as their top choice and b0i as their second choice. Similarly, both b0i and bi have ai as their top choice and a0i as their second choice. – The vertex ai has other neighbors: its third choice is b0 followed by all the vertices te1 , te2 , . . . where i is the lower-indexed endpoint of e1 , e2 , . . .. Similarly, bi has a0 as its third choice followed by all the vertices se01 , se02 , . . . where i is the higher-indexed endpoint of e01 , e02 , . . . 12 – The order among the vertices te1 , te2 , . . . (similarly, se01 , se02 , . . .) in the preference list of ai (resp., bi ) does not matter; hence these are represented as · · · in these preference lists. The vertex a0 has b1 , . . . , bnH as its neighbors and its preference list is some arbitrary permutation of these vertices. Similarly, the vertex b0 has a1 , . . . , anH as its neighbors and its preference list is some arbitrary permutation of these vertices. Lemma 7. No popular matching in G matches either a0 or b0 . Proof. We will first show that M = {(ai , b0i ), (a0i , bi ) : i ∈ VH } ∪{(s0e , t0e ), (s00e , t00e ) : e ∈ EH } is a popular matching in G. We prove the popularity of M by showing a vector α ∈ {0, ±1}n that will be a witness to M ’s popularity. – For vertices in Ci , where i ∈ VH : let αai = αbi = 1, αa0i = αb0i = −1. – For any vertex u in De , where e ∈ EH : let αu = 0. – Let αa0 = αb0 = 0. It can be checked that αu + αv ≥ costM (u, v) for all edges (u, v) in G. Also, αu ≥ costM (u, u) for all u ∈ AP ∪ B. Since αu = 0 for all vertices u unmatched in M and αu + αv = 0 for every edge (u, v) in M , u∈A∪B αu = 0. Suppose a0 is matched in some popular matching N , i.e., (a0 , bi ) ∈ N for some i ∈ [nH ]. Then (a0 , bi ) is a popular edge. So it follows from part 1 of Lemma 5 that the parities of βa0 and βbi have to be the same, for any witness β of the popular matching M . However αa0 = 0 while αbi = 1 for the witness α described above. This is a contradiction to (a0 , bi ) being a popular edge and hence no popular matching in G matches a0 (similarly, b0 ). t u Lemma 8. Let N be any popular matching in G. For each i ∈ {1, . . . , nH }: either (ai , bi ) and (a0i , b0i ) are in N or (ai , b0i ) and (a0i , bi ) are in N . Proof. We know from Lemma 7 that in the popular subgraph FG , the vertices a0 and b0 are singleton sets. We now claim that each Ci forms a maximal connected component in FG . This implies that ai has only 2 possible partners in any popular matching N : either bi or b0i . Thus either (1) {(ai , bi ), (a0i , b0i )} ⊂ N or (2) {(ai , b0i ), (a0i , bi )} ⊂ N . It is easy to see that the 4 vertices of Ci belong to the same connected component in FG : this is because all the 4 edges (ai , bi ), (a0i , b0i ), (ai , b0i ) ,(a0i , bi ) are popular. The former 2 edges belong to the stable matching S = {(ai , bi ), (a0i , b0i ) : i ∈ VH } ∪{(s0e , t0e ), (s00e , t00e ) : e ∈ EH } while the latter 2 edges belong to the popular matching M defined in Lemma 7. Consider the matching M and its witness α defined in the proof of Lemma 7: the parities of αai and αte for any i ∈ VH and e ∈ EH are different. Hence it follows from part 1 of Lemma 5 that the edge (ai , te ) is not a popular edge. Similarly, the edge (se , bj ) is not a popular edge. Thus each Ci forms a maximal connected component in FG . t u Lemma 8 will be important in our reduction. Let α be any witness of N . – In the first possibility of Lemma 8, i.e., when (ai , bi ), (a0i , b0i ) are in N , we have αu = 0 for all u ∈ Ci . This is because a0 and b0 are unmatched in N , so αai + αb0 ≥ costN (ai , b0 ) = 0 and αa0 + αbi ≥ costN (a0 , bi ) = 0. Also αa0 = αb0 = 0 (by Lemma 5). So αai ≥ 0 and αbi ≥ 0. We also have αai + αbi = costN (ai , bi ) = 0. Thus αai = αbi = 0. – In the second possibility of Lemma 8, i.e., when (ai , b0i ), (a0i , bi ) are in N , we have αu = ±1 for all u ∈ Ci . This is because costN (ai , bi ) = 2, thus αai = αbi = 1. Edge weights. We now assign weights to the edges in G. For all e ∈ EH , let w(se , t0e ) = w(se , t00e ) = w(s0e , te ) = w(s00e , te ) = 2, i.e., all the edges between se , te and their neighbors in De have weight 2. For all i ∈ [nH ], let w(ai , bi ) = w(a0i , b0i ) = 2. Set w(e) = 1 for all other edges e in G. Let N be a max-weight popular matching in G and let α ∈ {0, ±1}n be a witness of N ’s popularity. Let UN be the set of those indices i ⊆ [nH ] such that αu = ±1 for all u ∈ Ci . 13 Lemma 9. The set UN is a vertex cover of the graph H. Proof. Edge weights were assigned in G such that the following claim (proof given below) holds for any max-weight popular matching N . Claim 2 For every e ∈ EH , both se and te have to be matched in N . Consider any edge e = (i, j) ∈ EH , let i < j. It follows from Claim 2 and Lemma 8 that either the pair (se , t0e ), (s0e , te ) or the pair (se , t00e ), (s00e , te ) is in N . – If (se , t0e ) and (s0e , te ) are in N , then costN (ai , te ) = 0 since te prefers ai to s0e while ai prefers both bi and b0i (its possible partners in N ) to te . It follows from part 2 of Lemma 5 that αte = −1, thus αai has to be 1 so that αai + αte ≥ 0. Recall that α is a witness of N ’s popularity. – If (se , t00e ) and (s00e , te ) are in N , then costN (se , bj ) = 0 since se prefers bj to t00e while bj prefers both aj and a0j (its possible partners in N ) to se . It follows from part 2 of Lemma 5 that αse = −1, thus αbj has to be 1 so that αse + αbj ≥ 0. Thus at least one of Ci , Cj assigns the α-values of its vertices to ±1. Hence for every edge (i, j) ∈ EH , at least one of i, j is in UN , in other words, UN is a vertex cover of H. t u Proof of Claim 2. Consider any e ∈ EH . Since s0e , t0e , s00e , and t00e are stable vertices in G, they have to be matched in every popular matching in G. Thus any popular matching in G either matches both se , te or neither se nor te . Recall from the proof of Lemma 8 that there is no popular edge between De and either Ci or Cj . Let N be a max-weight popular matching in G. We now need to show that N matches both se and te . Suppose N matches neither se nor te . Thus (s0e , t0e ) and (s00e , t00e ) are in N . Hence the weight contributed by vertices in De to w(N ) is 2. Let e = (i, j) where i < j. We know from Lemma 8 that either (ai , b0i ), (a0i , bi ) are in N or (ai , bi ), (a0i , b0i ) are in N . Case 1: Suppose {(ai , b0i ), (a0i , bi )} ⊂ N . This means costN (ai , bi ) = 2 and hence αai = αbi = 1 in any witness α of N . Consider the matching N 0 = N ∪ {(se , t0e ), (s0e , te )} \ {(s0e , t0e )}. That is, we replace the edge 0 0 (se , te ) in N with the edges (se , t0e ) and (s0e , te ). It is easy to prove that N 0 is also popular; we will show a witness β to prove the popularity of N 0 . Let α be a witness of N and let βu = αu for all u ∈ A ∪ B except for the vertices in De . For the vertices in De , let βse = βte = βt00e = −1 and βs0e = βt0e = βs00e = 1. P 0 It can be checked that u∈A∪B βu = 0 and βu + βv ≥ costN (u, v) for all (u, v) ∈ E and βu ≥ costN 0 (u, u) for all u ∈ A ∪ B. In particular, costN 0 (ai , te ) = 0 = βai + βte . Moreover, we have w(N 0 ) = w(N ) + 3. Thus there is a popular matching N 0 in G with a larger weight than N , a contradiction to our assumption that N is a max-weight popular matching in G. Case 2: Suppose {(ai , bi ), (a0i , b0i )} ⊂ N . Consider the matching N 00 which is exactly the same as N except that the edges (s0e , t0e ), (ai , bi ) and (a0i , b0i ) are deleted from N and the new edges are (se , t0e ), (s0e , te ), (ai , b0i ), and (a0i , bi ). We claim that N 00 is also popular and we prove this by showing a witness γ. Let γu = αu for all u ∈ A ∪ B (α is a witness of N ) except for the vertices in Ci ∪ De . For the vertices in Ci ∪ De , let γse = γte = γt00e = −1, γs0e = P γt0e = γs00e = 1, and γai = γbi = 1, γa0i = γb0i = −1. 00 It can be checked that u∈A∪B γu = 0 and γu + γv ≥ costN (u, v) for all (u, v) ∈ E and γu ≥ costN 00 (u, u) for all u ∈ A ∪ B. Thus N 00 is a popular matching. Moreover, we have w(N 00 ) = w(N ) + 3 − 2 = w(N ) + 1. Thus there is a popular matching N 00 in G with a larger weight than N , a contradiction again. Hence we can conclude that both se and te have to be matched in N . t u Theorem 7. For any integer 1 ≤ k ≤ nH , the graph H = (VH , EH ) admits a vertex cover of size k if and only if G admits a popular matching of weight at least 5mH + 4nH − 2k, where |EH | = mH . Proof. Let U be a vertex cover of size k in H. Using U , we will construct a matching M in G of weight 5mH + 4nH − 2k and a witness α to M ’s popularity as follows. For every i ∈ [nH ]: 14 – if i ∈ U then include edges (ai , b0i ) and (a0i , bi ) in M ; set αai = αbi = 1 and set αa0i = αb0i = −1. – else include edges (ai , bi ) and (a0i , b0i ) in M and set αu = 0 for all u ∈ Ci . For every e = (i, j) ∈ EH , where i < j, we do as follows: – if i ∈ U then include the edges (se , t0e ), (s0e , te ), and (s00e , t00e ) in M ; set αse = αte = αt00e = −1 and αs0e = αt0e = αs00e = 1. – else (so j ∈ U ) include the edges (se , t00e ), (s0e , t0e ), and (s00e , te ) in M ; set αse = αte = αs0e = −1 and αt0e = αs00e = αt00e = 1. P Set αa0 = αb0 = 0. It can be checked that αu + αv = 0 for every (u, v) ∈ M , hence u∈A∪B αu = 0. Also αu + αv ≥ costM (u, v) for every edge (u, v) in G and αu ≥ costM (u, u) for all u ∈ A ∪ B. Thus α is a witness to M ’s popularity. We will now calculate w(M ). The sum of edge weights in M from vertices in De is 5, so this adds up to 5mH for all e ∈ EH . For i ∈ U , the sum of edge weights in M from vertices in Ci is 2, so this adds up to 2k over all i ∈ UH . For j ∈ / U , the sum of edge weights in M from vertices in Cj is 4, so this adds adds up to 4(nH − k) over all j ∈ / UH . Thus f (M ) = 5mH + 4nH − 2k. We will now show the converse. Suppose G has a popular matching of weight at least 5mH + 4nH − 2k. Let N be a max-weight popular matching in G. So w(N ) ≥ 5mH + 4nH − 2k. Let α be a witness of N ’s popularity and let UN = {i ⊆ [nH ] : αu = ±1 ∀u ∈ Ci }. We know from Lemma 9 that UN is a vertex cover of H. We will now show that |UN | ≤ k. We know from Claim 2 that for every e ∈ EH , both se and te have to be matched in N . So each gadget De contributes a weight of 5 towards w(N ). Each gadget Ci , for i ∈ UN , contributes a weight of 2 towards w(N ) while each gadget Cj , for j ∈ / UN , contributes a weight of 4 towards w(N ). Hence w(N ) = 5mH + 2|UN | + 4(nH − |UN |). Since 5mH + 2|UN | + 4(nH − |UN |) ≥ 5mH + 4nH − 2k, we get |UN | ≤ k. Thus H has a vertex cover of size k. t u Theorem 3 stated in Section 1 now follows. It is easy to see that Theorem 7 holds even if “popular matching of weight at least 5mH + 4nH − 2k” is replaced by “max-size popular matching of weight at least 5mH + 4nH − 2k”. Thus the problem of computing a max-size popular matching problem in G = (A ∪ B, E) of largest weight is also NP-hard. 6 Max-weight popular matchings: exact and approximate solutions Let G = (A ∪ B, E) be an instance with a weight function w : E → R≥0 . We will now show that a popular matching in G of weight at least OPT/2 can be computed in polynomial time, where OPT = w(M ∗ ) and M ∗ is a max-weight popular matching in G. The following decomposition theorem for any popular matching M in G = (A ∪ B, E) is known. Theorem 8 ([7]). M can be partitioned into M0 ∪ M1 such that M0 ⊆ S and M1 ⊆ D, where S is a stable matching and D is a (strongly) dominant matching in G. Any popular matching M has a witness α ∈ {0, ±1}n : let M0 (similarly, M1 ) be the set of edges of M on vertices u with αu = 0 (resp., αu = ±1). Since αa + αb = 0 for all (a, b) ∈ M , the matching M is a disjoint union of M0 and M1 . If M is a max-weight popular matching in G, then one of M0 , M1 has weight at least w(M )/2. What the above result from [7] shows is that M0 can be extended to a stable matching in G and M1 can be extended to a dominant matching in G. Consider the following algorithm. 1. Compute a max-weight stable matching S ∗ in G. 2. Compute a max-weight dominant matching D∗ in G. 3. Return the matching in {S ∗ , D∗ } with larger weight. Since all edge weights are non-negative, either the max-weight stable matching in G or the maxweight dominant matching in G has weight at least w(M ∗ )/2 = OPT/2. Thus Steps 1-3 compute a 2-approximation for max-weight popular matching in G = (A ∪ B, E). Regarding the implementation of this algorithm, both S ∗ and D∗ can be computed in polynomial time [25,7]. We also show descriptions of the stable matching polytope and the dominant matching polytope below. Thus the above algorithm runs in polynomial time. 15 6.1 A fast exponential time algorithm We will now show an algorithm to compute a max-weight popular matching in G = (A ∪ B, E) with w : E → R. We will use an extended formulation from [21] of the popular fractional matching polytopePPG . This is obtained by generalizing LP2 from Section 2 to all fractional matchings x in G, i.e., e∈Ẽ(u) xe = 1 for all vertices u and xe ≥ 0 for all e ∈ Ẽ. So costx (a, b), which is the sum of votes of a P and b for each other assignments P over their respective P P in x, replaces costM (a, b). Thus costx (a, b) = b0 :b0 ≺a b xab0 − b0 :b0 a b xab0 + a0 :a0 ≺b a xa0 b − a0 :a0 b a xa0 b . Recall the subgraph FG = (A ∪ B, EF ) where EF is the set of popular edges in G. The set EF can be efficiently computed as follows: call an edge stable if it belongs to some stable matching in G. It was shown in [7] that every popular edge in G = (A ∪ B, E) is a stable edge either in G or in a larger bipartite graph G0 on O(n) vertices and O(m + n) edges. All stable edges in G and in G0 can be identified in linear time [14]. Let C = {C1 , . . . , Ch } be the set of connected components in FG and let ` be the number of nonsingleton sets in C. Let us assume that components C1 , . . . , C` have size at least 2. For any popular matching M with a witness α ∈ {0, ±1}n , Lemma 6 tells us that α defines a natural function (we will call this function α) from C to {0, 1}, where α(Ci ) = 0 if αu = 0 for all u ∈ Ci and α(Ci ) = 1 if αu = ±1 for all u ∈ Ci . Note that α(Ci ) = 0 for ` + 1 ≤ i ≤ h. Definition 6. For r = (r1 , . . . , r` ) ∈ {0, 1}` , let P(r) be the convex hull of all popular matchings M in G such that M has a witness α with α(Ci ) = ri for all 1 ≤ i ≤ `. P(0) is the stable matching polytope and P(1) is the dominant matching polytope. We will now show an extended formulation of P(r) for any r ∈ {0, 1}` . First augment r with r`+1 = · · · = rh = 0 so that r ∈ {0, 1}h . Our constraints. Let U be the set of all unstable vertices in ∪i Ci where i ∈ {1, . . . , h} is such that ri = 0. Let A0 = A \ U and B 0 = B \ U . It follows from Lemma 6 that all vertices in U are left unmatched in any popular matching M in P(r) while all vertices in A0 ∪ B 0 are matched in M (recall that all stable vertices of G are matched in M ). Consider constraints (2)-(6) given below. αa + αb ≥ costx (a, b) + |ri − rj | ∀(a, b) ∈ E ∩ (Ci × Cj ), 1 ≤ i, j ≤ h (2) αa + αb = costx (a, b) X αu = 0 ∀(a, b) ∈ EF (3) and − ri ≤ αu ≤ ri ∀u ∈ Ci , 1 ≤ i ≤ h (4) u∈A∪B x(u,u) = 1 ∀u ∈ U and x(u,u) = 0 ∀u ∈ A0 ∪ B 0 X xe = 1 ∀u ∈ A ∪ B, xe ≥ 0 ∀e ∈ EF , and xe = 0 ∀e ∈ E \ EF (5) (6) e∈Ẽ(u) The variables in the constraints above are xe for e ∈ E and αu for u ∈ A ∪ B. Constraint (2) tightens the edge covering constraint αa + αb ≥ costx (a, b) for edges in Ci × Cj with ri 6= rj . Consider any popular matching M with witness α such that α(Ci ) 6= α(Cj ). So M and α satisfy αa + αb ≥ costM (a, b). Since αa + αb ∈ {±1} while costM (a, b) ∈ {±2, 0}, M and α have to satisfy αa + αb ≥ costM (a, b) + 1 = costM (a, b) + |ri − rj |. Constraint (3) makes the edge covering constraint tight for all popular edges (a, b). This is because for any popular matching M and witness α, we have αa + αb = costM (a, b) for any popular edge (a, b) (see the proof of Lemma 5). P Constraint (6) is clearly satisfied by any popular matching M and any witness α satisfies u∈A∪B αu = 0. The other constraints in (4) and (5) are consequences of the parity ri of the component Ci that a vertex belongs to. We will prove the following theorem in Section 6.2. Theorem 9. Constraints (2)-(6) define an extended formulation of the polytope P(r). Thus a max-weight popular matching in P(r) can be computed in polynomial time and hence a max-weight popular matching in G can be computed in O∗ (2` ) time by going through all r ∈ {0, 1}` . 16 Recall that ` is the number of components in FG of size at least 2. Since ` ≤ n/2, this is an O∗ (2n/2 ) algorithm for computing a max-weight popular matching. A faster exponential time algorithm. We will show in Section 6.3 that it is enough to go through all r ∈ {0, 1}k , where k is the number of components in FG of size at least 4. We do this by introducing a new variable pi , where 0 ≤ pi ≤ 1, to replace ri and represent the parity of Ci , for each Ci ∈ C of size 2. We will show that the resulting polytope is an extended formulation of the convex hull of all popular matchings M in G such that M has a witness α with α(Ci ) = ri for 1 ≤ i ≤ k. This yields an O∗ (2k ) algorithm for a max-weight popular matching in G = (A ∪ B, E). Since k ≤ n/4, this proves Theorem 4 stated in Section 1. Also, when k = O(log n), we have a polynomial time algorithm to compute a max-weight popular matching in G. 6.2 Proof of Theorem 9 Let Q0 (r) ⊆ Rm+n be the polytope defined by constraints (2)-(6), where |E| = m. Let Q(r) denote the polytope Q0 (r) projected on to its first m coordinates (those corresponding to e ∈ E). Our goal is to show that Q(r) is the polytope P(r). We will first show that every popular matching M with at least one witness α ∈ {0, ±1}n such that α(Ci ) = ri for i = 1, . . . , ` belongs to Q(r). It is easy to see that M and α satisfy constraints (3)(6). Regarding constraint (2), for any edge (a, b) ∈ Ci × Cj such that ri 6= rj , we have αa + αb ∈ {±1} while costM (a, b) ∈ {±2, 0}. Thus αa + αb ≥ costM (a, b) implies that αa + αb ≥ costM (a, b) + 1. Hence (M, α) ∈ Q0 (r), i.e., M ∈ Q(r). Thus P(r) ⊆ Q(r). Let (x, α) ∈ Q0 (r). We will now use the techniques and results from [27,18] to show that x is a convex combination of some popular matchings in P(r). This will prove Q(r) = P(r). The polytope P(0) is the stable matching polytope and a simple proof of integrality of Rothblum’s formulation [25] of this polytope was given in [27]. When G admits a perfect stable matching, the polytope P(1) is the same as PG and a proof of integrality of PG in this case was given in [18]. Note that r1 , . . . , rh are all 0 in [27] and r1 , . . . , rh are all 1 for this result in [18], i.e., the integrality of PG when G admits a perfect stable matching. We will build a table T of width 1 (as done in [27,18]) with n0 = |A0 ∪B 0 | rows: one corresponding to each vertex u ∈ A0 ∪ B 0 . The row corresponding to u will be called Tu . Form an array Xu of length 1 as follows: if x(u,v) > 0 then there is a cell of length x(u,v) in Xu with entry v in it. The entries in Xu will be sorted in increasing order of preference for u ∈ A0 and in decreasing order of preference for u ∈ B 0 . This was the order used in [27]. If u ∈ Ci where i ∈ {1, . . . , `} with ri = 1, then reorder Xu as done in [18]. For any a ∈ A0 that belongs to such a component Ci , the initial or least preferred (1 + αa )/2 fraction of Xa will be called the positive or blue sub-array of Xa and the remaining part, which is the most preferred (1 − αa )/2 fraction of Xa , will be called the negative or red sub-array of Xa . The array Xa will be reordered as shown in Fig. 3, i.e., the positive and negative sub-arrays of Xa are swapped. Call the reordered array Ta . qa 1 − qa 1 − qa Xa qa Ta Increasing order of a’s preference Fig. 3. The array Xa (on the left) will be reordered by swapping the positive and negative sub-arrays as shown above. The value qa = (1 + αa )/2, so 1 − qa = (1 − αa )/2. A similar transformation from Xb to Tb was shown in [18] for each b ∈ B 0 that belongs to a component Ci where i ∈ {1, . . . , `} and ri = 1. The initial or most preferred (1 − αb )/2 fraction of Xb will be called the negative sub-array of Xb and the remaining part, which is the least preferred 17 (1 + αb )/2 fraction of Xb , will be called the positive sub-array of Xb . As before, swap the positive and negative sub-arrays of Xb and call this reordered array Tb . If u ∈ A0 ∪ B 0 is in a component Ci with ri = 0, then we leave Xu as it is. That is, we set Tu = Xu (see Fig. 4). There are no positive or negative sub-arrays in Tu . Tu = Xu Fig. 4. The entries in Tu are sorted in increasing order of preference for u ∈ A and in decreasing order of preference for u ∈ B. Finding the popular matchings that x is a convex combination of. Let T be the table with rows Tu , for u ∈ A0 ∪ B 0 . For any t ∈ [0, 1), define the matching Mt as follows: – let L(t) be the vertical line at distance t from the left boundary of T ; – L(t) intersects (or touches the left boundary of) some cell in Tu , call this cell Tu [t], for each u ∈ A0 ∪ B 0 ; define Mt = {(u, v) : u ∈ A0 ∪ B 0 and v is in cell Tu [t]}. (7) Validity of Mt . We need to prove that Mt is a valid matching in G. That is, for any vertex u ∈ A0 ∪ B 0 , we need to show that if v belongs to cell Tu [t], then u belongs to cell Tv [t]. Note that both u and v have to belong to the same component in the subgraph FG since xuv = 0 otherwise (since xe = 0 for e ∈ E \ EF ). Let Ci be the connected component in F containing u and v. There are 2 cases here: (i) ri = 1 and (ii) ri = 0. The proof in case (i) follows directly from Theorem 3.2 in [18]. The proof in case (ii) is given in the proof of Theorem 1 in [27]. Both these proofs are based on the “tightness” of the edge (u, v), i.e., αu + αv = costx (u, v) in case (i) and costx (u, v) = 0 in case (ii). The tightness of (u, v) holds for us as well: since xuv > 0, (u, v) ∈ EF , so αu + αv = costx (u, v) by constraint (3) in case (i); and in case (ii), we have αu = αv = 0 by constraint (4) and so costx (u, v) = 0 by constraint (3). Popularity of Mt . We will now show that Mt is popular. Define a vector αt ∈ {0, ±1}n : – For 1 ≤ i ≤ h: if ri = 0 then set αut = 0 for each u ∈ Ci ; else for each u ∈ Ci ∗ if the cell Tu [t] is positive (or blue) then set αut = 1, else set αut = −1. We will now show that αt is a witness of Mt . Thus Mt will be a popular matching in G, in fact, Mt will be in P(r). This is because by our assignment of αt -values above, αt (Ci ) = ri for P i ∈ {1, . . . , h}. Our first claim is that u∈A∪B αut = 0. To prove the above claim, observe that for every vertex u that is left unmatched in Mt (all these vertices belong to U ), we have αut = 0. We now show that for every (a, b) in Mt , we have αat +αbt = 0. Since (a, b) ∈ EF , the vertices a and b belong to the same component Ci . If ri = 0 then αat = αbt = 0 and hence αat + αbt = 0. If ri =P1 then αat , αbt ∈ {±1} and the proof that αat + αbt = 0 was shown in [18] (see Corollary 3.1). Thus u∈A∪B αut = 0. We will now show that αut ≥ costMt (u, u) for all u ∈ A ∪ B. Every vertex u ∈ A0 ∪ B 0 is matched in Mt and so costMt (u, u) = −1. Since αut ≥ −1 for all u ∈ A0 ∪ B 0 , we have αut ≥ costMt (u, u) for these vertices. For u ∈ U , we have αut = 0 = costMt (u, u). What is left to show is that αat + αbt ≥ costMt (a, b) for all (a, b) ∈ E. Lemma 10 below shows this. Hence we can conclude that Mt is a popular matching in G, in particular, Mt ∈ P(r). It is now easy to show that x is a convex combination of matchings that belong to P(r). To obtain these matchings, as done in [27], sweep a vertical line from the left boundary of table T to its right boundary: whenever the line hits the left wall of one or more new cells, a new matching is obtained. If the left wall of the i-th leftmost cell(s) in the table T is at distance ti from the left boundary of T , then we obtain the matching Mti defined analogous to Mt in (7). Let M0 , Mt1 , . . . , Mtd−1 be all the matchings obtained by sweeping a vertical line through the table T . This means that x = t1 · M0 + (t2 − t1 ) · Mt1 + · · · + (1 − td−1 ) · Mtd−1 . Thus x is a convex combination of matchings in P(r). This finishes the proof that Q(r) = P(r). 18 Lemma 10. For any (a, b) ∈ E, we have αat + αbt ≥ costMt (a, b). Proof. Let a ∈ Ci and b ∈ Cj , where 1 ≤ i, j ≤ h. The proof that αat + αbt ≥ costMt (a, b) when ri = rj follows from [18,27]. When ri = rj = 1, it was shown in [18] (see Lemma 3.5) that αat + αbt ≥ costMt (a, b). When ri = rj = 0, it was shown in [27] (see Theorem 1) that costMt (a, b) ≤ αat +αbt = 0. We need to show αat + αbt ≥ costMt (a, b) when ri 6= rj . Assume without loss of generality that ri = 1 and rj = 0. So αb = 0. The constraint corresponding to edge (a, b) is αa + αb ≥ costx (a, b) + |ri − rj | which simplifies to αa ≥ costx (a, b) + 1. If b ∈ U then costx (a, b) ≥ 0 since b prefers a to itself. So αa ≥ costx (a, b) + 1 along with αa ≤ 1 (by constraint (4)) implies that αa = 1 and costx (a, b) = 0. This means that αat = 1 and a prefers all the entries in the array Ta to b. Hence costMt (a, b) = 0 and thus we have αat + αbt = 1 + 0 ≥ costMt (a, b). P Hence let us assume that b ∈ B 0 . Since e∈Ẽ(u) xe = 1 for all u, costx (a, b) equals ! X b0 ≺ ab xab0 − X b0  xab0 + ab X xa0 b − a0 ≺b a X xa0 b = 2 a0 b a X xab0 + X xa0 b + xab − 1 . a 0 ≺b a b0 ≺a b Here xab = 0 since a and b belong to distinct components in FG . So the constraint αa ≥ costx (a, b)+1 simplifies to: ! X X 2qa − 1 ≥ 2 xab0 + xa0 b − 1 + 1, where αa = 2qa − 1. a0 ≺b a b0 ≺a b This becomes qa ≥ P b0 ≺a b xab0 + P a 0 ≺b a xa0 b . See Fig. 5. Increasing order of a’s preference 1 − qa qa Ta αa = −1 αa = 1 αb = 0 Tb Increasing order of b’s preference Fig. 5. The cells where either a or b gets matched to a neighbor worse than the other is restricted to the blue sub-array of Ta and the sub-array of Tb exactly below this (between the two dashed vertical lines). The sum of lengths of such cells added up over both Ta and Tb is at most qa . The neighbors with which a gets paired in x start in increasing order of a’s preference from the dashed line separating the red sub-array and blue sub-array in Ta and this wraps around in left to right orientation (see Fig. 5). For b, the neighbors with which b gets paired in x start in increasing order of b’s preference from the right end of its array Tb and this order is from right to left. Thus b is matched in x to its worst neighbor at the right end of Tb and to its best neighbor at the left end of Tb . P P Since b0 ≺a b xab0 + a0 ≺b a xa0 b ≤ qa , this implies P that the subarray where either a is matched to a 0 worse neighbor than b (this subarray has length b0 ≺a b xab ) or b is matched to a worse neighbor than P a (this subarray has length a0 ≺b a xa0 b ) is confined to within the dashed line separating the red and blue subarrays of Ta and the rightmost wall of Tb (see Fig. 5). Also, there P is no cell where P both a and b are matched to worse neighbors than each other as this would make b0 ≺a b xab0 + a0 ≺b a xa0 b > qa . 19 If Ta [t] is positive or blue, then αat = 1. We have costMt (a, b) ≤ 0 here since when one of a, b is getting matched to a worse neighbor than the other, the other is getting matched to a better neighbor. Since αbt = 0 in the entire array, we have αat + αbt = 1 > costMt (a, b). If Ta [t] is negative or red, then Ta [t] contains a neighbor that a prefers to b and similarly, Tb [t] contains a neighbor that b prefers to a. That is, costMt (a, b) = −2 and here we have αat = −1 and αbt = 0. Thus we have αat + αbt = −1 > costMt (a, b). This shows that the edge (a, b) is always covered by the sum of αt -values of a and b. t u 6.3 A faster exponential time algorithm Recall the popular subgraph FG = (A∪B, EF ) and the set C = {C1 , . . . , Ch } of connected components in FG . Assume without loss of generality that C1 , . . . , Ck have size at least 4 and Ck+1 , . . . , C` have size 2. Let us define the polytope P 0 (r) as follows. Definition 7. For r = (r1 , . . . , rk ) ∈ {0, 1}k , let P 0 (r) be the convex hull of all popular matchings M in G such that M has a witness α with α(Ci ) = ri for all 1 ≤ i ≤ k. Consider constraints (2)-(6) from Section 6. Regarding constraint (2), r1 , . . . , rk are the coordinates in the vector r ∈ {0, 1}k while r`+1 = · · · = rh = 0 as before, and ri = pi for k + 1 ≤ i ≤ `, where pk+1 , . . . , p` are variables. So in constraint (2): – |ri − rj | ∈ {0, 1} for i, j ∈ {1, . . . , k} ∪ {` + 1, . . . , h}. – when one of i, j (say, i) is in {k +1, . . . , `} and j ∈ {1, . . . , k}∪{`+1, . . . , h} then |ri −rj | = 1−pi if rj = 1 and |ri − rj | = pi if rj = 0. – when both i, j are in {k + 1, . . . , `}, we replace constraint (2) with two constraints: one where |ri − rj | is replaced by pi − pj and another where |ri − rj | is replaced by pj − pi . Similarly, in constraint (4), −ri ≤ αu ≤ ri now becomes −pi ≤ αu ≤ pi , for u ∈ Ci where i ∈ {k + 1, . . . , `}. Constraints (3), (5), and (6) remain the same as before. Also, the sets U, A0 , B 0 are the same as before since all in Ck+1 ∪ · · · ∪ C` are stable vertices. We will show the following theorem here. The proof of Theorem 10 will follow the same outline as the proof of Theorem 9. Theorem 10. The revised constraints (2)-(6) along with the constraints 0 ≤ pi ≤ 1 for k +1 ≤ i ≤ ` define an extended formulation of the polytope P 0 (r). Proof. Let S 0 (r) be the polytope defined by the revised constraints (2)-(6) along with 0 ≤ pi ≤ 1 for k + 1 ≤ i ≤ `. Let S(r) denote the polytope S 0 (r) projected on to the coordinates corresponding to e ∈ E. We will now show that S(r) is the polytope P 0 (r). It is easy to see that every popular matching M with at least one witness α such that α(Ci ) = ri for i = 1, . . . , ` belongs to S(r). Thus P 0 (r) ⊆ S(r). Let (x, α, p) ∈ S 0 (r). We will now show that x is a convex combination of matchings in P 0 (r). As done in the proof of Theorem 9, we will construct a table T with n0 = |A0 ∪B 0 | rows. The rows of vertices outside Ck+1 ∪ · · · ∪ C` will be the same as before. Recall that |Ci | = 2 for k + 1 ≤ i ≤ ` and for any i ∈ {k + 1, . . . , `}: every vertex u ∈ Ci is matched to its only neighbor v ∈ Ci with xuv = 1. So we do not reorder Xu as it consists of just a single entry, i.e., Tu = Xu . However we partition Tu into 3 cells: (i) the positive or blue cell, (ii) the negative or red cell, and (iii) the zero or green cell. – for a ∈ Ci , compute 2si = 1 − pi . Since pi ≤ 1, we have si ≥ 0. Also pi ≥ ±αu since αu is sandwiched between −pi and pi . So 1 − 2si ≥ ±αa , i.e., si ≤ qa and si ≤ 1 − qa where qa = (1 + αa )/2. The array Ta gets divided into three cells as shown in Fig. 6. The leftmost 1 − qa − si part of Ta is its “negative” (or red) cell and the rightmost qa − si part is its “positive” (or blue) cell. The part left in between the positive and negative parts, which is of length 2si , is its “zero” (or green) cell. All 3 cells contain the same vertex b∗ where Ci = {a, b∗ }. 20 1 − qa qa Ta si si Fig. 6. The red part (of length 1 − qa − si ) is the negative cell of Ta and the blue part (of length qa − si ) is the positive cell of Ta . The middle or green part (of length 2si ) is its zero cell. 1 − qb qb Tb si si Fig. 7. The blue part (of length 1 − qb − si ) is the positive cell of Tb and the red part (of length qb − si ) is the negative cell of Tb . The middle or green part (of length 2si ) is its zero cell. – for b ∈ Ci , compute 2si = 1 − pi . Since ±αb ≤ pi ≤ 1, we have si ≥ 0; also si ≤ qb and si ≤ 1 − qb where qb = (1 − αb )/2. The array Tb gets divided into three cells as shown in Fig. 7. The leftmost 1 − qb − si part of Tb is its “positive” (or blue) cell and the rightmost qb − si part is its “negative” (or red) cell. The part left in between these two parts, which is of length 2si , is its “zero” (or green) cell. All 3 cells contain the same vertex a∗ where Ci = {a∗ , b}. In order to find the popular matchings that x is a convex combination of, we build the table T and define Mt exactly as done in the proof of Theorem 9. It follows from the same arguments as before that Mt is a matching. In particular, for k + 1 ≤ i ≤ `, we have |Ci | = 2, say Ci = {u, v}, and so v is the only entry in the entire array Tu and similarly, u is the only entry in the entire array Tv . We now need to show that Mt is popular. For this, we define a vector αt ∈ {0, ±1}n : for i ∈ {1, . . . , k} ∪ {` + 1, . . . , h}, the assignment of αut -values is exactly the same as in the proof of Theorem 9. For i ∈ {k + 1, . . . , `} and each u ∈ Ci do: – set αut = 1 if the cell Tu [t] is positive (or blue) – set αut = 0 if the cell Tu [t] is zero (or green) – set αut = −1 if the cell Tu [t] is negative (or red) P We will now show that u∈A∪B αut = 0. The only new step is to show that αat + αbt = 0 for (a, b) ∈ Mt , where Ci = {a, b}, i.e., i ∈ {k + 1, . . . , `}. Here we have αa + αb = costx (a, b) = 0 and this is because xab = 1. So qa = (1 + αa )/2 = (1 − αb )/2 = qb and this implies the length of the positive (or blue) cell in Ta , which is qa − si (see Fig. 6), equals the length of the negative (or red) cell in Tb , which is qb − si , (see Fig. 7). – Hence the positive cell of Ta is perfectly aligned with the negative cell of Tb . So if L(t) goes through the positive cell of Ta , i.e. if αat = 1, then αbt = −1. – Similarly, the negative cell of Ta , which is of length 1 − qa − si , is perfectly aligned with the positive cell of Tb , which is of length 1 − qb − si . So if L(t) goes through the negative cell of Ta , i.e. if αat = −1, then αbt = 1. – Thus the zero cells in Ta and Tb are perfectly aligned with each other. So if L(t) goes through the zero cell of Ta , i.e. if αat = 0, then αbt = 0. P Hence αat + αbt = 0 for all (a, b) ∈ Mt and so u∈A∪B αut = 0. It is easy to see that αut ≥ costMt (u, u) for all u ∈ A ∪ B. What is left to show is that αat + αbt ≥ costMt (a, b) for all (a, b) ∈ E. Let a ∈ Ci and b ∈ Cj . When both i and j are in {1, . . . , k} ∪ {` + 21 1, . . . , h}, the proof of Lemma 10 shows that the edge covering constraint holds. Lemmas 11 and 12 below show that the edge covering constraint holds when one or both the indices are in {k +1, . . . , `}. This completes the proof that Mt is a popular matching in G, in particular, Mt ∈ P 0 (r). The rest of the argument that x is a convex combination of matchings that belong to P 0 (r) is exactly the same as given in the proof of Theorem 9. Thus we can conclude that S(r) = P 0 (r). t u Lemma 11. Let (a, b) ∈ E with a ∈ Ci and b ∈ Cj . Suppose one of i, j is in {1, . . . , k}∪{`+1, . . . , h} and the other is in {k + 1, . . . , `}. Then αat + αbt ≥ costMt (a, b). Proof. Assume without loss of generality that i ∈ {k + 1, . . . , `}. So Ci = {a, b∗ }. Since a and b are in different components in FG , the edge (a, b) ∈ / EF and so xab = 0. The index j ∈ {1, . . . , k} ∪ {` + 1, . . . , h}, so rj is 0 or 1. Case 1. Suppose rj = 0. So αb = 0. Suppose b ∈ U , i.e., b is unmatched in x. Then the constraint αa + αb ≥ costx (a, b) + |ri − rj | for (a, b) becomes αa ≥ pi since costx (a, b) = 0. We also have αa ≤ pi (the revised constraint (4)). Hence αa = pi and this means 2si = 1 − αa , i.e., si = (1 − αa )/2 = 1 − qa (see Fig. 6). Then there is no negative (or red) cell in the entire array Ta . In other words, αat ≥ 0 throughout the array Ta and so αat + αbt ≥ 0 = costMt (a, b). P P Hence let us assume that b ∈ B 0 . So costx (a, b) = 2( b0 ≺a b xab0 + a0 ≺b a xa0 b − 1). Thus the constraint αa + αb − |ri − rj | ≥ costx (a, b) becomes: (where αa = 2qa − 1) ! X (2qa − 1) − pi ≥ 2 xab0 + b0 ≺a b qa + (1 − pi )/2 ≥ X xab0 + X xa0 b − 1 a 0 ≺b a X xa0 b a0 ≺b a b0 ≺a b qa + si ≥ X xab0 + b0 ≺a b X (since si = (1 − pi )/2) xa0 b a0 ≺b a Note that qa + si is the sum of lengths of the positive (or blue) and zero (or green) cells of Ta (see Fig. 8) and so qa + si ≤ 1. In these two cells of Ta , αat is either 1 or 0. 1 − qa qa Ta si si Tb Increasing order of b’s preference Fig. 8. The vertex a is matched to the same partner in the entire array Ta and b’s increasing order of partners in x starts from the right end of its array Tb . P P Suppose a prefers b∗ to b. Then b0 ≺a b xab0 = 0, so qa + si ≥ a0 ≺b a xa0 b . So while b is matched to a neighbor worse than a, αat ≥ 0. Note that αbt = 0 throughout the array Tb . Thus αat + αbt ≥ 0 ≥ costMt (a, b). P ∗ P Suppose a prefers b to b . Then b0 ≺a b xab0 = 1 and so qa + si ≥ 1. This means qa + si = 1 and so 0 a0 ≺b a xa b = 0. That is, b prefers each of its partners in the array Tb to a and so costMt (a, b) = 0. Also qa + si = 1 implies that there is no negative (or red) cell in Ta . Thus αat ≥ 0 throughout the array Ta and so αat + αbt ≥ 0 = costMt (a, b). 22 Case 2. Suppose rj = 1. So αb = 1 − 2qb and the constraint αa + αb − |ri − rj | ≥ costx (a, b) becomes: ! X (2qa − 1) + (1 − 2qb ) − (1 − pi ) ≥ 2 xab0 + X xab0 + X X xa0 b − 1 a0 ≺b a b0 ≺a b (qa − si ) + (1 − qb ) ≥ xa0 b − 1 a0 ≺b a b0 ≺a b qa − qb − (1 − pi )/2 ≥ X xab0 + X xa0 b . a0 ≺b a b0 ≺a b Note that qa − si is the length of the positive (or blue) cell in Ta (see Fig. 9). Similarly, 1 − qb is the length of the blue sub-array of Tb . P P Suppose a prefers b∗ to b. Then b0 ≺a b xab0 = 0 and so a0 ≺b a xa0 b ≤ (qa − si ) + (1 − qb ) and this is the sum of lengths of blue sub-arrays of Ta and Tb . Consider traversing the array Tb starting from the dashed line separating its blue sub-array from its red sub-array in a right-to-left orientation that P wraps around. The sum of length of the cells where b is matched to neighbors worse than a is a0 ≺b a xa0 b . This is at most the sum of lengths of blue sub-arrays in Ta and Tb . Thus while b is matched to a neighbor worse than a, we have αat + αbt ≥ 0 = costMt (a, b) and when b is matched to a neighbor better than a, we have αat + αbt ≥ −2 = costMt (a, b) since αat ≥ −1 and αbt ≥ −1. 1 − qa qa Ta si qb 1 − qb si Tb Increasing order of b’s preference Fig. 9. The vertex a is matched to the same partner in the entire array Ta and b’s increasing order of partners in Tb starts from the dashed line in right to left orientation. P P Suppose a prefers b to b∗ . Then b0 ≺a b xab0 = 1 and so a0 ≺b a xa0 b ≤ (qa − si ) + (1 − qb ) − 1. P SinceP a0 ≺b a xa0 b ≥ 0, this means the sum of lengths of blue sub-arrays in Ta and Tb is at least 1 and a0 ≺b a xa0 b is bounded by how much (qa −si )+(1−qb ) exceeds 1. Since the blue sub-array in Tb begins from its left end and the blue cell in Ta starts from its right end, for any t ∈ [0, 1), at least one of the cells Ta [t], Tb [t] is blue. Moreover, when b prefers a to its neighbors in Tb , then both Ta [t] and Tb [t] are blue. So while b is matched to a neighbor better than a, we have αat + αbt ≥ 0 = costMt (a, b) and when b is matched to a neighbor worse than a, we have αat + αbt = 2 = costMt (a, b). t u Lemma 12. Let (a, b) be an edge in Ci × Cj , where i, j ∈ {k + 1, . . . , `}. Then αat + αbt ≥ costMt (a, b). Proof. Here P both Ci and Cj have size 2. When i = j, we showed that αat + αbt = 0 = costMt (a, b) in the proof of u∈A∪B αut = 0. So we now assume i 6= j and so xab = 0. The constraint αa + αb − |ri − rj | ≥ costx (a, b) becomes the following two constraints, where αa = 2qa − 1 and αb = 1 − 2qb . P P (2qa − 1) + (1 − 2qb ) − (pi − pj ) ≥ 2 ( b0 ≺a b xab0 + a0 ≺b a xa0 b − 1) and P P (2qa − 1) + (1 − 2qb ) + (pi − pj ) ≥ 2 ( b0 ≺a b xab0 + a0 ≺b a xa0 b − 1). 23 Let si = (1−pi )/2 and sj = (1−pj )/2. The above two constraints imply the following two constraints respectively: X X (qa + si ) + (1 − qb − sj ) ≥ xab0 + xa0 b (8) a0 ≺b a b0 ≺a b (qa − si ) + (1 − qb + sj ) ≥ X xab0 + b0 ≺a b X xa0 b (9) a0 ≺b a Note that the length of the blue cell in Ta is qa − si while qa + si is the sum of the lengths of the blue and green cells in Ta (see the top 2 arrays in Fig. 10). Similarly, the length of the blue cell in Tb is 1 − qb − sj while 1 − qb + sj is the sum of the lengths of the blue and green cells in Tb (see the bottom 2 arrays in Fig. 10). We will consider 3 cases here. Case 1. Both a and b prefer their partners in x to each other. This is the easiest case. Here costMt (a, b) = −2 and since αut ≥ −1 for all vertices u, we have αat + αbt ≥ −2 = costMt (a, b). qa − si qa + si Ta 1 − q b − sj Tb 1 − qb + sj Fig. 10. The length of the blue cell in Ta (similarly, Tb ) is qa − si (resp., 1 − qb − sj ). The length of the blue + green cells in Ta (similarly, Tb ) is qa + si (resp., 1 − qb + sj ). Case 2. Exactly one of a, b prefers its partner in x to the other. So costMt (a, b) = 0 and the right side of constraints (8) and (9) is 1. Constraint (8) means that the length of the (blue + green) cells of Ta added to the length of the blue cell of Tb is at least 1. Hence the length of the blue cell of Tb is at least the length of the red cell in Ta (see Fig. 10). Constraint (9) means that the length of the (blue + green) cells of Tb added to the length of the blue cell of Ta is at least 1. Hence the length of the blue cell of Ta is at least the length of the red cell in Tb (see Fig. 10). Thus for any t ∈ [0, 1), it is the case that either (i) at least one of Ta [t], Tb [t] is blue or (ii) both the cells Ta [t] and Tb [t] are green. Thus we have αat + αbt ≥ 0 = costMt (a, b). Case 3. Both a and b prefer each other to their partners in x. So costMt (a, b) = 2 and the right side of constraints (8) and (9) is also 2. Since each of (qa + si ), (qa − si ), (1 − qb + sj ), (1 − qb − sj ) is at most 1, it follows that qa − si = 1 and 1 − qb − sj = 1. Thus the entire array Ta is blue and similarly, the entire array Tb is also blue. Hence αat = αbt = 1. Thus we have αat + αbt = 2 = costMt (a, b). t u Acknowledgment. Thanks to Chien-Chung Huang for useful discussions on strongly dominant matchings. References 1. D.J. Abraham, R.W. Irving, T. Kavitha, and K. Mehlhorn. Popular matchings. SIAM Journal on Computing, 37(4): 1030–1045, 2007. 2. P. Biro, R. W. Irving, and D. F. Manlove. Popular Matchings in the Marriage and Roommates Problems. In the 7th International Conference in Algorithms and Complexity (CIAC): 97–108, 2010. 24 3. F. Brandl and T. Kavitha. Popular matchings with multiple partners. In the 37th Foundations of Software Technology and Theoretical Computer Science (FSTTCS), 2017. 4. Condorcet method. https://en.wikipedia.org/wiki/Condorcet_method 5. Á. Cseh. Popular Matchings. In Trends in Computational Social Choice, Edited by Ulle Endriss, COST (European Cooperation in Science and Technology): 105–122, 2017. 6. Á. Cseh, C.-C. Huang, and T. Kavitha. Popular matchings with two-sided preferences and one-sided ties. In the 42nd International Colloquium on Automata, Languages, and Programming (ICALP): Part I, 367–379, 2015. 7. Á. Cseh and T. Kavitha. Popular edges and dominant matchings. In the 18th International Conference on Integer Programming and Combinatorial Optimization (IPCO): 138–151, 2016. 8. T. Feder. A new fixed point approach for stable networks and stable marriages. Journal of Computer and System Sciences, 45(2): 233-284, 1992. 9. T. Feder. Network flow and 2-satisfiability. Algorithmica, 11(3):291–319, 1994. 10. T. Fleiner. A fixed-point approach to stable matchings and some applications. Mathematics of Operations Research, 28(1): 103-126, 2003. 11. D. Gale and L.S. Shapley. College admissions and the stability of marriage. American Mathematical Monthly, 69(1): 9–15, 1962. 12. D. Gale and M. Sotomayor. Some remarks on the stable matching problem. Discrete Applied Mathematics, 11(3): 223–232, 1985. 13. P. Gärdenfors. Match making: assignments based on bilateral preferences. Behavioural Sciences, 20(3): 166–173, 1975. 14. D. Gusfield and R. W. Irving. The Stable Marriage Problem: Structure and Algorithms. MIT Press, Boston, MA 1989. 15. M. Hirakawa, Y. Yamauchi, S. Kijima, and M. Yamashita. On The Structure of Popular Matchings in The Stable Marriage Problem - Who Can Join a Popular Matching? In the 3rd International Workshop on Matching Under Preferences (MATCH-UP), 2015. 16. C.-C. Huang and T. Kavitha. Popular matchings in the stable marriage problem. Information and Computation, 222: 180–194, 2013. (Special issue on ICALP 2011.) 17. C.-C. Huang and T. Kavitha. Near-Popular Matchings in the Roommates Problem. SIAM Journal on Discrete Mathematics, 27(1): 43–62, 2013. 18. C.-C. Huang and T. Kavitha. Popularity, Self-Duality, and Mixed matchings. In the 28th ACM-SIAM Symposium on Discrete Algorithms (SODA): 2294-2310, 2017. 19. R. W. Irving. An efficient algorithm for the stable roommates problem. Journal of Algorithms, 6: 577–595, 1985. 20. R. W. Irving, P. Leather, and D. Gusfield. An efficient algorithm for the “optimal” stable marriage. Journal of the ACM, 34(3): 532–543, 1987. 21. T. Kavitha, J. Mestre, and M. Nasre. Popular mixed matchings. Theoretical Computer Science, 412(24): 2679–2690, 2011. 22. T. Kavitha. A size-popularity tradeoff in the stable marriage problem. SIAM Journal on Computing, 43(1): 52–71, 2014. 23. T. Kavitha. Popular half-integral matchings. In the 43rd International Colloquium on Automata, Languages, and Programming (ICALP): 22.1-22.13, 2016. 24. A. E. Roth. The evolution of the labor market for medical interns and residents. A case study in game theory. Journal of Political Economy, 92: 991-1016, 1984. 25. U. G. Rothblum. Characterization of stable matchings as extreme points of a polytope. Mathematical Programming, 54: 57–67, 1992. 26. A. Subramanian. A new approach to stable matching problems. SIAM Journal on Computing, 23(4): 671– 700, 1994. 27. C.-P. Teo and J. Sethuraman. The geometry of fractional stable matchings and its applications. Mathematics of Operations Research, 23(4): 874–891, 1998. 28. J. H. Vande Vate. Linear programming brings marital bliss. Operations Research Letters, 8(3): 147–153, 1989. Appendix Mixed matchings. Consider the roommates instance G that is a triangle on the 3 vertices a, b, c with the following preference lists: a prefers b to c while b prefers c to a and c prefers a to b. This instance has no mixed matching that is stable. A mixed matching Π is equivalent to a point x in 25 the matching polytope of G. A mixed matching Π is stable if the corresponding point x satisfies the following stability constraint for every edge (u, v): X X xuv + xuv0 + xu0 v ≥ 1. v 0 :v 0 u v u0 :u0 v u It can be checked that there is no point x in the matching polytope of G that satisfies the stability constraints for all edges. The mixed matching Π = {(M1 , 1/3), (M2 , 1/3), (M3 , 1/3)}, where M1 = {(a, b)}, M2 = {(b, c)}, M3 = {(c, a)}, is popular in this instance. Irving’s algorithm Given a roommates instance G = (V, E) with strict preferences, Irving’s algorithm [19] determines if G admits a stable matching or not and if so, returns one. Irving’s algorithm assumed G to be a complete graph, however the algorithm easily generalizes to non-complete graphs as well and hence we will not assume G to be complete. Irving’s algorithm consists of 2 phases: 1. In the first phase, we consider the bipartite graph G∗ = (V ∪ V 0 , E 0 ) where V 0 = {u0 : u ∈ V }. So G∗ has 2 copies u and u0 of each vertex u ∈ V , one on either side of the graph. The edge set E 0 = {(u, v 0 ) : (u, v) ∈ E}. Run Gale-Shapley algorithm on G∗ with vertices in V proposing and those in V 0 disposing. Let M ∗ be the resulting matching. If (u, v 0 ) ∈ M ∗ then prune the edge set E of G as follows: – delete all neighbors ranked worse than u from the preference list of v – make the adjacency lists symmetric so that if v deletes u from its list then u also deletes v from its list. 2. If the reduced adjacency list of every vertex which received at least 1 proposal consists of a single neighbor then the resulting edge set E defines a stable matching M . Else the adjacency lists are further reduced by eliminating “rotations”. – A rotation R = {(a0 , b0 ), (a1 , b1 ), . . . , (ak−1 , bk−1 )} is a set of edges such that for all i ∈ {0, . . . , k − 1}, the vertex bi is ai ’s most preferred neighbor in its reduced preference list (thus ai would be bi ’s least preferred neighbor in its reduced preference list); moreover, the second person on ai ’s reduced preference list is bi+1 (here bk = b0 ). – The second phase of Irving’s algorithm identifies such rotations and deletes them. The crucial observation here is that if G admits a stable matching then so does G \ R. – This step of eliminating rotations continues till either the updated reduced adjacency list of every vertex consists of a single neighbor or the updated reduced adjacency list of some vertex that received at least 1 proposal in the first phase is empty. In the former case, the resulting edge set is a stable matching and in the latter case, G has no stable matching. Consider Irving’s algorithm in the roommates instance G0 that corresponds to the instance G on 4 vertices a, b, c, d described in Section 1. The reduced adjacency lists at the end of the first phase are as follows: a : c−  d− b : d−  c+ c : b−  a+ d : a+  b+ Eliminating the rotation {(a+ , c− ), (b+ , d− )} yields the matching M10 = {(a+ , d− ), (b− , c+ )}. Instead, we could have eliminated the rotation {(c+ , b− ), (d− , a+ )}. This yields the matching M20 = {(a+ , c− ), (b+ , d− )}. 26
8cs.DS
TexT - Text Extractor Tool for Handwritten Document Transcription and Annotation Anders Hast1 , Per Cullhed2 , and Ekta Vats1 arXiv:1801.05367v1 [cs.DL] 22 Nov 2017 1 Department of Information Technology, Uppsala University, Uppsala, Sweden [email protected], [email protected], [email protected] 2 University Library, Uppsala University, Uppsala, Sweden Abstract. This paper presents a framework for semi-automatic transcription of large-scale historical handwritten documents and proposes a simple user-friendly text extractor tool, T exT for transcription. The proposed approach provides a quick and easy transcription of text using computer assisted interactive technique. The algorithm finds multiple occurrences of the marked text on-the-fly using a word spotting system. T exT is also capable of performing on-the-fly annotation of handwritten text with automatic generation of ground truth labels, and dynamic adjustment and correction of user generated bounding box annotations with the word being perfectly encapsulated. The user can view the document and the found words in the original form or with background noise removed for easier visualization of transcription results. The effectiveness of T exT is demonstrated on an archival manuscript collection from well-known publicly available dataset. Keywords: Handwritten Text Recognition, transcription, annotation, T exT , word spotting, historical documents 1 Introduction When printing was invented in the mid 15th century, a sort of transcription revolution took place all over Europe. Single handwritten texts were transformed into multiple copy books. Although this invention was crucial for the growth of knowledge, the process of writing continued well into the 20th century very much as before, with the help of pen and ink. A similar media-revolution is taking place right now when modern technology in the form of electronic texts is revolutionizing our reading habits and our media distribution possibilities. One of the most crucial steps for science in this modern media-revolution is the ability to search within texts. Optical Character Recognition (OCR) technology [1,2,3] has opened up even old printed texts to modern science in an unprecedented way. In libraries, meta-data is no longer the sole entry to collections, electronic content can speak for itself and this also changes library practices. However, the large mass of handwritten texts in our libraries and archives is still waiting to be transformed into searchable texts. The reason for this is a combination of technical and economic factors. Modern technology does not yet give us the good results of OCR technology, which nowadays can be so successfully applied to printed texts that it is a straightforward part of digitization processes world-wide. Handwritten text recognition (HTR) [4,5,6,7,8] is an emerging field and can be quite successful in certain circumstances, especially when applied to an even and uniform handwriting, but rarely so for the non-homogeneous handwritten texts that fill our archives. In most cases, manual transcription is still the most common way to produce reliable electronic texts from handwritten texts, but modern technology advances and many projects try to tackle this problem. Manual transcription is typically expensive and prone to human error. The incentives to open up this material to computerized searches is high. The information in archives and library collections world-wide, represent an enormously important source to history and only relatively small parts of it is available as electronic texts. Semi-automatic transcription of manuscripts typically requires hundreds of already transcribed pages, with thousands of examples of each word, in order to produce a useful transcription of the rest of the text. Due to the time consuming machine learning procedures involved, this is computed as off-line batch jobs overnight [7]. However, this means that if just a dozen pages exist, the transcriber is forced to complete the transcriptions without the help of HTR techniques, unless a similar handwriting style exists. An alternative approach to fast transcription of text with a low cost is using computer assisted interactive techniques. This paper introduces a simple yet effective text extractor tool, T exT for transcription of historical handwritten documents. T exT is designed for quick document transcription with the help of user interaction where the system finds multiple occurrences of the marked text on-the-fly using a word spotting system. Other advantages of T exT include on-the-fly annotation of handwritten text with automatic generation of ground truth labels, adjustment and correction of user labeled bounding box annotations such that the word perfectly fits inside the rectangle. Nevertheless, the transcribed words are cleaned using filtering methods for background noise removal. This paper is organized as follows. Sections 2-4 discusses various transcription and annotation methods and tools available in literature, and discusses related work on handwritten text transcription. Section 5 explains the proposed text extractor tool T exT in detail. Section 6 demonstrate the efficacy of the proposed method with implementation details on well-known historical document dataset. Section 7 concludes the paper. 2 Transcription methods and tools Transcriptions can be made by several different techniques, by reading and typing, typically done by one person interested in using the contents of the documents, as opposed to collective transcription where many individuals make transcriptions using crowdsourcing techniques. HTR, and dictation, are other techniques that can be used to produce transcriptions. An example of the lat- ter is the war-diary of Sven Blom, a Swedish volunteer in The Foreign Legion during the Great War. The diary is kept in Uppsala University Library and was transcribed by dictation [9]. Due to the labour-intensive task involved in transcriptions, crowdsourcing, a term originally coined by Jeff Howe in Wired Magazine in 2006 [10], has been a useful way of distributing transcription work to many people and therefore it sits at the core of many successful transcription projects. The T ranscribe Bentham project at the University College of London is often mentioned as an example [11]. Like so many others, T ranscribe Bentham is built with components from the open-source software M ediaW iki, also used for the perhaps biggest crowdsourcing project on the planet, W ikipedia. T ranscribe Bentham started in 2010 and has to this date completed approximately 43% of the whole collection [12]. They now collaborate with the READ project [13] and the application Transkribus [14], which can combine HTR with manual transcription. There are numerous other transcription tools on the Internet. Zooniverse [15], based in Oxford, include transcription as one of their crowdsourcing tasks, among many others. The plugin Scripto [16] is one of the oldest, typically created in an environment close to the history discipline, the Roy Rosenzweig Center for History and New Media at George Mason University. It is also based on M ediaW iki and can be used as a plugin for Omeka, W ordpress and Drupal. Veele Handen [17] is a Dutch application which offers crowdsourced transcriptions as a tool for archives and libraries wishing to open up their collections. They have recently included progress bars where followers and participants can monitor progress. This feature is very similar to the Smithsonian Institution and their “Digital Volunteers” [18]. In fact, the Smithsonian Institution can be regarded as one of the pioneers in assigning tasks to volunteers. Already in 1849, soon after the founding of Smithsonian Institution, it’s first secretary, Joseph Henry, was able to initiate a network of some 150 volunteers for weather observations, all over the United States [19]. The “Smithsonian Digital Volunteers” is a very successful transcription application and their Graphics User Interface (GUI) combines a clear topical structure with progress bars and a general layout which has incorporated well-established practices used in proof-reading. The work of volunteer number one, has to be approved by a second volunteer and finally the result needs to be approved by the mother institution, wishing to publish the results on the web. Together with other activities, such as promoting projects via social networks, they have managed to achieve good results, demonstrating the importance of an attractive GUI in crowdsourcing. The topical structure facilitates for the user to find attractive tasks Uppsala university library is Sweden’s oldest university library and its manuscript collections consist of approximately four kilometers of handwritten material in letters, diaries, notebooks etc. The handwritten manuscript collections date back 2000 years; from BC till the 21st century. The medieval manuscripts are plentiful and the 16th to 20th centuries are well represented with many single important collections, such as the correspondence of the Swedish King Gustav III, containing letters from, for example the French Queen Marie An- toinette and the Waller collection of 38000 manuscripts with letters from both Isaac Newton and Charles Darwin. The languages in the collection are also diverse (e.g. Swedish, Arabic, Persian etc.). However, the main languages for this project include Swedish, Latin, German, and French. Since a few years back it has been possible to publish digitized material in the Alvin platform [20], a repository for cultural heritage materials shared among the universities in Uppsala, Lund and Göteborg, as well as other Swedish libraries and museums. However, as so often is the case, very little of the handwritten material is transcribed. The collection can therefore be accessed only through meta-data and cannot be analyzed by computational means, a problem which may only be tackled by long term and multifaceted strategic planning for producing more handwritten document transcriptions. As a start, Alvin [20] has been adapted to allow for publishing transcriptions alongside the original manuscripts. One example of this is a transcription made from a testimony of refugees arriving to Sweden in 1945 from the concentration camp in Ravenbrück, kept at Lund University Library [21]. In this case, the transcriptions in textual electronic format (such as PDF) are a result of manual transcription and are open to Google indexing, thus making the original manuscripts searchable on the Internet. However, this is only an example, to open up more texts for use in digital humanities, a combination of HTR technology and manual crowdsourced transcriptions is probably as far as our present technologies admit. This work takes an initiative towards transcription and annotation of huge volumes of historical handwritten documents present in our university library using HTR methods such as word spotting [22]. 3 Document annotation methods and tools Several document image ground truth annotation methods [23,24] and tools [25,26,27,28,29,30,31,32] have been suggested in literature. Problems related to ground truth design, representation and creation are discussed in [33]. However, these methods are not suitable for annotating degraded historical datasets with complex layouts [34]. For example, Pink Panther [25], TrueViz [26], PerfectDoc [27] and PixLabeler [28] work well on simple documents only and perform poorly on historical handwritten document images [35]. A highly configurable document annotation tool GEDI [29] supports multiple functionalities such as merging, splitting and ordering. Aletheia [30] is an advanced tool for accurate and cost effective ground truth generation of large collection of document images. WebGT [31] provides several semi-automatic tools for annotating degraded documents and has gained importance recently. Text Encoder and Annotator (TEA) was proposed in [32] for manuscripts annotation using semantic web technologies. However, these tools require specific system requirements for configuration and installation. Most of these tools and methods are either not suitable for annotating historical handwritten datasets, or represent ground truths with imprecise and inaccurate bounding boxes [35]. Our previous work [34] takes into account such issues, and proposed a simple method for annotating historical handwritten text on-the-fly. This work employs this annotation method with improvements using word spotting algorithm. A detailed discussion of the annotation tools and methods is out of scope of this paper, and the reader is referred to [34] for a deeper understanding of ground truth annotation methods, and on-the-fly handwritten text annotation in general. 4 Related Work on Handwritten Text Transcription Manual transcription of historical handwritten documents requires highly skilled experts, and is typically a time consuming process. Manual transcription is clearly not a feasible solution due to large amounts of data waiting to be transcribed. Fully automatic transcription using HTR techniques offers a cost-effective alternative, but often fails in delivering the required level of transcription accuracy [36]. Instead, semi-automatic or semi-supervised transcription methods have gained importance in the recent past [36,37,38,39,40]. The transcription method proposed in [40] uses a computer assisted and interactive HTR technique: CATTI (Computer Assisted Transcription of Text Images) for fast, accurate and low cost transcription. For an input text line image to be transcribed, an iterative interactive process is initiated between the CATTI system and the end-user. The system thus generates successively improved transcription in response to the simple user corrective feedback. Image and language models from partially supervised data have been adapted in [38] to perform computer assisted handwritten text transcription using HMMbased text image modeling and n-gram language modeling. This method has been recently implemented in GIDOC (Gimp-based Interactive transcription of old text Documents) [41] system prototype where confidence measures are estimated using word graphs that helps users in finding transcription errors. An active learning based handwritten text transcription method is proposed in [39] that performs a sequential line-by-line transcription of the document, and a continuously re-trained system interacts with the end-user to efficiently transcribe each line. The performance of CATTI system [40], and the methods proposed in [38] and [39] is dependent upon accurate detection of the text lines in each document page. However, the line detection and extraction in historical handwritten document images is a challenging task, and advanced line detection techniques [42] are required. In practical scenarios, such methods are not appropriate as a system should ideally accept a full document page as an input and generate full transcription of the words as an output. An end-to-end system for handwritten text transcription is presented in [36,37] that also uses HMM-based text image modeling with interactive computer assisted transcription. The transcription method proposed in this work addresses these issues and introduces T exT for quick transcription of handwritten text using a segmentation-free word spotting algorithm [22]. The following section explains the proposed method and its advantages in detail. 5 TexT - Text Extractor Tool This paper presents a framework for semi-automatic transcription of historical handwritten manuscripts and introduces a simple interactive text extractor tool, T exT for transcribing words in textual electronic format. The method is based on the idea of transcribing each unique word only once for the whole document, including annotations such as gender, geographical locations, etc. This will both speed up the tedious work of transcription and also make it less exhausting. Furthermore, an interactive approach is proposed where the system finds other occurrences of the same word on-the-fly using so-called word spotting system [43,22]. The user simply identifies one occurrence, and while the word is being written by the user, the HTR engine finds other possible occurrences of the same word, which are shown to the user, meanwhile it continues in the background to search other pages. Further, the user helps the HTR engine in marking words that are correctly identified and correcting misclassified words. By marking these words, writing their corresponding letter sequence, and adding annotations, the HTR engine in the meanwhile processes these words and more accurately identifies them, making a better distinction between these two classes of words. The proposed method inherits features from our previous work [34] and efficiently performs on-the-fly annotation of handwritten text with automatic generation of ground truth labels, and dynamic adjustment and correction of user annotated bounding box labels with perfect encapsulation of the text inside the rectangle. Interestingly, the transcriptions are generated such that the transcribed word contains no added noise from the background or surroundings. This is made possible by the use of two band-pass filtering approach for background noise removal [44]. This is followed by connected components extraction from the word image. The following features are important parts of the T exT project planning: – A simple yet informative, and user-friendly GUI that may attract users according to well defined topics such as botany, history, theology, diaries, etc. – A GUI where the user can download the transcription results on-the-fly as they are distributed in the University library digital repository. – Presence on social networks. – A ranking system combined with a merit-report for the use of the contributor. – A proof-reading structure with a first and a second proof-reader and a safe yet quick ingestion mechanism for the repository. – A graphic illustration of progress for each topic. – An administration of the application which includes active outreach to find interested audiences, close monitoring of the uploaded content and general advertising of opportunities, news and activities, including events which might give contributors extra value, such as exhibitions and shows of the original material. – An HTR application, active only in the background, making use of the user input through machine learning and delivering better results based on the user input. The combination of crowdsourcing and HTR is crucial and, it is believed to be one of the key factors for the T exT project. Human interaction with AI (artificial intelligence) might be the best way to combine IT-technologies with those interested in contributing to the cultural heritage [45]. (a) Input document with user marked word (red) and system corrected bounding box (green). (b) Clean transcribed word reberé with background noise removed. Fig. 1: The user marks a word in the document (in the left), shown in red bounding box. The system finds the best fitting rectangle (in green) to perfectly encapsulate the word. The background noise is removed and the clean transcribed word generated is shown on the right. Figure best viewed in color. 6 Experimental Framework and Implementation Details This section emphasize on the overall experimental framework of T exT along with insight on its implementation details. The proposed framework is tested on the Esposalles dataset [46], a subset of the Barcelona Historical Handwritten Marriages (BH2M) database [47]. BH2M consists of 244 books with information on 550,000 marriages registered between 15th and 19th century. The Esposalles dataset consists of historical handwritten marriages records stored in archives of Barcelona cathedral, written between 1617 and 1619 by a single writer in old Catalan. In total, there are 174 pages handwritten by a single author corresponding to volume 69, out of which 50 pages are selected from 17th century. In future, the ancient manuscripts from the Uppsala University library will be used for further experimentation. The text transcription method based on word spotting is performed as follows. The system generates a document page query where the user marks a query Fig. 2: The result of searching one word marked by the user (for example, reberé), represented using blue bounding box. Figure best viewed in color. Fig. 3: The transcription can be performed in any order and in this case 11 different words have been marked, and the other occurrences are found automatically. Figure best viewed in color. Fig. 4: The ongoing transcription results in words being identified in their corresponding places. In this case, the user has also annotated names and places using different colors. Figure best viewed in color. word with a so called rubber band rectangle. The user marked red bounding box is highlighted in Fig. 1a for a sample word reberé. The system automatically finds the best fitting rectangle to perfectly encapsulate the word, as shown in Fig. 1a using green bounding box, and extracts the word. Furthermore, the noise from the background and surroundings is efficiently removed using two band-pass filtering approach in order to make the subsequent search more reliable (see Fig. 1b). The system starts searching for the word in the document page and the result is shown in Fig. 2. Note that only a cropped part of the document page from the dataset is shown for demonstration. The search is performed while the user inserts the transcribed text together with the annotations. Now the user can let the system learn by clicking on one or several word boxes confirming that they are correctly found. If the system find words that are misclassified, the user can inform the system by clicking a button to switch from correct to incorrect mode, and then selecting the words. While doing this, the system continues to perform word search on other document pages and update the search on the basis of information the system learns from the user. The user can select words in any order by marking them once. Figure 3 shows how 11 words have been chosen and the system finds the rest. The corresponding transcription is shown in Fig. 3. In this case, the user has annotated some words as names (highlighted in red) and others as geographical places (highlighted in green). This example of a place represents the abbreviation for the word Barcelona. 7 Conclusion and Future Work The transcription tool T exT presented in this paper is based on an interactive word spotting system, and lends itself to collaborative work, such as online crowdsourcing for large-scale document transcription. The proposed method can be further improved using client-server or cloud-based solution to perform transcription without much latency. So far algorithms for word spotting [22] have been developed and a simple experimental framework is proposed to support the transcription approach presented herein. As future work, we intend to implement a transcription framework on ancient manuscripts from Uppsala University Library that works as follows. Each user can freely mark words, annotate them and also identify words found by the search as correct or incorrect. The major part of the search will be performed on a dedicated computer that splits the work in parallel, making it possible to search even large documents in a few seconds. It can be noted that searching one word in our MATLAB implementation takes about 2 seconds for the example shown in Fig. 2. The word spotting approach used in this work [22] efficiently performs parallel processing such that the search in a single page can be distributed into several processes, and hence making the search much faster. Different learning methods are being evaluated to improve the transcription algorithm. Deep learning techniques can be used only when several hundreds of annotated examples are available for a document, but when starting a transcription of an entirely new document, no such are usually available. References 1. Mori, S., Nishida, H., Yamada, H.: Optical Character Recognition. John Wiley (1999) 2. Govindan, V.K., Shivaprasad, A.P.: Character recognition - a review. Pattern Recognition 23(7) (July 1990) 671–683 3. Blanke, T., Bryant, M., Hedges, M.: Open source optical character recognition for historical research. Journal of Documentation 68(5) (2012) 659–683 4. Plamondon, R., Srihari, S.N.: Online and off-line handwriting recognition: a comprehensive survey. IEEE Transactions on pattern analysis and machine intelligence 22(1) (2000) 63–84 5. Marti, U.V., Bunke, H.: Hidden markov models. World Scientific Publishing Co., Inc., River Edge, NJ, USA (2002) 65–90 6. Toselli, A.H., Vidal, E.: Handwritten text recognition results on the bentham collection with improved classical n-gram-hmm methods. In: Proceedings of the 3rd International Workshop on Historical Document Imaging and Processing. HIP’15, New York, USA, ACM (2015) 15–22 7. Espana-Boquera, S., Castro-Bleda, M.J., Gorbe-Moya, J., Zamora-Martinez, F.: Improving offline handwritten text recognition with hybrid hmm/ann models. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. IEEE Transactions on Pattern Analysis and Machine Intelligence 33(4) (2011) 767–779 Parvez, M.T., Mahmoud, S.A.: Offline arabic handwritten text recognition: A survey. ACM Computing Surveys 45(2) (2013) 23:1–23:35 http://urn.kb.se/resolve?urn=urn:nbn:se:alvin:portal:record-12537/ (2017) Howe, J.: The rise of crowdsourcing. Wired magazine 14(6) (2006) 1–4 Moyle, M., Tonra, J., Wallace, V.: Manuscript transcription by crowdsourcing: Transcribe bentham. Liber Quarterly 20(3-4) (2011) http://blogs.ucl.ac.uk/transcribe-bentham/2017/08/21/ transcription-update-22-july-to-18-august-2017/ (2017) http://read.transkribus.eu/ http://transkribus.eu/Transkribus/ Borne, K., Team, Z.: The zooniverse: A framework for knowledge discovery from citizen science data. In: AGU Fall Meeting Abstracts. (2011) http://scripto.org/ http://velehanden.nl/ (2017) http://transcription.si.edu/ (2017) http://siarchives.si.edu/blog/smithsonian-crowdsourcing-1849/ (2017) http://www.alvin-portal.org/ (2017) http://urn.kb.se/resolve?urn=urn:nbn:se:alvin:portal:record-101351/ (2017) Hast, A., Fornés, A.: A segmentation-free handwritten word spotting approach by relaxed feature matching. In: Document Analysis Systems (DAS), 2016 12th IAPR Workshop on, IEEE (2016) 150–155 Héroux, P., Barbu, E., Adam, S., Trupin, É.: Automatic ground-truth generation for document image analysis and understanding. In: Document Analysis and Recognition, 2007. ICDAR 2007. Ninth International Conference on, IEEE (2007) 476–480 Pletschacher, S., Antonacopoulos, A.: The page (page analysis and ground-truth elements) format framework. In: Pattern Recognition (ICPR), 2010 20th International Conference on, IEEE (2010) 257–260 Yanikoglu, B.A., Vincent, L.: Pink panther: a complete environment for groundtruthing and benchmarking document page segmentation. Pattern Recognition 31(9) (1998) 1191–1204 Kanungo, T., Lee, C.H., Czorapinski, J., Bella, I.: Trueviz: a groundtruth/metadata editing and visualizing toolkit for ocr. In: Document Recognition and Retrieval VIII. Volume 4307., International Society for Optics and Photonics (2000) 1–13 Yacoub, S., Saxena, V., Sami, S.N.: Perfectdoc: A ground truthing environment for complex documents. In: Document Analysis and Recognition, 2005. Proceedings. Eighth International Conference on, IEEE (2005) 452–456 Saund, E., Lin, J., Sarkar, P.: Pixlabeler: User interface for pixel-level labeling of elements in document images. In: Document Analysis and Recognition, 2009. ICDAR’09. 10th International Conference on, IEEE (2009) 646–650 Doermann, D., Zotkina, E., Li, H.: Gedi- a groundtruthing environment for document images. In: Ninth IAPR International Workshop on Document Analysis Systems (DAS). (2010) Clausner, C., Pletschacher, S., Antonacopoulos, A.: Aletheia- an advanced document layout and text ground-truthing system for production environments. In: 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. Document Analysis and Recognition (ICDAR), 2011 International Conference on, IEEE (2011) 48–52 Biller, O., Asi, A., Kedem, K., El-Sana, J., Dinstein, I.: Webgt: An interactive web-based system for historical document ground truth generation. In: Document Analysis and Recognition (ICDAR), 2013 12th International Conference on, IEEE (2013) 305–308 Valsecchi, F., Abrate, M., Bacciu, C., Piccini, S., Marchetti, A.: Text encoder and annotator: an all-in-one editor for transcribing and annotating manuscripts with rdf. In: International Semantic Web Conference, Springer (2016) 399–407 Antonacopoulos, A., Karatzas, D., Bridson, D.: Ground truth for layout analysis performance evaluation. In: International Workshop on Document Analysis Systems, Springer (2006) 302–311 Vats, E., Hast, A.: On-the-fly Historical Handwritten Text Annotation. arXiv preprint arXiv:1709.01775 (September 2017) Wei, H., Seuret, M., Liwicki, M., Ingold, R.: The use of gabor features for semiautomatically generated polyon-based ground truth of historical document images. Digital Scholarship in the Humanities (2017) Romero, V., Bosch, V., Hernández-Tornero, C., Vidal, E., Sánchez, J.: A historical document handwriting transcription end-to-end system. In: Pattern Recognition and Image Analysis - 8th Iberian Conference, IbPRIA 2017, Portugal, 2017, Proceedings. (2017) 149–157 Terrades, O.R., Toselli, A.H., Serrano, N., Romero, V., Vidal, E., Juan, A.: Interactive layout analysis and transcription systems for historic handwritten documents. In: 10th ACM Symposium on Document Engineering. (2010) 219–222 Serrano, N., Pérez, D., Sanchis, A., Juan, A.: Adaptation from partially supervised handwritten text transcriptions. In: Proceedings of the 2009 International Conference on Multimodal Interfaces. ICMI-MLMI ’09, New York, USA, ACM (2009) 289–292 Serrano, N., Giménez, A., Sanchis, A., Juan, A.: Active learning strategies for handwritten text transcription. In: International Conference on Multimodal Interfaces and the Workshop on Machine Learning for Multimodal Interaction. ICMI-MLMI ’10, New York, USA, ACM (2010) 48:1–48:4 Romero, V., Toselli, A.H., Vidal, E.: Multimodal interactive handwritten text transcription. Volume 80. World Scientific (2012) http://prhlt.iti.es/projects/handwritten/idoc/content.php?page=gidoc. php Bosch, V., Toselli, A.H., Vidal, E.: Semiautomatic text baseline detection in large historical handwritten documents. In: Frontiers in Handwriting Recognition (ICFHR), 2014 14th International Conference on, IEEE (2014) 690–695 Giotis, A.P., Sfikas, G., Gatos, B., Nikou, C.: A survey of document image word spotting techniques. Pattern Recognition 68 (2017) 310–332 Vats, E., Hast, A., Singh, P.: Automatic Document Image Binarization using Bayesian Optimization. arXiv preprint arXiv:1709.01782 (September 2017) Kittur, A., Nickerson, J.V., Bernstein, M., Gerber, E., Shaw, A., Zimmerman, J., Lease, M., Horton, J.: The future of crowd work. In: Proceedings of the 2013 conference on Computer supported cooperative work, ACM (2013) 1301–1318 Romero, V., Fornés, A., Serrano, N., Sánchez, J.A., Toselli, A.H., Frinken, V., Vidal, E., Lladós, J.: The ESPOSALLES database: An ancient marriage license corpus for off-line handwriting recognition. Pattern Recognition 46(6) (2013) 1658– 1669 47. Fernández-Mota, D., Almazán, J., Cirera, N., Fornés, A., Lladós, J.: Bh2m: The barcelona historical, handwritten marriages database. In: Pattern Recognition (ICPR), 2014 22nd International Conference on, IEEE (2014) 256–261
1cs.CV
1 Fully Distributed Adaptive Output Feedback Protocols for Linear Multi-Agent Systems with Directed Graphs: A Sequential Observer Design Approach arXiv:1511.01297v1 [cs.SY] 4 Nov 2015 Yuezu Lv, Zhongkui Li, Zhisheng Duan, and Jie Chen Abstract—This paper studies output feedback consensus protocol design problems for linear multi-agent systems with directed graphs. We consider both leaderless and leader-follower consensus with a leader whose control input is nonzero and bounded. We propose a novel sequential observer design approach, which makes it possible to design fully distributed adaptive output feedback protocols that the existing methods fail to accomplish. With the sequential observer architecture, we show that leaderless consensus can be achieved for any strongly connected directed graph in a fully distributed manner, whenever the agents are stabilizable and detectable. For the case with a leader of bounded control input, we further present novel distributed adaptive output feedback protocols, which include nonlinear functions to deal with the effect of the leaders’s nonzero control input and are able to achieve leader-follower consensus for any directed graph containing a directed spanning tree with the leader as the root. Index Terms—Multi-agent systems, consensus, output feedback control, adaptive control. I. I NTRODUCTION Over the past decade, the consensus control problem of multi-agent systems has emerged as a focal research topic in the field of control, due to its various applications to, e.g., UAV formation flying, multi-point surveillance, and distributed reconfigurable sensor networks [1], [2]. Considerable work from different perspectives has been conducted on consensus and other related cooperative control problems; see the recent papers [3], [4], [5], [1], [6], [2], the monographs [7], [8], and the references therein. Existing consensus algorithms can be essentially divided into two broad categories, namely, consensus without a leader (i.e., leaderless consensus) and consensus with a leader, whereas the latter ia also called leader-follower consensus or distributed tracking. In a leader-follower consensus problem, it is often the case that the leader may need to implement its own control actions to achieve certain objectives, e.g., to reach a desirable consensus trajectory or to avoid hazardous obstacles. Thus, compared to leaderless consensus, an additional This work was supported in part by the National Natural Science Foundation of China under grants 61473005, 11332001, 61225013, and in part by the Hong Kong RGC under the project CityU 111810, CityU 111511. Y. Lv, Z. Li, and Z. Duan are with the State Key Laboratory for Turbulence and Complex Systems, Department of Mechanics and Engineering Science, College of Engineering, Peking University, Beijing 100871, China. E-mail: {yzlv,zhongkli,duanzs}@pku.edu.cn J. Chen is with the Department of Electronic Engineering, City University of Hong Kong, Kowloon, Hong Kong. E-mail: [email protected] difficulty with leader-follower consensus lies in how to deal with the effect of the leader’s control input which is available to at most a small subset of the followers. A. Motivations and Related Works A central task in consensus studies is to design distributed consensus protocols based on only the local information of each agent and its neighbors to ensure that the states of the agents reach an agreement. In most of the previous works on consensus, e.g., [9], [10], [5], [11], [12], [13], which address the consensus problem of integrator-type, general linear and Lipschitz nonlinear multi-agent systems, the design of the consensus protocols requires the knowledge of certain connectivity of the communication graph. The connectivity for undirected graphs can be measured by the smallest nonzero eigenvalue of the corresponding Laplacian matrix [3], while for directed graphs the smallest positive real part of the eigenvalues of the Laplacian matrix [5] or other similar quantities are typically used [13]. Since the connectivity measures require computing the nonzero eigenvalues of the Laplacian matrix associated with the entire communication graph, the consensus protocols in these works require in essence global information of the graph which cannot be determined in a fully distributed manner. Fully distributed consensus protocols, nevertheless, can be developed by implementing adaptive laws to dynamically update the coupling weights of neighboring agents, thus removing the aforementioned requirement on the global eigenvalue information. Such adaptive consensus protocols are proposed in [14], [15] for linear multi-agent systems, which depend on only local information of each agent and its neighbors. Similar adaptive schemes are presented in [16], [17] for second-order nonlinear agents. Note that the adaptive protocols in [14], [15], [16], [17] are applicable to only undirected communication graphs. Due to the asymmetry of the corresponding Laplacian matrices, however, the development of distributed adaptive consensus protocols poses a more difficult problem with directed graphs. By introducing monotonically increasing functions as a means to provide additional freedom for design, a distributed adaptive consensus protocol is constructed in [18], for directed graphs containing a directed spanning tree in which the leader is the root node. Another adaptive protocol is presented in [19], which can be modified using the σmodification technique so that it is robust in the presence 2 of bounded external disturbances. It is worth pointing out, however, that the protocols in [18], [19] rely on the relative states of neighboring agents, which may not be available in general. How to design fully distributed adaptive output feedback consensus protocols using only local output information appears much more challenging. Except those protocols proposed in [20] for quite special minimum-phase and relativedegree-one agents, designing fully distributed output feedback protocols for general linear multi-agent systems with directed graphs remains to be an open issue. The aforementioned works are concerned with the leaderless consensus problem or distributed tracking problem for the case where the leader is of zero control input. The distributed tracking problem in the presence of a leader having a nonzero control input is generally more difficult and has been addressed in [21], [22], [23], [24], [14], [25]. In particular, the authors in [21] present nonsmooth controllers for first- and second-order integrators in the absence of velocity or acceleration measurements. The controllers in [21] incorporate discontinuous functions commonly found in the sliding mode control literature, which are meant to cope with the leader’s bounded control input. The authors in [22], [23], [24] address a distributed coordinated tracking and containment control problem, for multiple Euler-Lagrange systems with one or more dynamic leaders. Distributed static and adaptive protocols are given in [14], [25] for general linear multi-agent systems with a leader of bounded control input. It is worth noting that one common assumption in [21], [14], [25] is that the subgraph among the followers is undirected. The case where this subgraph is directed remains unsolved for general linear multi-agent systems. The main obstacle lies in the unpleasant interrelations between the nonlinear functions used to deal with the leader’s control input and the directed subgraph among followers. B. Our Contributions In this paper, we address the distributed adaptive output feedback consensus protocol design problem for general linear multi-agent systems with directed communication graphs. In this setting, the relative states of neighboring agents are not available, but only local output information is accessible. Both the cases with and without a leader of bounded control input are studied. Note that simply combining the techniques for the state feedback case (e.g., those proposed in [18], [19]) and distributed adaptive observer-type protocols (e.g., in [14]) for undirected graphs will not yield distributed adaptive output feedback consensus protocols applicable to general directed graphs. The main reason is that the monotonically increasing functions introduced in [18], [19], when used for observer-type adaptive protocols in [14], will still depend on the relative states of neighboring agents. This motivates us to seek for novel methods to design distributed output feedback consensus protocols. To circumvent the difficulties alluded to above, in this paper we propose a two-step, sequential observer design (SOD) method, which consists of designing first a local observer and next a distributed observer. Here the local observer is employed to estimate from an agent’s output the agent’ state, while the distributed observer operates on the local state estimates and generates the control input; neither of these observers uses the state information of the agents. Utilizing this novel SOD architecture, two types of distributed adaptive output feedback consensus protocols are developed for the leaderless consensus problem, which exchange the local estimates among neighboring agents via the communication graph and implement adaptive laws to update the time-varying coupling weights among the agents. As such, these two adaptive protocols uses only the local output information and achieve leaderless consensus in a fully distributed manner, for any strongly connected directed graph. This constitutes one of our main contributions in this paper. Another main result of this paper concerns the leaderfollower consensus with a leader of bounded control input. We propose a distributed discontinuous adaptive output feedback protocol, to solve the consensus problem, which includes discontinuous nonlinear functions to deal with the effect of the leaders’s nonzero control input. It is shown that the discontinuous adaptive protocols can achieve leader-follower consensus for any directed graph containing a directed spanning tree with the leader as the root. To attenuate the chattering phenomenon resulted from discontinuity, distributed continuous adaptive output feedback protocols are further developed, which can ensure the ultimate boundedness of the consensus error and the adaptive gains. The upper bound of the consensus error is explicit derived, which can be made satisfactorily small by appropriately tuning the design parameters. Unlike the protocols in the previous works [21], [14], [25], the adaptive protocols proposed herein appear to be the first available for linear multi-agent systems with general directed graphs. C. Outline of This Paper The rest of this paper is organized as follows. The mathematic preliminaries used in this paper are summarized in Section II. Distributed adaptive output feedback consensus protocols for general linear systems with strongly connected graphs are presented in Section III. The leader-follower consensus problem for the case with a leader of bounded control input is studied in Section IV. Numerical simulation results are presented in Section V. Section VI concludes our paper. II. M ATHEMATICAL P RELIMINARIES Notations: Throughout this paper, the symbol 1 denotes a column vector with all entries equal to 1. For any square matrix A, λmin (A) and λmax (A) represent the minimal and maximal eigenvalues of A, respectively. A matrix A = [aij ] ∈ Rn×n is called a nonsingular M-matrix, if aij < 0, ∀i 6= j, and all eigenvalues of A have positive real parts. The communication graph among the agents is specified by a directed graph G = (V, E), where V = {1, · · · , N } is the set of nodes (each node represents an agent) and E ⊆ V × V denotes the set of edges (each edge represents a communication link between two distinct agents). An edge (i, j) ∈ E represents that node i is a neighbor of node j and node j can have access to the state or output of node i. A directed path from node i1 to node il is a sequence of ordered 3 edges in the form of (ik , ik+1 ), k = 1, · · · , l − 1. A directed graph contains a directed spanning tree if there exists a node called the root such that the node has directed paths to all other nodes in the graph. A directed graph is strongly connected if there exists a directed path between every pair of distinct nodes. A directed graph has a directed spanning tree if it is strongly connected, but not vice versa. The adjacency matrix associated with the communication graph G, denoted by A = [aij ] ∈ RN ×N , is defined as aii = 0, aij = 1 if (i, j) ∈ E and 0 otherwise. The Laplacian matrix PN L = [lij ] ∈ RN ×N is defined such that lii = j=1 aij and lij = −aij , i 6= j. We summarize below key facts relevant to our subsequent developments. Lemma 1 ([4]): Zero is an eigenvalue of L with 1 as a right eigenvector and all nonzero eigenvalues have positive real parts. Besides, zero is a simple eigenvalue of L if and only if G has a directed spanning tree. Lemma 2 ([26]): Suppose that G is strongly connected. There exists a vector r = [r1 , · · · , rN ]T with ri > 0, i = 1, · · · , N , such that rT L = 0. Let R = diag(r1 , · · · , rN ) [13]. Then, L̂ , RL + LT R is the symmetric Laplacian matrix associated with an undirected connected graph. MoreT λ2 (L̂) over, minξT x=0,x6=0 xxTL̂x x > N , where λ2 (L̂) denotes the smallest nonzero eigenvalue of L̂ and ξ is any vector with positive entries. Lemma 3 ([27], [18]): Consider a nonsingular M-matrix L. There exists a diagonal matrix G ≡ diag(g1 , · · · , gN ) > 0 such that GL + LT G > 0. Lemma 4 ([28]): If a and b are nonnegative real numbers and p and q are positive real numbers such that p1 + 1q = 1, p q then ab ≤ ap + bq , where the equality holds if and only if ap = b q . Lemma 5 ([29]): If a real function W (t) satisfies the inequality W (t) ≤ −aW (t) + b, where a and b are positive constant numbers. Then, a a W (t) ≤ [W (0) − ]e−at + . b b III. D ISTRIBUTED O UTPUT F EEDBACK A DAPTIVE P ROTOCOLS FOR S TRONGLY C ONNECTED G RAPHS Consider a group of N identical linear dynamical systems, with the dynamics of the i-th agent described by ẋi = Axi + Bui , yi = Cxi , i = 1, · · · , N, (1) where xi ∈ Rn is the state vector, yi ∈ Rm is the measured output vector, ui ∈ Rp is the control input vector of the ith agent, respectively, and A, B and C are constant known matrices with compatible dimensions. The communication graph among the N agents are represented by a directed graph G. We assume that G satisfies Assumption 1: The communication graph G is strongly connected. With the agent dynamics given in (1), our purpose in this section is to design fully distributed output feedback consensus protocols to solve the consensus problem, wherein by consensus, we mean that limt→∞ kxi (t) − xj (t)k = 0, ∀ i, j = 1, · · · , N. We assume that the agents have access to their own outputs, i.e., the agents are introspective as termed in [30], [31]. The distributed adaptive output feedback protocol is proposed for each agent as follows: v̇i = Avi + Bui + F (Cvi − yi ), ẇi = Awi + Bui + (di + ρi )F C(ψi − ηi ) + F (Cvi − yi ), ui = Kwi , d˙i = (ψi − ηi )T C T C(ψi − ηi ), i = 1, · · · , N, (2) PN PN where ψi , j=1 aij (vi − vj ), j=1 aij (wi − wj ), ηi , vi ∈ Rn and wi ∈ Rn are the internal states of the protocol, di denotes the time-varying coupling weight associated with the i-th agent with di (0) > 0, K and F are the feedback gain matrices, and ρi (·) are smooth and monotonically increasing functions which satisfy the condition ρi (s) ≥ 0 for s > 0. Note that the term C(ψi − ηi ) in (2) implies that the agents need to transmit the virtual outputs Cwi and Cvi of the internal states wi and vi of their corresponding protocols to their neighbors via the communication network G. In (2), the parameters K, FP, and ρi (·) need to be determined. N Let ξi , j=1 aij (xi − xj ), i = 1, · · · , N , ξ , T T T T T T T [ξ1 , · · · , ξN ] , η , [η1T , · · · , ηN ] , ψ , [ψ1T , · · · , ψN ] , T T T T T T x , [x1 , · · · , xN ] , v , [v1 , · · · , vN ] , and w , T T [w1T , · · · , wN ] . Then, we have ξ = (L ⊗ In )x, η = (L ⊗ In )v, ψ = (L ⊗ In )w. (3) Under Assumption 1, it is known by Lemma 1 that L has an eigenvalue at the origin with 1 being the corresponding eigenvector and all the nonzero eigenvalues of L have positive real parts. By the first equality in (3), it is easy to see that the consensus problem is solved if and only if ξ asymptotically converges to zero. We will refer to ξ as the consensus error hereafter. By substituting (2) into (1), we can write the closed-loop dynamics of the network in a compact form as ξ˙ = (IN ⊗ A)ξ + (IN ⊗ BK)ψ, η̇ = (IN ⊗ A)η + (IN ⊗ BK)ψ + (IN ⊗ F C)(η − ξ), ψ̇ = [IN ⊗ (A + BK)]ψ + [L(D + ρ) ⊗ F C](ψ − η) + (IN ⊗ F C)(η − ξ), ˙ di = (ψi − ηi )T C T C(ψi − ηi ), (4) i = 1, · · · , N, where D , diag(d1 , · · · , dN ) and ρ , diag(ρ1 , · · · , ρN ). Let ζ , η−ξ and ̺ , [̺T1 , · · · , ̺TN ]T = ψ−η, where ̺i = ψi −ηi , i = 1, · · · , N . Then, it follows from the first two equalities in (4) that (5) ζ̇ = [IN ⊗ (A + F C)]ζ. From the last three equalities in (4), we find that ̺˙ = [IN ⊗ A + L(D + ρ) ⊗ F C]̺, ˙ di = ̺Ti C T C̺i , i = 1, · · · , N. (6) The third equality in (4) can be rewritten as ψ̇ = [IN ⊗ (A + BK)]ψ + [L(D + ρ) ⊗ F C]̺ + (IN ⊗ F C)ζ. (7) 4 The following theorem designs the adaptive output feedback protocol (2). Theorem 1: Suppose that the communication graph G satisfies Assumption 1. Then, the leaderless consensus problem of the agents in (1) can be solved under the adaptive output feedback protocol (2), if A + BK is Hurwitz, F = −S −1 C T , and ρi = ̺Ti S̺i , where S > 0 is a solution to the linear matrix inequality (LMI) AT S + SA − 2C T C < 0. (8) Moreover, each coupling weight di converges to some finite steady-state value. Proof: Since F = −S −1 C T , it follows from (8) that (A + F C)T S + S(A + F C) = AT S + SA − 2C T C < 0. Thus, A+F C is Hurwitz and ζ in (5) asymptotically converges to zero. Next, we show that ̺ in (6) converges to zero. To this end, consider the Lyapunov function candidate V1 = N 1X 2 ri (2di + ρi )̺Ti S̺i + i=1 N 1X 2 ri d˜2i , (9) i=1 where r = [r1 , · · · , rN ]T is the left eigenvector of L associated with the zero eigenvalue, d˜i , di − α, with α being a positive constant to be determined subsequentially. Since Assumption 1 holds, it follows from Lemma 1 that R , diag(r1 , · · · , rN ) > 0. Since di (0) > 0 and d˙i ≥ 0, it follows that di (t) > 0. Noting further that ρ(t) ≥ 0, it is not difficult to see that V1 is positive definite with respect to ˜ ̺ and d. The time derivative of V1 along the trajectory of (6) is given by V̇1 = N X [2ri (di + ρi )̺Ti S ̺˙ i + ri ρi d˙i ] + N X ri d˜i d˜˙i i=1 i=1 T T = ̺ [(D + ρ)R ⊗ (SA + A S) (10) − (D + ρ)L̂(D + ρ) ⊗ C T C + (ρR + DR − αR) ⊗ C T C]̺, where L̂ , RL + LT R. Let ̺ = ((D + ρ) ⊗ In )̺. Then, we have ̺T ((D + ρ)−1 r ⊗ 1) = ̺T (r ⊗ 1) = (w − v)T (LT r ⊗ 1) = 0, where we have used the fact that rT L = 0. Since every entry of r is positive, it is obvious that every entry of (D+ρ)−1 r⊗1 is also positive. In light of Lemma 2, we get λ2 (L̂) T ̺ ̺ N λ2 (L̂) T = ̺ [(D + ρ)2 ⊗ In ]̺. N ̺T (L̂ ⊗ In )̺ > (11) Note that ̺T [(D + ρ)R ⊗ C T C]̺ ≤ λ2 (L̂) T ̺ [(D + ρ)2 ⊗ C T C]̺ 4N N + ̺T (R2 ⊗ C T C)̺, λ2 (L̂) (12) and λ2 (L̂) T ̺ [(D + ρ)2 ⊗ C T C]̺ 4N N R2 ) ⊗ C T C]̺ − ̺T [(αR − λ2 (L̂) ≤ −2̺T [(D + ρ)R ⊗ C T C]̺, − (13) (R) where we have used Lemma 4 and chosen α ≥ 5Nλλmax to 2 (L̂) get the inequalities. By substituting (11), (12), and (13) into (10), we then obtain V̇1 ≤ ̺T [(D + ρ)R ⊗ (SA + AT S)]̺ 3λ2 (L̂) T ̺ ((D + ρ)2 ⊗ C T C)̺ 4N N R2 ) ⊗ C T C]̺ − ̺T [(αR − λ2 (L̂) ≤ ̺T [(D + ρ)R ⊗ (AT S + SA − 2C T C)]̺ − (14) ≤ ̺T [D(0)R ⊗ (AT S + SA − 2C T C)]̺ ≤ 0, where we have used the facts that D(t) ≥ D(0) and ρ ≥ 0 to arrive at the third inequality and used (8) to obtain the last inequality. Consequently, V1 (t) is bounded and so is each di . Noting that d˙i ≥ 0, we assert that each coupling weight di converges to some finite value. Furthermore, V̇1 ≡ 0 implies that ̺ ≡ 0. By LaSalle’s Invariance principle [32], it follows that ̺ asymptotically converges to zero. In light of this, together with the fact that ̺ asymptotically converges to zero and D(t) is bounded, it is easy to see that [L(D + ρ) ⊗ F C]̺ asymptotically converges to zero. Since A + BK is Hurwitz and ζ converge asymptotically to zero, it follows that ψ also asymptotically converges to zero. In conclusion, we have shown that all ζ, ̺, and ψ asymptotically converge to zero, which, in virtue of the definitions of ζ, ̺, and ψ, implies that the consensus error ξ converges asymptotically to zero. Thus, the agents achieve consensus.  Remark 1: As shown in [5], a necessary and sufficient condition for the existence of a solution S > 0 to the LMI (8) is that (A, C) is detectable. Therefore, an sufficient existence condition of an adaptive protocol (2) satisfying Theorem 1 is that (A, B, C) is stabilizable and detectable. Note that the adaptive protocol (2) can be designed by solving the algebraic Riccati equation: P̄ AT + AP̄ + I − P̄ C T C P̄ = 0, as in [33], [11]. In this case, the parameters in (2) can be chosen as F = −P̄ C T and ρi = ̺Ti P̄ −1 ̺i . Evidently, the adaptive protocol (2) uses only the agent dynamics and the local output information, and therefore is fully distributed. Remark 2: In contrast to the adaptive output feedback protocols in [14], which are applicable to only undirected graphs, the adaptive protocol (2) works for directed graphs, provided that the graphs are strongly connected. That this protocol is both fully distributed and only dependent on local output information is made possible by a novel sequential observer design (SOD) architecture, which consists of a local observer and a graph-based distributed observer: the local observer (the first equation in (2)) estimates the state of each agent, while the distributed observer (the second equation in 5 (2)) provides feedback based on estimated relative states, thus ensuring that ζ, ̺, and ψ converge to zero and subsequently the consensus error ξ converges to zero. In essence, the SOD method reduces the closed-loop network dynamics (4) into a upper-triangular form, where the first two dynamics (5) and (6) are independent and (7) relies on (5) and (6). Apart from the protocol (2), an alternative adaptive output feedback protocol can be constructed as follows: v̇i = Avi + Bui + F (Cvi − yi ), ẇi = Awi + Bui + (di + ρi )BK(ψi − ηi ) + F (Cvi − yi ), ui = Kwi , d˙i = (ψi − ηi )T Ω(ψi − ηi ), i = 1, · · · , N, (15) where Ω ∈ Rn×n is a feedback gain matrix, and the rest of the variables are defined as in (2). The parameters K, F , Ω, and ρi in (15) need to be determined. The difference between these two protocols will be elaborated subsequently. Theorem 2: Suppose that Assumption 1 holds. The consensus problem of the N agents described by (1) is solved by the adaptive output feedback protocol (15), whenever F satisfying that A+F C is Hurwitz, K = −B T P −1 , Ω = P −1 BB T P −1 , and ρi = ̺Ti P −1 ̺i where ̺i is defined as in (6) and P > 0 is a solution to the LMI: P AT + AP − 2BB T < 0, (16) In addition, the coupling weight di converge to finite steadystate values. Proof: From (15) and (1), we can obtain the closed-loop network dynamics as follows: ζ̇ = (IN ⊗ (A + F C))ζ, ψ̇ = [IN ⊗ (A + BK)]ψ + [L(D + ρ) ⊗ BK]̺ + (IN ⊗ F C)ζ, d˙i = ̺T Ω̺i , i = 1, · · · , N, (17) i where the variables ζ, ̺, and ψ are defined as in (5), (6), and (7), respectively. The convergence of ζ in (17) to zero is obvious. The convergence of ̺ in (17) can be proved similarly as in the proof of Theorem 1, by using the Lyapunov function candidate N FOR Theorem 1 and Theorem 2 in the previous section are applicable to strongly connected directed graphs. In this section, we extend our analysis to leader-follower consensus problems, alternatively known as distributed tracking. Consider a group of N + 1 agents with general linear dynamics described by (1), indexed by 0, · · · , N . Suppose that the agents indexed by 1, · · · , N , are the N followers and the agent indexed by 0 is the leader. Under many circumstances, the leader may need to implement control action to regulate the final consensus trajectory. We assume that in general the leader’s control input is bounded, i.e., the following assumption holds. Assumption 2: There exists a positive constant ω such that ku0 k ≤ ω. Moreover, we assume that the communication graph Gb among the N + 1 agents satisfies Assumption 3: The graph Gb contains a directed spanning tree with the leader as the root node. Under Assumption 3, the Laplacian matrix associated with  0 0 1×N , where Lb2 ∈ RN ×1 Gb can be partitioned as Lb = b Lb1 L2 and Lb1 ∈ RN ×N . It is easy to verify that Lb1 is a nonsingular M-matrix. In this section we propose new distributed output feedback consensus protocols that solve the leader-follower consensus problem, in the sense that limt→∞ kxi (t) − x0 (t)k = 0, ∀ i = 1, · · · , N. A. Discontinuous Adaptive Consensus Protocols ̺˙ = [IN ⊗ A + L(D + ρ) ⊗ BK]̺, V2 = IV. A DAPTIVE OUTPUT FEEDBACK PROTOCOLS L EADER - FOLLOWER G RAPHS N 1X 1 X ˜2 ri (2di + ρi )̺Ti P −1 ̺i + ri di . 2 i=1 2 i=1 The rest of the proof can be completed analogously as in the proof of Theorem 1. We omit the details for brevity.  Remark 3: The LMI (16) is dual to (8). Therefore, a sufficient condition for the existence of (15) satisfying Theorem 2 is also that (A, B, C) is stabilizable and detectable. Note that the adaptive protocol (2) transmits Cvi and Cwi between neighboring agents while the adaptive protocol (15) transmits vi and wi . The sum of the dimensions of Cvi and Cwi is generally lower than that of vi and wi . Therefore, the adaptive protocol (2) is more favorable, because of a lower communication burden. Based on the relative estimates of the states of neighboring agents, the following distributed discontinuous adaptive controller is proposed for each follower: ṽ˙ i =Aṽi + Bui + F (C ṽi − yi ), w̃˙ i =Aw̃i + B[ui − βh(B T S(ψ̃i − η̃i ))] + (di + ρi )F C(ψ̃i − η̃i ) + F (C ṽi − yi ), (18) T ui =K[w̃i − βh(B Qη̃i )], d˙i =(ψ̃i − η̃i )T C T C(ψ̃i − η̃i ), i = 1, · · · , N, where ṽ˙ 0 = Aṽ0 + Bu0 +PF (C ṽ0 − y0 ), w0 = 0, ψ̃i , P N N j=0 aij (w̃i − w̃j ), η̃i , j=0 aij (ṽi − ṽj ), ρi = (ψ̃i − T η̃i ) S(ψ̃i − η̃i ), S > 0 is a solution to the LMI (8), Q > 0, β is a positive constant, di denotes the time-varying coupling weight associated with the i-th follower with di (0) ≥ 0, and the nonlinear function h(·) is defined such that for z ∈ Rn , ( z if kzk = 6 0, (19) h(z) = kzk 0 if kzk = 0. In (18), the parameters K, F , Q, and β are to be determined. PN ˜ Let ξ˜i , j=0 aij (xi − xj ), i = 1, · · · , N , ξ , T T T T T T T T T ˜ [ξ1 , · · · , ξ̃N ] , η̃ , [η̃1 , · · · , η̃N ] , ψ̃ , [ψ̃1 , · · · , ψ̃N ] , T T T T T T and x , [x1 , · · · , xN ] , ṽ , [ṽ1 , · · · , ṽN ] , w̃ , 6 T T [w̃1T , · · · , w̃N ] . Then, we have ξ̃ = (Lb1 ⊗ In )(x − 1 ⊗ x0 ), η̃ = (Lb1 ⊗ In )(ṽ − 1 ⊗ ṽ0 ), (20) ψ̃ = (Lb1 ⊗ In )w̃. By the first equality in (20), it is easy to see that the leaderfollower consensus problem is solved if and only if the consensus error ξ˜ asymptotically converges to zero. By substituting protocol (18) into (1), we can get the closedloop dynamics of the network as follows: ˙ ξ̃ = (IN ⊗ A)ξ˜ + (IN ⊗ BK)ψ̃ − (Lb1 ⊗ B)[βM (η̃) + 1 ⊗ u0 ], ˜ + (Lb1 ⊗ F C)[1 ⊗ (v0 − x0 )], + (IN ⊗ F C)(η̃ − ξ) i = 1, · · · , N, where H(ψ̃ − η̃) , [h(B T S(ψ̃1 − η̃1 ))T , · · · , h(B T S(ψ̃N − η̃N ))T ]T , M (η̃) , [h(B T Qη1 )T , · · · , h(B T QηN )T ]T , and D, ρ are defined as in (4), . Let ζ̃ , η̃ − ξ˜ and ̺˜ , [˜ ̺T1 , · · · , ̺˜TN ]T = ψ̃ − η̃. Then, we obtain ζ̃˙ =[IN ⊗ (A + F C)]ζ̃, ̺˜˙ =[IN ⊗ A + Lb1 (D + ρ) ⊗ F C]˜ ̺ − (Lb1 ⊗ B)(βH(˜ ̺ ) − 1 ⊗ u0 ) (21) + (Lb1 ⊗ F C)(1 ⊗ e0 ), η̇ =[IN ⊗ (A + BK)]η̃ + (IN ⊗ BK)˜ ̺ + (IN ⊗ F C)ζ̃ − (Lb1 ⊗ B)[βM (η̃) + 1 ⊗ u0 ], i = 1, · · · , N, where e0 = ṽ0 − x0 is defined as the state estimation error of the leader. The following result provides a sufficient condition ensuring that the adaptive protocol (18) achieves leader-follower consensus. Theorem 3: Suppose that Assumptions 2 and 3 holds. Then, the leader-follower consensus problem of the agents in (1) can be solved under the adaptive output feedback protocol (18) where K, F , and ρi are designed as in Theorem 1, β is chosen such that β ≥ ω, and Q > 0 satisfies T Q(A + BK) + (A + BK) Q > 0. (22) In addition, each coupling weight di converges to some finite steady-state value. Proof: The convergence of ζ in (21) to zero is obvious. To show the convergence of ̺ in (21), we construct the Lyapunov function candidate V3 = 1 2 N X i=1 gi (2di + ρi )˜ ̺Ti S ̺˜i + 1 2 N X [2gi (di + ρi )˜ ̺Ti S ̺˜˙ i + gi ρi d˙i ] + N X gi d˜i d˜˙i i=1 i=1 ψ̃˙ = [IN ⊗ (A + BK)]ψ̃ + [Lb1 (D + ρ) ⊗ F C](ψ̃ − η̃) − (Lb1 ⊗ B)β[M (η̃) + H(ψ̃ − η̃)] d˙i =˜ ̺Ti C T C ̺˜i , V̇3 = + γeT0 [S(A + F C) + (A + F C)T S]e0 ˜ η̃˙ = (IN ⊗ A)η̃ + (IN ⊗ BK)ψ̃ + (IN ⊗ F C)(η̃ − ξ) − (Lb1 ⊗ B)[βM (η̃) + 1 ⊗ u0 ], d˙i = (ψ̃i − η̃i )T C T C(ψ̃i − η̃i ), where G , diag(g1 , · · · , gN ) is a positive definite matrix such that GLb1 + LbT1 G > 0, d˜i , di − α, α and γ are positive constants to be determined later. Due to the fact that Lb1 is a nonsingular M-matrix, the existence of such a positive definite matrix G is ensured by Lemma 3. Then, it is not difficult to see that V3 is positive definite with respect to the variables ̺˜i , d˜i , and e0 . The time derivative of V3 along the trajectory of (21) is given by N X i=1 ≤˜ ̺T [(D + ρ)G ⊗ (SA + AT S) − λ0 (D + ρ)2 ⊗ C T C + (ρ + D − αIN )G ⊗ C T C]˜ ̺ − γeT0 W e0 − 2̺˜T [(D + ρ)GLb1 ⊗ SB](βH(˜ ̺) − 1 ⊗ u 0 ) − 2̺˜T [(D + ρ)GLb1 ⊗ C T C](1 ⊗ e0 ), (24) where λ0 denotes the smallest eigenvalue of GLb1 + LbT1 G and W , −SA−AT S +2C T C is a positive definite matrix. Using Lemma 4, we then find that λ0 ̺˜T [(ρ + D)G ⊗ C T C]˜ ̺ ≤ ̺˜T [(D + ρ)2 ⊗ C T C]˜ ̺ 3 (25) 3 T 2 + ̺˜ [G ⊗ C T C]˜ ̺, 4λ0 and − 2̺˜T [(D + ρ)GLb1 ⊗ C T C](1 ⊗ e0 ) λ0 T ̺˜ [(D + ρ)2 ⊗ C T C]˜ ̺ ≤ (26) 3 T T b b 3λmax (C C)L2 GGL2 T e0 W e0 . + λ0 λmin (W ) Note that ̺˜Ti SBh(B T S ̺˜i ) = kB T S ̺˜i k, ̺˜Ti SBh(B T S ̺˜j ) ≤ kB T S ̺˜i kkh(B T S ̺˜j )k = kB S ̺˜i k. This leads to −̺˜T [(D+ρ)GLb1 ⊗ SB]βH(˜ ̺) =− N X (di + ρi )gi β ̺˜Ti SB[ai0 h(B T S ̺˜i ) i=1 + N X aij (h(B T S ̺˜i ) − h(B T S ̺˜j ))] (28) j=1 ≤− N X (di + ρi )gi βai0 kB T S ̺˜i k, i=1 where we have used (27) to arrive at the inequality. Noting that Lb1 1 = −Lb2 , we have ̺˜T [(D+ρ)GLb1 ⊗ SB](1 ⊗ u0 ) =− gi d˜2i + γeT0 Se0 , (23) (27) T ≤ N X i=1 N X (di + ρi )gi ai0 ̺˜Ti SBu0 (di + ρi )gi ωai0 kB T S ̺˜i k. i=1 (29) 7 Substituting (25), (26), (28), and (29) into (24) yields V̇3 ≤˜ ̺T [(D + ρ)G ⊗ (SA + AT S) − − (αG − By using Lemma 4, we can get that λ0 (D + ρ)2 ⊗ C T C 3 3 2 G ) ⊗ C T C]˜ ̺ − eT0 W e0 , 4λ0 bT GGL b2 3λmax (C T C)L 2 . λ0 λmin (W ) where we have chosen γ = 1 + selecting 15λmax (G) , α≥ 4λ0 (30) By (31) it follows from Lemma 4 that ̺˜T [( λ0 3 2 G )) ⊗ C T C]˜ ̺ (D + ρ)2 + (αG − 3 4λ0 ≥ ̺˜T [(D + ρ)G ⊗ 2C T C]˜ ̺. (32) (33) V̇3 ≤ − ̺˜T [(D + ρ)G ⊗ W ]˜ ̺ − eT0 W e0 , p Let χ = [˜ ̺T ( (D + ρ)G ⊗ In ), eT0 ]T . Then we can get from (33) that (34) where the last inequality follows directly from the definition of W . As a result, V3 (t) is bounded, and so are ̺˜, e0 and di , which, by the definition of χ, implies that χ is bounded. Since by Assumption 2, u0 is bounded, this implies that ̺˜˙ is bounded, which further implies that χ̇ is bounded. Since V3 (t) is nonincreasing and bounded from below by zero, it has a finite limit V3∞ as t → ∞. Integrating the first inequality of (34), we obtain Z ∞ χT (IN +1 ⊗ W )χdt ≤ V3 (0) − V3∞ . R∞ 0 Thus, 0 χT (IN +1 ⊗ W )χdt exists and is finite. In view of the fact that both χ and χ̇ are bounded, it is straightforward to see that 2χT (IN +1 ⊗ W )χ̇ is also bounded, which in turn ensures the uniform continuity of χT (IN +1 ⊗W )χ. Therefore, by Barbalat’s Lemma [32], we can establish that χT (IN +1 ⊗ W )χ → 0 as t → ∞. Noting that χT (IN +1 ⊗ W )χ → 0 equals to χ → 0 and thereby ̺˜ asymptotically converges to zero. Noting that d˙i ≥ 0, the boundedness of di implies that each coupling weight di converges to some finite value. Next, we show the convergence of η̃ in (21). Consider the following Lyapunov function candidate: V4 =η̃ T (IN ⊗ Q)η̃ + γ1 ζ̃ T (IN ⊗ S)ζ̃ + γ2 V3 , (35) where γ1 and γ2 are positive constants to be determined later. Since Q and S are positive definite, it is easy to see that V4 is also positive definite with respect to η̃, ζ̃, ̺˜i , d˜i , and e0 . The time derivative of V4 along the trajectory of (21) is given by V̇4 =η̃ T [IN ⊗ (Q(A + BK) + (A + BK)T Q)]η̃ + 2η̃ T (IN ⊗ QBK)˜ ̺ + 2η̃ T (IN ⊗ QF C)ζ̃ − 2η̃ T (Lb1 ⊗ QB)(βM (η̃) + 1 ⊗ u0 ) + γ2 V̇3 T T + γ1 ζ̃ [IN ⊗ (S(A + F C) + (A + F C) S)]ζ̃. where we have used the fact that D − I > 0 and chosen 4λ2max (QF C) , λmin (X)λmin (W ) 4λ2max (Γ) γ2 ≥ . λmin (X)λmin (G)λmin (W ) γ1 ≥ Substituting (32) into (30) gives V̇3 ≤ −χT (IN +1 ⊗ W )χ ≤ 0, 4λ2 (Γ) T 1 T η̃ (IN ⊗ X)η̃ + max ̺˜ ̺˜, 4 λmin (X) 4λ2 (QF C) T 1 ζ̃ ζ̃, 2η̃ T (IN ⊗ QF C)ζ̃ ≤ η̃ T (IN ⊗ X)η̃ + max 4 λmin (X) (37) where X = −(QA + AT Q − 2Γ) is a positive definite matrix and Γ = QBB T Q. Substituting (33) and (37) into (36), we obtain that 1 V̇4 ≤ − η̃ T [IN ⊗ X]η̃ 2 (38) − 2η̃ T (Lb1 ⊗ QB)(βM (η̃) + 1 ⊗ u0 ), 2η̃ T (IN ⊗ QBK)˜ ̺≤ (36) (39) Similarly as in (28) and (29), we can show that −2η̃ T (Lb1 ⊗ QB)(βM (η̃) + 1 ⊗ u0 ) ≤ 0. Thus, we follows from (38) that 1 V̇4 ≤ − η̃ T [IN ⊗ X]η̃ ≤ 0. 2 Therefore, V4 is bounded and so is η̃. By following the same steps in showing the convergence of ̺˜, we are able to obtain that η̃ asymptotically converges to zero, which, in virtue of the definitions of ζ̃ and η̃, further implies that the consensus error ξ asymptotically converges to zero. That is, the leader-follower consensus problem is solved.  Compared to the adaptive protocol (2) for the leaderless case in the previous section, the adaptive protocol (18) contains the nonlinear components h(B T S ̺˜i ) and h(B T Qη̃i ), which are included to deal with the effect of the leader’s nonzero control input. When the leader’s control input u0 = 0, the adaptive protocol (18) with the nonlinear components removed reduces to ṽ˙ i = Aṽi + Bui + F (C ṽi − yi ), w̃˙ i = Awi + Bui + (di + ρi )F C(ψ̃i − η̃i ) + F (C ṽi − yi ), ui = K w̃i , d˙i = (ψi − η̃i )T C T C(ψ̃i − η̃i ), i = 1, · · · , N. (40) Evidently, as a direct consequence of Theorem 3, the adaptive protocol (40) with parameters given as in Theorem 3 can achieve leader-follower consensus for the agents in (1) with u0 = 0, provided that the communication graph satisfies Assumption 3. For the special case where the relative state information among neighboring agents is available, we can present the following state feedback adaptive protocol: ui = (di + ρi )K ξ̃i − βh(B T P −1 ξ˜i ), (41) d˙i = ξ̃iT Ωξ˜i , i = 1, · · · , N, where ξ˜i is defined as in (20) and P > 0 is a solution to the LMI (16). 8 Corollary 1: Suppose that Assumptions 2 and 3 hold. Then, the leader-follower consensus problem of the agents in (1) can be solved by the adaptive protocol (41) with K, Ω, ρi designed as in Theorem 2 and β ≥ ω. Proof: Consider the following Lyapunov function candidate: V5 = N X 1 i=1 2 positive constants, and the rest of the variables are defined as in (18). Note that di (0) ≥ 1 and d˙i ≥ 0 when di = 1 in (44). Then, it is not difficult to see that di (t) ≥ 1 for any t > 0. By substituting the adaptive protocol (44) into (1), we can get the closed-loop dynamics of the network as ˙ ζ̃ =[IN ⊗ (A + F C)]ζ̃, ̺˜˙ =[IN ⊗ A + Lb1 (D + ρ) ⊗ F C]˜ ̺ b − (L1 ⊗ B)[β H̃(˜ ̺) − 1 ⊗ u 0 ] N gi (2di + ρi )ρi + 1 X ˜2 gi di , 2 i=1 (42) where λ0 is defined as in (24) and the rest of the variables are the same as in (23). Then, by following similarly steps in (G) , we can the proof of Theorem 3 and selecting α ≥ 5λmax 2λ0 obtain that the derivative of V5 satisfies V̇5 ≤ − ξ˜T [(D + ρ)G ⊗ (P −1 A + AT P −1 − 2P −1 BB T P −1 )]ξ˜ ≤0. The convergence of the consensus error ξ̃ can be established by the Barbalat’s lemma. The details are omitted here for conciseness.  B. Continuous Adaptive Consensus Protocols Note that the nonlinear function h(·) in the adaptive protocols (18) and (41) is discontinuous. In practical implementation, this discontinuity may result in chattering due to imperfections in switching devices [34], [35]. One feasible approach to eliminate chattering is to use the boundary layer technique [34], [35] to give a continuous approximation of the discontinuous function h(·); in other words, we may replace h(·) by a continuous function h̃i (·), defined such that for z ∈ Rn , ( z if kzk > κi , h̃i (z) = kzk (43) z if kzk ≤ κi , κi where κi is a small positive constant, denoting the width of the boundary layer of the protocol corresponding to the i-th follower. As κi → 0, the continuous function h̃i (·) approaches the discontinuous function h(·). It is worth noting that using this continuous adaptive protocol with h(·) replaced by h̃i (·), the consensus error ξ˜ will in general not converge to zero but some small nonzero ξ˜ may result. In this case, it can be observed from the last equation in (18) that the adaptive gains di (t) will slowly grow unbounded. To tackle this problem, we use the so-called σ-modification technique [36] to modify the adaptive protocol (18). Using the boundary layer concept and the σ-modification technique, we propose a new distributed continuous adaptive consensus protocol to each follower as follows: ṽ˙ i =Aṽi + Bui + F (C ṽi − yi ), w̃˙ i =Aw̃i + B[ui − β h̃i (B T S(ψ̃i − η̃i ))] + (di + ρi )F C(ψ̃i − η̃i ) + F (C ṽi − yi ), + (Lb1 ⊗ F C)(1 ⊗ e0 ), (45) η̃˙ =[IN ⊗ (A + BK)]η̃ + (IN ⊗ BK)˜ ̺ b + (IN ⊗ F C)ζ̃ − (L1 ⊗ B)[β M̃ (η̃) + 1 ⊗ u0 ], d˙i = − ϕi (di − 1) + ̺˜Ti C T C ̺˜i , i = 1, · · · , N, e ̺) where H(˜ = [h̃1 (B T S ̺˜1 )T , · · · , h̃N (B T S ̺˜N )T ]T , T T f M (η̃) = [h̃1 (B Qη̃1 ) , · · · , h̃N (B T Qη̃N )T ]T , and the rest of the variables are defined as in (21). Theorem 4: Suppose that Assumptions 2 and 3 hold. Then, the consensus error ξ˜ of (45) and the adaptive gains di , i = 1, · · · , N, are uniformly ultimately bounded under the adaptive protocol (44) with β, K, F , and Q designed as in Theorem 3. Moreover, ξ˜ converges exponentially to the residual set ( N 2 X 1 ˜ 2 < γ2 (α − 1) D , ξ˜ : kξk ϕi gi + 2λmin (Q)δ i=1 λmin (Q)δ × N X ) [γ2 Πi + (ωai0 + (2N − 1)β)κi ] , i=1 (46) where α is defined as in (31), Πi =gi (ωai0 + (2N − 1)β)κi (47) 1 λmax (S) +( + )(ωai0 + (2N − 1)β)2 κ2i gi . ϕi 2λmin (W ) and δ = min{ λmin (W ) ϕi λmin (X) λmin (W ) , , , }, (48) 2λmax (Q) γ1 λmax (S) 2γ2 λmax (S) 4 with γ1 and γ2 defined in (39), W defined in (24), X and Γ defined in (37). Proof: Consider the Lyapunov function V3 as in (23). The time derivative of V3 along (45) is given by V̇3 ≤˜ ̺T [(D + ρ)G ⊗ (SA + AT S) − λ0 (D + ρ)2 ⊗ C T C + (ρ + D − αIN )G ⊗ C T C]˜ ̺ − γeT0 W e0 e ̺ ) − 1 ⊗ u0 ] − ̺˜T [(D + ρ)GLb1 ⊗ SB][β H(˜ − 2̺˜T [(D + ρ)GLb1 ⊗ C T C](1 ⊗ e0 ) − N X i=1 ϕi gi (di − 1)d˜i , ui =K[w̃i − β h̃i (B T Qη̃i )], (49) T T ˙ where λ and W are defined as in (24). Note that di = − ϕi (di − 1) + (ψ̃i − η̃i ) C C(ψ̃i − η̃i ), i = 1, · · · , N, 0 (44) 1 1 −(di − 1)d˜i = −d˜2i − (α − 1)d˜i ≤ − d˜2i + (α − 1)2 , where di (t) denotes the time-varying coupling weight asso2 2 ciated with the i-th follower with di (0) ≥ 1, ϕi are small (50) 9 and Then, it follows from (52) and (56) that −(di − 1)d˜i = −(di − 1)2 + (α − 1)(di − 1) (51) 1 1 ≤ − (di − 1)2 + (α − 1)2 . 2 2 Substituting (25), (26), (32), (50), and (51) into (49), we can obtain that V̇3 ≤ − ̺˜T [(D + ρ)G ⊗ W ]˜ ̺ − eT0 W e0 + N 2 X (α − 1) 2 ϕi gi − N X ϕi gi i=1 i=1 4 [(di − 1)2 + d˜2i ] (52) 1 ̺ − eT0 W e0 V̇3 ≤ − ̺˜T [(D + ρ)G ⊗ W ]˜ 2 N N N X X ϕi gi ˜2 (α − 1)2 X − ϕi gi + Πi . di + 4 2 i=1 i=1 i=l+1 Therefore, by analyzing the above three cases, we get that V̇3 satisfies (55) for all ̺˜ ∈ RN n . Next, consider the Lyapunov function V4 in (35). Similar to the discussion of three cases above, we have that e ̺) − 1 ⊗ u0 ). − ̺˜T [(D + ρ)GLb1 ⊗ SB](β H(˜ f(η̃) + 1 ⊗ u0 ) − 2η̃ T (Lb1 ⊗ QB)(β M Consider the following three cases. i) kB T S ̺˜i k > κi , i = 1, · · · , N . In this case, as shown in (28), we can get that e ̺) − ̺˜ [(D + ρ)GLb1 ⊗ SB]β H(˜ ≤ ≤− (di + ρi )gi βai0 kB T S ̺˜i k. (53) i=1 Substituting (29) and (53) into (52) yields V̇3 ≤ − ̺˜T [(D + ρ)G ⊗ W ]˜ ̺ − eT0 W e0 − N X ϕi gi i=1 T N (α − 1)2 X ϕi gi . [(di − 1)2 + d˜2i ] + 4 2 i=1 1 V̇4 ≤ − η̃ T (IN ⊗ X)η̃ − ζ̃ T (IN ⊗ W )ζ̃ 2 1 − ̺˜T [(D + ρ)G ⊗ W ]˜ ̺ − γ2 eT0 W e0 2 N N X ϕi gi ˜2 γ2 (α − 1)2 X ϕi gi di + − γ2 4 2 i=1 i=1 + ≤ ≤ i=1 N X (di + ρi )gi (ωai0 + (2N − 1)β)kB T S ̺˜i k i=1 ≤ (di + ρi )gi (ωai0 + (2N − 1)β)κi i=1 (54) N N X X ϕi gi λmin (W ) Πi (di − 1)2 + gi ρ2i + 4 2λmax (S) i=1 i=1 N X ϕi gi N X 1 Πi , (di − 1) + ̺˜T (ρG ⊗ W )˜ ̺+ 4 2 i=1 where we have used Lemma 4 to get the third inequality and Πi is defined as in (47). Substituting (54) into (52) yields 1 V̇3 ≤ − ̺˜T [(D + ρ)G ⊗ W ]˜ ̺ − eT0 W e0 2 N N N X X ϕi gi ˜2 (α − 1)2 X Πi . ϕi gi + di + − 4 2 i=1 i=1 i=1 (55) iii) ̺˜ satisfies neither Case i) nor Case ii). Without loss of generality, assume that kB T S ̺˜i k > κi , i = 1, · · · , l, and kB T S ̺˜i k ≤ κi , i = l + 1, · · · , N , where 2 ≤ l ≤ N − 1. By combining (53) and (54), in this case we can get that N X (56) ϕi gi λmin (W ) ≤ [ (di − 1)2 + gi ρ2i + Πi ]. 4 2λmax (S) i=l+1 1 V̇4 ≤ − δV4 + δV4 − η̃ T (IN ⊗ X)η̃ − ζ̃ T (IN ⊗ W )ζ̃ 2 N X ϕi gi ˜2 1 d ̺ − γ2 eT0 W e0 − γ2 − ̺˜T [(D + ρ)G ⊗ W ]˜ 2 4 i i=1 + 2 e ̺) − 1 ⊗ u 0 ) −̺˜T [(D + ρ)GLb1 ⊗ SB](β H(˜ [γ2 Πi + (ωai0 + (2N − 1)β)κi ]. Furthermore, we rewrite (58) into i=1 N X N X (58) i=1 e ̺) − 1 ⊗ u 0 ) −̺˜T [(D + ρ)GLb1 ⊗ SB](β H(˜ ≤ (57) By using (37), (55), and (57), we can obtain the time derivative of V4 along (21) as ii) kB S ̺˜i k ≤ κi , i = 1, · · · , N . In this case, it follows from (29) and (43) that N X [ωai0 + (2N − 1)β]κi . i=1 T N X N X N X γ2 (α − 1)2 [ ϕi gi + γ2 Πi + (ωai0 + (2N − 1)β)κi ] 2 i=1 1 ≤ − η̃ T [IN ⊗ (X − 2δQ)]η̃ − ζ̃ T [IN ⊗ (W − γ1 δS)]ζ̃ 2 1 T ̺ − γ2 eT0 (W − δS)e0 − ̺˜ [(D + ρ)G ⊗ (W − 2γ2 δS)]˜ 2 N N X ϕi γ2 (α − 1)2 X ( − δ)gi d˜2i + − γ2 ϕi gi 4 2 i=1 i=1 + N X [γ2 Πi + (ωai0 + (2N − 1)β)κi ] − δV4 , i=1 (59) where δ is defined as in (48). By the definition of δ, it follows from (59) that V̇4 ≤ − δV4 + + N X N γ2 (α − 1)2 X ϕi gi 2 i=1 (60) [γ2 Πi + (ωai0 + (2N − 1)β)κi ]. i=1 In light of Lemma 5, we can deduce from (60) that V6 10 exponentially converges to the residual set ( N γ2 (α − 1)2 X D1 , V4 : V4 < ϕi gi 2δ i=1 ) N 1X [γ2 Πi + (ωai0 + (2N − 1)β)κi ] + δ i=1 (61) with a convergence rate faster than e−δtP . Since V4 ≥ N λmin (Q)kη̃k2 + min gi γ2 (λmin (S)k̺˜k2 + 12 i=1 d˜2i ), it follows from (61) that η̃, ̺˜, and di are uniformly ultimately bounded. Moreover, since ζ̃ asymptotically converges to zero, we can obtain that η̃ and thereby ξ˜ exponentially converges to the residual set D with a convergence rate faster than e−δt . For the special case where the relative states among neighboring agents are available, the discontinuous state feedback adaptive protocol (41) can be modified to be ui = (di + ρi )K ξ̃i − β h̃i (B T P −1 ξ̃i ), d˙i = −ϕi (di − 1) + ξ˜iT Ωξ˜i , i = 1, · · · , N, (62) where h̃i (·) is defined as in (43) and ϕi are small positive constants. Corollary 2: Suppose that Assumptions 2 and 3 hold. Then, the consensus error ξ˜ and the adaptive gains di , i = 1, · · · , N, are uniformly ultimately bounded under the adaptive protocol (62) with K, Ω, ρi , and β designed as in Corollary 1. Moreover, ξ˜ converges exponentially to the residual set ( ) N X 1 1 2 2 ˜ < [ (α − 1) ϕi gi + Π̃i ] , D̃ , ξ̃ : kξk λmin (P −1 )δ̃ i=1 2 (63) λmin (X̃) ϕi where α is defined as in (42), δ̃ = min{ 2λmax (P −1 ) , 4 }, and the boundary layer widths κi . In practice, we can choose ϕi and κi to be relatively small in order to guarantee a small consensus error ξ. Remark 5: Compared to the previous related works [21], [14], [25], which are applicable to only undirected subgraphs among the followers, the results in this section solve the distributed tracking problem in the presence of a leader with nonzero control input for general directed graphs. It should be noted that even though no global information of the communication graph is needed in the adaptive protocols, the upper bound of the leader’s control input is nonetheless required. This latter requirement appears to be a limitation of the present adaptive protocols, albeit a modest one. V. S IMULATION E XAMPLES In this section, we present numerical simulations to illustrate the effectiveness of the preceding theoretical results. Example 1: Consider a network of second-order integrators, described by (1), with         0 1 0 xi1 , A= , B= xi = , C= 1 0 . 0 0 xi2 1 The communication graph is given as in Fig. 1, which is strongly connected. It is worth noting that for second-order integrators with directed graphs, determining the parameters in existing linear consensus protocols generally requires the Lapalican matrix’s nonzero eigenvalues [9], [37]. Therefore, we will use the adaptive protocol (2) to solve the consensus problem. 1 Π̃i =gi (ωai0 + (2N − 1)β)κi λmax (P −1 ) 1 +( + )(ωai0 + (2N − 1)β)2 κ2i gi . ϕi 2λmin (X̃) with P defined in (16), X̃ = −(P −1 A + AT P −1 − 2Ω), and Ω defined in Theorem 2. Proof: Consider the Lyapunov function V5 in (42). By following similarly steps in the proof of Theorem 4, we can obtain that N X ϕi gi ˜2 1 d V̇5 ≤ − ξ˜T [(D + ρ)G ⊗ X̃]ξ˜ − 2 4 i i=1 N N X (α − 1)2 X + Π̃i . ϕi gi + 2 i=1 i=1 6 2 5 3 4 Fig. 1. A strongly connected directed communication graph. (64) The upper bound of the consensus error ξ̃ can be obtained by following the last part of the proof of Theorem 4. The details are omitted here for conciseness.  Remark 4: It is worth mentioning that implementing the σmodification technique to add −ϕi (di − 1) into (44) or (62) and using the boundary layer concept to derive continuous functions h̃i play a vital role to guarantee the ultimate boundedness of the consensus error ξ̃ and the adaptive gains di . We can observe from (46) and (63) that the upper bounds of the consensus error ξ˜ depend on the σ-modification parameters ϕi   Select K = − 0.8543 2.5628 such that A + BK is Hurwitz. Solving the LMI (8) by usingthe LMI toolbox of Matlab,  0.5853 −0.5853 we obtain a feasible solution S = . The −0.5853 1.7559   2.5628 feedback gain matrix of (2) is given by F = − . Let 0.8543 di (0) = 1, i = 1, · · · , 6. Then, with the adaptive protocol (2), the relative states xi − x1 , i = 2, · · · , 6, of the secondorder integrators are depicted in Fig. 2. Evidently, consensus is achieved. The adaptive coupling weights di in (2) are shown in Fig. 3, which converge to finite steady-state values. Example 2: Consider a network of heterogeneous agents consisting of a leader and several followers. Let the leader be a 11 The followers are three-order linear systems, described by (1), with A and B given in (65). The communication graph among the agents are depicted in Fig. 4, where the node indexed by 0 is the leader. For simplicity, it is assumed that the relative state information of neighboring agents is available and the continuous adaptive protocol (62) is used to achieve leader-follower consensus. Solving the linear matrix  in0.2403 −0.1467 −0.3444 0.0332  . equality (16) gives P = −0.1467 0.1459 −0.3444 0.0332 2.8821 The feedback gain matrices of (62), accordingly, is ob  2.8843 3.1711 1.5114 tained as K = − and Γ =   8.3194 9.1465 4.3594 9.1465 10.0558 4.7928 . The initial state of the leader 4.3594 4.7928 2.2843 is chosen as x0 (0) = [1, 0.8, −1.5]T and the initial states of the agents are randomly chosen. Select β = 10, κ = 0.05, and ϕi = 0.02 in (62). The state trajectories xi (t) of the agents under (62), designed as above, are depicted in Fig. 5, demonstrating that leader-follower consensus is indeed achieved. The adaptive gains di in (44) are shown in Fig. 6, which are clearly bounded. 6 5 4 xi−x1 3 2 1 0 −1 −2 0 5 10 15 20 t (s) 25 30 35 40 Fig. 2. The consensus errors xi − x1 , i = 2, · · · , 6 under (2). 1.5 1.45 1.4 1.35 di 1.3 1.25 1.2 1.15 1.1 1.05 1 0 5 10 15 20 t (s) 25 30 35 40 Fig. 3. The adaptive gains di in (2). 8 4 6 3 4 2 xi2 i1 2 x nonlinear Chua’s circuit, whose dynamics in the dimensionless form are given by [38] 1 0 0 −2 ẋ0 = Ax0 + Bf0 (x0 ), (65) −1 −4 −6 0 10 20 30 40 −2 50 0 10 20 t 30 40 50 t where 10       x01 −a(m10 + 1) a 0 1 1 −1 1 , B = 0 , x0 = x02  , A =  x03 0 −b 0 0 a 1 f0 (x0 ) = (m0 − m20 )(|x01 + 1| − |x01 − 1|), 2 5 xi3 0 −5 −10 −15 with a > 0, b > 0, m10 < 0, and m20 < 0 being the parameters of Chua’s circuits. Let a = 9, b = 18, m10 = − 34 , and m20 = − 43 . In this case, the leader displays a double-scroll chaotic attractor [38]. The nonlinear term f0 (x0 ) in (65) is regarded as the control input of the leader, which is bounded. 0 10 20 30 40 50 t Fig. 5. The state trajectories of the leader and the followers under the adaptive protocol (62). 3.5 0 1 6 3 di 2.5 2 5 2 1.5 1 3 0 10 20 Fig. 6. The adaptive gains di in (62). Fig. 4. A leader-follower graph containing a directed spanning tree. 30 t 4 40 50 12 VI. C ONCLUSION In this paper, we have addressed the distributed output feedback consensus protocol design problem for linear multiagent systems with directed graph. One main contribution of this paper is that a new SOD method has been introduced to derive distributed adaptive output feedback consensus protocols, which can solve the leaderless consensus problem for linear multi-agent systems with general directed graphs and the leader-follower consensus problem for the case with a leader of bounded control input. The adaptive output feedback protocols for the leaderless case are independent of any global information of the communication graph, and thereby are fully distributed. It should be mentioned that the adaptive output feedback protocols for the leader-follower case require the upper bound of the leader’s control input. This issue will be addressed in our future works. Another future direction is to consider the case where the agents are non-introspective, i.e., having access to only the relative output information respect to their neighbors. R EFERENCES [1] W. Ren, R. Beard, and E. Atkins, “Information consensus in multivehicle cooperative control,” IEEE Control Systems Magazine, vol. 27, no. 2, pp. 71–82, 2007. [2] G. Antonelli, “Interconnected dynamic systems: An overview on distributed control,” IEEE Control Systems Magazine, vol. 33, no. 1, pp. 76– 88, 2013. [3] R. Olfati-Saber and R. Murray, “Consensus problems in networks of agents with switching topology and time-delays,” IEEE Transactions on Automatic Control, vol. 49, no. 9, pp. 1520–1533, 2004. [4] W. Ren and R. Beard, “Consensus seeking in multiagent systems under dynamically changing interaction topologies,” IEEE Transactions on Automatic Control, vol. 50, no. 5, pp. 655–661, 2005. [5] Z. Li, Z. Duan, G. Chen, and L. Huang, “Consensus of multiagent systems and synchronization of complex networks: A unified viewpoint,” IEEE Transactions on Circuits and Systems I: Regular Papers, vol. 57, no. 1, pp. 213–224, 2010. [6] Y. Cao, W. Yu, W. Ren, and G. Chen, “An overview of recent progress in the study of distributed multi-agent coordination,” IEEE Transactions on Industrial Informatics, vol. 9, no. 1, pp. 427–438, 2013. [7] W. Ren and R. W. Beard, Distributed Consensus in Multi-vehicle Cooperative Control. Communications and Control Engineering, London: Springer-Verlag, 2008. [8] Z. Li and Z. Duan, Cooperative Control of Multi-Agent Systems: A Consensus Region Approach. Boca Raton, FL: CRC Press, 2014. [9] W. Ren, “On consensus algorithms for double-integrator dynamics,” IEEE Transactions on Automatic Control, vol. 53, no. 6, pp. 1503–1509, 2008. [10] W. Ren, K. Moore, and Y. Chen, “High-order and model reference consensus algorithms in cooperative control of multivehicle systems,” ASME Journal of Dynamic Systems, Measurement, and Control, vol. 129, no. 5, pp. 678–688, 2007. [11] H. Zhang, F. Lewis, and A. Das, “Optimal design for synchronization of cooperative systems: State feedback, observer, and output feedback,” IEEE Transactions on Automatic Control, vol. 56, no. 8, pp. 1948–1952, 2011. [12] J. Seo, H. Shim, and J. Back, “Consensus of high-order linear systems using dynamic output feedback compensator: Low gain approach,” Automatica, vol. 45, no. 11, pp. 2659–2664, 2009. [13] W. Yu, G. Chen, M. Cao, and J. Kurths, “Second-order consensus for multiagent systems with directed topologies and nonlinear dynamics,” IEEE Transactions on Systems, Man, and Cybernetics, Part B: Cybernetics, vol. 40, no. 3, pp. 881–891, 2010. [14] Z. Li, W. Ren, X. Liu, and L. Xie, “Distributed consensus of linear multiagent systems with adaptive dynamic protocols,” Automatica, vol. 49, no. 7, pp. 1986–1995, 2013. [15] Z. Li, W. Ren, X. Liu, and M. Fu, “Consensus of multi-agent systems with general linear and Lipschitz nonlinear dynamics using distributed adaptive protocols,” IEEE Transactions on Automatic Control, vol. 58, no. 7, pp. 1786–1791, 2013. [16] H. Su, G. Chen, X. Wang, and Z. Lin, “Adaptive second-order consensus of networked mobile agents with nonlinear dynamics,” Automatica, vol. 47, no. 2, pp. 368–375, 2011. [17] W. Yu, W. Ren, W. X. Zheng, G. Chen, and J. Lü, “Distributed control gains design for consensus in multi-agent systems with second-order nonlinear dynamics,” Automatica, vol. 49, no. 7, pp. 2107–2115, 2013. [18] Z. Li, G. Wen, Z. Duan, and W. Ren, “Designing fully distributed consensus protocols for linear multi-agent systems with directed graphs,” IEEE Transactions on Automatic Control, vol. 60, no. 4, pp. 1152–1157, 2015. [19] Y. Lv, Z. Li, Z. Duan, and G. Feng, “Novel distributed robust adaptive consensus protocols for linear multi-agent systems with directed graphs and external disturbances,” Automatica, submitted for publication, 2014. [20] Z. Li and Z. Ding, “Distributed adaptive consensus and output tracking of unknown linear systems on directed graphs,” Automatica, vol. 55, pp. 12–18, 2015. [21] Y. Cao and W. Ren, “Distributed coordinated tracking with reduced interaction via a variable structure approach,” IEEE Transactions on Automatic Control, vol. 57, no. 1, pp. 33–48, 2012. [22] J. Mei, W. Ren, and G. Ma, “Distributed coordinated tracking with a dynamic leader for multiple Euler-Lagrange systems,” IEEE Transactions on Automatic Control, vol. 56, no. 6, pp. 1415–1421, 2011. [23] J. Mei, W. Ren, and G. Ma, “Distributed containment control for lagrangian networks with parametric uncertainties under a directed graph,” Automatica, vol. 48, no. 4, pp. 653–659, 2012. [24] Z. Meng, Z. Lin, and W. Ren, “Leader-follower swarm tracking for networked lagrange systems,” Systems & Control Letters, vol. 61, no. 1, pp. 117–126, 2012. [25] Z. Li, X. Liu, W. Ren, and L. Xie, “Distributed tracking control for linear multi-agent systems with a leader of bounded unknown input,” IEEE Transactions on Automatic Control, vol. 58, no. 2, pp. 518–523, 2013. [26] J. Mei, W. Ren, and J. Chen, “Consensus of second-order heterogeneous multi-agent systems under a directed graph,” in The 2014 American Control Conference, pp. 802–807, 2014. [27] H. Zhang, F. L. Lewis, and Z. Qu, “Lyapunov, adaptive, and optimal design techniques for cooperative systems on directed communication graphs,” IEEE Transactions on Industrial Electronics, vol. 59, no. 7, pp. 3026–3041, 2012. [28] D. S. Bernstein, Matrix Mathematics: Theory, Facts, and Formulas. Princeton University Press, 2009. [29] J. Slotine and W. Li, Applied nonlinear control. Englewood Cliffs, NJ: Prentice Hall, 1991. [30] T. Yang, A. Saberi, A. A. Stoorvogel, and H. F. Grip, “Output consensus for networks of non-identical introspective agents,” in The 50th IEEE Conference on Decision and Control and European Control Conference, pp. 1286–1292, 2011. [31] E. Peymani, H. F. Grip, A. Saberi, X. Wang, and T. I. Fossen, “H∞ almost output synchronization for heterogeneous networks of introspective agents under external disturbances,” Automatica, vol. 50, no. 4, pp. 1026–1036, 2014. [32] H. Khalil, Nonlinear Systems. Englewood Cliffs, NJ: Prentice Hall, 2002. [33] S. E. Tuna, “LQR-based coupling gain for synchronization of linear systems,” arXiv preprint arXiv:0801.3390, 2008. [34] K. Young, V. Utkin, and U. Ozguner, “A control engineer’s guide to sliding mode control,” IEEE Transactions on Control Systems Technology, vol. 7, no. 3, pp. 328–342, 1999. [35] C. Edwards and S. Spurgeon, Sliding Mode Control: Theory and Applications. London: Taylor & Francis, 1998. [36] P. Ioannou and P. Kokotovic, “Instability analysis and improvement of robustness of adaptive control,” Automatica, vol. 20, no. 5, pp. 583–594, 1984. [37] S. Tuna, “Conditions for synchronizability in arrays of coupled linear systems,” IEEE Transactions on Automatic Control, vol. 54, no. 10, pp. 2416–2420, 2009. [38] R. Madan, Chua’s circuit: a paradigm for chaos. Singapore: World Scientific, 1993.
3cs.SY
1 Adaptive Modular Exponentiation Methods v.s. Python’s Power Function arXiv:1707.01898v1 [cs.DS] 6 Jul 2017 Shiyu Ji, Kun Wan {shiyu,kun}@cs.ucsb.edu Department of Computer Science University of California Santa Barbara Abstract—In this paper we use Python to implement two efficient modular exponentiation methods: the adaptive m-ary method and the adaptive sliding-window method of window size k, where both m’s are adaptively chosen based on the length of exponent. We also conduct the benchmark for both methods. Evaluation results show that compared to the industry-standard efficient implementations of modular power function in CPython and Pypy, our algorithms can reduce 1-5% computing time for exponents with more than 3072 bits. Algorithm 1: Left-to-right m-ary exponentiation 1 2 3 4 5 6 I. I NTRODUCTION 7 In cryptography, it is particularly important to compute exponentiation of large base and exponent efficiently. The standard of RSA recommends the primes should have bit-length of at least 2048, and modular exponentiation is intensively used in RSA encryption and decryption. In general large integers can give better security and it is worth researching on highly efficient modular exponentiation algorithms for cryptographic large integers. In this paper we focus on the use of script languages like Python not only because more and more cryptographic libraries are implemented in script languages, but also since Python has one of the most efficient libraries of built-in scientific computing functions. Any improvement on the performance of the built-in functions in Python would be beneficial to numerous applications, especially in the fields such as cryptography, natural language processing and machine learning. Thus it is worth checking if there is any space to improve. In Python 2, we implement two adaptive modular exponential methods: m-ary [5], [3] and sliding window of size m [5], [4]. Both the algorithms can adaptively choose the parameter m with the goal to minimize the number of multiplications between large integers. To argue that both the methods can be efficiently deployed up to industry standard, we choose CPython and Pypy’s built-in power functions as the baselines for comparison. Our experiment results show that for large exponents (e.g., 4096-bit), our methods can reduce the baseline running time by about 5%. 8 II. A DAPTIVE m- ARY M ETHOD This section will present the motivation and details of our adaptive m-ary method. Recall the left-to-right m-ary exponentiation (14.82 in [5]) as Algorithm 1. In the precomputation (lines 3 to 6), we need 9 10 11 12 13 14 Take as input the modulus N , the base g and the exponent e, and we are supposed to compute g e mod N Parse e as (et et−1 · · · e1 e0 ) where each ei takes m bits g0 ← 1 for i from 2 to 2m − 1 do gi ← gi−1 · g mod N end A ← get for i from t − 1 down to 0 do for j from 1 to m do A ← A · A mod N end A ← A · gei mod N end Return A. m 2m − 2 multiplications to compute g 2 , · · · , g 2 −1 . In the iteration from line 7 to 11, we have tm = k − m times of squaring (line 10), where k = (t + 1)m is the bit-length of exponent e, and in average (1 − 2−m )t times of multiplication on line 12. Hence in average the number of multiplications is given as follows. T (k, m) = 2m − 2 + k − m + (1 − 2−m ) k−m . m The reasoning above follows the similar lines given by [4], [3], which also presented a similar equation. An interesting fact of T (k, m) is that there always exists an positive integer m∗ that minimizes T (k, m) for any positive integer k, since T (k, m) is convex on m for any k (see Appendix for the proof). Moreover, for any k the minimizer m∗ satisfies T (k, m∗ ) ≤ T (k, m∗ + 1) by convexity of T (k, m). It turns out the minimizers m∗ are usually small, i.e., less than 10. Hence it is easy to find m∗ given any k. Table I gives the minimizers for different k’s. Since multiplication between large integers with thousands of bits is expensive, we leverage the minimizers to reduce the multiplication times as many as possible. This gives rise to our adaptive m-ary method. Algorithm 2 gives the detailed procedure, where m-aryExp(g, e, N ) denotes the m-ary method to compute g e mod N . 2 k m∗ k m∗ 1-5 1 369-1043 5 6-34 2 1044-2822 6 35-121 3 2823-7370 7 122-368 4 73718 TABLE I T HE MINIMIZERS m∗ GIVEN BIT- LENGTH k OF THE EXPONENT. Algorithm 2: Adaptive m-ary exponentiation 1 2 3 4 5 6 7 8 9 10 Take as input the modulus N , the base g and the exponent e, and we are supposed to compute g e Let k be the bit-length of e If k < 6, return 1-aryExp(g, e, N ) If k < 35, return 2-aryExp(g, e, N ) If k < 122, return 3-aryExp(g, e, N ) If k < 369, return 4-aryExp(g, e, N ) If k < 1044, return 5-aryExp(g, e, N ) If k < 2823, return 6-aryExp(g, e, N ) If k < 7371, return 7-aryExp(g, e, N ) return 8-aryExp(g, e, N ). III. A DAPTIVE S LIDING -W INDOW M ETHOD OF W INDOW S IZE m This section will present the motivation and details of our adaptive sliding-window method of window size m. Algorithm 3: Left-to-right sliding-window exponentiation with window size m 1 Take as input the modulus N , the base g and the exponent e, and we are supposed to compute g e mod N 2 Parse e as (et et−1 · · · e1 e0 ) where each ei is one bit 2 3 g1 ← g mod N , g2 ← g mod N m−1 4 for i from 1 to 2 − 1 do 5 g2i+1 ← g2i−1 · g2 mod N 6 end 7 A ← 1, i ← t 8 while i ≥ 0 do 9 if ei = 0 then 10 A ← A · A, i ← i − 1 11 end 12 Find the longest bitstring ei ei−1 · · · eℓ s.t. i − ℓ + 1 ≤ m and eℓ = 1 13 for j from 1 to i − ℓ + 1 do 14 A←A·A 15 end 16 A ← A · gei ei−1 ···eℓ 17 i←ℓ−1 18 end 19 Return A. Recall the left-to-right sliding-window exponentiation of window size m (14.85 in [5]) as Algorithm 3. In the precomputation (lines 3 to 6), we need 2m−1 multiplications to compute all the necessary powers of g. In the iteration from line 9 to 14, we have k times of squaring (lines 10 and 15), where k = t+1 is the bit-length of exponent e, and in average k/(m + 1) times of multiplication on line 16 (the mean length of one window with its forthcoming zeros is m + 1). Hence in average the number of multiplications is given as follows. k . T ′ (k, m) = 2m−1 + k + m+1 One can similarly verify that there always exists an positive integer m∗ that minimizes T ′ (k, m) for any positive integer k, since T ′ (k, m) is also convex on m for any k (see Appendix). Table II gives the minimizers for different k’s. k m∗ k m∗ 1-20 2 240-671 6 21-23 3 672-1791 7 24-79 4 1792-4607 8 80-239 5 4608-11519 9 TABLE II T HE MINIMIZERS m∗ GIVEN BIT- LENGTH k OF THE EXPONENT. Similarly as Algorithm 2, Algorithm 4 gives the detailed procedure of adaptive sliding-window exponentiation method. In Algorithm 4 i-winExp(g, e, N ) denotes the sliding window method with window size i to compute g e mod N . Algorithm 4: Adaptive sliding-window exponentiation with window size m 1 Take as input the modulus N , the base g and the exponent e, and we are supposed to compute g e 2 Let k be the bit-length of e 3 If k < 21, return 2-winExp(g, e, N ) 4 If k < 24, return 3-winExp(g, e, N ) 5 If k < 80, return 4-winExp(g, e, N ) 6 If k < 240, return 5-winExp(g, e, N ) 7 If k < 672, return 6-winExp(g, e, N ) 8 If k < 1792, return 7-winExp(g, e, N ) 9 If k < 4608, return 8-winExp(g, e, N ) 10 return 9-winExp(g, e, N ). IV. E VALUATION This section presents the evaluation results of our adaptive m-ary and m-sized sliding window method, with the baseline power functions from the popular implementations, CPython and Pypy, which are considered to be very efficient in practice [8], [1]. A. Experiment Setup To test the performance of our algorithm and CPython/Pypy’s power functions, we choose at uniformly random the base g, exponent e and modulus N to be large integers that are sufficient for cryptographic use, i.e., with bit-length of 1024, 2048, 3072 and 4096. We guarantee that N is larger than g and e. For exponentiation of each bit-length, we take 1000 samples and compute the average computing time. We use Python 2 with CPython/Pypy as the implementation. We run our Python code on a Linux Ubuntu 16.04 server with 8 cores of 2.4 GHz AMD FX8320, 16GB memory. 3 #bits k 1024 2048 3072 4096 CPython pow (ms) 5.050 ± 0.84 32.942 ± 2.81 101.136 ± 6.35 229.435 ± 11.48 Adaptive m-ary (ms) 5.271 ± 0.90 32.88 ± 2.04 99.77 ± 5.82 224.432 ± 10.27 Change ratio of m-ary +4.39% -0.17% -1.35% -2.31% Adaptive sliding window (ms) 5.179 ± 0.83 32.41 ± 2.69 97.273 ± 6.33 218.00 ± 10.67 Change ratio of sliding window +2.56% -1.63% -3.82% -4.98% TABLE III T IME COST OF ADAPTIVE m- ARY AND SLIDING WINDOW V. S . CP YTHON POW . #bits k 1024 2048 3072 4096 Pypy pow (ms) 3.450 ± 0.19 20.035 ± 2.08 58.383 ± 5.61 129.20 ± 10.94 Adaptive m-ary (ms) 3.586 ± 0.73 20.011 ± 2.28 57.782 ± 6.99 126.556 ± 11.82 Change ratio of m-ary +3.94% -0.12% -1.03% -2.04% Adaptive sliding window (ms) 3.543 ± 0.95 19.731 ± 2.18 56.118 ± 5.32 123.14 ± 10.07 Change ratio of sliding window +2.69% -1.52% -3.88% -4.69% TABLE IV T IME COST OF ADAPTIVE m- ARY AND SLIDING WINDOW V. S . P YPY POW . B. The Baseline The power function pow(g, e, N ) implemented in CPython [2] works as follows. For exponents with more than 8 digits, pow uses 5-ary method. For exponents of no more than 8 digits, pow uses LR binary method as Algorithm 1. Pypy’s pow always uses LR binary method [7]. To maximize the efficiency, pow as well as most code in CPython is written in C language, and Pypy has more efficient (on average 7.5 times faster than CPython) arithmetic operations including multiplication [6]. Note that our experiment code is written in Python 2, implying there is still some improvement space if we write our algorithm in C language. C. The Performance Results Table III gives the testing results of the three methods implemented in CPython, and Table IV gives the results of the methods implemented in Pypy. The times are measured in milliseconds, and the errors are the sampled deviations. We first discuss the CPython results. Note that for exponents with more than 2048 bits, our adaptive m-ary and m-sized sliding window method overall outperform CPython and Pypy’s pow implementation, since for such large exponents, the minimizer m∗ is often more than 5, and thus the strategy in CPython or Pypy’s pow is sub-optimal, whereas our adaptive method still captures the minimizer. For small exponents CPython and Pypy’s pow outperforms ours, since CPython pow’s C implementation is more efficient than our Python 2 code, and Pypy pow’s 1-ary LR method does not need to precompute or memorize any powers. In particular, for 1024-bit exponent, both pow and our m-ary method choose m = 5, and thus run the same algorithm. Hence the +4.39% change is mainly contributed by the difference between C and Python 2. In general, adaptive sliding window method achieves the best performance among the three methods. In particular, for 4096bit modular exponentiation, adaptive sliding window method can reduce pow’s time by nearly 5%. For Pypy’s results, our algorithms achieve similar performance gains, e.g, 4.6% for 4096-bit exponent. D. Discussion on the Exponentiation with Short Exponents Our experiments above indicate that for relatively short exponents (e.g., less than 1024 bits), the python built-in power function outperforms ours, due to the aforementioned gap on efficiency between Python and the low-level language for implementation like C. To mitigate this problem we may treat the short exponents differently, e.g., if the length of the exponent is no more than 1024, we just use Python’s built-in function to calculate the power. In this way our performance should be competitive for short exponents, while achieves better for long exponents. V. C ONCLUSION We have presented two improved modular exponential algorithms based on m-ary and sliding window respectively. Our methods can adaptively choose m based on the length of exponent. To verify the improvement on performance, we have done the benchmark by comparing their time cost with the power function implemented in CPython/Pypy as a baseline. The comparison results have verified that our methods outperform for very large exponent, e.g., 4.6-5% reduction on time for exponents with 4096 bits. R EFERENCES [1] Eli Biham and Jennifer Seberry. Pypy: another version of py. eSTREAM, ECRYPT Stream Cipher Project, Report, 38:2006, 2006. [2] CPython. Long pow implementation in the file objects/longobject.c. https://github.com/python/cpython/blob/master/Objects/longobject.c. Line 4179 - 4210. [3] Çetin K Koç. Analysis of sliding window techniques for exponentiation. Computers & Mathematics with Applications, 30(10):17–24, 1995. [4] Çetin K Koç and Ching-Yu Hung. Adaptive m-ary segmentation and canonical recoding algorithms for multiplication of large binary numbers. Computers & mathematics with applications, 24(3):3–12, 1992. [5] Alfred J Menezes, Paul C Van Oorschot, and Scott A Vanstone. Handbook of applied cryptography. CRC press, 1996. [6] Pypy. Performance comparison between pypy and cpython. http://speed.pypy.org/. [7] Pypy. Pow implementation in the file objspace/std/intobject.py. https://github.com/tycho/pypy/blob/master/pypy/objspace/std/intobject.py. Line 239 - 269. [8] Jose Manuel Redondo and Francisco Ortin. A comprehensive evaluation of common python implementations. IEEE Software, 32(4):76–84, 2015. A PPENDIX We will prove the claim that T (k, m) is convex on m ∈ R+ (k,m) monotonically for any k > m. It suffices to show ∂T∂m 4 increases on m ∈ R+ for any k > m. Compute the derivative as   −m 2 log 2 1 − 2−m ∂T (k, m) =(k − m) − ∂m m m2 −m 1−2 − + 2m log 2 − 1. m It is routine to verify the monotonic increase of − 1−2m and 2m log 2, by verifying their derivatives are always positive over R+ . It remains to show that the term 2−m log 2 1 − 2−m R(k, m) = − m m2 −2 =m ((m log 2 + 1) · 2−m − 1) −m is always negative over R+ and monotonically increases on m for any k > m. Since 1 + m log 2 < 2m (by Taylor’s theorem) for any positive m, R(k, m) is always negative over R+ . To verify the monotonic increase, compute the derivative ∂R(k, m) =2−m m−3 (−m2 log2 2 ∂m − 2m log 2 − 2 + 2m+1 ). Since 2m+1 > 2 + 2m log 2 + m2 log2 2 (again, by Taylor’s theorem), ∂R(k, m) > 0. ∂m Hence for any k > m, R(k, m) monotonically increases over m ∈ R+ . The function k T ′ (k, m) = 2m−1 + k + m+1 is also convex over m ∈ R+ for any positive k, since ∂ 2 T ′ (k, m) 2k = 2m−1 · log2 2 + ∂m2 (m + 1)3 is always positive over m ∈ R+ .
8cs.DS
Topological and Algebraic Properties of Chernoff Information between Gaussian Graphs arXiv:1712.09741v1 [cs.IT] 28 Dec 2017 Binglin Li, Shuangqing Wei, Yue Wang, Jian Yuan Abstract—In this paper, we want to find out the determining factors of Chernoff information in distinguishing a set of Gaussian graphs. We find that Chernoff information of two Gaussian graphs can be determined by the generalized eigenvalues of their covariance matrices. We find that the unit generalized eigenvalue doesn’t affect Chernoff information and its corresponding dimension doesn’t provide information for classification purpose. In addition, we can provide a partial ordering using Chernoff information between a series of Gaussian trees connected by independent grafting operations. With the relationship between generalized eigenvalues and Chernoff information, we can do optimal linear dimension reduction with least loss of information for classification. Key words: Gaussian graphs, generalized eigenvalue, Chernoff information, dimension reduction I. I NTRODUCTION Gaussian graphical model is widely used in constructing the conditional independence of continuous random variables. It is used in many applications such as social network [1], economics [2], biology [3] and so on. Our work is about statistical inference problems related to Gaussian graphical model where we want to learn the error exponents for classification. There are two different error events in this learning problem. If we want to classify the learnt distribution from the true one, we often use Kullback-Leibler(KL) distance as the error exponent [4], [5]. Otherwise, we use Chernoff information when we measure the average error exponent for the error probability in discerning M distributions based on a sequence of data drawn independently from one of M distributions. The minimum pair-wise Chernoff information among these distributions is the error exponent characterizing the performance of an M ary hypothesis testing problem. In algebraic analysis of hypothesis testing problem, we also use generalized eigenvalues of covariance matrices as a metric of the difference between them [6], [7]. Clearly, Chernoff information and generalized eigenvalues of covariance matrices are respectively probabilistic and algebraic ways to describe the difference between two Gaussian graphs. So there must be relation among topology, statistical distributions (Chernoff information), and algebra (generalized eigenvalues). This paper will study this relationship and show how Chernoff B. Li, Y. Wang and J. Yuan are with Department of Electronic Engineering, Tsinghua University, Beijing, P. R. China, 100084. (E-mail: [email protected]; wangyue, [email protected]). S. Wei is with the school of Electrical Engineering and Computer Science, Louisiana State University, Baton Rouge, LA 70803, USA (Email: [email protected]). This material is based upon work supported in part by the National Science Foundation (USA) under Grant No. 1320351, and the National Natural Science Foundation of China under Grant 61673237. information can be determined by generalized eigenvalues. What’s more, we will show how topology differences affect generalized eigenvalues and thus Chernoff information. More specifically, we find that two Gaussian graphs can be linearly and inversely transformed to two graphs whose covariance matrices are diagonal. And entries of the diagonal matrices are related to generalized eigenvalues. Thus we find that Chernoff information between two Gaussian graphs is an expression of generalized eigenvalues and a special parameter λ∗ which is also determined by generalized eigenvalues. What’s more, we find that the unit generalized eigenvalue doesn’t affect Chernoff information and the corresponding dimension is not making contributions to differentiating two Gaussian graphs for classification problem. Our former paper [8] dealt with the classification problem related to Gaussian trees. And we found that some special operations on Gaussian trees, namely, adding operation and division operation, don’t change Chernoff information between them. Now in this paper, we find that the two operations only add one extra unit generalized eigenvalue and don’t affect other generalized eigenvalues. So we can use generalized eigenvalues to prove the same probabilities. [8] also dealt with two Gaussian trees connected by one grafting operation and showed that Chernoff information between them is the same with that of two special 3-node trees whose weights are related to the underlying operation. In this paper, we extend this result to a Gaussian tree chain connected by independent grafting operations and provide a partial ordering of Chernoff information between these trees. In practice, the collection and storage of data have cost and we may need to reduce the dimension of data. An good choice here is doing linear dimension reduction in collection stage. We linearly transform an N dimensional Gaussian vector x to an NO < N dimensional vector y = Ax, through an NO × N matrix A. An immediate question here is the optimal selection of A which can maximize the error exponent in the classification of two hypothesis. In our former paper [8], we only dealt with a simple, but non-trivial case with NO = 1. In this work, we offer an optimal method to maximize the resulting Chernoff information after a linear transformation for an arbitrary NO ≥ 1. Our major and novel results can be summarized as follows. We first provide the relationship between Chernoff information and generalized eigenvalues. According to the former result, we show that generalized eigenvalues which are equal to 1 make no contribution to Chernoff information. And we use this to explain why adding and division operations of [8] don’t affect Chernoff information between Gaussian trees. These results build a relationship between topology, statistical distribution and algebra. What’s more, we deal with Gaussian trees connected by more than one grafting operation and show a partial ordering inside the chain. At last, we provide an optimal linear dimension reduction method. This paper is organized as below. In Section II, we propose the model of our analysis. The relationship between topology, Chernoff information and generalized eigenvalues is shown in Section III. The partial ordering of Gaussian tree chain is presented in Section IV. Section V shows the optimal dimension reduction method. And in Section VI we conclude the paper. II. S YSTEM M ODEL Consider a set of Gaussian graphs, namely, Gk (x), k = 1, 2, . . . , M , with their prior probabilities given by π1 , π2 , . . . , πM . For simplification, we normalize the variance of all Gaussian variables to be 1 and the mean values to be 0. They share the same entropy, and thus the (k) same determinant of their covariance matrices Σk = [σij ]. The same entropy means the same amount of randomness. This assumption can let us compare these Gaussian graphs fairly. We want to do an M -ary hypothesis testing to find out from which Gaussian distribution the data sequence T X = [x1 , . . . , xt ] (xl = [x1,l , . . . , xN,l ] ) comes from. We define the average error probability of the hypothesis testing to be Pe , and let Ee = limt→∞ − lnt Pe be the resulting error exponent, which depends on the smallest Chernoff information between the graphs [9] , namely, Ee = min 1≤i6=j≤M CI(Σi ||Σj ) (1) where CI(Σi ||Σj ) is the Chernoff information between the ith and j th graphs. For two 0-mean N-dim Gaussian joint distributions, x1 ∼ N (0, Σ1 ) and x2 ∼ N (0, Σ2 ), their Kullback-Leibler divergence is as follows D(Σ1 ||Σ2 ) = 1 |Σ2 | 1 N log + tr(Σ−1 2 Σ1 ) − 2 |Σ1 | 2 2 (2) P where tr(X) = i xii is the trace of square matrix X. We define a new distribution N (0, Σλ ) in the exponential family of the N (0, Σ1 ) and N (0, Σ2 ), namely −1 −1 Σ−1 λ = Σ1 λ + Σ2 (1 − λ) (3) So the Chernoff information is given below CI(Σ1 ||Σ2 ) = D(Σλ∗ ||Σ2 ) = D(Σλ∗ ||Σ1 ) (4) where λ∗ is the point at which the latter equation is satisfied [10]. It is unique in interval [0, 1]. We already know that the overall Chernoff information in an M -ary testing is bottle-necked by the minimum pair-wise difference [10], thus we next focus on the calculation of Chernoff information of pair-wise Gaussian graphs. Further research will show that pair-wise Chernoff information can be determined by the generalized eigenvalues of covariance matrices Σ1 , Σ2 and λ∗ . And λ∗ can also be determined by these generalized eigenvalues. In addition to the full observation case, we will also study a dimension reduction case. For two N variables Gaussian graphs G1 , G2 , in the full observation case, we can have access to all N variables and only need to calculate Chernoff information CI(Σ1 ||Σ2 ). But in the dimension reduction case, we can only observe an NO -dim vector each time, namely, y = Ax, where A is an NO × N matrix and x ∈ RN , y ∈ RNO . The new variables follow joint distributions N (0, Σ̃1 ) and N (0, Σ̃2 ) where Σ̃i = AΣi AT , i = 1, 2. For fixed NO , we want to find out the optimal A∗ and its Chernoff information result CI(Σ̃∗1 ||Σ̃∗2 ), s.t. A∗ = arg max CI(Σ̃1 ||Σ̃2 ) A (5) We only consider binary hypothesis testing in this dimension reduction problem. III. G ENERALIZED EIGENVALUES , C HERNOFF INFORMATION AND TOPOLOGY Chernoff information is the measurement of the difference between statistical distributions. It is hard to be calculated directly and we rarely study its insights about the relationship between Chernoff information and structure characters. Chernoff information and generalized eigenvalues are both important parameters to describe Gaussian graphical models. We will expose the relationship between them. A. Linear transformation to diagonal covariance matrix related to generalized eigenvalues For two N -node 0-mean Gaussian graphs G1 and G2 on random variables x, whose covariance matrices are Σ1 and Σ2 , we can use an inverse linear transformation matrix P to transform them to x0 = Px whose covariance matrices Σ01 and Σ02 are diagonal and related to the generalized eigenvalues of Σ1 and Σ2 . Σ1 and Σ2 are real symmetric positive definite matrices, so the eigenvalues of Σ1 Σ−1 are all positive, as shown in 2 Appendix A. The eigenvalue decomposition of Σ1 Σ−1 is 2 QΛQ−1 , where Q is an N × N matrix and Λ = Diag({λi }) is a diagonal matrix of eigenvalues, in which we put multiple eigenvalues adjacent. {λi } are the eigenvalues of Σ1 Σ−1 2 , namely, the generalized eigenvalues of Σ1 and Σ2 . Note that Q may be non-orthogonal when Σ1 Σ−1 2 isn’t symmetric. Proposition 1: For two N -node 0-mean Gaussian graphs G1 and G2 whose covariance matrices are Σ1 and Σ2 respectively, we can construct a linear transformation matrix   1 T − 2 −1 Q and thus P = Q−1 Σ2 (Q−1 ) Σ02 =PΣ2 PT = IN (6) Σ01 =PΣ1 PT = Λ (7) −1 where eigenvalue decomposition of Σ1 Σ−1 . 2 is QΛQ The proof of Proposition 1 is shown in Appendix A. We can treat Σ01 and Σ02 as two graphs G01 and G02 on x0 obtained from G1 and G2 by inverse linear transformation P. G01 and G02 are graphs with N independent variables. The distances of G01 and G02 are as follows. The distances between G1 and G2 are the same with the distances of G01 and G02 just because P is inverse. 1X (− ln λi + λi − 1) 2 i   1X 1 0 0 ln λi + −1 D(Σ2 ||Σ1 ) =D(Σ2 ||Σ1 ) = 2 i λi D(Σ1 ||Σ2 ) =D(Σ01 ||Σ02 ) = G_1 G_1 GT1 GT1 GT1 w N+1 i GT1 G_1' G_2 G_2 GT2 GT2 w N+1 i i G_2' GT2 w G_1' (8) N+1 GT2 w G_2' G_2 G_1 (9) D(Σλ ||Σ1 ) =D(Σ0λ ||Σ01 )   1X 1 = ln (λ + (1 − λ)λi ) + −1 2 i λ + (1 − λ)λi (10) GT_11 GT_11 G_1 GT_12 q w1w2 GT_11 q p w1w2 p N+1 i GT_21 p GT_12 w1w2 q GT_21 G_2 GT_22 w1w2 q p GT_22 w1 N+1 w2 w1 N+1 w2 GT_12 GT_21 GT_22 q w1 N+1 w2 q w1 N+1 w2 p p GT_11 GT_12 GT_21 GT_22 G_1' G_2' q q p p G_1' G_2' Fig. 1. Adding and Division operations of two trees =D(Σ0λ ||Σ02 ) D(Σλ ||Σ2 )   λi λ + (1 − λ)λi 1X ln = + −1 2 i λi λ + (1 − λ)λi (11) CI(Σ1 ||Σ2 ) =CI(Σ01 ||Σ02 ) = D(Σ0λ∗ ||Σ01 ) = D(Σ0λ∗ ||Σ02 ) (12) −1 −1 −1 −1 0 where Σ−1 = Σ01 λ + λ = Σ1 λ + Σ2 (1 − λ) and Σλ 0 −1 0 Σ2 (1 − λ). Σλ is also a diagonal matrix. λ∗ in (12) is the unique root of D(Σ0λ∗ ||Σ01 ) = D(Σ0λ∗ ||Σ02 ), namely, P 1−λi i λ∗ +(1−λ∗ )λi + ln λi = 0. In this way, we can conclude that the KL and CI divergences between two Gaussian graphs can be determined by their generalized eigenvalues. B. Relationship between generalized eigenvalues and Chernoff information Here we will show the relationship between Chernoff information of two Gaussian graphs and generalized eigenvalues of their covariance matrices Σ1 and Σ2 under the assumption of same entropy QN and normalized covariance matrix. Under this assumption, i=1 λi = |Σ1 |/|Σ2 | = 1. Proposition 2: For two N -node Gaussian distributions who have the same entropy and normalized covariance matrix Σ1 , Σ2 , their Chernoff information satisfies   p λ∗ 1X CI(Σ1 ||Σ2 ) = ln{(1 − λ∗ ) λi + √ } (13) 2 i λi where {λi } are the generalized eigenvalues of Σ1 , Σ2 , namely eigenvalues of Σ1 Σ2−1 , and λ∗ ∈ [0, 1] is the unique result of X X 1 λi = =N (14) ∗ ∗ ∗ λ + (1 − λ )λi λ + (1 − λ∗ )λi i i We can prove this proposition from the equation (12), as shown in Appendix B. We find that generalized eigenvalues of covariance matrices Σ1 and Σ2 are the key parameters of Chernoff information. We can get Chernoff information with these N generalized eigenvalues, so these N parameters contain all the information about the difference between two Gaussian trees. The generalized eigenvalues are so important that we need more property about them. C. Performance of unit generalized eigenvalues In former equation, we find that unit generalized eigenvalues are very special to Chernoff information. Proposition 3: Assuming that the generalized eigenvalues of (N + 1)-node G01 and G02 are the same with that of N node G1 and G2 except a newly additional unit generalized eigenvalue, the optimal parameter λ∗ of (Σ01 , Σ02 ) is the same with that of (Σ1 , Σ2 ) and CI(Σ01 ||Σ02 ) = CI(Σ1 ||Σ2 ). Proposition 3 can be proved from Proposition 2 as shown in Appendix C. Proposition 3 shows a possible way to do dimension reduction that we can reduce the dimension of Gaussian graphs from N +1 to N without changing their Chernoff information if we only remove an unit generalized eigenvalue in this procedure. Gaussian tree models, whose definition can be seen in [8], represent the dependence of multiple Gaussian random variables by tree topologies. [8] dealt with the classification on Gaussian trees. In that paper, we defined two special operations on two Gaussian trees, namely adding operation and division operation, as shown in Fig. 1. We add the same leaf node or divide the same edge by adding or division operations. These two operations don’t change Chernoff information between two Gaussian trees. Next we will show how generalized eigenvalues change after adding or division operation. Proposition 4: Assume that Gaussian trees G01 and G02 are obtained from G1 and G2 by adding operation or division operation. Their covariance matrices are (Σ01 , Σ02 ), (Σ1 , Σ2 ) respectively. The generalized eigenvalues of (Σ01 , Σ02 ) are the same with that of (Σ1 , Σ2 ) except a newly added unit eigenvalue. Proposition 4 is proved in Appendix D. From Proposition 3 and 4, we can conclude that adding and division operations don’t affect Chernoff information between two Gaussian trees. p i subtree2 grafting Subtree1 Subtree1 q i subtree2 Fig. 2. T2 is obtained from T1 by grafting operation 3 2 subtr ee3 2 subt ree2 subt ree4 Unchanged subtree 1 3 subt ree2 subt ree4 Unchanged subtree i subt ree5 1 …… subt ree1 j subt ree5 subt ree1 subt ree3 …… Fig. 3. Independent grafting operations This result has been proved in our former paper [8] and is one of key contribution of that paper. IV. PARTIAL ORDERING IN INDEPENDENT GRAFTING CHAIN Grafting operation is a topological operation by cutting down a subtree from another tree and pasting it to another location, as shown in Figure 2. It is defined in our former paper [8]. In that former paper, we have shown that two Gaussian trees connected by one grafting operation have the same Chernoff information with two special 3-node Gaussian trees whose weights are related to the underlying operation. Now we consider a more complex situation: two Gaussian trees connected by more than one grafting operation. Gaussian trees connected by more grafting operations can’t be simplified to a fixed couple of small trees because the interaction of these grafting operations varies. Our initial expectation was that bigger difference in topology between two Gaussian trees leads to larger Chernoff information. But this may not be true for all situations. Before we deal with a sequence of grafting operations, we need to constrain the interaction among them. So we will define the independence of grafting operations at first. Definition 1: If all the grafting operations can be divided into different subtrees, as shown in Fig. 3, then these grafting operations are independent. After regrouping all the nodes into small subtrees represented by circles, the whole tree has super star-shaped topology. The subtree in the center is unchanged during grafting operations. And grafting operations are involved in disjoint super leaf nodes of the star. In Fig. 3, we show 4 independent grafting operations around the unchanged subtree. There are three types of grafting operations in the star-shaped topology. From left to right, the 1-st, 2-nd grafting operations belong to the first type, the 4-th one belongs to the second type and the 3-rd operation belongs to the third type. For the first type, we can cut a subtree, represented by a small circle with a number in it, from the super leaf node(subtree1,2) and paste it to another part of this super leaf node. In the second type, we can cut the unchanged subtree outside the super leaf node(subtree5) and paste it to another location in this super leaf node. But for the third type, we will cut a subtree, represented by a small circle with a number in it, from a super leaf node(subtree3) and paste it to another super leaf node(subtree4). The third kind of grafting operation involves two super leaf nodes of the star while the first and second kinds of operation only involve one. If all the grafting operations are independent, then we can make the following conclusion. Proposition 5: For two Gaussian trees connected by several independent grafting operations, λ∗ = 1/2 holds. The trees have the same number of nodes and the same entropy due to grafting operations. So λ∗ satisfies tr(Σλ∗ (Σ−1 1 − Σ−1 )) = 0, which can be transformed from the definition 2 −1 formulas of λ∗ . tr(Σλ∗ (Σ−1 1 −Σ2 )) is a summation formula with 4n term, where each 4 terms are related to one single grafting operation. So we can deal with the terms respectively −1 and prove tr(Σ0.5 (Σ−1 1 − Σ2 )) = 0 eventually. More details can be found in Appendix E. Considering a grafting chain T1 ↔ T2 ↔ T3 , intuition tells us that CI(T1 ||T3 ) is likely larger than CI(T1 ||T2 ) and CI(T2 ||T3 ), because the difference between T1 and T3 is the accumulation of T1 − T2 ’s difference and T2 − T3 ’s difference. If the assumption is true, we only need to consider the adjacent pairs of Gaussian trees in the chain when looking for the minimum Chernoff information. Later results will tell us that it depends on the structure of the chain. Proposition 6: For the grafting chain T1 ↔ T2 ↔ T3 ↔ · · · ↔ Tn where all the grating operations in the chain are independent, we can conclude that CI(Ti ||Tj ) ≤ CI(Tp ||Tq ) if p ≤ i ≤ j ≤ q. Detail of the proof can be found in Appendix F. If we want to find out the minimum Chernoff information in this set, weonly need to try n − 1 pairs of Ti − Ti+1 , rather than all the n2 pairs. The number of candidates is significantly reduced. It is a partial ordering because we can’t compare CI(T1 ||T2 ) and CI(T2 ||T3 ) even in a simplest chain T1 ↔ T2 ↔ T3 without knowing the weights. We can only compare Chernoff information pairs CI(Ti ||Tj ), CI(Tp ||Tq ) when p ≤ i ≤ j ≤ q ordering, and thus this result is a partial inequality, rather than a full ordering inequality. In proposition 6, we constrain the grafting operations independent. So we may wonder whether the result suits for all the possible grafting chains T1 ↔ T2 ↔ T3 ↔ · · · ↔ Tn without independent assumption. Taking grafting chain T1 ↔ T2 ↔ T3 in Fig. 4 as an example, the two grafting operations are not independent. Some special cases is shown in Table I. In this table, we can find that CI(T1 ||T3 ) < CI(T1 ||T2 ) can hold in some special situations. This is a counter-intuitive result because more topological differences can’t lead to larger Chernoff information between Gaussian trees. cases 1 2 3 4 λ∗T ||T 1 3 0.5191 0.5073 0.5254 0.5082 λ CIT1 ||T3 CIT1 ||T2 CIT2 ||T3 19.5746, 0.0433, 1.5439, 0.7642, 1, 1, 1 0.8983 0.9142 0.0251 9.2341, 0.1019, 1.2982, 0.8185, 1, 1, 1 0.5402 0.5418 0.0113 9.4328, 1.653, 0.0844, 0.7603, 1, 1, 1 0.5982 0.6103 0.0392 5.0195, 0.1863, 1.2201, 0.8766, 1, 1, 1 0.3102 0.3132 0.0056 TABLE I N UMERICAL CASES DISSATISFYING P ROPOSITION 6 IN THE CHAIN OF F IG . 4 1 w5 6 w1 5 5 3 w3 4 G_2 7 4 w6 2 w2 3 w3 w1 4 w6 3 w3 G_1 2 w2 w4 w4 2 w2 5 w4 w1 1 w5 6 w6 7 1 w5 6 7 G_3 Fig. 4. Example for dependent grafting operations So we can only provide a partial ordering with independent grafting operations in this section. The problems of ordering is much more complex than what we have expected. For a grafting chain T1 ↔ T2 ↔ T3 , the Chernoff information G_1 between T1 and T3 may be larger than that between T1 and T2 , even though the difference between T1 and T2 seems smaller. Here we only consider topological difference, rather than parameterized difference, between Gaussian trees. Topological difference is not the only contribution factor affecting such comparisons [5], [11]. V. D IMENSION REDUCTION The analysis in former section deals with Chernoff information in full-observation situation where we can get access to all the variables. But in practice, there is significant cost in collecting and storing data. So we can only use linearly transformed low-dimensional samples to do the classification. The linear transformation matrix should make sure that the reduced data have maximum information for classification. Traditional dimension reduction methods, such as Principal Component Analysis (PCA) and other Representation Learning [12], aim to find the optimal features with maximum information. They only consider a distribution at one time and don’t care how we use the resulting low-dimensional data. But our method considers two hypothesises at the same time and want to keep the most information for classification. Some features may be important in PCA, but invalid in our method because these features in two hypothesis are similar. Our object function here is the Chernoff information between the resulting low-dimensional distributions. In section III-A, we have shown linear transformation method which can make the distribution in new space independent. In these new space, x0i , the i-th variable of x0 , follows N (0, 1) in hypothesis 2 and N (0, λi ) in hypothesis 1. If λi is farther from 1, this dimension can provide more information for classification than other dimensions. Assume that m of all the N eigenvalues {λi } are greater than 1 and the other N − m eigenvalues are no more than 1. If we want to reduce the observation dimension from N to NO , we choose the dimensions of x0 corresponding to the first k rank and last NO − k rank of {λi }, where NO + m − N ≤ k ≤ m and k ≥ 0. We can choose a sub-matrix of Σ01 and Σ02 corresponding to the NO chosen eigenvalues as the result of dimension reduction. The NO × N linear transformation matrix Ak is the corresponding NO rows of P corresponding to the chosen eigenvalues. Proposition 7: A∗ is the optimal NO ×N linear transformation matrices to maximize the Chernoff information in transformed space, namely A∗ = arg maxANO ×N CI(Σ̂1 ||Σ̂2 ) where Σ̂i = A∗ Σi A∗ T for i = 1, 2. So A∗ ∈ {Ak |NO + m − N ≤ k ≤ m, k ≥ 0}. Proof of proposition 7 can be seen in Appendix G and this proposition ensure the optimality of our method. The observation is y = A∗ x and the covariance matrices of y in two hypothesis are Σ002 = A∗ Σ2 A∗ T = INO Σ001 ∗ = A Σ1 A ∗T = Diag({µi }) (15) (16) where Σ001 and Σ002 are NO × NO diagonal matrices and {µ1 , µ2 , . . . , µNO } (including multiple eigenvalues) are NO chosen eigenvalues. D(Σ00λ ||Σ001 )   1X 1 = ln (λ + (1 − λ)µi ) + −1 2 i λ + (1 − λ)µi D(Σ00λ ||Σ002 )   λ + (1 − λ)µi λi 1X ln + −1 = 2 i λi λ + (1 − λ)µi (17) (18) CI(Σ001 ||Σ002 ) = max min{D(Σ00λ ||Σ001 ), D(Σ00λ ||Σ002 )} λ∈[0,1] (19) Equation (19) is another definition of Chernoff information [10]. The distances are only related to the eigenvalues we have chosen. VI. C ONCLUSION In this paper, we show the relationship between topology, statistical distribution and algebra. Chernoff information between two Gaussian graphs can be determined by the generalized eigenvalues of their covariance matrices. Among them unit generalized eigenvalue is very special and doesn’t affect the Chernoff information. Adding and division operations on Gaussian trees only add a newly unit generalized eigenvalues and don’t change other generalized eigenvalues. Thus these operations keep the Chernoff information. We also extend our former result about grafting operation to Gaussian trees connected by more than one independent grafting operation and provide a partial ordering among these trees. What’s more, we provide an optimal linear dimension reduction method with the metric of Chernoff information. R EFERENCES [1] F. Vega-Redondo, Complex social networks. Cambridge University Press, 2007, no. 44. [2] A. Dobra, T. S. Eicher, and A. Lenkoski, “Modeling uncertainty in macroeconomic growth determinants using Gaussian graphical models,” Statistical Methodology, vol. 7, no. 3, pp. 292–306, 2010. [3] A. Ahmed, L. Song, and E. P. Xing, “Time-varying networks: Recovering temporally rewiring genetic networks during the life cycle of drosophila melanogaster,” arXiv preprint arXiv:0901.0138, 2008. [4] V. Y. F. Tan, A. Anandkumar, and A. S. Willsky, “Learning Gaussian tree models: analysis of error exponents and extremal structures.” IEEE Transactions on Signal Processing, vol. 58, no. 5, pp. 2701–2714, 2010. [5] V. Y. Tan, A. Anandkumar, L. Tong, and A. S. Willsky, “A largedeviation analysis of the maximum-likelihood learning of markov tree structures,” Information Theory, IEEE Transactions on, vol. 57, no. 3, pp. 1714–1735, 2011. [6] G. Doretto and Y. Yao, “Region moments: Fast invariant descriptors for detecting small image structures,” in 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2010, pp. 3019–3026. [7] R. Wang, H. Guo, L. S. Davis, and Q. Dai, “Covariance discriminative learning: A natural and efficient approach to image set classification,” in 2012 IEEE Conference on Computer Vision and Pattern Recognition, 2012, pp. 2496–2503. [8] B. Li, S. Wei, Y. Wang, and J. Yuan, “Chernoff information of bottleneck Gaussian trees,” in 2016 IEEE International Symposium on Information Theory (ISIT). IEEE, 2016, pp. 970–974. [9] M. B. Westover, “Asymptotic geometry of multiple hypothesis testing,” IEEE transactions on information theory, vol. 54, no. 7, pp. 3327–3329, 2008. [10] T. M. Cover and J. A. Thomas, Elements of information theory. John Wiley & Sons, 2012. [11] V. Jog and P.-L. Loh, “On model misspecification and KL separation for Gaussian graphical models,” in 2015 IEEE International Symposium on Information Theory (ISIT). IEEE, 2015, pp. 1174–1178. [12] Y. Bengio, A. Courville, and P. Vincent, “Representation learning: A review and new perspectives,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 35, no. 8, pp. 1798–1828, 2013. A PPENDIX A P ROOF OF P ROPOSITION 1 Because Σ1 and Σ−1 are real symmetric positive definite 2 T matrices, Σ1 = L1 LT1 and Σ−1 2 = L2 L2 due to Cholesky decomposition where L1 and L2 are real non-singular triangular matrices. The characteristic polynomial of Σ1 Σ−1 2 is −1 f (Σ1 Σ−1 2 ) = |λI − Σ1 Σ2 | = |λI − L1 LT1 L2 LT2 | = |L1 (λI − LT1 L2 LT2 L1 )L−1 1 | = |λI − LT1 L2 LT2 L1 | T = |λI − (LT1 L2 )(LT1 L2 ) | (20) T T T So Σ1 Σ−1 2 has the same eigenvalues with (L1 L2 )(L1 L2 ) , which is a real symmetric positive definite matrix. So the −1 eigenvalues of Σ1 Σ−1 2 are all positive and Σ1 Σ2 is a positive definite matrix. The eigenvalue decomposition of Σ1 Σ−1 is QΛQ−1 , 2 where Q is an N × N matrix and Λ = Diag({λi }) is a diagonal matrix of eigenvalues, in which we put multiple eigenvalues adjacent. {λi } are the eigenvalues of Σ1 Σ−1 2 , namely, the generalized eigenvalues of Σ1 and Σ2 . T (1) (1) And Σ1 = Q−1 Σ1 Q−1 = [aij ] and Σ2 = T (1) (1) Q−1 Σ2 Q−1 = [bij ] satisfy Σ1 = ΛΣ2 . aij = λi bij (21) aij = aji = λj bji = λj bij (22) So for ∀i 6= j, aij = bij = 0 or λi = λj . If the eigenvalues of Σ1 Σ−1 have k different 2 multiple eigenvalues λ(1) , λ(2) , . . . , λ(k) with multiplicity n1 , n2 , . . . , nk , so   J1   J2     (1) J 3 Σ2 =   (23)   . ..   Jk  (1)  λ J1   λ(2) J2   (3)   (1) λ J3 Σ1 =   (24)   ..   . λ(k) Jk where Ji is ni × ni inverse matrix. (1) −0.5 We can also get an inverse matrix Q(1) = Σ2 so that (2) (1) T Σ2 = Q(1) Σ2 Q(1) = IN (2) Σ1 =Q (1) T (1) Σ1 Q(1) =Λ (25) (26) So we can construct a linear  1transformation matrix P = T − 2 −1 Q and thus Q(1) Q−1 = Q−1 Σ2 (Q−1 ) Σ02 =PΣ2 PT = IN (27) Σ01 =PΣ1 PT = Λ (28) A PPENDIX B P ROOF OF P ROPOSITION 2 λ∗ satisfies D(Σ0λ∗ ||Σ01 ) = D(Σ0λ∗ ||Σ02 ), and thus   1X 1 ln (λ∗ + (1 − λ∗ )λi ) + ∗ − 1 2 i λ + (1 − λ∗ )λi   1X λ∗ + (1 − λ∗ )λi λi = ln + ∗ −1 2 i λi λ + (1 − λ∗ )λi (29) QN With knowing i=1 λi = 1, we can conclude X X 1 λi = (30) ∗ ∗ ∗ λ + (1 − λ )λi λ + (1 − λ∗ )λi i i We also know X X λi 1 +(1 − λ∗ ) λ∗ ∗ ∗ ∗ λ + (1 − λ )λi λ + (1 − λ∗ )λi i i X = 1 =N (31) i ∗ So λ ∈ [0, 1] is the unique result of X X 1 λi = =N ∗ ∗ ∗ λ + (1 − λ )λi λ + (1 − λ∗ )λi i i (32) And CI(Σ1 ||Σ2 ) = D(Σ0λ∗ ||Σ01 )   1X 1 = ln (λ∗ + (1 − λ∗ )λi ) + ∗ − 1 2 i λ + (1 − λ∗ )λi 1X ln (λ∗ + (1 − λ∗ )λi ) = 2 i   p 1X λ∗ = ln (1 − λ∗ ) λi + √ (33) 2 i λi A PPENDIX C P ROOF OF P ROPOSITION 3 λ∗ is unique in the range of [0, 1]. So if λ∗ satisfies equation (14), then X 1 1 + ∗ = ∗ ∗ λ + (1 − λ )λi λ + (1 − λ∗ ) × 1 i X λi 1 + ∗ (34) ∗ + (1 − λ∗ )λ λ λ + (1 − λ∗ ) × 1 i i where {λi } are the generalized eigenvalues S of (Σ1 , Σ2 ). So the generalized eigenvalues {λi } {1} of (Σ01 , Σ02 ) and λ∗ also satisfies equation (14). The optimal λ∗ is the same. And  N  p 1X λ∗ CI(Σ01 ||Σ02 ) = ln{(1 − λ∗ ) λi + √ } 2 i=1 λi   ∗ √ 1 λ + ln{(1 − λ∗ ) 1 + √ } 2 1  N  X p 1 λ∗ = ln{(1 − λ∗ ) λi + √ } 2 i=1 λi =CI(Σ1 ||Σ2 ) (35) A PPENDIX D P ROOF OF P ROPOSITION 4 Assume that Gaussian trees G01 and G02 are obtained from G1 and G2 by adding operation or division operation. Their covariance matrices are (Σ01 , Σ02 ), (Σ1 , Σ2 ) respectively. The generalized eigenvalues of (Σ01 , Σ02 ) are the same with that of (Σ1 , Σ2 ) except a newly added unit eigenvalue. We use the equation of block matrix to prove this proposition. We deal with adding operation and division operation in different subsections. A. Proof on adding operation case Adding operation is shown in Fig. 1. Assume G1 and G2 have node 1, .. . , N , and  their covariance matrices are D α G1 : Σ1 = αT  1  A2 B2 G2 : Σ2 , Σ−1 = . 2 BT2 a2 Without loss of generality, the new edge is eN,N +1 with parameter w. So new covariance matrices after adding operation are   D α wα 1 w  Σ01 =  αT (36) T wα w 1   A2 B2 0 2 −w  w (37) Σ0−1 = BT2 a2 + 1−w 2 2 1−w2 w 1 0 − 1−w2 1−w2 The generalized eigenvalues of Σ1 and Σ2 are the roots of |λI − Σ1 Σ−1 2 | = 0. Σ1 Σ−1 2 Σ01 Σ0−1 2    D α A2 B2 = T α 1 BT2 a2   DA2 + αBT2 DB2 + a2 α = (38) αT A2 + BT2 αT B2 + a2   DA2 + αBT2 DB2 + a2 α 0  = αT A2 + BT2 αT B2 + a2 0 (39) ∗ ∗ 1 −1 |λI − Σ01 Σ0−1 2 | =(λ − 1)|λI − Σ1 Σ2 | (40) So new trees have an extra unit generalized eigenvalue without changing other eigenvalues. B. Proof on division operation case Division operation is shown in Fig. 1. Assume that G1 and G2 have node 1, . . . , N , and the connecting points are p = 1, q = N without loss of generality. If we set edge e1N in G2 to be 0, we can treat it as a new N -node tree, whose covariance matrix is A−1 . We divide A as   x XT 0 A = X Z Y (41) 0 YT y where X, Y are (N −2)×1 matrices and Z is (N −2)×(N −2) matrix. 2 w2 w1 2 2 w2 1−w1 2 XT X − Z w1 w2 − 2 w2 1−w1 2 Y T w1 w2 2 w2 1−w1 2 Y y+ 2 w2 w1 2 2 w2 1−w1 2     (43) 0 T αT 1 + w1 w2 α2 P T w1 w2 αT 1 + α2 T w1 αT + w α 2 1 2 1 α1 + w1 w2 α2 =  w1 w2 w1 2 w1  0 G2 : −1 Σ22 , Σ22 x + 1−w12  X   = 0    w1 − 2 1−w1 w1 w2 w1 w2 α1 + α2 1 w2 XT 0 Z Y YT 2 w2 2 1−w2 w2 − 2 1−w2 The generalized eigenvalues of Σ1 and |λI − Σ1 Σ−1 2 | = 0.  0  Σ11 Σ−1 12 =Σ11 A + −w1 w2 α2 −w1 w2 Σ21 Σ−1 22 Σ11 Σ−1 12 = ∗   w1 2 1−w1 0 w2 2 1−w2 2 w2 1 + 2 2 1−w1 1−w2 − y+ 0  w1 w1 α1 + w2 α2    w2 1 (44) −         (45) Σ2 are the roots of 0 0 0  0 1 −1 |λI − Σ21 Σ−1 22 | =(λ − 1)|λI − Σ11 Σ12 | 4 5 TYPE1 Other parts 1 w1 2 w2 3 Other parts’ 2 w1 1 w2 4 4 TYPE2 Other parts 1 w1 2 w2 Other parts’ Other 5 6 parts 1 4 w 5 w 6 3 2 w2 TYPE3 7 Other parts 2 5 4 w Other 6 parts 1' 1 w1 3 w4 5 w 6 7 Other parts 2'  G1 : Σ21  3 w3 w3 x+ 2 w2 5 3 w4 (42) 1 w1 w3 −1 G2 : Σ12 , Σ12   =   w1 w2 w1 w2 α1 + α2  1 4 w4  T αT 1 + w1 w2 α2 P T w1 w2 αT 1 + α2 3 w3 w3 G1 : Σ11 1 = α1 + w1 w2 α2 w1 w2 2 w2 w3  1 w1 w4 In G1 and G01 , we define the column node 1 to nodes 2 to N − 1 to be α1 (setting the respective rows to the nodes in GT12 0) and the column node N to nodes 2 to N − 1 to be α2 (setting the respective rows to the nodes in GT11 0). Then in G1 and G01 , the column from node 1 to nodes 2 to N − 1 is α1 + w1 w2 α2 because node 1 can reach the nodes in GT11 directly, but reach the nodes in GT12 through node N with path weighted by w1N = w1 w2 . And the column from node N to node 2 to N − 1 is w1 w2 α1 + α2 because node N can reach the nodes in GT12 directly, but reach the nodes in GT11 through node 1 with path weighted by w1N = w1 w2 . In G01 , the column from node N + 1 to node 2 to N − 1 is w1 α1 + w2 α2 because node N + 1 can reach the nodes in GT11 through node 1 with path e1,N +1 weighted by w1 , and reach the nodes in GT12 through node N with path eN,N +1 weighted by w2 . The covariance matrices of these trees are as shown below:  −w1 w2 −w1 w2 α1  0 (46) (47) (48) So new trees have an extra unit generalized eigenvalue without changing other eigenvalues. A PPENDIX E P ROOF OF P ROPOSITION 5 λ∗ satisfies D(Σλ∗ ||Σ2 ) = D(Σλ∗ ||Σ1 ). When |Σ1 | = |Σ2 |, it will become the unique root in [0, 1] of  −1 tr Σλ∗ (Σ−1 − Σ ) = 0. We only need to prove 1 2  −1 tr Σ0.5 (Σ−1 − Σ ) = 0 before we get λ∗ = 1/2. 1 2 Fig. 5. Simplified separate grafting operation types P tr (AB) = i,j aij bij when A, B are both symmetric −1 matrices. Luckily, A = Σ0.5 and B = Σ−1 are both 1 − Σ2 −1 symmetric matrices. What’s more, B = Σ1 − Σ−1 only 2 have 2n non-zero diagonal elements and 2n pairs of non-zero non-diagonal elements, where n is the number of grafting w2 w2 operations. For example, bpp = 1−w 2 , bqq = − 1−w 2 , biq = w w 1−w2 , bip = − 1−w2 if we cut node i from node p with edge eip weighting w and paste it to node q, and there aren’t any other grafting operations involving these three nodes.  −1 So tr Σ0.5 (Σ−1 1 − Σ2 ) is a sum of 4n terms, each 4 terms respecting to one grafting operation. We can divide the polynomial into n parts corresponding each grafting  to P −1 operation, namely, tr Σ0.5 (Σ−1 − Σ ) = 1 2 k Pk . Then we only need to prove each Pt equals to 0. As Fig. 3 shows, there are three different types of grafting operations here. After simplification by using adding and merging as shown in [8], the three types of subparts can be translated as shown in Fig. 5. In this figure, we label these relevant nodes as 1, 2, 3 . . . for simplification because it doesn’t change the result if we exchange labels of nodes. Before we deal with Pk in each case, we will show Σ−1 λ is positive definite matrix. Σ1 and Σ2 are positive definite matrices, so Σ−1 and Σ−1 are positive definite matrices, 1 2 T −1 namely , z Σ1 z > 0 and zT Σ−1 2 z > 0 for any non-zero T −1 vector z. Then zT Σ−1 z = λz Σ z + zT (1 − λ)Σ−1 1 2 z > 0 λ −1 for any non-zero vector z. So Σλ is positive definite matrix and its order principal minors are invertible matrices. This result is useful in our later proof. w2 −wi 2 i We define fi = 1−w 2 and gi = 1−w 2 , so (1 + gi )gi = fi . i i Then we will prove Pk = 0 in different type of Fig. 5 later. Mij is the (i, j) minor of Σ−1 0.5 , so A. TYPE1 In this type, we focus on node 1 to 4, which is involved in this grafting operation. So Σ−1 1 =  1 + g1 f1   1 + g1 + g2 f2   f1     f 1 + g + g + g f V 2 2 3 4 3     f3 1 + g3   T (1) V K  Σ−1 2 =  1 + g1       f  1  f1 1 + g2 f2 f2 1 + g2 + g3 + g4 f3 f3 1 + g1 + g3 V T    V     (2) K where V is a 4 × (N − 4) matrix with all zero elements except v3,1 = f4 and K(1) , K(2) are covariance matrices of node 5 to N in G1 and G2 respectively. And then −1 Σ−1 1 − Σ2 = 0 f1 −f1  f1 g1   0   −g1  −f1   1 M22 =|K(3) |(1 + g1 ){(1 + g3 )(1 + g2 + g4 + g1 ) 4 1 1 + g1 (g2 + g4 )} − (1 + g1 )(1 + g3 + g1 )X 4 4 1 M44 =|K(3) |(1 + g1 ){(1 + g2 )(1 + g3 + g4 + g1 ) 4 1 1 + g1 (g3 + g4 )} − (1 + g1 )(1 + g2 + g1 )X 4 4 1 (3) 1 M12 =|K |{ f1 {(1 + g3 )(1 + g2 + g4 + g1 ) 2 2 1 1 1 1 + g1 (g2 + g4 )} + f1 f2 f3 } − f1 (1 + g3 + g1 )X 2 2 2 2 1 1 M14 =|K(3) |{ f1 {(1 + g2 )(1 + g3 + g4 + g1 ) 2 2 1 1 1 1 + g1 (g3 + g4 )} + f1 f2 f3 } − f1 (1 + g2 + g1 )X 2 2 2 2 and 2f1 (−M12 + M14 ) + g1 (M22 − M44 ) = 0 = (2f1 (−M12 + M14 ) + g1 (M22 − M44 )) |Σ0.5 | = 0 (51) B. TYPE2 In this type, we focus on node 1 to 3, which is involved in this grafting operation. So Σ−1 1 =       1 + g1 f1  f1 1 + g f2 1 + g2   f2 1 + g2 + g3   K(1) − K(2) VT 1 −1 1 −1 Σ−1 0.5 = 2 Σ1 + 2 Σ2 =  1  1 + 2 g1    1  f  2 1        1f  2 1   (50) Pk =g1 m22 − g1 m44 + 2f1 m12 − 2f1 m14  V     K(1) Σ−1 2 = 1f 2 1 1 + g1 + g2 f1 f2  f1 1 + g1   f2 1 + g2 + g3  1 + g2 + 1 g1 2 f2 f2 1 + g2 + g3 + g4 f3 f3 1 + 1 g1 + g3 2 V VT K(3)                 VT where K(3) = 12 K(1) + 12 K(2) is an invertible matrix because Σ−1 λ is positive definite matrix. And we define  0  −1 VK(3) VT =   X |K(3) |    V     K(2) where V is a 3 × (N − 3) matrix with all zero elements except v3,1 = f3 and K(1) , K(2) are covariance matrices of node 4 to N in G1 and G2 respectively. And then we use the same progress and get Pk =g2 m22 − g2 m11 + 2f2 m23 − 2f2 m13 = 0  0    1f 2 1 (49) (52) where mij is the ij-th element of Σ0.5 . 0 C. TYPE3 So Pk related to this grafting operation is g1 m22 − g1 m44 + 2f1 m12 − 2f1 m14 where mij is the ij-th element of Σ0.5 . In this type, we focus on node 1 to 5, which is involved in this grafting operation. So Σ−1 1 = f1 1 + g1 + g2 f2 1 + g4 f2 f4 f4 1 + g2 + g3 + g5 f3 f3 1 + g3 + g4 + g6 K(1) subtr ee2 1 2   1 + g1        f1          f1 1 + g2 f2 1 + g1 + g4 f2 f4 f4 1 + g2 + g3 + g5 f3 f3 1 + g3 + g4 + g6 VT V K(2)                  where V is a 5 × (N − 5) matrix with all zero elements except v4,1 = f5 , v5,2 = f6 and K(1) , K(2) are covariance matrices of node 6 to N in G1 and G2 respectively. And then we use the same progress and get Pk =g1 m22 − g1 m33 + 2f1 m12 − 2f1 m13 = 0 (53) where mij is the ij-th element of Σ0.5 . Pk = 0 in all types of grafting operations these operations  if P −1 are separate. And tr Σ0.5 (Σ−1 1 − Σ2 ) = k Pk = 0. So λ∗ = 12 if all the grafting operations in the chain are separate. A PPENDIX F P ROOF OF P ROPOSITION 6 We prove this proposition by using adding and merging operation of [8] repeatedly. For p ≤ i ≤ j ≤ q, there are q − p grafting operations in the grafting chain Tp ↔ · · · ↔ Tq . We divide these grafting operations into two sets: grafting operations from Ti to Tj and other grafting operations, namely, set 1 and set 2. We can simplify tree pairs (Tp , Tq ) and (Ti , Tj ) into (T̂p , T̂q ) and (T̃i , T̃j ) respectively by using adding and merging operation of [8] repeatedly. (T̂p , T̂q ) have all the anchor nodes of all q − p operations and the paths of backbone among these operations. (T̃i , T̃j ) have all the anchor nodes of all set 1 operations and the paths of backbone among these operations. If all the grafting operations in the chain are independent, (T̂p , T̂q ) have the same substructure with (T̃i , T̃j ) after dropping the extra nodes. So CI(T̂p ||T̂q ) ≥ (T̃i ||T̃j ) holds by Proposition 2 of [8]. And then CI(Ti ||Tj ) ≤ CI(Tp ||Tq ). Here we take a T1 ↔ T2 ↔ T3 case as an example, as shown in Fig. 6. We can simplify the calculation of CI(T1 ||T3 ) and CI(T1 ||T2 ) as shown in Fig. 6. And then Proposition 2 of [8] can tell us CI(T1 ||T3 ) ≥ CI(T1 ||T2 ). In the same way, we can conclude CI(T1 ||T3 ) ≥ CI(T2 ||T3 ). A PPENDIX G P ROOF OF P ROPOSITION 7 We want to prove CI(Σ̂1 ||Σ̂2 ) ≥ CI(Σ̃1 ||Σ̃2 ) where Σ̂i = A∗ Σi A∗ T , Σ̃i = DΣi DT for arbitrary NO × N matrix D 1 3 7 subtr ee1 subtr ee2 6 5 3 Unchanged subtree 2 subtr ee2 Unchanged subtree T2 T1 1 w1 2 w2 CI(T1||T3)=CI( CI(T1||T2)=CI( T3 3 w3 8 w7 7 w4 1 w1 2 w2w3 4 6 8 5 4 Unchanged subtree Σ−1 2 =  8 7 4 subtr ee1 6 5 3 4 2 w2 || 5 w5 6 3 w3 7 w4 || 4 w1 1 6 w7 8 ) w6 VT V                  1 2 w6  1 + g1    f1              8 7 4 subtr ee1   5 w5 2 w2w3 4 w1 1 ) Fig. 6. Example for Proposition 6 and i = 1, 2. Due to equation (19), we only need to prove D(Σ̂λ ||Σ̂2 ) ≥ D(Σ̃λ ||Σ̃2 ) and D(Σ̂λ ||Σ̂1 ) ≥ D(Σ̃λ ||Σ̃1 ) −1 −1 −1 −1 where Σ̂−1 λ = λΣ̂1 + (1 − λ)Σ̂2 and Σ̃λ = λΣ̃1 + (1 − −1 λ)Σ̃2 . In the following part, I will prove D(Σ̂λ ||Σ̂1 ) ≥ D(Σ̃λ ||Σ̃1 ) and the proof of D(Σ̂λ ||Σ̂2 ) ≥ D(Σ̃λ ||Σ̃2 ) is similar. D(Σλ ||Σ1 ) = 1X g(νi ) 2 i (54) 1 where g(νi ) = ln (λ + (1 − λ)νi ) + λ+(1−λ)ν − 1 and {νi } i are generalized eigenvalues of Σ1 and Σ2 . g(1) = 0. g(νi ) is decreasing in (0, 1) and increasing in (1) (2) (1) (2) (1) (1, +∞). If ν1 ≤ ν1 ≤ ν2 ≤ ν2 ≤ · · · ≤ νN −1 ≤ (2) (1) (1) (1) (2) νN −1 ≤ νN , we can choose µi = νi+1 for νi ≥ 1 and (1) (1) (2) (1) µi = νi for νi < 1 so that {µi } is an (N − 1) subset PN −1 PN −1 (1) (1) (2) of {νi } and 12 i=1 g(µi ) ≥ 21 i=1 g(νi ). (2) (1) If m elements of {νi } are greater than one, {µi } contains the first k elements and last N − 1 − k elements (1) of {νi }. We first introduce a preparation of proof. A. The relationship of eigenvalues 0  We have  four covariance   matrices Σ1 , Σ2 , Σ1 Σ1 m Σ p and Σ02 = T2 . mT a0 p b0 (2) (2) = (2) The eigenvalues of Σ1 Σ−1 2 are λ1 ≤ λ2 ≤ · · · ≤ λN −1 . (1) (1) (1) The eigenvalues of Σ01 Σ0−1 are λ1 ≤ λ2 ≤ · · · ≤ λN . 2 For Σ1 and Σ2 , we can find an inverse matrix P where (2) (1) (1) (2) (2) Σ1 = PΣ1 PT = Diag{λ 1 , λ2 , . . . , λN −1 } and Σ2 =  P 0(1) PΣ2 PT = I. So P0 = satisfies Σ1 = P0 Σ01 P0T = 1  (1)    I b 0(1) Σ1 a 0 0 0T and Σ2 = P Σ2 P = T , where a = b b0 aT a0 {a1 , a2 , . . . , aN −1 }T and b = {b1 , b2 , . . . , bN −1 }T . (1) So {λk } are the roots of |λΣ02 − Σ01 | = 0, which is equal to F (λ) = 0 where 0(1) F (λ) = |λΣ2 = 0(1) (1) − Σ1 | = N −1 Y λI − Σ1 λbT − aT λb − a λb0 − a0 (N −N ) (2) (λ − λi )× i=1 n o (1) −1 λb0 − a0 − (λbT − aT )(λI − Σ1 ) (λb − a) ) ( N −1 N −1 Y X fi2 (λ) (2) (55) = (λ − λi ) × f0 (λ) − (2) i=1 i=1 λ − λi 0(1) = |Σ2 |λN + N −1 X ci λ i (56) i=0 and fi (λ) = bi λ − ai . At first, we assume that there is no multiple eigenvalues for (2) (2) {λi } and fi (λi ) 6= 0 for all 1 ≤ i ≤ N − 1. So (−1) N −k (2) F (λk ) =(−1) N −k+1 2 (2) fk (λk ) N −1 Y (2) (2) (λk − λi ) i=1,i6=k >0 The generalized eigenvalues after k dimension reduction are (k+1) {λi } of size N − k. In No. (N − NO ) dimension reduction stage, we can (N −NO ) (N −NO ) always find {µi } of {λi  an NO subset   } so that P P (N −NO ) (N −NO +1) NO NO 1 1 ≥ 2 i=1 g λi because i=1 g µi 2 (57) And F (+∞) = +∞, F (−∞) = (−1)N ∞ There is at least (2) (2) one root of F (λ) = 0 in (−∞, λ1 ), (λN −1 , +∞) and (2) (2) (λi , λi+1 ) for 1 ≤ i ≤ N − 2. (1) (2) (1) (2) So we can conclude that λ1 < λ1 < λ2 < λ2 < · · · < (1) (2) (1) λN −1 < λN −1 < λN . (2) (2) If λi has multiplicity ni , we can conclude that λi has multiplicity ni − 1 in F (λ) = 0. If we put this exact multiple eigenvalues aside, other eigenvalues satisfy the ordering before. (2) (2) If fi (λi ) = 0, we can conclude that λi is also the root of F (λ) = 0. If we put this eigenvalue aside, other eigenvalues satisfy the ordering before. (1) (2) (1) (2) So for all cases, λ1 ≤ λ1 ≤ λ2 ≤ λ2 ≤ · · · ≤ (1) (2) (1) λN −1 ≤ λN −1 ≤ λN . B. Main proof For N -dimension graphs whose covariance matrices are A and B, we can do inverse linear transformation by A0 = KAKT and B0 = KBKT . Then we can do dimensionreduction from N to N − 1 by A00 = [IN −1 , 0]A0 [IN −1 , 0]T and B00 = [IN −1 , 0]B0 [IN −1 , 0]T . (1) (1) The generalized eigenvalues of A and B are λ1 ≤ λ2 ≤ (1) · · · ≤ λN , which are also generalized eigenvalues of A0 and (2) 0 B . And the generalized eigenvalues of A00 and B00 are λ1 ≤ (2) (2) (1) (2) (1) (2) λ2 ≤ · · · ≤ λN −1 . So λ1 ≤ λ1 ≤ λ2 ≤ λ2 ≤ · · · ≤ (1) (2) (1) λN −1 ≤ λN −1 ≤ λN . We can also do the procedure to reduce the dimension from (2) (3) (2) (3) N − 1 to N − 2 and get λ1 ≤ λ1 ≤ λ2 ≤ λ2 ≤ · · · ≤ (2) (3) (2) λN −2 ≤ λN −2 ≤ λN −1 . (N −N +1) (N −N ) (N −N +1) O O O O λ1 ≤ λ1 ≤ λ2 ≤ λ2 ≤ ··· ≤ (N −NO ) (N −NO +1) (N −NO ) λNO +1 ≤ λNO ≤ λNO +1 . (N −NO −1) We can always find NO subset {µi } of (N −NO −1) (N −NO ) (N −NO ) {λi } and {µi } of {λ }, which sat PNO PiNO  (N −NO )  (N −NO −1) 1 1 ≥ 2 i=1 g µi ≥ isfy 2 i=1 g µi PNO  (N −NO +1)  1 with the same reason. i=1 g λi 2 With the same method, we can conclude that there exist PNO  (1)  (1) (1) an NO subset {µi } of {λi } so that 21 i=1 g µi ≥ PNO  (N −NO +1)  (N −NO +1) 1 . If k elements of {λi } are i=1 g λi 2 (1) greater than one, {µi } contains the first k elements and last (1) NO − k elements  of {λi }. P (1) N O 1 is D(Σλ ||Σ1 ) with linear transformation i=1 g µi 2 PNO  (N −NO +1)  1 matrix Ak . 2 i=1 g λi is D(Σ̃λ ||Σ̃1 ) under arbitrary linear transformation where the arbitrariness is embodied in K. So D(Σλ ||Σ1 ) ≥ D(Σ̃λ ||Σ̃1 ) holds for arbitrary D and its corresponding Ak . In the same way, D(Σλ ||Σ2 ) ≥ D(Σ̃λ ||Σ̃2 ) holds for arbitrary D and its corresponding Ak . So CI(Σ̂1 ||Σ̂2 ) ≥ CI(Σ̃1 ||Σ̃2 ) for for arbitrary D and A∗ is the optimal matrix in the set {Ak |NO + m − N ≤ k ≤ m, k ≥ 0}.
7cs.IT
COMPUTING ALGEBRAIC MATROIDS arXiv:1403.8148v2 [math.CO] 8 Apr 2014 ZVI ROSEN Abstract. An affine variety induces the structure of an algebraic matroid on the set of coordinates of the ambient space. The matroid has two natural decorations: a circuit polynomial attached to each circuit, and the degree of the projection map to each base, called the base degree. Decorated algebraic matroids can be computed via symbolic computation using Gröbner bases, or through linear algebra in the space of differentials (with decorations calculated using numerical algebraic geometry). Both algorithms are developed here. Failure of the second algorithm occurs on a subvariety called the non-matroidal or NMlocus. Decorated algebraic matroids have widespread relevance anywhere that coordinates have combinatorial significance. Examples are computed from applied algebra, in algebraic statistics and chemical reaction network theory, as well as more theoretical examples from algebraic geometry and matroid theory. 1. Introduction Algebraic matroids have a surprisingly long history. They were studied as early as the 1930’s by van der Waerden, in his textbook Moderne Algebra [27, Chapter VIII], and MacLane in one of his earliest papers on matroids [20]. The topic lay dormant until the 70’s and 80’s, when a number of papers about representability of matroids as algebraic matroids were published: notably by Ingleton and Main [12], Dress and Lovasz [7], the thesis of Piff [24], and extensively by Lindström ([16–19], among others). In recent years, the algebraic matroids of toric varieties found application (e.g. in [22]); however, they have been primarily confined to that setting. Renewed interest in algebraic matroids comes from the field of matrix completion, starting with [14], where the set of entries of a low-rank matrix are the ground set of the algebraic matroid associated to the determinantal variety. In applied algebra in general, coordinates typically carry real-world significance, and the matroid has inherent interest as the dependence structure among those quantities. Even for varieties arising in pure mathematics, distinguished coordinates may have combinatorial meaning, in which case the matroid also provides insight. From this perspective, algebraic matroids deserve serious study, which will be aided by computational tools. Matroids have many characterizations; the computation problem tackled in this paper is to take as input a prime ideal in a polynomial ring with specified generators, and return as output the list of bases and circuits of the corresponding matroid. Two algorithms are presented in Section 2: one uses symbolic computation in the polynomial ring with Gröbner bases, while the other passes to an equivalent linear matroid, where computations can use simple linear algebra (This technique was implemented in [14]). Numerical algebraic geometry [3] also plays a helpful role in attaching algebraic “decorations” to the matroid. We use the following notation, in keeping with the standard texts [23] and [28]: Date: April 9, 2014. 1 Notation 1.1. M denotes the matroid, E the ground set of the matroid, I(M) or I the set of independent sets, B(M) or B the set of bases, C(M) or C the set of circuits, and given S ⊂ E, ρ(S) denotes the value of the matroid rank function on S. We will say that two matroids are identical, if the obvious map of ground sets induces bijection on I, B, C, ρ, etc. Definition 1.2. Let k be a field, and R = k[x1 , . . . , xn ], a polynomial ring. Let P ⊆ k[x1 , . . . , xn ] be a prime ideal. The ring S = k[x1 , . . . , xn ]/P is an integral domain, so the function field K = Frac(S) is well-defined. Let E = {x1 , . . . , xn } ⊂ K be the image of the variables under the composition of the quotient and the injection ϕ : k → S → K. Independence is defined as usual in an algebraic matroid: algebraic independence over the ground field k. M(P ) denotes the matroid obtained from a prime ideal in this manner. In fact, every algebraic matroid M can be obtained as M(P ) for some prime ideal P . Start from an algebraic matroid M of size n with ground set contained in K/k. Set the ground set E to be the image of the variables in a ring map φE : k[x1 , . . . , xn ] → K. The image of the induced map of varieties is an irreducible variety in k n . The associated prime ideal P , obtainable by implicitization satisfies M = M(P ). Despite this property, it is often convenient to study the matroid of a variety purely in terms of the variety’s parametrization. Given a map φ : k[x1 , . . . , xn ] → K, the notation M(φ) will then refer to the algebraic matroid with ground set {φ(xi ) : i = 1, . . . , n}. 1.1. Decorated Bases and Circuits. We can infuse more of the algebraic structure of the ideal into the matroid via “matroid decorations”. This approach of enhancing a matroid with more information has been taken in various forms: oriented matroids [4], arithmetic matroids [6], valuated matroids [8] and matroids over rings [9], to name a few. Circuits of algebraic matroids have a natural decoration, based on the following fact ([13, Lemma 5.6]): C = {xi1 , . . . , xik } is a circuit of M(P ) ⇐⇒ The ideal I ∩ k[C] is principal with generator θC s.t. support(θC ) = C. The generator θC of the principal ideal, called a circuit polynomial is unique up to unit. This invariant was used by Dress and Lovasz in [7] as well as Lindström in [18] in the process of proving structural facts about algebraic matroids. More recently in [13], the circuit polynomials are studied as objects of interest in their own right. If the polynomial itself is too unwieldy, we may prefer to record only some aspect of the polynomial: (1) The Newton Polytope associated to the polynomial. (2) Top-Degree: This aspect is explored in [13]. It is the vector in Nn given by (degxi θC )i∈[n] . Equivalently, it is the outer vertex of the tightest bounding box for the Newton polytope. When we try to construct points in a variety based on subsets of the coordinates, the top-degree allows us to determine the cardinality of the solution set. (3) Degree: A natural concise invariant. Remark 1.3. An open question related to the degrees is as follows: What constraints are there for a set of integers attached to the circuits of a matroid to be the degrees of circuit polynomials for some algebraic matroid? If M is a matroid with corank 1, then there is a unique circuit: the full set of variables. Assuming there is more than one variable, we can find an irreducible circuit polynomial of any degree involving the circuit variables. On the other hand, suppose that a matroid has loops. Over an algebraically closed field, the degree of a loop’s polynomial is forced to 1, since a polynomial in one variable breaks into linear factors and the polynomial must be irreducible. Over Q, on the other hand, any degree is 2 possible for a loop, since there are irreducible polynomials in every degree. (See Section 3.4 for another example where the field places constraints on the matroid decorations.) We plan to explore this question further in later research. The bases of an algebraic matroid have the following nice property (cf. [13, Definition 2.6]): {xi1 , . . . , xik } is a base of M(P ) ⇐⇒ the projection from the variety onto the i1 , . . . , ik -th coordinates is surjective with finite fibers. The cardinality of the generic fiber (or, equivalently, the degree of the projection) is the decoration on the bases and will be referred to as the base degree. 2. Algorithms and Software We will outline two strategies for computing decorated algebraic matroids: the symbolic algorithm in Section 2.1 and the linear algorithm in Section 2.2. In both approaches, an ideal in a polynomial ring is taken, and a list of bases with base degrees and a list of circuits with circuit polynomial (or alternative decoration) are returned. Within each of these regimes, we employ techniques on two different levels: oracles, which extract matroid features from the ideal, and matroid algorithms, which turn one type of matroid data (e.g. rank) into another type (e.g. circuits). Matroid algorithms are well-studied, and will not be the focus of the paper, though our software does rely upon them. In most cases, we use naı̈ve matroid algorithms, though we have also implemented sophisticated methods like ReverseSearch [1] and the circuit enumeration algorithm of Boros et al. [5] to list bases and circuits respectively. These occasionally perform better than the naı̈ve algorithms; however, in the majority of cases, they do not accelerate the computation. 2.1. Symbolic Algorithm. In the symbolic realm, elimination is at the core of the computations. It is used in the rank oracle, which will be justified by the following proposition: Proposition 2.1 (Rank Oracle). Let M(P ) be a matroid as above, and S ⊂ E. ρ(S) = |S| − ht(P ∩ k[S]). where ht denotes the height of the ideal. Based on this, elimination of E \ S followed by computation of height will serve as a rank oracle. Matroid algorithms use the rank oracle to enumerate bases and circuits. For circuits, we may also use the characterization of circuits in Section 1.1 to define a circuit oracle: test a set S by (1) computing the elimination ideal P ∩ k[S], and (2) checking that the generator has full support on the variables of S. The decoration of the circuits is a natural byproduct of the symbolic algorithm. For the base degree, fix a base B = {xi1 , . . . , xid }. Under the projection map from k n → k d onto the coordinates in the base, the preimage of a generic point (λ1 , . . . , λd ), generated randomly, is a subspace with defining ideal IB = hxis − λs | s = 1, . . . , di. The fiber of the projection then has defining ideal P + IB , and the degree of that ideal is the base degree. We have written a file matroids.m2, which implements the symbolic approach in the commutative algebra platform Macaulay2 [11]. This file can be found at: http://math. berkeley.edu/~zhrosen/matroids.html. Some important commands are listed in Table 1. 3 bases decoratedBases circuits pCircuits topDegree Input: Polynomial Ring, Ideal. Output: List of bases of the matroid M(I). Input: Polynomial Ring, Ideal. Output: List of bases of the matroid M(I) with base degree. Input: Polynomial Ring, Ideal. Output: List of circuits of the matroid M(I). Input: Polynomial Ring, Ideal. Output: List of ordered pairs: circuits of the matroid M(I) together with circuit polynomials. Degree-decorated circuits can be computed with: apply(pCircuits, c -> (c 0, degree(c 1))). Input: Polynomial Ring, Polynomial. Output: Top-degree vector of the polynomial w.r.t. the variables of the ring. Top-degree decorated circuits can be computed with: apply(pCircuits(Ring, Ideal), c -> (c 0, topDegree(Ring,c 1))). Table 1. Commands to compute algebraic matroids using matroids.m2 The code has two sources of complexity - the complexity of elimination of variables via Gröbner bases, and the combinatorial complexity of listing and testing all potential bases, resp. circuits. For this reason, the code has difficulty with large ground sets, large-rank matroids, and ideals with high degree generators. In trials, the code works quickly for matroids with |E| ≤ 18, ρ(M) ≤ 6, and generators in degree ≤ 4. For larger or higher-rank matroids, one should use a more tailored approach, as in Example 3.2. 2.2. Linear Algebra. A classical result in the study of algebraic matroids states: algebraic matroids defined over a field k of characteristic zero can also be realized as a linear matroid over a field k(T ) where T is a finite set of transcendentals ([23, Proposition 6.7.10]). In particular, when P is defined by generators hf1 , . . . , fm i ⊆ k[x1 , . . . , xn ], we define the Jacobian matrix J (P ) as:   ∂fi (1) : 1 ≤ i ≤ m, 1 ≤ j ≤ n. ∂xj This matrix, when considered as a matroid with columns as the ground set and linear independence over Frac(k[x]/P ) defining the independent sets I, represents the dual matroid to M(P ). Though the derivatives are computed symbolically in the polynomial ring k[x1 , . . . , xn ], we then consider linear algebra over the function field of the variety. When the variety is defined by a parametrization φ(t1 , . . . , td ) = (g1 (t), . . . , gn (t)), we write J (φ) for the Jacobian matrix of the following form:   ∂gj (2) : 1 ≤ i ≤ d, 1 ≤ j ≤ n. ∂ti Note that the indices in top and bottom are flipped. This matrix, again setting the columns as E and using linear independence over Frac(k[x]/P ) to define I, represents M(P ) (not its 4 dual). Since symbolic computation is more costly, certain values of x1 , . . . , xn , the ambient coordinates, can be substituted for the variables. Definition 2.2 (NM-Locus). Let the non-matroidal locus NM(I) denote the locus of points in V(I), at which the specialization of the Jacobian matrix does not represent the dual of the algebraic matroid. Similarly, NM(φ) is the set of points in the parameter space where the specialization of the Jacobian matrix does not represent the algebraic matroid. This pair of definitions specifies the values that should be avoided when specializing the linear matroid. To help describe the non-matroidal locus, we set the following notation: Id (M ) will refer to the ideal generated by d × d minors of a matrix M . Further, M {S} denotes the submatrix of M obtained by restricting to the columns with indices in S. Proposition 2.3. Let V = V(P ) be a variety of dimension d in an ambient space of dimension n, with Jacobian J (P ) representing the dual of M(P ). Then NM(P ) is defined by the ideal: \ I= In−d (J (P ){B}), B∈B(M) or, equivalently, the intersection of In−d (J (P ){S}) over all S such that In−d (J (P ){S}) 6⊆ P . In the special case where J (P ) has n − d rows, this is a principal ideal generated by the lcm of all nonzero (mod P ) maximal minors. Proof. A matroid is fully described by its list of bases. Given any cobase of M(V ), the corresponding m×(n−d) matrix has rank n−d, so some (n−d)×(n−d) minor is nonvanishing. The last fact follows from the properties of intersections of principal ideals.  Example 2.4. We compute the non-matroidal locus of a torus in R3 . Let P = h(x2 + y 2 + z 2 + 3)2 − 16(x2 + y 2 )i ⊆ R[x, y, z], the defining ideal for the torus with minor radius 1 and major radius 2. The Jacobian J (P ) is a 1 × 3 matrix: x y z 2 2 3 2 2 2 [4x + 4xy + 4xz − 20x 4x y + 4y + 4yz − 20y 4x z + 4y z + 4z 3 + 12z] 3 2 Since the dual matroid has rank 1, the non-matroidal locus NM(P ) is a principal ideal generated by the lcm of the entries. NM(P ) = h−x5 yz −2x3 y 3 z −xy 5 z −2x3 yz 3 −2xy 3 z 3 −xyz 5 +2x3 yz +2xy 3 z +2xyz 3 +15xyzi. We add the ideal to P to find the non-matroidal locus as a subvariety of the torus, and we compute the associated primes: hx, y 2 + z 2 + 4y + 3i, hx, y 2 + z 2 − 4y + 3i, hy, x2 + z 2 + 4x + 3i, hy, x2 + z 2 − 4x + 3i, hz, x2 + y 2 − 9i, hz, x2 + y 2 − 1i, hz2 + 3, x2 + y2 i, hz + 1, x2 + y 2 − 4i, hz − 1, x2 + y 2 − 4i. The boldface ideal has empty real variety, but the other 8 ideals define 8 circles around the torus, four for each generator of the fundamental group. Specializing at any point on those circles gives the wrong matroid for M(P ). The corresponding statement for parametrized varieties is given in Proposition 2.5. 5 Proposition 2.5. Let V = V(φ) be a variety of dimension d with Jacobian J (φ) representing M(φ). Then NM(φ) is defined by the ideal: \ I= Id (J (φ){B}), B∈B(M) or, equivalently, the intersection of all nonzero Id (J (φ){S}). This is a principal ideal generated by the lcm of all nonzero maximal minors. For the linear algorithm, the goal is to specialize the Jacobian at a point so that we can perform linear algebra to compute the matroid. The propositions imply that selecting a non-root of the ideal I guarantees the desired matroid. From the formulation, it is clear that the non-matroidal locus has positive codimension in the ambient variety; therefore, selection of a generic point is sufficient to guarantee that the NM-locus is avoided. For parametrized varieties, the Jacobian at a generic point is obtained simply by plugging in random numbers for each parameter. For varieties defined by ideals, a generic point can be computed using numerical algebraic geometry software; we use Bertini [2]. Remark 2.6. When we select points in the variety numerically, we often need to use very high accuracy. A set of columns may have minors with polynomial values that evaluate to zero when passed to the quotient; however, when we specialize to a point with low accuracy, we may find that the minors corresponding to these columns are  0. The required accuracy depends on the degree of the ideal generators or polynomial parametrizations. Software that computes linear matroids is then used to transform the matrix into a list of circuits and bases; we use numerical linear algebra in Sage [25], as well as its Matroid implementation. These lists are translated into a set of {0, 1} vectors that are sent back to Bertini, which computes coordinate projections in TrackType:5. Bertini performs each projection with base degree for the list of basis vectors, and degree or top-degree of the circuit polynomial for the list of circuit vectors. Bertini returns these values using numerical algebraic geometry techniques (see [3] for more details). In this mode of computation, Gröbner basis complexity is avoided; however, combinatorial complexity is still a fixture. The original calculation of the witness set can also be expensive for a high-dimensional variety and ambient space. Examples of code for Sage and Bertini are included in the aforementioned website. 3. Applications In this section, examples from different areas of mathematics will demonstrate that decorated algebraic matroids are natural and provide fundamental insight into the independence structure of a system of distinguished coordinates. As mentioned earlier this is an approach which has already been explored in matrix completion [14], and which can be applied much more broadly. 3.1. Algebraic Statistics. The first area we look into is the field of algebraic statistics. Statistical models have distinguished coordinates describing the probability of an event; the relationship among those coordinates is therefore an obvious and natural question. The decorated algebraic matroid is the way to succinctly describe the independence structure among those probabilities. In this section, we discuss two specific models from [15, 26]. 6 Example 3.1 (P L4 matroid). M(P L4 ) : |E| = 24, ρ = 4, |B| = 10560, |C| = 41346. Consider a random variable X which takes as values the permutations of the letters 1 · · · n, which correspond to rankings of a set of preferences. Probability functions pπ : Θ → [0, 1] assign probabilities to each ranking as a function of some parameters θ1 , . . . , θk . The geometry of the variety defined by the image of the pπ ’s in [0, 1]n! is the object of interest. We forget the cube and consider the variety in Cn! for simplicity. In [26, Section 7], the Plackett-Luce model is defined by: pπ 7→ n−1 Y 1 Pi j=1 θπ(j) i=1 . Since Q algebraic Pi dependence is not changed by reciprocating elements, we instead consider pπ 7→ n−1 ( i=1 j=1 θπ(j) ) for easier computation. The variety defining the Plackett-Luce model for n = 4 is 4-dimensional with degree 27; the corresponding ideal is minimally generated by 9 polynomials of degree 1 and 36 degree-2 polynomials. Since M(P L4 ) has rank 4, the matroid may be represented by an affine representation in 3-space, depicted by its Schlegel diagram in Figure 1, made with Polymake [10]. 4231 4321 4213 4312 4132 4123 1432 1423 3412 3421 1324 2413 1243 1342 1234 2143 3142 2134 3124 3241 2431 2314 3214 2341 Figure 1. Schlegel Diagram for the Affine Representation of M(P L4 ) At first glance, this arrangement looks like the vertices of a permutahedron; however, some sets expected to be contained in facets are in fact full-dimensional. The polytope has four hexagonal facets given by fixing the last element of the ranking and acting with S3 on the others. The four facets of the permutahedron corresponding to fixing the first element are triangulated. This may be due to the fact that in the parametrization the last element of the ranking does not make an appearance. (e.g. p1234 7→ x1 (x1 + x2 )(x1 + x2 + x3 )). The full matroid is too large for computation; instead, we use combinatorial tools in Sage to find 7 representatives of each base and circuit modulo the natural S4 -action on the set of variables. We will refer to distinct bases and circuits modulo the group action as base classes and circuit classes, respectively. 1. Decorated Circuits: There are five circuit classes of size 4 with orbit size 6, 12, 12, 12, 24: Polynomial: Type: 1243 2143 1234 1234 p1243 p2134 − p1234 p2143 6 3124 p21234 p2134 − p1234 p1324 p2134 − p1234 p22134 − p1324 p22134 + p21234 p2314 + p1234 p2134 p2314 12 3124 p21234 p1324 − p1234 p21324 − p21324 p2134 + p21234 p3124 12 3124 p41234 − 2p31234 p1324 + p21234 p21324 − p31234 p2134 − p21234 p1324 p2134 + 2p1234 p21324 p2134 + p1234 p1324 p22134 + p21324 p22134 − p31234 p3214 − p21234 p2134 p3214 24 3124 p21234 p2314 − 2p1234 p1324 p2314 + p21324 p2314 − p1324 p22314 +p21234 p3214 −2p1234 p1324 p3214 +p21324 p3214 + p1234 p2314 p3214 + p1324 p2314 p3214 − p1234 p23214 12 2134 1324 2134 2314 3214 1234 1324 2134 2314 3214 1234 1324 2134 2314 3214 1234 1324 2134 2314 Orbit Size: 3214 There are 1720 circuit classes of size 5, each of which has orbit size 24, yielding an additional 41, 280 circuits. Important to note here: the Macaulay2 computation ran for 10 days without producing circuit polynomials. Bertini was able to produce a witness set in approximately 8 hours and compute 1720 projections in approximately 6 hours (working in parallel). The degrees of the circuit polynomials are recorded in Figure 2. 2. Decorated Bases: The 464 classes of size 4 that are not circuits are bases. The computation of base decorations produces the distribution of base degrees in Figure 3. The highest base degree is 24, which is also the cardinality of the matroid, and the size of the symmetry group. The base of degree 24 is {p1234 , p2341 , p3412 , p4123 }. In other words, pick a ranking and apply the 4-cycle to it. The degree of the variety, which tells us 8 80 150 60 100 40 50 20 0 0 5 10 15 20 25 0 Figure 2. Circuit degree frequency. 5 10 15 20 25 Figure 3. Base degree frequency. the degree of a fiber under generic projection, is 27, indicating that all of the coordinate projections are “special.” Knowing about the decorated bases and circuits of this matroid allows us to understand its coordinate projections, and gives valuable information about reconstructing partial data. Another application of matroids to algebraic statistics is in the study of mixture models. The r-th mixture model of a pair of discrete random variables X and Y , with m and n states respectively, models the situation where X ⊥⊥ Y conditional on a “hidden” variable Z which occupies r states. In [15], the algebraic boundary of the mixture model for m = n = 4 and r = 3 is computed; it has 288 components, one of which is analyzed in the example. Studying this example gives insight into the combinatorics of all of the components of the variety, in addition to the independence structure of this particular component. Example 3.2 (Mixture Model Matroid). M(Imix ) : |E| = 16, ρ = 14, |B| = 112, |C| = 11. We examine one of the components of the algebraic boundary of the mixture model of rank 3 for 4 × 4 matrices, as defined in [15, Example 5.2]. Let Imix denote the defining ideal of this component; Imix is generated by the 4 × 4 minors of the following matrix:   p11 p12 p13 p14 0  p21 p22 p23 p24  0    p31 p32 p33 p34  p33 (p11 p22 − p12 p21 ) p41 p42 p43 p44 p41 (p12 p23 − p13 p22 ) + p43 (p11 p22 − p12 p21 ) 1. Decorated Bases: The base enumeration in this case is very quick. There are 120 subsets of size 14; checking all of them took 0.5 seconds to run in Macaulay2 before returning a list of 112 bases. The cobases are the pairs of variables for which the corresponding edge is not one of the 8 edges in Figure 4. Computation of base degree yields the following numbers: Base Degree 1 2 3 # of Bases 52 54 6 9 1 2 3 4 1 1 1 2 2 3 3 4 4 Figure 4. Non-cobases of M(Imix ). 2 3 4 Figure 5. Base degrees for M(Imix ). The blue edges in Figure 5 indicate the complements of degree-1 bases, the green edges are the degree-2 bases, and the six red edges are the degree-3 bases. 2. Decorated Circuits: The matroid has 11 circuits, which can be read from Figure 4 as the complements of each connected component of the graph; this coincidence is because the cohyperplanes have rank one. The computation checking all sets of size ≤ 11 took 3090 seconds. When we started instead from the fundamental circuits associated to some base, and checked mutual eliminations (the Boros et al algorithm), took only 2.7 seconds to produce all circuits, and another 293 seconds to verify that the list was complete. This is one example where, due to high rank, the alternative circuit enumeration algorithm is preferred. The circuit polynomials are too big to record here: the number of terms in each polynomial are 24, 27, 27, 19, 150, 136, 24, 136, 150, 150, and 150, respectively. Instead, we record relevant statistics: Circuit Complement p32 , p42 p41 p31 p34 , p44 , p14 , p24 p22 p21 p33 , p43 p11 p12 p13 p23 Circuit Top-Degree (2, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 1, 1, 0, 1, 1) (1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 0, 1, 1, 1) (1, 2, 2, 1, 1, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1) (2, 2, 2, 0, 2, 2, 2, 0, 1, 1, 1, 0, 1, 1, 1, 0) (3, 1, 3, 2, 2, 0, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2) (1, 3, 3, 2, 0, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2) (2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1) (0, 2, 2, 2, 1, 3, 3, 2, 1, 2, 2, 2, 1, 2, 2, 2) (2, 0, 2, 2, 3, 1, 3, 2, 2, 1, 2, 2, 2, 1, 2, 2) (2, 2, 0, 2, 3, 3, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2) (3, 3, 1, 2, 2, 2, 0, 2, 2, 2, 1, 2, 2, 2, 1, 2) Circuit Degree 6 6 6 6 9 9 6 9 9 9 9 These circuit statistics tell us how many completions are possible for every projection. The combinatorial characterization of this component also carries information for the global structure. Consider the action of S4 × S4 × Z2 on the labeled graph of Figure 4. The orbit of the graph has cardinality 144. Indeed, in [15, Example 5.2], it is shown that the 288 components are paired by taking the transpose of the factorization, and both components in a given pair have the same matroid. 10 3.2. Chemical Reaction Networks. In the algebraic study of chemical reaction networks (CRNs), steady-state concentrations of chemical species lie in some algebraic variety. The matroid associated to this variety may be used to design an experiment where measurements of each coordinate are obtained only through some specified costs. Then, bases of the matroid would be appropriate to measure if the goal is to find all concentrations; if we aim to test the validity of the model, a circuit may be a good choice for model rejection. (For more details, see the author’s upcoming article “Matroids for Experimental Design” with Harrington.) Example 3.3 (MAPK Network). M(IM AP K ) : |E| = 12, ρ = 3, |B| = 190, |C| = 303. This ideal comes from [21], which analyzes the polynomials defining the steady-state of a certain CRN. Each variable corresponds to the concentration of some chemical species: R = R[KS00 , KS01 , KS10 , F S01 , F S10 , F S11 , K, F, S00 , S01 , S10 , S11 ]. IM AP K = ha00 · K · S00 + b00 · KS00 + γ0100 · F S01 + γ1000 · F S10 + γ1100 · F S11 , −a01 · K · S01 + b01 · KS01 + c0001 · KS00 − α01 · F · S01 + β01 · F S01 + γ1101 · F S11 , −a10 · K · S10 + b10 · KS10 + c0010 · KS00 − α10 · F · S10 + β10 · F S10 + γ1110 · F S11 , −α11 · F · S11 + β11 · F S11 + c0111 · KS01 + c1011 · KS10 + c0011 · KS00 , a00 · K · S00 − (b00 + c0001 + c0010 + c0011 ) · KS00 , a01 · K · S01 − (b01 + c0111 ) · KS01 , a10 · K · S10 − (b10 + c1011 ) · KS10 , α01 · F · S01 − (β01 + γ0100 ) · F S01 , α10 · F · S10 − (β10 + γ1000 ) · F S10 , α11 · F · S11 − (β11 + γ1101 + γ1110 + γ1100 ) · F S11 , −a00 · K · S00 + (b00 + c0001 + c0010 + c0011 ) · KS00 − a01 · K · S01 + (b01 + c0111 ) · KS01 − a10 · K · S10 + (b10 + c1011 ) · KS10 , −α01 · F · S01 + (β01 + γ0100 ) · F S01 − α10 · F · S10 + (β10 + γ1000 ) · F S10 − α11 · F · S11 + (β11 + γ1101 + γ1110 + γ1100 ) · F S11 i. The a, b, c, α, β, and γ constants are taken to be random real numbers, i.e. a set of algebraically independent transcendentals over Q. If the rate constants are originally taken to be part of the matroid, this specialization amounts to matroid contraction. The ideal IM AP K is radical with two associated primes: (1) a variety of degree 10 and dimension 3, and (2) a coordinate subspace with ideal hF, K, F S11 , F S10 , F S01 , KS1011 , KS01 , KS00 i. In the chemical reaction, the latter component to the steady-state achieved by the disappearance of these reactants. We are interested in the rank 3 matroid associated to the former component. A quick symbolic calculation determines that the matroid has affine representation as in Figure 6. F F S11 S11 F S10 K KS10 F S01 S10 S01 KS01 KS00 S00 Figure 6. Affine representation of the MAP Kinase matroid. 1. Decorated Bases: Any non-collinear set of 3 elements from the diagram are a basis of the matroid; there are 190 in total. Of these, 52 have base degree 1, 124 have degree 2, and 14 have degree 3. 11 2. Decorated Circuits: There are circuits of size 3 and 4. The size 3 circuits are the 30 collinear sets of 3: these have degree 2 except for {S00 , S01 , S11 } and {S00 , S10 , S11 }, which have degree 3. There are 273 circuits of size 4; the degrees of the circuit polynomials have the following frequencies: Circuit Degree 2 3 4 5 6 # of Circuits 13 76 125 49 10 Possessing this data aids in experimental design, as mentioned above; however, it also distills the combinatorial essence of a chemical reaction network. This demonstrates the power of algebraic matroids in summarizing structure. 3.3. The Grassmannian. In algebraic geometry and representation theory, some important objects have a distinguished set of coordinates. For the Grassmannian Gr(r, n), the Plücker coordinates are the variables of choice. When r = 2, the Grassmannian is defined by skew-symmetric n × n matrices; this is thematically similar to the content of [13]. So, we examine the next case of interest: r = 3. Example 3.4. M(Gr(3, 6)) : |E| = 20, ρ = 10, |B| = 184, 590, |C| = 51, 005. Gr(3, 6) is the variety of 3-dimensional subspaces of C6 , with coordinates given by the Plücker coordinates pijk , with 1 ≤ i, j, k ≤ 6, distinct. The ideal of the Grassmannian is generated by 35 Plücker relations of degree 2. 1. Decorated Bases: The bases are sets of size 10. Computation is aided here by using Sage to give only one representative of each class up to the S6 action on the Grassmannian. The rest is carried out in 7 seconds by Macaulay2. There are 197 base classes of degree 1, 42 of degree 2, two of degree 3, and one of degree 7. The degree-7 base appears to be an outlier, so further examination seems appropriate. The appearing variables correspond to the triangles in the beautifully symmetric complex in Figure 7. This image is familiar as a minimal triangulation of RP2 ; we plan to explore the connection between this image and high-degree projections of the Grassmannian in future work. 5 4 2 6 3 1 6 3 5 4 2 Figure 7. Base of M(Gr(3, 6)) with base degree 7. 12 2. Decorated Circuits: For circuit computation, Sage once again proved vital in cutting down the number of required tests by a factor of approximately 6!. The testing on the circuit class representatives took 55 seconds in Macaulay2 before returning the list of circuits. There are 97 total circuit classes, with degree of circuit polynomials distributed as in Figure 8. Taking into account the full orbits of each circuit, we have 51, 005 total circuits. The only circuit class of degree 12 is obtained from our special base by adding one triangle, e.g. the variable p456 as in Figure 9. 5 4 2 40 6 3 1 20 6 3 5 4 0 2 4 6 8 10 12 2 Figure 9. Circuit of M(Gr(3, 6)) with degree 12. Figure 8. Circuit degree frequency. 3.4. Matroid Representations. There is a small collection of algebraic matroids over finite fields that are not representable as linear matroids. Note that base degree is not well-defined for these algebraic matroids, since a “generic fiber” is not well-defined. Still, computation of the corresponding ideal with circuit polynomials can give insight into the structure of the matroid. One such matroid is explored in the example: Example 3.5 (Non-Pappus Matroid). M(I) : |E| = 9, ρ = 3, |B| = 76, |C| = 86. The non-Pappus Matroid is algebraic over every finite field while not being linearly representable over any field. Since linear representability ⇐⇒ algebraic representability for fields of char. 0, this is as extreme as a matroid can be. 1 2 7 4 3 9 8 5 6 Figure 10. Non-Pappus Matroid. 13 Algebraic Matroid over F2 : Algebraic Matroid over F4 (λ 6= λ2 ): ϕ(1) ϕ(2) ϕ(3) ϕ(4) ϕ(5) ϕ(6) ϕ(7) ϕ(8) ϕ(9) = = = = = = = = = ϕ(1) ϕ(2) ϕ(3) ϕ(4) ϕ(5) ϕ(6) ϕ(7) ϕ(8) ϕ(9) x2 + y, x, x + y, y + z, y + λz, z, (λ − 1)x2 + λy + λz, x2 + y + z − z 2 , λz − x. = = = = = = = = = x, x + y, y, xz x + y + x+y , z, yz x + y + x+y , xz, xyz xy + x+y , yz. The algebraic representation on the right was used by Lindstrom in [16] to prove that the non-Pappus matroid is algebraic. The algebraic representation on the left is a valid algebraic representation over Fp2 for any p prime, used in [17] to prove an infinite algebraic characteristic set. We can be a bit more precise in assessing these matroid representations, by computing the implicit ideal of each. The representation over F2 has defining ideal generated as: ht4 + t5 + t6 , t1 + t2 + t3 , t5 t8 + t3 t9 + t5 t9 + t6 t9 , t3 t7 + t2 t9 + t3 t9 , t2 t7 + t6 t7 + t2 t9 + t5 t9 + t6 t9 , t3 t5 + t9 , t2 t5 + t7 + t9 , t23 + t3 t6 + t8 + t9 , t22 + t2 t6 + t9 i. Compiling the degrees of the circuit polynomials, we have: Degree 1 2 3 4 5 6 7 # of Circuits 2 33 24 21 4 0 2 The representation over F4 has defining ideal generated as: ht4 + t5 + (λ + 1)t6 , t3 + t5 + t9 , t2 + λt6 + t9 , t1 + λt5 + λt7 , t29 + λt5 + t6 + (λ + 1)t7 + (λ + 1)t8 , t26 + λt5 + t6 + λt7 + t8 i. The degrees of the circuit polynomials appear with the following frequency: Degree 1 2 3 4 # of Circuits 12 59 0 15 Further examination of the decorated algebraic matroid may give insight into the various possible representations of this and similar nonlinear matroids. Acknowledgments: Thanks to Bernd Sturmfels for suggesting the project and providing most of the examples. Thanks to Franz Király, Louis Theran, and Alex Fink for helpful conversations. Thanks to Dan Bates, Jon Hauenstein, and Jose Rodriguez for their help with Bertini, and to Ariel Allon and Shivaram Lingamneni for their expert coding advice. This research was supported by the NSF through grant DMS-0968882, and by the Max Planck Institute for Mathematics in Bonn. References [1] David Avis and Komei Fukuda, Reverse search for enumeration, Discrete Applied Mathematics 65 (1993), 21–46. [2] Daniel J. Bates, Jonathan D. Hauenstein, Andrew J. Sommese, and Charles W. Wampler, Bertini: Software for Numerical Algebraic Geometry. 14 [3] Daniel J. Bates, Andrew J. Sommese, Jonathan D. Hauenstein, and Charles W. Wampler, Numerically solving polynomial systems with Bertini, Software, environments, tools, vol. 25, SIAM, 2013. [4] Anders Björner, Michel Las Vergnas, Bernd Sturmfels, Neil White, and Günter M. Ziegler, Oriented matroids, Second, Encyclopedia of Mathematics and its Applications, vol. 46, Cambridge University Press, Cambridge, 1999. [5] Endre Boros, Khaled Elbassioni, Vladimir Gurvich, and Leonid Khachiyan, Algorithms for enumerating circuits in matroids, Algorithms and computation, 2003, pp. 485–494. [6] Michele D’Adderio and Luca Moci, Arithmetic matroids, the Tutte polynomial and toric arrangements, Adv. Math. 232 (2013), 335–367. [7] Andreas Dress and Lászlo Lovász, On some combinatorial properties of algebraic matroids, Combinatorica 7 (1987), no. 1, 39–48. [8] Andreas Dress and Walter Wenzel, Valuated matroids, Adv. Math. 93 (1992), no. 2, 214–250. [9] Alex Fink and Luca Moci, Matroids over a ring, ArXiv e-prints (2012), available at 1209.6571. [10] Ewgenij Gawrilow and Michael Joswig, polymake: a framework for analyzing convex polytopes, Polytopes — combinatorics and computation, 2000, pp. 43–74. [11] Daniel R. Grayson and Michael E. Stillman, Macaulay2, a software system for research in algebraic geometry. [12] Aubrey Ingleton and Roger Main, Non-algebraic matroids exist, Bull. London Math. Soc. 7 (1975), 144–146. [13] Franz Király, Zvi Rosen, and Louis Theran, Algebraic matroids with graph symmetry, ArXiv e-prints (December 2013), available at 1312.3777. [14] Franz Király, Louis Theran, Ryota Tomioka, and Takeaki Uno, The algebraic combinatorial approach for low-rank matrix completion, Pre-print. (2012). http://arxiv.org/abs/1211.4116. [15] Kaie Kubjas, Elina Robeva, and Bernd Sturmfels, Fixed points of the EM algorithm and nonnegative rank boundaries, ArXiv e-prints (December 2013), available at 1312.5634. [16] Bernt Lindström, The non-Pappus matroid is algebraic, Ars Combin. 16 (1983), no. B, 95–96. , The non-Pappus matroid is algebraic over any finite field, Utilitas Math. 30 (1986), 53–55. [17] [18] , A reduction of algebraic representations of matroids, Proc. Amer. Math. Soc. 100 (1987), no. 2, 388–389. [19] , Matroids, algebraic and nonalgebraic, Algebraic, extremal and metric combinatorics, 1986 (Montreal, PQ, 1986), 1988, pp. 166–174. [20] Saunders Mac Lane, A lattice formulation for transcendence degrees and p-bases, Duke Math. J. 4 (1938), no. 3. [21] Arjun Manrai and Jeremy Gunawardena, The geometry of multisite phosphorylation, Biophys J 95 (2008), 5533–43. [22] Hidefumi Ohsugi and Takayuki Hibi, Toric ideals and their circuits, J. Commut. Algebra 5 (2013), no. 2. [23] James Oxley, Matroid theory, Graduate Texts in Mathematics, vol. 21, Oxford University Press, 2011. [24] M. J. Piff, Some Problems in Combinatorial Theory, Ph.D. Thesis, 1972. University of Oxford. [25] William A. Stein et al., Sage Mathematics Software (Version 6.0), The Sage Development Team, 2005. http://www.sagemath.org. [26] Bernd Sturmfels and Volkmar Welker, Commutative algebra of statistical ranking, J. Algebra 361 (2012), 264–286. [27] Bartel Leendert van der Waerden, Algebra. Vol. I, Springer-Verlag, New York, 1991. Translated from the second German edition. [28] Dominic Welsh, Matroid theory, Academic Press [Harcourt Brace Jovanovich Publishers], London, 1976. L. M. S. Monographs, No. 8. Department of Mathematics, University of California, Berkeley, CA 94720 E-mail address: [email protected] 15
0math.AC
Equivalence of two Fixed-Point Semantics for Definitional Higher-Order Logic Programs∗ Angelos Charalambidis Panos Rondogiannis Ioanna Symeonidou University of Athens Athens, Greece [email protected] University of Athens Athens, Greece [email protected] University of Athens Athens, Greece [email protected] Two distinct research approaches have been proposed for assigning a purely extensional semantics to higher-order logic programming. The former approach uses classical domain-theoretic tools while the latter builds on a fixed-point construction defined on a syntactic instantiation of the source program. The relationships between these two approaches had not been investigated until now. In this paper we demonstrate that for a very broad class of programs, namely the class of definitional programs introduced by W. W. Wadge, the two approaches coincide (with respect to ground atoms that involve symbols of the program). On the other hand, we argue that if existential higher-order variables are allowed to appear in the bodies of program rules, the two approaches are in general different. The results of the paper contribute to a better understanding of the semantics of higher-order logic programming. 1 Introduction Extensional higher-order logic programming has been proposed [10, 1, 2, 7, 5, 4] as a promising generalization of classical logic programming. The key idea behind this paradigm is that the predicates defined in a program essentially denote sets and therefore one can use standard extensional set theory in order to understand their meaning and reason about them. The main difference between the extensional and the more traditional intensional approaches to higher-order logic programming [9, 6] is that the latter approaches have a much richer syntax and expressive capabilities but a non-extensional semantics. Actually, despite the fact that only very few articles have been written regarding extensionality in higher-order logic programming, two main semantic approaches can be identified. The work described in [10, 7, 5, 4] uses classical domain-theoretic tools in order to capture the meaning of higher-order logic programs. On the other hand, the work presented in [1, 2] builds on a fixed-point construction defined on a syntactic instantiation of the source program in order to achieve an extensional semantics. Until now, the relationships between the above two approaches had not yet been investigated. In this paper we demonstrate that for a very broad class of programs, namely the class of definitional programs introduced by W. W. Wadge [10], the two approaches coincide. Intuitively, this means that for any given definitional program, the sets of true ground atoms of the program are identical under the two different semantic approaches. This result is interesting since it suggests that definitional programs are of fundamental importance for the further study of extensional higher-order logic programming. On the other hand, we argue that if we try to slightly extend the source language, the two approaches give different results in general. Overall, the results of the paper contribute to a better understanding of the ∗ This research was supported by the project “Handling Uncertainty in Data Intensive Applications”, co-financed by the European Union (European Social Fund) and Greek national funds, through the Operational Program “Education and Lifelong Learning” of the National Strategic Reference Framework (NSRF) - Research Program: THALES, Investing in knowledge society through the European Social Fund. R. Matthes, M. Mio (Eds.): Fixed Points in Computer Science 2015 (FICS 2015) EPTCS 191, 2015, pp. 18–32, doi:10.4204/EPTCS.191.4 c A. Charalambidis, P. Rondogiannis & I. Symeonidou A. Charalambidis, P. Rondogiannis & I. Symeonidou 19 semantics of higher-order logic programming and pave the road for designing a realistic extensional higher-order logic programming language. The rest of the paper is organized as follows. Section 2 briefly introduces extensional higher-order logic programming and presents in an intuitive way the two existing approaches for assigning meaning to programs of this paradigm. Section 3 contains background material, namely the syntax of definitional programs and the formal details behind the two aforementioned semantic approaches. Section 4 demonstrates the equivalence of the two semantics for definitional programs. Finally, Section 5 concludes the paper with discussion regarding non-definitional programs and with pointers to future work. 2 Intuitive Overview of the two Extensional Approaches In this section we introduce extensional higher-order logic programming and present the two existing approaches for assigning meaning to programs of this paradigm. Since these two proposals were initially introduced by W. W. Wadge and M. Bezem respectively, we will refer to them as Wadge’s semantics and Bezem’s semantics respectively. The key idea behind both approaches is that in order to achieve an extensional semantics, one has to consider a fragment of higher-order logic programming that has a restricted syntax. 2.1 Extensional Higher-Order Logic Programming The main differences between extensional and intensional higher-order logic programming can be easily understood through two simple examples (borrowed from [5]). Due to space limitations, we avoid a more extensive discussion of this issue; the interested reader can consult [5]. Example 1. Suppose we have a database of professions, both of their membership and their status. We might have rules such as: engineer(tom). engineer(sally). programmer(harry). with engineer and programmer used as predicates. In intensional higher-order logic programming we could also have rules in which these are arguments, eg: profession(engineer). profession(programmer). Now suppose tom and sally are also avid users of Twitter. We could have rules: tweeter(tom). tweeter(sally). The predicates tweeter and engineer are equal as sets (since they are true for the same objects, namely tom and sally). If we attempted to understand the above program from an extensional point of view, then we would have to accept that profession(tweeter) must also hold (since tweeter and engineer are indistinguishable as sets). It is clear that the extensional interpretation in this case is completely unnatural. The program can however be understood intensionally: the predicate profession is true of the name engineer (which is different than the name tweeter). On the other hand, there are cases where predicates can be understood extensionally: 20 Equivalence of two Definitional Higher-Order LP Semantics Example 2. Consider a program that consists only of the following rule: p(Q):-Q(0),Q(1). In an extensional language, predicate p above can be intuitively understood in purely set-theoretic terms: p is the set of all those sets that contain both 0 and 1. It should be noted that the above program is also a syntactically acceptable program of the existing intensional logic programming languages. The difference is that in an extensional language the above program has a purely set-theoretic semantics. From the above examples it can be understood that extensional higher-order logic programming sacrifices some of the rich syntax of intensional higher-order logic programming in order to achieve semantic clarity. 2.2 Wadge’s Semantics The first proposal for an extensional semantics for higher-order logic programming was given in [10] (and later refined and extended in [7, 5, 4]). The basic idea behind Wadge’s approach is that if we consider a properly restricted higher-order logic programming language, then we can use standard ideas from denotational semantics in order to assign an extensional meaning to programs. The basic syntactic assumptions introduced by Wadge in [10] are the following: • In the head of every rule in a program, each argument of predicate type must be a variable; all such variables must be distinct. • The only variables of predicate type that can appear in the body of a rule, are variables that appear in its head. Programs that satisfy the above restrictions are named definitional in [10]. Example 3. The program1 : p(a). q(b). r(P,Q):-P(a),Q(b). is definitional because the arguments of predicate type in the head of the rule for r are distinct variables. Moreover, the only predicate variables that appear in the body of the same rule, are the variables in its head (namely P and Q). Example 4. The program: q(a). r(q). is not definitional because the predicate constant q appears as an argument in the second clause. For a similar reason, the program in Example 1 is not definitional. The program: p(Q,Q):-Q(a). is also not definitional because the predicate variable Q is used twice in the head of the above rule. Finally, the program: p(a):-Q(a). is not definitional because the predicate variable Q that appears in the body of the above rule, does not appear in the head of the rule. 1 For simplicity reasons, the syntax that we use in our example programs is Prolog-like. The syntax that we adopt in the next section is slightly different and more convenient for the theoretical developments that follow. A. Charalambidis, P. Rondogiannis & I. Symeonidou 21 As it is argued in [10], if a program satisfies the above two syntactic restrictions, then it has a unique minimum model (this notion will be precisely defined in Section 3). Consider again the program of Example 3. In the minimum model of this program, the meaning of predicate p is the relation {a} and the meaning of predicate q is the relation {b}. On the other hand, the meaning of predicate r in the minimum model is a relation that contains the pairs ({a}, {b}), ({a, b}, {b}), ({a}, {a, b}) and ({a, b}, {a, b}). As remarked by W. W. Wadge (and formally demonstrated in [7, 5]), the minimum model of every definitional program is monotonic and continuous2 . Intuitively, monotonicity means that if in the minimum model the meaning of a predicate is true of a relation, then it is also true of every superset of this relation. For example, we see that since the meaning of r is true of ({a}, {b}), then it is also true of ({a, b}, {b}) (because {a, b} is a superset of {a}). The minimum model of a given definitional program can be constructed as the least fixed-point of an operator that is associated with the program, called the immediate consequence operator of the program. As it is demonstrated in [10, 7], the immediate consequence operator is monotonic, and this guarantees the existence of the least fixed-point which is constructed by a bottom-up iterative procedure (more formal details will be given in the next section). Example 5. Consider the definitional program: q(a). q(b). p(Q):-Q(a). id(R)(X):-R(X). In the minimum model of the above program, the meaning of q is the relation {a, b}. The meaning of p is the set of all relations that contain (at least) a; more formally, it is the relation {r | a ∈ r}. The meaning of id is the set of all pairs (r, d) such that d belongs to r; more formally, it is the relation {(r, d) | d ∈ r}. Notice that in the construction of the minimum model, all predicates are initially assigned the empty relation. The rules of the program are then used in order to improve the meaning assigned to each predicate symbol. More specifically, at each step of the fixed-point computation, the meaning of each predicate symbol either stabilizes or it becomes richer than the previous step. Example 6. Consider again the definitional program of the previous example. In the iterative construction of the minimum model, all predicates are initially assigned the empty relation (of the corresponding type). After the first step of the construction, the meaning assigned to predicate q is the relation {a, b} due to the first two facts of the program. At this same step, the meaning of p becomes the relation {r | a ∈ r}. Also, the meaning of id becomes equal to the relation {(r, d) | d ∈ r}. Additional iterations will not alter the relations we have obtained at the first step; in other words, we have reached the fixed-point of the bottom-up computation. In the above example, we obtained the meaning of the program in just one step. If the source program contained recursive definitions, convergence to the least fixed-point would in general require more steps. 2.3 Bezem’s Semantics In [1, 2], M. Bezem proposed an alternative extensional semantics for higher-order logic programs. Again, the syntax of the source language has to be appropriately restricted. Actually, the class of programs adopted in [1, 2] is a proper superset of the class of definitional programs. In particular, Bezem proposes the class of hoapata programs which extend definitional programs: 2 The notion of continuity will not play any role in the remaining part of this paper. 22 Equivalence of two Definitional Higher-Order LP Semantics • A predicate variable that appears in the body of a rule, need not necessarily appear in the head of that rule. • The head of a rule can be an atom that starts with a predicate variable. Example 7. All definitional programs of the previous subsection are also hoapata. The following nondefinitional program of Example 4 is hoapata: p(a):-Q(a). Intuitively, the above program states that p is true of a if there exists a predicate that is defined in the program that is true of a. We will use this program in our discussion at the end of the paper. The following program is also hoapata (but not definitional): P(a,b). Intuitively, the above program states that every binary relation is true of the pair (a, b). Given a hoapata program, the starting idea behind Bezem’s approach is to take its “ground instantiation” in which we replace variables with well-typed terms of the Herbrand Universe of the program (ie., terms that can be created using only predicate and individual constants that appear in the program). For example, given the program: q(a). q(b). p(Q):-Q(a). id(R)(X):-R(X). the ground instantiation is the following infinite “program”: q(a). q(b). p(q):-q(a). id(q)(a):-q(a). p(id(q)):-id(q)(a). id(id(q))(a):-id(q)(a). p(id(id(q))):-id(id(q))(a). ··· One can now treat the new program as an infinite propositional one (ie., each ground atom can be seen as a propositional one). This implies that we can use the standard least fixed-point construction of classical logic programming (see for example [8]) in order to compute the set of atoms that should be taken as “true”. In our example, the least fixed-point will contain atoms such as q(a), q(b), p(q), id(q)(a), p(id(q)), and so on. A main contribution of Bezem’s work was that he established that the least fixed-point of the ground instantiation of every hoapata program is extensional. This notion can intuitively be explained as follows. It is obvious in the above example that the relations q and id(q) are equal (they are both true of only the constant a, and therefore they both correspond to the relation {a}). Therefore, we would expect that (for example) if p(q) is true then p(id(q)) is also true because q and id(q) should be considered as interchangeable. This property of “interchangeability” is formally defined in [1, 2] and it is demonstrated that it holds in the least fixed-point of the immediate consequence operator of the ground instance of every hoapata program. A. Charalambidis, P. Rondogiannis & I. Symeonidou 23 2.4 The Differences Between the two Approaches It is not hard to see that the two semantic approaches outlined in the previous subsections, have some important differences. First, they operate on different source languages. Therefore, in order to compare them we have to restrict Bezem’s approach to the class of definitional programs3 . The main difference however between the two approaches is the way that the least fixed-point of the immediate consequence operator is constructed in each case. In Wadge’s semantics the construction starts by initially assigning to every predicate constant the empty relation; these relations are then improved at each step until they converge to their final meaning. In other words, Wadge’s semantics manipulates relations. On the other hand, Bezem’s semantics works with the ground instantiation of the source program and, at first sight, it appears to have a more syntactic flavor. In our running example, Wadge’s approach converges in a single step while Bezem’s approach takes an infinite number of steps in order to converge. However, one can easily verify that the ground atoms that belong to the least fixed-point under Bezem’s semantics, are also true in the minimum model under Wadge’s semantics. This poses the question whether under both approaches, the sets of ground atoms that are true, are identical. This is the question that we answer positively in the rest of the paper. 3 Definitional Programs and their Semantics In this section we define the source language H of definitional higher-order logic programs. Moreover, we present in a formal way the two different extensional semantics that have been proposed for such programs, namely Wadge’s and Bezem’s semantics respectively. 3.1 Syntax The language H is based on a simple type system that supports two base types: o, the boolean domain, and ι , the domain of individuals (data objects). The composite types are partitioned into three classes: functional (assigned to function symbols), predicate (assigned to predicate symbols) and argument (assigned to parameters of predicates). Definition 1. A type can either be functional, argument, or predicate, denoted by σ , ρ and π respectively and defined as: σ := ι | (ι → σ ) π := o | (ρ → π ) ρ := ι | π We will use τ to denote an arbitrary type (either functional, argument or predicate one). As usual, the binary operator → is right-associative. A functional type that is different than ι will often be written in the form ι n → ι , n ≥ 1. Moreover, it can be easily seen that every predicate type π can be written in the form ρ1 → · · · → ρn → o, n ≥ 0 (for n = 0 we assume that π = o). We proceed by defining the syntax of H : Definition 2. The alphabet of the higher-order language H consists of the following: 1. Predicate variables of every predicate type π (denoted by capital letters such as P, Q, R, . . .). 3 Actually, we could alternatively extend Wadge’s approach to a broader class of programs. Such an extension has already been performed in [5], and we will discuss its repercussions in the concluding section. 24 Equivalence of two Definitional Higher-Order LP Semantics 2. Individual variables of type ι (denoted by capital letters such as X, Y, Z, . . .). 3. Predicate constants of every predicate type π (denoted by lowercase letters such as p, q, r, . . .). 4. Individual constants of type ι (denoted by lowercase letters such as a, b, c, . . .). 5. Function symbols of every functional type σ 6= ι (denoted by lowercase letters such as f, g, h, . . .). 6. The logical conjunction constant ∧, the inverse implication constant ←, the left and right parentheses, and the equality constant ≈ for comparing terms of type ι . The set consisting of the predicate variables and the individual variables of H will be called the set of argument variables of H . Argument variables will be usually denoted by V and its subscripted versions. Definition 3. The set of terms of the higher-order language H is defined as follows: • Every predicate variable (respectively predicate constant) of type π is a term of type π ; every individual variable (respectively individual constant) of type ι is a term of type ι ; • if f is an n-ary function symbol and E1 , . . . , En are terms of type ι then (f E1 · · · En ) is a term of type ι ; • if E1 is a term of type ρ → π and E2 a term of type ρ then (E1 E2 ) is a term of type π . Definition 4. The set of expressions of the higher-order language H is defined as follows: • A term of type ρ is an expression of type ρ ; • if E1 and E2 are terms of type ι , then (E1 ≈ E2 ) is an expression of type o. We write vars(E) to denote the set of all the variables in E. Expressions (respectively terms) that have no variables will often be referred to as ground expressions (respectively ground terms). Expressions of type o will often be referred to as atoms. We will omit parentheses when no confusion arises. To denote that an expression E has type ρ we will often write E : ρ . Definition 5. A clause is a formula p V1 · · · Vn ← E1 ∧· · ·∧Em , where p is a predicate constant, p V1 · · · Vn is a term of type o and E1 , . . . , Em are expressions of type o. The term p V1 · · · Vn is called the head of the clause, the variables V1 , . . . , Vn are the formal parameters of the clause and the conjunction E1 ∧ · · · ∧ Em is its body. A definitional clause is a clause that additionally satisfies the following two restrictions: 1. All the formal parameters are distinct variables (ie., for all i, j such that 1 ≤ i, j ≤ n, Vi 6= V j ). 2. The only variables that can appear in the body of the clause are its formal parameters and possibly some additional individual variables (namely variables of type ι ). A program P is a set of definitional program clauses. In the rest of the paper, when we refer to “clauses” we will mean definitional ones. For simplicity, we will follow the usual logic programming convention and we will write p V1 · · · Vn ← E1 , . . . , Em instead of p V1 · · · Vn ← E1 ∧ · · · ∧ Em . Our syntax differs slightly from the Prolog-like syntax that we have used in Section 2. However, one can easily verify that we can transform every program from the former syntax to the latter. Definition 6. For a program P, we define the Herbrand universe for every argument type ρ , denoted by UP,ρ to be the set of all ground terms of type ρ , that can be formed out of the individual constants, function symbols and predicate constants in the program. In the following, we will often talk about the “ground instantiation of a program”. This notion is formally defined below. A. Charalambidis, P. Rondogiannis & I. Symeonidou 25 Definition 7. A ground substitution θ is a finite set of the form {V1 /E1 , . . . , Vn /En } where the Vi ’s are different argument variables and each Ei is a ground term having the same type as Vi . We write dom(θ ) = {V1 , . . . , Vn } to denote the domain of θ . We can now define the application of a substitution to an expression. Definition 8. Let θ be a substitution and E be an expression. Then, Eθ is an expression obtained from E as follows: • Eθ = E if E is a predicate or individual constant; • Vθ = θ (V) if V ∈ dom(θ ); otherwise, Vθ = V; • (f E1 · · · En )θ = (f E1 θ · · · En θ ); • (E1 E2 )θ = (E1 θ E2 θ ); • (E1 ≈ E2 )θ = (E1 θ ≈ E2 θ ). Definition 9. Let E be an expression and θ be a ground substitution such that vars(E) ⊆ dom(θ ). Then, the ground expression Eθ is called a ground instantiation of E. A ground instantiation of a clause p V1 · · · Vn ← E1 , . . . , Em with respect to a ground substitution θ is the formula (p V1 · · · Vn )θ ← E1 θ , . . . , Em θ . The ground instantiation of a program P is the (possibly infinite) set that contains all the ground instantiations of the clauses of P with respect to all possible ground substitutions. 3.2 Wadge’s Semantics The key idea behind Wadge’s semantics is (intuitively) to assign to program predicates monotonic rem lations. In the following, given posets A and B, we write [A → B] to denote the set of all monotonic relations from A to B. Before specifying the semantics of expressions of H we need to provide the set-theoretic meaning of the types of expressions of H with respect to an underlying domain. It is customary in logic programming to take the underlying domain to be the Herbrand universe UP,ι . In the following definition we define simultaneously and recursively two things: the semantics Jτ K of a type τ and a corresponding partial order ⊑τ on the elements of Jτ K. We adopt the usual ordering of the truth values false and true, i.e. false ≤ false, true ≤ true and false ≤ true. Definition 10. Let P be a program. Then, • Jι K = UP,ι and ⊑ι is the trivial partial order that relates every element to itself; n → U . A partial order for this case is not needed; • Jι n → ι K = UP, P,ι ι • JoK = {false, true} and ⊑o is the partial order ≤ on truth values; m • Jρ → π K = [Jρ K → Jπ K] and ⊑ρ →π is the partial order defined as follows: for all f , g ∈ Jρ → π K, f ⊑ρ →π g iff f (d) ⊑π g(d) for all d ∈ Jρ K. We now proceed to define Herbrand interpretations and states. Definition 11. A Herbrand interpretation I of a program P is an interpretation such that: 1. for every individual constant c that appears in P, I(c) = c; 2. for every predicate constant p : π that appears in P, I(p) ∈ Jπ K; 3. for every n-ary function symbol f that appears in P and for all t1 , . . . tn ∈ UP,ι , I(f) t1 · · · tn = f t1 · · · tn . Equivalence of two Definitional Higher-Order LP Semantics 26 Definition 12. A Herbrand state s of a program P is a function that assigns to each argument variable V of type ρ , an element s(V) ∈ Jρ K. In the following, s[V/d] is used to denote a state that is identical to s the only difference being that the new state assigns to V the value d. Definition 13. Let P be a program, I be a Herbrand interpretation of P and s be a Herbrand state. Then, the semantics of the expressions of P is defined as follows: 1. JVKs (I) = s(V) if V is a variable; 2. JcKs (I) = I(c) if c is an individual constant; 3. JpKs (I) = I(p) if p is a predicate constant; 4. J(f E1 · · · En )Ks (I) = I(f) JE1 Ks (I) · · · JEn Ks (I); 5. J(E1 E2 )Ks (I) = JE1 Ks (I) JE2 Ks (I); 6. J(E1 ≈ E2 )Ks (I) = true if JE1 Ks (I) = JE2 Ks (I) and false otherwise. For ground expressions E we will often write JEK(I) instead of JEKs (I) since the meaning of E is independent of s. It is straightforward to confirm that the above definition assigns to every expression an element of the corresponding semantic domain, as stated in the following lemma: Lemma 1. Let P be a program and let E : ρ be an expression. Also, let I be a Herbrand interpretation and s be a Herbrand state. Then JEKs (I) ∈ Jρ K. Definition 14. Let P be a program and M be a Herbrand interpretation of P. Then, M is a Herbrand model of P iff for every clause p V1 · · · Vn ← E1 , . . . Em in P and for every Herbrand state s, if for all i ∈ {1, . . . , m}, JEi Ks (M) = true then Jp V1 · · · Vn Ks (M) = true. In the following we denote the set of Herbrand interpretations of a program P with IP . We define a partial order on IP as follows: for all I, J ∈ IP , I ⊑IP J iff for every predicate p : π that appears in P, I(p) ⊑π J(p). Similarly, we denote the set of Herbrand states with SP and we define a partial order as follows: for all s1 , s2 ∈ SP , s1 ⊑SP s2 iff for all variables V : ρ , s1 (V) ⊑ρ s2 (V). The following lemmata are straightforward to establish: Lemma 2. Let P be a program. Then, (IP , ⊑IP ) is a complete lattice. Lemma 3. Let P be a program and let E : ρ be an expression. Let I, J be Herbrand interpretations and s, s′ be Herbrand states. Then, 1. If I ⊑IP J then JEKs (I) ⊑ρ JEKs (J). 2. If s ⊑SP s′ then JEKs (I) ⊑ρ JEKs′ (I). We can now define the immediate consequence operator for H programs, which generalizes the corresponding operator for classical (first-order) programs [8]. Definition 15. Let P be a program. The mapping TP : IP → IP is called the immediate consequence operator for P and is defined for every predicate p : ρ1 → · · · → ρn → o and di ∈ Jρi K as   true there exists a clause p V1 · · · Vn ← E1 , . . . Em such that TP (I)(p) d1 · · · dn = for every state s, JEi Ks[V1 /d1 ,...,Vn /dn ] (I) = true for all i ∈ {1, . . . , m}   false otherwise. It is not hard to see that TP is a monotonic function, and this leads to the following theorem [10, 7]: Theorem 1. Let P be a program. Then MP = lfp(TP ) is the minimum, with respect to ⊑IP , Herbrand model of P. A. Charalambidis, P. Rondogiannis & I. Symeonidou 27 3.3 Bezem’s Semantics In contrast to Wadge’s semantics which proceeds by constructing the meaning of predicates as relations, Bezem’s approach takes a (seemingly) more syntax-oriented approach. In particular, Bezem’s approach builds on the ground instantiation of the source program in order to retrieve the meaning of the program. In our definitions below, we follow relatively closely the exposition given in [1, 2, 3]. Definition 16. Let P be a program and let Gr(P) be its ground instantiation. An interpretation I for Gr(P) is defined as a subset of UP,o by the usual convention that, for any A ∈ UP,o , I(A) = true iff A ∈ I. We also extend the interpretation I for every (E1 ≈ E2 ) atom as follows: I(E1 ≈ E2 ) = true if E1 = E2 and false otherwise. Observe that the meaning of (E1 ≈ E2 ) is fixed and independent of the interpretation. Definition 17. We define the immediate consequence operator, TGr(P) , of P as follows: TGr(P) (I)(A) =   true   false if there exists a clause A ← E1 , . . . , Em in Gr(P) such that I(Ei ) = true for all i ∈ {1, . . . , m} otherwise. As it is well established in bibliography (for example [8]), the least fixed-point of the immediate consequence operator of a propositional program exists and is the minimum, with respect to set inclusion and equivalently ≤, model of Gr(P). This fixed-point, which we will henceforth denote by MGr(P) , is shown in [1, 2] to be directly related to a notion of a model capable of capturing the perceived semantics of the higher-order program P. In particular, this model by definition assigns to all ground atoms the same truth values as MGr(P) . It is therefore justified that we restrict our attention to MGr(P) , instead of the aforementioned higher-order model, in our attempt to prove the equivalence of Bezem’s semantics and Wadge’s semantics. The following definition and subsequent theorem obtained in [3], identify a property of MGr(P) that we will need in the next section. Definition 18. Let P be a program and let MGr(P) be the ≤-minimum model of Gr(P). For every argument type ρ we define a corresponding partial order as follows: for type ι , we define ι as syntactical equality, i.e. E ι E for all E ∈ UP,ι . For type o, E o E′ iff MGr(P) (E) ≤ MGr(P) (E′ ). For a predicate type of the form ρ → π , E ρ →π E′ iff E D π E′ D for all D ∈ UP,ρ . Theorem 2 (-Monotonicity Property). [3] Let P be a program and MGr(P) be the ≤-minimum model of Gr(P). Then for all E ∈ UP,ρ →π and all D, D′ ∈ UP,ρ such that D ρ D′ , it holds E D π E D′ . 4 Equivalence of the two Semantics In this section we demonstrate that the two semantics presented in the previous section, are equivalent for definitional programs. To help us transcend the differences between these approaches, we introduce two key notions, namely that of the ground restriction of a higher-order interpretation and its complementary notion of the semantic extension of ground expressions. But first we present the following Substitution Lemma, which will be useful in the proofs of later results. Lemma 4 (Substitution Lemma). Let P be a program and I be a Herbrand interpretation of P. Also let E be an expression and θ be a ground substitution with vars(E) ⊆ dom(θ ). If s is a Herbrand state such that, for all V ∈ vars(E), s(V) = Jθ (V)K(I), then JEKs (I) = JEθ K(I). Equivalence of two Definitional Higher-Order LP Semantics 28 Proof. By a structural induction on E. For the basis case, if E = p or E = c then the statement reduces to an identity and if E = V then it holds by assumption. For the induction step, we first examine the case that E = (f E1 · · · En ); then JEKs (I) = I(f) JE1 Ks (I) · · · JEn Ks (I) and JEθ K(I) = I(f) JE1 θ K(I) · · · JEn θ K(I). By the induction hypothesis, JE1 Ks (I) = JE1 θ K(I), . . . , JEn Ks (I) = JEn θ K(I), thus we have JEKs (I) = JEθ K(I). Now consider the case that E = E1 E2 . We have JEKs (I) = JE1 Ks (I)JE2 Ks (I) and JEθ K(I) = JE1 θ K(I)JE2 θ K(I). Again, applying the induction hypothesis, we conclude that JEKs (I) = JEθ K(I). Finally, if E = (E1 ≈ E2 ) we have that JEKs (I) = true iff JE1 Ks (I) = JE2 Ks (I), which, by the induction hypothesis, holds iff JE1 θ K(I) = JE2 θ K(I). Moreover, we have JEθ K(I) = true iff JE1 θ K(I) = JE2 θ K(I), therefore we conclude that JEKs (I) = true iff JEθ K(I) = true. Given a Herbrand interpretation I of a definitional program, it is straightforward to devise a corresponding interpretation of the ground instantiation of the program, by restricting I to only assigning truth values to ground atoms. As expected, such a restriction of a model of the program produces a model of its ground instantiation. This idea is formalized in the following definition and theorem. Definition 19. Let P be a program, I be a Herbrand interpretation of P and Gr(P) be the ground instantiation of P. We define the ground restriction of I, which we denote by I|Gr(P) , to be an interpretation of Gr(P), such that, for every ground atom A, I|Gr(P) (A) = JAK(I). Theorem 3. Let P be a program and Gr(P) be its ground instantiation. Also let M be a Herbrand model of P and M|Gr(P) be the ground restriction of M. Then M|Gr(P) is a model of Gr(P). Proof. By definition, each clause in Gr(P) is of the form p E1 · · · En ← B1 θ , . . . , Bk θ , i.e. the ground instantiation of a clause p V1 · · · Vn ← B1 , . . . , Bk in P with respect to a ground substitution θ , such that dom(θ ) includes V1 , . . . ,Vn and all other (individual) variables appearing in the body of the clause and θ (Vi ) = Ei , for all i ∈ {1, . . . , n}. Let s be a Herbrand state such that s(V) = Jθ (V)K(M), for all V ∈ dom(θ ). By the Substitution Lemma (Lemma 4) and the definition of M|Gr(P) , Jp V1 · · · Vn Ks (M) = Jp E1 · · · En K(M) = M|Gr(P) (p E1 · · · En ). Similarly, for each atom Bi in the body of the clause, we have JBi Ks (M) = JBi θ K(M) = M|Gr(P) (Bi θ ), 1 ≤ i ≤ k. Consequently, if M|Gr(P) (Bi θ ) = true for all i ∈ {1, . . . , k}, we also have that JBi Ks (M) = true, 1 ≤ i ≤ k. As M is a model of P, this implies that Jp V1 · · · Vn Ks (M) = M|Gr(P) (p E1 · · · En ) = true and therefore M|Gr(P) is a model of Gr(P). The above theorem is of course useful in connecting the ⊑IP -minimum Herbrand model of a program to its ground instantiation. However, in order to prove the equivalence of the two semantics under consideration, we will also need to go in the opposite direction and connect the ≤-minimum model of the ground program to the higher-order program. To this end we introduce the previously mentioned semantic extensions of a ground expression. Definition 20. Let P be a program and MGr(P) be the ≤-minimum model of Gr(P). Let E be a ground expression of argument type ρ and d be an element of Jρ K. We will say that d is a semantic extension of E and write d ✄ρ E if • ρ = ι and d = E; • ρ = o and d = MGr(P) (E); • ρ = ρ ′ → π and for all d ′ ∈ Jρ ′ K and E′ ∈ UP,ρ ′ , such that d ′ ✄ρ ′ E′ , it holds that d d ′ ✄π E E′ . Compared to that of the ground restriction presented earlier, the notion of extending a syntactic object to the realm of semantic elements, is more complicated. In fact, even the existence of a semantic extension is not immediately obvious. The next lemma guarantees that not only can such an extension A. Charalambidis, P. Rondogiannis & I. Symeonidou 29 be constructed for any expression of the language, but it also has an interesting property of mirroring the ordering of semantic objects with respect to ⊑τ in a corresponding ordering of the expressions with respect to τ . Lemma 5. Let P be a program, Gr(P) be its ground instantiation and MGr(P) be the ≤-minimum model of Gr(P). For every argument type ρ and every ground term E ∈ UP,ρ 1. There exists e ∈ Jρ K such that e ✄ρ E. 2. For all e, e′ ∈ Jρ K and all E′ ∈ UP,ρ , if e ✄ρ E, e′ ✄ρ E′ and e ⊑ρ e′ , then E ρ E′ . Proof. We prove both statements simultaneously, performing an induction on the structure of ρ . Specifically, the first statement is proven by showing that in each case we can construct a function e of type ρ , which is monotonic with respect to ⊑ρ and satisfies e ✄ρ E. In the basis case, the construction of e for types ι and o is trivial. Also, if ρ = ι , then both ✄ρ and ⊑ρ reduce to equality, so we have E = E′ , which in this case is equivalent to E ρ E′ . On the other hand, for ρ = o, ✄ρ identifies with equality, while ⊑ρ and ρ identify with ≤, so we have that MGr(P) (E) = e ≤ e′ = MGr(P) (E′ ) implies E ρ E′ . For a more complex type ρ = ρ1 → · · · → ρn → o, n > 0, we can easily construct e, as follows:   true, if there exist d1 , . . . , dn and ground terms D1 , . . . , Dn such that, e e1 · · · en = for all i, di ⊑ρi ei , di ✄ρi Di and MGr(P) (E D1 · · · Dn ) = true   false, otherwise. To see that e is monotonic, consider e1 , . . . , en , e′1 , . . . , e′n , such that e1 ⊑ρ1 e′1 , . . . , en ⊑ρn e′n and observe that e e1 · · · en = true implies e e′1 · · · e′n = true, due to the transitivity of ⊑ρi . We will now show that e ✄ρ E, i.e. for all e1 , . . . , en and E1 , . . . , En such that e1 ✄ρ1 E1 , . . . , en ✄ρn En , it holds e e1 · · · en = MGr(P) (E E1 · · · En ). This is trivial if MGr(P) (E E1 · · · En ) = true, since ei ⊑ρi ei . Let us now examine the case that MGr(P) (E E1 · · · En ) = false. For the sake of contradiction, assume e e1 · · · en = true. Then, by the construction of e, there must exist d1 , . . . , dn and D1 , . . . , Dn such that, for all i, di ⊑ρi ei , di ✄ρi Di and MGr(P) (E D1 · · · Dn ) = true. By the induction hypothesis, we have that Di ρi Ei , for all i ∈ {1, . . . , n}. This, by the -Monotonicity Property of MGr(P) (Theorem 2), yields that MGr(P) (E D1 · · · Dn ) = true ≤ MGr(P) (E E1 · · · En ) = false, which is obviously a contradiction. Therefore it has to be that e e1 · · · en = false. Finally, in order to prove the second statement and conclude the induction step, we need to show that for all terms D1 ∈ UP,ρ1 , . . . , Dn ∈ UP,ρn , it holds E D1 · · · Dn o E′ D1 · · · Dn . By the induction hypothesis, there exist d1 , . . . , dn , such that d1 ✄ρ1 D1 , . . . , dn ✄ρn Dn . Because e ✄ρ E and E D1 · · · Dn is of type o, we have e d1 · · · dn = MGr(P) (E D1 · · · Dn ) by definition. Similarly, we also have e′ d1 · · · dn = MGr(P) (E′ D1 · · · Dn ). Moreover, by e ⊑ρ e′ we have that e d1 · · · dn ⊑o e′ d1 · · · dn . This yields the desired result, since ⊑o identifies with o . The following variation of the Substitution Lemma states that if the building elements of an expression are assigned meanings that are semantic extensions of their syntactic counterparts, then the meaning of the expression is itself a semantic extension of the expression. Lemma 6. Let P be a program, Gr(P) be its ground instantiation and I be a Herbrand interpretation of P. Also, let E be an expression of some argument type ρ and let s be a Herbrand state and θ be a ground substitution, both with domain vars(E). If, for all predicates p of type π appearing in E, JpK(I) ✄π p and, for all variables V of type ρ ′ in vars(E), s(V) ✄ρ ′ θ (V), then JEKs (I) ✄ρ Eθ . 30 Equivalence of two Definitional Higher-Order LP Semantics Proof. The proof is by induction on the structure of E. The basis cases E = p and E = V hold by assumption and E = c : ι is trivial. For the first case of the induction step, let E = (f E1 · · · En ), where E1 , . . . , En are of type ι . By the induction hypothesis, we have that JE1 Ks (I) ✄ι E1 θ , . . . , JEn Ks (I) ✄ι En θ . As ✄ι is defined as equality, we have that JEKs (I) = I(f) JE1 Ks (I) · · · JEn Ks (I) = f E1 θ · · · En θ = Eθ and therefore JEKs (I) ✄ι Eθ . For the second case, let E = E1 E2 , where E1 is of type ρ1 = ρ2 → π and E2 is of type ρ2 ; then, JEKs (I) = JE1 Ks (I) JE2 Ks (I). By the induction hypothesis, JE1 Ks (I) ✄ρ2 →π E1 θ and JE2 Ks (I) ✄ρ2 E2 θ , thus, by definition, JEKs (I) = JE1 Ks (I) JE2 Ks (I) ✄π E1 θ E2 θ = (E1 E2 )θ = Eθ . Finally, we have the case that E = (E1 ≈ E2 ), where E1 and E2 are both of type ι . The induction hypothesis yields JE1 Ks (I) ✄ι E1 θ and JE2 Ks (I) ✄ι E2 θ or, since ✄ι is defined as equality, JE1 Ks (I) = E1 θ and JE2 Ks (I) = E2 θ . Then JE1 Ks (I) = JE2 Ks (I) iff E1 θ = E2 θ and, equivalently, JEKs (I) = true iff Eθ = true, which implies JEKs (I) ✄o Eθ . We are now ready to present the main result of this paper. The theorem establishes the equivalence of Wadge’s semantics and Bezem’s semantics, in stating that their respective minimum models assign the same meaning to all ground atoms. Theorem 4. Let P be a program and let Gr(P) be its ground instantiation. Let MP be the ⊑IP -minimum Herbrand model of P and let MGr(P) be the ≤-minimum model of Gr(P). Then, for every A ∈ UP,o it holds JAK(MP ) = MGr(P) (A). Proof. We will construct an interpretation N for P and prove some key properties for this interpretation. Then we will utilize these properties to prove the desired result. The definition of N is as follows: For every p : ρ1 → · · · → ρn → o and all d1 ∈ Jρ1 K, . . . , dn ∈ Jρn K   false, if there exist e1 , . . . , en and ground terms E1 , . . . , En such that, N(p) d1 · · · dn = for all i, di ⊑ρi ei , ei ✄ρi Ei and MGr(P) (p E1 · · · En ) = false   true, otherwise Observe that N is a valid Herbrand interpretation of P, in the sense that it assigns elements in Jπ K (i.e. functions that are monotonic with respect to ⊑π ) to every predicate of type π in P. Indeed, if it was not so, then for some predicate p : π = ρ1 → · · · → ρn → o, there would exist tuples (d1 , . . . , dn ) and (d1′ , . . . , dn′ ) with d1 ⊑ρ1 d1′ , . . . , dn ⊑ρn dn′ , such that N(p) d1 · · · dn = true and N(p) d1′ · · · dn′ = false. By definition, the fact that N(p) d1′ · · · dn′ is assigned the value false, would imply that there exist e1 , . . . , en and E1 , . . . , En as in the above definition, such that MGr(P) (p E1 · · · En ) = false and d1′ ⊑ρ1 e1 , . . . , dn′ ⊑ρn en . Being that ⊑ρi are transitive relations, the latter yields that d1 ⊑ρ1 e1 , . . . , dn ⊑ρn en . Therefore, by definition, N(p) d1 · · · dn should also evaluate to false, which constitutes a contradiction and thus confirms that the meaning of p is monotonic with respect to ⊑π . It is also straightforward to see that N(p) ✄π p, i.e. for all d1 , . . . , dn and all ground terms D1 , . . . , Dn such that d1 ✄ρ1 D1 , . . . , dn ✄ρn Dn , we have N(p) d1 · · · dn = MGr(P) (p D1 · · · Dn ). Because di ⊑ρi di , this holds trivially if MGr(P) (p D1 · · · Dn ) = false. Now let MGr(P) (p D1 · · · Dn ) = true and assume, for the sake of contradiction, that N(p) d1 · · · dn = false. Then, by the definition of N, there must exist e1 , . . . , en and E1 , . . . , En such that, for all i, di ⊑ρi ei , ei ✄ρi Ei and MGr(P) (p E1 · · · En ) = false. Thus, by the second part of Lemma 5, for all i, Di ρi Ei and, by the -Monotonicity Property of MGr(P) , MGr(P) (p D1 · · · Dn ) ≤ MGr(P) (p E1 · · · En ), which is obviously a contradiction. Thus we conclude that N(p) d1 · · · dn = true. Next we prove that N is a model of P. Let p V1 · · · Vn ← B1 , . . . , Bk be a clause in P and let {V1 , . . . , Vn , X1 , . . . , Xm }, with Vi : ρi , for all i ∈ {1, . . . , n}, and Xi : ι , for all i ∈ {1, . . . , m}, be the set of A. Charalambidis, P. Rondogiannis & I. Symeonidou 31 variables appearing in the clause. Then, it suffices to show that, for any tuple (d1 , . . . , dn ) of arguments and any Herbrand state s such that s(Vi ) = di for all i ∈ {1, . . . , n}, N(p) d1 · · · dn = false implies that, for at least one j ∈ {1, . . . , k}, JB j Ks (N) = false. Again, by the definition of N, we see that if N(p) d1 · · · dn = false, then there exist e1 , . . . , en and ground terms E1 , . . . , En such that MGr(P) (p E1 · · · En ) = false, d1 ⊑ρ1 e1 , . . . , dn ⊑ρn en and e1 ✄ρ1 E1 , . . . , dn ✄ρn En . Let θ be a ground substitution such that θ (Vi ) = Ei for all i ∈ {1, . . . , n} and, for all i ∈ {1, . . . , m}, θ (Xi ) = s(Xi ); then there exists a ground instantiation p E1 · · · En ← B1 θ , . . . , Bk θ of the above clause in Gr(P). As MGr(P) is a model of the ground program, MGr(P) (p E1 · · · En ) = false implies that there exists at least one j ∈ {1, . . . , k} such that MGr(P) (B j θ ) = false. We are going to show that the latter implies that JB j Ks (N) = false, which proves that N is a model of P. Indeed, let s′ be a Herbrand state such that s′ (Vi ) = ei ✄ρi θ (Vi ) = Ei for all i ∈ {1, . . . , n} and s′ (Xi ) = θ (Xi ) = s(Xi ) for all i ∈ {1, . . . , m}. As we have shown earlier, N(p′ ) ✄π ′ p′ for any predicate p′ : π ′ , thus by Lemma 6 we get JB j Ks′ (N) ✄o B j θ . Since B j is of type o, the latter reduces to JB j Ks′ (N) = MGr(P) (B j θ ) = false. Also, because di ⊑ρi ei , i.e. s ⊑SP s′ , by the second part of Lemma 3 we get JB j Ks (N) ⊑o JB j Ks′ (N), which makes JB j Ks (N) = false. Now we can proceed to prove that, for all A ∈ UP,o , JAK(MP ) = MGr(P) (A). Let A be of the form p E1 · · · En , where p : ρ1 → · · · → ρn → o ∈ P and let d1 = JE1 K(MP ), . . . , dn = JEn K(MP ). As we have shown, N is a Herbrand model of P, while MP is the minimum, with respect to ⊑IP , of all Herbrand models of P, therefore we have that MP ⊑IP N. By definition, this gives us that MP (p) d1 · · · dn ⊑o N(p) d1 · · · dn (1) and, by the first part of Lemma 3, that d1 ⊑ρ1 JE1 K(N), . . . , dn ⊑ρn JEn K(N) (2). Moreover, for all predicates p′ : π ′ in P, we have N(p′ ) ✄π ′ p′ and thus, by Lemma 6, taking s and θ to be empty, we get JEi K(N) ✄ρi Ei , 1 ≤ i ≤ n. In conjunction with (2), the latter suggests that if MGr(P) (p E1 · · · En ) = false then N(p) d1 · · · dn = false, or, in other words, that N(p) d1 · · · dn ≤ MGr(P) (p E1 · · · En ). Because of (1), this makes it that MP (p) d1 · · · dn ≤ MGr(P) (p E1 · · · En ) (3). On the other hand, by Theorem 3, MP |Gr(P) is a model of Gr(P) and therefore MGr(P) (p E1 · · · En ) ≤ MP |Gr(P) (p E1 · · · En ), since MGr(P) is the minimum model of Gr(P). By the definition of Gr(P) and the meaning of application, the latter becomes MGr(P) (p E1 · · · En ) ≤ MP |Gr(P) (p E1 · · · En ) = MP (p E1 · · · En ) = MP (p) JE1 K(MP ) · · · JEn K(MP ) = MP (p) d1 · · · dn . The last relation and (3) can only be true simultaneously, if all the above relations hold as equalities, in particular if MGr(P) (p E1 · · · En ) = Jp E1 · · · En K(MP ). 5 Discussion We have considered the two existing extensional approaches to the semantics of higher-order logic programming, and have demonstrated that they coincide for the class of definitional programs. It is therefore natural to wonder whether the two semantic approaches continue to coincide if we extend the class of programs we consider. Unfortunately this is not the case, as we discuss below. A seemingly mild extension to our source language would be to allow higher-order predicate variables that are not formal parameters of a clause, to appear in its body. Such programs are legitimate under Bezem’s semantics (ie., they belong to the hoapata class). Moreover, a recent extension of Wadge’s semantics [5] also allows such programs. However, for this extended class of programs the equivalence of the two semantic approaches no longer holds as the following example illustrates. Example 8. Consider the following extended program: p(a):-Q(a). 32 Equivalence of two Definitional Higher-Order LP Semantics Following Bezem’s semantics, we initially take the ground instantiation of the program, namely: p(a):-p(a). and then compute the least model of the above program which assigns to the atom p(a) the value false. On the other hand, under the approach in [5], the atom p(a) has the value true in the minimum Herbrand model of the initial program. This is due to the fact that under the semantics of [5], our initial program reads (intuitively speaking) as follows: “p(a) is true if there exists a relation that is true of a”; actually, there exists one such relation, namely the set {a}. This discrepancy between the two semantics is due to the fact that Wadge’s semantics is based on sets and not solely on the syntactic entities that appear in the program. Future work includes the extension of Bezem’s approach to higher-order logic programs with negation. An extension of Wadge’s approach for such programs has recently been performed in [4]. More generally, the addition of negation to higher-order logic programming appears to offer an interesting and nontrivial area of research, which we are currently pursuing. References [1] Marc Bezem (1999): Extensionality of Simply Typed Logic Programs. In Danny De Schreye, editor: Logic Programming: The 1999 International Conference, Las Cruces, New Mexico, USA, November 29 - December 4, 1999, MIT Press, pp. 395–410. [2] Marc Bezem (2001): An Improved Extensionality Criterion for Higher-Order Logic Programs. In Laurent Fribourg, editor: Computer Science Logic, 15th International Workshop, CSL 2001. 10th Annual Conference of the EACSL, Paris, France, September 10-13, 2001, Proceedings, Lecture Notes in Computer Science 2142, Springer, pp. 203–216, doi:10.1007/3-540-44802-0_15. [3] Marc Bezem (2002): Hoapata programs are monotonic. In: Proceedings NWPT02, Institute of Cybernetics at TTU, Tallinn, pp. 18–20. [4] Angelos Charalambidis, Zoltán Ésik & Panos Rondogiannis (2014): Minimum Model Semantics for Extensional Higher-order Logic Programming with Negation. TPLP 14(4-5), pp. 725–737, doi:10.1017/ S1471068414000313. [5] Angelos Charalambidis, Konstantinos Handjopoulos, Panagiotis Rondogiannis & William W. Wadge (2013): Extensional Higher-Order Logic Programming. ACM Trans. Comput. Log. 14(3), p. 21, doi:10.1145/ 2499937.2499942. [6] Weidong Chen, Michael Kifer & David Scott Warren (1993): HILOG: A Foundation for Higher-Order Logic Programming. Journal of Logic Programming 15(3), pp. 187–230, doi:10.1016/0743-1066(93)90039-J. [7] Vassilis Kountouriotis, Panos Rondogiannis & William W. Wadge (2005): Extensional Higher-Order Datalog. In: Short Paper Proceeding of the 12th International Conference on Logic for Programming, Artificial Intelligence and Reasoning (LPAR), pp. 1–5. [8] John W. Lloyd (1987): Foundations of Logic Programming. Springer Verlag, doi:10.1007/ 978-3-642-83189-8. [9] Dale Miller & Gopalan Nadathur (2012): Programming with Higher-Order Logic, 1st edition. Cambridge University Press, New York, NY, USA, doi:10.1017/CBO9781139021326. [10] William W. Wadge (1991): Higher-Order Horn Logic Programming. In Vijay A. Saraswat & Kazunori Ueda, editors: Logic Programming, Proceedings of the 1991 International Symposium, San Diego, California, USA, Oct. 28 - Nov 1, 1991, MIT Press, pp. 289–303.
6cs.PL
MagNet and “Efficient Defenses Against Adversarial Attacks” are Not Robust to Adversarial Examples Nicholas Carlini David Wagner University of California, Berkeley arXiv:1711.08478v1 [cs.LG] 22 Nov 2017 Abstract In this short paper, we demonstrate these three defenses are not effective on the MNIST [5] and CIFAR-10 [4] datasets. We show that we are able to bypass MagNet with greater than 99% success, and the latter two with 100%, with only a slight increase in distortion. We defeat MagNet by making use of the transferability [11] property of adversarial examples: the adversary trains their own copy of the defense, constructs adversarial examples on their model, and supplies these adversarial examples to the defender. It turns out that these examples will also fool the defender’s model. We defeat “Efficient Defenses Against Adversarial Attack” and APE-GAN by showing that existing attack can defeat them with 100% success without modification. Adversarial examples are not more visually detectable than an undefended network. MagNet and “Efficient Defenses...” were recently proposed as a defense to adversarial examples. We find that we can construct adversarial examples that defeat these defenses with only a slight increase in distortion. 1 Introduction It is an open question how to train neural networks so they will be robust to adversarial examples [11]. Recently, three defenses have been proposed to make neural networks robust to adversarial examples: • MagNet [8] was proposed as an approach to make neural networks robust against adversarial examples through two complementary approaches: adversarial examples near the data manifold are reformed to lie on the data manifold that are classified correctly, whereas adversarial examples far away from the data manifold are detected and rejected before classification. MagNet does not argue robustness in the white-box setting; rather, the authors argue that MagNet is robust in the grey-box setting where the adversary is aware the defense is in place, knows the parameters of the base classifier, but not the parameters of the defense. 2 Background We assume familiarity with neural networks [5], adversarial examples [11], transferability [6], generating strong attacks against adversarial examples [1] and MagNet [8]. We briefly review the key details and notation. Notation Let F (x) = y be a neural network used for classification outputting a probability distribution. Call the second-to-last layer (the layer before the the softmax layer) Z, so that F (x) = softmax(Z(x)). Each output yi corresponds to the predicted probability that the object x is labelled as class i. Let C(x) = arg maxi F (xi ) correspond to the classification of x on F . In this paper we are concerned with neural networks used to classify images (on MNIST and CIFAR-10). • An efficient defense [12] was proposed to make neural networks more robust against adversarial examples by performing Gaussian data augmentation during training, and using the BReLU activation function. The authors do not claim perfect security, but claim this makes attacks visually detectable. Adversarial examples [11] are instances x0 that are very close to a normal instance x with respect to some distance metric (L2 distance, in this paper), but where C(x0 ) = t for any target t chosen by the adversary. We generate adversarial examples with Carlini and Wagner’s L2 attack algorithm [1]. Specifically, we solve • Adversarial Perturbation Elimination GAN (APEGAN) [10] is similar to MagNet, only adversarial examples are projected onto the data manifold using a Generative Adversarial Network (GAN) [2]. We did not set out to bypass this defense, but found it to be very similar to MagNet and so we analyze it too. minimize kx0 − xk22 + c · `(x0 ) 1 where the loss function ` is defined as Efficient Defenses Against Adversarial Attacks [12] works by making two modifications to standard neural networks. First, the authors propose use of the Bounded ReLU activation function, defined as BReLU (x) = min(max(x, 0), 1) instead of standard ReLU [9] which is unbounded above. Second, instead of training on the standard training data {(xi , yi )}ni=1 they train on {(xi +Ni , yi )}ni=1 where Ni ∼ N (0, σ 2 ) is chosen fresh for each training instance. On MNIST, σ = 0.3; for CIFAR, σ = 0.05. The authors claim that despite training on noise, it is successful on [1]. `(x0 ) = max(max{Z(x0 )i : i 6= t} − Z(x0 )t , 0). and the constant c is chosen via binary search. Perhaps the most surprising property of adversarial examples is transferability [11]: given two different models that perform the same task, trained on different datasets, adversarial examples constructed to fool one one model often fool the other as well. This effect can be amplified [6] by constructing the adversarial examples to fool multiple local models before applying it to the target model. MagNet [8] was recently proposed as a defense to adversarial examples under the grey box threat model: here, the adversary is aware that MagNet is being used to secure a given classifier, as well as the parameters of the classifier, but is not aware of the parameters of the defensive models. MagNet has two defense components: APE-GAN [10] works by constructing a pre-processing network G(·) trained to project both normal instances and adversarial examples back to the data manifold as done in MagNet. The network G is trained with a GAN instead of an auto-encoder. Note that unlike a standard GAN which takes as input a noise vector and must produce an output image, the generator in APE-GAN takes in an adversarial example and must make it appear nonadversarial. During training, the authors train on adversarial examples generated with the Fast Gradient Sign algorithm [3]; despite this, the authors claim robustness on a wide range of attacks (including [1]). 1. The detector examines inputs and decides if they are adversarial or benign. There can be multiple detectors, in which case if any report “adversarial” the input is rejected. 2. The reformer takes inputs classified as benign by the detector(s) and reforms them to remove any remaining minor adversarial nature to the instances. The defender trains multiple reformers and selects one at random, to prevent the adversary from learning its parameters. Defense Models. We take the MagNet implementation from the authors’ open-source code 1 and train our own models. Since the provided code does not include an implementation of the CIFAR defense and classifier, we implement it as described in the paper. We were unable to obtain source code for “Efficient Defenses...”. We therefore re-implement the proposed defense based on the description in the paper. We take the APE-GAN implementation from the authors opensource code 2 . We use the C&W attack given by the authors. We also release our code 3 4 5 . The authors argue these defenses complement each other: the detector should be able to detect any adversarial examples with large distortion and are far away from the true data manifold. The reformer takes instances which are close to the data manifold and maps them directly on to the manifold to remove any minor adversarial perturbations that may not have been detected. The specific instantiation of the detector and reformer suggested by the authors are based on auto-encoders. Given an auto-encoder AE, to detect if an input is adversarial, compare the mean squared error kx − AE(x)k2 with a threshold τ chosen to minimize the false positive rate. On CIFAR, the authors suggest one further detector: compute the Jensen-Shannon divergence JSD(F (x)/T, F (AE(x))/T ) with temperature T (set to 10 and 40), and report “adversarial” if the difference is greater than a different threshold τ 0 , also chosen to minimize the false positive rate. Similarly, to reform an adversarial example run it through the auto-encoder and let x ← AE(x): since the auto-encoder is trained to reconstruct typical instances, this operation projects it back to the data manifold. 3 Breaking MagNet We demonstrate MagNet is not robust by generating transferable adversarial examples with Carlini and Wagner’s L2 attack. To do this, we (as the adversary) train 32 local auto-encoders to use as detectors and reformers (different than the 16 the defender will use). To generate 1 https://github.com/Trevillie/MagNet 2 https://github.com/shenqixiaojiang/APE-GAN 3 https://github.com/carlini/MagNet 4 https://github.com/carlini/breaking_ efficient_defenses 5 https://github.com/carlini/APE-GAN 2 Dataset Model Success Distortion (L2 ) MNIST Unsecured MagNet 100% 99% 1.64 2.25 CIFAR Unsecured MagNet 100% 100% 0.30 0.45 Table 1: The success rate of our attack on MagNet. The last column shows the mean distance to the nearest targeted adversarial example, across the first 1000 test instances, with the target chosen uniformly at random from the incorrect classes. adversarial examples, we modify the optimization formulation to the following, where reformers are denoted Rj and the detectors Dj : minimize kx0 − xk22 + c · `c (x0 ) + d · `d (x0 ) where the classifier loss function `c is defined as X `c (x0 ) = max(max Z(Rj (x0 ))i − Z(Rj (x0 ))t , −κ) j i6=t Figure 1: MagNet targeted adversarial examples for each source/target pair of images on MNIST. We achieve a 99% grey-box success (the 7 → 6 attack failed to transfer). and the detector loss function `d is defined as X `d (x0 ) = max(Dj (x0 ) − τj , 0). j Here, c and d are chosen via binary search simultaneously. The threshold τj is chosen such that 1% of validation images are detected as adversarial. (The true defender sets their remote τ to reject only 0.1% of instances [8]: ours is more strict to help the attack construct adversarial examples that fool the remote detectors more often.) We set the confidence κ = 1 so that the adversarial examples are more likely to transfer. We attack by performing 10000 iterations of gradient descent with a learning rate of 10−2 . We did not perform hyperparameter search (e.g., picking 32 auto-encoders, κ = 1, τj = 0.01); improved search over these parameters would yield lower distortion adversarial examples. Figures 1 and 2 contain images of targeted adversarial examples on on the secured network, and Table 1 the mean distortion required across the first 1000 instances of the test set with targets chosen uniformly at random among the incorrect classes. Figure 2: MagNet targeted adversarial examples for each source/target pair of images on CIFAR. We achieve a 100% grey-box success. 3 Dataset Model MNIST Unsecured BReLU Gaussian Noise Gaussian Noise + BReLU 2.04 2.14 2.66 2.58 Unsecured BReLU Gaussian Noise Gaussian Noise + BReLU 0.56 0.58 0.66 0.67 CIFAR Distortion (L2 ) Success Distortion (L2 ) MNIST Unsecured APE-GAN 100% 100% 2.04 2.17 CIFAR Unsecured APE-GAN 100% 100% 0.43 0.72 Investigating APE-GAN’s Failure. Why are we able to fool APE-GAN? We compare (a) the mean distance between the original inputs and the adversarial examples, and (b) the mean distance between the original inputs and the recovered adversarial examples. We find that the recovered adversarial examples are less similar to the original than the adversarial examples. Specifically, the mean distortion between the adversarial examples and the original instances is 4.3, whereas the mean distortion between the recovered instances and original instances is 5.8. This indicates that what our adversarial examples have done is fool the generator G into giving reconstructions that are even less similar from the original than the adversarial example. This effect can be observed in Figure 4: faint lines introduced become more pronounced after reconstruction. Breaking “Efficient Defenses...” We demonstrate this defense is not robust by generating adversarial examples with Carlini and Wagner’s L2 attack. We do nothing more than apply the attack to the defended network. Figure 3 contains images of adversarial examples on the secured network, and Table 2 the mean distortion required across the first 1000 instances of the test set with targets chosen at random among the incorrect classes. On MNIST, the full defense increases mean distance to the nearest adversarial example by 30%, and on CIFAR by 20%. This is in contrast with other forms of retraining, such as adversarial retraining [7], which increase distortion by a significantly larger amount. Interestingly, we find that BReLU provides some increase in distortion when trained without Gaussian augmentation, but when trained with it, does not help. 5 Model Table 3: APE-GAN does not significantly increase robustness to adversarial examples on the MNIST or CIFAR-10 datasets. Table 2: Neither adding Gaussian data augmentation during training nor using the BReLU activation significantly increases robustness to adversarial examples on the MNIST or CIFAR-10 datasets; success rate is always 100%. 4 Dataset 6 Conclusion As this short paper demonstrates, MagNet is not robust to transferable adversarial examples, and combining Gaussian data augmentation and BReLU activations does not significantly increase the robustness of a neural network against strong iterative attacks. Surprisingly, we found that while all three defenses take different approaches to increasing the robustness against adversarial examples, they all give approximately the same increase in robustness (∼ 30%). We recommend that researchers who propose defenses attempt adaptive white-box attacks against their schemes before claiming robustness. Or, if arguing security in the grey-box threat model, we recommend researchers generate adversarial examples targeting the specific defense by using a copy of that defense as the source model. Just because the adversary is not aware of the exact parameters, does not mean the best that can be done is to transfer from an unsecured model: as we have shown here, transfering from a local copy of the model improves the attack success rate. Breaking APE-GAN We demonstrate APE-GAN is not robust by generating adversarial examples with Carlini and Wagner’s L2 attack. We do nothing more than apply the attack to defended network. That is, we change the loss function to account for the fact that the manifold-projection is done before classification. Specifically, we let `(x0 ) = max(max{Z(G(x0 ))i : i 6= t} − Z(G(x0 ))t , 0) and solve the same minimization formulation. Figure 4 contains images of adversarial examples on APE-GAN, and Table 3 the mean distortion required across the first 1000 instances of the test set with targets chosen at random among the incorrect classes. 4 References [1] N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. IEEE Symposium on Security and Privacy, 2017. [2] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. WardeFarley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014. [3] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. [4] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. [5] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [6] Y. Liu, X. Chen, C. Liu, and D. Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016. (a) (b) (c) (a) (b) [7] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. (c) Figure 3: Attacks on “Efficient Defenses...” on MNIST and CIFAR-10: (a) original reference image; (b) adversarial example on the defense with only BReLU; (c) adversarial example on the complete defense with Gaussian noise and BReLU. [8] D. Meng and H. Chen. MagNet: a two-pronged defense against adversarial examples. In ACM Conference on Computer and Communications Security (CCS), 2017. arXiv preprint arXiv:1705.09064. [9] V. Nair and G. E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807– 814, 2010. [10] S. Shen, G. Jin, K. Gao, and Y. Zhang. APE-GAN: Adversarial Perturbation Elimination with GAN. arXiv preprint arXiv:1707.05474, 2017. [11] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. ICLR, 2013. [12] V. Zantedeschi, M.-I. Nicolae, and A. Rawat. Efficient defenses against adversarial attacks. arXiv preprint arXiv:1707.06728, 2017. (a) (b) (c) (a) (b) (c) Figure 4: Attacks on APE-GAN on MNIST and CIFAR-10: (a) original reference image; (b) adversarial example on APEGAN; (c) reconstructed adversarial example. 5
2cs.AI
arXiv:1303.6011v1 [math.FA] 25 Mar 2013 THE INVERSE FUNCTION THEOREM AND THE RESOLUTION OF THE JACOBIAN CONJECTURE IN FREE ANALYSIS J. E. PASCOE Abstract. We establish an invertibility criterion for free polynomials and free functions evaluated on some tuples of matrices. We show that if the derivative is nonsingular on some domain closed with respect to direct sums and similarity, the function must be invertible. Thus, as a corollary, we establish the Jacobian conjecture in this context. Furthermore, our result holds for commutative polynomials evaluated on tuples of commuting matrices. 1. Introduction A free map is a function defined on some structured subset of tuples of matrices that respects joint invariance. For the purposes of introduction, the standard example is a free polynomial being evaluated on tuples of matrices. We give a formal defintion in Section 2. We consider the inverse function theorem for free maps. Classically, the inverse function theorem states that given a map f , if Df (x) is nonsingular for some x, then there is a neighborhood U of x such that f −1 is well-defined on f (U ). Our inverse function theorem is as follows. Theorem 1.1 (Inverse function theorem). Let f be a free map. The following are equivalent: (1) Df (X) is a nonsingular map for every X. (2) f is injective. (3) f −1 exists and is a free map. In the classical case, one may obtain a neighborhood of x where the derivative is nonsingular. The geometry of free analysis is not exactly topological due noted algebraic obstructions such as those observed in the work of D. S. KaliuzhnyiVerbovetskyi and V. Vinnikov [9], and Amitsur and Levitzki [2]. Thus, we assert nonsingularity of the derivative on the entire domain in our theorem, and, in return, we obtain a global result. We prove the inverse function theorem result in Section 3. We also consider a famous conjecture of Ott-Heinrich Keller, the so-called Jacobian conjecture [10]. Question 1.2. Let P : CN → CN be a polynomial map. If the Jacobian DP (x) is invertible for every x ∈ CN , is the map P itself invertible? James Ax [3] and Alexander Grothendieck [5] independently showed that if a polynomial map P : CN → CN is injective, then it must be surjective. Furthermore, 2010 Mathematics Subject Classification. Primary 46L52; Secondary 14A25, 47A56. 1 2 J. E. PASCOE a proof in [12] shows that the inverse must be given by a polynomial via techniques from Galois theory. We prove a free Ax-Grothendieck theorem as Theorem 4.4. The following is an immediate corollary of our inverse function theorem combined with the results in the preceeding paragraphs. Theorem 1.3 (Free Jacobian conjecture). Let M(C)N be the set of matrix N tuples. Suppose P : M(C)N → M(C)N is a free polynomial map. The following are equivalent: (1) DP (X) is a nonsingular map for each X. (2) P is injective. (3) P is bijective. (4) P −1 exists and P −1 |Mn (C)N agrees with free polynomial. We prove this result in Section 4. We remark the last condition could be conjectured to be that P −1 is a bona fide free polynomial. However, we caution that degree bounds in the Ax-Grothendieck theorem are very large [4], and the theory of polynomial identity rings supplies many low degree polynomial identities satisfied by all matrix tuples of a specific size [2]. This means that there are a plethora of maps that have polynomial formulas for each specific size of matrix, but are not actually given by some polynomial. Additionally, we immediately obtain a matrix version of the commutative Jacobian conjecture via another application of the inverse function theorem. In this case, we do obtain true polynomials for the inverse map, because commutative polynomials are determined by their values on the scalars. Theorem 1.4 (Commuting matrix Jacobian conjecture). Let P : CN → CN . The following are equivalent: (1) DP (X) is an nonsingular map for each commuting matrix N -tuple X. (2) P is injective. (3) P is bijective. (4) P −1 exists and P −1 is given by a polynomial. We prove this result in Section 4. We caution that the structure of free maps greatly simplifies their geometry. The Jacobian conjecture in the classical context is notoriously difficult, but in the matricial context is shown here to be tractable. Indeed, free maps have generally been observed to encode nonlocal data in many contexts which is in strong contrast to the classical case. For another example, compare between Putinar’s Positivstellensatz [11] to Helton’s noncommutative Positivstellensatz [6]. 1.1. Some examples of domains of invertibility. We briefly give some examples of applications of our main result, the inverse function theorem for free maps. 1.1.1. Domains of inveribility for squaring. Take the function f (X) = X 2 . Suppose we want to find a domain where f is invertible. We obtain a derivative for f given by the formula Df (X)[H] = XH + HX. Thus, by the inverse function theorem, we need the equation XH + HX = 0 THE INVERSE FUNCTION THEOREM 3 to have no nontrivial solutions for each X in our domain. This is a degenerate form of the famous Sylvester equation, so this will be nonsingular if X has no eigenvalues in common with −X. For a detailed account of the Sylvester equation, see Horn and Johnson [8]. Thus, if we take a subset H ⊂ C such that H ∩ −H = ∅, and lift to the set of matrices with spectrum in H, then f will be invertible there. In fact, these are all possible maximal domains for such an inverse. 1.1.2. The quadratic symmetrization map. Consider, f (X, Y ) = (X + Y, X 2 + Y 2 ). Taking the derivative, Df (X, Y )[H, K] = (H + K, HX + XH + KY + Y K). So we need to check the second coordinate of the derivative is nonzero when H = −K. So, we want H(X − Y ) + (X − Y )H = 0 to have no nontrivial solutions. By the same use of Sylvesters equation as in the first example, this exactly says X − Y needs to have spectrum disjoint from Y − X. 1.1.3. A more exotic quadratic map. Now consider the function f (X) = (X + X 2 + [X, Y ], Y + [X, Y ]). Taking the derivative, Df (X, Y )[H, K] = (H + HX + HX + [H, Y ] + [X, K], K + [H, Y ] + [X, K]). Suppose this had a nontrivial solution at some (X, Y ) for (H, K). Either kHk ≥ kKk or kKk ≥ kHk. In the case where kHk ≥ kKk, H 6= 0, and kH + HX + XH + [H, Y ] + [X, K]k ≥ kHk(1 − 4kXk − 2kY k). So, it must be that 1 − 4kXk − 2kY k ≤ 0. In the case where kKk ≥ kHk, K 6= 0, and kK + [H, Y ] + [X, K]k ≥ kKk(1 − 2kXk − 2kY k) So, it must be that 1 − 2kXk − 2kY k ≤ 0. Restricting f to the set of (X, Y ) such that 4kXk + 2kY k < 1 precludes Df from being singular. However, this fails to be a free domain since it is not closed with repect to direct sums. (See Section 2 for a formal definition of a free domain.) However, if we restrict f to the set of (X, Y ) such that kXk < 81 and kY k < 41 we do indeed obtain a free map, and thus by the inverse function theorem, the function f will be invertible there. 2. Free analysis S Let Mn be the n × n matrices. We denote MN = MN n. A free set D ⊂ MN is closed under direct sums and joint similarity. That is, (1) A, B ∈ D ⇒ A ⊕ B ∈ D, −1 (2) A ∈ D ∩ MN AS ∈ D. n , S ∈ GLn ⇒ S 4 J. E. PASCOE Where (A1 , A2 , . . . , AN ) ⊕ (B1 , B2 , . . . , BN ) = (A1 ⊕ B1 , A2 ⊕ B2 , . . . , AN ⊕ BN ), and S −1 (A1 , A2 , . . . , AN )S = (S −1 A1 S, S −1 A2 S, . . . , S −1 AN S). A prototypical example of such a set is the zero set of some free polynomial map. For example, the commuting tuples of matrices form a free set. We define a free domain D ⊂ MN to be either a free set or, if working over a local field, a set that is relatively open in its orbit under conjugation by invertible matrices and is closed under direct sums. Any function on a free domain extends to a function on a free set as in the envelope method described in [9]. A free map f : D → MN̂ obeys the following (1) f (A ⊕ B) = f (A) ⊕ f (B), (2) f (S −1 AS) = S −1 f (A)S, (3) D is a free domain. This definition of free sets and free maps is a direct generalization of the definition given in Helton-Klep-McCullough [7]; in the language of Agler-McCarthy [1] this generalizes functions on basic open sets in their free topology. Essentially, these maps are an emulation of the classical functional calculus for non-commuting tuples of operators. We note that we do not specify a ground ring for the matrices in the general inverse function theorem; it merely needs to have a multiplicative identity. 2.1. Derivatives in free analysis. Helton, Klep and McCullough differentiated free maps in [7]. They obtained the formula     X H f (X) Df (X)[H] (2.1) f = . 0 X 0 f (X) These types of formulas are pervasive throughout the free analysis literature. For other references see Voiculescu [14] and the recently completed tome by D. S. Kaliuzhnyi-Verbovetskyi and V. Vinnikov [9]. Formula 2.1 can be seen to be true for formal differentiation satisfying Leibniz rule. Thus, we eschew any analytic means for obtaining the derivative, and instead use the above as our definition. That is, our results formally hold over any field, or indeed unital ring, and for sets that may have cusps or other exotic geometric features. We formalize the above in the following proposition. Proposition 2.2. Define  Hi , if i = j D(Xi )[Hj ] = , 0, if i 6= j and require D(f + g)[H] = D(f )[H] + D(g)[H], and D(f g)[H] = D(f )[H]g + f D(g)[H]. Equation 2.1 is satisfied. THE INVERSE FUNCTION THEOREM 5 Proof. We only need to prove this fact on monomials. This is obtained inductively via the following algebra:        m(X) Dm(X)[H] X H X i Hi X i Hi m = 0 m(X) 0 Xi 0 X 0 Xi =   Xi m(X) Xi Dm(X)[H] + Hi m(X) 0 Xi m(X) =   Xi m(X) D(Xi m(X))[H] . 0 Xi m(X)  3. The inverse function theorem We now prove the inverse function theorem. Proof. (¬1 ⇒ ¬2) Suppose Df is singular at some X and some direction H 6= 0. That is, Df (X)[H] = 0. So, applying 2.1 and the direct sum formula,     X H f (X) Df (X)[H] f = 0 X 0 f (X)   f (X) 0 0 f (X) =  X f 0 = 0 X  This equality witnesses the noninjectivity of f. (1 ⇒ 2) Suppose Df (X) is not singular at any X. Let X1 , X2 be two matrices of the same size such that f (X1 ) = f (X2 ). Let  1 0  S= 0 0 0 1 0 0 0 0 1 0  1 0 . 0 1 Let,  X1 0 X = 0 0 0 X2 0 0 0 0 X1 0  0 0 . 0 X2  X1  0 S −1 XS =  0 0 0 X2 0 0 0 0 X1 0  X1 − X2  0 ,  0 X2 Note, 6 J. E. PASCOE and, since  f (X1 ) 0  0 f (X 2) f (X) =   0 0 0 0  0 0   0  f (X2 ) 0 0 f (X1 ) 0 because f preserves direct sums, we obtain the fomula  f (X1 ) 0 0  0 f (X2 ) 0 −1  S f (X)S =  0 0 f (X1 ) 0 0 0  f (X1 ) − (X2 )  0 .  0 f (X2 ) So, via the similarity relation for free maps,  X1 0 f 0 0 0 X2 0 0 0 0 X1 0    f (X1 ) 0 0 f (X1 ) − f (X2 ) X1 − X2    0 f (X2 ) 0 0 0 . =    0 0 f (X1 ) 0 0 0 0 0 f (X2 ) X2 Thus, since we assumed f (X1 ) = f (X2 ),  X1 0 f 0 0 0 X2 0 0 0 0 X1 0    f (X1 ) 0 0 0 X1 − X2   0 0 f (X2 ) 0 0  = .   0 0 0 f (X1 ) 0  X2 0 0 0 f (X2 ) On the other hand, by 2.1,  X1 0 f 0 0 0 X2 0 0 0 0 X1 0        0 X1 − X2 X1 − X2 X1 0 X1 0 Df  f 0 X2  0 0  X2 0  0 = .    0 X1 0 0 f X2 0 X2 So, Df  X1 0 0 X2     0 X1 − X2 0 0 = . 0 0 0 0 Thus, X1 − X2 = 0, since we assumed Df (X)[H] is nonsingular for all X in the domain, or equivalently that Df (X)[H] = 0 implies H = 0. So, f is injective. (2 ⇔ 3) We leave this to the reader. It is similar to a proof in Helton-KlepMcCullough [7].  THE INVERSE FUNCTION THEOREM 7 4. Polynomial maps In this section we recall some classical results from algebraic geometry which we will use to prove the Jacobian conjecture for free polynomials and commuting matrix polynomials, and subsequently give these proofs. Ott-Heinrich Keller infamously suggested the following conjecture. Question 4.1 (Jacobian conjecture). Let P : CN → CN be a polynomial map. If DP (x) is nonsingular for every x, must P necesarily be invertible? Furthermore, can the inverse be taken to be a polynomial? James Ax and Alexander Grothendieck independently proved the following seemingly related result about polynomial maps. Theorem 4.2 (Ax-Grothendieck theorem [3], [5]). Let P : CN → CN be a polynomial map. If P is injective, then P is surjective. This reduces the Jacobian conjecture to showing the condition on the derivative implying global injectivity. Furthermore, this result has been refined to the following. Theorem 4.3 (Ax-Grothendieck theorem[12]). Let P : CN → CN be a polynomial map. If P is injective, then P is surjective and P −1 is given by a polynomial. This tacitly gives an equivalence between a polynomial map being invertible and having a polynomial inverse. This can be lifted to the free case. Theorem 4.4 (Free Ax-Grothendieck theorem). Let P : M(C)N → M(C)N be a free polynomial map. If P is injective, then P is surjective and P −1 |MN is given n by a free polynomial. Proof. For each size of matrix n, we view P as a tuple of dn2 commuting polynomials by replacing the free variables with indeterminant n by n matices. Since P |Mn (C)N is injective, P −1 |Mn (C)N is given by a tuple of dn2 commuting polynomials. Since the global P −1 is a free map by the inverse function theorem and continuous free maps are analytic, they have a power series of free polynomials[9], the restriction P −1 |Mn (C)N must agree with a free polynomial; the terms in the power series for P −1 must eventually vanish on all of Mn (C)N .  We now prove the the Jacobian conjecture for free polynomials, Theorem 1.3. Proof of Theorem 1.3. (1 ⇔ 2) follows from the inverse function theorem. (2 ⇔ 3 ⇔ 4) is the free Ax-Grothendieck theorem.  We now prove the the Jacobian conjecture for commuting matrix polynomials, Theorem 1.4. Proof of Theorem 1.3. (1 ⇔ 2) follows from the inverse function theorem. (2 ⇒ 4) The function P |M1 (C)N has a polynomial inverse P −1 by the AxGrothendieck theorem. Since P |M1 (C)N is equal to P as a polynomial, we indeed obtained global inverse. (The values on the scalars determine a commutative polynomial.) (4 ⇒ 3 ⇒ 2) is trivial.  8 J. E. PASCOE References [1] J. Agler and J.E. McCarthy. On the approximation of holomorphic functions in several noncommuting variables by free polynomials. in progress. [2] A. S. Amitsur and J. Levitzki. Minimal identities for algebras. Proc. Amer. Math. Soc., 1:449–463, 1950. [3] James Ax. The elementary theory of finite fields. Ann. of Math., 88(2):239–271, 1968. [4] Hyman Bass, Edwin H. Connell, and David Wright. The jacobian conjecture: reduction of degree and formal expansion of the inverse. Bull. Amer. Math. Soc., 7:287–330, 1982. [5] Alexander Grothendieck. Eléments de géométrie algébrique IV. Publications Mathematiques de l’IHES, 1966. [6] Bill Helton. Positive noncommutative polynomials are sums of squares. Ann. of Math., 159:675–694, 2002. [7] J. William Helton, Igor Klep, and Scott McCullough. Proper analytic free maps. Journal of Functional Analysis, 260(5):1476 – 1490, 2011. [8] R.A. Horn and C.R. Johnson. Matrix Analysis. Cambridge University Press, Cambridge, 1985. [9] D. S. Kaliuzhnyi-Verbovetskyi and V. Vinnikov. Foundations of Noncommutative Function Theory. ArXiv e-prints, 2012. [10] Ott-Heinrich Keller. Ganze cremona-transformationen. Monatshefte für Mathematik und Physik, 47:299–306, 1939. [11] M. Putinar. Positive polynomials on compact sets. Indiana Math. J., 42:969–984, 1993. [12] Walter Rudin. Injective polynomial maps are automorphisms. American Mathematical Monthly, 102(6):540–543, 1995. [13] Dan-Virgil Voiculescu. Free analysis questions. I: Duality transform for the coalgebra of ∂X:B . International Math. Res. Notices, 16:793–822, 2004. [14] Dan-Virgil Voiculescu. Free analysis questions. II: The Grassmannian completion and the series expansions at the origin. J. Reine Angew. Math., 645:155–236, 2010.
0math.AC
1 Control Barrier Function Based Quadratic Programs for Safety Critical Systems arXiv:1609.06408v2 [math.OC] 5 Dec 2016 Aaron D. Ames, Xiangru Xu, Jessy W. Grizzle, Paulo Tabuada Abstract—Safety critical systems involve the tight coupling between potentially conflicting control objectives and safety constraints. As a means of creating a formal framework for controlling systems of this form, and with a view toward automotive applications, this paper develops a methodology that allows safety conditions—expressed as control barrier functions— to be unified with performance objectives—expressed as control Lyapunov functions—in the context of real-time optimizationbased controllers. Safety conditions are specified in terms of forward invariance of a set, and are verified via two novel generalizations of barrier functions; in each case, the existence of a barrier function satisfying Lyapunov-like conditions implies forward invariance of the set, and the relationship between these two classes of barrier functions is characterized. In addition, each of these formulations yields a notion of control barrier function (CBF), providing inequality constraints in the control input that, when satisfied, again imply forward invariance of the set. Through these constructions, CBFs can naturally be unified with control Lyapunov functions (CLFs) in the context of a quadratic program (QP); this allows for the achievement of control objectives (represented by CLFs) subject to conditions on the admissible states of the system (represented by CBFs). The mediation of safety and performance through a QP is demonstrated on adaptive cruise control and lane keeping, two automotive control problems that present both safety and performance considerations coupled with actuator bounds. objective of this paper is to develop a methodology to design controllers enforcing safety objectives expressed in terms of invariance of a given set, and performance/stability objectives, expressed as the asymptotic stabilization of another given set. Motivated by the use of Lyapunov functions to certify stability properties of a set without calculating the exact solution of a system, the underlying concept in this paper is to use barrier functions to certify forward invariance of a set, while avoiding the difficult task of computing the system’s reachable set. Prior work in [1] incorporates into a single feedback law the conditions required to simultaneously achieve asymptotic stability of an equilibrium point, while avoiding an unsafe set. Importantly, if the stabilization and safety objectives are in conflict, then no feedback law can be proposed. In contrast, the approach developed here will pose a feedback design problem that mediates the safety and stabilization requirements, in the sense that safety is always guaranteed, and progress toward the stabilization objective is assured when the two requirements “are not in conflict” [2]. The essential differences in these approaches will be highlighted through a realistic example. Index Terms—Control Lyapunov function, Barrier function, Nonlinear control, Quadratic program, Safety, Set invariance Barrier functions were first utilized in optimization; see Chapter 3 of [3] for an historical account of their use in optimization. More recently, barrier functions were used in the paper [4] to develop an interior penalty method for converting constrained optimal control methods into unconstrained ones1 . Barrier functions are now common throughout the control and verification literature due to their natural relationship with Lyapunov-like functions [5], [6], their ability to establish safety, avoidance, or eventuality properties [7], [8], [9], [10], [11], and their relationship to multi-objective control [12]. Two notions of a barrier function associated with a set C are commonly utilized: one that is unbounded on the set boundary, i.e., B(x) → ∞ as x → ∂C, termed a reciprocal barrier function here, and one that vanishes on the set boundary, h(x) → 0 as x → ∂C, called a zeroing barrier function here. In each case, if B or h satisfy Lyapunov-like conditions, then forward invariance of C is guaranteed. The natural extension of a barrier function to a system with control inputs is a Control Barrier Function (CBF), first proposed by [6]. In many ways, CBFs parallel the extension of Lyapunov functions to Control Lyapunov functions (CLFs), as pioneered in [13], [14], [15] I. I NTRODUCTION Cyber-physical systems have at their core tight coupling between computation, control and physical behavior. One of the difficulties in designing cyber-physical systems is the need to meet a large and diverse set of objectives by properly designing controllers. While it is tempting to decompose the problem into the design of a controller for each individual objective and then integrate the resulting controllers via software, the integration problem is far from being a simple one. Examples abound in, e.g., robotic and automotive systems, of unexpected and unintended interactions between controllers resulting in catastrophic behavior. In this paper we address a specific instance of this problem: how to synthesize a controller enforcing the different, and occasionally conflicting, objectives of safety and performance/stability. The overarching This research is supported by NSF CPS Awards 1239055, 1239037 and 1239085. A. D. Ames is with the Dept. of Mechanical and Civil Engineering, California Institute of Technology, Pasadena CA, [email protected]. X. Xu and J. W. Grizzle are with the Dept. of Electrical Engineering and Computer Science, University of Michigan, Ann Arbor, MI, {xuxiangr, grizzle}@umich.edu. P. Tabuada is with the Dept. of Electrical Engineering, University of California at Los Angles, Los Angles, CA, [email protected]. A. Background 1 Although the techniques employed are different from ours, there are conceptual similarities as can be seen by noticing the similarity between (2)(4) defined later in our paper and the inequalities appearing in Proposition 4, item (g), in [4] characterizing membership to the set used to define a Gauge function. 2 and studied in depth in [16]. In each case, the key point is to impose inequality constraints on the derivative of a candidate CBF (resp., CLF) to establish entire classes of controllers that render a given set forward invariant (resp., stable). The Lyapunov-like conditions that define a (control) barrier function are intrinsically coupled to the class of controllers that achieve forward invariance of a set C. As emphasized in [17] and [18], it is therefore essential to consider how one defines the evolution of a barrier function away from the set boundary, as this will translate directly to conditions imposed on a CBF. In the case of reciprocal barrier functions, existing formulations impose invariant level sets of B [5], via, Ḃ ≤ 0, as was done in earlier work on zeroing barrier functions (or barrier certificates) [11] via ḣ ≥ 0; yet, in both cases, these conditions are too restrictive on the interior of C. B. Contributions The first contribution of this paper is to formulate conditions on the derivative of a (reciprocal or zeroing) barrier function that are minimally restrictive on the interior of C. These conditions will be formulated with an eye toward their extension to control barrier functions. It is clear that less restrictive conditions for a barrier function will translate into a control barrier function that admits a larger set of inputs compatible with controlled invariance; this will be important when integrating performance with safety later in the paper. Less obvious considerations include robustness of a controlled invariant set to model perturbations, Lipschitz continuity of feedbacks achieving controlled invariance, and, as pointed out by [10] for barrier certificates, convexity of the set of control barrier functions when computing them numerically. For reciprocal barrier functions, we allow for B to grow when it is far away from the boundary of C in that we only require that Ḃ ≤ α(1/B), for a class-K function α. In the case of zeroing barrier functions, we adopt a condition of the form ḣ ≥ −α(h). The latter condition may be somewhat surprising in view of the well-known Nagumo’s Theorem, which states that for a system without inputs and a C 1 function h, the condition ḣ ≥ 0 on ∂C is necessary and sufficient for the zero superlevel set to be invariant. Importantly, under mild conditions on C, it is demonstrated that the conditions we propose are also necessary and sufficient for forward invariance, and result in the relationships shown in Fig. 1. Moreover, it is shown how our conditions lead to Lipschitz continuity of control laws, robustness, and convexity of the class of control barrier functions. Safety-critical control problems often include performance objectives, such as stabilization to a point or a surface, in addition to safety constraints. An important novelty of the present paper is that a Quadratic Program (QP) is used to “mediate” these (potentially conflicting) specifications: stability and safety. The motivation for this solution comes from [19], [20], [21], which developed CLFs to exponentially stabilize periodic orbits in a class of hybrid systems. The experimental realization of CLF inspired controllers on a bipedal robot resulted in the observation that, since CLF conditions are affine in torque, they can be formulated as QPs [22]. Moreover, this Theorem 1: RBF Int(C) is invariant Propositions 1 and 3: ZBF C is invariant (Assume C is compact) Theorem 2: RBF Int(C) is invariant (Assume C is compact and contractive) ZBF Fig. 1. Relationships among reciprocal barrier functions (RBFs), zeroing barrier functions (ZBFs), and forward invariance that are developed in the paper. The underlying analysis can be found in Theorem 1, Proposition 1, Proposition 3 and Theorem 2. The relations established for barrier functions then extend to control barrier functions. perspective allows for the consideration of multiple control objectives (expressed via multiple CLFs) together with forceand torque-based constraints [23], [24]. The present paper extends these ideas by unifying CBFs and CLFs through QPs. In particular, given a control objective (expressed through a CLF) and an admissible set in the state space (expressed via a CBF), we formulate a QP that mediates the tradeoff of achieving a stabilization objective subject to ensuring the system remains in a safe set. In particular, relaxation is used to make the stability objective a soft constraint on the QP, while safety is maintained as a hard constraint. In this way, safety and stability do not need to be simultaneously satisfiable, and continuity of the resulting control law is provably maintained. An alternative approach to controlled invariance has been developed in [25], [26], [27], [28], [29] under the name of invariance control. This elegant body of work is based on an extension of Nagumo’s condition to functions h of higher relative degree [30], namely, it focuses on derivative conditions on the boundary of the controlled-invariant set. As a consequence, the control law is discontinuous, such as in sliding mode control, and as in sliding mode control, chattering may occur. We, however, establish a control framework that yields checkable conditions for Lipschitz continuous control laws and well-defined solutions of the closed-loop system. This is important from a theoretical point of view as well as the practical benefit of avoiding chattering. The consideration of the existence of solutions to the closed-loop system is one of the important differences between barrier certificates for dynamical systems and control barrier functions for control systems. The CBF-CLF-based QPs are illustrated on two automotive safety/convenience problems; namely, Adaptive Cruise Control (ACC) and Lane Keeping (LK) [31], [32], [33], [34]. ACC is being developed and deployed on passenger vehicles due to its promise to enhance driver convenience, safety, traffic flow, and fuel economy [35], [36], [37]. It is a multifaceted control problem because it involves asymptotic performance objectives (drive at a desired speed), subject to safety constraints (maintain a safe distance from the car in front of you), and constraints based on the physical characteristics of the car and road surface (bounded acceleration and deceleration). A key challenge is that the various objectives can often be in 3 conflict, such as when the desired cruising speed is faster than the speed of the leading car, while provably satisfying the safety-oriented constraints is of paramount importance. Lane keeping, maintaining a vehicle between the lane markers [38], is another safety-related problem that we use to illustrate the methods developed in this paper. A preliminary version of this work was presented in the conference publications [2] and [39]. The present paper adds to those two papers in the following important ways: the relations between the two forms of barrier functions are characterized; barriers with a higher relative degree are considered; the adaptive cruise control problem is extended from the lead vehicle’s speed being constant to the more realistic case of varying speed with bounded input force; and the lane keeping problem is considered under the proposed QP framework. A. Reciprocal Barrier Functions C. Organization and Notation Motivated by the barrier method in optimization [40], consider the logarithmic barrier function candidate   h(x) . (6) B(x) = − log 1 + h(x) The remainder of the paper is organized as follows. Two barrier functions, specifically, reciprocal barrier functions and zeroing barrier functions, are formulated in Sect. II, and are extended to control barrier functions in Sect. III. Quadratic programs that unify control Lyapunov functions and control barrier functions are introduced in section IV. The theory developed in the paper is illustrated on the adaptive cruise control and lane keeping problems in Sect. V, with simulations reported in Sect. VI. Conclusions are provided in Sect. VII. Notation: R, R+ 0 denote the set of real, non-negative real numbers, respectively. Int(C) and ∂C denote the interior and boundary of the set C, respectively. The open ball in Rn with radius ε ∈ R+ and center at 0 is denoted by Bε = {x ∈ Rn | kxk < ε}. The Minkowsky sum of two sets R ⊆ Rn and S ⊆ Rn is denoted by R ⊕ S. The distance from x to a set S is denoted by kxkS = inf s∈S kx − sk. For any essentially bounded function g : R → Rn , the infinity norm of g is denoted by kgk∞ = ess supt∈R kg(t)k. A continuous function β1 : [0, a) → [0, ∞) for some a > 0 is said to belong to class K if it is strictly increasing and β1 (0) = 0. A continuous function β2 : [0, b) × [0, ∞) → [0, ∞) for some b > 0 is said to belong to class KL, if for each fixed s, the mapping β2 (r, s) belongs to class K with respect to r and for each fixed r, the mapping β2 (r, s) is decreasing with respect to s and β2 (r, s) → 0 as s → ∞. II. R ECIPROCAL AND Z EROING BARRIER F UNCTIONS This section studies two notions of barrier functions and investigates their relationships with forward invariance of a set. Consider a nonlinear system of the form ẋ = f (x) 1) Motivation: Given a closed set C ⊂ Rn , we determine conditions on functions B : Int(C) → R such that Int(C) is forward invariant. These conditions will motivate the formulation of the barrier functions considered in this paper. Assume that the set C is defined as C = {x ∈ Rn : h(x) ≥ 0}, (2) Int(C) = {x ∈ Rn : h(x) > 0}, (4) Int(C) 6= ∅ and Int(C) = C. (5) ∂C = {x ∈ R : h(x) = 0}, where h : Rn → R is a continuously differentiable function. Later, it will also be assumed that C is nonempty and has no isolated point, that is, Note that this function satisfies the important properties inf x∈Int(C) B(x) ≥ 0, (7) lim B(x) = ∞. x→∂C The question then becomes: what conditions should be imposed on Ḃ so that Int(C) is forward invariant? The conventional answer in [5], [11] has been to enforce the condition Ḃ ≤ 0, but this may not be desirable since it requires all sublevel sets of C to be invariant; in particular, it will not allow a solution to leave a sublevel set even if by doing so it will remain in Int(C). A condition analogous to this was relaxed by [18] and [17] where the key idea was to only require a single sublevel set to be invariant. Motivated by this, we relax the condition Ḃ ≤ 0 to γ Ḃ ≤ , (8) B where γ is positive. This inequality allows for Ḃ to grow when solutions are far from the boundary of C. As solutions approach the boundary, the rate of growth decreases to zero. For (8) to be an acceptable condition, we need to verify that its satisfaction guarantees that solutions to (1) stay in Int(C). To see this, we note that differentiating (6) along solutions of (1) gives ḣ Ḃ = − . h + h2 Therefore, (8) implies that the rate of change in h with respect to t is bounded by (1) where x ∈ Rn and f is assumed to be locally Lipschitz. Then for any initial condition x0 := x(t0 ) ∈ Rn , there exists a maximum time interval I(x0 ) = [t0 , τmax ) such that x(t) is the unique solution to (1) on I(x0 ); in the case when f is forward complete, τmax = ∞. A set S is called (forward) invariant with respect to (1) if for every x0 ∈ S, x(t) ∈ S for all t ∈ I(x0 ). (3) n ḣ ≥ γ(h + h2 )  . h log 1+h Assuming for the moment that solutions x(t, x0 ) of (1) are forward complete, the Comparison Lemma [41] implies that h(x(t, x0 )) ≥ 1 r −1 + exp 2γt + log2  h(x0 )+1 h(x0 )  . 4 Therefore, if h(x0 ) > 0, i.e., x0 ∈ Int(C), then condition (8) guarantees that h(x(t, x0 )) > 0 for all t ≥ 0, i.e., x(t, x0 ) ∈ Int(C) for all t ≥ 0. Apart from (6), another barrier function that is commonly considered in optimization is the inverse-type barrier candidate B(x) = 1 . h(x) (9) Note that B(x) in (9) also satisfies the properties in (7). If condition (8) holds, then by the Comparison Lemma, we have h(x(t, x0 )) ≥ q 1 2γt + 1 h2 (x0 ) , and once again, x(t, x0 ) ∈ Int(C) for all t ≥ 0, provided that x0 ∈ Int(C). 2) Reciprocal Barrier Functions and Set Invariance: Based on the presented motivation, we formulate a notion of barrier function that provides the same guarantees in a more general context. Definition 1. For the dynamical system (1), a continuously differentiable function B : Int(C) → R is a reciprocal barrier function (RBF) for the set C defined by (2)-(4) for a continuously differentiable function h : Rn → R, if there exist class K functions α1 , α2 , α3 such that, for all x ∈ Int(C), 1 1 ≤ B(x) ≤ , α1 (h(x)) α2 (h(x)) Lf B(x) ≤ α3 (h(x)). (10) (11) Remark 1. The Lyapunov-like bounds (10) on B imply that 1 along solutions of (1), B essentially behaves like α(h) for some class K function α with inf x∈Int(C) 1 ≥ 0, α(h(x)) lim x→∂C 1 = ∞. α(h(x)) The condition (11) on Ḃ = Lf B, which generalizes condition (8), allows for B to grow quickly when solutions are far away from ∂C, with the growth rate approaching zero as solutions approach ∂C. Remark 2. In the conference version [2], a function satisfying Def. 1 was simply called a barrier function and not a reciprocal barrier function. The new terminology is necessary to make the distinction with a second type of barrier function used in the next subsection. Theorem 1. Given a set C ⊂ Rn defined by (2)-(4) for a continuously differentiable function h, if there exists a RBF B : Int(C) → R, then Int(C) is forward invariant. The following lemma is established to prove Theorem 1. Lemma 1. Consider the dynamical system   1 , y(t0 ) = y0 , ẏ = α y (12) with α a class K function. For every y0 ∈ (0, ∞), the system has a unique solution defined for all t ≥ t0 and given by 1 y(t) = σ  1 y0 , t − t0 , (13) where σ is a class KL function. Proof. Under the change of variables z = y1 , the dynamical system (12) becomes   α y1 ẏ (14) ż = − 2 = − 2 = −α(z)z 2 := −ᾱ(z). y y Since α(z) is a class K function, it follows that ᾱ(z) = α(z)z 2 is a class K function. The fact that ᾱ(z) is a continuous, nonincreasing function for all z ≥ 0 implies that (14) has a unique solution for every initial state z0 > 0; see Peano’s Uniqueness Theorem (Thm. 1.3.1 in [42], Thm. 6.2 in [43]). Furthermore, by the proof of Lemma 4.4 of [41], it follows that the solution is defined on [t0 , ∞) and is given by z(t) = σ(z0 , t − t0 ), with σ a class KL function. Converting from z back to y through y = z1 yields the solution y(t) given in (13). We now have the necessary framework in which to prove Theorem 1. Proof. (of Theorem 1) Utilizing (10) and (11), we have that     1 1 Ḃ ≤ α3 ◦ α2−1 := α . (15) B B Since the inverse of a class K function is a class K function, and the composition of class K functions is a class K function, α = α3 ◦ α2−1 is a class K function. Let x(t) be a solution of (1) with x0 ∈ Int(C), and let B(t) = B(x(t)). The next step is to apply the Comparison Lemma to (15) so that B(t) is upper bounded by the solution of (12). To do so, it must be noted that the hypothesis “f (t, u) is locally Lipschitz in u” used in the proof of Lemma 3.4 in [41], can be replaced by with the hypothesis “f (t, u) is continuous, non-increasing in u”. This is valid because the proof only uses the local Lipschitz assumption to obtain uniqueness of solutions to (12), and this was taken care of with Peano’s Uniqueness Theorem in the proof of Lemma 1. Hence, the Comparison Lemma in combination with Lemma 1 yields 1 , (16) B(x(t)) ≤  1 σ B(x , t − t 0 ) 0 for all t ∈ I(x0 ), where x0 = x(t0 ). This, coupled with the left inequality in (10), implies that    1 −1 α1 σ , t − t0 ≤ h(x(t)), (17) B(x0 ) for all t ∈ I(x0 ). By the properties of class K and KL functions, if x0 ∈ Int(C) and hence B(x0 ) > 0, it follows from (17) that h(x(t)) > 0 for all t ∈ I(x0 ). Therefore, x(t) ∈ Int(C) for all t ∈ I(x0 ), which implies that Int(C) is forward invariant. 5 Remark 3. Inequality (16) is the essential condition to make B a reciprocal barrier function, because it ensures that B(x(T )) 6= ∞ for any finite T ∈ I(x0 ), which implies that h(x(T )) > 0 for any T ∈ I(x0 ) if h(x0 ) > 0. Remark 4. Note that the function considered in (6), subject to the condition (8) for some γ > 0, is a RBF by Def. 1. This follows from the fact that ( 1 if r > 0 r α(r) = − log( 1+r ) 0 if r = 0. is a class K function. Therefore, in Def. 1, we choose α1 (r) = α2 (r) = α(r) and α3 (r) = γα(r). Note also that the function (9) satisfying (8) is also a RBF with class K functions α1 (r) = α2 (r) = r and α3 (r) = γr. Proof. Note that for any x ∈ ∂C, ḣ(x) ≥ −α(h(x)) = 0. According to Nagumo’s theorem [44], [45], the set C is forward invariant. Remark 7. As stated in Remark 3, what makes function B of Def. 1 a barrier is that B(x(T )) < ∞ for any finite T ∈ I(x(t0 )). Here, what makes function h of Def. 3 a barrier is that h(x(T )) > 0 for any finite T ∈ I(x(t0 )). For a ZBF h defined on a set D, if D is open, then h induces a Lyapunov function VC : D → R+ 0 defined by  0, if x ∈ C, VC (x) = (20) −h(x), if x ∈ D\C. It is easy to see that: 1) VC (x) = 0 for x ∈ C; 2) VC (x) > 0 for x ∈ D\C; and 3) Lf VC (x) satisfies the following inequality for x ∈ D\C: Lf VC (x) = −Lf h(x) ≤ α ◦ h(x) = α(−VC (x)) < 0, B. Zeroing Barrier Functions Intrinsic to the notion of RBF is the fact, formalized in (10), that such a function tends to plus infinity as its argument approaches the boundary of C. Unbounded function values, however, may be undesirable when real-time/embedded implementations are considered. Motivated by this and the barrier certificates in [18], we study a barrier function that vanishes on the boundary of the set C. This is facilitated by fist defining the notion of an extended class K function. where α is the extended class K function introduced in Def. 3. It thus follows from these three properties, from the fact that VC is continuous on its domain and continuously differentiable at every point x ∈ D\C, and from2 Theorem 2.8 in [46] that the set C is asymptotically stable whenever (1) is forward complete or the set C is compact. This is summarized in the following result. Definition 2. A continuous function α : (−b, a) → (−∞, ∞) is said to belong to extended class K for some a, b > 0 if it is strictly increasing and α(0) = 0. Proposition 2. Let h : D → R be a continuously differentiable function defined on an open set D ⊆ Rn . If h is a ZBF for the dynamical system (1), then the set C defined by h is asymptotically stable. Moreover, the function VC defined in (20) is a Lyapunov function. Definition 3. For the dynamical system (1), a continuously differentiable function h : Rn → R is a zeroing barrier function (ZBF) for the set C defined by (2)-(4), if there exist an extended class K function α and a set D with C ⊆ D ⊂ Rn such that, for all x ∈ D, Note that asymptotic stability of C implies forward invariance of C as described in [39]. Therefore, existing robustness results in the literature (such as [47], [48]) can be used to characterize the extent to which forward invariance of the set C is robust with respect to different perturbations on the dynamics (1). The reader is referred to [39] for further discussion and an application. Lf h(x) ≥ −α(h(x)). (18) Remark 5. Defining h on a set D larger than C allows one to consider the effects of model perturbations. This idea is developed in the conference submission [39], where it is also illustrated on a realistic problem. Remark 6. A special case of (18) is Lf h(x) ≥ −γh(x), (19) for γ > 0. This leads to a convex problem when seeking barrier functions with numerical means, such as sum of squares (SOS) [10]. Similar to Theorem 1, existence of a ZBF implies the forward invariance of C, as shown by the following theorem. Proposition 1. Given a dynamical system (1) and a set C defined by (2)-(4) for some continuously differentiable function h : Rn → R, if h is a ZBF defined on the set D with C ⊆ D ⊂ Rn , then C is forward invariant. C. Relationships of RBFs, ZBFs and Set Invariance Theorem 1 and Prop. 1 in the two previous subsections show that the existence of a RBF (resp., a ZBF) is a sufficient condition for the forward invariance of Int(C) (resp., C). This section investigates cases where the converse holds and other relations among these two types of barrier functions. Proposition 3. Consider the dynamical system (1) and a nonempty, compact set C defined by (2)-(4) for a continuously differentiable function h. If C is forward invariant, then h|C is a ZBF defined on C. Proof. We take D = C in Def. 3. For any r ≥ 0, the set {x|0 ≤ h(x) ≤ r} is a compact subset of C. Define a function α : [0, ∞) → R by α(r) = − inf {x|0≤h(x)≤r} Lf h(x). 2 While Theorem 2.8 requires the function V to be smooth, V can always be smoothed as shown in Proposition 4.2 in [46]. 6 Using the compactness property stated above and the continuity of Lf h, α is a well defined, non-decreasing function on R+ 0 satisfying By Nagumo’s theorem [44], [45], the invariance of C is equivalent to ⇒ inf {x|h(x)=r} Lf h(x) ≥ −α ◦ h(x), ∀x ∈ C. h(x) = 0 Clearly, C is not compact and ḣ = ẋ2 − 2x1 ẋ1 = x1 (x2 − x21 ) + 1. For any r > 0, Lf h(x) ≥ 0, which implies that α(0) ≤ 0. There always exists a class K function α̂ defined on [0, ∞) that upper-bounds α, yielding ḣ(x) ≥ −α̂(h(x)) for all x ∈ C. This completes the proof. Propositions 1 and 3 together show that a set C is forward invariant if, and only if, it admits a ZBF. Before addressing necessity for RBFs, a lemma is given. The shorthand notation ḣ(x) is used for Lf h(x), analogous to common usage for Lyapunov functions. Lemma 2. Consider the dynamical system (1) and a nonempty, compact set C defined by (2)-(4) for a continuously differentiable function h. If ḣ(x) > 0 for all x ∈ ∂C, then for each integer k ≥ 1, there exists a constant γ > 0 such that ḣ(x) ≥ −γhk (x), ∀x ∈ Int(C). Proof. Because C = Int(C) and C is nonempty, we have Int(C) 6= ∅. Furthermore, because ḣ(x) > 0 for all x ∈ ∂C, by the continuity of ḣ, there exists ε0 > 0 such that ḣ(x) > 0 for all x ∈ Q $ C where Q := (Bε0 (0) ⊕ ∂C) ∩ Int(C) is an open set contained in Int(C). It follows that ḣ(x) ≥ −γ 0 hk (x) holds for any x ∈ Q and any constant γ 0 > 0, because the left hand side is non-negative and the right hand side is non-positive. Note that C\Q is a compact subset because C is compact; moreover, − hḣk is well-defined and continuous in C\Q. Hence, we can choose some constant γ 00 ≥ max{x|x∈C\Q} − hḣ(x) k (x) , such that ḣ(x) ≥ −γ 00 hk (x) holds for any x ∈ C\Q. Taking γ = γ 00 , we have ḣ(x) ≥ −γhk (x) for any x ∈ Int(C), which completes the proof. inf {x|h(x)=r} x1 r + 1 = −∞. Consequently, there cannot exist an extended K function α such that ḣ ≥ −α(h), which implies that h cannot be a ZBF for C. Similarly, it is also impossible to find a class K function ḣ ≤ α3 (h)), which α3 such that − hḣ2 ≤ α3 (h) (resp. − h(h+1) implies that (6) (resp. (9)) cannot be a RBF for C. The relationships of RBFs, ZBFs and the set invariance are summarized in Fig.1. Note that while a ZBF leads to C being invariant, when C is contractive, Int(C) is also invariant. III. C ONTROL BARRIER F UNCTIONS While barrier functions are important tools to verify invariance of a set, they cannot be directly used to design a controller enforcing invariance. By drawing inspiration on how Lyapunov functions were extended to control Lyapunov functions (by Sontag), we propose in this section a similar extension of barrier functions to control barrier functions (CBFs). It is important to note that CBFs have been considered in the context of existing notions of barrier certificates [1], [6], [11]. The construction presented here differs due to the novel RBF condition (11) and the ZBF condition (18), which increases the available control inputs that satisfy the CBF condition. Ultimately, the true usefulness of this will be seen when CBFs are unified with control Lyapunov functions through quadratic programs in Section IV. A. Reciprocal Control Barrier Functions Consider an affine control system (21) ẋ = f (x) + g(x)u, with f and g locally Lipschitz, x ∈ R and u ∈ U ⊂ Rm . Later, we will be particularly interested in the case that U can be expressed as a convex polytope, n U = {u ∈ Rm |A0 u ≤ b0 }, Based on the lemma, we have the following theorem. Theorem 2. Under the assumptions of Lemma 2, B = Int(C) → R is a RBF and h : C → R is a ZBF for C. ḣ(x) = 1 h : Proof. Let k = 3 in Lemma 2. Then there exists γ1 > 0 such that for all x ∈ Int(C), ḣ ≥ −γ1 h3 holds, which implies that − hḣ2 ≤ γ1 h holds, or equivalently, Ḃ ≤ γB1 holds. By Definition 4, B = h1 is a RBF for C. Let k = 1 in Lemma 2. Then there exists γ2 > 0 such that for all x ∈ Int(C), ḣ ≥ −γ2 h holds. By Definition 3, h is a ZBF defined on C. Remark 8. The assumption ḣ(x) > 0 for all x ∈ ∂C is called contractivity in [45], because the flow on the boundary of C points inward. Without the compactness assumption on C, counterexamples to Thm. 2 can be given. Consider a dynamical system on R2 given by ẋ1 = − 12 x2 , ẋ2 = −x31 + 1. Define C = {x|h(x) ≥ 0}, where h(x) = x2 − x21 . Note that C is forward invariant because for any x ∈ ∂C, ḣ(x) = 1 > 0. (22) where A0 is a p × m matrix and b0 is a p × 1 column vector of constants with p some positive integer. When the set Int(C) is not forward invariant under the natural dynamics of the system, ẋ = f (x), how can a controller be specified that will ensure the invariance of Int(C)? This motivates the following definition. Definition 4. Consider the control system (21) and the set C ⊂ Rn defined by (2)-(4) for a continuously differentiable function h. A continuously differentiable function B : Int(C) → R is called a reciprocal control barrier function (RCBF) if there exist class K functions α1 , α2 , α3 such that, for all x ∈ Int(C), 1 1 ≤ B(x) ≤ α1 (h(x)) α2 (h(x)) inf [Lf B(x) + Lg B(x)u − α3 (h(x))] ≤ 0. u∈U (23) (24) The RCBF B is said to be locally Lipschitz continuous if α3 and ∂B ∂x are both locally Lipschitz continuous. 7 Given a RCBF B, for all x ∈ Int(C), define the set Krcbf (x) = {u ∈ U : Lf B(x) + Lg B(x)u − α3 (h(x)) ≤ 0}. constant Hmax > 0 and continuously differentiable function H : R → R+ 0 satisfying (i) 0 ≤ H(λ) ≤ Hmax , ∀ λ ∈ R, dH(λ) 6= 0, ∀ λ ∈ R, (ii) dλ Considering control values in this set allows us to guarantee the forward invariance of C via the following straightforward application of Theorem 1. Corollary 1. Consider a set C ⊂ Rn be defined by (2)-(4) and let B be an associated RCBF for the system (21). Then any locally Lipschitz continuous controller u : Int(C) → U such that u(x) ∈ Krcbf (x) will render the set Int(C) forward invariant. (27) the function Br : Int(C) → R+ 0 defined by Br := 1 (r−1) + H ◦ Lf h h is a RCBF. Proof. For all x ∈ Int(C), 1 1 ≤ Br (x) ≤ + Hmax h(x) h(x) B. Zeroing Control Barrier Functions Def. 2 for ZBFs leads to the second type of control barrier function. Definition 5. Given a set C ⊂ Rn defined by (2)-(4) for a continuously differentiable function h : Rn → R, the function h is called a zeroing control barrier function (ZCBF) defined on set D with C ⊆ D ⊂ Rn , if there exists an extended class K function α such that sup [Lf h(x) + Lg h(x)u + α(h(x))] ≥ 0, ∀x ∈ D. (26) (25) u∈U The ZCBF h is said to be locally Lipschitz continuous if α and the derivative of h are both locally Lipschitz continuous. Given a ZCBF h, for all x ∈ D define the set Kzcbf (x) = {u ∈ U : Lf h(x) + Lg h(x)u + α(h(x)) ≥ 0}. Similar to Corollary 1, the following result guarantees the forward invariance of C. Corollary 2. Given a set C ⊂ Rn defined by (2)-(4) for a continuously differentiable function h, if h is a ZCBF on D, then any Lipschitz continuous controller u : D → U such that u(x) ∈ Kzcbf (x) will render the set C forward invariant. Remark 9. Note that control u(x) ∈ Krcbf (x) (or u(x) ∈ Kzcbf (x)) will not necessarily render the closed-loop system of (21) forward complete, but only ensures that if x0 ∈ Int(C), then x(t) ∈ Int(C) for all t ∈ Iu (x0 ). Here, Iu (x0 ) is the maximal time interval for the closed-loop system of (21) with control u(x) ∈ Krcbf (x) (resp. u(x) ∈ Kzcbf (x)). C. Higher Relative Degree In the preceding two subsections, if the function h has a relative degree greater than 1, then Lg h = 0 and the set Krcbf (x) or Kzcbf (x) trivially equals to U or the empty set. When h has a relative degree r ≥ 2, the following proposition shows how to design a RCBF for C. Proposition 4. Consider the control system (21) with U = Rm . Consider also a set C ⊂ Rn defined by (2)-(4) for a function h with relative degree r ≥ 2, namely, h is r-times continuously differentiable and ∀ x ∈ Int(C), Lg Lkf h(x) = 0, (r−1) for 0 ≤ k ≤ r − 2, and Lg Lf h(x) 6= 0. Then for any and thus 1 1 ≤ Br (x) ≤ , α1 (h(x)) α2 (h(x)) where α1 (ξ) := ξ and α2 (ξ) := ( 0 1 1 ξ +Hmax If ξ = 0 If ξ > 0 are both class K functions. Thus, condition (23) is satisfied. By the chain rule,    dH (r−1) (r−1) h . (28) ◦ Lf h Lg Lf Lg Br = dλ Because h has relative degree r and (27) holds, it follows that Br has relative degree one. Therefore, for any class K function α3 , and for any x ∈ Int(C), there exists u ∈ Rm such that Lf Br (x) + Lg Br (x)u ≤ α3 (1/Br (x)), and thus condition (24) holds. Therefore, Br is a RCBF. An example for H is H(λ) = atan(λ) + π2 ∈ (0, π2 ), where 1 = 1+λ 2 6= 0 for any λ. Another means to construct RCBFs for h with relative degree r ≥ 2 is given in [49], where a backstepping-inspired method for its construction is provided. dH dλ Remark 10. For ZCBF h with relative degree r ≥ 2, replace (26) by there exists Hmin > 0, Hmax > 0 and Hmin ≤ H(λ) ≤ Hmax , ∀ λ ∈ R. (29) Then for any H(λ) satisfying (29) and (27), the function (r−1) (H ◦ Lf ) · h is a ZCBF defined on C. See also [50] for an alternative approach. Remark 11. Note that if U 6= Rm , i.e., there are constraints on the input u, then the construction shown above for higher relative degree h may no longer be valid. Designing CBFs in this case remains an open question. IV. QP S FOR M EDIATING S AFETY AND P ERFORMANCE In this section, we address the following question: how to select, among the control inputs that enforce the safety requirement, an input that also enforces liveness/stability? We begin with a brief overview of exponentially stabilizing control Lyapunov functions in the context of nonlinear systems. This formulation naturally leads to a quadratic program (QP) that 8 allows for the unification of control Lyapunov functions for performance and control barrier functions for safety. In the following, the dynamics of the system are given by a nonlinear affine control system of the form       g1 (x1 , x2 ) ẋ1 f1 (x1 , x2 ) + u = 0 ẋ2 f2 (x1 , x2 ) {z } | {z } | f (x) g(x) where x1 ∈ X ⊂ Rn1 are controlled (or output) states, x2 ∈ Z ⊂ Rn2 are the uncontrolled states, with n1 + n2 = n, and U ⊂ Rm is the set of admissible control values for u. In addition, we assume that f1 (0, x2 ) = 0, i.e., that the zero dynamics surface Z defined by x1 = 0 with dynamics given by ẋ2 = f2 (0, x2 ) is invariant, and we assume adequate smoothness assumptions on the dynamics so that solutions are well defined. A. Control Lyapunov Functions Definition 6. [20] A continuously differentiable function V : X × Z → R is an exponentially stabilizing control Lyapunov function (ES-CLF) if there exist positive constants c1 , c2 , c3 > 0 such that for all x = (x1 , x2 ) ∈ X × Z, the following inequalities hold, c1 kx1 k2 ≤ V (x) ≤ c2 kx1 k2 , inf u∈U [Lf V (x) + Lg V (x)u + c3 V (x)] ≤ 0. (30) (31) The existence of an ES-CLF yields a family of controllers that exponentially stabilize the system to the zero dynamics [16]. In particular, consider the set Kclf (x) = {u ∈ U : Lf V (x) + Lg V (x)u + c3 V (x) ≤ 0}. It follows that a locally Lipschitz controller u : X × Z → U satisfies r c2 − c3 t e 2 kx1 (0)k. u(x) ∈ Kclf (x) ⇒ kx1 (t)k ≤ c1 When U = Rm , Freeman and Kokotovic introduced the min-norm controller, u∗ (x), defined pointwise as the element of Kclf (x) having minimum Euclidean norm [51]. The min-norm controller can be interpreted as the solution of a quadratic program (QP). Importantly, by using the QP formulation, it is straightforward to include bounds on the control values [52], [22], such as those given in (22), namely 1 > u u 2 s.t. Lf V (x) + Lg V (x)u ≤ −c3 V (x) u∗ (x) =argmin (32) u∈Rm A0 u ≤ b0 . The QP-form of the controllers have been executed in realtime to achieve bipedal walking [22], [21] on a human-sized robot and on scale cars [53], with sample rates of 200 Hz to 1 kHz. B. Combining CLFs and CBFs via QPs A distinct advantage of the QP perspective is that it allows for the unification of control performance objectives (represented by CLFs) subject to the trajectories belonging to desired ”safe” sets (as dictated by CBFs). By relaxing the constraint represented by the CLF condition (31), and adjusting the weight on the relaxation parameter, the QP can mediate the tradeoff between performance and safety, with the safety being guaranteed. Specifically, given a RCBF B associated with a set C defined by (2)-(4) and an ES-CLF V , they can be combined into a single controller through the use of a QP of the following form3 1 > u H(x)u + F (x)> u u∗ (x) = argmin 2 m u=(u,δ)∈R ×R (CLF-CBF QP) s.t. Lf V (x) + Lg V (x)u + c3 V (x) − δ ≤ 0, Lf B(x) + Lg B(x)u − α(h(x)) ≤ 0, (33) (34) where c3 > 0 is a constant, α belongs to class K, H(x) ∈ R(m+1)×(m+1) is positive definite, and F (x) ∈ Rm+1 . The following theorem4 provides a sufficient condition for ∗ u (x) to be locally Lipschitz continuous in Int(C), thereby guaranteeing local existence and uniqueness of solutions to the closed-loop system, and the applicability of Corollaries 1 and 2. Theorem 3. Suppose that the following functions are all locally Lipschitz: the vector fields f and g in the control system (21), the gradients of the RCBF B and CLF V , as well as the cost function terms H(x) and F (x) in (CLF-CBF QP). Suppose furthermore that the relative degree one condition, Lg B(x) 6= 0 for all x ∈ Int(C), holds. Then the solution, u∗ (x), of (CLF-CBF QP) is locally Lipschitz continuous for x ∈ Int(C). Moreover, a closed-form expression can be given for u∗ (x). Proof. The proof is based on [54][Ch. 3], which as a special case includes minimization of a quadratic cost function subject to affine inequality constraints. Define y1 (x) = [Lg V (x), −1]> , p1 (x) = −Lf V (x) − c3 V (x), y2 (x) = [Lg B(x), 0]> , p2 (x) = −Lf B(x) + α(h(x)), and note that for all x ∈ Int(C), y1 (x) and y2 (x) are linearly independent in Rm+1 . Because H(x) is locally Lipschitz continuous and positive definite, its inverse exists and is locally Lipschitz continuous. Define     ȳ1 (x), ȳ2 (x) = H(x)−1 y1 (x), y2 (x) ,       p̄1 (x) p1 (x) y1 (x)> = − ū(x), p̄2 (x) p2 (x) y2 (x)> and ū(x) := −H(x)−1 F (x) v := u − ū(x). Finally, leth·, ·i define an inner product on Rm+1 with weight 3 In the following sections, only RCBFs are used to formulate the QPs; however, QPs incorporating ZCBFs can be formulated in a similar way [39]. 4 Note that while this theorem is established for ES-CLFs in this paper, the same results hold for classically defined CLFs as in [16]. 9 matrix H(x) so that hv, vi := v> H(x)v. The optimization problem (CLF-CBF QP) is then equivalent to v∗ (x) =argmin hv, vi (35) v∈Rm+1 s.t. hȳ1 (x), vi ≤ p̄1 (x), hȳ2 (x), vi ≤ p̄2 (x), with u∗ (x) = v∗ (x) + ū(x). (36) From [54][Ch. 3], the solution to (35) is computed as follows. Let G(x) = [Gij (x)] = [hȳi (x), ȳj (x)i], i, j = 1, 2 be the Gram matrix. Due to the linear independence of {ȳ1 (x), ȳ2 (x)}, G(x) is positive definite. The unique solution to (35) is ∗ (37) v (x) = λ1 (x)ȳ1 (x) + λ2 (x)ȳ2 (x), where λ(x) = [λ1 (x), λ2 (x)]> is the unique solution to G(x)λ(x) ≤ p̄(x), (38) λ(x) ≤ 0, [G(x)λ(x)]i < p̄i (x) ⇒ λi (x) = 0, where [·]i denotes the i-th row of the quantity in brackets, and the inequalities hold componentwise. Because G(x) is 2×2, a closed form solution can be given. Define the Lipschitz continuous function  0, if r > 0, ω(r) = r ∈ R. r, if r ≤ 0. For x ∈ Int(C), λ1 , λ2 can be expressed in closed form as If: G21 (x)ω(p̄2 (x)) − G22 (x)p̄1 (x) < 0, #   " 0 λ1 (x) (39) = ω(p̄2 (x)) , λ2 (x) G22 (x) Else if: G12 (x)ω(p̄1 (x)) − G11 (x)p̄2 (x) < 0,   " ω(p̄1 (x)) # λ1 (x) G11 (x) = , λ2 (x) 0 Otherwise: " # λ1 (x) λ2 (x)  = ω(G22 (x)p̄1 )(x)−G21 (x)p̄2 (x)) G11 (x)G22 (x)−G12 (x)G21 (x) ω(G11 (x)p̄2 (x)−G12 (x)p̄1 (x)) G11 (x)G22 (x)−G12 (x)G21 (x) (40)  . (41) Because the Gram matrix is positive definite, for all x ∈ Int(C), G11 (x)G22 (x) − G12 (x)G21 (x) > 0. Using standard properties for the composition and product of locally Lipschitz continuous functions, each of the expressions in (39) -(41) is locally Lipschitz continuous on Int(C). Hence, the functions λ1 (x) and λ2 (x) are locally Lipschitz on each domain of definition and have well defined limits on the boundaries of their domains of definition relative to Int(C). If these limits agree at any point x that is common to more than one boundary, then λ1 (x) and λ2 (x) are locally Lipshitz continuous on Int(C). However, the limits are solutions to (38), and solutions to (38) are unique [54]. Hence the limits agree at common points of their boundary5 (relative to Int(C)) and the proof is complete. If the control objective and the barrier function do not conflict, such as when the zero dynamics surface of the CLF has a non-empty intersection with the safe set, an appropriate choice of weights results in a solution of the QP with δ ≈ 0 [39]. The mediation of safety and performance will be illustrated in the context of the adaptive cruise control and lane keeping problems in the following sections. The examples will also provide explicit control barrier functions that respect constraints on the inputs, such as those given in (22). In particular, the examples will add a constraint of the form A0 u − b0 ≤ 0 (42) to the QP, in addition to (33) and (34). By construction, at each point of the safe set, there will exist a solution of the QP satisfying all three constraints. The Lipschitz continuity of the QP with the additional constraint (42) on the inputs, however, is not currently assured. V. T WO AUTOMOTIVE S AFETY P ROBLEMS VIA QP S In this section, we use Adaptive Cruise Control (ACC) and Lane Keeping (LK) to illustrate the power of a CLF-CBFbased QP to meet a performance objective, subject to a safety requirement. A. Adaptive Cruise Control Via QPs A vehicle equipped with ACC seeks to converge to and maintain a fixed cruising speed, as with a common cruise control system. Converging to and maintaining fixed speed is naturally expressed as asymptotic stabilization of a set. With ACC, the vehicle must in addition guarantee a safety condition, namely, when a slower moving vehicle is encountered, the controller must automatically reduce vehicle speed to maintain a guaranteed lower bound on time headway or following distance, where the distance to the leading vehicle is determined with an onboard radar. When the leading car speeds up or leaves the lane, and there is no longer a conflict between safety and desired cruising speed, the adaptive cruise controller automatically increases vehicle speed. The timeheadway safety condition is naturally expressible as a control barrier function. Because relaxation is used to make the stability objective a soft constraint in the QP, while safety is maintained as a hard constraint, safety and stability do not need to be simultaneously satisfiable. In contrast, the approach of [1] for combining CBFs and CLFs is only applicable when the two objectives can be simultaneously met. Simulations in Sect. VI will illustrate how the QP-based solution to ACC automatically adjusts vehicle speed under various traffic conditions. 5 As an example, the only non-zero solutions of (38) occur when p (x) < 0, 2 in which case, G21 (x)p2 (x)−G22 (x)p1 (x) = 0, and therefore (41) reduces to (39). The other cases are similar. 10 1) ACC problem setup: We begin by setting up the dynamics of the problem based upon [34] and [36], which assume that the lead and following vehicles are modeled as pointmasses moving in a straight line. The following vehicle is the one equipped with ACC while the lead vehicle acts as a disturbance to the following vehicle’s objective of cruising at a given constant speed. The dynamics of the system can be compactly expressed as     1/M −Fr /M  +  0  u. aL (43) ẋ =  0 x2 − x1 {z } | {z } | f (x) g(x) Here, x = (x1 , x2 , x3 ) := (vf , vl , D) where vf and vl are the velocity of the following and leading vehicle (in m/s), respectively, D is the distance between the two vehicles (in m); M is the mass of the following vehicle (in kg); Fr (x) = f0 +f1 vf +f2 vf2 is the aerodynamic drag (in N) with constants f0 , f1 and f2 determined empirically; aL ∈ [−al g, a0l g] is the overall acceleration/deceleration of the lead vehicle (in m/s2 ) with al , a0l fractions of the gravitational constant g for deceleration and acceleration, respectively; u ∈ U ⊂ R, the control input of the following car, is wheel force (in N). Initially, we will suppose that the control input is unbounded, that is, U = R, and later, we address realistic bounds on wheel force. where τd is the desired time headway.6 The constraint (HC) can be rewritten as for the dynamics (43). Correspondingly, we consider the function h(x) = D − τd vf , which yields the admissible set C as defined in (2)-(4). A candidate RCBF can be constructed from h as follows   h . (45) B = − log 1+h Because D − τd vf > 0 for any x ∈ Int(C), it follows that τd > 0, Lg B(x) = M (1 + D − τd vf )(D − τd vf ) which implies that B has relative degree 1 in Int(C). If the class K function α3 in (24) is chosen as γ/B for some constant γ > 0, then   γ 1 Lf B(x) − u(x) = − Lg B(x) B(x) provides a specific example of a u ∈ R satisfying   γ inf Lf B(x) + Lg B(x)u − ≤ 0. u∈R B(x) u∗ (x) = lim vf (t) = vd . t→∞ Performance : V (x) := (vf − vd )2 . Straightforward calculations given in [2] show that for any c > 0, the following inequality holds, inf [Lf V (x) + Lg V (x)u + cV (x)] ≤ 0, u∈R verifying that V is a valid CLF. Hard Constraints. These represent constraints that must not be violated under any condition. For ACC, this is simply the constraint: “keep a safe distance from the car in front of you”. There are numerous formulations of this concept including Time Headway and Time to Collision [55]. In the context of this paper, to start with a simple formulation, we express this constraint as Safety : D/vf ≥ τd , where (SC) This translates into a soft constraint since this speed should only be achieved in the case when safety can be assured. In terms of a candidate CLF, the soft constraint (SC) can be written (HC) argmin u=[u,δ]> ∈R2 s.t. Performance : (46) As a result, B is a valid RCBF for U = R. 2) The CLF-CBF based QP: As in [23], a CLF-CBF QP is constructed by combining the above constraints in the form Given the model (43), we next present two constraints that are necessary in the context of ACC. Soft Constraints. In the context of ACC, when adequate headway is assured, the goal is to achieve a desired speed, vd . In other words, (44) D − τd vf ≥ 0, and 1 > > u Hacc u + Facc u 2 (ACC QP) Aclf u ≤ bclf , Acbf u ≤ bcbf , Aclf = [Lg V (x), −1] , bclf = −Lf V (x) − cV (x), (47) γ . B(x) (48) Acbf = [Lg B(x), 0] , bcbf = −Lf B(x) + Remark 12. Setting δ = 0 would make the CLF constraint “hard” in that it would force exact exponential convergence at a rate of c, and in such a case, if there were no inputs satisfying both the CLF constraint and the RCBF constraint, the QP would be infeasible. The cost function in the QP is selected in view of achieving the control objective encoded in the CLF, i.e., achieving the desired speed, subject to balancing the relaxation factors that ensure solvability and continuity of (ACC QP). As explained in [2], the CLF was constructed by first partially linearizing the system through the feedback u = Fr + M µ. As a result, the cost relative to this control will be chosen as µ> µ, which yields the following function in u:  1 µ> µ = 2 u> u − 2u> Fr + Fr2 . M 6 A general rule stated in [55] is that the minimum distance between two cars is “half the speedometer”. This translates into the hard constraint as D ≥ 1.8vf with τd = 1.8. 11 30 0.4 100 20 15 h (m) 0.2 u/mg Speed (m/s) 25 0 50 0.2 lead car controlled car 10 0 20 40 60 time (s) 80 0.4 0 100 0 20 40 60 time (s) 80 100 0 20 40 60 time (s) 80 100 Fig. 2. Simulation results of the ACC problem based on (ACC QP) (left) speed of the lead car and the controlled car with the desired speed vd indicated (middle) vehicle acceleration as fractions of g, with typical desired upper and lower bounds indicated (right) hard constraint (HC), where positive values indicate satisfaction. This can then be converted into the form  1   F  r 0 2 M Hacc = 2 , Facc = −2 M 2 . 0 psc 0 acceleration, respectively. That is, the input set is now: Here psc is the weight for the relaxation δ. Simulation Preview. Simulation results obtained by applying the (ACC QP) controller are developed in Section VI. A sneak preview is shown in Fig. 2 to highlight a few properties of the designed controller and to motivate an important refinement. The desired cruising speed vd is set to 79.2 (km/h), which is 22 (m/s). The system (43) is initialized at (vf (0), vl (0), D(0)) = (18, 10, 150). The left plot in Fig 2 shows the desired cruising speed as a thick dashed line and the speeds of the lead and controlled vehicles as thin lines. The controlled vehicle achieves the desired cruising speed when it does not conflict with the time-headway constraint, and it settles to the speed of the lead car when required to maintain a safe following distance. The forward invariance of the safe set, defined by the hard constraint (HC) encoding the desired time headway τd , is shown in the right plot of Fig. 2. The middle plot shows typical “comfort” limits on acceleration that should be respected by the controlled vehicle, which are violated because no constraint has been imposed on the wheel force that can be requested by the QP when the car accelerates and brakes. This motivates the development of a refined barrier function that is compatible with bounds on the two vehicles’ inputs. 3) Force Constraints and CBFs: The QP formulated in subsection V-A2 generates a control input u ∈ R for the ACCcontrolled vehicle. In practice, however, the wheel force that can be generated by the car is constrained by physical limits (e.g., the maximal engine torque for acceleration, maximal braking capability, and road conditions). This requires the admissible set U to be bounded. Furthermore, to guarantee driver comfort, the wheel forces the controller is allowed to apply are typically much less than the maximal forces that can be generated by the vehicle. Force Constraints. We now constrain the allowable wheel forces. Supposing that we do not want to accelerate or decelerate more than some fraction of g, the gravitational constant, we can write the constraints on acceleration and deceleration as inequalities u ≤ a0f M g, −u ≤ af M g. Uacc := [−af M g, a0f M g]. (49) (FC) where af and a0f are the fractions of g for deceleration and Since it may be the case that these constraints will conflict with the torque values needed to satisfy the hard constraint (HC), we require a force-based barrier function allowing the hard constraints and force constraints to be simultaneously satisfied. In particular, we seek a function hF (x) such that for all x ∈ CF , where CF = {x |hF (x) ≥ 0}, there exists a trajectory of (43) satisfying (HC) and the maximum braking limit (FC). That is to say, within the set CF , the ACC-equipped car can always brake to maintain a desired headway using an allowed amount of deceleration. In the appendix, two CBFs7 , hcF and hoF , that can be used to define the safe set CF are developed. The function hcF has a much simpler form8 than hoF , but makes a more conservative approximation of the safe set than hoF . When rolling resistance is ignored in the model (43), hoF provides the maximal safe set compatible with (48) and the force bounds (FC), and will therefore be referred to as “optimal”. The functions hoF and hcF in turn define the optimal RCBF BFo and the conservative RCBF BFc , respectively, using (6) or (9). The force-based hard constraints are ultimately expressed via (FC) together with the condition γ ≤ 0. (FCBF) Lf BF (x) + Lg BF (x)u − BF (x) 4) Modified CLF-CBF Based QP: Incorporating (FCBF) 1 and (47), we have the modified force-based CLF-CBF QP: 1 > > u Hacc u + Facc u (ACC-QP2) u∗ (x) = argmin u=[u,δ]> ∈Uacc ×R 2 s.t. Aclf u ≤ bclf , Afcbf u ≤ bfcbf , Afc u ≤ bfc . The soft constraints yield the same Aclf , bclf as (47). The comfort constraints in (FC) yields Afc , bfc as    0  af M g 1 0 Afc = , bfc = . (51) −1 0 af M g 7 The functions are piecewise defined by a set of continuously differentiable functions; more details are given in [56]. 8 When the speed of the lead car is constant (i.e., a = 0), and v > v , L l then hcF reduces to the formula given in [2]. 12 2) Encoding LK Constraints: The hard and acceleration constraints can be encoded formally as follows. By condition (FCBF), the force constraints yield Afcbf = [Lg BF (x), 0] , bfcbf γ = −Lf BF (x) + . BF (x) Encoding Acceleration Constraint. Since The cost function is the same as in (49). Simulation results obtained by applying the (ACC-QP2) controller and its comparison with the (ACC QP) controller are provided in Section VI. B. Lane Keeping Via QPs In this subsection, we consider the Lane Keeping (LK) problem using a CBF-based QP, which aims to keep the vehicle “centered” in a possibly curved lane. We focus on the lateral movement of the vehicle by assuming that the vehicle has a constant longitudinal speed [38]. 1) Lane Keeping Problem Setup: Under the assumptions of constant longitudinal speed and a linear tire-force model, a two-state handling model can be augmented to the four-state lateral-yaw model given in (50) [38]. In the model, the state is x := (y, ν, ψ, r), where y and ψ are the lateral displacement and the error yaw angle in road fixed coordinates, respectively, ν is the lateral velocity, and r is the yaw rate (rotation rate about the vertical axis). The input u is the steering angle of the front tires, and the disturbance is the desired yaw rate rd , which can be calculated from the curvature of the road by rd = vR0 , where v0 is a constant value for the longitudinal velocity and R is the road radius of curvature. Additionally, M is the total mass of the car, Iz is the moment of inertia about the center of mass, a and b are the distance from the center of mass to the front and rear tires, respectively, and Cr and Cf are tire (stiffness) parameters. The objective of the LK problem is to provide a steering input that keeps the car “centered” in the lane. Particularly, the car should satisfy the following hard control objective and the acceleration constraint. Hard Constraint. This constraint requires the displacement of the vehicle from the center of the lane to be less than a given constant ymax : (LK-HC) |y| ≤ ymax . Since the width of US lanes is 12 feet and typical width of a car is 6 feet, we can take ymax to be 3 feet, which is approximately 0.9 meters. Therefore, the hard constraint is |y| ≤ 0.9. Acceleration Constraint. Due to the force limit of the car and for the comfort of the driver, the lateral acceleration needs to be bounded. We express this constraint as (LK-FC) |ÿ| ≤ amax .   0 ẏ  ν̇   0     ψ̇  =   0 ṙ 0  1 Cf +Cr − M v0 0 bCr −aCf Iz v0 v0 0 0 0 0 M ÿ : = Cf (u − ν + ar ν − br ) − Cr − M v0 rd , v0 v0 the acceleration constraint (LK-FC) is equivalent to   1 1 u ∈ Ulk : = (−M amax + F0 ), (M amax + F0 ) Cf Cf ν−br where F0 = Cf ν+ar v0 + Cr v0 + M v0 rd . Encoding Hard Constraint. Suppose that at time 0, the lateral displacement is y(0) and the lateral velocity is ẏ(0). Under the maximal allowable acceleration, it takes time T for the lateral . Then, speed to be reduced to zero, where T = |aẏ(0)| max y(T ) = y(0) + T ẏ(0) − = y(0) + z 0 sgn(ẏ(0)) 2 T amax 2 1 |ẏ(0)| ẏ(0). 2 amax Motivated by the above formula, define hF (x) = (ymax − sgn(ẏ) y) − 1 ẏ 2 2 amax (53) and CF := {x|hF (x) ≥ 0}. Then, for every x ∈ CF , the controlled vehicle can remain in CF while keeping the acceleration within the allowable set (LK-FC). Indeed, differentiating (53) for ẏ 6= 0 yields   ÿ ḣF (x, u) = − sgn(ẏ) + ẏ. (54) amax It follows that if ẏ > 0, then ḣF (x, u) ≥ 0 when u = 1 Cf (−M amax + F0 ), and if ẏ < 0, then ḣF (x, u) ≥ 0 when u = C1f (M amax + F0 ). Finally, from (53), the limit of ḣF as ẏ tends to zero is well defined and equals zero. Taking BF as (6) and γ > 0 a constant, the above calculations imply that RCBF condition (24) holds, namely, for any x ∈ Int(CF ), there exists u such that γ Lf BF (x) + Lg BF (x)u − ≤ 0, (LK-FCBF) BF (x) and therefore Int(CF ) is controlled invariant. The next proposition relates the controlled invariance of Int(CF ) to the lane condition, (LK-HC). Proposition 5. Let CLK be the subset of Int(CF ) where the hard constraint (LK-HC) is satisfied, namely, CLK :=Int(CF ) ∩ {x : |y| ≤ ymax }. (55) Then any feedback controller for (50) that renders Int(CF ) forward invariant also renders CLK forward invariant.    0 y  − v0   ν   CMf +  1  ψ   0 2 2 C a C +b C r a Izf − If v r bCr −aCf M v0 (52)    0     u +  0  rd   −1  0 (50) 13 Proof. Figure 3 shows the projection of CF onto the (y, ẏ)plane, given by the strip between the upper and lower (blue) curves. The figure also shows the projection of the subset CLK , outlined by the dotted lines. Its forward invariance is immediate because ∀x ∈ (∂CLK ) ∩ Int(CF ), sgn(y) sgn(ẏ) < 0. 3) CBF-based QP for LK: Incorporating (LK-FCBF) and (LK-FC), we have the QP for lane keeping: u∗ (x) = > u=[u,δ] s.t. 1 > > u Hlk u + Flk u 2 ∈Ulk ×R argmin (LK QP) lk Alk fcbf u ≤ bfcbf , lk Alk fc u ≤ bfc , Remark 13. Another important fact is that a feedback controller rendering CLK forward invariant with bounded lateral acceleration ÿ results in ultimate boundedness of the yaw angle and yaw rate. Indeed, solving (52) for u as a function of ÿ and using ẏ = ν + ψv0 , the four-state lateral-yaw model (50) results in      0 1 ψ ψ̇ = r r r − b(a+b)C − (a+b)C ṙ Iz Iz v0       0 0 −1 ÿ + + (a+b)Cr ẏ + rd . (56) M a Iz 0 Iz v0 This is a linear system in companion form, driven by ẏ, ÿ and rd . The model parameters a, b, Cr , Iz and v0 are all positive, and hence the system is exponentially stable, and therefore input-to-state stable [41]. The term ẏ is bounded by virtue of belonging to CLK and the term ÿ is bounded by (LK-FC). Because the desired yaw rate rd is bounded for bounded road curvature, it therefore follows that ψ and r are bounded. Feedback Control Law For Performance. To illustrate that a number of feedback controllers can be combined with a CBF via a QP, a linear controller u = −K(x − xf f ) is assumed here, where xf f is a feedforward term, with details given in the simulation section. Alternatively, a quadratic Lypaunov function for the resulting closed-loop system could be used as a CLF for the open-loop system, and the feedback design completed as in Sect. V-A. ẏ CF y ymax 0 ymax u = −K(x − xf f ) + δ, where δ is a relaxation parameter, indicating the “soft” nature lk lk lk of this constraint, and Alk fcbf , bfcbf , Afc , bfc are derived in a similar manner to the corresponding terms in Sect. V-A2. VI. S IMULATION R ESULTS Simulation results obtained by applying the QP-mediated controllers for ACC and LK are shown in this section. The parameters used for the simulation are given in Table I. A. Simulation results for ACC Various problem formulations are compared here. In all cases, the system (43) is started from the initial condition 1 x(0) = (18, 10, 150). B. Comparison of two QPs Recall that Figure 2 showed simulation results obtained by applying the QP controller in (ACC QP), where the force constraints were not taken into account. Figures 4 and 5 show simulation results for (ACC-QP2), where the force constraints are included. Specifically, Figure 4 compares (ACC QP) with (ACC-QP2) using the optimal RCBF BFo and the conservative RCBF BFc . Note that, due to limits on the wheel forces, the speed converges to vd more slowly, and begins braking earlier, as evidenced by the top plot in Fig. 4. Since RCBF BFo is less conservative than BFc , the car maintains a smaller following distance, but the specified time-headway constraint is always satisfied, as indicated by the bottom plot in Fig. 4. Moreover, when using a force-based RCBF (45), the force constraints are satisfied for all time, as shown in Fig. 5. Ultimately, the QP based controller (ACC-QP2) is able to satisfy all of the control objectives and constraints for the ACC problem outlined in Sect. V-A4 through a unified control methodology. Remark 14. The conference paper [53] implements the above QP-based controllers in a real-time embedded processor on scaled cars. A video of the results is available on YouTube [57]. C. Comparison of RCBFs and ZCBFs Fig. 3. The projection of CF onto the (y, ẏ)-plane is bounded by the upper and lower curves. The subset CLK ⊂ Int(CF ) is bounded by the dotted lines. Any feedback controller that renders Int(CF ) forward invariant also renders CLK forward invariant because, if y = ymax , then ẏ < 0, and if y = −ymax , then ẏ > 0. We also consider the ZCBFs for our ACC problem, which are associated with functions hoF and hcF given in the appendix. As expected, when using the controller from the QP (ACC-QP2) with ZCBFs, all constraints are satisfied just as with the RCBFs. Figure 5 shows a comparison of the generated vehicle acceleration using both types of CBFs, for both optimal and conservative cases. Our limited experience is that the 14 ZCBFs generate a smoother input trajectory (see Fig. 5), while satisfying the force constraints. We suspect that this is due to the local Lipschitz constant of a RCBF potentially becoming arbitrarily large near the boundary of the safe set. 30 Speed (m/s) 25 20 TABLE I PARAMETER VALUES USED IN SIMULATION M f0 a b v0 vd ymax 15 1650 kg 0.1 N 1.11 m 1.59 m 27.7 m/s 22 m/s 0.9 m f1 f2 Cf Cr Iz g amax 5 N s/m 0.25 N s2 /m2 133000 N/rad 98800 N/rad 2315.3 m2 · kg 9.81 m/s2 0.3×9.81 m/s2 psc a0f af c γ 102 0.25 0.25 10 1 10 0 20 40 60 time (s) 80 100 80 100 120 100 h (m) 80 60 40 20 0 0 20 40 60 1 time (s) lead car controlled car based on (ACC QP) controlled car based on (ACC QP 2) with conservative RCBF controlled car based on (ACC QP 2) with optimal RCBF Fig. 4. Comparison 40 of QP (ACC QP) with QP (ACC-QP2). (top) speed of 60 the lead car and the controlled car time based (s)on QP (ACC QP) and (ACC-QP2) (bottom) hard constraint (HC) based on QP (ACC QP) and (ACC-QP2) where positive values indicate satisfaction. 1 0.4 u/mg 0.2 0 0.2 0.4 0 20 0 20 0.4 40 60 time (s) 80 100 0.2 u/mg 20 0 0.2 0.4 40 60 80 100 1 time (s) conservative RCBF conservative ZCBF optimal RCBF optimal ZCBF Fig. 5. Comparison of the input force generated from QP (ACC-QP2) using ZCBFs and RCBFs. (top) conservative CBFs (bottom) optimal CBFs D. LK simulation 1 The feedback gain K was determined by solving an LQR 1 problem with control weight R = 600 and state weight given by Q = Kp C > C + Kd C > A> AC, where C = [1, 0, 20, 0], Kp = 5, and Kd = 0.4. The “output” y = Cx corresponds to a lateral preview of approximately 0.7 seconds. The feedforward term xf f = [0, 0, 0, rd ]> reduces tracking error. Simulation results for lane keeping are shown in Fig.6. The road is assumed to be curved and the longitudinal speed of the vehicle is a constant. We can see that the absolute value of the lateral displacement is always bounded by 0.9m, and the lateral acceleration is always bounded by 0.3g. Therefore, the displacement and acceleration constraints are both satisfied. VII. C ONCLUSIONS This80 paper presented a novel100framework for the control of safety-critical systems through the unification of safety conditions (expressed as control barrier functions) with control objectives (expressed as control Lyapunov functions). At the core of this methodology was the introduction of two new classes of barrier functions: reciprocal and zeroing. The interplay between these classes of functions was characterized, and it was shown that they provide necessary and sufficient conditions on the forward invariance of a set C under reasonable assumptions. Therefore, in the context of (affine) control systems, this naturally yields control barrier functions (CBFs) with a large set of available control inputs that yield forward invariance of a set C. Importantly, CBFs are expressed as affine inequality constraints in the control input that–when satisfied pointwise in the candidate safe set–imply forward invariance of the set, and hence safety. Utilizing control Lyapunov function (CLFs) to represent control objectives–which again result in affine inequality constraints in the control input– safety constraints and performance objectives were naturally unified in the framework of quadratic program (QP) based controllers. Furthermore, continuity of the resulting controllers was formally established by strictly enforcing the safety constraint and relaxing the control objective. The mediation of safety and performance was illustrated through the application to automotive systems in the context of adaptive cruise control (ACC) and lane keeping (LK). Future work will be devoted to building upon the foundations presented in this paper in the context of safety-critical control of cyber-physical systems, with a special focus on robotic and automotive systems. At a formal level, this paper developed “force-based” barrier functions for the specific problems considered (ACC and LK), leaving as an open 15 Lateral Displacement (m) Lateral Acceleration (g) Barrier Function 1 4 0.3 0.2 0.5 3 2 0 B 0 ÿ y 0.1 −0.1 −0.5 1 −0.2 −0.3 −1 0 5 10 t 15 20 25 0 5 10 t 15 20 0 0 25 5 10 t 15 20 25 Fig. 6. Simulation results of the QP-based controller for LK problem. (left) lateral displacement with y max = 0.9m (middle) lateral acceleration with amax = 0.3g (right) barrier function where positive values indicate satisfaction. problem how to do characterize and compute such functions for general classes of control systems. In addition, formulating how to unify safety constraints, e.g., combining ACC and LK constraints into a single framework, has the potential to suggest methods for composing safety specifications. Going beyond automotive systems, the presented methodologies are naturally applicable to robotic systems, e.g., in the context of self-collision avoidance, obstacle avoidance, end-effector (and foot) placement, and a myriad of other safety constraints. Exploring these applications promises to provide a formal framework for safety-critical operation of robotic systems. ACKNOWLEDGEMENTS The authors are indebted to H. Peng (University of Michigan) for guidance on the models and control specifications for adaptive cruise control and lane keeping. We also greatly benefited from feedback by T. Pilutti, M. Jankovic, and W. Milam (Ford Motor Company) as well as K. Butts and D. Caveney (Toyota Technical Center) during the course of this work. The work of Aaron Ames was performed while he was with the Woodruff School of Mechanical Engineering and the School of Electrical and Computer Engineering at the Georgia Institute of Technology. A PPENDIX In this appendix, we develop two control barrier functions hcF and hoF for the safe set C in Section V-A. Recall the dynamics of the ACC model (43). If we drop the aerodynamic drag term Fr , then a RCBF BF meeting the comfort constraint (FC) for the simplified dynamic is also a RCBF for the original model (43), because the drag terms effectively augment the action of braking. In what follows, we develop the RCBFs for the ACC problem with input constraints using the simplified model, and the optimality is in the sense of the simplified model. For simplicity, suppose that the present time is t0 = 0 and denote vf (0), vl (0) and D(0) by vf , vl , and D respectively. If the lead car brakes using its maximal deceleration force, then the best response of the controlled car is to brake using its maximal deceleration force. Let Tl and Tf denote the time in seconds for the two cars to come to a complete stop when using maximum braking force, respectively. Supposing there v are no reaction delays, it follows that Tl = avllg , Tf = affg . Optimal CBF for ACC. The optimal RCBF takes the form ho F of BFo = h1o or BFo = −log( 1+h ) with o F F hoF (x) = D − ∆o∗ where ∆o∗ is given as follows: (i) If Tf > Tl (or equivalently vf > al vl /af ), which implies the lead car can stop first, then ∆o∗ = max (∆1 (t) + τd (vf − af gt)). t∈[0,Tf ] with ∆1 (t) = ( (vf t − 21 af gt2 ) − (vl t − 21 al gt2 ), t ∈ [0, Tl ), (vf t − 21 af gt2 ) − vl2 2al g , t ∈ [Tl , Tf ]. (ii) If Tf ≤ Tl (or equivalently vf ≤ al vl /af ), which implies the following car can stop first, then ∆o∗ = max (∆2 (t) + τd (vf − af gt)), t∈[0,Tf ] with 1 1 ∆2 (t) = (vf t − af gt2 ) − (vl t − al gt2 ), t ∈ [0, Tf ]. 2 2 For both cases, ∆1 (t) or ∆2 (t) is the decrease in relative distance at time t between the two cars, and ∆o∗ is the maximum decrease in distance headway. The explicit form of ∆o∗ can be derived by solving the optimization problem above. The results are given as follows. Define ∆o∗ 1 = 1.8vf , 1 (1.8af g − vf )2 v2 ∆o∗ + 1.8vf − l , 2 = 2 af g 2al g 2 1 (vl + 1.8af g − vf ) ∆o∗ + 1.8vf . 3 = 2 (af − al )g When af = al , ( ∆ o∗ = ∆o∗ 1 , ∆o∗ 2 , if 0 < vf < vl + 1.8af g; otherwise. 16 When af > al ,  o∗  ∆1 , o∗ o∗ ∆ = ∆2 ,   o∗ ∆3 , When af < al , ( ∆o∗ 1 , o∗ ∆ = ∆o∗ 2 , R EFERENCES if 0 < vf < vl + 1.8af g; a if vf ≥ afl vl + 1.8af g; otherwise. if 0 < vf < otherwise. p af /al vl + 1.8af g; Convervative CBF for ACC. A simpler, albeit conservative, estimate of the safe set is given in this section. Replace the term τd (vf −af gt) by τd vf in ∆o∗ and denote the new formula by ∆c∗ . Then we define hcF (x) = D − ∆c∗ , and call the associated RCBF candidate BFc as in BFc := 1/hcF hcF c or BF = log( 1+hc ) the conservative RCBF. Clearly, ∆c∗ F is larger than ∆o∗ and therefore hcF corresponds to a more conservative safety set than hoF . However, the closed-form expressions for ∆c∗ are much simpler than ∆o∗ , which is given as follows. ∆c∗ =   τd vf , if vl ≥ vf , Tl ≥ Tf ;  2   τd vf + 1 (al vf −af vl ) , if vl ≥ vf , Tl < Tf ; 2 al af (al −af )g  τd vf +     τd vf + 2 1 (vf −vl ) 2 (af −al )g , 2 2 1 vf al −vl af 2 af al g if vl < vf , Tl ≥ Tf ; , if vl < vf , Tl < Tf . It is easy to check that hoF and hcF above are valid RCBFs. For example, we prove that BFc := 1/hcF satisfies   1 c c inf Lf BF + Lg BF u − c ≤ 0. u∈U BF When vl ≥ vf , Tl ≥ Tf , taking u = −af M g results in Lf BFc + Lg BFc u = − τd af g + (vl − vf ) < 0. (hcF )2 When vl ≥ vf , Tl < Tf , taking u = −af M g results in Lf BFc + Lg BFc u =− (al vf −af vl )(al af g+af aL ) al af (al −af )g (hcF )2 τd af g + (vl − vf ) + < 0, because al > af and al vf > af vl in this case. When vl < vf , Tl ≥ Tf , taking u = −af M g results in Lf BFc + Lg BFc u =− τd af g + (vf −vl )(al g+aL ) (af −al )g c (hF )2 < 0, because vf > vl and af > al in this case. When vl < vf , Tl < Tf , taking u = −af M g results in Lf BFc + Lg BFc u = − τd af g + vl + vl aL /al g < 0. (hcF )2 Clearly, the corresponding optimal and conservative ZCBFs are just hoF and hcF shown above, respectively. [1] M. Z. Romdlony and B. Jayawardhana, “Uniting control Lyapunov and control barrier functions,” in IEEE Conference on Decision and Control, 2014, pp. 2293–2298. [2] A. D. Ames, J. W. Grizzle, and P. Tabuada, “Control barrier function based quadratic programs with application to adaptive cruise control,” in IEEE Conference on Decision and Control, 2014, pp. 6271–6278. [3] A. Forsgren, P. E. Gill, and M. H. Wright, “Interior methods for nonlinear optimization,” SIAM Review, vol. 44, no. 4, pp. 525–597, 2002. [4] P. Malisani, F. Chaplais, and N. Petit, “An interior penalty method for optimal control problems with state and input constraints of nonlinear systems,” Optimal Control Applications and Methods, vol. 37, pp. 3–33, 2016. [5] K. P. Tee, S. S. Ge, and E. H. Tay, “Barrier Lyapunov functions for the control of output-constrained nonlinear systems,” Automatica, vol. 45, no. 4, pp. 918 – 927, 2009. [6] P. Wieland and F. Allgöwer, “Constructive safety using control barrier functions,” in Proceedings of the 7th IFAC Symposium on Nonlinear Control System, 2007, pp. 462–467. [7] J. P. Aubin, Viability theory. Springer, 2009. [8] C. Sloth, R. Wisniewski, and G. J. Pappas, “On the existence of compositional barrier certificates,” in IEEE Conference on Decision and Control, 2012, pp. 4580–4585. [9] R. Wisniewski and C. Sloth, “Converse barrier certificate theorems,” IEEE Transactions on Automatic Control, vol. 61, no. 5, pp. 1356–1361, 2016. [10] S. Prajna and A. Rantzer, “Convex programs for temporal verification of nonlinear dynamical systems,” SIAM Journal of Control and Optimization, vol. 46, no. 3, pp. 999–1021, 2007. [11] S. Prajna, A. Jadbabaie, and G. J. Pappas, “A framework for worst-case and stochastic safety verification using barrier certificates,” Automatic Control, IEEE Transactions on, vol. 52, no. 8, pp. 1415–1428, 2007. [12] D. Panagou, D. M. Stipanovič, and P. G. Voulgaris, “Multi-objective control for multi-agent systems using lyapunov-like barrier functions,” in IEEE Conference on Decision and Control, 2013, pp. 1478–1483. [13] E. Sontag, “A Lyapunov-like stabilization of asymptotic controllability,” SIAM Journal of Control and Optimization, vol. 21, no. 3, pp. 462–471, 1983. [14] Z. Artstein, “Stabilization with relaxed controls,” Nonlinear Analysis: Theory, Methods & Applications, vol. 7, no. 11, pp. 1163–1173, 1983. [15] E. Sontag, “A ’universal’ contruction of Artstein’s theorem on nonlinear stabilization,” Systems & Control Letters, vol. 13, pp. 117–123, 1989. [16] R. A. Freeman and P. V. Kokotović, Robust Nonlinear Control Design. Birkhäuser, 1996. [17] L. Dai, T. Gan, B. Xia, and N. Zhan, “Barrier certificates revisited,” Journal of Symbolic Computation, 2016, http://dx.doi.org/10.1016/j.jsc. 2016.07.010. [18] H. Kong, F. He, X. Song, W. Hung, and M. Gu, “Exponential-conditionbased barrier certificate generation for safety verification of hybrid systems,” in CAV2013, volume 8044 of LNCS. Springer, 2013, pp. 242–257. [19] A. D. Ames, K. Galloway, and J. W. Grizzle, “Control Lyapunov Functions and Hybrid Zero Dynamics,” in IEEE Conference on Decision and Control, 2012, pp. 6837–6842. [20] A. D. Ames, K. Galloway, J. W. Grizzle, and K. Sreenath, “Rapidly Exponentially Stabilizing Control Lyapunov Functions and Hybrid Zero Dynamics,” IEEE Trans. Automatic Control, vol. 59, no. 4, pp. 115– 1130, 2014. [21] K. Galloway, K. Sreenath, A. Ames, and J. Grizzle, “Walking with Control Lyapunov Functions (2012),” Youtube Video. [Online]., available: http://youtu.be/onOd7xWbGAk. [22] K. Galloway, K. Sreenath, A. D. Ames, and J. W. Grizzle, “Torque saturation in bipedal robotic walking through control Lyapunov functionbased quadratic programs,” IEEE Access, vol. 3, pp. 323–332, 2015. [23] A. D. Ames and M. Powell, “Towards the unification of locomotion and manipulation through control lyapunov functions and quadratic programs,” in Control of Cyber-Physical Systems, Lecture Notes in Control and Information Sciences, vol. 449, 2013, pp. 219–240. [24] B. J. Morris, M. J. Powell, and A. D. Ames, “Continuity and smoothness properties of nonlinear optimization-based feedback controllers,” in IEEE Conference on Decision and Control, 2015, pp. 151–158. [25] J. Mareczek, M. Buss, and M. W. Spong, “Invariance control for a class of cascade nonlinear systems,” Automatic Control, IEEE Transactions on, vol. 47, no. 4, pp. 636–640, 2002. 17 [26] J. Wolff and M. Buss, “Invariance control design for constrained nonlinear systems,” in Proceedings of the 16th IFAC World Congress, 2005, pp. 37–42. [27] M. Kimmel and S. Hirche, “Invariance control with chattering reduction,” in IEEE Decision and Control, 2014, pp. 68–74. [28] S. Lee, M. Leibold, M. Buss, and F. C. Park, “Rollover prevention of mobile manipulators using invariance control and recursive analytic ZMP gradients,” Advanced Robotics, vol. 26, no. 11-12, pp. 1317–1341, 2012. [29] M. Kimmel and S. Hirche, “Active safety control for dynamic humanrobot interaction,” in Intelligent Robots and Systems (IROS), IEEE/RSJ International Conference on, 2015, pp. 4685–4691. [30] A. Isidori, Nonlinear Control Systems-3rd Edition. Springer, 1995. [31] A. Vahidi and A. Eskandarian, “Research advances in intelligent collision avoidance and adaptive cruise control,” Intelligent Transportation Systems, IEEE Transactions on, vol. 4, no. 3, pp. 143–153, 2003. [32] S. Li, K. Li, R. Rajamani, and J. Wang, “Model predictive multiobjective vehicular adaptive cruise control,” Control Systems Technology, IEEE Transactions on, vol. 19, no. 3, pp. 556–566, 2011. [33] G. Naus, J. Ploeg, M. Van de Molengraft, W. Heemels, and M. Steinbuch, “Design and implementation of parameterized adaptive cruise control: An explicit model predictive control approach,” Control Engineering Practice, vol. 18, no. 8, pp. 882–892, 2010. [34] P. A. Ioannou and C.-C. C. Chien, “Autonomous intelligent cruise control,” Vehicular Technology, IEEE Transactions on, vol. 42, no. 4, pp. 657–672, 1993. [35] C.-Y. Liang and H. Peng, “Optimal adaptive cruise control with guaranteed string stability,” Vehicle System Dynamics, vol. 32, no. 4-5, pp. 313–330, 1999. [36] ——, “String stability analysis of adaptive cruise controlled vehicles,” JSME International Journal Series C, vol. 43, no. 3, pp. 671–677, 2000. [37] B. Van Arem, C. J. van Driel, and R. Visser, “The impact of cooperative adaptive cruise control on traffic-flow characteristics,” Intelligent Transportation Systems, IEEE Transactions on, vol. 7, no. 4, pp. 429–436, 2006. [38] E. J. Rossetter and C. J. Gerdes, “Lyapunov based performance guarantees for the potential field lane-keeping assistance system,” Journal of Dynamic Systems, Measurement, and Control, vol. 128, no. 3, pp. 510–522, 2006. [39] X. Xu, P. Tabuada, A. D. Ames, and J. W. Grizzle, “Robustness of control barrier functions for safety critical control,” in IFAC Conference on Analysis and Design of Hybrid Systems, 2015, pp. 54–61. [40] S. P. Boyd and L. Vandenberghe, Convex optimization. Cambridge university press, 2004. [41] H. K. Khalil, Nonlinear Systems (Third Edition). Prentice Hall, 2002. [42] R. P. Agarwal, R. P. Agarwal, and V. Lakshmikantham, Uniqueness and nonuniqueness criteria for ordinary differential equations. World Scientific, 1993. [43] P. Hartman, Ordinary Differential Equations (Second Edition). SIAM, 2002. [44] F. Blanchini and M. Stefano, Set Theoretic Methods In Control. Birkhäuser Basel, 2008. [45] F. Blanchini, “Set invariance in control,” Automatica, vol. 35, no. 11, pp. 1747–1767, 1999. [46] Y. Lin, E. Sontag, and Y. Wang, “A smooth converse Lyapunov theorem for robust stability,” SIAM Journal on Control and Optimization, vol. 34, no. 1, pp. 124–160, 1996. [47] A. Bacciotti and L. Rosier, Liapunov functions and stability in control theory. Springer, 2005. [48] A. Isidori, Nonlinear control systems II. Springer, 1999. [49] S.-C. Hsu, X. Xu, and A. D. Ames, “Control barrier functions based quadratic programs with application to bipedal robotic walking,” in American Control Conference, 2015, pp. 4542–4548. [50] Q. Nguyen and K. Sreenath, “Exponential control barrier functions for enforcing high relative-degree safety-critical constraints,” in American Control Conference, 2016, pp. 322–328. [51] R. A. Freeman and P. V. Kokotovic, “Inverse optimality in robust stabilization,” SIAM Journal on Control and Optimization, vol. 34, no. 4, pp. 1365–1391, 1996. [52] M. W. Spong, J. S. Thorp, and J. M. Kleinwaks, “The control of robot manipulators with bounded input,” IEEE Trans. Automatic Control, vol. 31, no. 6, pp. 483–490, 1986. [53] A. Mehra, W.-L. Ma, F. Berg, P. Tabuada, J. W. Grizzle, and A. D. Ames, “Adaptive cruise control: Experimental validation of advanced controllers on scale-model cars,” in American Control Conference, 2015, pp. 1411–1418. [54] D. G. Luenberger, Optimization by vector space methods. John Wiley & Sons, 1969. [55] K. Vogel, “A comparison of headway and time to collision as safety indicators,” Accident Analysis & Prevention, vol. 35, no. 3, pp. 427 – 433, 2003. [56] X. Xu, J. W. Grizzle, P. Tabuada, and A. D. Ames, “Correctness guarantees for the composition of lane keeping and adaptive cruise contro,” 2016. [Online]. Available: http://arxiv.org/abs/1609.06807 [57] “Adaptive cruise control: Experimental validation of advanced controllers on scale-model cars.” http://youtu.be/9Du7F76s4jQ.
3cs.SY
Challenges and potentials for visible light communications: State of the art Pranav Kumar Jha, Neha Mishra, and D. Sriram Kumar Citation: AIP Conference Proceedings 1849, 020007 (2017); doi: 10.1063/1.4984154 View online: http://dx.doi.org/10.1063/1.4984154 View Table of Contents: http://aip.scitation.org/toc/apc/1849/1 Published by the American Institute of Physics Challenges and Potentials for Visible Light Communications: State of the Art Pranav Kumar Jha*, Neha Mishra and D. Sriram Kumar Department of ECE National Institute of Technology, Tiruchirappalli, TN, India * [email protected] Abstract. Visible Light Communication is the emerging field in the area of Indoor Optical Wireless Communication which uses white light LEDs for transmitting data and light simultaneously. LEDs can be modulated at very high speeds which increases its efficiency and enabling it for the dual purposes of data communication and illumination simultaneously. Radio Frequency have some limitations which is not at par with the current demand of bandwidth but using visible light, it is possible to achieve higher data rates per user. In this paper, we discuss some challenges, potentials and possible future applications for this new technology. Basically, visible light communication is for indoor application capable of multiuser access. We also design a very basic illumination pattern inside a room using uniform power distribution. INTRODUCTION In the most recent couple of years, worldwide research in Visible Light Communication (VLC) utilizing LEDs for both light and information is at the pinnacle. This technology is useful mainly due to high transmission capacity and information rate, information security, no health hazards and low power utilization. Nowadays, the incandescent bulb is gradually being eliminated as it has a low energy efficiency. LEDs are the best choice for illumination and also for communication purposes and it is fit for changing to various light power levels at a quick rate and the exchanging rate is sufficiently quick to be noticed by a human eye [3]. The information is encoded in radiating light in different ways and a photodetector at the receiver receives and decodes the modulated signal fulfilling the criteria of the dual purposes of illumination and communication. In the recent years, it has been demonstrated that VLC can achieve high information rates [1] as the communication encoded in visible light has uncommon significance relative to existing modes of wireless communication. In the most recent two decades, confinements of Radio Frequency (RF) have been related to the exponential increment of traffic over mobile data networks. RF waves interfere with electronic devices and can infiltrate walls effectively prompts to the deterioration of signals and this attenuation in propagation limits information rates of proposed clients, however, visible light does not interfere with electronic devices. Since transmission does not bind to the expected region, the security of the connections might be traded off by listening stealthily malignant clients. VLC can give required coverage, visible light cannot infiltrate walls, so it has an inalienable connection security. Visible light communication operating in the visible light range, which incorporates hundreds of terahertz of license free bandwidth shown in Fig. 1 [3], can correlate the RF based mobile communication systems in designing high capacity mobile data networks. Visible light cannot infiltrate through walls and objects which permits to generate small cells of LED transmitters with no inter-cell interference issues over the walls and parcels and feeds an inherent security for wireless data communications and can also increase the capacity of the available wireless channel. Let There be Light AIP Conf. Proc. 1849, 020007-1–020007-8; doi: 10.1063/1.4984154 Published by AIP Publishing. 978-0-7354-1521-8/$30.00 020007-1 FIGURE 1. The human eye can sense the electromagnetic signals between the frequency range of 430 THz and 790 THz VLC OUTLINE Transmitter LED is the most regularly used transmitters in visible light communication. It might be an LED or array of LEDs. The flow of current through the LEDs is controlled by a driver circuit and in turn brightness of transmitting light can be controlled. For communication purposes in both indoor and outdoor applications, white light is the most widely used forms of illumination because of color rendering [3]. Two types of LEDs are used to produce white light. By proper mixing of red, green and blue (RGB) light, white light can be generated. Another way to generate white light is to use a blue LED with yellow phosphor coating [3] where different intensities of white light can be generated by adjusting the thickness of the phosphor layer. RGB combination method of generating white light is not cost effective as it uses three separate LEDs costs higher than using blue LED with phosphor [3]. Receiver Either a photodetector or an imaging sensor (camera sensor) is used as receivers. The receiver consists of a photodetector and a setup for demodulation of the data. A camera sensor could also be used to receive the data sent from the LED array. An ideal photodetector should be sensitive to the wavelength interval analogous with the light, reliable and cost effective [3]. A photodetector should not be affected by the fluctuations in temperature. Any mobile device with a camera can be allowed to receive visible light for communication using image sensor. However, in its present form, it can just give exceptionally constrained throughput because of its low sampling rate. Then again, remain solitary photodetectors have appeared to accomplish fundamentally higher throughput [3]. CHALLENGES In general, optical communication is a system which is used every day by millions of users. Laser links are either space based or terrestrial point-to-point Free Space Optical Communications (FSO). Visible Light Communication is a completely new technology having the goal to utilize the lighting system for lighting and communication 020007-2 simultaneously. Though the growth of indoor wireless communication is growing very fast, Wi-Fi cannot keep up the increasing demands of the bandwidth. Wi-Fi can provide only limited data per user during heavy usage. Later studies suggest that more than an eighty percent of wireless data communication engenders indoors. VLC system transmits information back and forth from infrastructure to mobile users for wireless data communication. To illuminate and to transmit energy in the form of data, LEDs are used frequently. It is not possible with the incandescent light sources or fluorescent light sources because it could not be modulated very effectively. LEDs are ubiquitous, non-coherent and very easy to modulate. LED can be modulated at a very reasonable rate. These devices are not designed for communications, only for lighting. It is not necessary to think about synchronizing carrier, phase or anything. The problem is their bandwidth is limited to a few megahertz (MHz) and they are not designed for high bandwidth. Improving Information Rate For improving the rate of information, the most recent work is done in [4] where VLC guided-wave links based on the utilization of µLEDs and PAM schemes gives high-speed (>1 Gbps) optical interconnection in short-reach lowcost communication links [4]. Micro LEDs are much smaller in size, much faster rise time at a very low power level. Modulation, coding and pre-equalization [2] of transmitters are used for increasing the data rates. Suppose inside a hall, if everyone wants to connect to the internet to watch videos, handling of that might not be possible for Wi-Fi installed in that hall. With this technology, it is possible to use different levels of spatial multiplexing and spatial reuse of the resource in such a way that not everyone gets 1 Gbps, but it might be possible to supply everyone in that hall with enough bandwidth to watch their video and this is the problem addressed. MIMO There is the possibility of significant multiplexing gain by having a multiple antenna supply signal to different receivers because receivers belong to own individual or multiple individuals [5]. Also, the possibility of using imaging receivers enables users to be in touch with the internet anywhere and anytime. For example, a camera is taking videos of lights and the lights could be encoded to downlink information directly through that and this possibility of using imaging receivers that had already built-in to all mobile devices already provides users to be connected to the internet endlessly. Modulation The modulation techniques that are used in RF cannot be used for visible light communications. Flicker is a major problem as light is modulated at a very high speed and it may harm human eye. Dimming is also a problem for indoor environment where the amount of light needs to be controlled as per user’s requirements. LED rise time and nonlinearity are also a problem in modulation. Single carrier pulse based (MEPPM) and multicarrier (OFDM) modulation techniques are frequently used in visible light communications [6, 7]. LEDs are peak power limited and OFDM has high Peak to Average Power ratio. Conventional modulation for optical communication is pulse position modulation (PPM). Pulse amplitude modulation (PAM) cannot be used because of the flicker and dimming. 020007-3 Shadowing FIGURE 2. Directed and diffuse links Where there is light, a single point is being illuminated by multiple light sources and then the shadowing problem translates to blocking one of many line-of-sight (LOS) links and for blocking all the LOSs, the concept of overprovisioning is used. If the adaptive modulation is used, it is possible to block some of those LOSs. Adaptive modulation and coding can be done to adjust to channel change. Fast accurate channel estimation is the key point for adjusting channel. When available, VLC can be used as an enhancement. Channel Modelling and Estimation (b) (a) FIGURE 3. (a) Impulse response from ray-tracing model; (b) Multipath Effect If a source and a receiver are used and the light goes LOS, it will reflect from all the walls and surfaces. In the Fig. 3(a), there are two LOSs and others is for reflections, a Ray-tracing model [9] is used to generate this impulse response. Here for the impulse response, a very short LOS Fig. 3(a) and a broad Non-LOS Fig. 3(b) is used and modulated as a Gaussian mixture. For address shadowing, rapid channel estimation can be used [10]. Multi User Access To provide data or information to the multiple users at a place, the supply of data should be in such a way that everyone gets connectivity for the resource available. Hence, for resource allocation so the resource or light source that are allocating power could be used efficiently, multiplexing could be done in different ways, and if it is orthogonal frequency-division multiplexing (OFDM), different frequency band for different users can be allocated. Frequency, time and code division multiplexing used can be same as RF but there is an addition that is spatial modulation [12]. 020007-4 Uplink To watch a video online selectively, requests should be generated and this requires uplink [8]. There are two ways in which it could be done. The first one is a stand-alone system and this prototype uses visible light, Infrared, RF or millimeter wave and if any of these is used for uplink, it can be completely stand-alone from the mobile back up into infrastructure. Visible light is not suitable otherwise the phone’s LED and the phone will be switched on for requesting the video which is really not the purpose. Infrared is not used these days. The second method is to converge system with others that are already deployed. Heterogeneous networks using Wi-Fi or cellular could be deployed as primarily downlink, but it freezes up a lot of Wi-Fi to service a lot of uplink and there is an asymmetry that the downlink tends to have a lot more demand than uplink. It might be possible to construct a balance between using more of the Wi-Fi for the uplink and less for the downlink APPLICATIONS Underwater Communications VLC is a brilliant option for fast submerged communication contrasted with RF transmission, which is still to a great degree troublesome, and acoustic communication which comes about costly and have restricted the information rate. Hospitals Wi-Fi is typically not allowed in hospitals because there are issues with health, interfering with electronic equipment. And if Wi-Fi is not there wireless is not there. It may be possible to provide some connectivity using VLC. This can be useful in critical situations which requires internet connectivity like monitoring patients from other locations without interfering with the other electronic equipment. Public Places For outdoor application, LEDs are already deployed in the headlights and taillights of cars, streetlights and traffic signals. Using LED can provide potential to have communication going from traffic signal to the car, when there is an accident up ahead. This could save possible future accidents. Disaster Management It may be possible to detect any minor cracks inside the aircraft engines and wings or any part of the aircraft, so that it could get fixed within time preventing air disaster. Fatigue failure is usually cannot seen by human eyes but using light it is possible to examine constantly, so that any possible cause for the accident could get fixed with less human effort. During heavy rain or fog, maneuvering the aircraft for landing is not an easy task, but it could be simpler with the help of this technology as light is already carrying information and information about the height and location of the aircraft can be exchanged automatically with the aircraft. Power Distribution inside a Typical Room Scenario The indoor communication challenges, mostly depend on the power distribution of a typical room size. Fig. 4(a) shows a typical 4mx4mx3m room with a distance of 2.25m between the LEDs at the center of the top and the working space. The power distribution plots of the given scenario are determined for different irradiance angles for a 4x4 MIMO system and shown in Fig. 5 where different illumination patterns with wide and narrow coverage are obtained. The application of wide coverage is required for illumination purpose, whereas the narrow coverage targets point-topoint communication. In wide coverage, MIMO system suffers from co-channel interference rather than gaining mobility. In another case, the narrow coverage does not provide favorable regions for mobile users even though interference free. These factors, mainly affect the performance of MIMO systems. So, overcoming the challenge of tradeoff using unique power distribution pattern is a future direction [13]. 020007-5 (a) (b) FIGURE 4. (a) MIMO system in a typical room scenario; (b) System model with simulation parameters The LED is accepted to have a Lambertian radiant intensity shown in the following equation [11, 13]: R(θ ) = (m + 1)cosm (θ ) (1) 2π Where the order of Lambertian emission  sketched by the LED's semi-angle at half power  . The order of Lambertian emission described in the following equation [13]: m=− ln 2 ln(cos(θ1/ 2 )) (2) Where irradiance angle  and incidence angle  respectively could be clearly shown in Fig. 4(b) [13]. Light passes from LED to receiver (Rx) through the LOS as the LEDs are situated at the center of the room. The received power can be given by the channel transfer function as [13]; ⎧ (m + 1)A cos m θ cosϕ ,ϕ ≥ϕ FOV ⎪ h=⎨ 2πd 2 ⎪0,ϕ <ϕ FOV ⎩ (3) Here the receiver (Rx) has an area  and  is the LOS distance between the LED and Rx. As shown in Eq. (3), the incidence angle  ought to be not as much as the field-of-view (FOV) incidence angle  , else, the channel transfer function is zero [13]. Table TABLE 1. Simulation parameters Space between LEDs (In meters) 1.5 1.5 1.5 1.5 Irradiance angle (In degrees) Space between detectors (In meters) 4 5 7 8 0.5 0.5 0.5 0.5 020007-6 MATLAB 2015b is used for the simulation purpose and the received power distribution plots for different irradiance angles are presented in the figures below: FIGURE 5. (a) (b) (c) (d) FIGURE 5 (a)(b)(c)(d) CONCLUSION Different challenges and potentials for visible light communication along with the possible future applications has been discussed. A brief power distribution simulation has been done to show the different illumination patterns which give tradeoff between illumination and communication. It has been concluded that wide coverage suits for illumination where communication happens with high interference. To overcome the issue, a narrow coverage illumination pattern has been designed for 4 degree LED semi-angle, which suits best for fixed point-to-point line-of-sight indoor communications. 020007-7 REFERENCES 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. D. C. O'Brien, "Visible Light Communications: Challenges and potential," IEEE Photonic Society 24th Annual Meeting, Arlington, VA, 2011, pp. 365-366. D. C. O'Brien, L. Zeng, H. Le-Minh, G. Faulkner, J. W. Walewski and S. Randel, "Visible light communications: Challenges and possibilities," 2008 IEEE 19th International Symposium on Personal, Indoor and Mobile Radio Communications, Cannes, 2008, pp. 1-5. P. H. Pathak, X. Feng, P. Hu and P. Mohapatra, "Visible Light Communication, Networking, and Sensing: A Survey, Potential and Challenges," in IEEE Communications Surveys & Tutorials, vol. 17, no. 4, Fourthquarter 2015, pp. 2047-2077. N. Bamiedakis et al., "Micro-LED-based guided-wave optical links for visible light communications," 2015 17th International Conference on Transparent Optical Networks (ICTON), Budapest, 2015, pp. 1-4. J. Lian and M. Brandt-Pearce, "Multiuser multidetector indoor visible light communication system," 2015 OptoElectronics and Communications Conference (OECC), Shanghai, 2015, pp. 1-3. M. Noshad and M. Brandt-Pearce, "Application of Expurgated PPM to Indoor Visible Light Communications— Part II: Access Networks," in Journal of Lightwave Technology, vol. 32, no. 5, March1, 2014, pp. 883-890. I-Cheng Lu, Yen-Liang Liu and Chih-Han Lai, "High-speed 2×2 MIMO-OFDM visible light communication employing phosphorescent LED," 2016 Eighth International Conference on Ubiquitous and Future Networks (ICUFN), Vienna, 2016, pp. 222-224. A. Jovicic, J. Li and T. Richardson, "Visible light communication: opportunities, challenges and the path to market," in IEEE Communications Magazine, vol. 51, no. 12, December 2013, pp. 26-32. E. Sarbazi, M. Uysal, M. Abdallah and K. Qaraqe, "Ray tracing based channel modeling for visible light communications," 2014 22nd Signal Processing and Communications Applications Conference (SIU), Trabzon, 2014, pp. 702-705. M. J. Vincent Hogue, A. O. Dahmane, S. Moussa and C. D'Amours, "Rapid prototyping of channel estimation techniques in MIMO-OFDM systems," 6th Joint IFIP Wireless and Mobile Networking Conference (WMNC), Dubai, 2013, pp. 1-4. Z. Wang, W.D. Zong, C. Yu, J. Chen, A novel LED arrangement to reduce SNR fluctuation for multi-user in visible light communication systems, in: Proceedings of the ICICS, 2011, pp. 1–4. K. Xu, H. Yu and Y. J. Zhu, "Channel-Adapted Spatial Modulation for Massive MIMO Visible Light Communications," in IEEE Photonics Technology Letters, vol. 28, no. 23, Dec.1, 1 2016, pp. 2693-2696. Chi-Wai Chow, Yang Liu, Chien-Hung Yeh, Chung-Yen Chen, Chao-Nan Lin, Dar-Zu Hsu, Secure communication zone for white-light LED visible light communication, Optics Communications, Volume 344, 1 June 2015, ISSN 0030-4018, pp 81-85. 020007-8
7cs.IT
1 Investigating the Effectiveness of Variance Reduction Techniques in Manufacturing, Call Center and Cross-Docking Discrete Event Simulation Models Adrian Adewunmi* and Uwe Aickelin** Variance reduction techniques have been shown by others in the past to be a useful tool to reduce variance in Simulation studies. However, their application and success in the past has been mainly domain specific, with relatively little guidelines as to their general applicability, in particular for novices in this area. To facilitate their use, this study aims to investigate the robustness of individual techniques across a set of scenarios from different domains. Experimental results show that Control Variates is the only technique which achieves a reduction in variance across all domains. Furthermore, applied individually, Antithetic Variates and Control Variates perform particularly well in the Cross-docking scenarios, which was previously unknown. 1.1 Introduction There are several analytic methods within the field of operational research; simulation is more recognized in contrast to others such as mathematical modeling and game theory. In simulation, an analyst creates a model of a real - life system that describes some process involving individual units such as persons or products. The constituents of such a model attempt to reproduce, with some varying degree of accuracy, the actual operations of the real workings of the process under consideration. It is likely that such a real - life system will have time - varying inputs Adrian Adewunmi · Uwe Aickelin Intelligent Modelling & Analysis Research Group (IMA) School of Computer Science The University of Nottingham Jubilee Campus Wollaton Road Nottingham NG8 1BB UK e-mail: [email protected], [email protected] * Corresponding author. ** Co – author. 2 A. Adewunmi and U. Aickelin and time - varying outputs which may be influenced by random events (Law 2007). For all random events it is important to represent the distribution of randomness accurately within input data of the simulation model. Since random samples from input probability distributions are used to model random events in simulation model through time, basic simulation output data are also characterized by randomness (Banks et al. 2000). Such randomness is known to affect the degree of accuracy of results derived from simulation output data analysis. Consequently, there is a need to reduce the variance associated within simulation output value, using the same or less simulation effort, in order to improve a desired precision (Lavenberg and Welch 1978). There are various alternatives for dealing with the problem of improving the accuracy of simulation experimental results. It is possible to increase the number of replications as a solution approach, but the required number of replications to achieve a desired precision is unknown in advance (Hoad et al. 2009) , (Adewunmi et al. 2008). Another solution is to exploit the source of the inherent randomness which characterizes simulation models in order to achieve the goal of improved simulation results. This can be done through the use of variance reduction techniques. “A variance reduction technique is a statistical technique for improving the precision of a simulation out-put performance measure without using more simulation, or, alternatively achieve a desired precision with less simulation effort" (Kleijnen 1974). It is know that the use of variance reduction techniques has potential benefits. However, the class of systems within which it is guaranteed to succeed and the particular technique that can achieve desirable magnitudes of variance reduction is ongoing research. In addition, applicability and success in the application of variance reduction techniques has been domain specific, without guidelines on their general use. “Variance reduction techniques cannot guarantee variance reduction in each simulation application, and even when it has been known to work, knowledge on the class of systems which it is provable to always work has remained rather limited" (Law and Kelton 2000). The aim of this chapter is to answer the research question; which individual application of variance reduction techniques will succeed is achieving a reduction in variance for the different discrete event simulation scenarios under consideration. The scope of this chapter covers the use of variance reduction techniques as individual techniques on a set of scenarios from different application domains. The individual variance reduction techniques are: i. ii. iii. Antithetic Variates Control Variates and Common Random Numbers. In addition, the following three real world application domains are under consideration: (i) Manufacturing System (ii) Distribution System and (iii) Call Centre System. The rest of the book chapter is laid out as follows; the next section gives a background into the various concepts that underpin this study. This is followed by 1 Investigating the Effectiveness of Variance Reduction Techniques 3 a case study section which describes the variance reduction techniques experimentation according to application domain. Further on is a discussion on the results from experimentation. 1.2 Reduction of Variance in Discrete Event Simulation The development of simulation models requires a specific knowledge that is usually acquired over time and through experience. Since most simulation output results are essentially random variables, it may be difficult to determine whether an observation is as a result of system interrelationships or the randomness inherent in simulation models. Furthermore, simulation as a process can consume a lot of time, despite advances in computer technology. An example of a time consuming task is one which is statistically based i.e. output data analysis. However, it is known that advances in computer simulation have allowed the modeling of more complicated systems. Moreover, even when simpler systems are simulated, it can be difficult to judge the precision of simulation results. In general, output analysis is the examination of data generated by simulation experimentation, and its purpose is to predict the performance of a system or to compare the performance of two or more alternative system design (Law 2007). However, simulation models differ from one another insofar as they have different values or types of system parameters, input variables, and behavioral relationships. These varying parameters, variables, and relationships are called "factors" and the output performance measure is called "response" in statistical design terminology (April et al. 2003). The decision as to which parameters are selected as fixed aspects of the simulation model and which are selected as experimental factors depends on the goals of the study rather than on the inherent form of the model. Also, during simulation studies there are usually a wide range of different responses or performance measure, which can be of interest. As a result, output performance measures for the three different simulation models considered within this study have been carefully selected after considering literature which reports on the most common performance metric for judging the performance of each simulation model (i.e. Manufacturing simulation, Call Centre simulation, and Crossdocking simulation). In addition, selection of output performance measures have been carried out in order to achieve a research goal of reducing simulation output variance through manual experimentation (Adewunmi 2010). For simulation models, where the performance of such models is measured by its precision, i.e. mean, standard deviation, confidence interval and half width, for the selected output performance measure, it is sometimes difficult to achieve a target precision at an acceptable computational cost because of variance. This variance is usually that which is associated with the performance measure under consideration. For example, (Adewunmi et al. 2008), investigated the use of the Sequential Sampling Method (Law and Kelton 2000) to achieve a target variance reduction for a selected simulation output performance measure. Results from experimentation indicate that this technique for reducing variance requires a huge number of simulation runs to achieve any success for this particular simulation model. In a wider context, the variance associated with a simulation or its output 4 A. Adewunmi and U. Aickelin performance measure may be due to the inherent randomness of the complex system under study. This variance can make it difficult to get precise estimates on the actual performance of the system. Consequently, there is a need to reduce the variance associated with the simulation output value, using the same or less simulation runs, in order to achieve a desired precision (Wilson 1984). The scope of this investigation covers the use of individual variance reduction techniques on different simulation models. This will be carried out under the assumption that all the simulation models for this study are not identical. The main difference between these models is the assumed level of inherent randomness. Where such randomness has been introduced by the following: a. The use of probability distributions for modeling entity attributes such as inter arrival rate and machine failure. Conversely, within other models, some entity attributes have been modeled using schedules. The assumption is; the use of schedules does not generate as much randomness as with the use of probability distribution. b. In addition, to the structural configuration of the simulation models under consideration i.e. the use of manual operatives, automated dispensing machines or a combination of both manual operatives and automated dispensing machines. As a result, the manufacturing simulation model is characterized by an inter arrival rate and processing time which are modeled using probability distribution, the call centre simulation model’s inter arrival rate and processing time are based on fixed schedules. The cross-docking simulation model is also characterized by the use of probability distribution to model the inter arrival rate and processing time of entities. The theoretical assumption is that by setting up these simulation models in this manner, there will be a variation in the level of model randomness. This should demonstrate the efficiency of the selected variance reduction techniques in achieving a reduction of variance for different simulation models, which are characterized by varying levels of randomness. In addition, as this is not a full scale simulation study, but a means of collecting output data for the variance reduction experiments, this investigation will not be following all the steps in a typical simulation study (Law 2007). 1.2.1 Variance Reduction Techniques Within this section, the discussion has been restricted to a selected subset of variance reduction techniques which have proven to be the most practical in use within the discrete event simulation domain (Lavenberg and Welch 1978), (Cheng 1986). Furthermore, these techniques have been chosen because of the manner each one performs variance reduction i.e. through random number manipulation or the use of prior knowledge. The three selected variance reduction techniques fall into two broad categories; the first class manipulates random numbers for each replication of the simulation experiment, thereby inducing either a positive or a negative correlation between the mean responses across replications. Two methods of this category of variance reduction techniques are presented. The first method, Common Random Numbers, only applies when comparing two or more 1 Investigating the Effectiveness of Variance Reduction Techniques 5 systems. The second method, using Antithetic Variates, applies when estimating the response of a variable of interest (Cole et al. 2001). The second class of variance reduction techniques incorporates a modeler’s prior knowledge of the system when estimating the mean response, which can result in a possible reduction in variance. By incorporating prior knowledge about a system into the estimation of the mean, the modeler’s aim is to improve the reliability of the estimate. For this technique, it is assumed that there is some prior statistical knowledge of the system. A method that falls into this category is Control Variates (Nelson and Staum 2006). The following literature with extensive bibliographies is recommended to readers interested in going further into the subject i.e. (Nelson 1987), (Kleijnen 1988) and (Law 2007). In next section is a discussion on the three variance reduction techniques that appear to have the most promise of successful application to discrete event simulation modeling is presented. 1.2.1.1 Common Random Numbers (CRN) Usually the use of CRN only applies when comparing two or more alternative scenarios of a single systems, it is probably the most commonly used variance reduction technique. Its popularity originates from its simplicity of implementation and general intuitive appeal. The technique of CRN is based on the premise that when two or more alternative systems are compared, it should be done under similar conditions (Bratley et al. 1986). The objective is to attribute any observed differences in performance measures to differences in the alternative systems, not to random fluctuations in the underlying experimental conditions. Statistical analysis based on common random numbers is founded on this single premise. Although a correlation is being introducing between paired responses, the difference, across pairs of replications is independent. This independence is achieved by employing a different starting seed for each of the pairs of replications. Unfortunately, there is no way to evaluate the increase or decrease in variance resulting from the use of CRN, other than to repeat the simulation runs without the use of the technique (Law and Kelton 2000). There are specific instances where the use of CRN has been guaranteed. Gal et.al. present some theoretical and practical aspects of this technique, and discuss its efficiency as applied to production planning and inventory problems (Gal et al. 1984). In addition, Glasserman and Yao state that "common random numbers is known to be effective for many kinds of models, but its use is considered optimal for only a limited number of model classes". They conclude that the application of CRN on discrete event simulation models is guaranteed to yield a variance reduction (Glasserman and Yao 1992). To demonstrate the concept of CRN, let Xa denote the response for alternative A and Xb denote the response for alternative B, while considering a single system. Let D, denote the difference between the two alternatives, i.e. D = Xa – Xb. The following equation gives the random variable D ′s variance. 6 A. Adewunmi and U. Aickelin Var ( D ) = Var ( X a X b ) + Var ( X a ) − 2Cov( X a , X b ) (1.1) 1.2.1.2 Antithetic Variates (AV) In comparison to CRN, the AV technique reduces variance by artificially inducing a correlation between replications of the simulation model. Unlike CRN, the AV technique applies when seeking to improve the performance of a single system's performance. This approach to variance reduction makes n independent pairs of correlated replications, where the paired replications are for the same system. The idea is to create each pair of replications such that a less than expected observation in the first replication is offset by a greater than expected observation in the second, and vice versa (Andreasson 1972), (Fishman and Huang 1983). Assuming that this value is closer to the expected response than the value that would result from the same number of completed independent replications, the average of the two observations is taken and the result used to derive the confidence interval. A similar feature that AV shares with CRN is it can also be difficult to ascertain that it will work, and its feasibility and efficacy are perhaps even more model dependent than CRN. Another similarity it shares with CRN is the need for a pilot study to assess its usefulness in reducing variance for each specific simulation model (Cheng 1981). In some situations, the use of AV has been known to yield variance reduction, and as mentioned earlier it can be model specific. In his paper, Mitchell considers the use of AV to reduce the variance of estimates obtained in the simulation of a queuing system. The results reported in this paper, show that a reduction in variance of estimates was achieved (Mitchell 1973). The idea of AV is more formally presented. Let random variable X, denote the response from the first replication and X ′ denote the replication from the second replication, within a pair. The random variable Y denotes the average of these two variables, i.e. Y = ( X + X ′) / 2 . The expected value of Y and the variance of Y are given as follows: E (Y ) = [ E ( X ) + E ( X ′)] = E ( X ) = E ( X ′) 2 (1.2) and Var (Y ) = [Var ( X ) + Var ( X ′) + 2Cov( X , X ′)] 4 (1.3) 1.2.1.3 Control Variates (CV) This technique is based on the use of secondary variables, called CV. This technique involves incorporating prior knowledge about a specific output performance parameter within a simulation model. It does not however require advance 1 Investigating the Effectiveness of Variance Reduction Techniques 7 knowledge about a parameters theoretical relationship within the model as would other variance reduction techniques such as Indirect Estimation (IE). As compared with CRN and AV, CV attempts to exploit the advantage of the correlation between certain input and output variables to obtain a variance reduction. Of course depending on the specific type of CV that is being applied, the required correlation may arise naturally during the course of a simulation experiment, or might arise by using CRN in an auxiliary simulation experiment (Law 2007). In order to apply the CV technique, it has to be assumed that a theoretical relationship exists between the control variate X, and the variable of interest Y. This approach does not require that a modeler knows the exact mathematical relationship between the control variates and the variable of interest; all the knowledge needed is to only know that the values are related. This relationship can be estimated by using the data recorded for instance from a pilot simulation study. Information from the estimated relationship is used to adjust the observed values of Y (Sadowski et al. 1995). Let X be the random variable that is said to partially control the random variable Y, and hence, it is called a control variate for Y. Usually it is assumed that there is a linear relationship between the variable of interest and the control variate. The observed values of the variable of interest Y can then be corrected, by using the observed values of the control variates X, as follows: Yi (n) = Y (n) − a( X (n) − E ( X )(n)) (1.4) And a= Cov(Y (n), X (n)) Var ( X ) (1.5) Where a is the amount by which an upward or downward adjustment of the variable of interest Y is carried out, E(X) is the mean of X, and n is the number of replications. There are, however, some classes of discrete event simulation models for which the application of control variates has proven to be successful. In a recent article on the use of variance reduction techniques for manufacturing simulation by Eraslan and Dengiz, CV and Stratified Sampling were applied for the purpose of improving selected performance measures, results from this paper suggest that CV yields the lowest variance for selected performance measures (Eraslan and Dengiz 2009). The main advantage of using CV as a technique for variance reduction is that they are relatively easy to use. More importantly, CV can essentially be generated anywhere within the simulation run, so they add basically nothing to the simulation's cost; thus they will prove worthwhile even if they do not reduce the variance greatly (Kelton et al. 2007). 8 A. Adewunmi and U. Aickelin 1.3 Case Studies This section proceeds to present 3 case studies: • The application of individual variance reduction techniques in a manufacturing system, • The application of individual variance reduction techniques in a call centre system, • The application of individual variance reduction techniques in a cross-docking distribution centre. 1.3.1 Manufacturing System 1.3.1.1 Description of a Manufacturing System / Simulation Model Typically, the simulation of manufacturing systems is performed using a commercial software, rather than through a purpose built application. The manufacturing simulation model has been developed using the ArenaTM simulation software. It is common that one of the activities during a simulation study is the statistical analysis of output performance measures. Since random samples from input probability distributions are used to model events in a manufacturing simulation model through time, basic simulation output data (e.g., average times in system of parts) or an estimated performance measure computed from them (e.g., average time in system from the entire simulation run) are also characterized by randomness (Buzacott and Yao 1986). Another source of manufacturing simulation model randomness which deserves a mention is unscheduled random downtime and machine failure which is also modeled using probability distributions. It is known that inherent model randomness can distort a true and fair view of the simulation model output results. Consequently, it is important to model system randomness correctly and also design and analyze simulation experiments in a proper manner (Law 2007). There are a number of ways of modeling random unscheduled downtimes, interested readers are directed to Chapter 13, section 3, Discrete Event System Simulation, Banks et.al. (Banks et al. 2000). The purpose of using variance reduction techniques is to deal with the inherent randomness in the manufacturing simulation model. This is through the reduction of variance associated with any selected measure of model performance. This reduction will be gained using the same number of replications that was used to achieve the initial simulation results. Improved simulation output results obtained from the application of variance reduction techniques has been known to increase the credibility of the simulation model. An investigation into the application of variance reduction techniques on a small manufacturing simulation model is herein presented. The simulation model under consideration has been adapted from chapter 7, Simulation with Arena, Kelton et.al. (Kelton et al 2007), purely for research purposes. Experimentation is based on the assumption that the output performance measures are of a 1 Investigating the Effectiv veness of Variance Reduction Techniques 9 terminating, multi scenarrio, single system discrete event simulation model. Thhe simple manufacturing sysstem consists of parts arrival, four manufacturing cellls, and parts departure. The system produces three part types, each routed through a different process plan in the t system. This means that the parts do not visit individdual Cells randomly, but through a predefined routing sequence. Parts enter thhe om the left hand side, and move only in a clockwise direccmanufacturing system fro tion, through the system. There T are four manufacturing cells; Cells 1, 2, and 4 eacch have a single machine, however, h Cell 3 has two machines. The two machines at Cell 3 are not identical in n performance capability; one of these machines is neweer than the other and can perrform 20% more efficiently than the other. Machine faiilure in Cells 1, 2, 3, and 4 in the manufacturing simulation model was representeed using an exponential distrribution with mean times in hours. Exponential distribuution is a popular choice when w modeling such activities in the absence of real datta. A layout of the small maanufacturing system under consideration is displayed iin figure 1.1. Fig. 1.1 Small Manufacturin ng System Layout adapted from (Kelton et al. 2007) Chapter 7. Herein is a description of the simulation model under consideration. All process times are triangularly disttributed, while the inter arrival times between successivve part arrivals are exponentially distributed. These are the probability distributionns which were already impleemented in the simulation model, and there was no reasoon not to continue using th hem. The Arena TM simulation model incorporates aan animation feature that cap ptures the flow of parts to and fro the cells, until they arre finally disposed or exist out o of the system. The inter arrival times between succeessive parts arrival are exponentially distributed with a mean of 13 minutes, whiile me 0. the first part arrives at tim 10 A. Adewunmi and U. Aickellin Here is a brief descrip ption of the ArenaTM control logic which underlines thhe animation feature. Parts arrival a are generated in the create parts module. The nexxt step is the association of a routing sequence to arriving parts. This sequence wiill determine the servicing ro oute of the parts to the various machine cells. Once a paart arrives at a manufacturing g cell (at a station), the arriving part will queue for a machine, and is then processed by a machine. This sequence is repeated at each of thhe manufacturing cells the part has to be processed. The process module for Cell 3 is slightly different from thee other three Cells. This is to accommodate the two diifferent machines, a new machine m and an old machine, which process parts at diifferent rates. Figure 1.2 shows the animation equivalent and control logic of thhe small manufacturing systeem simulation model. Fig. 1.2 Manufacturing system simulation animation and control logic adapted from (Keelton et al. 2007) Chapter 7 1.3.1.2 Variance Reducction Experiments This section of the chapteer is divided into two parts; the first describes the desiggn of the variance reduction n experiments and the second details the results of thhe application of individual variance v reduction techniques. 1 Investigating the Effectiveness of Variance Reduction Techniques 11 1.3.1.2.1 Experimental Design In designing the variance reduction experiment, data on time persistent performance measures was utilized for experimentation as opposed to both time and cost data. This is due mainly to the availability of time based data as opposed to cost based data during the performance of the case study. Although both types of data would have given a greater insight into the performance of the variance reduction techniques, using different classes of time based data should be sufficient for this level of experimentation. Here is a list of the three performance measures utilized: • Entity Total Average Time (Base): This is the average of the total time each entity will travel over the total length of the conveyor through the manufacturing system. • Resource Utilization (Base): This variable records the instantaneous utilization of a resource during a specific period. • Average Total WIP (Base): This metric records the average quantity of total work in process for each entity type. The experimental conditions are as follows: • • • • Number of Replications: 10 Warm up Period: 0 Replication Length: 30 Days Terminating Condition: None The performance measures have been labeled (Base), to highlight their distinction from those that have had variance reduction techniques applied and those that have not. As this is a pilot study where the goal is to establish the effectiveness of the variance reduction techniques under consideration, in this instance 10 simulation replications is deemed sufficient for collecting enough data for this purpose. An extensive bibliography on an appropriate number of replications for simulation experimentation and such like issues can be found in Robinson (Robinson 1994) and Hoad et.al (Hoad et al. 2009).In addition, for a full discussion on design issues such as warm up, replication length and simulation model termination condition for this study, readers are encouraged to see (Adewunmi 2010). In addition, performance measures have been classed according to variance reduction techniques, i.e. Average Total WIP (Base), Average Total WIP (CRN), and Average Total WIP (AV). This means for each performance measure, the appropriate variance reduction that has been applied to it is stated, i.e. CRN and that which has not been treated to a variance reduction technique is labeled (Base). Under consideration is a two scenario, single manufacturing discrete event simulation model. The scenario which has performance measures labeled (Base) is characterized by random number seeds dedicated to sources of simulation model randomness as selected by the simulation software Arena TM. The other scenario which has performance measures labeled common random number (CRN) has its identified sources of randomness, allocated dedicated random seeds by the user. So these two scenarios have unsynchronized and synchronized use of random numbers respectively (Law and Kelton 2000). 12 A. Adewunmi and U. Aickelin At this stage of experimental design, an additional performance measure Entity Wait Time is being introduced. This performance measure will be used for the CV experiment, with a view to applying it to adjusting upward or downwards the performance measure Entity Total Average Time (Base). Initial simulation results show a linear relationship between both variables, which will be exploited for variance reduction. Here is the hypothesis that aim’s to answer the research question: • There is no difference in the standard deviations of the performance measure. The hypothesis that tests the true standard deviation of the first scenario μ1 against the true standard deviation of the second scenario μ2 ,… scenario μk is: H 0 : μ1 = μ 2 =  = μk (1.6) Or H1 : μi ≠ μ k for at least one pair of (i, k ) (1.7) Assuming we have samples of size ni from the i – th population, i = 1, 2, … , k, and the usual standard deviation estimates from each sample: μ1 , μ 2 =  = μk (1.8) Test Statistic: Bartlett’s Test The Bartlett’s Test (Snedecor and Cochran 1989) has been selected as a test for equality of variance between samples, as it is assumed that our data is normally distributed. Furthermore, this is one of the most common statistical techniques for this purpose. However, an alternative test like the Levene's test (Levene 1960) could have been used. In this instance, it will not be appropriate because Levene's test is less sensitive than the Bartlett test to departures from normality. Significance Level: A value of α = 0.05 Next is a summary of results from the application of individual variance reduction techniques on a manufacturing simulation model. 1.3.1.2.2 Results Summary In this section, a summary of results on the performance of each variance reduction technique on each output performance measure is presented. In addition, a more in-depth description of results from the application of individual variance reduction techniques is presented in (Adewunmi 2010). • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.000) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Average Total WIP (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, CV technique 1 Investigating the Effectiveness of Variance Reduction Techniques 13 achieved the largest reduction in variance for the simulation output performance measure, Average Total WIP. • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.003) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Entity Total Average Time (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, AV technique achieved the largest reduction in variance for the simulation output performance measure, Entity Total Average Time. • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.006) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Resource Utilization (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, CRN technique achieved the largest reduction in variance for the simulation output performance measure, Resource Utilization. 1.3.2 Call Centre System 1.3.2.1 Description of a Call Centre System / Simulation Model With the progression towards skill based routing of inbound customer calls due to advances in technology, Erlanger calculations for call centre performance analysis has become outdated since it assumes that agents have a single skill and there is no call priority (Doomun and Jungum 2008). On the other hand, the application of simulation ensures the modeling of human agent skills and abilities, best staffing decisions and provides an analyst with a virtual call centre that can be continually refined to answer questions about operational issues and even long term strategic decisions (L'Ecuyer and Buist 2006). A close examination of a typical call centre reveals a complex interaction between several "resources" and "entities". Entities can take the form of customers calling into the call centre and resources are the human agents that receive calls and provide some service. These incoming calls, usually classified by call types, then find their way through the call centre according to a routing plan designed to handle specific incoming call type. While passing through the call centre, incoming calls occupy trunk lines, wait in one or several queues, abandon queues, and are redirected through interactive voice response systems until they reach their destination, the human agent. Otherwise, calls are passed from the interactive voice response system to an automatic call distributor (Doomun and Jungum 2008). An automatic call distributor is a specialized switch designed to route each call to an individual human agent; if no qualified agent is available, then the call is placed in a queue. See figure 1.3 for an illustration of the sequence of activities in typical call centre, which has just been described in this section. Since each human agent possesses a unique skill in handling incoming calls, it is the customers’ request that will determine whether the agent handles the call or transfers it to 14 A. Adewunmi and U. Aickellin another agent. Once the call c is handled, it then leaves the call centre system. Duuring all of these call handlling transactions, one critical resource being consumed is time. For example time spent handling a call and the time a call spends in thhe system. These are imporrtant metrics to consider during the evaluation of thhe performance of a call centtre. Fig. 1.3 A Simple Call Centrre adapted from (Doomun and Jungum 2008). Herein is a description of the simulation model under consideration. The simpple call centre system underr consideration has been adapted from the Chapter 5, Simulation with Arena, (Kelton et al 2007). This call centre system, althouggh theoretical in nature, contains the essential working components of a typical reeal life call centre, i.e. techn nical support, sales and customer order status checking. Arrival of incoming callss is generated using an arrival schedule. The purpose foor using an arrival schedule instead of modeling this event using a probability distrribution and a mean in min nutes is to cause the system to stop creating new arrivaals at a designated time into the simulation experiment. An answered caller has threee options: transfer to techn nical support, sales information, or order status inquiry. 1 Investigating the Effectiv veness of Variance Reduction Techniques 115 The estimated time for this activity is uniformly distributed; all times are iin minutes. In simulation terms, th he "entities" for this simple call centre model are produuct type 1, 2 and 3. The avaailable "resources" are the 26 trunk lines which are off a fixed capacity, and the sales and technical support staff. The skill of the sales annd d using schedules which show the duration during whicch technical staff is modeled for a fixed period, a resou urce is available, its capacity and skill level. The simulation model records the nu umber of customer calls that are not able to get a trunnk line and are thus rejected d from entering the system similar to balking in queuinng system. However, it does not consider “reneging”, where customers who get a trunk line initially, later hang h up the phone before being served. Figure 1.4, show ws an Arena TM simulation an nimation of the simple call centre simulation model. Fig. 1.4 Call Centre Simulatiion Animation adapted from (Kelton et al. 2007) Chapter 5 1.3.2.2 Variance Reducction Experiments This section of the chapteer is divided into two parts; the first describes the desiggn of the variance reduction experiments and the second details the results of the appplication of individual varriance reduction techniques. Experimental Design For the design of the calll centre variance reduction experiments, the three outpuut performance measures wh hich have been chosen are both time and cost persistennt in nature. Here is a list of these performance measures: • Total Average Call Tim me (Base): This output performance measure records thhe total average time an in ncoming call spends in the call centre simulation system m. 16 A. Adewunmi and U. Aickelin • Total Resource Utilization (Base): This metric records the total scheduled usage of human resources in the operation of the call centre over a specified period in time. • Total Resource Cost (Base): This is the total cost incurred for using a resource i.e. a human agent. The experimental conditions are as follows: • • • • Number of Replications: 10 Warm up Period: 0 Replication Length: 660 minutes (27.5 days) Terminating Condition: At the end of 660 minutes and no queuing incoming The call centre simulation model is based on the assumption that there are no entities at the start of each day of operation and the system will have emptied itself of entities at the end of the daily cycle. For the purpose of variance reduction experimentation, it is a terminating simulation model, although a call centre is naturally a non terminating system. No period of warm up has been added to the experimental set up. This is because experimentation is purely on the basis of a pilot run and the main simulation experiment, when it is performed, will handle issues like initial bias and its effect on the performance of variance reduction techniques. The performance measures have been labeled (Base), to highlight their distinction between those that have had variance reduction techniques applied and those that have not. These experiments assume that the sampled data is normally distributed. In addition, the performance measures have been classed according to variance reduction techniques, i.e. Total Average Call Time (Base), Total Average Call Time (CRN), and Total Average Call Time (AV).Under consideration as in the previous manufacturing simulation study is a two scenario, single call centre simulation model. The scenario which has performance measures labeled (Base) is characterized by random number seeds dedicated to sources of simulation model randomness as selected by the simulation software Arena TM. The other scenario which has performance measures labeled CRN has its identified sources of randomness, allocated dedicated random seeds by the user. So these two scenarios have unsynchronized and synchronized use of random numbers (Law and Kelton 2000). The research question hypothesis remains the same as that in the manufacturing system; however an additional performance measure Total Entity Wait Time is introduced at this stage. This performance measure will be used for the CV experiment, with a view to adjusting the variance value of the performance measure Total Average Call Time (Base). Results Summary In this section, a summary of results on the performance of each variance reduction technique on each output performance measure is presented. In addition, a more in-depth description of results from the application of individual variance reduction techniques is presented in (Adewunmi 2010). 1 Investigating the Effectiveness of Variance Reduction Techniques 17 • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.000) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Total Aver-age Call Time (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, CV technique achieved the largest reduction in variance for the simulation output performance measure, Total Average Call Time. • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.995) is greater than the significance level (0.05), therefore "do not reject the null hypothesis". The difference in variance between Total Resource Utilization (Base, CRN, AV, and CV) is "statistically insignificant". On the basis of the performance of the variance reduction techniques, there was no reduction in variance for the simulation output performance measure, Total Resource Utilisation. • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.002) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Total Re-course Cost (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, AV technique achieved the largest reduction in variance for the simulation output performance measure, Total Resource Cost. 1.3.3 Cross-Docking System 1.3.3.1 Description of Cross-Docking System / Simulation Model Many systems in areas such as manufacturing, warehousing and distribution can sometimes be too complex to model analytically; in particular, Just in Time (JIT) warehousing systems such as cross-docking can present such difficulty (Buzacott and Yao 1986). This is because cross-docking distribution systems operate processes which exhibit an inherent random behavior which can potentially affect its overall expected performance. A suitable technique for modeling and analyzing complex systems such as cross-docking systems is discrete event simulation (Magableh et al. 2005). Normally, such a facility would consist of a break up area where inbound freight is received and sorted as well as a build up area which handles the task of picking customer orders for onward dispatch via out bound dock doors. The usual activities of the cross-docking distribution centre begin with the receipt of customer orders, batched by outbound destinations, at specified periods during the day. As customer orders are being received, inbound freight arranged as pallet load is being delivered through inbound doors designated according to destination. Customer orders batched by destination can differ in volume and variety; also they are released into the order picking system at the discretion of an operator in order to even out the work load on the order picking system. Once pallet load is 18 A. Adewunmi and U. Aickellin ve i.e. during the break up process, individual items iin sorted by a floor operativ packs of six to twelve un nits can be placed in totes (A plastic container which is used for holding items on o the conveyor belt). Normally, totes will begin theeir journey on a conveyor beelt, for onward routing to the order picking area. Just before the order picking areea is a set of roof high shelves where stock for replenishhing the order picking areaa is kept. A conveyor belt runs through the order pickinng area and its route and speeed are fixed. Figure 1.5, below provides a representatioon of the cross-docking distriibution centre. Fig. 1.5 A Typical Cross-doccking Distribution Centre (Adewunmi 2010). Within the order pickiing area, there are two types of order picking methodds; automated dispensing maachines and manual order picking operatives. These order picking resources are ussually available in shifts, constrained by capacity annd scheduled into order pick king jobs. There is also the possibility that manual order picking operators possesss different skill levels and there is a potential for autoomated order picking machines to breakdown. In such a situation, it becomes im mportant for the achievemeent of a smooth cross-docking operation, to pay particular attention to the order pick king process within the cross-docking distribution system m. The order picking process essentially needs to be fulfilled with minimal interrupptions and with the least am mount of resource cost (Lin and Lu 1999). Below figurre 1.6 provides a representaation of the order picking function with a cross-dockinng distribution centre. 1 Investigating the Effectiv veness of Variance Reduction Techniques 119 Fig. 1.6 An Order Pick king Process within a Cross-docking Distribution Centtre (Adewunmi 2010) A description of the orrder picking simulation model, which will be the scope oof the cross-docking simulattion study is presented. The scope of this particular studdy is restricted to the order picking p function as a result of an initial investigation connducted at a physical cro oss-docking distribution centre. It was discovered thhat amongst the different acctivities performed in a distribution centre, the order picking function was judg ged as the most significant by management. The customeer order (entity) inter arrivall rate is modeled using an exponential probability distrribution, and the manual as a well as the automated order picking process are moddm eled using triangular prob bability distribution. Customer orders are released from the left hand side of the simulation s model. At the top of the model are two autoomated dispensing machinees and at the bottom of the simulation model are two seets of manual order picking operatives, o with different levels of proficiency in pickinng customer orders. Figure 1.7, 1 displays a simulation animation of the order pickinng process cross-docking distribution centre. 1.3.3.2 Variance Reducction Experiments This section of the chapteer is divided into two parts; the first describes the desiggn of the variance reduction n experiments and the second details the results of thhe application of individual variance v reduction techniques. 20 A. Adewunmi and U. Aickellin Fig. 1.7 Simulation animatio on of a Cross-docking order picking process (Adewunmi 2010). Experimental Design For the design of the cro oss-docking distribution system variance reduction expeeriments, the following perrformance measures were chosen: • Total Entity Time (Base): This variable records the total time an entity spendds m. in the simulation system • Total Resource Utilizaation (Base): The purpose of collecting data on resourcce utilization is to have statistics s on the level of usage of the resources during a specified period. • Total Resource Cost (Base): This is a cost based statistic that records thhe monetary amount expeended on the use of re-sources for a specific period. The experimental conditio ons are as follows: • • • • Number of Replication ns: 10 Warm up Period: 0 Replication Length: 30 0 Days Terminating Condition n: None The performance measurres have been classed according to variance reductioon technique, i.e. Total Reesource Utilization (Base), Total Resource Utilizatioon 1 Investigating the Effectiveness of Variance Reduction Techniques 21 (CRN), and Total Resource Utilization (AV). Under consideration is a two scenario, single cross-docking discrete event simulation model. The scenario which has performance measures labeled (Base) is characterized by random number seeds dedicated to sources of simulation model randomness as selected by the simulation software Arena TM. The other scenario which has performance measures labeled CRN has its identified sources of randomness, allocated dedicated random seeds by the user. So these two scenarios have unsynchronized and synchronized use of random numbers (Law and Kelton 2000). The research question hypothesis remains the same as that in the manufacturing system; however an additional performance measure Total Entity Wait Time is introduced at this stage. This performance measure will be used for the CV experiment, with a view to applying it to adjusting the performance measure Total Entity Time. For those interested, detailed results from the application of individual variance reduction techniques are presented in (Adewunmi 2010). Results Summary In this section, a summary of results on the performance of each variance reduction technique on each output performance measure is presented. In addition, a more in-depth description of results from the application of individual variance reduction techniques is presented in (Adewunmi 2010). • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.000) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Total Entity Time (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, CV technique achieved the largest reduction in variance for the simulation output performance measure, Total Entity Time. • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.000) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Total Re-source Cost (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, AV technique achieved the largest reduction in variance for the simulation output performance measure, Total Resource Cost. • At a 95% confidence interval (CI), homogeneity of variance was assessed by Bartlett's test. The P-value (0.003) is less than the significance level (0.05), therefore "reject the null hypothesis". The difference in variance between Total Resource Utilization (Base, CRN, AV, and CV) is "statistically significant". On the basis of the performance of the variance reduction techniques, AV technique achieved the largest reduction in variance for the simulation output performance measure, Total Resource Utilization. 22 A. Adewunmi and U. Aickelin 1.4 Discussion The purpose of this study is to investigate the application of variance reduction techniques (CRN, AV and CV) on scenarios from three different application domains. In addition, to finding out which class of systems the variance reduction techniques will prove to most likely succeed. It also seeks to provide general guidance to beginners on the universal applicability of variance reduction techniques. A review of results from the variance reduction experiments indicate that the amount of variance reduction by the techniques applied can vary substantially from one output performance measure to the other, as well as one simulation model to the other. Among the individual techniques, CV stands out as the best technique. This is followed by AV and CRN. CV was the only technique that achieved a reduction in variance for at least one performance measure of interest, in all three application domains. This can be attributable to the fact that the strength of this technique is its ability to generate a reduction in variance by inducing a correlation between random variates. In addition, control variates have the added advantage of being able to be used on more than one variate, resulting in a greater potential for variance reduction. However, implementing AV and CRN required less time, and was less complex than CV for all three domain application domains. This maybe because with CV, where there is a need to establish some theoretical relationship between the control variate and the variable of interest. The variance reduction experiments were designed with the manufacturing simulation model being characterized by an inter arrival rate and processing time which were modeled using probability distribution. The cross-docking simulation model was also characterized by the use of probability distribution to model the inter arrival rate and processing time of entities. Conversely, the call centre simulation model inter arrival rate and processing time were based on fixed schedules. The assumption is that by setting up these simulation models in this manner, there will be a variation in the level of model randomness i.e. the use of schedules does not generate as much model randomness as with the use of probability distribution. For example, results demonstrate that for the call centre simulation model, the performance measure "Total Resource Utilization" did not achieve a reduction in variance with the application of CRN, AV and CV, on this occasion. However, for this same model, the performance measures “Total Average Call Time” and “Total Resource Cost” did achieve a reduction in variance. This expected outcome demonstrates the relationship between the inherent simulation model’s randomness and the efficiency of CRN, AV and CV, which has to be considered when applying variance reduction techniques in simulation models. This study has shown that the Glasserman and Yao (Glasserman and Yao 1992) statement regarding the general applicability of CRN is true, for the scenarios and application domains under consideration. As a consequence, this makes CRN a more popular choice of technique in theory. However, results from this study demonstrate CRN to be useful but not the most effective technique for reducing variance. In addition CV under the experimental conditions reported within this study did outperform CRN. While it is not claimed that CV is more superior a technique as compared with CRN, in this instance, it has been demonstrated that 1 Investigating the Effectiveness of Variance Reduction Techniques 23 CV achieved more instances of variance reduction as compared with CRN and AV. In addition, under current experimental conditions, a new specific class of systems, in particular the Cross-docking distribution system has been identified, for which the application of CV and AV is beneficial for variance reduction. 1.5 Conclusion Usually during a simulation study, there are a variety of decisions to be made at the pre and post experimentation stages. Such decisions include input analysis, design of experiments and output analysis. Our interest is in output analysis with particular focus on the selection of variance reduction techniques as well as their applicability. The process of selection was investigated through the application of CRN, AV and CV in a variety of scenarios. In addition, this study seeks to establish which of the application domains considered, will the application of CRN, AV and CV be successful, where such success had not been previously reported. Amongst the individual variance reduction techniques (CRN, AV and CV), CV was found to be most effective for all the application domains considered within this study. Furthermore, AV and CV, individually, were effective in variance reduction for the cross-docking simulation model. Typically, a lot of consideration is given to number of replications, replication length, terminating condition, warm up period during the design of a typical simulation experiment. It would be logical to imagine that there will be a linear relationship between these factors and the performance of variance reduction techniques. However, the extent of this relationship is unknown unless a full simulation study is performed before the application of variance reduction techniques. The experimental conditions applied to this study were sufficient to demonstrate reduction. However, upcoming research will investigate the nature and effect of considering the application of variance reduction techniques during the design of experiments for full scale simulation study. In future, research investigation will be focused on exploring the idea of combining different variance reduction techniques, with the hope that their individual beneficial effort will add up to a greater magnitude of variance reduction for the estimator of interest. These combinations could have a positive effect when several alternative configurations are being considered. To obtain more variance reduction, one may want to combine variance reduction techniques simultaneously in the same simulation experiment and use more complicated discrete event simulation models. The potential gain which may accrue from the combination of these techniques is also worth investigating because it will increase the already existing knowledge base on such a subject. Authors Biography, Contact Dr Adrian Adewunmi was a Post Graduate Researcher in the Intelligent Modelling & Analysis (IMA) Research Group, School of Computer Science, University of Nottingham. A summary of his current interest is Modeling and Simulation, Artificial Intelligence and Data Analysis.´ 24 A. Adewunmi and U. Aickelin Professor Uwe Aickelin is an EPSRC Advanced Research Fellow and Professor of Computer Science at The University of Nottingham. He is also the Director of Research in the School of Computer Science and leads one of its four research groups: Intelligent Modeling & Analysis (IMA). A summary of his current research interests is Modeling and Simulation, Artificial Intelligence and Data Analysis. Contact [email protected] [email protected] Intelligent Modelling & Analysis Research Group (IMA) School of Computer Science The University of Nottingham Jubilee Campus Wollaton Road Nottingham NG8 1BB UK Bibliography Adewunmi, A.: Selection of Simulation Variance reduction techniques through a Fuzzy Expert System. PhD Thesis, University of Nottingham (2010) Adewunmi, A., Aickelin, U., Byrne, M.: An investigation of sequential sampling method for crossdocking simulation output variance reduction. In: Proceedings of the 2008 Operational Research Society 4th Simulation Workshop (SW 2008), Birmingham (2008) Andradottir, S., Heyman, D.P., Ott, T.J.: Variance reduction through smoothing and control variates for markov chain simulations. ACM Transactions on Modeling and Computer Simulation 3(3), 167–189 (1993) Andreasson, I.J.: Antithetic methods in queueing simulations. Technical Report, Royal Institute of Technology, Stockholm (1972) April, J., Glover, F., Kelly, J.P., Laguna, M.: Simulation-Based optimisation: practical introduction to simulation optimisation. In: WSC 2003: Proceedings of the 35th Conference on Winter Simulation, New Orleans, Louisiana (2003) Avramidis, A.N., Bauer Jr., K.W., Wilson, J.R.: Simulation of stochastic activity networks using path control variates. Journal of Naval Research 38, 183–201 (1991) Banks, J., Carson II, J.S., Nelson, B.L., Nicol, D.M.: Discrete Event System Simulation, 3rd edn. Prentice - Hall, New Jersey (2000) Bratley, P., Fox, B.L., Schrage, L.E.: A guide to simulation, 2nd edn. Springer, New York (1986) Burt, J.M., Gaver, D.P., Perlas, M.: Simple stochastic networks: Some problems and procedures. Naval Research Logistics Quarterly 17, 439–459 (1970) Buzacott, J.A., Yao, D.D.: Flexible manufacturing systems: A review of analytical models. Management Science 32(7), 890–905 (1986) Cheng, R.C.H.: The use of antithetic control variates in computer simulations. In: WSC 1981: Proceedings of the 13th Conference on Winter Simulation. IEEE, Atlanta (1981) 1 Investigating the Effectiveness of Variance Reduction Techniques 25 Cheng, R.C.H.: Variance reduction methods. In: WSC 1986: Proceedings of the 18th Conference on Winter simulation. ACM, Washington D.C. (1986) Cole, G.P., Johnson, A.W., Miller, J.O.: Feasibility study of variance reduction in the logistics composite model. In: WSC 2007: Proceedings of the 39th Conference on Winter Simulation. IEEE Press, Washington D.C. (2001) Doomun, R., Jungum, N.V.: Business process modelling, simulation and reengineering: call centres. Business Process Management Journal 14(6), 838–848 (2008) Eraslan, E., Dengiz, B.: The efficiency of variance reduction in manufacturing and service systems: The comparison of the control variates stratified sampling. Mathematical Problems in Engineering, 12 (2009) Fishman, G.S., Huang, B.D.: Antithetic variates revisited. Communications of the ACM 26(11), 964–971 (1983) Gal, S., Rubinstein, Y., Ziv, A.: On the optimality and efficiency of common random numbers. Mathematics and Computers in Simulation 26, 502–512 (1984) Glasserman, P., Yao, D.D.: Some guidelines and guarantees for common random numbers. Management Science 38(6), 884–908 (1992) Gordon, G.: System Simulation, 2nd edn. Prentice - Hill, New Jersey (1978) Hoad, K., Robinson, S., Davies, R.: Automating discrete event simulation output analysis automatic estimation of number of replications,warm-up period and run length. In: Lee, L.H., Kuhl, M.E., Fowler, J.W., Robinson, S. (eds.) INFORMS Simulation Society Research Workshop, INFORMS Simulation Society, Warwick, Coventry (2009) Kelton, D.W., Sadowski, R.P., Sturrock, D.T.: Simulation with Arena, 4th edn. McGrawHill, New York (2007) Kleijnen, J.P.C.: Statistical Techniques in Simulation, Part 1. Marcel Dekker, New York (1974) Kleijnen, J.P.C.: Antithetic variates, common random numbers and optimal computer time allocation in simulations. Management Science 21(10), 1176–1185 (1975) Kleijnen, J.P.C.: Statistical tools for simulation practitioners. Marcel Dekker, Inc., New York (1986) Kleijnen, J.P.C.: Experimental design for sensitivity analysis optimization, and validation of simulation models. In: Handbook of Simulation. Wiley, New York (1988) Kwon, C., Tew, J.D.: Strategies for combining antithetic variates and control variates in designed simulation experiments. Management Science 40, 1021–1034 (1994) Lavenberg, S.S., Welch, P.D.: Variance reduction techniques. In: WSC 1978: Proceedings of the 10th Conference on Winter Simulation. IEEE Press, Miami Beach (1978) Law, A.M.: Simulation Modeling and Analysis, 4th edn. McGraw-Hill, New York (2007) Law, A.M.: Statistical analysis of simulation output data: the practical state of the art. In: WSC 2007: Proceedings of the 39th Conference on Winter Simulation. IEEE Press, Washington, DC (2007) Law, A.M., Kelton, D.W.: Simulation Modeling and Analysis, 3rd edn. McGraw Hill, New York (2000) L’Ecuyer, P.: Effciency improvement and variance reduction. In: WSC 1994: Proceedings of the 26th Conference on Winter Simulation, Society for Computer Simulation International, Orlando, Florida (1994) L’Ecuyer, P., Buist, E.: Variance reduction in the simulation of call centers. In: WSC 2006: Proceedings of the 38th Conference on Winter Simulation, Winter Simulation Conference, Monterey, California (2006) Levene, H.: Robust Tests for Equality of Variances. In: Contributions to Probability and Statistics. Stanford University Press, Palo Alto (1960) 26 A. Adewunmi and U. Aickelin Lin, C., Lu, I.: The procedure of determining the order picking strategies in distribution center. The International Journal of Production Economics 60-61(1), 301–307 (1999) Magableh, G.M., Ghazi, M., Rossetti, M.D., Mason, S.: Modelling and analysis of a generic cross-docking facility. In: WSC 2005: Proceedings of the 37th Conference on Winter Simulation, Winter Simulation Conference, Orlando, Florida (2005) Mitchell, B.: Variance reduction by antithetic variates in gi/g/1 queuing simulations. Operations Research 21, 988–997 (1973) Nelson, B.L.: A perspective on variance reduction in dynamic simulation experiments. Communications in Statistics- Simulation and Computation 16(2), 385–426 (1987) Nelson, B.L.: Control variates remedies. Operations Research 38, 974–992 (1990) Nelson, B.L., Schmeiser, B.W.: Decomposition of some well-known variance reduction techniques. Journal of Statistical Computation and Simulation 23(3), 183–209 (1986) Nelson, B.L., Staum, J.: Control variates for screening, selection, and estimation of the best. ACM Transactions on Modeling and Computer Simulation 16(1), 52–75 (2006) Robinson, S.: Successful Simulation: a Practical Approach to Simulation Projects. McGraw-Hill, Maidenhead (1994) Sadowski, R.P., Pegden, C.D., Shannon, R.E.: Introduction to Simulation Using SIMAN, 2nd edn. McGraw-Hill, New York (1995) Schruben, L.W., Margolin, B.H.: Pseudorandom number assignment in statistically designed simulation and distribution sampling experiments. Journal of the American Statistical Association 73(363), 504–520 (1978) Shannon, R.E.: Systems Simulation. Prentice - Hill, New Jersey (1975) Snedecor, G.W., Cochran, W.G.: Statistical Methods, 8th edn. University Press, Iowa (1989) Tew, J.D., Wilson, J.R.: Estimating simulation metamodels using combined correlation based variance reduction techniques. IIE Transactions 26, 2–26 (1994) Wilson, J.R.: Variance reduction techniques for digital simualtion. American Journal on Mathematics in Science 4(3-4), 277–312 (1984) Yang, W., Liou, W.: Combining antithetic variates and control variates in simulation experiments. ACM Transactions on Modeling and Computer Simulation 6(4), 243–260 (1996) Yang, W., Nelson, B.L.: Using common random numbers and control variates in multiplecomparison procedures. Operations Research 39(4), 583–591 (1991)
5cs.CE
arXiv:1304.7274v1 [math.AC] 26 Apr 2013 Explicit Hilbert-Kunz functions of 2 × 2 determinantal rings Marcus Robinson and Irena Swanson Abstract Let k[X] = k[xi,j ∶ i = 1, . . . , m; j = 1, . . . , n] be the polynomial ring in mn variables xi,j over a field k of arbitrary characteristic. Denote by I2 (X) the ideal generated by the 2 × 2 minors of the generic m × n matrix [xi,j ]. We give a closed formulation for the dimensions of the k-vector space k[X]/(I2 (X) + (xq1,1 , . . . , xqm,n )) as q varies over all positive integers, i.e., we give a closed form for the generalized Hilbert-Kunz function of the determinantal ring k[X]/I2 [X]. We also give a closed formulation of dimensions of related quotients of k[X]/I2 [X]. In the process we establish a formula for the numbers of some compositions (ordered partitions of integers), and we give a proof of a new binomial identity. 1 Introduction Throughout let m, n, q be non-negative integers and k, k[X], and I2 (X) as in the abstract. The generalized Hilbert-Kunz function of R = k[X]/I2 [X] is the function HKR,X ∶ N → N given by HKR,X (q) = length ( ) xq1,1 , . . . , xqm,n ) R = length ( k[X] ). I2 (X) + (xq1,1 , . . . , xqm,n ) The standard Hilbert-Kunz function is only defined when k has positive prime characteristic p and when q varies over powers of p, whereas the generalized Hilbert-Kunz function is defined for arbitrary field k, regardless of the characteristic. While the Hilbert-Kunz function is not necessarily a polynomial function, it has a well-defined normalized leading coefficient. The normalized leading coefficient of the generalized Hilbert-Kunz function has been studied by several authors, including Conca [1], Eto [2], Eto and Yoshida [3], while Miller and Swanson [4] studied the whole generalized Hilbert-Kunz function. Miller and Swanson gave a recursive formulation for HKR,X and proved that it is a polynomial function. They gave closed formulations in the case m ≤ 2. This paper is an extension of [4]. The main result of this paper, Theorem 3.3, is the closed formulation of HKR,X for arbitrary positive integers m, n. We also give, in Theorem 3.1, an explicit length of I2 (X) + (xqi,j k[X] . ∶ i, j) + ∑nj=1 (x1,j , . . . , xm,j )q 1 In Lemma 2.5 and Corollary 3.4 we give some explicit formulas for the number of tuples of specific length of non-negative integers that sum up to at most a fixed number and whose first few entries are at most another fixed number. (In other words, we give formulas for the numbers of some specific compositions of integers.) 2 Set-Up Our proofs are based on the following result from [4]: Theorem 2.1. [4, Theorem 2.4] A k-vector space basis for k[X]/(I2 + (xq1,1 , . . . , xqm,n )) conp sists of monomials ∏i,j xi,ji,j with the following properties: 1. Whenever pi,j > 0 and i′ < i, j < j ′ , then pi′ ,j ′ = 0. (Monomials satisfying this property will be called staircase monomials. The name comes from the southwest-northeast staircase-like shape of the non-zero pi,j in the m × n matrix of all pi,j .) 2. Either for all i = 1, . . . , m, ∑j pi,j < q, or for all j = 1, . . . , n, ∑i pi,j < q. Thus to compute the Hilbert-Kunz function, we need to be able to count such monomials. The recursive formulations for this function in [4], as well as the explicit formulations below, require counting related sets of monomials: Definition 2.2. [4, Section 3] Let r1 , . . . , rm , c1 , . . . , cn ∈ N ∪ {∞}. (In general we think of the ri as the row sums and the cj as the column sums.) Define Nq (m, n; r1 , . . . , rm ; c1 , . . . , cn ) p to be the number of monomials ∏i,j xi,ji,j with the following properties: p 1. ∏i,j xi,ji,j is a staircase monomial, i.e., whenever pi,j > 0 and i′ < i, j < j ′ , then pi′ ,j ′ = 0. 2. For all i ∈ {1, . . . , m}, ∑j pi,j ≤ ri , and for all j ∈ {1, . . . , n}, ∑i pi,j ≤ cj . 3. Either for all i ∈ {1, . . . , m}, ∑j pi,j < q, or for all j ∈ {1, . . . , n}, ∑i pi,j < q. For ease of notation let c denote {c, c, . . . , c}. For example, Nq (m, n; ∞, . . . , ∞; ∞, . . . , ∞) = Nq (m, n; ∞, ∞). By convention, Nq (0, n; ; c1 , . . . , cn ) = 1. It was proved in [4, Section 3] that Nq (m, n; r1 , . . . , rm ; c1 , . . . , cn ) equals length ( I2 (X) + (xqi,j ∶ k[X] ri +1 i, j) + ∑m i=1 (xi,1 , . . . , xi,n ) + ∑nj=1 (x1,j , . . . , xm,j )cj +1 ), where for an ideal I, we set I ∞ to be the 0 ideal. Thus in particular Nq (m, n; ∞; ∞) = HKK[X]/I2 (X),X (q). Our main result relies on the count of the following monomials as well: 2 Definition 2.3. Let r1 , . . . , rm , c1 , . . . , cn ∈ N ∪ {∞}. Define Mq (m, n; r1 , . . . , rm ; c1 , . . . , cn ) p to be the number of monomials ∏i,j xi,ji,j such that p 1. ∏i,j xi,ji,j is a staircase monomial, i.e., whenever pi,j > 0 and i′ < i, j < j ′ , then pi′ ,j ′ = 0. 2. For all i ∈ {1, . . . , m}, ∑j pi,j ≤ min{ri , q − 1}. 3. There exists j ∈ {1, . . . , n} such that ∑i pi,j > cj . The following lemma says that mn exponents pi,j of a staircase monomial can be identified by m + n or even m + n − 1 numbers: Lemma 2.4. Suppose that r1 , . . . , rm , c1 , . . . , cn are non-negative integers and that ∑i ri = pi,j ∑j cj . Then there exists a unique staircase monomial ∏i,j xi,j such that for all i = 1, . . . , m, ri = ∑j pi,j and that for all j = 1, . . . , n, cj = ∑i pi,j . Proof. If m = 1, the clearly p1,j = cj , which is uniquely determined. If n = 1, necessarily pi,1 = ri . In general, for arbitrary m and n, knowing c1 and rm is enough information to uniquely determine pm,1 : If pm,1 < min{c1 , rm }, then the mth row has a non-zero number beyond the first entry and the first column has a non-zero number in the first m − 1 rows, which then makes the corresponding monomial non-staircase and is not allowed. So necessarily pm,1 = min{c1 , rm }. If pm,1 = c1 , then no more non-zero exponents appear in the first column, and it remains to fill in the remaining m × (n − 1) matrix of pi,j with the remaining numbers r1 , . . . , rm−1 , rm − c1 , c2 , . . . , cn . If instead pm,1 = rm , then no more non-zero exponents appear in the last row, and it remains to fill in the remaining (m − 1) × n matrix of pi,j with the remaining numbers r1 , . . . , rm−1 , c1 − rm , c2 , . . . , cn . Lemma 2.5. Let a, b, w, z be integers with a ≤ b. The number of b-tuples of non-negative integers that sum up to at most w and for which the first a entries are strictly smaller than z equals a a w − iz + b ). ∑(−1)i ( )( b i i=0 Proof. Set Uw,l = {(v1 , . . . , vb ) ∈ Nb ∶ ∑bi=1 vi ≤ w, and l ≤ ∣{i ≤ a ∶ vi ≥ z}∣}. The desired number is ∣Uw,0 ∖ Uw,1 ∣. Certainly ∣Uw,0∣ = (w+b b ), which is the number of ways of positioning up to w stones into b boxes (possibly more than one stone per box). Let (v1′ , . . . , vb′ ) ∈ Uw−lz,0 and let L be an l-element subset of {1, . . . , a}. We construct (v1 , . . . , vb ) ∈ Nb such that vi = vi′ +z if i ∈ L and otherwise vi = vi′ . Note that (v1 , . . . , vb ) ∈ Uw,l . Every element (v1 , . . . , vb ) of Uw,l is obtained in this way, but note that for k ≥ l, each element (v1 , . . . , vb ) of Uw,k ∖ Uw,k+1 is obtained in this way in exactly (kl) ways. This proves that a k a a w − lz + b ). ∑ ( )∣Uw,k ∖ Uw,k+1∣ = ( )∣Uw−lz,0∣ = ( )( l l b k=l l 3 This gives a system of ⎡(0) ⎢ 0 ⎢ 0 ⎢(1) ⎢ 0 ⎢( ) ⎢ 2 ⎢ ⎢ ⋮ ⎢ 0 ⎢( ) ⎣ a a + 1 linear equations whose matrix form is )⎤⎥ (10) (20) ⋯ (a0)⎤⎥ ⎡⎢ ∣Uw,0 ∖ Uw,1 ∣ ⎤⎥ ⎡⎢(a0)(w−0z+b b ⎥ ⎢ ⎥ ⎥⎢ )⎥⎥ (11) (21) ⋯ (a1)⎥⎥ ⎢⎢ ∣Uw,1 ∖ Uw,2 ∣ ⎥⎥ ⎢⎢(a1)(w−1z+b b (12) (22) ⋯ (a2)⎥⎥ ⎢⎢ ∣Uw,2 ∖ Uw,3 ∣ ⎥⎥ = ⎢⎢(a2)(w−2z+b )⎥⎥ . b ⎥ ⎢ ⎥ ⎥⎢ ⋮ ⋮ ⋮ ⋱ ⋮ ⎥⎢ ⎥ ⎢ ⎥ ⋮ ⎥ ⎢ ⎥ ⎢ ⎥ ⎥ (a1) (a2) ⋯ (aa)⎥⎦ ⎢⎣∣Uw,a ∖ Uw,a+1 ∣⎥⎦ ⎢⎣(aa)(w−az+b ) ⎦ b The (a + 1) × (a + 1) matrix above is upper triangular with entries 1 on the diagonal. It is i+j (j−1)] . Thus by Cramer’s )] easy to see that the inverse of this matrix [(j−1 i−1 i,j is [(−1) i−1 i,j rule, ∣Uw,0 ∖ Uw,1 ∣ = ∑ (−1) a+1 i−1 i=1 3 a a w − (i − 1)z + b a w − iz + b ( )( ) = ∑(−1)i ( )( ). i−1 b i b i=0 Main theorems In this section we give explicit formulas for Nq (m, n; ∞; q − 1), Mq (m, n; q − 1; q − 1), and Nq (m, n; ∞; ∞) for arbitrary positive integers m, n. Theorem 3.1. For all m, n, the length of I2 (X) + (xqi,j k[X] equals ∶ i, j) + ∑nj=1 (x1,j , . . . , xm,j )q n n iq + m − 1 ), Nq (m, n; ∞; q − 1) = ∑(−1)n−i ( )( i m+n−1 i=1 and furthermore, this number equals the number of (m+n−1)-tuples of non-negative integers that sum up to at most n(q − 1) and for which the first n entries are strictly smaller than q. p Proof. Let Tm,n,q be the set of all staircase monomials ∏i,j xi,ji,j such that for all j = 1, . . . , n, ∑i pi,j < q. By [4, Section 3], ∣Tm,n,q ∣ = Nq (m, n; ∞; q − 1) = length ( I2 (X) + (xqi,j k[X] ). ∶ i, j) + ∑nj=1(x1,j , . . . , xm,j )q Let W be the set of (m + n − 1)-tuples of non-negative integers that sum up to at most n(q − 1) and for which the first n entries are strictly smaller than q. Define f ∶ Tm,n,q → W by p f (∏ xi,ji,j ) = (c̃1 , . . . c̃n , r2 , r3 , . . . , rm ), i,j where c̃j = (q − 1) − ∑i pi,j , and ri = ∑j pi,j . First of all, by assumption all c̃j are strictly smaller than q, and n m i=1 j=2 ∑ c̃i + ∑ rj = n(q − 1) − ∑ pi,j + ∑ pi,j i,j = n(q − 1) − ∑ p1,j j ≤ n(q − 1). 4 i≠1,j Thus the image of f is in W . An (n + m − 1)-tuple (c̃1 , . . . c̃n , r2 , r3 , . . . , rm ) ∈ W uniquely identifies non-negative integers c1 , . . . , cn , r2 , . . . , rm . Furthermore, r1 = ∑ cj − ∑ ri = ∑(q − 1 − c̃j ) − ∑ ri = n(q − 1) − (∑ c̃j + − ∑ ri ) ≥ 0, n m n m n m j=1 i=2 j=1 i=2 j=1 i=2 so that (c̃1 , . . . c̃n , r2 , r3 , . . . , rm ) uniquely identifies non-negative integers c1 , . . . , cn , r1 , . . . , rm , p whence by Lemma 2.4 it uniquely identifies the staicase monomial ∏i,j xi,ji,j . Thus f is injective and surjective, so that by Lemma 2.5, Nq (m, n; ∞; q − 1) = ∣W ∣ n−1 n n(q − 1) − iq + m + n − 1 = ∑ (−1)i ( )( ) i m+n−1 i=0 n−1 (n − i)q + m − 1 n ) )( = ∑ (−1)i ( m+n−1 n−i i=0 n n iq + m − 1 = ∑(−1)n−i ( )( ). i m+n−1 i=1 Theorem 3.2. For all positive integers m, n, n m n m jq − iq + n − 1 ). Mq (m, n; q − 1; q − 1) = ∑ ∑(−1)m−j+i−1 ( )( )( i j m+n−1 i=1 j=0 p Proof. Let Sn,m,q be the set of all staircase monomials ∏i,j xi,ji,j such that either for all i = 1, . . . , m, ∑j pi,j < q or for all j ∈ {1, . . . , n}, ∑i pi,j < q. By Definition 2.2, Nq (m, n; ∞; ∞) = ∣Sn,m,q ∣. p Set Sm,n,q,k ∶= { ∏i,j xi,ji,j ∈ Sm,n,q ∶ k ≤ ∣{j ∶ ∑i pi,j ≥ q}∣}. Then Mq (m, n; q − 1; q − 1) = ∣Sm,n,q,1∣. p For any ∏i,j xi,ji,j ∈ Sm,n,q let cj be the jth column sum ∑i pi,j and ri the ith row sum ∑j pi,j . Let Pl (n) be the set of all l-element subsets of {1, . . . , n}. Let W be the number of (m + n − 1)-tuples of non-negative integers that sum up to at most m(q − 1) − lq and for which the first m entries are strictly smaller than q. p In the following we assume that k > 0. If ∏i,j xi,ji,j ∈ Sm,n,q,k ∖ Sm,n,q,k+1, then by the definition of Sm,n,q , ri ≤ q − 1 for all i. Let K ∈ Pk (n) such that cj ≥ q if and only if j ∈ K. p For any l-element subset L of K, we associate (L, ∏i,j xi,ji,j ) with (L, q − 1 − r1 , . . . , q − 1 − rm , c′1 , . . . , ĉ′s , . . . , c′n ), where s is the smallest element in L, and c′j = cj − q if j ∈ L and c′j = cj otherwise. Recall Lemma 2.5: this associated element is in Pl (n) × W because all ri are at most q − 1 and ∑(q − 1 − ri ) + ∑ c′j = m(q − 1) − ∑ ri + ∑ cj − (l − 1)q m i=1 m j= /s i=1 j= /s = m(q − 1) − cs − (l − 1)q ≤ m(q − 1) − q − (l − 1)q = m(q − 1) − lq. 5 Conversely, we can reverse this. Namely, let (L, v) ∈ Pl (n) × W . By definition the first m entries in v are non-negative integers that are at most q − 1, and we can write them in the form q − 1 − ri for some ri ∈ {0, . . . , q − 1}. We write the last n − 1 entries of v as (c′1 , . . . , c′s−1 , c′s+1 , . . . , c′n ), where s is the smallest number in L. For j ∈ {1, . . . , n} ∖ L, let cj = c′j , for j ∈ L ∖ {s}, set cj = c′j + q, and finally set cs = (∑i ri ) − (∑j =/ s cj ). Note that ∑ ri = m(q−1)− ∑(q−1−ri ) = m(q−1)−lq− ∑(q−1−ri )− ∑ c′j +lq+ ∑ c′j ≥ lq+ ∑ c′j = q+ ∑ cj . i i i j= /s j= /s j= /s j= /s Thus cs ≥ q and so ci ≥ q for all i ∈ L. Furthermore, by Lemma 2.4, these non-negative p numbers r1 , . . . , rm , c1 , . . . , cn uniquely determine a staircase monomial ∏i,j xi,ji,j uniquely. p Thus in any case, (L, v) yields (L, ∏i,j xi,ji,j ) uniquely. p We have proved the following: for every staircase monomial ∏i,j xi,ji,j ∈ Sm,n,q,l there exists p a unique k such that ∏i,j xi,ji,j ∈ Sm,n,q,k ∖ Sm,n,q,k+1. There exist (kl) sets L ∈ Pl (n) such that p cj ≥ q for all j ∈ L. To (L, ∏i,j xi,ji,j ) we uniquely associate an element of Pl (n) × W . Thus by Lemma 2.5, for all l ≥ 1, n k ∑ ( )∣Sm,n,q,k ∖ Sm,n,q,k+1∣ = ∣Pl (n) × W ∣ k=l l = ∣Pl (n)∣ ⋅ ∣W ∣ m m(q − 1) − lq − jq + m + n − 1 n m ) = ( ) ∑(−1)m ( )( m+n−1 j l j=0 n m m (m − j)q − lq + n − 1 = ( ) ∑(−1)m ( )( ) l j=0 j m+n−1 n m m jq − lq + n − 1 = ( ) ∑(−1)m−j ( )( ). l j=0 j m+n−1 This is a system of n linear equations with matrix form: ⎡ (1) ⎢ 1 ⎢ 1 ⎢ (2) ⎢ 1 ⎢( ) ⎢ 3 ⎢ ⎢ ⋮ ⎢ 1 ⎢( ) ⎣ n (21) (22) (23) ⋮ 2 (n) (31) (32) (33) ⋮ 3 (n) ⋯ ⋯ ⋯ ⋱ ⋯ m jq−1q+n−1 ⎤ ⎡ n m (n1 )⎤⎥ ⎡⎢ ∣Sm,n,q,1 ∖ Sm,n,q,2∣ ⎤⎥ ⎢⎢ ( 1 ) ∑j=0(−1)m−j ( j )( m+n−1 ) ⎥⎥ ⎥⎢ ⎥ n m−j (m)(jq−2q+n−1) ⎥ (n2 )⎥⎥ ⎢⎢ ∣Sm,n,q,2 ∖ Sm,n,q,3∣ ⎥⎥ ⎢⎢ ( 2 ) ∑m j=0 (−1) ⎥ j m+n−1 ⎢ n m n ⎥⎢ m jq−3q+n−1 ⎥ m−j ⎥ ( 3 )⎥ ⎢ ∣Sm,n,q,3 ∖ Sm,n,q,4∣ ⎥ = ⎢⎢ ( 3 ) ∑j=0(−1) ( j )( m+n−1 ) ⎥⎥ . ⎥⎢ ⎥ ⎢ ⎥ ⋮ ⎥⎢ ⋮ ⎥ ⎢ ⋮ ⎥ ⎥ ⎢ ⎥ ⎢ n m n ⎥⎢ m jq−nq+n−1 ⎥ m−j ⎥ (n)⎦ ⎣∣Sm,n,q,n ∖ Sm,n,q,n+1∣⎦ ⎢(n) ∑j=0 (−1) ( j )( m+n−1 )⎥ ⎦ ⎣ 6 But the inverse of this matrix [(ji )]i,j is [(−1)i+j (ji )]i,j , so that by Cramer’s rule, Mq (m, n; q − 1; q − 1) = ∣Sm,n,q,1∣ = ∑ ∣Sm,n,q,k ∖ Sm,n,q,k+1∣ n k=1 n n i n m m jq − iq + n − 1 = ∑ ∑(−1)k+i ( )( ) ∑(−1)m−j ( )( ) k i j=0 j m+n−1 k=1 i=1 n n i n m m jq − iq + n − 1 ) = ∑(−1)i ∑ (−1)k ( )( ) ∑(−1)m−j ( )( k i j=0 j m+n−1 i=1 k=1 n n m m jq − iq + n − 1 = ∑(−1)i−1 ( ) ∑(−1)m−j ( )( ) i j=0 j m+n−1 i=1 n m n m jq − iq + n − 1 ) = ∑ ∑(−1)m−j+i−1 ( )( )( i j m+n−1 i=1 j=0 n m n m jq − iq + n − 1 ). = ∑ ∑(−1)m−j+i−1 ( )( )( i j m+n−1 i=1 j=1 The main theorem on the generalized Hilbert-Kunz function now follows: Theorem 3.3. For all positive m, n, HKR,X (q) = length ( k[X] ) equals I2 (X) + (xq1,1 , . . . , xqm,n ) Nq (m, n; ∞; ∞) = Nq (m, n; ∞; q − 1) + Mq (m, n; q − 1; q − 1) n n m n iq + m − 1 n m jq − iq + n − 1 = ∑(−1)n−i ( )( ) + ∑ ∑(−1)m−j+i−1 ( )( )( ). i m+n−1 i j m+n−1 i=1 i=1 j=1 Proof. By Definition 2.2, Nq (m, n; ∞; ∞) counts all the staircase monomials ∏i,j xi,ji,j with the property that either for all j, ∑i pi,j < q, or for all i, ∑j pi,j < q. The number Nq (m, n; ∞; q − 1) counts those monomials in the previous paragraph for which for all j, ∑i pi,j < q, and Mq (m, n; q − 1; q − 1) counts those monomials for which for some j, ∑i pi,j ≥ q. Thus Nq (m, n; ∞; ∞) = Nq (m, n; ∞; q − 1) + Mq (m, n; q − 1; q − 1), and by Theorems 3.1 and 3.2 this equals to the claimed sums of binomial coefficients. p In particular, comparison with Theorem 4.4 in [4] when m = 2 gives: Corollary 3.4. The number of (n+1)-tuples of non-negative integers that sum up to at most n(q − 1) and for which the first n entries are strictly smaller than q equals n n iq + 1 nq n+1 − (n − 2)q n . )= ∑(−1)n−i ( )( 2 i n+1 i=1 7 Proof. According to [4, Theorem 4.4], Nq (2, n; ∞; ∞) = orem 3.3, nq n+1 −(n−2)q n 2 ), and by The+ n(q+n−1 n+1 n n iq + 1 Nq (2, n; ∞; ∞) = ∑(−1)n−i ( )( ) i n+1 i=1 n n n q − iq + n − 1 n 2q − iq + n − 1 + 2 ∑(−1)i ( )( ) + ∑(−1)i−1 ( )( ) i n+1 i n+1 i=1 i=1 n n 2q − 1q + n − 1 n iq + 1 ) ) + ( )( = ∑(−1)n−i ( )( n+1 1 i n+1 i=1 n q+n−1 n iq + 1 ). ) + n( = ∑(−1)n−i ( )( n+1 i n+1 i=1 nq −(n−2)q Thus ∑ni=1 (−1)n−i (ni)(iq+1 . By Theorem 3.1, this number is the number of n+1 ) = 2 (n + 1)-tuples of non-negative integers that sum up to at most n(q − 1) and for which the first n entries are strictly smaller than q. n+1 n We remark here that we know of no other proof of the equality in the last corollary. Natural first attempts would be induction and Gosper’s algorithm, and neither of these is successful, as for one thing, the summands depend not only on the summing index i but also on n. The challenge remains to establish a closed-form expression for Nq (m, n; ∞; ∞) and Nq (m, n; ∞; q − 1) for higher m. References [1] A. Conca, Hilbert-Kunz functions of monomial ideals and binomial hypersurfaces, Man. Math., 90, (1996), 287–300. [2] K. Eto, Multiplicity and Hilbert-Kunz Multiplicity of Monoid Rings, Tokyo J. Math., 25, 2, (2002), 241–245. [3] K. Eto and K-i. Yoshida, Notes on Hilbert-Kunz multiplicity of Rees algebras, Comm. Algebra, 31, (2003), 5943–5976. [4] L. E. Miller and I. Swanson, Hilbert-Kunz functions of 2 x 2 determinantal rings, preprint 2012, accepted to Illinois J. of Math. 8
0math.AC
1 A Multivariate Hawkes Process with Gaps in Observations arXiv:1608.01282v3 [stat.ML] 30 Jul 2017 Triet M. Le Abstract—Given a collection of entities (or nodes) in a network and our intermittent observations of activities from each entity, an important problem is to learn the hidden edges depicting directional relationships among these entities. Here, we study causal relationships (excitations) that are realized by a multivariate Hawkes process. The multivariate Hawkes process (MHP) and its variations (spatio-temporal point processes) have been used to study contagion in earthquakes, crimes, neural spiking activities, the stock and foreign exchange markets, etc. In this paper, we consider the multivariate Hawkes process with gaps in observations (MHPG). We propose a variational problem for detecting sparsely hidden relationships with a multivariate Hawkes process that takes into account the gaps from each entity. We bypass the problem of dealing with a large amount of missing events by introducing a small number of unknown boundary conditions. In the case where our observations are sparse (e.g. from 10% to 30%), we show through numerical simulations that robust recovery with MHPG is still possible even if the lengths of the observed intervals are small but they are chosen accordingly. The numerical results also show that the knowledge of gaps and imposing the right boundary conditions are very crucial in discovering the underlying patterns and hidden relationships. In technical terms, let N be the number of entities (or nodes) within a network. For each entity m ranging from 1 to N , let Em = {tm,i } be the set of events that entity m generates in some interval of interest, say (0, T ]. Here each tm,i in (0, T ] (assuming tm,i−1 < tm,i ) represents a time-stamp when an event from entity m occurs. We recall the following definitions of point processes. Definition 1 (Poisson Process [21]). For each entity m, denote the finite collection of disjoint intervals in (0, T ] by m {(cm,k , dm,k ]}K k=1 . Let N (cm,k , dm,k ] be the number of observed events from entity m that are contained in (cm,k , dm,k ]. We say the collection of observed events in Em follows a homogeneous Poisson process with some constant intensity λm ≥ 0 if N (cm,k , dm,k ] follows a Poisson distribution with mean λm (dm,k − cm,k ). In other words, the following probability holds P (N (cm,k , dm,k ] = n) = Index Terms—Hawkes process, self-exciting point process, causal network, intermittent observations. I. I NTRODUCTION Point processes have demonstrated to be promising tools for extracting dynamic patterns and discovering hidden relationships in event data. Variations of (spatio-temporal, univariate, multivariate) point processes have been applied to event data from many different fields in science. For instance, selfexciting point processes have been used in seismology to model contagion of earthquakes [1], [2], [3], [4], and in anthropology to study the spread of crimes and violence acts [5], [6], [7], [8]. The multivariate Hawkes process (a parametric version of the self-exciting point process) has been applied to financial data to study contagion and influential entities in financial networks [9], [10], [11], [12], [13], and also in social media networks [14], [15], [16], [17], [18]. The multivariate Hawkes process with inhibition has also been used in neuroscience to make inference of functional connectivity from neural spiking activities [19], [20], among others. The common assumption in these work is that all events over a long-enough time interval of interest are observed. However, for reasons associated to the environment, etc., events are only observed intermittently. Thus the challenges are: 1) how to recover robustly the underlying parameters in the presence of gaps; 2) how to distribute the gaps for optimal recovery given the available resources. NGA Research, National Geospatial-Intelligence Agency, 7500 GEOINT Dr., Springfield, VA 22150, Email: [email protected]. [λm (dm,k − cm,k )]n e−λm (dm,k −cm,k ) . n! (1) Suppose now instead of a constant λm , we have a positive (integrable) function λm : (0, T ] → R+ . Then we say the set of events Em follows an inhomogeneous Poisson process with intensity function λm (t) if P (N (cm,k , dm,k ] = n) = where Z [Λm,k ]n e−Λm,k , n! (2) dm,k Λm,k = λm (t) dt. cm,k The interpretations of (1) (or (2)) are as follows: 1) The number of events in (cm,k , dm,k ] follows a Poisson distribution with mean and variance λm (dm,k − cm,k ) R dm,k (or cm,k λm (t) dt). 2) The number of events in disjoint intervals or from different entities are independent random variables. In other words, an occurrence of an event from entity m has no influence on future events from itself or from any other entities. The multivariate Hawkes process introduces directional dependencies among entities and events into the definition of the (conditional) intensity function λm (t). The word ‘conditional’ is used because λm (t) is conditioned on prior events. Definition 2 (Multivariate Hawkes Process [22]). We say the collection of observed events in Em , m = 1, · · · , N, follows a multivariate Hawkes process if for all t in (0, T ], 2 the conditional intensity function (CIF) λm (t) for entity m is given by λm (t) = um + N X am,n n=1 X bm e−bm (t−tn,j ) . (3) tn,j ∈En tn,j <t Here, the background um ≥ 0 is a homogeneous Poisson process, and it is included here to promote independent R∞ random events. Since 0 bm e−bm t dt = 1 for bm > 0, the matrix a = (am,n )N ×N with the entry am,n ≥ 0 depicts how an event tn,j from entity n will trigger or excite future events from entity m. A multivariate Hawkes process is stationary if and only if the largest eigenvalue of the matrix a in absolute value is strictly bounded above by 1 [21]. 1/bm (the width of the exponential function) is the timescale providing the likelihood when the next event from entity m occurs. To incorporate inhibition into the multivariate Hawkes process, one allows am,n to be negative and the conditional intensity λm (t) ≥ 0 can be defined as [20]   (a) (b) Fig. 1. Simulations of two univariate point processes in the interval (0, T ], T = 10: (a): Homogeneous Poisson process with constant intensity λ = 1, (b): A univariate Hawkes process depicting the dynamic of λ(t) given in (4) as events (blue spikes) evolve. Here u = 1, a = 0.5 and b = 2. N X X   λm (t) = G  u + am,n bm e−bm (t−tn,j )  m  , n=1 tn,j ∈En tn,j <t where for example G(x) = max(0, x) or G(x) = ex . In this paper we focus on the case where am,n is non-negative. It is possible to consider an inhomogeneous Poisson process for the background, and to have a different timescale or mode of excitation for each pair of entities. For simplicity, we focus on the single mode of excitation case given by (3). Also, each event tm,i may have a different mark or jump size Mm,i ∈ [0, 1]. In other words, λm (t) can be defined as λm (t) = um + N X n=1 am,n X Fig. 2. A simulation of a multivariate Hawkes process (N = 2): In this Figure, entity 2 is very influential toward entity 1 (since a1,2 = 0.75) and entity 1 has no influence on entity 2 (since a2,1 = 0). Both entities have the same amount of self-excitation (a1,1 = a2,2 = 0.25). Mn,j bm e−bm (t−tn,j ) . tn,j ∈En tn,j <t Here we consider all events to be the same, namely Mm,i = 1. Figure 1 shows simulations of two univariate point processes (N = 1) in the interval (0, T ], with T = 10. Figure 1(a) shows a homogeneous Poisson process with constant λ = 1, and Figure 1(b) shows a (univariate) Hawkes process with u = 1, a = 0.5 and b = 2. Recall the CIF of a univariate Hawkes process (Equation (3) with N = 1) is defined as X λ(t) = u + a be−b(t−ti ) . (4) 0<ti <t Note the dynamics of λ(t) in Figure 1(b) as events (in blue spikes) evolve. Based on the definition of a homogeneous Poisson process, we expect that events are uniformly distributed (as evident in Figure 1(a)). The same phenomenon doesn’t hold for a Hawkes process whenever ab > 0. This is evident in Figure 1(b) as events are more clustered as a result of selfexcitation and hence there are more burstiness in the intensity function. Figure 2 shows a simulation Hawkes  of a multivariate   0.1 0.25 0.75 process (N = 2) with u = ,a = ,b = 0.1 0 0.25   10 . a1,2 = 0.75 implies that events from entity 2 is very 1 contagious toward entity 1. On the other hand, events from entity 1 has no influence on entity 2 since a2,1 = 0. These effects can be seen in the evolution of the CIFs (in blue). An event from entity 2 creates a jump in the CIF of entity 1 which causes a series of events to follow, but not vice versa. In this paper, we consider the case where one has intermittent observations (and hence gaps). Figure 3 shows an example of intermittent observations for a network of two entities. The shaded intervals represent the observational gaps. We observe events in blue and do not observe events in red from each entity. For this simulation, we use the same parameters as in Figure 2. m For each entity m, let {(cm,k , dm,k ]}K k=1 be the collection of disjoint observed intervals (e.g. unshaded intervals in Figure 3) that are contained in (0, T ], and let Om = {tm,i } be the corresponding partially observed events (e.g. events in blue from Figure 3). For each t that belongs to one of the observed intervals (cm,k , dm,k ] we replace the original CIF for entity m in (3) with 3 II. M ULTIVARIATE H AWKES P ROCESS WITH G APS (MHPG) For each m = 1, · · · , N , let Em = {tm,i } be the complete set of events from entity m that are contained in (0, T ]. Recall from (3) that the CIF for entity m is given by λm (t) = um + N X X am,n bm e−bm (t−tn,j ) . (7) tn,j ∈En tn,j <t n=1 It can be shown that λm (t) satisfies the following meanreverting dynamics dλm (t) = bm (um − λm (t))dt + N X am,n bm dNn (t), (8) n=1 Fig. 3. A simulation (using the same parameters as in Figure 2) showing the intermittent observations for each entity. Blue spikes are observed events and red spikes are unobserved events. for t ∈ (0, T ], with the boundary condition λm (0) = um . In general, the solution to (8) has the form λm (t) = um + (λm (0) − um )e−bm t + N X am,n + N X am,n n=1 X bm e−bm (t−tn,j ) , (5) tn,j ∈On cm,k <tn,j <t MHP: Given Em , for m = 1, · · · , N , the task is to learn the parameters u = (um )N ×1 , a = (am,n )N ×N and b = (bm )N ×1 . The common approach is to minimize the (−)loglikelihood functional [21]: "Z ( N T X min L(u, a, b) = λm (t) dt u,a,b where λ̄m,k := λ̄m (cm,k ) are extra unknowns. By an abuse of notation, denote the vector λ̄ := {λm,k }. To learn the underlying parameters u, a and b, we propose to solve the following minimization problem, J(u, a, b, λ̄) = " Km Z N X X m=1 k=1 − dm,k λ̄m (t) dt cm,k X   log λ̄m (tm,i )  (6) tm,i ∈(cm,k ,dm,k ] + G(a) + H(λ̄), where G(a) and H(λ̄) are appropriate constraints or regularizations on the matrix a and the vector λ̄. The paper is organized as follows. In Section II we go over a formulation to incorporate the gaps into the modeling of (5) and go over the variational model (6) with appropriate regularizations and constraints to learn the underlying parameters u, a and b. In Section III, we provide a numerical study using simulated data to show that the proposed method robustly recovers the underlying parameters in the presence of large amount of missing events (≥ 70%). A detailed description of the numerical implementation for computing a minimizer of (6) (see Algorithm (1)) is outlined in the appendix. To the author’s knowledge, there isn’t any work in the literature that addresses intermittent observations for point processes in a continuous setting. bm e−bm (t−tn,j ) . tn,j ∈En tn,j <t n=1 λ̄m (t) = um + (λ̄m (cm,k ) − um )e−bm (t−cm,k ) X 0 m=1  − X log(λm (tm,i )) + G(a)   (9) ,  tm,i ∈Em with the constraint um ≥ 0 and bm ≥ 0. The second term G(a) is the prior or regularization on the matrix a. For instance, to impose sparsity on interactions, one can use the LASSO P constraint [23] G(a) = µ m,n |am,n | for some µ > 0 . Suppose now that we do not have complete observations, m that is let {(cm,k , dm,k ]}K k=1 be the collection of disjoint observed intervals for entity m that are contained in (0, T ]. Here we assume that tn,j 6= cm,k for all events tn,j and boundary values cm,k . Let Om be the set of the corresponding partially observed events, that is h i m Om = Em ∩ ∪K k=1 (cm,k , dm,k ] . Let t ∈ (cm,k , dm,k ] and recall from (7), we have (assuming λm (0) = um ) λm (t) = um + N X N X n=1 + N X n=1 am,n bm e−bm (t−tn,j ) (10) tn,j ∈En tn,j <t n=1 = um + X am,n X am,n bm e−bm (t−tn,j ) (11) tn,j ∈En tn,j <cm,k X tn,j ∈En cm,k <tn,j <t bm e−bm (t−tn,j ) . (12) 4 Since by (3), λm (cm,k ) = um + N X X am,n bm e−bm (cm,k −tn,j ) . tn,j ∈En tn,j <cm,k n=1 Substituting λm (cm,k ) into (12), we get λm (t) = um + (λm (cm,k ) − um )e−bm (t−cm,k ) + N X This implies am,n X bm e−bm (t−tn,j ) . (13) tn,j ∈En cm,k <tn,j <t n=1 The boundary value λm,k := λm (cm,k ) is an extra unknown since it may depend on the unobserved events that are contained in the gap (dm,k−1 , cm,k ]. The third term on the righthand side of the last equation is summing over (observed and unobserved) events from entity n that are contained in (cm,k , dm,k ]. Clearly, if m and n have the same observed intervals, then we have {tn,j ∈ En : cm,k < tn,j ≤ dm,k } = {tn,j ∈ On : cm,k < tn,j ≤ dm,k }. (14) In general, we consider the following approximation of the CIF for entity m: λ̄m (t) = um + (λm (cm,k ) − um )e−bm (t−cm,k ) + N X Theorem 4.1 from [24] provides a theoretical result for the marginal distribution of {λm (t)}t>0 . The (-)log of this distribution can be used to define H(λ̄). For instance, for a univariate Hawkes process (4), {λ(t)}t>0 follows a shifted Gamma distribution   u 1−a , . (18) {λ(t)}t>0 ≈ u + Gamma b ab am,n X bm e−bm (t−tn,j ) . (15) tn,j ∈On cm,k <tn,j <t n=1 Note that the representation of λ̄m (t) in (15) is exactly equal to λm (t) in (13) whenever (14) holds. For the general case where the observed intervals for m and n are not identical, then (15) provides an approximation to λm (t). In Section III, we show that by taking the intersection of the observed intervals and remove events that do not belong to this intersection, one can achieve better reconstructions. MHPG: Denote λ̄m,k := λm (cm,k ) and by an abuse of notation denote λ̄ := {λ̄m,k }. We propose to learn the parameters u, a, b and λ̄ by minimizing the following functional: " Km Z dm,k N X X J(u, a, b, λ̄) = λ̄m (t) dt cm,k m=1 k=1 −   log λ̄m (tm,i )  X (16) tm,i ∈(cm,k ,dm,k ] + G(a) + H(λ̄), where G(a) and H(λ̄) are priors (or regularizations) on a and λ̄ respectively. If all entities have the same observed intervals, then using techniques from [21], one can show that J from (16) is the (−)log-likelihood function. From the graph/network point of view, the LASSO constraint [23] on the matrix a, G(a) = µ N X |am,n |, (17) m,n=1 enforces sparsity on a. In other words, each entity only interacts with a few other entities within the network. ua , and 1−a ua2 b . var ({λ(t)}t>0 ) = (1 − a)2 mean ({λ(t)}t>0 ) = u + (19) Clearly as a → 1 both the mean and variance converge to ∞. Note that a small change in the parameter a produces a large change in both the mean and variance. For a multivariate Hawkes process the distribution of {λm (t)}t>0 has a much more complicated form. Thus, we consider instead the following constraint on λ̄m,k : um ≤ λ̄m,k ≤ Cum , (20) for some C ≥ 1. This can be viewed as having λ̄m,k following a uniform distribution on [um , Cum ]. The functional J in (16) is not convex, in particular, with respect to b. There are numerous successful numerical schemes that have been proposed to compute a minimizer for nonconvex functionals. See for instance PALM [25], or Block Prox-Linear Method [26], among others. The method we use here follows PALM but instead of using gradient descend which is very slow in practice we use the fixed point method. Below is a summary of the proposed algorithm where the detail of the numerical implementation is given in the appendix Algorithm 1 (Algorithm for parameter estimation). Given m Om = {tm,i } ⊂ ∪K k=1 (cm,k , dm,k ], m = 1, · · · , N, some µ > 0 and dt = small. 1) Initial guess: u0m = 1, a0m,n = 0.5/N, bm = 1000, λ̄0 = {λ̄0m,k = u0m }. 2) Suppose u` , a` , b` and λ̄` are known. 3) While not convergent a) Compute u`+1 using u` , a` , b` and λ̄` via (32). b) Compute a`+1 using u`+1 , a` , b` and λ̄` via (33). c) Compute b`+1 using u`+1 , a`+1 , b` and λ̄` via (34). d) Compute λ̄`+1 using u`+1 , a`+1 , b`+1 and λ̄` via (35) using the constraint (20). 4) End while. Although Equation (13) can be derived directly from Equation (8) for t ∈ (cm,k , dm,k ], the technique described in Equations (10)-(12) can be applied to a much more general case. Transforming Equation (10) to Equation (15) is possible because of the fact that e−bt satisfies the semi-group property. The same technique can also be used for g(t) = Q(t)s(t), where Q(t) is a polynomial and s(t) is any function satisfying the semi-group property (namely s(t1 + t2 ) = s(t1 )s(t2 ).) By approximating a power-law function with a sum of exponentials, this technique can also be applied there. In particular, let 5 R∞ g(t) = αb te−bt , where αb is chosen such that 0 g(t) dt = 1. For simplicity consider the univariate self-exciting point process with λ(t), t ∈ (0, T ], given by X λ(t) = u + a g(t − ti ) 0<ti <t X =u+a (21) αb (t − ti )e−b(t−ti ) . 0<ti <t Take t ∈ (ck , dk ] and assuming ti 6= ck , (21) becomes X αb (t − ti )e−b(t−ti ) λ(t) = u + a 0<ti <ck X +a (22) αb (t − ti )e−b(t−ti ) . ck <ti <t Let A = a A P 0<ti <ck = a X αb (t − ti )e−b(t−ti ) , then αb (t − ck + ck − ti )e−b(t−ck +ck −ti ) 0<ti <ck = a h X αb (ck − ti )e−b(ck −ti ) e−b(t−ck ) i 0<ti <ck + a h i αb e−b(ck −ti ) (t − ck )e−b(t−ck ) . X 0<ti <ck Apply the last equation to (22), we get λ(t) = u + (λ(ck ) − u)e−b(t−ck ) h i e k ) − u) (t − ck )e−b(t−ck ) + (λ(c (23) X −b(t−ti ) +a αb (t − ti )e , for t ∈ (ck , dk ], ck <ti <t −b(ck −ti ) e k) = u + a P where λ(c has the form of 0<ti <ck αb e a univariate Hawkes process. In this case the extra unknowns e k )}. In general, for g(t) = Q(t)e−bt with are {λ(ck )} and {λ(c Q(t) being a polynomial of degree M , there will be M + 1 extra unknown boundary values to solve. III. N UMERICAL R ESULTS Given the parameters u ∈ Rn , a ∈ RN ×N and b ∈ R , we use the algorithm from [24] to simulate events Em ⊂ (0, T ], for some T > 0. Given the observed intervals m {(cm,k , dm,k ]}K k=1 generated by Algorithm 2, the observed events are then computed as   m Om = Em ∩ ∪K (c , d ] . (24) m,k m,k k=1 N In the following examples, we apply Om to MHP and MHPG given in (9) and (16) respectively using (17) for the regularization on the matrix a. We consider the following two constraints for the unknown boundary values {λm,k }: the histograms of event counts on the interval (0, 20] having λm,k = um . In the latter, the median values are used to simulate events for 500 times. Algorithm 2 (Algorithm for generating observed intervals). Given a fraction of observations 0 < p < 1, and 0 < τ1 < τ2 representing the lower and upper bounds for the lengths of the observed intervals. 1) Set c1 = 0 and d1 = e1 where e1 is a uniform random number in (τ1 , τ2 ). 2) Suppose ck−1 and dk−1 are computed. 3) Set ck = dk−1 + nk , where nk is a uniform random τ1 τ2 , 2p ). number in ( 2p 4) Set dk = ck +ek , where ek is a uniform random number in (τ1 , τ2 ). 5) Proceed until either ck ≥ T or dk ≥ T . Set the last dk = T . Example 1. Consider a bivariate Hawkes process with the parameters       5 0.5 0.5 10 u= , a= , b= . (27) 5 0 0.5 10 Here, all entities have the same observed intervals which are generated by Algorithm 2 with T = 1000, p = 0.3, τ1 = 5/b1 and τ2 = 30/b1 . Using the observed events Om (defined in (24)), the boxplots in Figure 4 show for 100 simulations the reconstructed parameters using MHP (top), and MHPG using (25) (middle) and (26) (bottom) for the boundary intensity values. MHP incorrectly estimates u and a. See for instance the median values for u and a using MHP in Figure 4:(i),(iii). From (19), {λ2 (t)} with a2,2 = 0.5 and a2,1 = 0 has mean 2u2 and variance u2 b2 . MHPG with the constraint (25) imposes a small bias on boundaries {λ2,k } and as a result produces a slightly larger background u2 in its estimation (e.g. the median value is 5.2.) One also observes a similar effect for entity 1 where the median value for u1 is 6.1. Other than the background parameter, both methods using MHPG produce comparable results for a and b. Setting the boundary value λm (0) = um , we then use the median values of the reconstructed parameters (shown in Figure 4) from each method to simulate events in the interval (0, 20]. Figure 5 shows the histograms (distributions) of event counts from each entity for 500 simulations for MHP (green), MHPG using (25) (cyan) and MHPG using (26) (yellow). Compare with the ground truth (blue), MHP significantly underestimates the event counts. This is apparent since we only apply Om to MHP as oppose to Em . This also shows that the knowledge of gaps (or observed intervals) is crucial in capturing the underlying distributions. λm,k = um , (25) um ≤ λm,k ≤ 20um . (26) Example 2. The setup is the same as in Example 1, but here we consider a much more contagious Hawkes process having       1 0.9 0.75 10 u= , a= , b= . (28) 2 0 0.9 10 We use the following metrics to compare the performance of the three methods: 1) the boxplots and median values of the reconstructed parameters for 100 simulations, and 2) The boxplots in Figure 6 show, for 100 simulations, the reconstructed parameters using: MHP (top), MHPG using (25) (middle), and MHPG using (26) (bottom). In this case, both and 6 (i) (i) (ii) (ii) Fig. 5. Using the median values of the reconstructed parameters (shown in Figure 4) from each method to simulate events in the interval (0, 20] by setting the boundary value λm (0) = um , (i) and (ii) show the histograms of event counts for entity 1 and 2 respectively for 500 simulations: 1) MHP (green), 2) MHPG using (25) (cyan), and 3) MHPG using (26) (yellow). The histograms of event counts using the true parameters are shown in blue. MHP and MHPG using (25) (e.g. λm,k = um ) inaccurately estimate all the parameters. However, with MHPG using (26), λm,k is adjusted accordingly with respect to how the events occur in the gap (cm,k , dm,k ]. As a result the reconstructed parameters are significantly improved. This improvement is also validated by the histograms in Figures 7 showing the distributions of event counts from each entity. (iii) Fig. 4. Reconstructed parameters for MHP (top), MHPG using (25) (middle) and MHPG using (26) (bottom). The ground truths are given in (27). Here all entities have the same observed intervals generated by Algorithm 2 with T = 1000, p = 0.3, τ1 = 5/b1 and τ2 = 30/b1 . The median values of the 100 reconstructions from each method are also presented in (i), (ii) and (iii). Example 3. In this example, we consider the same Hawkes process as in Example 2. However in this case, we generate a separate set of observed intervals for each entity using Algorithm 2 with T = 1000, p = 0.3, τ1 = 5/b1 and τ2 = 30/b1 . The presence of non-identical observed intervals results in all methods underestimating am,n , m 6= n. As seen in Figure 8, the estimated values for a1,2 are much smaller than the true value of 0.75. To compensate for this loss, all three methods overestimate a1,1 . We do not see this effect for a2,2 since it is not influenced by entity 1, e.g. a2,1 = 0. Among the three methods, the proposed MHPG using (26) (bottom boxplots in Figure 8:(i)-(iii)) provides the closest approximations to all the parameters. This is also evident in Figures 9 where for both entities the distributions of event counts coming from the proposed method (yellow) is closest 7 (i) (i) (ii) (ii) Fig. 7. Using the median values of the reconstructed parameters (shown in Figure 6) from each method to simulate events in the interval (0, 20] by setting the boundary value λm (0) = um , (i) and (ii) show the histograms of event counts for entity 1 and 2 respectively for 500 simulations: 1) MHP (green), 2) MHPG using (25) (cyan), and 3) MHPG using (26) (yellow). The histograms of event counts using the true parameters are shown in blue. to the ground truth (blue) compared to the other two methods (green and cyan). (iii) Fig. 6. Reconstructed parameters for MHP (top), MHPG using (25) (middle) and MHPG using (26) (bottom). The ground truths are given in (28). Here all entities have the same observed intervals generated by Algorithm 2 with T = 1000, p = 0.3, τ1 = 5/b1 and τ2 = 30/b1 . The median values of the 100 reconstructions from each method are also presented in (i), (ii) and (iii). Example 4. In this example we consider the same Hawkes process as in Example 3. Given the nonidentical observed intervals generated as in Example 3, we then take the intersection of these intervals to get the common observed intervals for each entity. Figure 10 shows the histograms of the lengths of the observed intervals prior and posterior to taking the intersection. The resulting intersection contains intervals with lengths concentrated mostly below 10/b1 and the fraction of observations becomes p = 0.14. Figure 11 shows the performance of the three methods by considering only events that are contained in the intersection. Here, we note that the reconstructed parameters using the proposed method (MHPG using (26)) are much better than those obtained in Example 3. See for instance the median values of u and a in Figures 11:(i),(iii). In addition, the histogram of event counts for each entity using the proposed method (yellow) in Figure 12 is much closer the ground truth (blue) than the histogram shown in Figure 9 from Example 3. However, with the presence of too many small intervals, MHPG still under estimates a1,2 , e.g. the median value is now 0.66 as oppose to 0.5 in Example 3. 8 (i) (i) (ii) (ii) Fig. 9. Using the median values of the reconstructed parameters (shown in Figure 8) from each method to simulate events in the interval (0, 20] by setting the boundary value λm (0) = um , (i) and (ii) show the histograms of event counts for entity 1 and 2 respectively for 500 simulations: 1) MHP (green), 2) MHPG using (25) (cyan), and 3) MHPG using (26) (yellow). The histograms of event counts using the true parameters are shown in blue. (iii) Fig. 8. Reconstructed parameters for MHP (top), MHPG using (25) (middle) and MHPG using (26) (bottom). The ground truths are given in (28). Here each entity has a separate collection of observed intervals generated by Algorithm 2 with T = 1000, p = 0.3, τ1 = 5/b1 and τ2 = 30/b1 . The median values of the 100 reconstructions from each method are also presented in (i), (ii) and (iii). Fig. 10. Histograms of the lengths of the observed intervals prior and posterior to taking the intersection. Recall that the ground truth for a1,2 is 0.75. Example 5. In this example, we consider the same Hawkes process and the setup as in Example 2 but with the fraction of observations p = 0.1. Figures 13-14 show the reconstructed parameters and the histograms of event counts for the three compared methods. The results for MHPG using (26) are as 9 (i) (i) (ii) (ii) Fig. 12. Using the median values of the reconstructed parameters (shown in Figure 11) from each method to simulate events in the interval (0, 20] by setting the boundary value λm (0) = um , (i) and (ii) show the histograms of event counts for entity 1 and 2 respectively for 500 simulations: 1) MHP (green), 2) MHPG using (25) (cyan), and 3) MHPG using (26) (yellow). The histograms of event counts using the true parameters are shown in blue. (iii) Fig. 11. Reconstructed parameters for MHP (top), MHPG using (25) (middle) and MHPG using (26) (bottom). The ground truths are given in (28). Here we take intersection of observed intervals from Example 3 and remove events that do not belong to the intersection. The median values of the 100 reconstructions from each method are also presented in (i), (ii) and (iii). good as in Example 2 where p = 0.3. Even though the fraction of observations is smaller than the one from Example 4, the reconstructions are better by using uniform sampling for the observed intervals with τ1 = 5/b1 and τ2 = 30/b1 . Again, MHPG using (26) outperforms the other two methods. In conclusion, we present here a simple technique for modeling the CIF of a multivariate Hawkes process that incorporates observational gaps in (15). The proposed minimizing energy (16) simplifies the problem of having to deal with a large amount of missing events by introducing a much smaller number of unknown boundary values, e.g. {λm,k }. In our numerical study, a constraint such as (20) with C  1 is sufficient for a stable reconstruction of the underlying parameters given that the observed intervals are sampled appropriately. In this paper, we consider a random uniform sampling strategy (Algorithm 2) that is based solely on the timescale 1/bm . However, the dynamic of {λm (t)} is also sensitive to the parameters um and {am,n }N n=1 . Thus a sampling strategy should also take into account these additional parameters. The comparisons between Examples 4 and 5 show that a good sampling strategy is crucial as a prior step. However, in the case when the observed intervals from all entities within a network are not identical, taking the intersection (reducing the fraction of observations and observed events) can improve the parameter estimations. In a network of N entities with nonidentical observed intervals, taking the intersection among all N entities, where N is large, may produce an empty set or a very small fraction of observations. Therefore, the techniques proposed here are not applicable to this situation. One possible heuristic approach to mitigate this problem is to consider the following strategy: Fix an m and let Im = {n ∈ {1, · · · , N } : e am,n > 0}, where e am,n is estimated by 10 (i) (i) (ii) (ii) Fig. 14. Using the median values of the reconstructed parameters from each method (shown in Figure 4) to simulate events in the interval (0, 20] by setting the boundary value λm (0) = um , (i) and (ii) show the histograms of event counts from each method for entity 1 and 2 respectively for 500 simulations: 1) MHP (green), 2) MHPG using (25) (cyan), and 3) MHPG using (26) (yellow). The histograms of event counts using the true parameters are shown in blue. applying the intersection of only entities m and n to MHPG. The new CIF for m can now be estimated as λ̄m (t) = um + (λm (ck ) − um )e−bm (t−ck ) X X + am,n bm e−bm (t−tn,j ) , n∈Im (iii) Fig. 13. Reconstructed parameters for MHP (top), MHPG using (25) (middle) and MHPG using (26) (bottom). The ground truths are given in (28). Here all entities have the same observed intervals generated by Algorithm 2 with T = 1000, p = 0.1, τ1 = 5/b1 and τ2 = 30/b1 . The median values of the 100 reconstructions from each method are also presented in (i), (ii) and (iii). (29) ck <tn,j <t where {(ck , dk ]} is the intersection between {(cm,k , dm,k ]} and {(cn,k , dn,k ]} for all n ∈ In . For a network with sparse interactions, this could provide heuristically a strategy for computing the parameters associated to entity m, e.g. apply the new estimated λ̄m (t) in (29) to the minimizing energy in (16). Again, it may be possible that either the resulting {(ck , dk ]} does not exists (since it is an empty set) or that it is very small. So in this case, the proposed method is not applicable for this type of sampling strategy. A PPENDIX Denote λ̄m,k,i = λ̄m (tm,i ) for some tm,i ∈ (cm,k , dm,k ]. Also, let Z dm,k Λ̄m,k = λ̄m (t) dt. cm,k 11 We have Λ̄m,k = um (dm,k − cm,k )  λ̄m,k − um  + 1 − e−bm (dm,k −cm,k ) bm N X + am,n Bm,n,k , and λ̄m,k,i = um + (λ̄m,k − um,k )e−bm (tm,i −cm,k ) N X + am,n Am,n,k,i ,   Km X X ∂ λ̄ 1 ∂ λ̄ m,k,i   m,k − = ∂am,n ∂am,n λ̄ m,k,i k=1 tm,i ∈(cm,k ,dm,k ]   Km X X A m,n,k,i Bm,n,k −  = λ̄ m,k,i k=1 ∂L ∂am,n tm,i ∈(cm,k ,dm,k ] n=1 Km X = n=1 am,n where Am,n,k,i = bm e−bm (tm,i −tn,j ) Km X 1 − X Bm,n,k k=1 X k=1 tm,i ∈(cm,k ,dm,k ] am,n Am,n,k,i . λ̄m,k,i Setting cm,k <tn,j <tm,i ≤dm,k = Am,n,k,i−1 e−bm (tm,i −tm,i−1 ) X + bm e−bm (tm,i −tn,j ) ,  (30) ām,n =  Km X X k=1 tm,i ∈(cm,k ,dm,k ] cm,k <tm,i−1 ≤tn,j <tm,i  " # Km am,n Am,n,k,i  X Bm,n,k / λ̄m,k,i k=1 We then solve which can be computed recursively and   X Bm,n,k = 1 − e−bm (dm,k −tn,j ) . am,n = shrinkµ (ām,n ) . (33) cm,k <tn,j ≤dm,k Computing bm : We have The minimizing energy we are interested in is: J(u, a, b, λ̄) = µ N X ∂J ∂bm |am,n | m,n=1 Km N X X + m=1 k=1   X Λ̄m,k − = k=1 ∂ λ̄k ∂bm tm,i ∈(cm,k ,dm,k ] i 1 h −bm (dm,k −cm,k ) = e − (1 − bm (dm,k − cm,k ) bm h 1 (λ̄m,k − um ) − 2 (1 − e−bm (dm,k −cm,k ) ) bm i 1 + (dm,k − cm,k )e−bm (dm,k −cm,k ) bm N X ∂Bm,n,k am,n + . ∂bm n=1 = ∂ λ̄m,k,i ∂bm = + and −(λ̄m,k − um )(tm,i − cm,k )e−bm (tm,i −cm,k ) N X am,n n=1   ∂ λ̄m,k,i = 1 − e−bm (tm,i −cm,k ) . ∂um ∂J ∂um um Computing am,n : We have ∂Am,n,k,i ∂bm where = 0, we see that a minimizer um must satisfy "K # "K # m m X X um ∂ λ̄m,k,i ∂ λ̄m,k = / . ∂um ∂um λ̄ k=1 m,k,i k=1 tm,i ∈(cm,k ,dm,k ] 1 ∂ λ̄m,k,i  , λ̄m,k,i ∂bm and where Setting  ∂ λ̄k − ∂bm X where tm,i ∈(cm,k ,dm,k ] with the constraint that um ≤ λ̄m,k ≤ Cum . Computing um : We have   Km X X 1 ∂ λ̄m,k,i  ∂J  ∂ Λ̄m,k − = , ∂um ∂um λ̄m,k,i ∂um ∂ Λ̄m,k ∂um   (31) log(λ̄m,k,i ) = G(a) + L(u, a, b, λ̄), k=1 Km X (32) − X ∂Am,n,k,i = e−bm (tm,i −tn,j ) ∂bm cm,k <tn,j <tm,i ≤dm,k X bm (tm,i − tn,j )e−bm (tm,i −tn,j ) cm,k <tn,j <tm,i ≤dm,k (1) = ∂Am,n,k,i ∂bm (2) − bm ∂Am,n,k,i ∂bm . 12 Thus, ∂J ∂bm = − Km X k=1 Km X ∂ λ̄m,k ∂bm 1 X k=1 tm,i ∈(cm,k ,dm,k ] λ̄m,k,i ·  −(λ̄m,k − um )(tm,i − cm,k )e−bm (tm,i −cm,k ) ! (1) N X ∂Am,n,k,i + am,n ∂bm n=1   (2) PN ∂Am,n,k,i a K m n=1 m,n ∂bm X X − bm λ̄m,k,i k=1 tm,i ∈(cm,k ,dm,k ] = A1 − A2 − bm A3 ., Setting ∂J ∂bm = 0 implies that a minimizer bm must satisfy, bm = A1 − A2 . A3 (34) Computing λ̄m,k : ∂J ∂ λ̄m,k = − 1 (1 − e−bm (dm,k −cm,k ) ) bm X 1 e−bm (tm,i −cm,k ) . λ̄m,k,i tm,i ∈(cm,k ,dm,k ] Setting λ̄m,k ∂J ∂ λ̄m,k = 0 implies that a minimizer λ̄m,k must satisfy   −bm (tm,i −cm,k ) X λ̄ e m,k / =bm  λ̄m,k,i (35) tm,i ∈(cm,k ,dm,k ] h i 1 − e−bm (dm,k −cm,k ) , with the constraint um ≤ λ̄m,k ≤ Cum , for some C ≥ 1. R EFERENCES [1] Y. Ogata and K. Shimazaki, “Transition from aftershock to normal activity: The 1965 rat islands earthquake aftershock sequence,” Bulletin of the Seismological Society of America, vol. 74, no. 5, pp. 1757–1765, 1984. [2] Y. Ogata, “Statistical models for earthquake occurrences and residual analysis for point processes,” Journal of the American Statistical Association, vol. 83, no. 401, pp. 9–27, 1988. [3] ——, “Seismicity analysis through point-process modeling: A review,” Pure and applied geophysics, vol. 155, no. 2-4, pp. 471–507, 1999. [4] J. Zhuang, O. Yosihiko, and V.-J. D., “Stochastic declustering of space-time earthquake occurrences,” Journal of the American Statistical Society, vol. 97, no. 458, pp. 369–380, 2002. [5] G. O. Mohler, M. B. Short, P. J. Brantingham, F. P. Schoenberg, and G. E. Tita, “Self-exciting point process modeling of crime,” Journal of the American Statistical Association, vol. 106, no. 493, 2011. [6] E. Lewis, G. Mohler, P. J. Brantingham, and A. L. Bertozzi, “Selfexciting point process models of civilian deaths in iraq,” Security Journal, vol. 25, no. 3, pp. 244–264, 2012. [7] A. Sidebottom, “Repeat burglary victimization in malawi and the influence of housing type and area-level affluence,” Security journal, vol. 25, no. 3, pp. 265–281, 2-12. [8] M. Short, G. Mohler, P. Brantingham, and G. Tita, “Gang rivalry dynamics via coupled point process networks,” Discrete & Continuous Dynamical Systems-Series B, vol. 19, no. 5, 2014. [9] Y. Aı̈t-Sahalia, J. Cacho-Diaz, and R. J. Laeven, “Modeling financial contagion using mutually exciting jump processes,” National Bureau of Economic Research, Tech. Rep., 2010. [10] S. Azizpour and K. Giesecke, “Self-exciting corporate defaults: Contagion vs. frailty,” Stanford University working paper series, Tech. Rep., 2008. [11] C. G. Bowsher, “Modeling security market events in continuous time: intensity based, multivariate point process models,” Journal of Econometrics, vol. 141, no. 2, pp. 876–912, 2007. [12] P. Embrechts, T. Liniger, L. Lin et al., “Multivariate hawkes processes: an application to financial data,” Journal of Applied Probability, vol. 48, pp. 367–378, 2011. [13] P. Embrechts and M. Kirchner, “Hawkes graphs,” arXiv preprint arXiv:1601.01879, 2016. [14] A. Stomakhin, M. B. Short, and A. L. Bertozzi, “Reconstruction of missing data in social networks based on temporal patterns of interactions,” Inverse Problems, vol. 27, no. 11, p. 115013, 2011. [15] J. R. Zipkin, F. P. Schoenberg, K. Coronges, and A. L. Bertozzi, “Pointprocess models of social network interactions: parameter estimation and missing data recovery,” UCLA CAM Report, no. 14-65, August, 2014. [16] E. C. Hall and R. M. Willett, “Tracking dynamic point processes on networks,” arXiv preprint arXiv:1409.0031, 2014. [17] N. Masuda, T. Takaguchi, N. Sato, and K. Yano, “Self-exciting point process modeling of conversation event sequences,” in Temporal Networks. Springer, 2013, pp. 245–264. [18] J. Etesami, N. Kiyavash, K. Zhang, and K. Singhal, “Learning network of multivariate hawkes processes: A time series approach,” arXiv preprint arXiv:1603.04319, 2016. [19] S. Kim, D. Putrino, S. Ghosh, and E. N. Brown, “A Granger causality measure for point process models of ensemble neural spiking activity,” PLoS computational biology, vol. 7, no. 3, p. e1001110, 2011. [20] P. Reynaud-Bouret, V. Rivoirard, and C. Tuleau-Malot, “Inference of functional connectivity in neurosciences via hawkes processes,” in Global Conference on Signal and Information Processing (GlobalSIP), 2013 IEEE. IEEE, 2013, pp. 317–320. [21] D. J. Daley and D. Vere-Jones, An Introduction to the Theory of Point Processes, volume I: Elementary Theory and Methods of Probability and its Applications. Springer, New York,, 2003. [22] A. G. Hawkes, “Spectra of some self-exciting and mutually exciting point processes,” Biometrika, vol. 58, no. 1, pp. 83–90, 1971. [23] R. Tibshirani, “Regression shrinkage and selection via the lasso,” J. of Royal Stat. Society, Series B (Methodological), pp. 267–288, 1996. [24] A. Dassios and H. Zhao, “A dynamic contagion process,” Advances in applied probability, pp. 814–846, 2011. [25] J. Bolte, S. Sabach, and M. Teboulle, “Proximal alternating linearized minimization for nonconvex and nonsmooth problems,” Mathematical Programming, vol. 146, no. 1-2, pp. 459–494, 2014. [26] Y. Xu and W. Yin, “A globally convergent algorithm for nonconvex optimization based on block coordinate update,” arXiv preprint arXiv:1410.1386, 2014.
7cs.IT
arXiv:1604.08639v3 [math.AC] 6 Nov 2016 ON QUOTIENTS OF GENERALIZED EUCLIDEAN GROUP RINGS LUC GUYOT Abstract. Let R = Z[C] be the integral group ring of a finite cyclic group C. Dennis et al. proved that R is a generalized Euclidean ring in the sense of P. M. Cohn, i.e., SLn (R) is generated by the elementary matrices for all n. We prove that every proper quotient of R is also a generalized Euclidean ring. 1. Introduction Let R be an associative ring with identity. For n ≥ 2, we define En (R) as the subgroup of GLn (R) generated by the elementary matrices, i.e., the matrices which differ from the identity by a single off-diagonal element. The ring R is termed a GEn -ring if GLn (R) = Dn (R)En (R), where Dn (R) denotes the subgroup of invertible diagonal matrices. Following P. M. Cohn, we term R a generalized Euclidean ring, or concisely a GE-ring , if R is a GEn -ring for every n ≥ 2, a property notoriously shared by Euclidean rings. If R is commutative, Whitehead’s lemma implies that Dn (R) ∩ SLn (R) ⊂ En (R). Therefore the property GEn is equivalent to SLn (R) = En (R) in this case. Let I be an ideal of a commutative ring R and let ϕn be the natural map SLn (R) → SLn (R/I). The natural map En (R) → En (R/I) is surjective and if ϕn is surjective too, then R/I is certainly a GEn -ring whenever R is. But ϕn can fail to be surjective for all n ≥ 2 as is the case for R = R[X, Y ] and I the principal ideal generated by X 2 + Y 2 − 1 (see [Mil71, Example 13.5] and [Lam06, Proposition I.8.12 and Theorem VI.4.5]). Thus the inheritance of property GEn by homomorphic images is not automatic. In the previous example R is a GE3 -ring whereas R/I is not a GEn -ring for any n ≥ 2. We can actually produce a non-commutative GE-ring having a non-GE2 quotient. Indeed, a non-commutative free associative algebra over a field k is a GE-ring Date: November 8, 2016. 2010 Mathematics Subject Classification. Primary 13F07, Secondary 16S34. Key words and phrases. group ring; quotient; generalized Euclidean ring; quasi-Euclidean ring; elementary matrix; unimodular row; Nielsen equivalence; metabelian group. 1 2 LUC GUYOT and maps homomorphically onto a free commutative algebra over k which is not a GE2 -ring by [Coh66, Theorem 3.4 and Proposition 7.3]. By contrast, the class of commutative GE-rings is known to be stable under taking quotients by the ideals contained in the Jacobson radical [Gel77, Proposition 5]. In addition, the class of quasi-Euclidean rings, i.e., the GErings which are moreover Hermite rings in the sense of Kaplansky [Kap49], is stable under taking quotients by any ideals [AJLL14]. The integral group ring Z[C] of a finite cyclic group C was shown to be a GE-ring in [DMV84]. If C is not trivial, then Z[C] has a non-principal ideal, and hence is not quasi-Euclidean. The purpose of this article is to establish Theorem A. Let C be a finite cyclic group. Then every homomorphic image of Z[C] is a GE-ring. Our result has some bearing in combinatorial group theory. Let R be quotient of Z[C] and let M be a finitely generated free R-module with C a finite cyclic group. Then the image of C in R is a subgroup of the unit group of R so that C acts naturally on M by automorphisms. Theorem A allows us to show that the semi-direct product G = M ⋊ C has only one Nielsen class of generating k-tuples for every k ≥ rk(G) + 1, where rk(G) denotes the minimal number of generators of G [Guy16, Corollary 4]. Our proof of Theorem A reuses extensively the techniques developed in [DMV84]. Lemma 4 below compiles all criteria from the latter article which render induction possible. The proof of these criteria is faithful to the original. We provide it for the reader’s convenience. A notable difference in our case is that we need to extend the induction basis to the integer ring Z[ζd ] of the cyclo2iπ tomic field Q(ζd ) (ζd = e d ) for all positive rational integers d ∈ / {1, 2, 3, 4, 6}. For this we can rely on [Vas72]. The basis of our induction also comprises a set of 31 small quotients of Z[X] parametrized by the non-empty subsets of {1, 2, 3, 4, 6}. These quotients can in turn be handled by induction, still using Lemma 4. Acknowledgments. The author thanks Pierre de la Harpe and Tatiana SmirnovaNagnibeda for encouragements and comments made on preliminary versions of this paper. 2. Proof Our first step consists in the following observation: we only need to prove that GE2 holds for the homomorphic images of Z[C]. This is the assertion (ii) of this first lemma which collects elementary facts for later use: ON QUOTIENTS OF GENERALIZED EUCLIDEAN GROUP RINGS 3 Lemma 1. Let R be a commutative ring with identity. Then the following assertions hold: (i) If the stable rank of R is 1, then R is a GE-ring. (ii) If the stable rank of R is at most 2 (e.g., the Krull dimension of R is at most 1), then R is a GE-ring if and only if it is a GE2 -ring. (iii) R is a GE2 -ring if and only if E2 (R) acts transitively on the set Um2 (R) = {(r, s) ∈ R2 | rR + sR = R} of unimodular pairs of R.  A semilocal ring has stable rank 1 [Bas64, Corollary 6.5]. As a result semilocal rings, and Artinian rings in particular, are GE-rings. All rings considered in the proof of Theorem A are quotients of Z[C] and hence have stable rank at most 2 [MR87, Corollary 6.7.4]. Our second step consists in a reduction to quotients of Z[C] of a special kind. To this end, we will need the following stability properties: Lemma 2. Let R be a commutative ring with identity. Then the following assertions hold: (i) Let J be an ideal contained in the Jacobson radical of R. Then R is a GE-ring if and only if R/J is a GE-ring [Gel77, Proposition 5]. (ii) If R/I is a GE-ring for some finite ideal I of R, then R is a GE-ring. Proof. (i) See aforementioned reference. (ii). Let n ≥ 2 and let A ∈ SLn (R). As R/I is a GE-ring, we can find E ∈ En (R) such that B = AE −1 lies in SLn (R, I) + ker(SLn (R) ։ SLn (R/I)). The coefficients of B lie in the subring K of R generated by I and 1R , the identity of R. Therefore it suffices to show that K is a GE-ring. If the prime field of R is finite, then K is finite and hence Artinian. As K is a GE-ring in this case, we can assume now that the prime field of R is Z. We have then Z1R ∩ I = 0, which implies that the additive group of K is isomorphic to Z × I. Let e be the exponent of the additive group of I. Then K/eK is finite and hence a GE-ring. We can find E ′ ∈ En (K) such that C = BE ′−1 lies in SLn (K, eK) ⊂ SLn (Z1R ). As Z1R ≃ Z is Euclidean, we have C ∈ En (Z1R ), which completes the proof.  We now introduce the special GE2 -quotients of Z[X] to which the study of Z[C] can be reduced. Given a rational integer d > 0 we let λd : Z[X] → Z[ζd ] be the ring homomorphism induced by the mapQ X 7→ ζd . Given a set Q D of positive rational integers, we define λD : Z[X] → d∈D Z[ζd ] by λD = d∈D λd and set O(D) = λD (Z[X]). Lemma 3. Let D be a finite and non-empty set of positive rational integers. Then O(D) is a GE2 -ring. 4 LUC GUYOT We postpone the proof of Lemma 3 and prove the theorem first. Proof of Theorem A. Set n = |C| and let R be an homomorphic image of Z[X]. There exists an ideal I of Z[X] containing X n − 1 and such that R = Z[X]/I. If R is finite, then R is Artinian and hence a GE-ring. Thus we can assume that R is infinite. By Lemma 2.i we can also assume that R is reduced. Since R is Noetherian, the ideal I is the intersection of finitely many prime ideals of Q Z[X]. Those ideals contain X n − 1 = d | n Φd (X), therefore they are either principal ideals generated by cyclotomic polynomials or maximal ideals. In the latter case the index in R is necessarily finite. Consider then the finite and non-empty set D of all positive rational integers such that I ⊂ Φd (X)Z[X] and let π : Z[X] ։ R be the natural ring epimorphism. Using the quotients of Z[X] by the prime ideals containing I, we easily see that there isQa finite direct sum K of finite fields, an injective ring homomorphism λ : R → d∈D Z[ζd ]×K and a surjective ringQhomomorphism κQ: R ։ K such that λ ◦ π = λD × κ. Then the projection d∈D Z[ζd ]×K ։ d∈D Z[ζd ] induces a ring epimorphism from R onto O(D) whose kernel is R∩({0}×K), R being identified with λ(R). Applying Lemma 2.ii yields the conclusion.  The remainder of this section is devoted to the proof of Lemma 3. Lemma 4. Let D be a finite set of Qpositive rational integers with at least two elements. Let e ∈ D and set ηe = d∈D\{e} Φd (ζe ). Assume that O(D \ {e}) is a GE2 -ring and that at least one of the following holds: (i) e ∈ / {1, 2, 3, 4, 6} and de and is not a positive power of a prime for any d ∈ D \ {e}. (ii) e ∈ {1, 2, 3, 4, 6} and ηe ∈ (Z[ζe ])× . (iii) e ∈ {1, 2} and ηe = ±3. (iv) e ∈ {1, 2, 3, 6} and ηe Z[ζe ] = 2Z[ζe ]. (v) e ∈ {3, 4, 6} and ηe Z[ζe ] = (1 − ζe )k Z[ζe ] for some k ∈ {1, 2}. Then O(D) is a GE2 -ring. Proof. Assertion (i) is [DMV84, Lemma 3.5]. For the remaining assertions   we a b identify O(D) with its image in O(D \{e})×Z[ζe ] and let r = , ∈ c d Um2 (R). Since the projection pre : O(D) → O(D \ {e}) is surjective and O(D \ {e}) is a GE2 -ring, after multiplication by some E ∈ E2 (O(D)) we can assume that (1) a = 1, b = 0 ON QUOTIENTS OF GENERALIZED EUCLIDEAN GROUP RINGS 5 As ker(pre ) maps onto ηe Z[ζe ] via the projection O(D) ։ Z[ζe ], we have (2) c − 1, d ∈ ηe Z[ζe ] O(D) ∩ ({0} × Z[ζe ]) = {0} × ηe Z[ζe ]. Conditions (1) and (2) remain valid after multiplication by any product of matrices in     1 {0} × ηe Z[ζe ] [ 1 0 . 0 1 O(D) 1 The projection of these of matrices to the Z[ζe ] coordinate is     1 ηe Z[ζe ] [ 1 0 (3) 0 1 Z[ζe ] 1 If (ii) holds then matrices of the form (3) generate E2 (Z[ζe ]). As Z[ζe ] is a Euclidean ring for e ∈ {1, 2, 3, 4, 6} such matrices can therefore be used to reduce (c, d) to (1, 0), reducing thus r to (1, 0). If either (iii) or (iv) holds, then [DMV84, Lemma 4.1] applies, so that multiplication by matrices in (3) can reduce either c or d to 0. Since c − 1 ∈ ηe Z[ζe ], it must be d. Assuming now that d = 0, the unimodularity of (c, d) yields c ∈ (1 + ηe Z[ζe ]) ∩ (Z[ζe ])× ⊂ {±1}. If c = −1, then ηe Z[ζe ] = 2Z[ζe ] must hold and the identity      1 2 1 0 1 2 c d = 1 0 1 −1 1 0 1 0  shows that (c, d) can be reduced to (1, 0) using matrices in (3). If (v) holds then (Z[ζe ], 1 − ζe ) is a Euclidean pair with respect to the complex modulus, so that [DMV84, Lemma 4.2] applies and leads to the desired conclusion.  Proof of Lemma 3. We apply inductively Lemma 4.i by choosing at each step the largest member e of D which is not in S = {1, 2, 3, 4, 6}. In this way D is reduced to either a subset of S or a singleton {d} with d ∈ / S. In the latter case, O(D) = O({d}) = Z[ζd ] is a GE2 -ring by [Vas72]. We also observe that O({d}) is a GE2 -ring for all d in S. Indeed, the rings Z, Z[i] and Z[ζ3 ] are Euclidean rings with respect to the complex modulus. Applying assertions (ii) to (iv) of Lemma 4, we can prove the result inductively for all pairs, triples and quadruples of elements of S, except the quadruple {1, 2, 3, 6} for which we apply [DMV84, Proposition 5.1]. Eventually, we apply Lemma 4.v (or equivalently [DMV84, Proposition 5.10]) to prove the result for D = S.  6 LUC GUYOT References [AJLL14] Adel Alahmadi, S. K. Jain, T. Y. Lam, and A. Leroy. Euclidean pairs and quasiEuclidean rings. J. Algebra, 406:154–170, 2014. [Bas64] H. Bass. K-theory and stable algebra. Inst. Hautes Études Sci. Publ. Math., (22):5–60, 1964. [Coh66] P. M. Cohn. On the structure of the GL2 of a ring. Inst. Hautes Études Sci. Publ. Math., (30):5–53, 1966. [DMV84] Keith Dennis, Bruce Magurn, and Leonid Vaserstein. Generalized Euclidean group rings. J. Reine Angew. Math., 351:113–128, 1984. [Gel77] Susan C. Geller. On the GEn of a ring. Illinois J. Math., 21(1):109–112, 1977. [Guy16] L. Guyot. Generators of split extensions of Abelian groups by cyclic groups. Preprint, arXiv: [math.GR], April 2016. [Kap49] Irving Kaplansky. Elementary divisors and modules. Trans. Amer. Math. Soc., 66:464–491, 1949. [Lam06] T. Y. Lam. Serre’s problem on projective modules. Springer Monographs in Mathematics. Springer-Verlag, Berlin, 2006. [Mil71] John Milnor. Introduction to algebraic K-theory. Princeton University Press, Princeton, N.J.; University of Tokyo Press, Tokyo, 1971. Annals of Mathematics Studies, No. 72. [MR87] J. C. McConnell and J. C. Robson. Noncommutative Noetherian rings. Pure and Applied Mathematics (New York). John Wiley & Sons, Ltd., Chichester, 1987. With the cooperation of L. W. Small, A Wiley-Interscience Publication. [Vas72] L. N. Vaseršteı̆n. The group SL2 over Dedekind rings of arithmetic type. Mat. Sb. (N.S.), 89(131):313–322, 351, 1972. EPFL ENT CBS BBP/HBP. Campus Biotech. B1 Building, Chemin des mines, 9, Geneva 1202, Switzerland E-mail address: [email protected]
0math.AC
Evolutionary Algorithm for Drug Discovery – Interim Design Report Author: Mark Shackelford th 14 March 2014 Post: Advanced Computational Technologies 9 Belsize Road, West Worthing, West Sussex, BN11 4RH, UK Email: [email protected] Introduction Evolutionary Algorithm for Drug Discovery [EAfDD] is a MS Windows based software program (written in C#.NET) which aims to provide an explorative capability over the Search Space of potential drug molecules. In essence the program explores the search space by generating random molecules, determining their fitness (based on a variety of criteria) and then breeding a new generation from the fittest individuals. The search space (in theory any combination of any elements in any order) is constrained by the use of a subset of elements (e.g. organic) and a list of fragments (molecular parts that are known to be useful in drug development). The resultant molecules from each generation are stored in a searchable database, so that the user can browse through previous generations looking for interesting molecules. Much of the intent of the program is not necessarily to find an optimal solution, or even a molecule that can actually be created by a chemist – but to allow the user to trawl through areas of the search space that might be outside their experience. The program also provides an Interactive capability, whereby the user can inspect the output from any generation and adjust the system calculated fitness, thereby allowing the user to alter the selection process and drive the algorithm in a new direction. There have been a number of different approaches in the past ([1] – [35]), which have used fixed length genetic algorithms, or graph based genetic programs etc. These have produced variable success but have provided many useful ideas that been incorporated into EAfDD. The Algorithm EAfDD uses an evolutionary algorithm with variable length strings to represent candidate molecules. The initial population of molecules is created using a newly designed molecule creation process, which builds a C# object-oriented linked-list structure of molecular fragments and atoms. The fragments and atoms are selected from a user-specifiable list of required items – which can be varied depending on the drug target environment. Standard chemistry rules (valence etc) are used to create the initial molecules, and a variety of other rules can also be specified and used to determine the validity of the molecules (e.g. min/max number of atoms, max molecular weight etc.). Once the program has created the molecules they are converted to “expanded” SMILES strings for processing within the evolutionary algorithm – which has a variety of functions to search and select items within the strings for cross-over and mutation. NOTE: “Expanded” SMILES is an extended format of the basic SMILES strings, which contains extra information to allow the cross-over and mutation operators to easily find the required items to process. For details see Expanded SMILES section below. The resultant population runs through a number of iterations using a genetic algorithm crossover and mutation operators, which have been tailored to meet the chemical rules as specified with the program. The Fitness of molecules can be derived from a variety of mechanisms, such as using algorithms to determine solubility, permeability, toxicity etc. At present the algorithm (in proof of concept mode) uses a Target Molecule and a Similarity Fitness function, such that it has to evolve its initial random population towards a target molecule. Early tests show that the algorithm can reach a 96% fit with the target molecule in 100 iterations or so. The Program The program provides a range of functions to allow the process to be tailored to a wide range of drug discovery projects.  Parameters – this function allows the user to control all aspects of the process, from the number of iterations, the various GA parameters (population size etc), the generation process (such as the % likelihood of choosing a new atom or fragment when creating a molecule) and the cross-over and mutation processes (such as mutation rate).  Elements – the system allows the user to choose a subset of elements to be used in the process. This is likely to be the Organic subset (H, B, C, N, O, F, P, S, Cl, Br, I), but this can be extended or reduced as required. A Periodic Table graphic is used to select the required atoms.  Fragments – the user can create a list of molecular fragments that are to be used in the random molecule generation. These are specified as SMILES strings and will be used in the initial population as well as during the Mutation process.  Leads – one or more Lead Molecules can be specified to seed the initial population. Use of this function will tend to target specific areas of the search space, and can be used to explore potential drug molecules similar to known ones, rather than the more general exploration of the entire search space.  Fitness – a variety of operators can be specified for use in defining the fitness of molecules which drives the selection process for each generation. At present this uses a Similarity function (how close to a target molecule) plus constraints on the size of molecules (number of atoms and their molecular weight).  History – all generated molecules for every generation are saved in a SQL database, and can be accessed through a search and display function. This allows the user to not only be given the final “optimised” molecule, but browse through all of the generated molecules to see if there are other interesting molecules that have potential even if they have not met the current fitness criteria.  Interaction – as the program iterates through the generations, the user can break into the process, review each molecule (the system draws a 2D representation of each molecule on the screen and provides a variety of data on the molecule (weight etc.). The user can then alter the fitness score of any or all of the molecules, and then let the process continue. As the fitness score drives the selection process, the iteractive user is able to drive the evolution towards their own required direction – which may not be able to be defined with the fitness functions provided. Selection Operators The system provides 6 different Parent Selection methods for the genetic algorithm CrossOver process, the user deciding which one is the most appropriate for their particular requirements:  Standard (Roulette) - each Chromosome is chosen based on its relative Fitness. The higher the fitness the more likely it will be chosen as a parent.  Tournament - a number of Chromosomes are chosen at random, and the two highest Fitness chromosomes are used as Parents  Random - two Parents are chosen at random with no bearing on fitness  Attractive - a number of Chromosomes are chosen at random and the two with the closest Similarity are chosen  Difference - a number of Chromosomes are chosen at random and the two with the least Similarity are chosen  Sequential - each Chromosome is chosen in order as a Parent, with a second one chosen at random. The last three Operators are experimental, and not previously described in Evolutionary Algorithm literature - but would seem to have the potential to model biological behaviour attraction of like, attraction of opposites - or free-for-all. Mutation Operators The system provides 10 mutation operators, which are chosen at random for each iteration and each member of the population. If one mutation process fails, the next random one is attempted until a successful mutation occurs (or all operators have been used). A Mutation Rate (%) parameter is used to determine whether any specific Molecule is subjected to Mutation.  Insert Atom - a bond (-, =) is chosen at random and a new Atom/Fragment with the same Valence is inserted.  Replace H - a single H atom is selected and replaced with a branching Atom/Fragment  Remove Atom - an Atom is replaced by one or more [H] to match Valence  Remove Bond and Atom - an Atom with equal bonds is replaced by a single bond  Change Atom to Fragment - an Atom at the end of a branch is replaced with a Fragment with the same Valence  Switch Atom - change one Atom for another with same or greater Valence (plus H)  Increase Bond - a single bond with available H at both ends is replaced with a double bond, and an H removed from each adjoining Atom  Decrease Bond - a double (or triple) bond is replaced with a smaller bond, with H added to each adjoining Atom  Cut Ring - two matching Ring markers {n} are removed and replaced with [H]  Add Ring - two H atoms at the ends of branches are replaced with {n} User Interaction The system provides a variety of Interactive options for the user. These allow any individual from each generation to be rescored by the user. Scoring is very basic – allowing a set of values in the range {0, 1} to be defined. For example these might be “Excellent = 1, Good = 0.75, Average = 0.5, Poor = 0.25, Dreadful = 0.00”. The range and values can be defined in the interface. The user can choose the interval at which the system allows interaction – i.e. Interaction th every <n> generations, which can range from 1 (every generation) to 100 (every 100 generation). The system provides a number of options for which individuals are displayed for interaction, ranging from ALL, to selected individuals based on a number of optional criteria:  Top <n> - only the top individual are displayed, based on fitness score. This can have a deleterious effect on diversity,  Banding - using a normal sized population, split into (N) bands (where N is a suitable size to present) across the fitness spectrum. Display one item (at random) from each Band, and then use the input User's score to scale the original band scoring  Partial Sequential - use a normal sized population but select only some by choosing every nth item in fitness order. User scores these ones, system scores the remaining.  Partial Random - use a normal sized population, and select (N) at random for the user to score. Rest scored by the system. The last three attempt to maintain diversity, whilst allowing the user to have some effect (but not completely). It was shown (Shackelford & Corne, 2005) that the User often makes mistakes, or loses concentration - so it is useful to have the machine scoring in parallel. Expanded SMILES SMILES is a standard (developed by Daylight Systems) for specifying a molecular formula as a simple linear string. This format (in itself) does not contain enough information for the algorithm's Crossover and Mutation operators, so the system uses an "Expanded SMILES" notation - which can easily be converted to standard SMILES for use with the Chemaxon function library. The rules for generating Expanded SMILES are as follows: All atoms (apart from Hydrogen) to be specified within square brackets: [C] All bonds to be entered explicitly: [C]-[N], [C]=[O], [C]#[N] where "-" is single, "=" is double and "#" is triple Hydrogen atoms to be explicitly added as required inside their bonded atom [XH], followed by number unless 1: [CH2], [OH] All branches ending in zero valence to be entered within round brackets (): [C](=[O])-[C]([F])(=[O]) Ring indication numbers must be shown with curly brackets: [C](-[O]-{1})(=[CH]-[C](=[N]-{1})[OH] Ring indicators must also include the bond symbol (-, =, #) References [1] Genetic Algorithm for the design of molecules with desired properties Kamphausen, Holtge et al, J. of Computer-Aided Molecular Design, 16: 551-567, 2002 [2] A genetic algorithm for structure-based de novo design Pegg, Haresco, Kuntz J. of Computer-Aided Molecular Design, 15: 911-933, 2001 [3] Evolving molecules for drug design using Genetic Algorithms via molecular trees Goh and Foster Proc. of the Genetic and Evolutionary Computation Conference GECCO, 27-33, 2000 [4] Neural Networks and genetic algorithms in drug design Terfloth and Gasteiger DDT Genomics Supplement, Vol 6, No. 15, 102-108, 2001 [5] A genetic algorithm for the automated generation of small organic molecules Douguet, Thoreau and Grassy J. of Computer-Aided Molecular Design, 14: 449-466, 2000 [6] Genetic Programming in Data Mining for Drug Discovery Langdon and Barrett Evolutionary Computing in Data Mining (Ghosh and Jain), 211-235, 2004 [7] Genetic programming for computational pharmacokinetics in drug discovery and development Archetti etc al Genetic Program Evolvable Mach 8: 413-432, 2007 [8] Evaluation of Mutual Information and Genetic Programming for Feature selection in QSAR Venkatraman et al. J. Chem. Inf. Comp, Sci 44: 1686-1692, 2004 [9] Automatic molecular design using evolutionary techniques Globus, Lawton and Wipke Nanotechnology 10: 290-299, 1999 [10] Evolutionary and genetic methods in drug design Parrill DDT Vol 1, 12: 514-521, 1996 [11] Advances in the application of machine learning techniques in drug discovery, design and development Barrett and Langdon WSC10: Soft Computing in Industrial Applications, 2005 [12] Optimization algorithms and natural computing in drug discovery Solmajer and Zupan Drug Discovery Today Vol 1, 3: 247-252, 2004 [13] Evolutionary Algorithms in drug design Lameijer, Back et al. Natural Computing 4: 177-243, 2005 [14] The Molecule Evoluator: an interactive evolutionary algorithm for designing drug molecules. Lameijer, Back et al. GECCO’05 1969-1976, 2005 [15] Genetic Programming for drug discovery Langdon Tech Report CES-481 (ISSN: 1744-8050), 2008 [16] Genetic programming applied to pharmaceutical drugs design Werner and Fogarty th 7 SIGKDD Int. Conf. Knowledge Discovery, San Francisco, 2001 [17] Evolutionary Algorithms for automated drug design towards target molecule properties Kruisselbrink, Back et al GECCO’08, 1555-1562, Atlanta 2008 [18] Drug Guru: A computer program for drug design using medicinal chemistry rules. Stewart, Shiroda and James Bioorganic & Medicinal Chemistry 14: 7011-7022, 2006 [19] Molecular Evolution: Automated manipulation of hierarchical chemical topology and its application to average molecular structures Nachbar Genetic Programming and Evolvable Machines, 1: 57-95, 2000 [20] A drug candidate design environment using evolutionary computation Ecemis, Wikel et al. IEEE Trans. Evolutionary Computation, 591-603, 2008 [21] Genetic algorithms in chemometrics and chemistry: a review Leardi Journal of Chemometrics 15: 559-569, 2001 [22] Evolutionary combinatorial chemistry: application of genetic algorithms Weber DDT Vol 3. No 8, 379-385, 1998 [23] Molecular optimization using computational multi-objective methods Nicolaou, Brown and Pattichis Current Opinion in Drug Discovery and Development 10(3): 316-324, 2007 [24] Genetic algorithm optimization in drug design QSAR… Fernandez et al Mol Divers 15:269-289, 2011 [25] Evolutionary computation in bioinformatics: A review Pal, Bandyopadhyay and Ray IEEE Trans on Systems, Man and Cybernetics 36, 5:601-615, 2006 [26] Drug design via novel directivity genetic algorithm and Lyapunov principle Chung et al Int. Jour. Of Innovative Computing (ICIC) 5(6), 2006 [27] Computer aided molecular design with combined molecular modelling and group contribution Harper et al. Fluid Phase Equilibria 158-160: 337-347, 1999 [28] Techniques for the design of molecules and combinatorial chemical libraries Sedwell and Parmee CEC 2007, 2435 – 2442, 2007 [29] Drug discovery: Exploring the utility of cluster oriented genetic algorithms in virtual library design Parmee, Sedwell et al IEEE Congress on Evolutionary Computation 1: 668-675, 2005 [30] Evolutionary Algorithms for automated drug design Kruisselbrink MsC Thesis, University of Leiden, 2008 [31] Experimental and computational approaches to estimate solubility and permeability in drug discovery and development settings Lipinski et al Advanced Drug Delivery Reviews, 46: 3-26, 2001 [32] Fragment based de novo ligand design by multi-objective evolutionary optimization Dey and Caflisch J. Chem. Inf. Model 48: 679-690, 2008 [33] Applying computational modelling to drug discovery and development Kumar et al DDT Vol 11 Reviews: 806-811, 2006 [34] Computational approaches for fragment-based and de novo design Loving, Alberts and Sherman Current Topics in Medicinal Chemistry 10: 14-32, 2010 [35] Computational systems biology in drug discovery and development: methods and applications Materi and Wishart DDT 12: 295-303, 2007 [36] Designing combinatorial libraries optimized for multiple objectives Gillet Methods in Molecular Biology, 275: 335-354, 2004 [37] Computer based de novo design of drug-like molecules Schneider and Fechner Nature Reviews: Drug Discovery, 4: 649-663, 2005 [38] Designing active template molecules by combining computational de novo design and human chemist’s experience Lameijer et al. Jour Medicinal Chemistry 50(8): 1925-1932, 2007 [39] Chemoinformatics – an emerging field for computer aided drug design Shukia et al Jour Biotechnology Letters 1(1): 10-14, 2010
9cs.NE
arXiv:1209.4559v3 [math.AC] 25 Oct 2013 On generalized series fields and exponential-logarithmic series fields with derivations. Mickaël Matusinski ∗ October 29, 2013 Abstract We survey some important properties of fields of generalized series and of exponential-logarithmic series, with particular emphasis on their possible differential structure, based on a joint work of the author with S. Kuhlmann [KM12a, KM11]. 1 Introduction on generalized series fields Definition 1.1 [Generalized series and their natural valuation] Let k be a field and Γ be a totally ordered Abelian group. A generalized series with coefficients in k and exponents in Γ is a map a : Γ → k, denoted by : X a= aα t α α∈Γ with its support Supp a := {α ∈ Γ | aα , 0} that is well-ordered. We denote by k((Γ)) the set of generalized series, which is actually a field when endowed with the componentwise sum and (the straightforward generalization of) the convolution product. The canonical valuation on k((Γ)) is: v : k((Γ)) → Γ ∪ {∞} a 7→ min(Supp a) 0 7→ ∞ Since Γ is an ordered group, one can define on it the Archimedian equivalence relation : ∀α1 , α2 ∈ Γ, α1 ∼+ α2 ⇔ ∃n, n|α1 | ≤ |α2 | and n|α2 | ≤ |α1 | ∗ The author thanks Salma Kuhlmann for reading a preliminary version of this paper and providing helpful comments. He thanks also the referee of the journal Order for having corrected several mistakes and provided interesting comments, in particular for having suggested the statement of Theorem 2.5. 1 and the corresponding set Φ of Archimedian equivalence classes φ := [γ] for γ ∈ Γ. The set Φ inherits naturally a total order ≤ from the one of Γ: φ1 = [α1 ] ≤ φ2 = [α2 ] ≤ ∞ := [0] ⇔ 0 ≤ |α2 | ≤ |α1 |. The order type of Φ is called the rank of Γ, and as well the rank of k((Γ)). Generalized series are ubiquitous objects in mathematics. They generalize the classical field of Laurent series (Γ = Z), and Puiseux series form a subfield of k((Γ)) for Γ = Q. A few years after the pioneering work of Veronese and Levi-Civita on infinite and infinitesimal numbers [Ver91, LC94, LC98], H. Hahn introduced in [Hah07] the generalized series in the case where k = R, along the proof of his embedding theorem for (totally) ordered Abelian groups: Theorem 1.1 (Hahn’s embedding) Any ordered Abelian group is order isomorphic to a subgroup of the Hahn group over the divisible hull of its skeleton (see Section 2). To quote Hahn himself (p. 614-615, translated by ourselves): “ We want to show that to the sizes in an arbitrary non Archimedian system of orders of magnitude, in unambiguous way symbols can be assigned of the form X a γ eγ where aγ means a real number, eγ are symbols for a ranking (“units") and summation applies to well-ordered amounts." For a survey on this topic, we recommend [Ehr95]. Almost at the same time, G.H. Hardy published his monograph enhancing P. Du Bois-Reymond’s work on orders of infinity [Har10]. The central question that this work addresses is: even though orders of growth of real functions have no bound (by Du Bois-Reymond’s results), can we find asymptotic scales to describe them ? With the field of logarithmic-exponential functions, Hardy provides an important example of such a generalized asymptotic scale. It is what is called now a Hardy field (see [Bou76, Section V, Appendix] and below). In his seminal article [Kru32], W. Krull provides a common framework for these works, and many others: abstract valuation theory. Recall that, given a valued field, an immediate extension of it is an extension of valued field with same valued group and residue field. In [Kru32, Section 13], fields of generalized series are key examples of maximally valued fields - i.e. fields which admit no proper immediate extension with any given value group and residue field. Note that Krull proves in the same article that any valued field possesses an immediate maximally valued extension, and puts the following crucial question (see the end of Section 13): “Under which conditions a maximal extension of a given valued field may be viewed as a generalized series field?" The answer for valued fields having same characteristic as its residue field is given by Kaplansky in [Kap42a, Kap42b] almost ten years after. Recall that two valued fields are said to be analytically isomorphic if there exists a value preserving isomorphism between them. More precisely: 2 Theorem 1.2 (Kaplansky’s embedding) In the equal characteristic case, every valued field is analytically isomorphic to a subfield of a suitable generalized series field “Suitable" means that in certain cases, one might need factor sets to express the multiplication rule for monomials of the generalized series. But in the context we are interested in (real closed or algebraically closed zero characteristic residue field), these are not needed. Note that there is also a result for the mixed characteristic case, that we leave aside since we are mostly interested in the zero characteristic for differential structures. Just keep in mind that generalized series are not less represented in number theory (see e.g. [Sch37, Poo93, Ked01b, Ked01a, MR93, Ber00]) For the same reason, we will not detail the various results for what are called now Mal’cev-Neumann series [Neu49, Mal48] (when k is only supposed to be a ring, and Γ is not necessarily commutative) (see e.g. [Rib95, Rib97]). As for the classical formal power series, generalized series have great algebraic properties [Rib92]. E.g., they are always Henselian valued fields. If Γ is divisible and k is real closed, respectively algebraically closed, then so is k((Γ)). As wrote S. Maclane [Mac39]: generalized power series are universal as valued fields. In topological terms, a valued field (K, v) is an ultrametric space. In this context, generalized series fields are spherically complete: the intersection of any decreasing sequence of balls is nonempty. This holds if and only if every pseudo-Cauchy sequence in K has a pseudo limit in K, which means that the field K is maximally valued. In a spherically complete space, many of the classical results of functional analysis hold, as the Hahn-Banach, Banach-Steinhaus and Open Mapping Theorems [Sch02]. In particular, one has a Banach Fixed Point Theorem [PCR93, Kuh11]. At the interplay between model theory and geometry sits the order minimal or ominimal geometry, a generalization of semialgebraic and subanalytic geometry [vdD98]. There, generalized series provide non standard models for various o-minimal theories, like certain expansions of the field of real numbers: by the power functions corresponding to a subfield of the reals [Mil94]; by the global real exponential function possibly with restricted analytic functions [Wil96, vdDMM94] ; by solutions of Pfaffian differential equations [Spe99]. Concerning the o-minimal theory with the global exponential function, there are several similar constructions of non standard models of it based on generalized series: see Section 5 and [vdDMM97, Kuh00, vdH06] for details. Moreover, generalized series are themselves used to build other o-minimal structures, by expanding the field of reals by multisummable series [vdDS00], by convergent generalized series [vdDS98]. O-minimality tells us that the definable subsets of the structure have finitely many connected components, justifying the tameness of such geometry in the sense of [Gro97]. Other important tameness results about differential equations may be put in parallel: the proof of the Dulac conjecture (finiteness of the number of limit cycles of a planar polynomial vector field: Hilbert 16th problem, part 2) using transseries (see [É92, vdH06] and Section 5 below); the desingularization result for 3-dimensional real analytic vector fields in [CMR05] using rank 1 generalized series. 3 In o-minimal geometry as for differential equations, another important algebraic object is omnipresent: the Hardy fields, i.e. fields of germs at +∞ of real functions closed under differentiation. As the germs in such a field are non oscillating, they carry a total order and therefore the corresponding natural convex valuation (the valuation ring is the convex hull of the constant functions), so they are valued differential fields i.e. fields equipped with a valuation and a derivation. Moreover, there are specific connections between the derivation and the valuation: the valuation is differential with a certain principle (*) [Ros80, p.303 and 314]. This means exactly with our terminology that the derivation is a Hardy type derivation (Definition 3.1). Hardy fields are key tools for the study of asymptotic problems. For examples, take R(x) or R(xR , exp(x)R ) or the above cited Hardy’s log-exp functions. Also, for any o-minimal structure over R, the germs at +∞ of unary definable functions form a Hardy field [AvdD05a]. As another important example, in the context of an isolated singularity of a real analytic vector field, take the field of meromorphic functions evaluated on a germ of non oscillating integral curve [CMR05]. Hardy fields may also be generated by adjoining to a given Hardy field certain solutions of differential equations [Ros83a, Ros95, Kuh11, PCR04]. Note that by [Bos86] there exist also infinite rank Hardy fields that are not exponentially bounded, i.e. for which any element is bounded by some iterate of exp. In [AvdD02, AvdD05b], the authors have resumed and enhanced the valuation theoretic approach of M. Rosenlicht in the context of ordered differential fields: the notion of H-fields is an axiomatized version of Hardy fields, as well as is the notion of valued field with a Hardy type derivation. More precisely, the derivation in such H-fields is of Hardy type (see (HF1), (HF2) following Definition 3.1). For a nice survey on these topics, see [AvdD05a]. How far can one push the connection between Hardy fields and generalized series fields ? For instance, we showed in [Mat11] that one can solve differential equations over finite rank generalized series similarly as over finite rank Hardy fields. In [vdDMM01, Corollary 3.12], the authors prove that the infinite rank Hardy field of the above cited o-minimal structure Ran,exp (the field of reals expanded by the global exponential and restricted analytic functions [vdDMM94]) embeds as ordered differential field into the field of logarithmic-exponential series. Recently, J. van der Hoeven introduced in [vdH09] the notion of a transserial Hardy field, namely a Hardy field which is differentially order isomorphic to a subfield of the field of transseries. There he proves [vdH09, Theorem 9] [AvdDvdH12, Theorem 1.1] that : the field of transseries that are differentially algebraic over R is isomorphic as ordered differential field to some Hardy field. Even more recently 1 , M. Aschenbrenner, L. van den Dries and J. van der Hoeven state the following result for H-fields - so in particular for Hardy fields - [AvdDvdH12, Theorem 4.1]: every real closed H-field has an immediate maximally valued H-field extension. Recall that the derivation in an H-field is a derivation of Hardy type (3.1). By Kaplansky’s embedding Theorem 1.2, this implies that: Theorem 1.3 Any H-field is analytically and differentially isomorphic to a subfield of a suitable field of generalized series endowed with some Hardy type derivation. 1 The author thanks Matthias Aschenbrenner for having indicated him this preprint 4 The authors assert that the derivation on such differential maximally valued immediate extension needs not be unique (see the proof of their Proposition 5.4), whereas the extension is unique as a valued field by Kaplansky’s work. Now follows an important question: what kind of derivation can we expect for the generalized series field? For generalized series, one may not only require the derivation to mimic the valuative properties of the derivation in a Hardy field. One may expect the derivation to behave the same way as the derivation for the classical formal power series: commutation with infinite sums, real powers go to the coefficients. This is what we call a series derivation: see Definition 2.2. Note also that Theorem 1.3 does not say anything about immediate maximally valued extensions of Hardy field within the class of Hardy fields: it says that any Hardy field admits an immediate maximal H-field extension. In fact, as far as the author knows, there is no example of a maximally valued Hardy field. Together with S. Kuhlmann, we propose the following conjecture, problem and questions: Differential Kaplansky embedding conjecture for Hardy fields. Any Hardy field is analytically and differentially isomorphic to a subfield of a suitable generalized series field endowed with a series derivation of Hardy type. Differential Kaplansky embedding problem. Describe which valued differential fields are analytically and differentially isomorphic to a subfield of a suitable generalized series field endowed with a series derivation of Hardy type. Question 1. On what subfield of a generalized field is it sufficient to define a series derivation of Hardy type to ensure that it extends uniquely ? In particular, does the series derivation of Hardy type naturally defined on the field of transseries (grid-based or well-ordered; see Section 5) extends uniquely to the maximally valued extension ? Question 2. Can we obtain the same result as in Theorem 1.3 for valued field endowed with a Hardy type derivation (Definition 3.1) ? Or with a differential valuation in the sense of Rosenlicht (only axioms (HD1), (HD2) of 3.1) ? In the following Sections 2 and 3, the author will survey the results in [KM12a] describing how to endow generalized series fields with such series derivations of Hardy type. In the case where the generalized series field is ordered, it can thus be endowed with a H-field structure. This has already been done in [AvdD05b, Section 11] in the particular case of a value group Γ divisible with a property called (*) (i.e. admitting a valuation basis in [Kuh00]) and carrying an asymptotic couple in the sense of [Ros81]. In [KM11] we continued our study in the case of exponential-logarithmic series fields in the sense of [Kuh00] (see Sections 4 and 5), to provide a large family of exponential H-fields. This has already been done for LE-series field and certain transseries fields: see Section 5 and [vdDMM97, Kuh00, vdH06] for details. Remark 1.2 As will be shown in the next section, such series derivation for generalized series is determined by the definition of the logarithmic derivatives of a certain family of (generalized) monomials. Consider a Hardy field H. Any Kaplansky embedding (1.2) f : H → k((Γ)) of H seen as a valued field will fix these monomials and their logarithmic derivatives. So, the derivation δ := f ◦ d on f (H) inherited from the 5 derivation d on H extends uniquely to a series derivation on k((Γ)). So, another way of formulating our conjecture is: Differential Kaplansky embedding conjecture version 2 For any Hardy field H, there is a Kaplansky embedding (1.2) f : H ֒→ k((Γ)) such that the resulting derivation on f (H) lifts to a Hardy type series derivation on k((Γ)). 2 What kind of derivations for generalized series ? We follow the ideas in [KM12a, KM11], but with additive notations as for the classical Krull valuations. By a derivation on a field K, we mean a map d : K → K which is linear and verifies the Leibniz rule : d(ab) = d(a)b + ad(b). The derivation for the usual power series verifies two further key properties :   X  X n  • it commutes with infinite sums d  an x  = an d(xn ); n n • it generalizes the Leibniz rule to real powers d(xα ) = αxα−1 d(x) = αxα d(x)/x, with in particular d(1) = 0. How can we generalize these properties to the case of our fields k((Γ)) ? If we impose that d is strongly linear, that is:   X α  X  d  aα t  = aα d(tα ), α α two questions arise: 1. how do we define d(tα ), α ∈ Γ, where Γ is an arbitrary ordered Abelian group ? X 2. how do we ensure that aα d(tα ) is itself well-defined and in k((Γ)) ? α To answer question 1, we will apply the above cited Hahn’s embedding theorem (1.1). To any totally ordered (non trivial) Abelian group (Γ, ≤), one can associate its skeleton [Φ, (Aφ )φ∈Φ ] as follows. As before Φ denotes the ordered set of all Archimedian equivalence classes. The map vΓ : Γ → Φ ∪ {∞} defined by vΓ (α) := [α] = φ is the corresponding natural valuation on Γ (as ordered group). To any value φ ∈ Φ corresponds two subgroups of Γ: Cφ := {α ∈ Γ | vΓ (α) ≥ φ} and Dφ := {α ∈ Γ | vΓ (α) > φ}, with the following properties: • Dφ ( C φ ; • (0) ⊂ · · · Dφ ( Cφ · · · ⊂ Γ forms the chain of isolated subgroups of Γ; • Aφ := Cφ /Dφ is an Archimedian group, and therefore is (order isomorphic to) some subgroup of R (Hölder’s theorem). 6 The groups Aφ , φ ∈ Φ, are usually called the ribs and Φ the spine of Γ. Given X a skeleton [Φ, (Aφ)φ∈Φ ], one can always build the corresponding Hahn group, say Aφ . For any φ ∈ Φ, consider its index map 1φ : Φ → {0, 1}, φ−1 (1) = {φ}. An φ∈Φ X X element of Aφ is a formal sum αφ 1φ with αφ ∈ Aφ , φ ∈ Φ, and the support φ∈Φ φ∈Φ supp α := {φ | αφ , 0} that is well-ordered. The group law is the componentwise sum and the total ordering is lexicographical. We can give now a more precise version of Theorem 1.1 (see e.g. [Fuc63], [Gla99, Theorem 4.C] or [Kuh00, Theorem 0.26]). Theorem X 2.1 (Hahn’s Embedding) (Γ, ≤) embeds as an ordered group in the Hahn group Aφ where Aφ is the divisible closure of Aφ in R (i.e. the rational vector φ∈Φ subspace of R generated by Aφ ). Note that the ordering of an ordered group extends uniquely to its divisible X closure. Aφ , which From now on, we consider Γ as a subgroup of a given Hahn group φ∈Φ X X is itself a subgroup of R. So, any element α ∈ Γ is written α = αφ 1φ , and φ φ∈Φ vΓ (α) = min(supp α) ∈ Φ ∪ {∞}. Returning to the generalized series field k((Γ)), we write the generalized monomials as: Y α P tφ := t1φ and tα = t φ αφ 1φ := tφ φ . φ The multiplication rule is componentwise, and we will also speak of the support supp tα of such formal product: supp tα := supp α = {φ | αφ , 0} which is well-ordered in Φ. Note that, in the case where the sum and the product are finite, one has a true equality P Q αφ φ αφ 1φ = φ tφ between elements of k((Γ)). Now we define the derivative of tα , by imposing that it verifies a strong Leibniz rule, that is: X d(tφ ) αφ d(tα ) = tα with in particular d(t0 ) = d(1) := 0. t φ φ Subsequently, three new questions arise: 3. how do we define d(tφ ) for φ ∈ Φ, with Φ being an arbitrary ordered set ? 4. how do we make sense of αφ as coefficient in the series ? X d(tφ ) 5. how do we ensure that αφ is itself well-defined and in k((Γ)) ? tφ φ To answer question 3, one can set d(tφ ) ∈ k((Γ)). In other words, one can pick a priori any map d : Φ̃ → k((Γ))\{0} where Φ̃ := {tφ , φ ∈ Φ}. To answer question 4, we need to impose that αφ ∈ k for any α ∈ Γ and φ ∈ Supp α ⊂ Φ. In other words, k has to contain the union of the groups Aφ in R. For simplicity, one can take k = R (as we did in [KM12a, KM11]) or k = C. 7 Example 2.1 [The finite rank case] In the finite rank case, say rank r for some r ∈ N, the given answers to questions 3 and 4 also solve questions 2 and 5. Indeed, write any element α ∈ Γ as tα = t1α1 t2α2 · · · trαr , and for any a ∈ k((Γ)):   X α   d(a) = d  aα t  Xα = aα d(tα ) (by strong linearity) α ! X d(tr ) d(t1 ) + · · · + αr (by strong Leibniz rule) = aα tα α1 t1 tr α d(t1 ) X d(tr ) X = (aα α1 )tα + · · · + (aα αr )tα t1 α tr α So d(a) is well-defined whatever value in k((Γ)) we choose for the d(ti ) ’s. ti It remains to answer questions 2 and 5 in the infinite rank case. Definition 2.2 We call series derivation on k((Γ)) any derivation d on k((Γ)) that is strongly linear (solving question 2) and that verifies a strong Leibniz rule (solving question 5). Thus the problem consists in finding a criterion on the map d : Φ̃ → k((Γ)) so that the formulas in questions 2 and 5 involve always summable families of series. A family of series is said to be summable if the union of their support is well-ordered and if for any value in this union there are only finitely many series which have that value in their support. The desired criterion is stated and proved in [KM12a, Theorem 3.7], using Ramsey’s theory type arguments [Ros82, Exercise 7.5, p. 112]: see Theorem 2.3. Since this criterion is technical, firstly we consider for simplicity a particular case for which series derivations can be explicitly built. We suppose also for simplicity that Aφ = R for any φ ∈ Φ. Definition 2.3 A map σ : Φ → Φ is said to be a right shift if it is order preserving and for any φ ∈ Φ, σ(φ) > φ. Theorem 2.2 Suppose that Φ carries a right shift σ : Φ → Φ. Define d : Φ̃ → k((Γ)) by: Y θ d(tφ ) := tθφ = tσφ,n n (φ) tφ n≥1 where θφ,n ∈ R with in particular θφ,1 < 0. Then d extends to a series derivation on k((Γ)) via strong Leibniz rule and strong linearity. Y α Proof. Consider a monomial tα = tφ φ for some α ∈ Γ and apply the strong Leibniz φ∈Φ rule to compute its derivative: 8 d(tα ) = = d(tφ ) tφ φ∈Φ X Y θ α t αφ tσφ,n n (φ) tα X φ∈Φ αφ n≥1     Y θ  Y θ  φ,n ψ,n Note that, for any φ < ψ, θφ = v  tσn (φ)  < v  tσn (ψ)  = θψ since σ(φ) < σ(ψ) and n≥1 n≥1 θφ,1 < 0. Therefore, the support of the sum in the right hand expression is well-ordered as well as the support X of α: we obtain a well defined series in k((Γ)). Consider a series a = aα tα and apply the strong linearity to compute its derivative: α∈Γ d(a) = X = X aα d(tα ) α∈Γ = X d(tφ ) aα t α αφ tφ α∈Γ X φ∈Φ X α+θφ aα αφ t α∈Γ φ∈Φ Suppose that the family (aα αφ tα+θφ ) in the right hand sum is not summable, say there is a decreasing sequence (αn + θφn )n∈N . Since Supp a is well-ordered, the sequence (αn )n∈N is increasing, non ultimately stationary. So we would have for infinitely many n: 0 < αn+1 − αn ≤ θφn − θφn+1 The corresponding sequence (φn )n∈N is strictly decreasing. So there exists n2 ∈ N such that φn2 < supp α1 . So φn2 ∈ supp (αn2 − α1 ), which implies that vΓ (αn2 − α1 ) ≤ φn2 . But, by construction, we have vΓ (θφ1 − θφn2 ) = σ(φn2 ) > φn2 . This is in contradiction with the fact that 0 < αn2 − α1 ≤ θφ1 − θφn2 .  Note that we could have built other derivations by choosing a more complicated formula for d(tφ )/tφ , for instance a two monomials expression: Y θ Y τ d(tφ ) := tθφ + tτφ = tσφ,n tσφ,n n (φ) + n (φ) tφ n≥1 n≥1 with θφ < τφ < 0. In this case, for any φ1 < φ2 we have θ1 < θ2 and τ1 < τ2 . We also have vΓ (θ1 − θ2 ) > φ1 , vΓ (τ1 − τ2 ) > φ1 , vΓ (θ1 − τ2 ) > φ1 and vΓ (τ1 − θ2 ) > φ1 . In fact, in the general case when d(tφ ) ∈ k((Γ)), the same ingredients as in the preceding proof apply provided the fact that, roughly speaking, for almost all φ1 < φ2 : • the right shift σ lifts to a right shift between corresponding elements of Supp and Supp d(tφ2 ) . tφ2 9 d(tφ1 ) tφ1 • for almost all τ1 ∈ Supp d(tφ2 ) d(tφ1 ) and τ2 ∈ Supp , we have vΓ (τ1 − τ2 ) > φ1 . tφ1 tφ2 The precise criterion is as follows [KM12a, Theorem 3.7]: Theorem 2.3 A map d : Φ̃ → k((Γ))\{0} extends to a series derivation on k((Γ)) via strong Leibniz rule and strong linearity if and only if both of the following conditions hold: (C1) for any strictly increasing sequence (φn )n∈N ⊂ Φ and any sequence (τn )n∈N ⊂ Γ d(tφn ) , then (τn )n∈N cannot be decreasing (i.e. there is with for any n, τn ∈ Supp tφn N ∈ N such that τN+1 > τN ). (C2) For any strictly decreasing sequences (φn )n∈N ⊂ Φ and (τn )n∈N ⊂ Γ such that for d(tφn ) any n, τn ∈ Supp , there is N ∈ N such that vΓ (τN+1 − τN ) > φN+1 . tφn Example 2.4 We illustrate (2.3) by the following basic example. Consider the Hardy field of germs at +∞ of real functions H = R(log(x)R , xR , exp(x)R ), which can be viewed also as a subfield of a field R((Γ)) of generalized series of rank 3, with e.g. t1 = exp(−x), t2 = 1/x, t3 = 1/ log(x) and Γ = R ×lex R ×lex R. As an illustration of this embedding, take for instance the germ of 1/(exp(x) − x) = exp(−x)/(1 − exp(−x)x). P P It goes to t1 /(1 − t1 t2−1 ) = t1 n∈N t1n t2−n = n∈N t1n+1 t2−n since one has that v(t1 t2−1 ) > (0, 0, 0), or equivalently lim x→+∞ exp(−x)x = 0. Note that, for any n ∈ N>0 , 0 < t1n < t2n < t3n < R for the ordering in H corresponding to (0, 0, 0) < nv(t3 ) = (0, 0, n) < nv(t2 ) = (0, n, 0) < nv(t1 ) = (n, 0, 0) < ∞ in Γ and φ1 = vΓ (v(t1 )) = [(1, 0, 0)] < φ2 = vΓ (v(t2 )) = [(0, 1, 0)] < φ3 = vΓ (v(t3 )) = [(0, 0, 1)] < ∞ for the Archimedian equivalence classes of Γ. We compute in H:   d(t1 ) = − exp(−x) = −t1 with support {(1, 0, 0)}     −1    d(t2 ) = = −t22 with support {(0, 2, 0)}  x2    −1    = −t2 t32 with support {(0, 1, 2)}  d(t3 ) = x(log(x))2 10  d(t1 )       t1      d(t2 )    t2    d(t3 )      t 3 = = = −1 −1 x −1 x log(x) with support {(0, 0, 0)} = −t2 with support {(0, 1, 0)} = −t2 t3 with support {(0, 1, 1)} ! ! d(t2 ) d(t3 ) Consider for instance t2 and t3 . One has that v = (0, 1, 0) < (0, 1, 1) = v t2 t3 and their difference equals (0, 0, 1): vΓ (0, 0, 1) = φ3 which is indeed bigger than φ2 in Φ. Our criterion in (2.3) permits to build families of series derivations for a large class of generalized series fields [KM12a, Section 5]. Moreover we will be able to obtain in certain cases series derivations of Hardy type, as will be shown in (3.2). One of the central notions in such explicit constructions of derivations is the one of right-shift as is already illustrated in Theorem 2.2. This notion was already central in the construction of pre-logarithms on generalized series fields: see Section 4 and [Kuh00] for details. 3 On Hardy type series derivations Definition 3.1 Let (K, v, d) be a valued differential field. Denote by Ov the valuation ring and mv its maximal ideal. The derivation d : K → K is said to be a Hardy type derivation if : (HD1) Ov = ker d + mv ; (HD2) d verifies l’Hospital’s rule: ∀a, b ∈ K\{0} with v(a) , 0 and v(b) , 0, v(a) ≤ v(b) ⇔ v(d(a)) ≤ v(d(b)). (HD3) the logarithmic derivation is compatible with the valuation: ∀a, b ∈ K ! ! d(b) d(a) ≤v |v(a)| > |v(b)| > 0 ⇒ v b ! !a d(b) d(a) =v ⇔ v(a) ∼+ v(b) with: v a b Axioms (HD1) and (HD2) are those which define a differential valuation in the sense of M. Rosenlicht ([Ros80, Definition p. 303]). Axiom (HD3) corresponds to the Principle (*) in [Ros81, p. 992]. This principle is itself an abstract version of properties obtained in [Ros83b, Propositions 3 and 4] and [Ros80, Principle (*) p. 314] in the context of Hardy fields. Note that these axioms hold for fields that are not necessarily ordered, whereas H-fields (see below) and Hardy fields are. As M. Rosenlicht does, we believe that the tools we develop here may be used in the more general context of valued differential fields: see the various examples in [Ros80], in particular Example 2 and 10. The question we want to address here is: 11 How can we endow k((Γ)) with a Hardy type series derivation ? As we showed in [KM12a, Theorem 4.3 and Corollary 4.4], the answer depends only on the values v(d(tφ )/tφ ), say θφ , φ ∈ Φ: Theorem 3.1 A series derivation d on k((Γ)) verifies (HD2) and (HD3) if and only if the following condition holds:   (H3) ∀φ1 , φ2 ∈ Φ, φ1 < φ2 ⇒ θφ1 < θφ2 and vΓ θφ1 − θφ2 > φ1 . In this case (HD1) holds with k = ker d. In other words, for the given hypothesis, the corresponding  map φ 7→ θφ is order preserving and the maps θφ1 7→ θφ2 and φ1 7→ vΓ θφ1 − θφ2 are right-shifts. As an illustration, consider the example in (2.4). Concerning ordered differential fields, in [AvdD02] is developed the notion of Hfield which generalizes the one of Hardy field. An H-field is an ordered field (denote by v the natural convex valuation on it) endowed with a derivation d : K → K such that: (HF1) Ov = ker d + mv ; (HF2) for any f ∈ K>0 , v( f ) < 0 ⇒ d( f ) > 0. Note that (HD1) is (HF1). Properties (HD2) and (HD3) also hold for H-fields [AvdD02, Lemma 1.1 and 2.2]. In the case where k is ordered, one can order k((Γ)) lexicographically, so that the valuation ring k[[Γ≥0 ]] is the convex hull of k. Suppose that k((Γ)) is endowed with a series derivation d of Hardy type. In this context: k((Γ)) is an H-field if and only if for any φ ∈ Φ, coefficient of d(tφ ) < 0, that is, the leading tφ d(tφ ) is negative. tφ Indeed, for any series a > 0 with v(a) < 0, denote a = aα tα + · · · where v(a) = α and aα > 0. Denote vΓ (α) = φ and the coefficient of 1φ in α by α0 . Note that α0 < 0 since v(a) = α < 0. By the strong linearity, the strong Leibniz rule and (H3), we have: ! d(tφ ) + · · · + d(· · · ) (1) d(a) = aα d(tα ) + d(· · · ) = aα tα α0 tφ So d(a) has same sign as − d(tφ ) d(tφ ) . Thus, d(a) > 0 as required in (HF1) iff < 0. tφ tφ Example 3.2 We use theorems 2.3 and 3.1 to build general examples of series derivations of Hardy type on k((Γ)). If we restrict our attention to the value θφ = v(d(tφ )/tφ ), then (H3) tells us that the map φ 7→ θφ has to be a section of Φ in Γ. It says also that for any φ1 < φ2 , the principal parts of θφ1 and θφ2 up to the component 1φ1 have to be identical. This can be achieved easily in the following cases. We leave the verifications to the reader. 12 • If Φ admits a right-shift σ : Φ → Φ, then for any φ pick θφ ∈ Γ<0 such that d(tφ ) vΓ (θφ ) = σ(φ) (see e.g. Theorem 2.2) and set for example = cφ tθφ for artφ bitrary cφ ∈ k. This includes for example the cases where Φ carries the structure of an ordered group, or where Φ is a limit ordinal. • If Φ has a biggest element φ0 and carries a right-shift σ : Φ \ {φ0 } → Φ then we can set the θφ ’s and the logarithmic derivatives as before, just completing the definition for φ0 by setting θφ0 := 0. This includes for example the cases where Φ is a successor ordinal or where Φ is isomorphic to an interval of R with greatest element. As a prolongation of [KM12a, Section 5.1], in [KMS13, Example 6, case 2] we treat completely the case of subsets of R. Note that this includes any countable wellordered, reverse well-ordered or more generally scattered set (they all embed into Q). It includes also the case of some tricky dense subsets of R as the Dushnik-Miller example (a dense subset of R that admits no non trivial self-embedding). We invite the reader to read through [Ros82] for the various references and classical results. For simplicity we suppose for the rest of this section that Aφ = R for any φ ∈ Φ. Proposition 3.2 Let Φ be isomorphic to a subset S of R. Then k((Γ)) carries a series d(tφ ) is a monomial. derivation of Hardy type such that for any φ ∈ Φ, tφ Proof. Suppose that Φ has a greatest element φ0 and consider an isomorphism s : Φ → S ⊂ Aφ0 = R. For any φ ∈ Φ pick some element θφ = s(φ)1φ0 of Γ and set for d(tφ ) s(φ) = cφ tθφ = cφ tφ0 where cφ ∈ k. Note that vΓ (θφ0 ) = φ0 . example tφ Suppose that Φ has no greatest element. Then choose a sequence (φn )n∈N>0 of elements of Φ cofinal in Φ, and set φ0 := inf Φ. The intervals (φn , φn+1 ] ⊂ Φ form a partition of Φ (i.e. they cover Φ without overlapping). Fix a corresponding family of isomorphisms sn : (φn−1 , φn ] → S n ⊂ Aφn+1 = R. For any φ ∈ (φn−1 , φn ] pick some element θφ = d(tφ ) (φ) = cφ tθφ = cφ tφsnn+1 · · · where cφ ∈ k.  sn (φ)1φn+1 + · · · of Γ and set for example tφ Remark 3.3 In the second part of the preceding proof, we could have chosen a family of isomorphisms sn : (φn−1 , φn ] → S n ⊂ Aφn = R. But in this case, to comply the second part of (H3), we must adjoin a principal part to the θφ ’s. Pick αφ = sn (φ)1φn +· · · d(tφ ) = cφ t θ φ = of Γ, then set θφ := s1 (φ1 )1φ1 +· · ·+sn−1 (φn−1 )1φn−1 +αφ and for example tφ (φn−1 ) sn (φn ) cφ tφs11(φ1 ) · · · tφsn−1 tφn · · · where cφ ∈ k. As an illustration, in Example (2.4), one has n−1 −1 d(t3 ) d(t2 ) 1 = = −t2 and = = −t2 t3 . t2 x t3 x log(x) We can generalize the construction in the preceding proof. Corollary 3.3 Let Φ be isomorphic to the concatenation of a family of subsets of R over any ordered set which admits a right-shift. Suppose that Aφ ≃ R for any φ ∈ Φ. Then k((Γ)) carries a series derivation of Hardy type. 13 F Indeed, denote Φ = e∈E S e where E is the given set with a right-shift f : E → E. In the proof of (3.2), replace N by E, pick a family of elements φe ∈ S e and apply the construction where S e stands for S n , φ f (φe ) for φn+1 , etc. Note that such set Φ may not carry itself a right shift. E.g. take E = Z and, for any n , 0, S n = {0} and S 0 = Z≤0 : F the resulting Φ is order isomorphic to Z≤0 Z which does not admit any right shift. Some of these abstract examples may be illustrated by or enhanced using germs in some Hardy fields in the spirit of (2.4). For instance, take the following Hardy fields: • R(exp(x)R , exp2 (x)R , . . . , expn (x)R , . . .) • R(xR , exp(xα )R ; α ∈ R>0 ) • R(xR , log(x)R , . . . , logn (x)R , . . .) • R(. . . , expn (x)R , . . . , exp2 (x)R , exp(x)R , xR , log(x)R , . . . , logn (x)R , . . .) We let the reader verify what kind of Hardy type series derivation may model these cases. The preceding examples give partial solution to the following natural problem: Describe the generalized series fields which can carry a Hardy type series derivation. We believe that a complete answer can be derived from (3.1). This would also help to characterize which groups may belong to an asymptotic couple in the sense of [Ros81, AvdD05b]. 4 On asymptotic integration, integration and logarithms. Definition 4.1 Let (K, v, d) be a valued differential field, and a ∈ K. The element a is said to admit an asymptotic integral b if there exists b ∈ K \ {0} such that v(d(b) − a) > v(a). The element a is said to admit an integral b if there exists b ∈ K \ {0} such that d(b) = a. For a valued differential field, the existence of a valuation permits to deal with approximate solutions of equations, for instance the basic differential equation corresponding to integration: d(y) = a (2) In the context of Hardy fields, the problem of computing asymptotic integrals has been solved by M. Rosenlicht [Ros83b, Proposition 2 and Theorem 1]. In [KM12a] we observed that his proof applies to the more general context of valued fields with Hardy type derivations: Theorem 4.1 (Rosenlicht) Let (K, v, d) be a valued differential field with d of Hardy type. Let a ∈ K\{0}, then a admits an asymptotic integral if and only if ( ! ) d(b) v(a) , l.u.b. v ; b ∈ K\{0}, v(b) , 0 b 14 Moreover, for any such a, there exists u0 ∈ K\{0} with v(u0 ) , 0 such that for any au/d(u) is an asymptotic integral of a. u ∈ K\{0}, |v(u0 )| > |v(u)| > 0, then a. d(au/d(u)) Note that in our context of a generalized series field k((Γ)) endowed with a series derivation of Hardy type, by the computation (1) in Section 3, one has for any b ∈ K\{0} with v(b) , 0 that: ! ! ! d(tφ ) d(b) d(tβ ) v =v =v = θφ b tβ tφ where of (4.1) we can replace the ! and φ = vΓ (β). Therefore) in the hypothesis ( β = v(b) n o d(b) ; b ∈ k((Γ)) \ {0}, v(b) , 0 by the set θφ ; φ ∈ Φ . set v b We can derive from (4.1) in our context explicit formulas for the computation of a specific asymptotic integral: the unique one which is a monomial cγ tγ [KM12a, Corollary 6.3] or [KM11, Section 4.1]: Corollary 4.2 Let α ∈ Γ with α , θ̃, α = α0 1φ0 + · · · . There exists a uniquely determined ψα ∈ Φ which satisfies α − θψα = γ0 1ψα + · · · for some γ0 , 0. d(tψα ) Set = cψα tθψα + · · · . Consequently, any series a = aα tα + · · · admits as monomial tψα asymptotic integral: a.i.(a) = aα α−θψα t γ0 cψα A natural question now is: What is the relation between asymptotic integration and integration ? The answer is given in [Kuh11, Theorem 55] for spherically complete valued differential fields: asymptotic integration implies integration. Applying this result to our context we obtain that: Corollaryn 4.3 Let k((Γ)) be endowed with a series derivation of Hardy type d. Set o θ̃ = l.u.b. θφ ; φ ∈ Φ . Then any series a ∈ k((Γ)) with v(a) > θ̃ admits an integral in k((Γ)). Moreover k((Γ)) is closed under integration if and only if θ̃ < Γ. A particular case of the problem of integration that we want to solve is the one for the logarithm: d(a) d(y) = ⇔ y = log |a| + c (3) a This is the subject of the section 4.2 in [KM11]. There, such solutions log to (3) are called pre-logarithms since they might not be surjective as a real logarithm is. Of course, our study is rooted in the studies of logarithmic and exponential maps in the non-Archimedian context, e.g. [All62, Kuh00, Res93, vdDMM97, vdH06]. By [All62], in order to define a pre-logarithm on k((Γ)), we suppose from now on that the coefficient field k carries a logarithm log, e.g. k = R. So in particular k 15 is ordered, and therefore so is k((Γ)) lexicographically. Moreover, the logarithm on 1-units is naturally defined as the following isomorphism of ordered groups: log : 1 + k((Γ>0 )) → k((Γ>0 )) X ǫn 1+ǫ 7→ (−1)n−1 n n≥1 (4) Since any generalized series may be written a = aα tα (1 + ǫ), it remains only to define a pre-logarithm on the monic monomials tα . In particular, we are interested in pre-logarithms verifying the growth axiom scheme as a real logarithm does: (GA) ∀α ∈ Γ<0 , v(log(tα )) > α. In the non differential case, this problem is discussed extensively in [Kuh00]. The perspective we adopt in the differential case is to consider pre-logarithms that verify equation (3). Moreover, in the context of generalized series fields, we consider prelogarithms that are series morphisms, i.e. such that: X X (L) ∀α = αφ 1φ ∈ Γ, log(tα ) = αφ log(tφ ). φ∈Φ φ∈Φ We prove in [KM11, Theorem 4.10] that: Theorem 4.4 n Let k((Γ)) o be endowed with a series derivation of Hardy type d. Set θ̃ = l.u.b. θφ ; φ ∈ Φ . There exists a unique pre-logarithm log on k((Γ)) which is a series morphism if and only if the following two conditions hold: [ d(tφ ) ; 1. θ̃ < Supp tφ φ∈Φ 2. ∀φ ∈ Φ, ∀τφ ∈ Supp  d(tφ )  , v a.i.(τφ ) < 0. tφ Moreover, this pre-logarithm verifies (GA). In [KM11, Corollary 4.13], we obtain explicit formulas for this pre-logarithm. Generally speaking, the principle is the same as before: to get the good property on d(tφ ) d(a) ’s. Once has an integral - it suffices to have it for the k((Γ)) - here that any a tφ again, the key property that we use in the proof is the spherical completeness of k((Γ)), more precisely the existence of a fixed point principle as in [Kuh11, PCR93]. As a conclusion to this section, note that one can derive from the preceding results methods of construction of pre-logarithms and classes of examples in the same spirit as (3.2). Conversely, one may also try to deduce from a given pre-logarithmic structure a corresponding series derivation of Hardy type: see [KM11, Section 5] Example 4.2 Suppose that Φ carries a right-shift σ : Φ → Φ, then the map defined by:   Y γ  X P  φ γ 1 −1 logσ t φ∈Φ φ φ = logσ  tφ  = γφ tσ(φ) φ∈Φ 16 φ∈Φ induces a pre-logarithm on k((Γ)). Moreover if σ is onto, denote the convex orbit of any φ by Cφ = {ψ ∈ Φ | ∃k ∈ N, σk (φ) 4 ψ 4 σ−k (φ)}. Then the pre-logarithm logσ corresponds to a series derivation of Hardy type such that: For any φ1 < φ2 ∈ Φ, the principal part up to Cφ1 of θφ1 − θφ2 is equal to the one of ∞ k X X 1σ j (φ2 ) − 1σ j (φ1 ) , with in particular θσk (φ) = θφ − 1σ j (φ) for any k ∈ N. j=1 j=1 5 Exponential-logarithmic series fields The last but not least differential equation we are interested in is the one for the exponential: d(y) = d(a)y ⇔ y = c exp(a) (5) According to [KKS97], there is no hope for defining an exponential and logarithmic structure on a generalized series field. Nevertheless there are several similar ways to obtain non Archimedian exponential-logarithmic fields seen as subfields of generalized series fields: see below and [vdDMM97, vdH06, Kuh00]. See also [KT] for a comparison between LE-series and EL-series. The original idea is due to [Dah84, DG87] and may be seen as an abstraction of Hardy’s construction of log-exp functions [Har10]. In each case, it consists in starting with some initial field of generalized series, and then taking the closure under towering logarithmic and/or exponential extensions. As a main difference, for LE-series and grid-based transseries only grid-based supports are allowed for the series, whereas for EL-series and well-ordered transseries the supports are well-ordered. For instance, the grid-based transseries field is obtained by starting with a field of grid-based series with Φ = N corresponding to the various iterates of log(x), and by applying the exponential closure process described, allowing only gridbased supports for the series [vdH06, Section 4.3]. The fields of LE-series and of grid-based transseries are naturally equipped with a series derivation of Hardy type [vdH06, Section 5.1]. It is also possible to equip certain fields of well-ordered transseries with such a derivation [Sch01]. Our aim here is to show that it is also possible to do that for EL-series fields. Here we get started directly with a generalized series field k((Γ)) endowed with a pre-logarithm strong morphism log and a Hardy type series derivation d as in Section 4. The construction we present here is the construction of the exponential-logarithmic closure of k((Γ)) as in [Kuh00]. It consists in iterating the following exponential extension procedure. By definition, the pre-logarithm defines an embedding of ordered groups log : tΓ ֒→ k((Γ<0 )). Keep in mind that this map cannot be onto [KKS97]. In other words, the exponential of the elements of k((Γ<0 )) \ log(Γ) are missing in the left-hand side. Set the following multiplicative copy of the ordered additive group Γ♯ := k((Γ<0 )): ♯ tΓ := {ta | a ∈ k((Γ<0 )), with tlog(t ♯ α )) := tα , α ∈ Γ} By construction tΓ ⊂ tΓ , so the generalized series field k((Γ♯ )) extends k((Γ)). Define also a pre-logarithm by: 17 k((Γ♯<0 )) a   log♯ extends log, and k((Γ<0 )) embeds in k((Γ♯<0 )). Call k((Γ♯ )), log♯ the exponential  extension of k((Γ)), log . By iterating this exponential  extension procedure, we can define the n’th exponential extension k((Γ♯n )), log♯n , obtaining thus an inductive system of pre-logarithmic fields. The inductive limit is defined as the exponential-logarithmic series (EL   series) field (induced by k((Γ)), log in the sense of [Kuh00], say k((Γ))EL , logEL . ♯ log♯ : tΓ ta ֒→ 7→ Theorem 5.1 (Kuhlmann) series field k((Γ)) endowed with a pre  For any generalized logarithm log, the couple k((Γ))EL , logEL is such that:     EL logEL : k((Γ))EL >0 , ., ≤ → k((Γ)) , +, ≤ is an isomorphism of ordered groups, verifying the growth axiom scheme (GA). Therefore it admits a well-defined exponential map expEL as inverse map, and k((Γ))EL is a non-Archimedian exponential-logarithmic field. EL Note series field k((ΓEL )) where [that k((Γ)) is a strict subfield of the generalized ♯n −tφ −ttφ −1 Γ := Γ . For example, the series tφ +t +t +· · · belongs to k((ΓEL ))\k((Γ))EL. EL n∈N Nevertheless, ΓEL is the value group of k((Γ))EL and k((ΓEL )), and k is their residue field, so that k((Γ))EL ⊂ k((ΓEL )) is an immediate extension. Considering k((Γ)) endowed with a Hardy type series derivation d, we are interested in extending d to k((Γ))EL . In [KM11, Theorem 6.2], we showed that this is always feasible: Theorem 5.2 The series derivation of Hardy type d on k((Γ)) extends to a series derivation of Hardy type on k((Γ))EL , and this extension is uniquely determined. Of course it is understood that the derivations and exponential and logarithmic maps we consider verify the corresponding differential equations (3) and (5): such k((Γ))EL is a non-Archimedian differential exponential-logarithmic field. Moreover k((Γ))EL inherits the properties ofnk((Γ)) concerning asymptotic integrao tion and integration. Denote as before θ̃ = l.u.b. θφ ; φ ∈ Φ where Φ is the rank of the initial valued group Γ. By [KM11, Theorem 7.1 and Corollary 7.2], we have that: Theorem 5.3 A series a ∈ k((Γ))EL admits an asymptotic integral if and only if a - θ̃. The EL-series field k((Γ))EL is closed under integration if and only if θ̃ < ΓEL . To conclude this section and the article, recall from our introduction that generalized series fields are universal domains for valued fields. In the characteristic zero case, with the EL-series construction, they provide also universal domains for ordered exponential fields. This is brilliantly illustrated by the construction of surreal numbers [Con01, Gon86, All87]. See also [All85] for a specific emphasis on the generalized series structure and set theoretic topics. These non Archimedian numbers form a class, 18 say NO, which can be at the same time viewed as a generalized series field R((NO)) via the so-called Conway normal form of the surreal numbers and equipped with an exponential and a logarithmic functions exp and log = exp−1 : see [Gon86, Chapter 5 and 10]. We describe in a recent work [KM12b] a canonical family, say Φ, of representatives of the exp-log equivalence classes of surreal numbers. Let Γ be the Hahn group with copies of R as ribs and Φ as spine. With S. Kuhlmann, we conjecture that: Differential EL-series conjecture for surreal numbers. The class of surreal numbers NO may be described as: NO = R((Γ))EL where the exponential and logarithmic functions are Gonshor’s exp and log. Moreover, NO can be endowed with a Hardy type series derivation compatible with such EL structure. Consequently, NO is a universal domain for exp-log differential fields. [All62] N. L. Alling, On exponentially closed fields, Proc. Amer. Math. Soc. 13 (1962), 706–711. [All85] N. L. Alling, Conway’s field of surreal numbers, Trans. Amer. Math. Soc. 287 (1985), no. 1, 365–386. [All87] N. L. Alling, Foundations of analysis over surreal number fields, NorthHolland Mathematics Studies, vol. 141, North-Holland Publishing Co., Amsterdam, 1987, Notas de Matemática [Mathematical Notes], 117. [AvdD02] M. Aschenbrenner and L. van den Dries, H-fields and their Liouville extensions, Math. Z. 242 (2002), no. 3, 543–588. [AvdD05a] M. Aschenbrenner and L. van den Dries, Asymptotic differential algebra, Analyzable functions and applications, Contemp. Math., vol. 373, Amer. Math. Soc., Providence, RI, 2005, pp. 49–85. [AvdD05b] M. Aschenbrenner and L. van den Dries, Liouville closed H-fields, J. Pure Appl. Algebra 197 (2005), 83–139. [AvdDvdH12] M. Aschenbrenner, L. van den Dries and J. van der Hoeven, Towards a model theory for transseries, to appear in Notre Dame J. Form. Log., arXiv:1112.5237v2. [Ber00] A. Berarducci, Factorization in generalized power series, Trans. Amer. Math. Soc. 352 (2000), no. 2, 553–577. [Bos86] M. Boshernitzan, Hardy fields and existence of transexponential functions, Aequationes Math. 30 (1986), no. 2-3, 258–280. [Bou76] N. Bourbaki, Éléments de mathématique. fonctions d’une variable réelle, Hermann, Paris, 1976, Théorie élémentaire. 19 [CMR05] F. Cano, R. Moussu, and J.-P. Rolin, Non-oscillating integral curves and valuations, J. Reine Angew. Math. 582 (2005), 107–141. [Con01] J. H. Conway, On numbers and games, second ed., A. K. Peters Ltd., Natick, MA, 2001. [Dah84] B. I. Dahn, The limit behaviour of exponential terms, Fund. Math. 124 (1984), no. 2, 169–186. [DG87] B. I. Dahn and P. Göring, Notes on exponential-logarithmic terms, Fund. Math. 127 (1987), no. 1, 45–50. [vdD98] L. van den Dries, Tame topology and o-minimal structures, Cambridge University Press, Cambridge, 1998. [vdDMM94] L. van den Dries, A. Macintyre, and D. Marker, The elementary theory of restricted analytic fields with exponentiation, Ann. of Math. (2) 140 (1994), no. 1, 183–205. [vdDMM97] L. van den Dries, A. Macintyre, and D. Marker, Logarithmic-exponential power series, J. London Math. Soc. (2) 56 (1997), no. 3, 417–434. [vdDMM01] L. van den Dries, A. Macintyre, and D. Marker, Logarithmic-exponential series, in Proceedings of the International Conference “Analyse & Logique” (Mons, 1997), vol. 111, Ann. Pure Appl. Logic, no. 1-2, 2001, pp. 61–113. [vdDS98] L. van den Dries and P. Speissegger, The real field with convergent generalized power series, Trans. Amer. Math. Soc. 350 (1998), no. 11, 4377–4421. [vdDS00] L. van den Dries and P. Speissegger, The field of reals with multisummable series and the exponential function, Proc. London Math. Soc. (3) 81 (2000), no. 3, 513–565. [É92] J. Écalle, Introduction aux fonctions analysables et preuve constructive de la conjecture de Dulac, Actualités Mathématiques, Hermann, Paris, 1992. [Ehr95] P. Ehrlich, Hahn’s über die nichtarchimedischen grössensysteme and the development of the modern theory of magnitudes and numbers to measure them, in From Dedekind to Gödel (Boston, MA, 1992), Synthese Lib., vol. 251, Kluwer Acad. Publ., Dordrecht, 1995, pp. 165–213. [Fuc63] L. Fuchs, Partially ordered algebraic systems, Pergamon Press, Oxford, 1963. [Gla99] A. M. W. Glass, Partially ordered groups, Series in Algebra, vol. 7, World Scientific Publishing Co. Inc., River Edge, NJ, 1999. [Gon86] H. Gonshor, An introduction to the theory of surreal numbers, London Mathematical Society Lecture Note Series, vol. 110, Cambridge University Press, Cambridge, 1986. 20 [Gro97] A. Grothendieck, Esquisse d’un programme, in Geometric Galois actions, 1, London Math. Soc. Lecture Note Ser., vol. 242, Cambridge Univ. Press, Cambridge, 1997, pp. 5–48. [Hah07] H. Hahn, Über die nichtarchimedischen Grössensystem, Sitzungsberichte der Kaiserlichen Akademie der Wissenschaften, Mathematisch - Naturwissenschaftliche Klasse (Wien) 116 (1907), no. Abteilung IIa, 601–655. [Har10] G. H. Hardy, Orders of infinity: The ‘Infinitärcalül’ of Paul du Bois-Reymond., Cambridge Tracts in Mathematics and Mathematical Physics, vol. 12, Cambridge University Press, 1910. [vdH06] J. van der Hoeven, Transseries and real differential algebra, Lecture Notes in Mathematics, vol. 1888, Springer-Verlag, Berlin, 2006. [vdH09] J. van der Hoeven, Transserial Hardy fields, Astérisque (2009), no. 323, 453– 487. [Kap42a] I. Kaplansky, Maximal fields with valuations, Duke Math. Journal 9 (1942), 303–321. [Kap42b] I. Kaplansky, Maximal fields with valuations ii, Duke Math. Journal 12 (1942), 245–248. [Ked01a] K. S. Kedlaya, Power series and p-adic algebraic closures, J. Number Theory 89 (2001), no. 2, 324–339. [Ked01b] K. S. Kedlaya, The algebraic closure of the power series field in positive characteristic, Proc. Am. Math. Soc. 129 (2001), no. 12, 3461–3470. [Kru32] W. Krull, Allgemeine Bewertungstheorie, J. Reine Angew. Math. 167 (1932), 160–196 (German). [Kuh11] F.-V. Kuhlmann, Maps on ultrametric spaces, hensel’s lemma, and differential equations over valued fields, Comm. Algebra 39 (2011), no. 5, 1730–1776. [Kuh00] S. Kuhlmann, Ordered exponential fields, Fields Institute Monographs, vol. 12, American Mathematical Society, Providence, RI, 2000. [KKS97] F.-V. Kuhlmann, S. Kuhlmann, and S. Shelah, Exponentiation in power series fields, Proc. Amer. Math. Soc. 125 (1997), no. 11, 3177–3183. [KM11] S. Kuhlmann and M. Matusinski, Hardy type derivations on fields of exponential logarithmic series, J. Algebra, 345 (2011), 171–189. [KM12a] S. Kuhlmann and M. Matusinski, Hardy type derivations in generalized series fields, J. Algebra 351 (2012), 185–203. [KM12b] S. Kuhlmann and M. Matusinski, The exponential-logarithmic equivalence classes of surreal numbers, to appear in Order, preprint arXiv: 1203.4538. 21 [KMS13] Salma Kuhlmann, Mickaël Matusinski, and Ahuva C. Shkop, A note on Schanuel’s conjectures for exponential logarithmic power series fields, Arch. Math. (Basel) 100 (2013), no. 5, 431–436. [KT] S. Kuhlmann and M. Tressl, Comparison of Exponential-Logarithmic and Logarithmic-Exponential series, Math. Logic Quarterly, 58, 434-448 (2012). [LC94] T. Levi-Civita, Sugli infiniti ed infinitesimi attuali quali elementi analitici, Ven. Ist. Atti (7) (1894), IV. 1765–1815 (Italian). [LC98] T. Levi-Civita, Sui numeri transfiniti, Rom. Acc. L. Rend. (5) 7 (1898), no. 1, 91–96, 113–121 (Italian). [Mac39] S. MacLane, The universality of formal power series fields, Bull. Am. Math. Soc. 45 (1939), 888–890 (English). [Mal48] A. I. Mal’cev, On the embedding of group algebras in division algebras, Doklady Akad. Nauk SSSR (N.S.) 60 (1948), 1499–1501. [Mat11] M. Matusinski, A differential Puiseux theorem in generalized series fields of finite rank, Ann. Fac. Sci. Toulouse Math. (6) 20 (2011), no. 2, 247–293 (English). [Mil94] C. Miller, Expansions of the real field with power functions, Ann. Pure Appl. Logic 68 (1994), no. 1, 79–94. [MR93] M.H. Mourgues and J.P. Ressayre, Every real closed field has an integer part, J. Symb. Log. 58 (1993), no. 2, 641–647 (English). [Neu49] B. H. Neumann, On ordered division rings, Trans. Amer. Math. Soc. 66 (1949), 202–252. [PCR93] S. Priess-Crampe and P. Ribenboim, Fixed points, combs and generalized power series, Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg 63 (1993), 227–244. [PCR04] S. Priess-Crampe and P. Ribenboim, Differential equations over valued fields (and more), J. Reine Angew. Math. 576 (2004), 123–147. [Poo93] B. Poonen, Maximally complete fields, Enseign. Math. (2) 39 (1993), no. 1-2, 87–106. [Res93] J.-P. Ressayre, Integer parts of real closed exponential fields, in Arithmetic, Proof Theory and Computational Complexity (P. Clote and J. Krajicek, eds.), Oxford University Press, 1993, pp. 278–288. [Rib92] P. Ribenboim, Fields: algebraically closed and others, Manuscripta Math. 75 (1992), no. 2, 115–150. [Rib95] P. Ribenboim, Special properties of generalized power series, J. Algebra 173 (1995), no. 3, 566–586. 22 [Rib97] P. Ribenboim, Semisimple rings and von Neumann regular rings of generalized power series, J. Algebra 198 (1997), no. 2, 327–338. [Ros80] M. Rosenlicht, Differential valuations, Pacific J. Math. 86 (1980), no. 1, 301– 319. [Ros81] M. Rosenlicht, On the value group of a differential valuation. II, Amer. J. Math. 103 (1981), no. 5, 977–996. [Ros83a] M. Rosenlicht, Hardy fields, J. Math. Anal. Appl. 93 (1983), no. 2, 297–311. [Ros83b] M. Rosenlicht, The rank of a Hardy field, Trans. Amer. Math. Soc. 280 (1983), no. 2, 659–671. [Ros95] M. Rosenlicht, Asymptotic solutions of Y ′′ = F(x)Y, J. Math. Anal. Appl. 189 (1995), no. 3, 640–650. [Ros82] J. G. Rosenstein, Linear orderings, Pure and Applied Mathematics, vol. 98, Academic Press Inc. [Harcourt Brace Jovanovich Publishers], New York, 1982. [Sch37] O. E. G. Schilling, Arithmetic in fields of formal power series in several variables, Ann. of Math. (2) 38 (1937), no. 3, 551–576. [Sch01] M.C. Schmeling, Corps de transséries, Ph.D. thesis, Université Paris-VII, 2001. [Sch02] P. Schneider, Nonarchimedean functional analysis, Springer Monographs in Mathematics, Springer-Verlag, Berlin, 2002. [Spe99] P. Speissegger, The Pfaffian closure of an o-minimal structure, J. Reine Angew. Math. 508 (1999), 189–211. [Ver91] G. Veronese, Fondamenti di geometria a più dimensioni e a più spezie di unita rettilinee esposti in forma elementare, textitPadova. Tipografia del seminario. 5. LVIII + 628 S, 1891 (Italian). [Wil96] A. J. Wilkie, Model completeness results for expansions of the ordered field of real numbers by restricted Pfaffian functions and the exponential function, J. Amer. Math. Soc. 9 (1996), no. 4, 1051–1094. 23 This figure "right-shift-1.jpg" is available in "jpg" format from: http://arxiv.org/ps/1209.4559v3
0math.AC
arXiv:cs/0512016v2 [cs.DS] 12 Mar 2006 A linear-time algorithm for finding the longest segment which scores above a given threshold Miklós Csűrös∗. February 1, 2008 Abstract. This paper describes a linear-time algorithm that finds the longest stretch in a sequence of real numbers (“scores”) in which the sum exceeds an input parameter. The algorithm also solves the problem of finding the longest interval in which the average of the scores is above a fixed threshold. The problem originates from molecular sequence analysis: for instance, the algorithm can be employed to identify long GC-rich regions in DNA sequences. The algorithm can also be used to trim low-quality ends of shotgun sequences in a preprocessing step of whole-genome assembly. 1 Introduction Let a1 , . . . , an be an arbitrary sequence of real numbers with n > 0. The segment [i, j] for 1 ≤ i ≤ j ≤ n is the interval {i, i + 1, . . . , j}; its score is a(i, j) = ai + ai+1 + · · · + aj . This paper’s central problem is the following. Given a score threshold α, find a segment [i, j] that has maximum length (j − i + 1) among those with a(i, j) ≥ α. Similar segmentation questions are encountered in statistical changepoint estimation [7], with applications in various areas including molecular biology [1, 5, 11]. A number of related problems can be solved with efficient algorithms. Jon Bentley’s classic “programming pearl” finds a segment with maximum score in O(n) time [3]. Csűrös [5] solves the more general problem of finding a k-set of segments with maximum total score in O(n min{k, log n}) time and O(n) space. Huang [10] reports a simple ∗ Université de Montréal, Department of Computer Science and Operations Research, CP 6128 succ. Centre-Ville, Montréal, Qué., H3C 3J7, Canada. WWW: http://www.iro.umontreal.ca/˜csuros/ 1 linear-time algorithm for the dual of our problem, namely, that of finding a a segment that has maximum score among those longer than a given threshold. An algorithm of Lin et al. [12] finds such a segment in O(n) time, when in addition to a lower bound on the segment length, an upper bound is also imposed. In some situations, it may be interesting to evaluate a segment [i, j] by its average score a(i, j)/(j − i + 1). Lin et al. [12] devised an algorithm that finds the segment with maximum average score among those longer than L, in O(n log L) time. Goldwasser et al. [8] give a faster algorithm for the same problem that runs in O(n) time irrespective of L. This paper’s techniques lead to an O(n)-time algorithm for the dual problem; namely, that of finding the longest segment with average score above a bound α. This latter result is particularly relevant in molecular sequence segmentation. For instance, our algorithm can be employed to identify the longest contiguous region in a DNA sequence with a GC-content (relative frequency of guanine and cytosine) above a cutoff level. The search for GC-rich and GC-poor regions in DNA is one of the main practical motivations behind the algorithms of [5, 8, 10, 12]. Whole-genome shotgun assembly programs also often need to compute long segments with high average scores. In shotgun sequencing, the sequence of a long DNA molecule is computed from the sequences of randomly sampled short fragments [9], called the shotgun sequences. The shotgun sequences are typically delivered together with position-specific error probabilities [6] to the assembly software. In a preprocessing phase, many assembly programs trim the shotgun sequences by removing the extremities with high sequencing error. It is important to trim the sequences only as much as is absolutely necessary. Small error levels can be tolerated and even corrected, while the assembly’s quality is ultimately determined by its length. The shotgun sequence trimming problem is defined as follows. Given a DNA sequence s1 s2 · · · sn and position-specific error probabilities e1 , e2 , . . . , en , find the longest contiguous substring si . . . sj such that its average error (ei + ei+1 + . . . + ej )/(j − i + 1) falls below a user-specified threshold E. Clearly, by setting ak = 1 − ek , we can look for the longest segment for which the average score is above (1 − E) by using the techniques in this paper. Existing assembly programs trim heuristically using variations of a sliding window technique, without guarantees of length optimality. (They rely on the fact that the error probabilities in chain-termination sequencing are usually high at the extremities and low in the middle, and essentially assume a unimodal function.) The assembly program Arachne [2], for instance, purposely looks for the longest segment with an average error below 2 a threshold, but closer inspection of the source code reveals that the implemented algorithm is not guaranteed to find an optimal segment for all error probabilities. 2 Algorithm Define the prefix score fj = a(1, j) for all j = 1, . . . , n, and let f0 = 0. Obviously, a(i, j) = fj −fi−1 , and thus we are looking for the longest segment [i, j] with fj ≥ fi−1 + α. Now, let 0 ≤ i∗ < j ∗ ≤ n be such that fj ∗ ≥ fi∗ + α and (j ∗ − i∗ ) is maximal. Clearly, [i∗ + 1, j ∗ ] is the longest segment with a(i∗ + 1, j ∗ ) ≥ α. Lemma 1. Let 0 ≤ i∗ < j ∗ ≤ n be such that fj ∗ ≥ fi∗ + α and (j ∗ − i∗ ) is maximal. If i∗ > 0, then fi∗ < f0 , f1 , . . . , fi∗ −1 . (1a) fj ∗ > fn , fn−1 , . . . , fj ∗ +1 . (1b) If j ∗ < n, then Proof. We prove Eq. (1a). For the sake of contradiction, assume that there exists such an i < i∗ that fi ≤ fi∗ . Then j ∗ − i > j ∗ − i∗ , yet fj ∗ ≥ fi∗ + α ≥ fi + α. Eq. (1b) is proven analogously. Definition 1. Define the left sequence of minima 0 = l1 < l2 < · · · lk ≤ n by l1 = 0 and lj = min{i : lj−1 < i ≤ n, fi < flj−1 }. Define the right sequence of maxima n = r1 > r2 > · · · > rm ≥ 0 by r1 = n and rj = max{i : 0 ≤ i < rj−1 , fi > frj−1 }. Figure 1 illustrates these notions. By definition, the left sequence of minima is sorted in decreasing order of prefix scores: fl1 > fl2 > · · · > flk . (2a) f r1 < f r2 < · · · < f rm . (2b) Similarly, By Lemma 1, we can restrict our attention to segments [i, j] where i ∈ {l1 . . . , lk } and j ∈ {r1 , . . . , rm }. Equations (2a) and (2b) imply the following lemmas. 3 f decreases l 1 2 k 0 r n 2 m 1 f increases Figure 1: Left sequence of minima {li } and right sequence of maxima {rj }. Lemma 2. Let i ∈ {0, . . . , n}. If fi + α ≤ frj for some j, then fi + α ≤ frj′ for all j ′ ≥ j. Lemma 3. Let j ∈ {0, . . . , n}. If fli + α ≤ fj , then fli′ + α ≤ fj for all i′ ≥ i. In view of these lemmas, we can define the following values. Definition 2. For all i = 1, . . . , k define right(i) by right(i) = min{j : frj ≥ fli + α}. Let right(i) = m + 1 if fli + α > frj for all j. For all j = 1, . . . , m, define left(j) by left(j) = min{i : fli + α ≤ frj }; let left(j) = k + 1 if fli + α > frj for all i. By Lemmas 1, 2 and 3, for every i = 1, . . . , k, the longest segment [li + 1, j] which scores above α has j = rright(i) , unless right(i) = m + 1 or rright(i) ≤ li , in which case there is no suitable segment with left endpoint at li + 1. Similarly, left(j) gives the left endpoint i = lleft(j) for the longest segment [i + 1, rj ] that scores above the threshold, unless left(j) = k + 1 or lleft(j) ≥ rj , in which case there is no suitable segment with right endpoint rj . Lemmas 2 and 3 imply the following property. Lemma 4. For all 1 ≤ i < i′ ≤ k, right(i) ≥ right(i′ ). For all m ≥ j > j ′ ≥ 1, left(j) ≤ left(j ′ ). Now, the best segment is the longest valid segment in the set   [li + 1, rright(i) ] : i = 1, . . . , k ∪ [lleft(j) + 1, rj ] : j = 1, . . . , m . In fact, it suffices to consider only one of the two sets since for the longest segment [li∗ + 1, rj ∗ ], left(j ∗ ) = i∗ and right(i∗ ) = j ∗ . The following algorithm solves the original problem. 1 Algorithm LongestSegment 4 2 Input: scores ai : i = 1, . . . , n; threshold α 3 Output: longest segment that scores above α, or nil if no segment score exceeds α 4 Set f0 ← 0; for i ← 1, . . . , n do fi ← fi−1 + ai 5 Set k ← 1, l1 ← 0 6 for i ← 1, . . . , n do if fi < flk then k ← k + 1, lk ← i 7 Set m ← 1, r1 ← n 8 for j ← n, . . . , 1 do if fj > frm then m ← m + 1, rm ← j 9 Set max ← 0, segment ← nil 10 Set i ← 1, j ← m 11 while i ≤ k and j ≥ 1 do 12 while i ≤ k and fli + α > frj do i ← i + 1 13 if i ≤ k then 14 while j ≥ 1 and fli + α ≤ frj do 15 if rj − li > max then max ← rj − li , segment ← [li + 1, rj ] 16 Set j ← j − 1 17 18 end while end if 19 end while 20 return segment Theorem 1. Algorithm LongestSegment finds the longest segment which scores above the threshold α in O(n) time. Proof. Line 4 calculates the prefix sums fi in O(n) time. Lines 5–6 compute the left sequence of minima, and Lines 7–8 compute the right sequence of maxima, in O(n) time. Lines 11–19 are executed in O(k + m) = O(n) time, since the loops of Lines 12 and 16 increase i and decrease j by one, respectively. Line 9 initializes the structures for tracking the best segment: max stores the length of the longest segment found and segment is the best segment. In Lines 10–19, the algorithm goes through pairs (i, j) where i = left(j). More precisely, the algorithm’s correctness follows from the invariant that i = k + 1 or i = left(j) holds in Line 13. Subsequently, as long as the while loop’s condition in Line 14 is true, i = left(j) holds. As discussed, one of the 5 segments [lleft(j) + 1, rj ] is the longest one that scores above the cutoff, and, thus Line 15 finds the optimal segment if the invariant is true. In order to see that the invariant is true, notice the following. First, after the condition of the loop in Line 12 fails with j = m, the invariant holds by Definition 2 of left(m). Secondly, for j < m, left(j) can be looked for starting the search at left(j + 1) by Lemma 4, and, thus the invariant holds every time the execution arrives to Line 13. 3 Related problems The same technique applies also to the problem of finding a segment with maximum score with a lower bound on the segment length. (Albeit Xiaoqiu Huang’s algorithm [10] is arguably simpler.) The idea is to define the left and right pairs by thresholding on the segment length and then select the one segment with the highest score. The described algorithm can also be used to find the longest segment a +ai+1 +...+aj ≥ β if with an average score above a given threshold β. Since i j−i+1 and only if jk=i (ak −β) ≥ 0, the longest such segment can be found by using Algorithm LongestSegment with scores (ai − β) and threshold α = 0. P 4 Acknowledgments I would like to thank Mihai Pop and Pavel Havlak for discussions of shotgun sequence trimming, as well as David Jaffe for sending me the Arachne source code. Remark. Kuan-Yu Chen and Kun-Mao Chao’s paper [4] about the same problem came out in print while this paper was under review. (So this will always remain a preprint.) Their algorithm works in an on-line setting. They also show the reduction for finding the shortest segment which scores above a given cutoff. References [1] I. E. Auger and C. E. Lawrence. Algorithms for the optimal identification of segment neighborhoods. Bull. Math. Biol., 51(1):39–54, 1989. 6 [2] S. Batzoglou, D. B. Jaffe, K. Stanley, J. Butler, S. Gnerre, E. Mauceli, B. Berger, J. P. Mesirov, and E. S. Lander. ARACHNE: A wholegenome shotgun assembler. Genome Res., 12:177–189, 2002. [3] J. Bentley. Programming pearls: algorithm design techniques. Comm. ACM, 27(9):865–873, 1984. [4] K.-Y. Chen and K.-M. Chao. Optimal algorithms for locating the longest or shortest segments satisfying a sum or average constraint. Inform. Process. Lett., 96:197–201, 2005. [5] M. Csűrös. Maximum-scoring segment sets. IEEE/ACM Trans. Comput. Biol. Bioinf., 1(4):139–150, 2004. [6] B. Ewing and P. Green. Base-calling of automated sequencer traces using phred: II. error probabilities. Genome Res., 8:186–194, 1998. [7] Y.-X. Fu and R. N. Curnow. Maximum likelihood estimation of multiple change points. Biometrika, 77(3):563–573, 1990. [8] M. H. Goldwasser, M.-Y. Kao, and H.-I. Lu. Linear-time algorithms for computing maximum-density sequence segments with bioinformatics applications. J. Comp. Syst. Sci., 70(2):128–144, 2005. [9] E. D. Green. Strategies for the systematic sequencing of complex genomes. Nat. Rev. Genet., 2:573–583, 2001. [10] X. Huang. An algorithm for identifying regions of a DNA sequence that satisfy a content requirement. Comput. Appl. Biosci., 10:219–225, 1994. [11] S. Karlin. Statistical studies of biomolecular sequences: score-based methods. Philos. Trans. R. Soc. Lond. B Biol. Sci., 344(1310):391– 402, 1994. [12] Y.-L. Lin, T. Jiang, and K.-M. Chao. Efficient algorithms for locating the length-constrained heaviest segments with applications to biomolecular sequence analysis. J. Comp. Syst. Sci., 65:570–586, 2002. 7
5cs.CE
Approximation and Parameterized Complexity of Minimax Approval Voting Marek Cygan∗ Lukasz Kowalik∗ Arkadiusz Socala∗ Krzysztof Sornat† arXiv:1607.07906v1 [cs.DS] 26 Jul 2016 Abstract We present three results on the complexity of Minimax Approval Voting. First, we study Minimax Approval Voting parameterized by the Hamming distance d from the solution to the votes. We show Minimax Approval Voting admits no algorithm running in time O⋆ (2o(d log d) ), unless the Exponential Time Hypothesis (ETH) fails. This means that the O⋆ (d2d ) algorithm of Misra et al. [AAMAS 2015] is essentially optimal. Motivated by this, we then show a parameterized approximation scheme, running in time 2d O⋆ ((3/ǫ) ), which is essentially tight assuming ETH. Finally, we get a new polynomialtime randomized approximation scheme for Minimax Approval Voting, which runs in 2 time nO(1/ǫ ·log(1/ǫ)) · poly(m), almost matching the running time of the fastest known PTAS for Closest String due to Ma and Sun [SIAM J. Comp. 2009]. 1 Introduction One of the central problems in artificial intelligence and computational social choice is aggregating preferences of individual agents (see the overview of Conitzer [7]). Here we focus on multi-winner choice, where the goal is to select a k-element subset of a set of candidates. Given preferences of the agents, the subset is identified by means of a voting rule. This scenario covers a variety od settings: nations elect members of parliament or societies elect committees [6], web search engines choose pages to display in response to a query [10], airlines select movies available on board [26], companies select a group of products to promote [22], etc. In this work we restrict our attention to the situation where each vote (expression of the preferences of an agent) is a subset of the candidates. Various voting rules are studied. In the simplest one, Approval Voting (AV), occurences of each candidate are counted and k most often chosen candidates are selected. While this rule has many desirable properties in the single winner case [11], in the multi-winner scenario its merits are often considered less clear [16]. Therefore, numerous alternative rules have been proposed (see [15]), including Satifaction Approval Voting (SAV, satifaction of an agent is the fraction of her approved candidates that are elected; the goal is to maximize the total satisfaction), Proportional Approval Voting (PAV: like SAV, but satisfaction of an agent whose j approved candidates are selected is the j-th harmonic number Hj ), Reweighted Approval Voting (RAV: a k-round scheme, in each round another candidate is selected). In this paper we study a rule called Minimax Approval Voting ∗ University of Warsaw, Warsaw, Poland, {cygan, kowalik, arkadiusz.socala}@mimuw.edu.pl. The work of M. Cygan is a part of the project TOTAL that has received funding from the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation programme (grant agreement No 677651). L. Kowalik and A. Socala are supported by the National Science Centre of Poland, grant number 2013/09/B/ST6/03136. † University of Wroclaw, Wroclaw, Poland, [email protected]. K. Sornat was supported by the National Science Centre, Poland, grant number 2015/17/N/ST6/03684. During the work on these results, Krzysztof Sornat was an intern at Warsaw Center of Mathematics and Computer Science. 1 (MAV), introduced by Brams, Kilgour, and Sanver [2]. Here, we see the votes and the choice as 0-1 strings of length m (characteristic vertors of the subsets). The goal is to minimize the maximum Hamming distance to a vote. (Recall that the Hamming distance H(x, y) of two strings x and y of the same length is the number of positions where x and y differ.) Our focus is on the computational complexity of computing the choice based on the MAV rule. In the Minimax Approval Voting decision problem, we are given a multiset S = {s1 , . . . , sn } of 0-1 strings of length m (also called votes), and two integers k and d. The question is whether there exists a string s ∈ {0, 1}m with exactly k ones such that for every i = 1, . . . , n we have H(s, si ) ≤ d. In the optimization version of Minimax Approval Voting we minimize d, i.e., given a multiset S and an integer k as before, the goal is to find a string s ∈ {0, 1}m with exactly k ones which minimizes maxi=1,...,n H(s, si ). A reader familiar with string problems might recognize that Minimax Approval Voting is tightly connected with the classical NP-complete problem called Closest String, where we are given n strings over an alphabet Σ and the goal is to find a string that minimizes the maximum Hamming distance to the given strings. Indeed, LeGrand [17] showed that Minimax Approval Voting is NP-complete as well by reduction from Closest String with binary alphabet. This motivated the study on Minimax Approval Voting in terms of approximability and fixed-parameter tractability. Previous results on Minimax Approval Voting First approximation result was a simple 3-approximation algorithm due to LeGrand, Markakis and Mehta [18], obtained by choosing an arbitrary vote and taking any k approved candidates from the vote (extending it arbitrarily to k candidates if needed). Next, a 2-approximation was shown by Caragiannis, Kalaitzis and Markakis using an LP-rounding procedure [5]. Finally, recently Byrka and Sornat [4] presented a polynomial time approximation scheme (PTAS), i.e., an algorithm that for any fixed ǫ > 0 gives a (1+ǫ)-approximate solution in polynomial time. More precisely, their algorithm runs in 4 3 time mO(1/ǫ ) + nO(1/ǫ ) what is polynomial on number of voters n and number of alternatives m. The PTAS uses information extraction techniques from fixed size (O(1/ǫ)) subsets of voters and random rounding of the optimal solution of a linear program. In the area of fixed parameter tractability (FPT) the goal is to find algorithms with running time of the form f (r)poly(|I|), where |I| is the size of the input istance I, r is a parameter and f is a function, which is typically at least exponential for NP-complete problems. For more about paremeterized algorithms see the textbook of Cygan et al. [8] or the survey of Bredereck et al.[3] (in the context of computational social choice). The study of FPT algorithms for Minimax Approval Voting was initiated by Misra, Nabeel and Singh [24]. They show for example that Minimax Approval Voting parameterized by the number of ones in the solution k (i.e. k is the paramater r) is W [2]-hard, which implies that there is no FPT algorithm, unless there is a highly unexpected collapse in parameterized complexity classes. From a positive perspective, they show that the problem is FPT when parameterized by the maximum allowed distance d. Their algorithm runs in time1 O⋆ (d2d )2 . Previous results on Closest String It is interesting to compare the known results on Minimax Approval Voting with the corresponding ones on the better researched Closest String. The first PTAS for Closest String was given by Li, Ma and Wang [19] with The O⋆ notation suppresses factors polynomial in the input size. Actually, in the article [24] the authors claim the slightly better running time of O⋆ (dd ). However, it seems there is a flaw in the analysis: it states that the initial solution v is at distance at most d from the solution, while it can be at distance 2d because of what we call here the k-completion operation. This increases the maximum depth of the recursion to d (instead of the claimed d/2). 1 2 2 log 1/ǫ running time bounded by nO(1/ǫ ) . This was later improved by Andoni et al. [1] to nO( ǫ2 ) , 2 and then by Ma and Sun [23] to nO(1/ǫ ) . The first FPT algorithm for Closest String, running in time O⋆ (dd ) was given by Gramm, Niedermeier, and Rossmanith [12]. This was later improved by Ma and Sun [23], who gave an algorithm with running time O⋆ (2O(d) ·|Σ|d ), which is more efficient for constant-size alphabets. No further substantial progress is possible, since Lokshtanov, Marx and Saurabh [21] have shown that Closest String admits no algorithms in time O⋆ (2o(d log d) ) or O⋆ (2o(d log |Σ|) ) , unless the Exponential Time Hypothesis (ETH) [13] fails. The discrepancy between the state of the art for Closest String and Minimax Approval Voting raises interesting questions. First, does the additional constraint in Minimax Approval Voting really makes the problem harder and the PTAS has to be significantly slower? Similarly, although in Minimax Approval Voting the alphabet is binary, no O⋆ (2O(d) )-time algorithm is known, in contrary to Closest String. Can we find such an algorithm? The goal of this work is to answer these questions. 4 Our results We present three results on the complexity of Minimax Approval Voting. Let us recall that the Exponential Time Hypothesis (ETH) of Impagliazzo et al. [13] states that there exists a constant c > 0, such that there is no algorithm solving 3-SAT in time O⋆ (2cn ). During the recent years, ETH became the central conjecture used for proving tight bounds on the complexity of various problems, see [20] for a survey. We begin from showing that, unless the ETH fails, there is no algorithm for Minimax Approval Voting running in time O⋆ (2o(d log d) ). In other words, the algorithm of Misra et al. [24] is essentially optimal, and indeed, in this sense Minimax Approval Voting is harder than Closest String. Motivated by this, we then show a parameterized approximation scheme, i.e., a randomized Monte-Carlo algorithm which, given an instance (S, k, d) and a number ǫ > 0, finds a solution at distance at most (1 + ǫ)d in time O⋆ ((3/ǫ)2d ) or reports that there is no solution at distance at most d. Note that our lower bound implies that, under (randomized version of) ETH, this is essentially optimal, i.e., there is no parameterized approximation scheme running in time O⋆ (2o(d log(1/ǫ)) ). Indeed, if such an algorithm existed, by picking ǫ = 1/(d + 1) we get an exact algortihm which contradicts our lower bound. Finally, we get a new polynomialtime randomized approximation scheme for Minimax Approval Voting, which runs in time 2 nO(1/ǫ ·log(1/ǫ)) · poly(m). Thus the running time almost matches the one of the fastest known PTAS for Closest String (up to a log(1/ǫ) factor in the exponent). Organization of the paper In Section 2 we introduce some notation and we recall standard probabability bounds that are used later in the paper. In Section 3 we present our lower bound for Minimax Approval Voting parameterized by d. Next, in Section 4 we show a parameterized approximation scheme. Finally, in Section 5 we show a new randomized PTAS. The paper concludes with Section 6, where we discuss directions for future work. 2 Definitions and Preliminaries For every integer n we denote [n] = {1, 2, . . . , n}. For a set of words S ⊆ {0, 1}m and a word x ∈ {0, 1}m we denote H(x, S) = maxs∈S H(x, s). For a string s ∈ {0, 1}m , the number of 1’s in s is denoted as n1 (s) and it is also called the Hamming weight of s; similarly n0 (s) = m − n1 (s) denotes the number of zeroes. Moreover, the set of all strings of length m with k ones is denoted by Sk,m, i.e., Sk,m = {s ∈ {0, 1}m : n1 (s) = k}. s[j] means j-th letter of a string s. For a subset of positions P ⊆ [m] we define a subsequence s|P by removing letters on positions [m] \ P from s. 3 For a string s ∈ {0, 1}m , any string s′ ∈ Sk,m at distance |n1 (s) − k| from s is called a k-completion of s. Note that it is easy to find such a k-completion s′ : when n1 (s) ≥ k we obtain s′ by replacing arbitrary n1 (s) − k ones in s by zeroes; similarly when n1 (s) < k we obtain s′ by replacing arbitrary k − n1 (s) zeroes in s by ones. We will use the following standard Chernoff bounds (see e.g.Chapter 4.1 in [25]). Theorem 2.1. Let X1 , X2 , . . . , Xn be n independent random 0-1 P variables such that for every i = 1, . . . , n we have Pr [Xi = 1] = pi , for pi ∈ [0, 1]. Let X = ni=1 Xi . Then, • for any 0 < ǫ ≤ 1 we have:  (1)  (2)  (3) Pr [X > (1 + ǫ) · E [X]] ≤ exp − 31 ǫ2 · E [X] Pr [X < (1 − ǫ) · E [X]] ≤ exp − 12 ǫ2 · E [X] • for any 1 < ǫ we have: Pr [X > (1 + ǫ) · E [X]] ≤ exp − 13 ǫ · E [X] Pr [X < (1 − ǫ) · E [X]] = 0 3 (4) A lower bound In this section we show a lower bound for Minimax Approval Voting parameterized by d. To this end, we use a reduction from a problem called k × k-Clique. In k × k-Clique we are given a graph G over the vertex set V = [k] × [k], i.e., V forms a grid with k rows and k columns, and the question is whether in G there is a clique containing exactly one vertex in each row. Lemma 3.1. Given an instance I = (G, k) of k × k-Clique with k ≥ 2, one can construct ′ an instance I ′ = (S, k, d) of Minimax Approval Voting, such iff I  that I is a yes-instance 2k−2 2 is a yes-instance, d = 3k − 3 and the set S contains O(k k−2 ) strings of length k2 + 2k − 2 each. The construction takes time polynomial in the size of the output. Proof. Each string in the set S will be of size m = k2 + 2k − 2. Let us split the set of positions [m] into k + 1 blocks, where the first k blocks contain exactly k positions each, and the last (k + 1)-th block contains the remaining 2k − 2 positions. Our construction will enforce that if a solution exists, it will have the following structure: there will be a single 1 in each of the first k blocks and put all zeros in the last block. Intuitively the position of the 1 in the first block encodes the clique vertex of the first row of G, the position of the 1 in the second block encodes the clique vertex of the second row of, etc. We construct the set S as follows. • (nonedge strings) For each pair of nonadjacent vertices v, v ′ ∈ V (G) of G belonging to different rows, i.e., v = (a, b), v ′ = (a′ , b′ ), a 6= a′ , we add to S a string svv′ , where all the blocks except a-th and a′ -th are filled with zeros, while the blocks a, a′ are filled with ones, except the b-th position in block a and the b′ -th position in block a′ which are zeros (see Fig. 1). Formally, svv′ contains ones at positions {(a − 1)k + j : j ∈ [k], j 6= b} ∪ {(a′ − 1)k + j : j ∈ [k], j 6= b′ }. Note that the Hamming weight of svv′ equals 2k − 2.  • (row strings) For each row i ∈ [k] we create exactly 2k−2 k−2 strings, i.e., for i ∈ [k] and for each set X of exactly k − 2 positions in the (k + 1)-th block we add to S a string si,X having ones at all positions of the i-th block and at X, all the remaining positions are filled with zeros (see Fig. 2). Note that similarly as for the nonedge strings the Hamming weight of each row string equals 2k − 2, and to achieve this property we use the (k + 1)-th block. 4 0 ...0 1 ...1 0 1 ...1 0 ...0 0 on b-th position | {z a-th block 1 ...1 0 1 ...1 0 on } | b′ -th 0 ...0 position {z a′ -th block } Figure 1: Nonedge string. 0 ...0 1 ...1 | {z } 0 ...0 i-th block 0 0 1 0 1 1 0 ...0 1 0 | {z } ones on positions X ⊆ 2k−2 k−2 Figure 2: Row string. To finish the description of the created instance I ′ = (S, k, d) we need to define the target distance d, which we set d = 3k − 3. Observe that as the Hamming weight of each string s′ ∈ S equals 2k − 2, for s ∈ {0, 1}m with exactly k ones we have H(s, s′ ) ≤ d if and only if the positions of ones in s and s′ have a non-empty intersection. Let us assume that there is a clique K in G of size k containing exactly one vertex from each row. For i ∈ [k] let ji ∈ [k] be the column number of the vertex of K from row i. Define s as a string containing ones exactly at positions {(i − 1)k + ji : i ∈ [k]}, i.e., the (k + 1)-th block contains only zeros and for i ∈ [k] the i-th block contains a single 1 at position ji . Obviously s contains exactly k ones, hence it suffices to show that s has at least one common one with each of the strings in S. This is clear for the row strings, as each row string contains a block full of ones. For a nonedge string svv′ , where v = (a, b) and v ′ = (a′ , b′ ) note that K does not contain v and v ′ at the same time. Consequently s has a common one with svv′ in at least one of the blocks a, a′ . In the other direction, assume that s is a string of length m with exactly k ones such that the Hamming distance between s and each of the strings in S is at most d, which by construction implies that s as a common one with each of the strings in S. First, we are going to prove that s contains a 1 in each of the first k blocks (and consequently has only zeros in block k + 1). For the sake of contradiction assume that this is not the case. Consider a block i ∈ [k] containing only zeros. Let X be any set of k − 2 positions in block k + 1 containing zeros from s (such a set exists as block k + 1 has 2k − 2 positions). But the row string si,X has 2k − 2 ones at positions where s has zeros, and consequently H(s, si,X ) = k + (2k − 2) = 3k − 2 > d = 3k − 3, a contradiction. As we know that s contains exactly one one in each of the first k blocks let ji ∈ [k] be such a position of block i ∈ [k]. Create X ⊆ V (G) by taking the vertex from column ji for each row i ∈ [k]. Clearly X is of size k and it contains exactly one vertex from each row, hence it remains to prove that X is a clique in G. Assume the contrary and let v, v ′ ∈ X be two distinct nonadjacent vertices of X, where v = (i, ji ) and v ′ = (i′ , ji′ ). Observe that the nonedge string svv′ contains zeros at the ji -th position of the i-th block and at the ji′ -th position of the i′ -th block. Since for i′′ ∈ [k], i′′ 6= i, i′′ 6= i block i′′ of svv′ contains only zeros, we infer that the sets of positions of ones of s and svv′ are disjoint leading to H(s, svv′ ) = k + (2k − 2) = 3k − 2 > d, a contradiction. As we have proved that I is a yes-instance of k × k-Clique iff I ′ is a yes-instance of Minimax Approval Voting, the lemma follows. In order to derive an ETH-based lower bound we need the following theorem of Lokshtanov, Marx and Saurabh [21]. 5 Theorem 3.2. Assuming ETH, there is no 2o(k log k) -time algorithm for k × k-Clique. We are ready to prove the main result of this section. Theorem 3.3. Assuming ETH, there is no 2o(d log d) poly(n, m)-time algorithm for Minimax Approval Voting. Proof. Using Lemma 3.1, the input instance G of k × k-Clique is transformed into an equiv alent instance I ′ = (S, k, d) of Minimax Approval Voting, where n = |S| = O(k2 2k−2 k−2 ) = 2O(k) , each string of S has length m = O(k2 ) and d = Θ(k). It follows that a 2o(d log d) poly(n, m)time algorithm for Minimax Approval Voting solves k × k-Clique in time 2o(k log k) 2O(k) = 2o(k log k) , which contradicts ETH by Theorem 3.2. 4 Parameterized approximation scheme In this section we show the following theorem. Theorem 4.1. There exists a randomized algorithm which, given an instance   ({si }i=1,...,n , k, d) 2d of Minimax Approval Voting and any ǫ ∈ (0, 3), runs in time O 3ǫ mn and either (i) reports a solution at distance at most (1 + ǫ)d from S, or (ii) reports that there is no solution at distance at most d from S. In the latter case, the answer is correct with probabability at least 1 − p, for arbitrarily small fixed p > 0. Let us proceed with the proof. In what follows we assume p = 1/2, since then we can get the claim even if p < 1/2 by repeating the whole algorithm ⌈log2 (1/p)⌉ times. Indeed, then the algorithm returns incorrect answer only if each of the ⌈log2 (1/p)⌉ repetitions returned incorrect answer, which happens with probabability at most (1/2)log 2 (1/p) = p. Assume we are given a yes-instance and let us fix a solution s∗ ∈ Sk,m, i.e., a string at distance at most d from all the input strings. Our approch is to begin with a string x0 ∈ Sk,m not very far from s∗ , and next perform a number of steps. In j-th step we either conclude that xj−1 is already a (1 + ǫ)-approximate solution, or with some probability we find another string xj which is closer to s∗ . First observe that if |n1 (s1 ) − k| > d, then clearly there is no solution and our algorithm reports NO. Hence in what follows we assume |n1 (s1 ) − k| ≤ d. (5) We set x0 to be any k-completion of s1 . By (5) we get H(x0 , s1 ) ≤ d. Since H(s1 , s∗ ) ≤ d, by the triangle inequality we get the following bound. H(x0 , s∗ ) ≤ H(x0 , s1 ) + H(s1 , s∗ ) ≤ 2d. (6) Now we are ready to describe our algorithm precisely (see also Pseudocode 1). We begin with x0 defined as above. Next for j = 1, . . . , d we do the following. If for every i = 1, . . . , n we have H(xj−1 , si ) ≤ (1 + ǫ)d the algorithm terminates and returns xj−1 . Otherwise, fix any i = 1, . . . , n such that H(xj−1 , si ) > (1 + ǫ)d. Let Pj,0 = {a ∈ [m] : 0 = xj−1 [a] 6= si [a] = 1} and Pj,1 = {a ∈ [m] : 1 = xj−1 [a] 6= si [a] = 0}. The algorithm samples a position a0 ∈ Pj,0 and a position a1 ∈ Pj,1 . Then, xj is obtained from xj−1 by swapping the 0 at position a0 with the 1 at position a1 . If the algorithm finishes without finding a solution, it reports NO. The following lemma is the key to get a lower bound on the probablity that the xj ’s get close to s∗ . 6 Pseudocode 1: Parameterized approximation scheme for Minimax Approval Voting. 1 2 3 4 5 6 7 if |n1 (s1 ) − k| > d then return NO x0 ← any k-completion of s1 ; for j ∈ {1, 2, . . . , d} do if H(xj−1 , S) ≤ (1 + ǫ)d then return xj−1 otherwise there exists si s.t. H(xj−1 , si ) > (1 + ǫ)d; Pj,0 ← {a ∈ [m] : 0 = xj−1 [a] 6= si [a] = 1}; Pj,1 ← {a ∈ [m] : 1 = xj−1 [a] 6= si [a] = 0}; if min(|Pj,0 |, |Pj,1 |) = 0 then return NO Get xj from xj−1 by swapping 0 and 1 on random positions from Pj,0 and Pj,1 ); if H(xd , S) ≤ (1 + ǫ)d then return xd else return NO Q P x 0 1 0 1 si 1 0 0 1 s∗ 0 1 0 P0∗ P1∗ 1 Figure 3: Strings x, si and s∗ after permuting the letters. Lemma 4.2. Let x be a string in Sk,m such that H(x, si ) ≥ (1 + ǫ)d for some i = 1, . . . , n. Let s∗ ∈ Sk,m be any solution, i.e., a string at distance at most d from all the strings si , i = 1, . . . , n. Denote P0∗ = {a ∈ [m] : 0 = x[a] 6= si [a] = s∗ [a] = 1} , P1∗ = {a ∈ [m] : 1 = x[a] 6= si [a] = s∗ [a] = 0} . Then, min (|P0∗ | , |P1∗ |) ≥ ǫd . 2 Proof. Let P be the set of positions on which x and si differ, i.e., P = {a ∈ [m] : x[a] 6= si [a]}. (See Fig. 3.) Note that P0∗ ∪ P1∗ ⊆ P . Let Q = [m] \ P . The intuition behind the proof is that if min(|P0∗ |, |P1∗ |) is small, then s∗ differs too much from si , either because s∗ |P is similar to x|P (when |P0∗ | ≈ |P1∗ |) or because s∗ |Q has much more 1’s than si |Q (when |P0∗ | differs much from |P1∗ |). We begin with a couple of useful observations on the number of ones in different parts of x, si and s∗ . Since x and si are the same on Q, we get n1 (x|Q ) = n1 (si |Q ). (7) Since n1 (x) = n1 (s∗ ), we get n1 (x|P ) + n1 (x|Q ) = n1 (s∗ |P ) + n1 (s∗ |Q ), and further n1 (s∗ |Q ) − n1 (x|Q ) = n1 (x|P ) − n1 (s∗ |P ). (8) n1 (s∗ |P ) = |P0∗ | + n1 (x|P ) − |P1∗ |. (9) Finally note that We are going to derive a lower bound on H(si , s∗ ). First, H(si |P , s∗ |P ) = |P | − (|P0∗ | + |P1∗ |) = H(x, si ) − (|P0∗ | + |P1∗ |) ≥ (1 + ǫ)d − (|P0∗ | + |P1∗ |). 7 On the other hand, H(si |Q , s∗ |Q ) ≥ |n1 (s∗ |Q ) − n1 (si |Q )| = (7) = |n1 (s∗ |Q ) − n1 (x|Q ) = (8) = |n1 (x|P ) − n1 (s∗ |P )| = (9) = ||P1∗ | − |P0∗ || . It follows that d ≥ H(si , s∗ ) = H(si |P , s∗ |P ) + H(si |Q , s∗ |Q ) ≥ (1 + ǫ)d − (|P0∗ | + |P1∗ |) + ||P1∗ | − |P0∗ || = (1 + ǫ)d − 2 min(|P0∗ |, |P1∗ |). Hence, min(|P0∗ |, |P1∗ |) ≥ ǫd 2 as required. Corollary 4.3. Assume that there is a solution s∗ ∈ Sk,m and that the algorithm created a string xj , for some j = 0, . . . , d. Then, Pr[H(xj , s∗ ) ≤ 2d − 2j] ≥  ǫ 2j 3 . Proof. We use induction on j. For j = 0 the claim follows from (6). Consider j > 0. By the induction hypothesis, Pr[H(xj−1 , s∗ ) ≤ 2d − 2j + 2] ≥  ǫ 2j−2 3 . (10) Assume that H(xj−1 , s∗ ) ≤ 2d − 2j + 2. Since xj was created, H(xj−1 , si ) > (1 + ǫ)d for some i = 1, . . . , n. Since H(s∗ , si ) ≤ d, by the triangle inequality we get the following. |Pj−1,0 | + |Pj−1,1 | = H(xj−1 , si ) ≤ H(xj−1 , s∗ ) + H(s∗ , si ) ≤ 3d − 2j + 2 ≤ 3d. (11) Then, by Lemma 4.2 |P0∗ | · |P1∗ | Pr[H(xj , s ) ≤ 2d−2j | H(xj−1 , s ) ≤ 2d−2j +2] ≥ ≥ |Pj−1,0 | · |Pj−1,1 | ∗ ∗ The claim follows by combining (10) and (12).  ǫd 2 2  3d 2 2 =  ǫ 2 3 . (12) In order to increase the success probability, we repeat the algorithm until a solution is found or the number of repetitions is at least (3/ǫ)2d . By Corollary 4.3 the probablity that there is a solution but it was not found is bounded by  1−  ǫ 2d (3/ǫ)2d 3 = 1− 1 (3/ǫ)2d This finishes the proof of Theorem 4.1. 8 !(3/ǫ)2d ≤ e−1 < 1/2. Pseudocode 2: Parameterized approximation scheme for Minimax Approval Voting 1 2 3 4 5 5 Solve the LP (13–16) obtaining an optimal solution (x∗1 , . . . , x∗m , d∗ ); for j ∈ {1, 2, . . . , m} do Set x[j] ← 1 with probability x∗j and x[j] ← 0 with probability 1 − x∗j y ← any k-completion of x; return y A fast polynomial time approximation scheme The goal of this section is to present a PTAS for Minimax Approval Voting running in 2 time nO(1/ǫ ·log(1/ǫ)) · poly(m). It is achieved by combining the parameterized approximation scheme from Theorem 4.1 with the following result, which might be of independent interest. Throughout this section OPT denotes the value of the optimum solution s for the given instance ({si }i=1,...,n , k) of Minimax Approval Voting, i.e., OPT = maxi=1,...,n H(s, si ), Theorem 5.1. There exists a randomized polynomial time algorithm which, for arbitrarily small fixed p > 0, given an instance ({si }i=1,...,n , k) of Minimax Approval Voting and any ǫ > 0 such that OPT ≥ 122ǫ2ln n , reports a solution, which with probabability at least 1 − p is at distance at most (1 + ǫ) · OPT from S. In what follows, we prove Theorem 5.1. As in the proof of Theorem 4.1 we assume w.l.o.g. p = 1/2. Note that we can assume ǫ < 1, for otherwise it suffices to use the 2-approximation of Caragiannis et al. [5]. We also assume n ≥ 3, for otherwise it is a straightforward exercise to find an optimal solution in linear time. Let us define a linear program (13–16): minimize d m X xj = k (13) (14) j=1 X (1 − xj ) + j=1,...,m si [j]=1 X xj ≤ d ∀i ∈ {1, . . . , n} (15) ∀j ∈ {1, . . . , m} (16) j=1,...,m si [j]=0 xj ∈ [0, 1] The linear program (13–16) is a relaxation of the natural integer program for Minimax Approval Voting, obtained by replacing (16) by the discrete constraint xj ∈ {0, 1}. Indeed, observe that xj corresponds to the j-th letter of the solution x = x1 · · · xm , (14) states that n1 (x) = k, and (15) states that H(x, S) ≤ d. Our algorithm is as follows (see Pseudocode 2). First we solve the linear program in time poly(n, m) using the interior point method [14]. Let (x∗1 , . . . , x∗m , d∗ ) be the obtained optimal solution. Clearly, d∗ ≤ OPT. We randomly construct a string x ∈ {0, 1}m , guided by the values x∗j . More precisely, for every j = 1, . . . , m independently, we set x[j] = 1 with probabability x∗j . Note that x needs not contain k ones. Let y by any k-completion of x. The algorithm returns y. Clearly, the above algorithm runs in polynomial time. In what follows we bound the probability of error. To this end we prove upper bounds on the probabability that x is far from S and the probabability that the number of ones in x is far from k. This is done in Lemmas 5.2 and 5.3. Lemma 5.2.   Pr H(x, S) > (1 + 2ǫ ) · OPT ≤ 41 . 9 Proof. For every i = 1, . . . , n we define a random variable Di that measures the distance between x∗ and si X X Di = (1 − x[j]) + x[j]. j∈[m] si [j]=1 j∈[m] si [j]=0 Note that x[i] are independent 0-1 random variables. Using linearity of the expectation we obtain  X (1 − x[j]) + E[Di ] = E  j∈[m],si [j]=1 X = = X X E[x[j]] = j∈[m],si[j]=0 (1 − X x∗j ) + j∈[m],si[j]=1 ∗ x[j] = j∈[m],si [j]=0 (1 − E[x[j]]) + j∈[m],si[j]=1  X x∗j ≤ j∈[m],si [j]=0 ≤ d ≤ OPT. (17) Note that Di is a sum of m independent 0-1 random variables Xj = 1 − x[j] when si [j] = 1 OPT and Xj = x[j] otherwise. Denote δ = ǫ · 2E[D . We apply Chernoff bounds. For δ < 1 we have i] (17) (1)    Pr[Di > 1 + 2ǫ · OPT] ≤ Pr Di > E[Di ] + 2ǫ · OPT = Pr [Di > (1 + δ) · E[Di ]] ≤ !  2    (17) 1 ǫ · OPT OPT 2 ≤ exp − E[Di ] ≤ exp − ǫ· . 3 2E[Di ] 12 In case δ ≥ 1 we proceed analogously, using the Chernoff bound (3) Pr[Di > 1 + ǫ 2  (3)  ǫ · OPT · OPT] ≤ exp − 6   ǫ2 · OPT ≤ exp − 12 1>ǫ  . Now we use the union bound to get the claim.      Pr H(x, S) ≤ (1 + 2ǫ ) · OPT = Pr ∃i ∈ [n] Di > 1 + 2ǫ · OPT ≤  2  ǫ · OPT ≤ n · exp − ≤ 12 ! 122 ln n OPT · OPT < ≤ n · exp − 12 n≥3 < n−9 < Lemma 5.3. Proof. First we note that  Pr |n1 (x) − k| > E[n1 (x)] = E h X j∈[m] ǫ 2 1 . 4 (18)  1 · OPT < . 4 i X X (14) x[j] = E[x[j]] = x∗j = k. j∈[m] 10 j∈[m] (19) Pick an i = 1, . . . , n. Define the random variables X Ei = (1 − x[j]), Fi = j∈[m],si[j]=1 X x[j]. j∈[m],si[j]=0 Let Di = Ei + Fi , as in the proof of Lemma 5.2. By (17) we have E[Ei ] ≤ E[Ei ] + E[Fi ] = E[Di ] ≤ OPT (20) E[Fi ] ≤ OPT. (21) and analogously Both Ei and Fi are sums of independent 0-1 random variables and we apply Chernoff OPT bounds as follows. When 14 ǫ · E[E ≤ 1 then using (1) and (2) we obtain i]  (1),(2) 1 ≤ Pr Ei − E[Ei ] > ǫ · OPT 4     20 1 1 2 (OPT)2 1 1 2 (OPT)2 ≤ exp − · ǫ · 2 · E[Ei ] + exp − · ǫ · 2 · E[Ei ] ≤ 3 16 E [Ei ] 2 16 E [Ei ]   1 2 ≤ 2 · exp − ǫ · OPT , 48   OPT otherwise 14 ǫ · E[E > 1 , using (3) and (4), we have i]    (3),(4) 1 Pr Ei − E[Ei ] > ǫ · OPT ≤ 4   1 1 OPT · E[Ei ] + 0 ≤ ≤ exp − · ǫ · 3 4 E[Ei ]     1>ǫ 1 1 2 ≤ exp − ǫ · OPT ≤ 2 · exp − ǫ · OPT . 12 48 To sum up, in both cases we have shown that     1 1 2 Pr Ei − E[Ei ] > ǫ · OPT ≤ 2 · exp − ǫ · OPT . 4 48 (22) Similarly we show Pr     1 2 1 Fi − E[Fi ] > ǫ · OPT ≤ 2 · exp − ǫ · OPT . 4 48 We see that X n1 (x) = x[j] = n1 (si ) − j∈[m] X (1 − x[j]) + j∈[m],si [j]=1 X (23) x[j] = n1 (si ) − Ei + Fi (24) j∈[m],si [j]=0 and hence E[n1 (x)] = n1 (si ) − E[Ei ] + E[Fi ]. (25) ∀x, y ∈ R |x − y| > a =⇒ |x| > a/2 ∨ |y| > a/2. (26) Additionally we will use 11 Now we can write h i (19) i (24),(25) h Pr n1 (x) − k > 12 ǫ · OPT = Pr n1 (x) − E[n1 (x)] > 12 ǫ · OPT = h i (26) = Pr n1 (si ) − Ei + Fi − n1 (si ) + E[Ei ] − E[Fi ] > 12 ǫ · OPT ≤ i h Fi − E[Fi ] > 14 ǫ · OPT ≤ ≤ Pr Ei − E[Ei ] > 14 ǫ · OPT ∨ h i h i (22),(23) ≤ Pr Ei − E[Ei ] > 14 ǫ · OPT + Pr Fi − E[Fi ] > 14 ǫ · OPT ≤  assum.  n≥3 1 1 2 ≤ 4 · exp − 48 < 4. ǫ · OPT ≤ 4 · exp − 122 ln n 48 Now we can finish the proof of Theorem 5.1. By Lemmas 5.2 and 5.3 with probabability at least 1/2 both H(x, S) ≤ (1 + 21 ǫ) · OPT and H(y, x) = |n1 (x) − k| ≤ 12 ǫ · OPT. By triangle inequality this implies that H(y, S) ≤ (1 + ǫ) · OPT, with probability at least 1/2 as required. We conclude the section by combining Theorems 4.1 and 5.1 to get a fast PTAS. Theorem 5.4. For each ǫ > 0 we can find (1 + ǫ)-approximation solution for the Minimax  Approval Voting problem in time n any fixed r > 0. O log 1/ǫ ǫ2 · poly(m) with probability at least 1 − r, for Proof. First we run algorithm from Theorem 4.1 for d = ⌈ 122ǫ2ln n ⌉ and p = r/2. If it reports a solution, for every d′ ≤ d we apply Theorem 4.1 with p = r/2 and we return the best solution. If OPT ≥ d, even the initial solution is at distance at most (1 + ǫ)d ≤ (1 + ǫ)OPT from S. Otherwise, at some point d′ = OPT and we get (1 + ǫ)-approximation with probability at least 1 − r/2 > 1 − r. In the case when the initial run of the algorithm from Theorem 4.1 reports NO, we just apply the algorithm from Theorem 5.1, again with p = r/2. With probability at least 1−r/2 the answer NO of the algorithm from Theorem 4.1 is correct. Conditioned on that, we know that OPT > d ≥ 122ǫ2ln n and then the algorithm from Theorem 5.1 returns a (1 + ǫ)-approximation with probability at least 1 − r/2. Thus, the answer is correct with probabability at least (1 − r/2)2 > 1 − r. The total running time can be bounded as follows.   244 2ln n !   ln 1/ǫ     log 1/ǫ ǫ 3 O O ∗ ∗ 2 2 ǫ ǫ ⊆O n O · poly(m). ⊆n ǫ 6 Further research We conclude the paper with some questions related to this work that are left unanswered. Our PTAS for Minimax Approval Voting is randomized, and it seems there is no direct way of derandomizing it. It might be interesting to find an equally fast deterministic PTAS. The second question is whether there are even faster PTASes for Closest String or Minimax Approval Voting. Recently, Cygan, Lokshtanov, Pilipczuk, Pilipczuk and Saurabh [9] showed that under ETH, there is no PTAS in time f (ǫ) · no(1/ǫ) for Closest String. This extends to the same lower bound for Minimax Approval Voting, since we can try all values k = 0, 1, . . . , m. It is a challenging open problem to close the gap in the running time of PTAS either for Closest String or for Minimax Approval Voting. 12 References [1] Alexandr Andoni, Piotr Indyk, and Mihai Patrascu. On the Optimality of the Dimensionality Reduction Method. In 47th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2006, pages 449–458, 2006. [2] Steven J. Brams, D. Marc Kilgour, and M. Remzi Sanver. A Minimax Procedure for Electing Committees. Public Choice, 132(3-4):401–420, 2007. [3] Robert Bredereck, Jiehua Chen, Piotr Faliszewski, Jiong Guo, Rolf Niedermeier, and Gerhard J. Woeginger. Parameterized Algorithmics for Computational Social Choice: Nine Research Challenges. Tsinghua Science and Technology, 19(4):358–373, Aug 2014. [4] Jaroslaw Byrka and Krzysztof Sornat. PTAS for Minimax Approval Voting. In Proceedings of 10th International Conference Web and Internet Economics, WINE 2014, pages 203– 217, 2014. [5] Ioannis Caragiannis, Dimitris Kalaitzis, and Evangelos Markakis. Approximation Algorithms and Mechanism Design for Minimax Approval Voting. In Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, AAAI, 2010. [6] John R. Chamberlin and Paul N. Courant. Representative Deliberations and Representative Decisions: Proportional Representation and the Borda Rule. American Political Science Review, 77:718–733, 9 1983. [7] Vincent Conitzer. Making Decisions Based on the Preferences of Multiple Agents. Commun. ACM, 53(3):84–94, 2010. [8] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. [9] Marek Cygan, Daniel Lokshtanov, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Lower Bounds for Approximation Schemes for Closest String. In 15th Scandinavian Symposium and Workshops on Algorithm Theory, SWAT 2016, pages 12:1–12:10, 2016. [10] Cynthia Dwork, Ravi Kumar, Moni Naor, and D. Sivakumar. Rank aggregation methods for the Web. In Proceedings of the Tenth International World Wide Web Conference, WWW 2001, pages 613–622, 2001. [11] Peter C. Fishburn. Axioms for Approval Voting: Direct Proof. Journal of Economic Theory, 19(1):180–185, 1978. [12] Jens Gramm, Rolf Niedermeier, and Peter Rossmanith. Fixed-Parameter Algorithms for Closest String and Related Problems. Algorithmica, 37(1):25–42, 2003. [13] Russell Impagliazzo and Ramamohan Paturi. On the Complexity of k-SAT. J. Comput. Syst. Sci., 62(2):367–375, 2001. [14] Narendra Karmarkar. A New Polynomial-time Algorithm for Linear Programming. Combinatorica, 4(4):373–396, 1984. [15] D. Marc Kilgour. Approval Balloting for Multi-winner Elections. In Jean-François Laslier and Remzi M. Sanver, editors, Handbook on Approval Voting, pages 105–124. Springer Berlin Heidelberg, Berlin, Heidelberg, 2010. 13 [16] J.F. Laslier and M.R. Sanver. Handbook on Approval Voting. Studies in Choice and Welfare. Springer Berlin Heidelberg, 2010. [17] Rob LeGrand. Analysis of the Minimax Procedure. Technical Report WUCSE-200467, Department of Computer Science and Engineering, Washington University, St. Louis, Missouri, 2004. [18] Rob LeGrand, Evangelos Markakis, and Aranyak Mehta. Some Results on Approximating the Minimax Solution in Approval Voting. In 6th International Joint Conference on Autonomous Agents and Multiagent Systems, AAMAS 2007, pages 1193–1195, 2007. [19] Ming Li, Bin Ma, and Lusheng Wang. On the Closest String and Substring Problems. Journal of the ACM, 49(2):157–171, 2002. [20] Daniel Lokshtanov, Dániel Marx, and Saket Saurabh. Lower Bounds Based on the Exponential Time Hypothesis. Bulletin of the EATCS, 105:41–72, 2011. [21] Daniel Lokshtanov, Dániel Marx, and Saket Saurabh. Slightly Superexponential Parameterized Problems. In Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2011, pages 760–776, 2011. [22] Tyler Lu and Craig Boutilier. Budgeted Social Choice: From Consensus to Personalized Decision Making. In Proceedings of the 22nd International Joint Conference on Artificial Intelligence, IJCAI 2011, pages 280–286, 2011. [23] Bin Ma and Xiaoming Sun. More Efficient Algorithms for Closest String and Substring Problems. SIAM Journal of Computing, 39(4):1432–1443, 2009. [24] Neeldhara Misra, Arshed Nabeel, and Harman Singh. On the Parameterized Complexity of Minimax Approval Voting. In Proceedings of the 2015 International Conference on Autonomous Agents and Multiagent Systems, AAMAS 2015, pages 97–105, 2015. [25] Rajeev Motwani and Prabhakar Raghavan. Randomized Algorithms. Cambridge University Press, 1995. [26] Piotr Krzysztof Skowron, Piotr Faliszewski, and Jérôme Lang. Finding a Collective Set of Items: From Proportional Multirepresentation to Group Recommendation. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, AAAI 2015, pages 2131– 2137, 2015. 14
8cs.DS
Optimal rates of entropy estimation over Lipschitz balls arXiv:1711.02141v1 [math.ST] 6 Nov 2017 Yanjun Han, Jiantao Jiao, Tsachy Weissman, and Yihong Wu∗ November 8, 2017 Abstract We consider the problem of minimax estimation of the entropy of a density over Lipschitz balls. Dropping the usual assumption that the density is bounded away from zero, we obtain s the minimax rates (n ln n)− s+d + n−1/2 for 0 < s ≤ 2 in arbitrary dimension d, where s is the smoothness parameter and n is the number of independent samples. Using a two-stage approximation technique, which first approximate the density by its kernel-smoothed version, and then approximate the non-smooth functional by polynomials, we construct entropy estimators that attain the minimax rate of convergence, shown optimal by matching lower bounds. One of the key steps in analyzing the bias relies on a novel application of the HardyLittlewood maximal inequality, which also leads to a new inequality on Fisher information that might be of independent interest. Contents 1 Introduction 1.1 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 6 6 6 2 Construction of the estimator 2.1 A general recipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Poissonization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Construction of the optimal estimator . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 8 8 3 Proof of upper bound 3.1 First-stage approximation error . . . . . . . . . . 3.1.1 Mutual information and χ2 -divergence . . 3.1.2 Approximation by C 2 functions . . . . . . 3.1.3 Application of Hardy-Littlewood maximal 3.2 Second-stage approximation error and variance . 3.3 Overall performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . inequality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 13 13 15 16 18 19 4 Proof of lower bound 21 4.1 Reduction to a parametric submodel . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2 Construction of two priors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3 Minimax lower bound in the parametric submodel . . . . . . . . . . . . . . . . . . . 26 ∗ Yanjun Han, Jiantao Jiao, Tsachy Weissman are with the Department of Electrical Engineering, Stanford University. Yihong Wu is with the Department of Statistics and Data Science, Yale University. 1 5 Further discussions 28 5.1 The case of s > 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.2 Suboptimality of the plug-in estimator . . . . . . . . . . . . . . . . . . . . . . . . . . 28 A Auxiliary lemmas 29 B Proof of main lemmas B.1 Proof of Lemma 1 . B.2 Proof of Lemma 4 . B.3 Proof of Lemma 6 . B.4 Proof of Lemma 7 . B.5 Proof of Lemma 8 . B.6 Proof of Corollary 2 B.7 Proof of Lemma 10 . B.8 Proof of Lemma 13 . B.9 Proof of Lemma 14 . B.10 Proof of Lemma 16 . 31 31 32 33 34 36 39 43 43 46 49 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction Estimation of functionals of data generating distributions is a fundamental problem in statistics. While this problem is relatively well-understood in finite dimensional parametric models [BKB+ 93, VdV00], the corresponding nonparametric counterparts are often much more challenging and have attracted tremendous interest over the last two decades. Initial efforts have focused on inference of linear, quadratic, and cubic functionals in Gaussian white noise and density models and have laid the foundation for the ensuing research. We do not attempt to survey the extensive literature in this area, but instead refer to the interested reader to, e.g., [HM87, BR88, DN90, Fan91, BM95, KP96, Lau96, Nem00, CL03, CL05, TLRvdV08] and the references therein. The monograph by [Nem00] provides a general treatment of estimating smooth functionals and discusses cases where efficient parametric rate of estimation is possible. Recently, there has been progresses toward the understanding of more complex nonparametric functionals over substantially more general observational models. These include causal effect functionals in observational studies and mean functionals in missing data models. For more details, we refer to [RLTvdV08, RLM+ 16, MNR17], which considers a general recipe to yield minimax estimation of a large class nonparametric functionals common in statistical literature. However, among the class of nonparametric functionals considered in literature, most of the research endeavors, at least from the point of view of minimax optimality, have focused on “smooth functionals” (see [RLTvdV08] for a discussion on general classes of “smooth functionals”). In contrast, the results on optimal estimation of non-smooth functionals have been comparatively sporadic [HI80,Don97,KT12]. Notably, the seminal papers of [LNS99] and [CL11] considered the estimating of Lr -norms in Gaussian mean models. Subsequently, significant progress has been made on testing and estimation of non-smooth functionals, such as the Shannon entropy, support size, total variation and Kullback-Leibler (KL) divergence, for discrete distributions on large domains (see, e.g., [Pan04, VV11, JVHW15, WY16, WY15, HJW16, JHW16]). An important non-smooth functional of probability density function is the entropy, which has been the subject of extensive studies. The main goal of this paper is to resolve the minimax rates of entropy estimation in the density model under smoothness constraints, specifically, over Lipschitz 2 classes. To this end, consider the following i.i.d. sampling model: i.i.d X1 , · · · , Xn ∼ f where f is a probability density function supported on [0, 1]d . The goal is to estimate the entropy (also known as the differential entropy in the information theory literature) of the density f : Z −f (t) ln f (t)dt, H(f ) , [0,1]d This problem has extensive applications in various fields such as information theory, neuroscience, time series, and machine learning (c.f. [KSG04, CH04, HSPVB07] and the survey [BDGVdM97, WKV09]). In this paper, we assume that the density satisfies a smoothness constraint as well as a certain “periodic boundary condition.”, i.e., the periodic extension of the density f lies in the Lipschitz ball Lipsp,d (L) with smoothness parameter s ∈ (0, 2], norm parameter p ∈ [2, ∞) and dimensionality d ∈ N , {1, 2, · · · }. Specifically, the Lipschitz ball is defined as Lipsp,d (L) , {f : kf kLipsp,d ≤ L} where with r , ⌈s⌉, the Lipschitz norm k · kLipsp,d is defined as kf kLipsp,d , kf kp + sup t−s ωr (f, t)p , (1) t>0 ωr (f, t)p , sup e∈Rd ,|e|≤1 ∆rh f (x) , r X k∆rte f (·)kp , r−k (−1) k=0 (2)     r r  h , f x+ k− 2 k h ∈ Rd . (3) Here |x| denotes the Euclidean norm of a vector x ∈ Rd and for 1 ≤ p ≤ ∞, k · kp denotes the Lp norm of measurable functions on [0, 1]d . By periodic extension of f , we mean f defined by f (x mod 1) , f (x1 − ⌊x1 ⌋, x2 − ⌊x2 ⌋, · · · , xd − ⌊xd ⌋), for x = (x1 , · · · , xd ) ∈ Rd . The main result of this paper is the following characterization of the minimax rate of convergence: Theorem 1. For any d ∈ N, 0 < s ≤ 2 and 2 ≤ p < ∞, there exists L0 > 0 depending on s, p, d, such that for any L ≥ L0 and any n ∈ N, s − s+d c((n ln n) +n − 21 !1 2 )≤ inf 2 sup Ĥ f ∈Lipsp,d (L) Ef (Ĥ − H(f )) s 1 ≤ C((n ln n)− s+d + n− 2 ) where c and C are constants depending on s, p, d, L. Corollary 1. For entropy estimation over the Lipschitz ball Lipsp,d (L) with 0 < s ≤ 2 and 2 ≤ p < 1 ∞, the parametric rate n− 2 is attainable if and only if s ≥ d. Theorem 1 is the first characterization of the minimax risk for entropy estimation within constant factors in arbitrary dimensions, without assuming that the density is bounded away from zero. Specifically, the main contributions of this paper are as follows: 3 s and • We obtain the exact expression of the minimax rate, including the sharp exponent s+d the exact logarithmic factor. We also proposed the first minimax rate-optimal estimator for entropy over the Lipschitz balls Lipsp,d (L) for 0 < s ≤ 2 in any dimension. • We propose a general recipe for constructing minimax rate-optimal estimators of non-smooth nonparametric functionals. Specifically, we propose the so-called two-stage approximation technique which involves first approximating the density function (by kernel-smoothed density) and then approximating the functional (by polynomials). Similar techniques have been applied in [INH87, Nem00] to obtain asymptotic efficient estimators for smooth functionals (where Taylor expansion is employed in the second stage), and in [LNS99] to estimate the L1 norm of the mean in Gaussian white noise (with trigonometric approximation in the second stage). Recently, the two-stage approximation technique was explicitly carried out in [HJMW17] to fully characterize the minimax rate of convergence for estimating the Lr -norms (for all r ∈ [1, ∞)) of the mean function in Gaussian white noise model over Nikolskii-Besov spaces. • We demonstrate the drastically different behavior of functional estimation in Gaussian white noise model and the density model. It is well known that these two models are asymptotically equivalent [Nus96] for s > 21 provided that the density is bounded below by a constant; however, it is worth emphasizing that these equivalence results do not imply a given estimation problem need to have the same rates in these two models. In fact, in contrast to Corollary 1, it is shown in [HJMW17] that the parametric rate is never achievable for entropy estimation in the white noise model. Furthermore, as will be elaborated in Section 5, there exist crucial differences between these two models which enable [HJMW17] to deal with general smoothness s > 0 in the white noise model but the current approach for the density model fails for s > 2. • We improve the best known minimax lower bound for estimating non-smooth nonparametric 4s 1 functionals. The well-known lower bound n− 4s+d + n− 2 [BM95], which is optimal for smooth functionals such as quadratic functionals, is loose for our purpose. Instead, we reduce the nonparametric problem into a parametric submodel, and construct lower bound via the duality between moment matching and best approximation using rational functions, which appears to be novel in the nonparametric statistics literature. • We tackle the non-smooth entropy functional directly and do not impose any lower bound on the density f . Existing results on entropy estimation frequently assume – either explicitly or implicitly – that f (x) ≥ c everywhere for some constant c > 0. In fact, this boundedness assumption makes the entropy estimation problem significantly easier: note that the function y 7→ y ln y is in fact smooth when y ≥ c and, consequently, the general technique for estimating smooth nonparametric functionals [RLTvdV08, RLM+ 16, MNR17] can be directly 4s applied to achieve the minimax rate n− 4s+d + n−1/2 . In this paper, we show that polynomial approximation provides the right tool to deal with the non-smoothness of y ln y at y = 0, which has been previously used to construct rate-optimal estimators for the Shannon entropy and KL divergence for discrete distributions [JVHW15, WY16, HJW16, BZLV16]. Next we elaborate on the various assumptions in Theorem 1: • The Lipschitz ball Lipsp,d (L): it is well-known that smoothness conditions are usually necessary in non-parametric problems. A widely used smoothness class is the Hölder ball, i.e., for s = r + α with r integer and α ∈ (0, 1], the Hölder ball Hsd (L) with smoothness s and radius 4 L consists of functions f with sup x6=y |f (r) (x) − f (r) (y)| ≤ L. |x − y|α The Lipschitz ball is an generalization of the Hölder ball by imposing the smoothness constraint on average through the norm parameter p; for example, for p = ∞ the Lipschitz ball coincides with the Hölder Lips∞,d (L) = Hsd (L) for any non-integer s > 0.1 • Radius of the Lipschitz ball: The assumption that the radius satisfies L ≥ L0 is not superfluous. Indeed, if sp ≥ d, then by standard embedding results of Lipschitz (or NikolskiiBesov) spaces [Jaw77], there exists L1 = L1 (s, p, d) such that any f ∈ Lipsp,d (L1 ) is bounded below by a positive constant almost everywhere,2 which, in view of the previous results [RLTvdV08, RLM+ 16, MNR17], implies that the entropy can be estimated at a faster rate 4s n− 4s+d + n−1/2 than that in Theorem 1. • The smoothness condition s ∈ (0, 2]: Capturing high-order smoothness s > 2 of a function is often challenging in nonparametric statistics, especially for density models. For example, if one would like to apply a kernel density estimator, for s > 2 there does not exist a non-negative kernel to keep all polynomials with degree at most ⌊s⌋. We will discuss this phenomenon in details in Section 5.1. • The norm condition p ∈ [2, ∞): Our current upper bound requires p ≥ 2, which ensures the difference between the entropy of the true density and its kernel-smoothed version is at the right order. For the lower bound, the case of p = ∞ imposes a too strict constraint on the density (i.e., to be smooth everywhere), while p < ∞ only imposes an average-case smoothness constraint which can be handled by the current construction. • The periodic extension of f (torus assumption): for general nonparametric functional estimation problem, there are essentially three factors contributing to the minimax rates: the tail behavior if f is supported on Rd , the boundary behavior if f is compactly supported, and the behavior of f in the interior of its domain. We have adopted the convention to assume f to be compactly supported to avoid the necessity of imposing conditions on the tail of f , but sliding window kernel methods usually can not deal with the boundary effects without additional assumptions [KA05]. Indeed, near the boundary the sliding window kernel density estimator may have a significantly larger bias than that of the interior points. In the nonparametric statistics literature, it is usually assumed that the density has its value and all the derivatives vanishing at the boundary, and our assumptions are in fact weaker than that, which has appeared in the literature [KKPW14]. For example, when d = 1, s = 1 and p = ∞, an equivalent formulation is to assume that an equivalent formulation is that f satisfies periodic boundary conditions, namely, f (0) = f (1) and f ′ (0) = f ′ (1), or in other words, we can view that the density is defined on the d-dimensional torus Td . 1 Note that there is another slightly different definition of the Lipschitz ball, with the Lipschitz norm Lipsp,d replaced s by a slight modification Lip∗s p,d , which coincides with a special case of Besov ball Bp,∞,d [DL93]. These two definitions coincide for non-integer s, while for integer s the latter is strictly bigger. In this paper we adopt the former definition of the Lipschitz ball in (1) to avoid some technical subtleties. 2 In fact, [Jaw77, Theorem 2.1] states that if sp ≥ d, kf (·) − f (· − t)k∞ ≤ C(s, p, d)kf (·) − f (· − t)kLipsp,d for any t ∈ [0, 1]d . Since there must be some x0 ∈ [0, 1]d such that f (x0 ) ≥ 1, we conclude that f (x) ≥ 1 − 2C(s, p, d)L for almost every x ∈ [0, 1]d , which is bounded below by a constant if L is sufficiently small. 5 1.1 Related work The problem of estimating the entropy of density functions has been investigated extensively in the literature. As discussed in the overview [BDGVdM97], there exist two main approaches, based on either kernel density estimators, e.g. [Joe89, GVdM91, HM93, PY08, KKP+ 15] or nearest neighbor methods, e.g. [TVdM96, SRH12, SP16, BSY16, DF17, GOV17]. Among these works, √ some focus on the consistency [GVdM91, PY08], n-consistency [Joe89, TVdM96], or the asymptotic efficiency [HM93, BSY16] of the proposed estimator, while others work on the minimax rate [SRH12, KKP+ 15, SP16, DF17, GOV17]. A prevailing assumption is that the density is uniformly bounded away from zero [Hal84, Joe89, VE92, KKP+ 15, SRH12], while others impose various assumptions quantifying on average how close the density is to zero [HM93, Lev78, TVdM96, EHHG09, GOV16, SP16, DF17, GOV17]. To the best of our knowledge, our work is the first that provides an entropy estimator with provable guarantees on minimax rates over Lipschitz balls (or even the simpler Hölder balls) without assuming the density is bounded away from zero. 1.2 Notations For a finite set A, let |A| denote its cardinality. For x, y ∈ Rd , let x · y denote their inner product, and x\i , (xj : j 6= i) ∈ Rd−1 . Throughout the paper, for non-negative sequences {aγ } and {bγ }, we write aγ . bγ (or an = O(bn )) if aγ ≤ Cbγ for some positive constant C that does not depend on the sample size n or the bandwidth h. We use aγ & bγ (or aγ = Ω(bγ )) to denote bγ . aγ , and aγ ≍ bγ (or aγ = Θ(bγ )) to denote both aγ . bγ and bγ . aγ . We use aγ ≪ bγ (or aγ = o(bγ )) a to denote limγ bγγ = 0, and aγ ≫ bγ (or aγ = ω(bγ )) to denote bγ ≪ aγ . The support set of a probability measure µ is denoted by supp(µ). The KL divergence from distribution µ to ν is defined R as D(µkν) = dµ log dµ dν if µ ≪ ν and +∞ otherwise. 1.3 Organization The rest of this paper is organized as follows. Section 2 presents a general recipe based on two-stage approximation and the explicit construction of the optimal entropy estimator. Section 3 proves the upper bound. In particular, the analysis of the bias incurred by the first-stage approximation relies on a novel application of the Hardy-Littlewood maximal inequality, and the same argument also leads to an inequality on Fisher information, which is presented at the end of Section 3.1 and might be of independent interest. The minimax lower bound is proved in Section 4. Section 5 discusses generalizations and open problems, and shows that the conventional plug-in estimator does not achieve the minimax rate convergence. 2 2.1 Construction of the estimator A general recipe In the parametric case, there has been a recent wave of study [CL11, JVHW15, WY16, HJW16, JHW16] on the estimation of non-smooth functionals of high-dimensional parameters based on approximation-theoretic approach. Roughly speaking, the idea is to split the entire parameter space into “smooth” and “non-smooth” regimes according to the analytic property of the functional. Then in the “non-smooth” regime, we approximate the functional by a simpler one, e.g., polynomials, and use the unbiased estimator of the approximant, whereas in the “smooth” regime we simply use the plug-in approach with possible bias correction. This motivates us, in the nonparametric case, to use polynomial approximation as a proxy for the non-smooth functional. 6 Moreover, as is well known in nonparametric statistics, the smoothness of the density or regression function determines the optimal estimation rates, achieved by the unbiased estimator designed for the kernel-smoothed approximation of the function. Notably, the estimation of several classes of smooth functionals has been studied, e.g., the linear, quadratic and cubic functionals. Specifically, the plug-in approach was essentially used in these examples, while some complicated bias-correction techniques need to be used simultaneously to result in the minimax estimators. These ideas have also been extended to estimate general smooth nonparametric functionals. However, the estimation problem of non-smooth nonparametric functionals remains largely open, which leads to the question: Question. In the nonparametric non-smooth functional estimation problem, how to approximate the function and the functional simultaneously? In the recent work [HJMW17], a two-stage approximationR technique is proposed to construct the minimax estimator for nonparametric functionals I(f ) = φ(f (x))dx: • First-stage approximation: approximate the nonparametric function f locally with bandwidth h to form fh , and then aim at estimating I(fh ) instead of I(f ); • Second-stage approximation: apply the polynomial approximation-based construction [LNS99, CL11, HJW16, WY16], namely, replace φ by its best polynomial approximation Q, estimate Q(fh (x)) for any x, and integrate the estimates to form the final estimator. The main utility of replacing f by fh is that this approximation essentially reduces our nonparametric problem into a parametric one. For example, in the Gaussian white noise model σ dYt = f (t)dt + √ dBt , n t ∈ [0, 1] there is no unbiased estimator for f (x0 ) at a given x0 ∈ [0, 1]; however, if we define the kernelsmoothed approximation Z 1 Kh (x − y)f (y)dy fh (x) , 0 where Kh (·) is some suitable kernel of bandwidth h (supported on [−h, +h]), then f and fh are pointwise close thanks to the smoothness of f . Moreover, the statistic Z 1 ˆ Kh (x − y)dYy fh (x) = 0 is a natural unbiased estimator of fh (x). Furthermore, fˆh (x) ∼ N (fh (x), σh2 ) for some common variance σh2 , and fˆh (x), fˆh (y) are independent whenever |x−y| > h. As a result, we essentially obtain a parametric Gaussian location model with h−1 parameters, where the parametric approximationbased approach can be employed to solve the functional estimation problem. This approach has been proved to be optimal in estimating the Lr norm of nonparametric functions in the Gaussian white noise model in [HJMW17]. Similar phenomenon also occurs in the density estimation model. In fact, if we define Z 1 Kh (x − y)f (y)dy, fh (x) , 0 7 this quantity again admits a unbiased estimator n 1X fˆh (x) , Kh (x − Xi ), n i=1 i.i.d. where X1 , · · · , Xn ∼ f . Moreover, it will be made clear that fˆh (x) roughly follows the binomial distribution hfˆh (x) ∼ B(n, hfh (x)), which implies that we have essentially arrived at a parametric binomial model. Hence, it is expected that the previous two-stage approximation technique also works in the density estimation model, and it is indeed the case as shown in Section 2.3 for the estimation of differential entropy. 2.2 Poissonization For the technical simplicity, we introduce the following Poisson sampling model: instead of drawing n independent observations X1 , · · · , Xn from the density f , consider a Poisson random measure M on [0, 1]d with mean measure nf (x)dx, whose atoms are denoted by X1 , . . . , XN . In other words: 1. For any measurable A ⊂ [0, 1]d , we have   Z f (x)dx . M (A) , |{1 ≤ i ≤ N : Xi ∈ A}| ∼ Poi n A 2. For any collection of disjoint subsets {Ai , i ≥ 1}, the random variables {M (Ai ), i ≥ 1} are mutually independent. The idea of Poissonization is motivated by the asymptotic equivalence between the density estimation model and the Poisson sampling model [BCL+ 04]. The independence in the Poisson sampling model plays an important role in the theoretical analysis of our estimator, and we can relate the Poisson sampling model to the original model as follows: the sample size N = M ([0, 1]d ) is distributed as Poi(n); conditioning on N = m, the random variables X1 , · · · , Xm are i.i.d. according to the density f . This fact helps us to establish the following lemma, which shows that the minimax risk of entropy estimation is essentially the same under both models and it suffices to work with the Poisson sampling model. Analogous results appeared in [WY16, Eqn. (11)] and [JVHW15, Lemma 16] in the discrete setting. Lemma 1. Denote by Rn (Lipsp,d (L)) the minimax risk in estimating the entropy over the Lipschitz ball Lipsp,d (L) in the original sampling model, and denote by RnP (Lipsp,d (L)) its counterpart in the Poisson sampling model. For p ≥ 2, the following inequality holds:  n 1 · (e−1 + L2 )2 . R2n (Lipsp,d (L)) ≤ RnP (Lipsp,d (L)) ≤ R n2 (Lipsp,d (L)) + exp − 2 8 2.3 Construction of the optimal estimator Now we apply the two-stage approximation method to construct the optimal entropy estimator for any s ∈ (0, 2] in any dimension. For the first approximation stage we would like to find a suitable approximation fh for f . We recall the following characterization of Lipschitz spaces [HKPT12, Theorem 8.1]: 8 R < ∞ and Lemma 2. Fix any s > 0 and any kernel K : Rd → R which satisfies Rd |x|⌈s⌉ |K(x)|dx R maps any polynomial p in d variables of degree at most ⌈s⌉ − 1 to themselves, i.e., Rd p(y)K(x − y)dy = p(x). Then for any f ∈ Lipsp,d (L) and   Z x−y 1 K f (y)dy, fh (x) = d h [0,1]d h we have kfh − f kp = Z p x∈[0,1]d |fh (x) − f (x)| dx !1/p . hs . To apply Lemma 2, we choose a kernel K with the following properties: Assumption 1. Suppose K : Rd → R satisfies the following: 1. Non-negativity: K(t) ≥ 0 for any t ∈ Rd ; R 2. Unit total mass: Rd K(t)dt = 1; R 3. Zero mean: Rd tK(t)dt = 0; R 4. Finite second moment: Rd |t|2 K(t)dt < ∞. 5. Compact support: sup{|t| : K(t) 6= 0} < ∞. There are several kernel functions which fulfill Assumption 1, e.g., the box kernel K(t) = 1[− 21 , 21 ]d (t). Note that the second and the third requirements ensure that it keeps all polynomials R of degree at most one, i.e., Rd (a · x + b)K(x − y)dx = a · y + b, and the first requirement (nonnegativity) is crucial for proving the concentration result in Section 3. In fact, the non-negativity requirement is the key reason why we need to impose the assumption s ≤ 2, and relaxing this requirement appears highly challenging (cf. Section 5.1). Now by defining Kh (t) , h−d K(h−1 t), we consider the following approximation of f : Z f (x − y)Kh (y)dy, ∀x ∈ [0, 1]d . (4) fh (x) = Rd Here and below the subtraction x − y is understood on the torus [0, 1)d mod 1, i.e., (x − y) mod 1 = x − y − ⌊x − y⌋ componentwise. Equivalently, when we evaluate the function f at points outside the unit cube, the periodic extension of f is understood. By Lemma 2 and our assumption that s ≤ 2, we have kf − fh kp . hs . (5) The approximation fh admits a natural kernel density estimator: 1(N ≥ n2 ) X fˆh (x) , Kh (x − Xi ), N N i=1 ∀x ∈ [0, 1]d . (6) Conditioned on the realization of N , fˆh (x) is an unbiased estimator of fh (x): for any m ≥ n/2,   m 1 X ˆ E Kh (x − Xi ) N = m E[fh (x)|N = m] = m i=1 Z f (y)Kh (x − y)dy = fh (x). = Rd 9 Note that we impose the requirement N ≥ n2 to rule out the possibility that there may not be enough samples in the Poisson sampling model, which deteriorates the estimation performance. Since N ∼ Poi(n), N ≥ n2 occurs with high probability (cf. Lemma 18). Once we fix an appropriate kernel K that fulfills Assumption 1 and define fh , fˆh as in (4) and (6), our estimator Ĥ(x) for −fh (x) ln fh (x) is constructed as follows: 1. Split the samples into three parts as follows, i.e., attach a random label uniformly distributed on {1, 2, 3} independently to each observation X1 , · · · , XN , and the observations are partitioned into X (1) , X (2) , X (3) according to the label. By the property of the Poisson process, each subset of samples defines a Poisson random measure with rate replaced by n/3, and different subsets are independent. In the sequel we redefine n/3 as n for notational simplicity; 2. For each part of samples, construct the kernel density estimators fˆh,1 (x), fˆh,2 (x) and fˆh,3 (x) per (6). The estimator fˆh,1 (x) will be used for classifying smooth versus non-smooth regime, and the other two for estimation; 3. Regime classification and estimator construction: • “Non-smooth” regime: fˆh,1 (x) < 1 ln n imation of −t ln t on [0, 2cnh d ]: Q(t) = k X c1 ln n . nhd Consider the best degree-k polynomial approx- al tl = arg min max P ∈Polyk t∈[0, 2c1 ln n ] d l=0 nh | − t ln t − P (t)|, (7) where Polyk denote the collection of all polynomials of degree at most k. Define the (almost) unbiased estimator of Q(fh (x)):    −1 k X X Y n N (2) Ĥ1 (x) = 1(N ≥ ) · Kh (x − Xj ) . al  2 l J⊂[N ],|J|=l j∈J l=0 • “Smooth” regime: fˆh,1 (x) ≥ Ĥ2 (x) = 1(N ≥ c1 ln n . nhd Define the following bias-corrected plug-in estimator: n c1 ln n )1(fˆh,2 (x) ≥ )· 2 4nhd − fˆh,2 (x) ln fˆh,2 (x) 1 ˆ − (1 + ln fˆh,2 (x))(fˆh,3 (x) − fˆh,2 (x)) − fh,2 (x) 2 !! X 1 (3) (3) − 2fˆh,3 (x) + N  Kh (x − Xi )Kh (x − Xj ) . fˆh,2 (x) 2 i<j • The final point estimate of H(x) = −fh (x) ln fh (x) is     c1 ln n 1 ˆ Ĥ(x) , min Ĥ1 (x), 1−2ǫ d 1 fh,1 (x) < n h nhd   c1 ln n . + Ĥ2 (x)1 fˆh,1 (x) ≥ nhd 10 (8) 4. Finally, choose 1 h = c0 (n ln n)− s+d , where c0 > 0 is any constant, 0 < ǫ < Lemma 22) and output the estimator s s+d , Ĥ = k = ⌈c2 ln n⌉, ǫ 8 ln 2 0 < c2 < Z (9) and c1 > 0 is sufficiently large (per Ĥ(x)dx. (10) [0,1]d This completes the construction of our estimator. A few remarks are in order: 1. Choice of the U -statistics: the following U -statistic Um = 1 m Y X N m 1≤i1 <i2 <···<im ≤N j=1 Kh (x − Xij ) has appeared several times in the estimator construction, which is the natural unbiased estimator for powers of fh (x):   m Y X 1 Kh (x − Xij ) N  E E[Um |N ] = N  m = j=1 1≤i1 <i2 <···<im ≤N 1 m Y X N m 1≤i1 <i2 <···<im ≤N j=1   E Kh (x − Xij ) N = fh (x)m . The reason why we average over all possible subsets of size m is to reduce the variance to the correct order (cf. Lemma 16). In practice, to compute the k-th order U -statistics, note that it is simply the (normalized) k-th elementary symmetric polynomial of Kh (x − Xi ). Hence, it suffices to compute the power sum sl , N X i=1 (Kh (x − Xi ))l , l = 1, · · · , k up to order k, and then invoke Newton’s identity to compute elementary symmetric polynomials; this has overall time complexity O(N k + k2 ) = O(n log n). For the special case of the box kernel K(t) = 1[−1/2,1/2]d (t), which can be used to achieve the upper bound in Theorem 2, Ĥ1 (x) reduces to Ĥ1 (x) = 1(N ≥ k n X Zx · (Zx − 1) · . . . · (Zx − l + 1) )· , al · ld 2 h · N · (N − 1) · . . . · (N − l + 1) l=0 where Zx = N X i=1 (2) hd Kh (x − Xi ). (11) Hence, the computational cost can be further reduced to O(N + k2 ) = O(n) in this simple example. 11 2. Polynomial approximation in the non-smooth regime: in the non-smooth regime (i.e., fˆh,1 (x) ≤ c1 ln n ) a suitable linear combination of the U -statistics is applied, where the coefficients come nhd from the best approximating polynomial of our target functional −x ln x. By the previous property of the U -statistic, in the non-smooth regime we estimate Q(fh (x)) without any bias, and thus the bias in this regime becomes the polynomial approximation error. 3. Bias correction based on Taylor expansion in the smooth regime: in the smooth regime (i.e., fˆh,1 (x) > c1nhlndn ), we use the idea in [HJW16] to correct the bias. Specifically, by Taylor expansion we can write φ(fh (x)) ≈ = R X φ(l) (fˆh,2 (x)) l=0 l! (fh (x) − fˆh,2 (x))l l   R X φ(l) (fˆh,2 (x)) X l l=0 l! j=0 j (12) fh (x)j (−fˆh,2 (x))l−j . A natural idea to de-bias is to find an unbiased estimator of the right-hand side in (12). Indeed, this can be done by sample splitting: we can split samples to obtain fˆh,3 (x), an independent copy of fˆh,2 (x), and then apply the previous U -statistics to fˆh,3 (x) to obtain an unbiased estimator fh (x)j . Our estimator construction uses this idea with φ(z) = −z ln z and R = 2. 1 4. Choice of bandwidth: as will be clarified in Section 3 (cf. (29)), the bandwidth h ≍ (n ln n)− s+d in (9) is chosen in order to balance between two types of bias of our estimator. Com1 pared with the optimal bandwidth h ≍ n− 2s+d in estimating the density under Lp risk for p ∈ [1, ∞) [Nem00], our choice of the bandwidth results in an “undersmoothed” kernel estimator of the density, which is consistent with the findings in [GM92, PY08] that an undersmoothed kernel estimator should be used in estimating nonparametric functionals. 1 However, our specific choice of h ≍ (n ln n)− s+d is different from the optimal bandwidths 2 for other problems, such as h ≍ n− 4s+d for estimating quadratic, cubic, and general smooth 1 functionals [BR88, KP96, RLTvdV08, MNR17], and the optimal bandwidth h ≍ (n ln n)− 2s+1 for estimating the Lr norm of the function in Gaussian white noise in one dimension with r ∈ [1, ∞) not an even integer [LNS99, HJMW17]. 5. Final integration: the estimator Ĥ(x) in (8) provides the pointwise estimation of −fh (x) ln fh (x) for all x ∈ [0, 1]d , and an integration is required to produce the final entropy estimator. If the box kernel is used, notice that n small cubes of equal size can partition the unit cube [0, 1]d into O(nd ) pieces, the mapping x 7→ Zx in (11) is piecewise constant on O(nd ) pieces. Hence, for exact integration it suffices to evaluate Ĥ(x) at O(nd ) points, which yields an overall O(nd+1 log n) time complexity of our estimator. For practical implementation with general kernels, numerical integration methods and quadrature formulas can be used to evaluate the integral, and then we only need to evaluate Ĥ(x) at finitely many points. In the next section we prove the following result: Theorem 2. For s ∈ (0, 2] and p ≥ 2, under the Poisson sampling model, the following holds for the estimator Ĥ defined in (10): !1 2   s 1 ≤ C (n ln n)− s+d + n− 2 sup Ef (Ĥ − H(f ))2 f ∈Lipsp,d (L) 12 where C = C(s, p, d, L) is independent of n (we omit the dependence of C on the choice of parameters c0 , c1 , c2 , ǫ and the kernel K(·)). Note that the combination of Theorem 2 and Lemma 1 completes the proof of the achievability part of Theorem 1. The next section is devoted to the proof of Theorem 2. 3 Proof of upper bound The error of our estimator Ĥ can be decomposed into three terms: the approximation error of |H(fh ) − H(f )|, the bias and the variance of the estimation error of Ĥ in estimating H(fh ). Next we deal with these terms separately. 3.1 First-stage approximation error The approximation error between H(fh ) and H(f ) is summarized in the following lemma, which is one of the key results in this paper. Recall that Td denotes the d-dimensional torus. Lemma 3. Let s ∈ (0, 2], p ≥ 2. For any f ∈ Lipsp,d (L) and h > 0, let fh be defined in (4). There exists a constant C > 0 independent of h, such that Z Z fh (x) ln fh (x)dx ≤ Chs |H(f ) − H(fh )| = f (x) ln f (x)dx − (13) Td Td whenever 0 < h < h0 , where h0 is a constant depending only on s. In view of the fact that kf − fh kp . hs cf. (5), Lemma 3 essentially says that the entropy functional H(·) is “Lipschitz” with respect to convolution. The proof of Lemma 3 consists of three steps: 1. By the convolution property, we first express the entropy difference H(fh )− H(f ) as a mutual information term. Then using the variational representation of the mutual information and χ2 -divergence, we reduce (13) to an inequality that no longer involves the kernel; 2. By the equivalence between the K-functional and the modulus of continuity [DL93], we approximation f by a non-negative C 2 -function g and further reduce the goal to an estimate R 2 of the form Td f|∇g(x)| (x)+hs dx; 3. We invoke the Hardy-Littlewood maximal inequality to control the above integral using the L2 -norm of the second-order derivative of g. This is the crux of the proof. The same proof technology also leads to a new upper bound on Fisher information, which we summarize at the end of this subsection. 3.1.1 Mutual information and χ2 -divergence Recall the mutual information between random variables A and B is defined as the KL divergence between the joint and product of the marginal distributions:   dPAB . I(A; B) = D(PAB kPA ⊗ PB ) = E ln dPA dPB 13 R Recall that, by Assumption 1, the kernel satisfies K ≥ 0 and Td K(x)dx = 1. Let X and U be independent random variables with density function f and K, respectively. Then by the convolution property, the density of X + hU is fh , and, as a result, 0 ≤ H(fh ) − H(f ) = I(U ; X + hU ). (14) Next we reduce the desired inequality into a simpler one that is independent of the kernel K(·). Let w be an arbitrary density on Td . Then by the variational representation of mutual information, we have  Z f (x − hU ) f (x − hU ) log dx I(U ; X + hU ) = EU fh (x) Td Z  f (x − hU ) = EU f (x − hU ) log dx − D(fh kw) w(x) Td  Z (a) f (x − hU ) dx ≤ EU f (x − hU ) log w(x) Td  Z (b) (f (x − hU ) − w(x))2 dx (15) ≤ EU w(x) Td where (a) follows from the non-negativity of the KL divergence, and (b) is due to the fact that the KL divergence is upper bounded by the χ2 -divergence, Now we choose w(x) = (1 − hs )f (x) + hs , ∀x ∈ Td . Then w is a valid density on Td lower bounded everywhere by hs . Furthermore, kf − wk2 = hs kf − 1k2 ≤ hs (kf k2 + 1) ≤ hs (kf kp + 1) . hs , where we used kf kp ≤ L by definition (1). As a result, Z Z (f (x − hU ) − h(x))2 (f (x − hU ) − f (x) + f (x) − w(x))2 dx = dx w(x) w(x) Td Td Z (f (x − hU ) − f (x))2 + (f (x) − w(x))2 ≤2 dx w(x) Td Z Z (f (x − hU ) − f (x))2 (f (x) − w(x))2 =2 dx + 2 dx w(x) w(x) Td Td Z (f (x − hU ) − f (x))2 2kf − wk22 ≤2 dx + w(x) hs Td Z (f (x − hU ) − f (x))2 dx + hs . . w(x) Td Combining (14)–(16), we have 0 ≤ H(fh ) − H(f ) . EU Z Td  (f (x − hU ) − f (x))2 dx + hs . (1 − hs )f (x) + hs Therefore, for Lemma 3 to hold, it suffices to prove that Z (f (x − hU ) − f (x))2 dx . hs . EU s s Td (1 − h )f (x) + h 14 (16) Recall that the finite second moment of the kernel K ensures that E|U |2 < ∞. Assuming that h is small (i.e., hs ≤ 12 ) and replacing −U by U , it further suffices to prove that for any u, we have Z (f (x + hu) − f (x))2 dx . hs (1 + |u|2 ). (17) f (x) + hs Td Note that (17) no longer involves the kernel K(·). 3.1.2 Approximation by C 2 functions We need the following lemma to replace f with a smoother function g: Lemma 4. Let f ∈ Lipsp,d (L) be a non-negative function, with s ∈ (0, 2] and p ≥ 1. Then there exists C = C(s, p, d, L), such that for any h > 0, there exists a non-negative function g ∈ C 2 (Td ) such that3 2 kf − gkp ≤ Chs , s−2 kk∇ g(·)kop kp ≤ Ch (18) , (19) where k · kop denotes the operator norm of matrices, i.e., the largest singular value. Note that Lemma 4 is essentially the equivalence between the K-functional and the modulus of smoothness (Lemma 21 in Appendix A), with an extra constraint that g being non-negative, which turns out to be crucial in proving the inequality (21) below. Let g be given by Lemma 4. Then Z (f (x + hu) − f (x))2 dx f (x) + hs Td Z (f (x + hu) − g(x + hu))2 + (f (x) − g(x))2 + (g(x + hu) − g(x))2 dx ≤3 f (x) + hs Td Z (f (x + hu) − g(x + hu))2 + (f (x) − g(x))2 ≤3 dx hs Td Z (h∇g(x)T u)2 + (g(x + uh) − g(x) − h∇g(x)T u)2 +6 dx f (x) + hs Td Z 6kf − gk22 6 |∇g(x)|2 2 2 2 ≤ + kρ(·, u)k + 6h |u| dx, (20) 2 s s s h h Td f (x) + h where ρh (x, u) , g(x + uh) − g(x) − h∇g(x)T u We bound the three terms in (20) separately. By (18), the first term is upper bounded by 6kf − gk2p 6kf − gk22 ≤ . hs . hs hs For the second term, by the integral representation of the Taylor remainder term, we have Z 1 |ρh (x, u)| = (1 − t)uT ∇2 g(x + t · hu)u · dt 0 Z 1 2 2 (1 − t)k∇2 g(x + t · hu)kop dt ≤ h |u| · 0 3 2 d Here g ∈ C (T ) means that g is twice continuously differentiable with periodic boundary conditions. Equivalently, the periodic extension of g is in C 2 (Rd ). 15 and hence 2 2 kρh (·, u)k2 ≤ h |u| · (a) ≤ h2 |u|2 · (b) Z Z 1 0 1 0 (1 − t)k∇2 g(x + t · hu)kop dt (1 − t) k∇2 g(x + t · hu)kop 2 2 dt . h2 |u|2 · hs−2 = hs |u|2 , where (a) follows from the convexity of norms and (b) follows from (19). Thus the first two terms in (20) are both upper bounded by O(hs |u|2 ). Hence, to show (17), it remains to prove that Z |∇g(x)|2 dx . hs−2 , s f (x) + h d T or more specifically, Z Td where ∂i g = 3.1.3 |∂i g(x)|2 dx . hs−2 , f (x) + hs ∀i ∈ [d] (21) ∂g ∂xi . Application of Hardy-Littlewood maximal inequality Finally, we use the non-negativity of g and the classical maximal inequality [Ste79] to prove (21). Fix any τ > 0 to be optimized later. Since g is non-negative, we have 0 ≤ g(x + τ ei ) = g(x) + τ · ∂i g(x) + (g(x + τ ei ) − g(x) − τ · ∂i g(x)) and thus −τ · ∂i g(x) ≤ g(x) + (g(x + τ ei ) − g(x) − τ · ∂i g(x)). Replacing x + τ ei by x − τ ei , we also have τ · ∂i g(x) ≤ g(x) + (g(x − τ ei ) − g(x) + τ · ∂i g(x)). Combining these two inequalities, we arrive at the following pointwise bound: τ · |∂i g(x)| ≤ 2g(x) + |g(x + τ ei ) − g(x) − τ · ∂i g(x)| + |g(x − τ ei ) − g(x) + τ · ∂i g(x)| Z 1 ≤ 2g(x) + τ 2 |∂ii g(x + t · τ ei )|dt −1 where for the second inequality we have used the integral representation of the Taylor remainder term again. p Since the previous inequality holds for any τ > 0, we choose τ = τx = h2−s f (x) + h2 to obtain an upper bound on the derivative: Z 1 2g(x) + τx |∂i g(x)| ≤ p |∂ii g(x + t · τx ei )|dt. h2−s f (x) + h2 −1 16 Plugging in this bound into (21) and using the triangle inequality, we have Z |∂i g(x)|2 dx s Td f (x) + h 2  Z Z 1 Z  4g(x)2 2−s s−2 |∂ii g(x + t · τx ei )|dt dx . ≤2 h dx + h s 2 Td −1 Td (f (x) + h ) {z } | | {z } ,A1 ,A2 Next we upper bound A1 and A2 separately. For A1 , we use the triangle inequality again to obtain Z 4g(x)2 s−2 A1 = h · dx s 2 Td (f (x) + h ) Z (g(x) − f (x))2 + f (x)2 s−2 ≤ 8h · dx (f (x) + hs )2 Td Z  Z (g(x) − f (x))2 (f (x))2 ≤ 8hs−2 · dx + dx 2 h2s Td Td (f (x))   2 kg − f k2 +1 = 8hs−2 · h2s . hs−2 . Hence, it remains to upper bound A2 , and it further suffices to prove that for any x\i ∈ Td−1 , 2 Z Z Z 1 (22) |∂ii g(x + t · τx ei )|dt dxi ≤ C |∂ii g(x)|2 dxi T −1 T for some constant C > 0. In fact, if (22) holds, then integrating both sides over x\i ∈ Td−1 together with the fact k∂ii gk2 ≤ k∂ii gkp . hs−2 completes the proof of (21). The proof of (22) requires the introduction of the maximal inequality. Fix any x\i ∈ Td−1 and define h(y) = |∂ii g(x\i , y)|, (22) is equivalent to 2 Z x+τx Z  Z C 1 |h(x)|2 dx. (23) h(y)dy dx ≤ 2τ 4 x x−τx T T For any function h on the real line, recall the Hardy–Littlewood maximal function M [h] is defined as Z 1 y+t M [h](y) , sup |h(z)|dz. (24) t>0 2t y−t Now we claim that if, in addition, h is periodic with period 1, then Z 1 y+t |h(z)|dz, M [h](y) = sup 0<t≤ 1 2t y−t (25) 2 which coincides with the definition of the maximal function of h as a function on T. To see (25), let 2t = k + r, where k = ⌊2t⌋ ∈ Z+ and r = 2t − k ∈ (0, 1). Then, by periodicity, Z Z Z Z 1 y+t 1 y+k/2 1 y−k/2 1 y+t |h(z)|dz = |h(z)|dz + |h(z)|dz + |h(z)|dz 2t y−t 2t y−k/2 2t y−t 2t y+k/2 ! Z Z r 1 y+r/2 k y+1/2 |h(z)|dz + |h(z)|dz , = 2t y−1/2 2t r y−r/2 17 which shows that it is suffices to restrict to t ≤ 21 in (24), thereby proving (25). Next we recall the maximal inequality on torus:4 Lemma 5. For any non-negative real-valued measurable function h on the torus T, the following tail bound holds: for any t > 0, there exists a universal constant C1 > 0 such that for p > 1 we have  1 p p khkp . kM [h]kp ≤ C1 p−1 Applying this lemma with p = 2 exactly yields (23) (and thus (22)), as desired, completing the proof of Lemma 3. We finish this subsection by noting that the technology developed based on the maximal inequality in fact leads to the following upper bound on Fisher information, which might be of independent interest. Theorem 3. Let f ∈ C 1 (Td ) be a density function with an absolute continuous gradient. Denote its Fisher information by Z |∇f |2 . J(f ) , f Td Then for any p > 1, there exists a constant Cp , such that J(f ) ≤ Cp d X i=1 k∂ii f kp . The connection between this result and the previous proof of Lemma 3 is the well-known fact that the local expansion of χ2 -divergence is given by the Fisher information. Indeed, by Taylor expansion (assuming for simplicity that d = 1 and f = g), the LHS of the main estimate (17) behaves as h2 J(f ). Thanks to Theorem 3, we can control the Fisher information by J(f ) = O(kf ′′ k2 ), which, by the smoothness assumption, is O(hs−2 ), and leads to the desired (17). 3.2 Second-stage approximation error and variance In this subsection we analyze the performance of our pointwise estimator Ĥ(x) in estimating −fh (x) ln fh (x) for any x ∈ [0, 1]. Recall that Z Kh (x − y)f (y)dy fh (x) = Rd is the smoothed density, and 1(N ≥ n2 ) X fˆh (x) = Kh (x − Xi ) N N i=1 is our estimator of fh (x), and Kh (t) , h−d K(h−1 t). Conditioning on N ≥ n2 , we already know that fˆh (x) is an unbiased estimator of fh (x). In fact, fˆh (x) satisfies some more properties: the random variable hd fˆh (x) roughly follows a binomial distribution B(n, hd fh (x)). This property confines to the one-dimensional simple example that hd fh (x) can be viewed as the discrete probability in the bin containing x, and hd fˆh (x) is the empirical frequency. Specifically, we prove the following lemma: 4 For example, see [Tao15]; the proof follows from that of standard maximal inequality on Euclidean space via the Vitali covering lemma [Ste79, Chapter 1, Theorem 1]. 18 Lemma 6. If the kernel K is non-negative everywhere, then there exists a universal constant c1 > 0 depending on d and kKk∞ only such that: conditioning on N ≥ n2 , 1. If fh (x) ≤ c1 ln n , 2nhd we have  c1 ln n P fˆh (x) < nhd 2. If fh (x) ≥ 2c1 ln n , nhd  ≥ 1 − n−5d ; we have P   fh (x) ˆ ≤ fh (x) ≤ 2fh (x) ≥ 1 − n−5d . 2 Note that the concentration property of fˆh (x) in Lemma 6 behaves as if nfˆh (x) is distributed binomially as B(n, hd fh (x)). It shows that, based on our threshold to split the smooth and nonsmooth regimes in (8), the probability of making an error in classification is negligible. Now we make use of Lemma 6 to prove that our estimators Ĥ1 and Ĥ2 perform well in the corresponding regimes. Specifically, the following lemmas summarize the upper bounds of the bias and the variance of these estimators: Lemma 7 (Non-smooth regime). If fh (x) ≤ 4c2 ln n, conditioning on N ≥ n2 we have 2c1 ln n , nhd c1 ≥ 4kKk∞ c2 , 0 < 8c2 ln 2 < ǫ and n ≥ 1 , nhd ln n 1 Var(Ĥ1 (x)) ≤ E[Ĥ1 (x)2 ] . 2−ǫ 2d . n h |EĤ1 (x) + fh (x) ln fh (x)| . Lemma 8 (Smooth regime). If fh (x) ≥ conditioning on N ≥ n2 we have c1 ln n 2nhd with constant c1 > 0 large enough (as in Lemma 6), fh (x) |fh (x) ln fh (x)| + , n2 n5d 1 1 fh (x)(1 + (ln fh (x))2 ) + 2 2d + 5d . Var(Ĥ2 (x)) . d nh n h n |EĤ2 (x) + fh (x) ln fh (x)| . 1 nhd ln n + Based on Lemma 6–8, we are ready to analyze the performance of the final pointwise estimator Ĥ(x): Corollary 2. Under the assumptions of Lemma 22 and nh ≥ 1, conditioning on N ≥ |EĤ(x) + fh (x) ln fh (x)| . Var(Ĥ(x)) . 3.3 1 nhd ln n 1 n2−ǫ h2d fh (x) |fh (x) ln fh (x)| + , n2 n5d fh (x)(1 + (ln fh (x))2 ) + . nhd + n 2 we have (26) (27) Overall performance Now we are in a position to analyze the overall performance of the integrated estimator Ĥ = R [0,1]d Ĥ(x)dx. By the triangle inequality, we have three types of errors: 19 • First-stage approximation error: by Lemma 3 we know that |H(f ) − H(fh )| . hs . • Bias (second-stage approximation error): by Corollary 2, conditioning on N ≥ bias is upper bounded by Z |EĤ(x) + fh (x) ln |fh (x)||dx |EĤ − H(fh )| ≤ n 2, the total [0,1]d   1 fh (x) |fh (x) ln fh (x)| + + dx nhd ln n n2 n5d [0,1]d ! Z (b) 1 1 1 1 2 fh (x) dx + + + ≤ nhd ln n n2 n5d e [0,1]d (a) Z . (c) . 1 1 + . nhd ln n n2 where (a) follows from (26), (b) follows from the fact that |t log t| ≤ 1/e + t2 for all t ≥ 0, and (c) follows from the estimate kfh k2 . kf k2 + hs ≤ L + hs (28) in view of (5) and (1). • Variance: by the property of the Poisson sampling model and the compact support of the kernel K, the samples used to construct Ĥ(x) and Ĥ(y) are independent whenever |x − y| > Rh, where R , sup{|t| : K(t) 6= 0} < ∞ is the radius of support of the kernel K. Conditioning on N ≥ n2 , we have Z Var(Ĥ) = Var = ≤ ZZ ZZ [0,1]d Z Cov(Ĥ(x), Ĥ(y))dxdy [0,1]d Cov(Ĥ(x), Ĥ(y))dxdy |x−y|≤Rh Z .h · d = Z |x−y|≤Rh d (a) Ĥ(x)dx [0,1]d ! .h · Var(Ĥ(x)) + Var(Ĥ(y)) dxdy 2 Var(Ĥ(x))dx [0,1]d Z  1 fh (x)(1 + (ln fh (x))2 ) + nhd n2−ǫ h2d Z 1 1 1 = 2−ǫ d + + fh (x)(ln fh (x))2 dx n h n n [0,1]d (b) . [0,1]d 1 n2−ǫ hd +  dx 1 . n where (a) follows from (27), and (b) follows from the fact that t log2 t ≤ 1 + t2 for all t ≥ 0 and (28). 20 Combining three types of error, we have . !1  2 n 2 sup Ef Ĥ − H(f ) 1(N ≥ ) 2 f ∈Lipsp,d (L)   q sup |H(fh ) − H(f )| + |Ef Ĥ − H(fh )| + Varf (Ĥ) f ∈Lipsp,d (L) . hs + 1 1 1 √ +√ . + nhd ln n n1−ǫ/2 hd n Also note that P(N < n2 ) ≤ exp(− n4 ) by Lemma 18, then sup f ∈Lipsp,d (L) . Ef  2 Ĥ − H(f ) !1 2 !1  2 n 2 sup Ef Ĥ − H(f ) 1(N ≥ ) 2 f ∈Lipsp,d (L) + sup f ∈Lipsp,d (L) Ef  !1 2 n 2 Ĥ − H(f ) 1(N < ) 2 !1 2 n sup H(f )2 · exp(− ) 4 f ∈Lipsp,d (L) 1 1 1 √ +√ + + . hs + d nh ln n n1−ǫ/2 hd n 1 1 1 √ +√ . . hs + d + nh ln n n1−ǫ/2 hd n 1 Finally, we choose h = c0 (n ln n)− s+d and ǫ < sup f ∈Lipsp,d (L)  Ef (29) s s+d to obtain !1 . (n ln n)− s+d + n− 2 , 2 Ĥ − H(f ) 2 s 1 completing the proof of Theorem 2. 4 Proof of lower bound In this section we prove the following lower bound for entropy estimation: Theorem 4. Let s > 0 and p ≥ 1. Then there exist constants L0 and c0 depending on s, p, d such that the following holds. Let Rn , inf sup Ĥ f ∈Lipsp,d (L0 )  2 Ef Ĥ − H(f ) Then s 1 • For any p ∈ [1, ∞), Rn ≥ c0 ((n ln n)− s+d + n− 2 ). 21 !1 2 s+2d s 1 • For p = ∞, Rn ≥ c0 (n− s+d (ln n)− s+d + n− 2 ). Note that Theorem 4 implies the lower bound part of Theorem 1, which in fact holds for any 1 s > 0 and any 1 ≤ p < ∞. Note that the parametric rate Θ(n− 2 ) is a trivial lower bound, and our goal is to show s (30) Rn & (n ln n)− s+d . The outline for the proof of Theorem 4 is as follows: In Section 4.1 we reduce the nonparametric problem to a parametric subproblem in the Poissonized sampling model. The minimax lower bound for the parametric submodel is proved by a generalized version of Le Cam’s method involving a pair of priors, also known as the method of two fuzzy hypotheses [Tsy08]. In Section 4.2 we construct the priors using duality to best approximation and Section 4.3 finishes the proof. 4.1 Reduction to a parametric submodel Let d1 , d2 , d3 be constants to be specified later. Set 1 h = (n ln n)− s+d , S = (2h)−d . Without loss of generality we assume that S is an integer. Fix   1 . α ∈ 0, S (31) (32) Let I1 , · · · , IS be the partition of the large cube [ 14 , 34 ]d into S smaller cubes of edge length h, and ti denote the leftmost corner of sub-cube Ii , i.e., Ii = ti + [0, h]d . Let g and w be some fixed smooth probability density functions on Rd with finite entropy which vanish outside [0, 1]d and [0, 1]d \[ 41 , 34 ]d , respectively. Note that the smoothness of g and w on Rd implies that their derivatives of any order vanish at their respective boundary. To each vector P = (p1 , · · · , pS ) ∈ [0, d3 nln n ]S , we associate a function fP (t) , S X i=1 1 pi · d g h  t − ti h  + (1 − Sα) w(t). (33) By the choice of α, fP is non-negative everywhere. Moreover, since w is smooth on Rd and vanishes outside [0, 1]d , fP connects to zero smoothly on the boundary and thus admits a periodic extension in C 2 (Rd ). The next result is a sufficient condition for fP to lie in the Lipschitz ball. Lemma 9. If   S 2C1 p 1X p pi ≤ , S n ln n (34) i=1 then fP ∈ Lipsp,d (L0 ) for some constant L0 independent of n. Proof. Let f˜P (t) , S X i=1 1 pi · d g h 22  t − ti h  . Then fP = f˜P + (1 − Sα)w. Since kfP kLip ≤ kf˜P kLip + (1 − Sα)kwkLip and Sα ≤ 1, it suffices to show f˜P ∈ Lipsp,d (L0 ) for some constant L0 independent of n. Observe that S 1X p pi S kgkp kf˜P kp = d h i=1 ! p1 = hs kgkp · n ln n S 1X p pi S i=1 ! p1 , (35) the condition (34) ensures that h−s kf˜P kp is upper bounded by a constant depending only on C1 and g. By (44) in Lemma 21, (35) implies that there exists a constant L0 independent of n such that ωr (f˜P , t) ≤ L0 ts for any t ≥ h. For t < h, further observe that for r = ⌈s⌉, we have S 1X p pi S kD r gkp kD r f˜P kp = hd+r i=1 ! p1 kD r gkp = · n ln n hr−s S 1X p pi S i=1 ! p1 (36) Hence, hr−s kD r f˜P kp is upper bounded by a constant depending on C1 , g. By (45) in Lemma 21, (36) implies that ωr (f˜P , t) ≤ L0 ts for any t ≤ h, completing the proof. Now we would like to reduce the original nonparametric model f ∈ Lipsp,d (L0 ) to some parametric submodel f ∈ {fP : P ∈ P}, with a properly chosen P, and impose an iid prior on the coefficient vector P with mean α. However, fP need not be a valid density, since Z [0,1]d fP (t)dt = 1 + S X i=1 (pi − α) need not normalize to one. To resolve this issue, we show that the minimax risk remains unchanged R as long as [0,1]d f is sufficiently close to one. To this end, define a new model: instead of the original sampling model with a fixed sample size n, we draw N ∼ Poi(nkf k1 ) i.i.d samples from the density f kf k1 . In the new model, the parameter set of f becomes a parametric one {fP : P ∈ P}, where P, ( )  S d3 ln n S X 1 P ∈ 0, : (pi − α) ≤ n nhd (ln n)3 i=1 (  p ) S 2C 1X 1 |pi |p ≤ ∩ P : S n ln n  (37) i=1 with C1 given in (41). In view of Lemma 9, we have {fP : P ∈ P} ⊂ Lipsp,d (L0 ). We also extend R1 the definition of entropy to positive functions verbatim: H(fP ) = 0 −fP (t) ln fP (t)dt, and denote the minimax risk restricted to the parametric submodel f ∈ {fP : P ∈ P} as RnP ,  2 inf sup EfP (Ĥ − H(fP )) Ĥ P ∈P 1 2 . The following lemma relates the new minimax risk RnP to the original risk Rn in Theorem 4. Lemma 10. There exists a universal constant C2 > 0 depending on s, p, L0 only that   1 P n . Rn ≤ C 2 R 2 + nhd (ln n)3 23 s Since our goal (30) is to show Rn & (n ln n)− s+d = s RnP & (n ln n)− s+d . Note that 1 , nhd ln n by Lemma 10, it suffices to prove H(fP ) = C0 + H(P ) + (H(g) + d ln h) · S X pi i=1 where the constant C0 does depend on P , and we denote, with a slight abuse of notation, the Pnot S discrete entropy H(P ) , i=1 −pi ln pi . Hence, given any estimator Ĥ for H(fP ), the following estimator for H(P ) H̃ , Ĥ − C0 − (H(g) + d ln h) · Sα satisfies 1/2 (E[(H̃ − H(P ))]) 1/2 ≤ (E[(Ĥ − H(fP ))]) + |H(g) + d ln h| · s . RnP + (n ln n)− s+d (ln n)−1 . S X i=1 (pi − α) Therefore, to show (30), it suffices to prove  2 2s inf sup EP Ĥ − H(P ) & (n ln n)− s+d . (38) Ĥ P ∈P Finally, we note that by the factorization theorem, for the Poisson sampling model, to estimate H(P ) with P ∈ P, the histograms hj = N X i=1 1(Xi ∈ Ij ), j = 1, · · · , S constitute a sufficient statistic. As a result, we may further assume that our observation model is ind hj ∼ Poi(n · pj ), j = 1, · · · , S (39) and the estimator Ĥ in (38) is a function of (h1 , · · · , hS ). 4.2 Construction of two priors The minimax lower bound (38) follows from a generalized version of Le Cam’s method involving two priors, also known as the method of two fuzzy hypotheses [Tsy08]. Given a collection of distributions {Pθ : θ ∈ Θ′ }, suppose the observation Z is distributed as Pθ with θ ∈ Θ ⊂ Θ′ . Let T̂ = T̂ (Z) be an arbitrary estimator of a function T (θ) based on Z. Denote the total variation distance between two probability measures P, Q by Z 1 V (P, Q) , sup |P (A) − Q(A)| = |p − q|dν, 2 A∈A dQ where p = dP dν , q = dν , and ν is a dominating measure so that P ≪ ν, Q ≪ ν. The following general minimax lower bound follows from the same proof as [Tsy08, Theorem 2.15]: 24 Lemma 11. Let σ0 and σ1 be prior distributions on Θ′ . Suppose there exist ζ ∈ R, s > 0, 0 ≤ β0 , β1 < 1 such that σ0 (θ ∈ Θ : T (θ) ≤ ζ − s) ≥ 1 − β0 , σ1 (θ ∈ Θ : T (θ) ≥ ζ + s) ≥ 1 − β1 . Then where Fi = R   1 − V (F , F ) − β − β 1 0 0 1 , inf sup Pθ |T̂ − T (θ)| ≥ s ≥ 2 T̂ θ∈Θ Pθ σi (dθ) is the marginal distribution of Z under the prior σi for i = 0, 1, respectively. To apply Lemma 11 to Θ′ = [0, d3 nln n ]S and Θ = P, we first describe the construction of the two priors. The following result is simply the duality between the problem of best uniform approximation and moment matching.5 Lemma 12. Given a compact interval I = [a, b] with a > 0, integers q, k > 0 and a continuous function φ on I, let k X ai xi − φ(x) Eq−1,k (φ; I) , inf sup {ai } x∈I i=−q+1 denote the best uniform approximation error of φ by rational functions spanned by {x−q+1 , x−q+2 , · · · , xk }. Then Z Z 2Eq−1,k (φ; I) = max φ(t)ν1 (dt) − φ(t)ν0 (dt) Z Z (40) l l s.t. t ν1 (dt) = t ν0 (dt), l = −q + 1, · · · , k where the maximum is taken over pairs of probability measures ν0 and ν1 supported on I. Here we apply this lemma to φq (t) = t1−q ln t and η= d1 , (ln n)2 k = ⌈d2 ln n⌉, I = [η, 1] , q = ⌈p⌉ with constants d1 , d2 > 0 to be specified later. The following lemma provides a lower bound for the approximation error φq (t) , t1−q ln t: Lemma 13. Fix q ∈ N. There exists constants c, c′ > 0 depending on q only such that  h c i lim inf k−2(q−1) Eq−1,k φq ; 2 , 1 ≥ c′ . k→∞ k Choosing d1 = c/d22 with constant c > 0 given in Lemma 13 and in view of the definitions of I and k, we conclude that Eq−1,k (φq ; I) & (ln n)2q−2 . Let ν0 and ν1 be the maximizer of (40). We define probability measures µ̃0 , µ̃1 by  η q h η q i  δ0 (dt) + νi (dt) i = 0, 1. µ̃i (dt) = 1 − Eνi X t where δ0 (·) is the delta measure at zero. It is straightforward to verify that µ̃i forms a probability measure, and 5 The proof of Lemma 12 is identical to that of [WY16, Eqn. (34)], since {x−q+1 , x−q+2 , · · · , xk } forms a Haar system [DL93, Section 3.3, Example 2] and hence the Chebyshev alternating theorem holds. 25 R tl µ̃1 (dt) = R tl µ̃0 (dt), for all l = 0, 1, · · · , q + k; R R 2. t ln tµ̃1 (dt) − t ln tµ̃0 (dt) & (ln n)−2 ; R 3. tq µ̃i (dt) = η q ≍ (ln n)−2q , for i = 0, 1. 1. Finally, let µi be the dilation of µ̃i by a factor of d3 nln n , that is, if Yi ∼ µ̃i , then Then supp(µi ) ⊂ [0, d3 nln n ] and, furthermore, R R 1. tl µ1 (dt) = tl µ0 (dt), for all l = 0, 1, · · · , q + k; R R 2. t ln tµ1 (dt) − t ln tµ0 (dt) & (n ln n)−1 ; R n q −q 3. tq µi (dt) = ( η ln n ) ≍ (n ln n) , for i = 0, 1. d3 ln n n · Yi ∼ µi . In the next subsection we will impose the prior where the parameters (p1 , . . . , pS ) are iid as either µ0 or µ1 . The utility of the above these properties are as follows: The first condition ensures the priors µ1 and µ2 have matching first q + k moments, and the induced Poisson mixtures are exponentially close in total variation; this is exactly the distribution of the sufficient statistics (h1 , . . . , hS ). The second property ensures the separation of the functional values, while the third property ensures the smoothness of the functions fP . Indeed, since q ≥ p, Hölder’s inequality yields Z 1 Z 1 Z p q C1 q p (41) ≤ t µi (dt) ≤ t µi (dt) tµi (dt) ≤ n ln n where C1 is a constant depending on d2 , d3 and p. It implies that controlling the qth moment of µi for q ≥ p also controls all of its lower-order moments. 4.3 Minimax lower bound in the parametric submodel In this subsection we invoke Lemma 11 to finish the proof of (38), thereby proving the lower bound in Theorem 1. Consider the probability measures µ0 , µ1 constructed in Section 4.2, and define Z Z 1 ∆ , t ln tµ1 (dt) − t ln tµ0 (dt) & . (42) n ln n R R Put α = tµ0 (dt) = tµ1 (dt) and recall the parameter space P defined in (37). By (41), we have 0 ≤ Sα . S 1 . ≪1 n ln n nhd ln n which fulfills (32). Let µ⊗S denote the S-fold product of µi . Consider the following event: i   S  X ∆ 1 , pj ln pj − Eµi p ln p ≤ Ei , {P : P ∈ P} ∩ P :  S 4 i = 0, 1. j=1 We first show that µ⊗S i (Ei ) → 0 as n → ∞ for any i = 0, 1. Recall the definitions of S and h from n (31). By Chebyshev’s inequality and the fact that µi is supported on [0, d3 log ], we have n # ) " ( S S X X 1 ⊗S d 3 2 pi ≤ (nh (ln n) ) · Varµ⊗S µi P : (pi − Eµi pi ) > i nhd (ln n)3 i=1 i=1   d3 ln n 2 ≤ (nhd (ln n)3 )2 · S n . hd (ln n)8 → 0. 26 Similarly, (  p ) S X 2C 1 1 |pi |p > P : µ⊗S i S n ln n i=1 (  p ) S X (41) C 1 1 (|pi |p − Eµi |pi |p ) > P : ≤ µ⊗S i S n ln n i=1 # "  −2p S C1 1X ≤ |pi |p · Varµ⊗S i n ln n S i=1  2p 1 ln n . (n ln n)2p · S n ≍ hd (ln n)4p → 0 and  S X 1 ∆ ⊗S P : pj ln pj − Eµi p ln p > µi  S 4 j=1   S X 1 16 pj ln pj  ≤ 2 Varµ⊗S  i ∆ S   j=1 2 16 ≤ · S∆2 n (42) . hd (ln n)6 → 0.  (ln n)2 c Hence, by the union bound, we have βi , µ⊗S i (Ei ) → 0 for i = 0, 1. Now we are ready to apply Lemma 11 to T (θ) = H(P ) = S X i=1 ζ= −pi ln pi Eµ⊗S H(P ) + Eµ⊗S H(P ) 0 1 2 , s= S∆ 4 with distribution Fi , γi⊗S , Under Note that µ0 and µ1 have where matching first q + k moments. By [WY16, Lemma 3], we have   d 2ed3 ln n q+k −d log 2 ≤ n 2 2ed3 ≤ n−2 V (π0 , π1 ) ≤ q+k ⊗S the prior R σi , µi , the sufficient statistics (h1 , . . . , hS ) are i.i.d. γi , Poi(nλ)µi (dλ) is a Poisson mixture, in view of (39). d d2 ≥ 2. Therefore V (F0 , F1 ) ≤ S · V (π0 , π1 ) . (n ln n) d+s n−2 → 0. Applying provided that d2 log 2ed 3 Lemma 11 together with Markov’s inequality yields  2   inf sup EP Ĥ − H(P ) & s2 · inf sup P |Ĥ − H(P )| ≥ s Ĥ P ∈P Ĥ P ∈P & 1 (nhd ln n)2 27 2s & (n ln n)− s+d which is (38), as desired. Finally, the lower bound for p = ∞ follows from the same argument, except that we will set q = 1, choose the bandwidth differently h= and replace the RHS of (41) by 5  ln n n  1 s+d , d3 ln n n . Further discussions 5.1 The case of s > 2 Note that the minimax lower bound in Theorem 4 holds for all smoothness parameters s > 0, but our current proof techniques of upper bound only work for the smoothness regime of 0 < s ≤ 2. There are two main reasons: 1. Classifying smooth/nonsmooth regime (Lemma 6) fails when s > 2; 2. Bias correction based on Taylor expansion (Lemma 8) in the smooth regime does not extend to s > 2. The failures of Lemma 6 and 8 are intrinsically related to the fact that one has to use kernels with negative parts to take advantage of smoothness s > 2 [Tsy08]. Concretely, Lemma 6 is closely related to the problem of adapting to the lowest values of density in density estimation [PR16]. It was conjectured in [PR16] that the case of s > 2 exhibit significantly different behavior from the case of 0 < s ≤ 2. Regarding bias correction, when the kernel is no longer non-negative, (51) can fail even when fh (x) > 0, which makes the proof of Lemma 8 break down. It is possible that bias correction based on Jackknife may achieve better performances when s > 2. For the application of this approach in entropy estimation, we refer to [MSGHI16, DF17]. Finally, we remark that the high smoothness regime of s > 2 may not pose significant challenge for other problems of nonparametric statistics. For example, in the Gaussian white noise model, since it is a location model, the concentration of kernel estimators can be directly guaranteed using concentration inequality for sums of independent bounded random variables, which turn out to be sufficient for non-smooth functional estimation [HJMW17]. Even in the Poisson model or the density model, the case of s > 2, which indeed calls for kernels with negative parts, can be easily handled. For example, to density itself under L2 risk, we can simply truncate the negative density estimates to obtain a better performance [Tsy08]; in smooth functional estimation [BM95, TLRvdV08], the case of s > 2 is also not special. It is mainly in estimating non-smooth functionals that designing procedures that can adapt to low density regime becomes a crucial challenge [PR16]. 5.2 Suboptimality of the plug-in estimator As opposed to the estimator constructed in Section 2.3 via polynomial approximation, a straightforward method is to use the “plug-in” estimator for a suitable kernel density estimator. Next we show that this naı̈ve method fails to achieve the minimax rate. Lemma 14. For s ∈ (0, 2], p ≥ 2, and any kernel K(·) satisfying Assumption 1, let fˆh (x) be R given in (6) and define the plug-in estimator as H(fˆh ) = [0,1]d −fˆh (x) ln fˆh (x)dx. If we choose 28 1 h ≍ n− s+d , then " sup f ∈Lipsp,d (L)  2 Ef H(fˆh ) − H(f ) #1 2   s 1 ≤ C n− s+d + n− 2 in the Poisson sampling model, where C is a constant independent of n. Conversely, under the previous assumptions, for any such kernel K(·) and any bandwidth h > 0, the following lower bound holds: there exist constants L0 and c independent of n, such that for any L ≥ L0 , " #1   2 2  s 1 ≥ c n− s+d + n− 2 . sup Ef H(fˆh ) − H(f ) f ∈Lipsp,d (L) Lemma 14 presents a tight characterization of the plug-in approach, and showssthat the plug-in idea is strictly sub-optimal: the bias of the kernel-based plug-in estimator is n− s+d , while for the s optimal estimator it is (n ln n)− s+d . A Auxiliary lemmas The following lemma presents the property of the best approximating polynomial of −x ln x on the interval [0, ∆], which follows from [Tim63, Section 7.5.4]. P Lemma 15. [JVHW15, WY16] Let ∆ ≤ 1. Denote by Q(t) = kl=0 al tl the best approximating polynomial of −t ln t on [0, ∆] in the uniform norm, we have sup |Q(t) + t ln t| ≤ t∈[0,∆] C∆ . k2 where C is a universal constant. Moreover, the coefficients satisfy: |al | ≤ 23k ∆1−l , 3k |a1 | ≤ 2 l = 0, 2, 3, · · · , k − ln ∆. Lemma 16 (Variance of second-order U -statistics). Let X 2 Xi Xj , U2 , n(n − 1) 1≤i<j≤n where X1 , · · · , Xn are i.i.d random variables with finite second moment. Then Var(U2 ) ≤ 4(n − 2) 2(EX12 )2 (EX12 )(EX1 )2 + . n(n − 1) n(n − 1) Lemma 17 (Bennett’s inequality [BLM13]). Let X1 , · · · , Xn ∈ [a, b] be independent random variables with n 1X 2 σ , Var(Xi ). n i=1 Then we have n P n 1X 1X Xi − E[Xi ] ≥ ǫ n n i=1 i=1 !  ≤ 2 exp − 29 nǫ2 2(σ 2 + (b − a)ǫ/3)  . Lemma 18. [MU05, Theorem 5.4] For X ∼ Poi(λ) and any δ > 0, we have P(X ≥ (1 + δ)λ) ≤ P(X ≤ (1 − δ)λ) ≤ Lemma 19. [CL11, Lemma 4] Suppose and Y , then   eδ (1 + δ)1+δ e−δ (1 − δ)1−δ λ λ , ≤ exp(− δ2 λ ). 2 1(A) is an indicator random variable independent of X Var(X 1(A) + Y 1(Ac )) = Var(X)P(A) + Var(Y )P(Ac ) + (EX − EY )2 P(A)P(Ac ). Lemma 20. [CL11, Lemma 5] For any two random variables X and Y , Var(min{X, Y }) ≤ Var(X) + Var(Y ). In particular, for any random variable X and any constant C, Var(min{X, C}) ≤ Var(X). Finally, we need the equivalence between Peetre’s K-functional and modulus of smoothness on Pd both Td and Rd . For a multi-index β = (β1 , · · · , βd ), we define |β| , |β i=1 i |, and write the Qd β β i differential operator i=1 (∂/∂xi ) as D (·). Now for r ∈ N, the differential operator D r is defined as D r f , sup |D β f |. |β|=r For p ∈ [1, ∞] and r ∈ N, the Peetre’s K-functional for f defined on U (U = Rd , Td ) is defined as Kr (f, tr )p , inf kf − gkp + tr kD r gkp g where the infimum is taken over all functions g defined on U such that D β g for any |β| = r − 1 is locally absolutely continuous. Also recall the definition of the modulus of smoothness ωr (f, t)p in (2). Lemma 21. Let U = Rd or Td . For any p ∈ [1, ∞] and r ∈ N, there exist universal constants M = M (r, p) and t0 = t0 (r, p) such that for any 0 < t < t0 and f defined on U , M −1 Kr (f, tr )p ≤ ωr (f, t)p ≤ M Kr (f, tr )p . (43) Furthermore, ωr (f, t)p ≤ M tr kD r f kp , 0 < t < t0 (44) t > 0. (45) and ωr (f, t)p ≤ 2r kf kp , For a proof this lemma, see [DL93, Chapter 6, Theorem 2.4] for the case of d = 1, and [JS77] for the general Rd , which can be easily generalized to the torus case Td . Finally, (44) follows from (43) by choosing g = f , and (45) follows from the definitions (2)–(3) and the triangle inequality. 30 B Proof of main lemmas B.1 Proof of Lemma 1 The proof of Lemma 1 mimics that of [JVHW15, Lemma 16]. Denote by π any prior distribution on Lipsp,d (L) and consider the Bayes estimator of the entropy under both sampling models. Conditioning on N = m in the Poisson sampling model, the observations X1 , · · · , Xm are i.i.d with density f , and thus the Bayes estimator coincides with the Bayes estimator in the original sampling model with m samples. Hence, denoting by Rn (Lipsp,d (L), π) and RnP (Lipsp,d (L), π) the Bayes risks under prior π in these two models, respectively, we have RnP (Lipsp,d (L), π) = ∞ X m=0 Rm (Lipsp,d (L), π) · P(Poi(n) = m). Using the Poisson tail bound (Lemma 18) and the fact that m 7→ Rm (Lipsp,d (L), π) is nonincreasing, we have RnP (Lipsp,d (L), π) = n/2 X m=0 Rm (Lipsp,d (L), π) · P(Poi(n) = m) ∞ X + m=n/2+1 ≤ sup f ∈Lipsp,d (L) −n 8 ≤e · Rm (Lipsp,d (L), π) · P(Poi(n) = m) |H(f )|2 · P(Poi(n) ≤ sup f ∈Lipsp,d (L) n ) + R n2 (Lipsp,d (L), π) 2 |H(f )|2 + R n2 (Lipsp,d (L), π), and RnP (Lipsp,d (L), π) ≥ 2n X m=0 Rm (Lipsp,d (L), π) · P(Poi(n) = m) ≥ R2n (Lipsp,d (L), π) · P(Poi(n) ≤ 2n)   E(Poi(n)) s ≥ R2n (Lipp,d (L), π) · 1 − 2n 1 = R2n (Lipsp,d (L), π). 2 The minimax theorem implies that RnP (Lipsp,d (L)) = sup RnP (Lipsp,d (L), π) π Rn (Lipsp,d (L)) Furthermore, for f ∈ = sup Rn (Lipsp,d (L), π). π Lipsp,d (L), we have kf k2 ≤ kf kp ≤ L, and thus Z |f (x) ln f (x)|dx |f (x) ln f (x)|dx + |H(f )| ≤ f (x)>1 f (x)≤1 Z Z 1 f (x)2 dx dx + ≤ e f (x)>1 f (x)≤1 Z ≤ e−1 + L2 . Now the desired result follows from combining the previous inequalities. 31 B.2 Proof of Lemma 4 Let Kd be the following non-negative kernel on Rd : Kd (x) = d Y i=1 where we note that R Rd (1 − |xi |)+ , x = (x1 , · · · , xd ) Kd (x)dx = 1. Now define Kd,h (x) = 1 x Kd ( ), hd h and g(x) = Z Td f (y)Kd,h (x − y)dy. Since both f and Kd,h are non-negative, so is g. Also, by the symmetry of Kd (·), Z (f (x) − f (y))Kd,h (x − y)dy f (x) − g(x) = d ZT (f (x) − f (x − hu))Kd (u)du = Td Z 1 = (2f (x) − f (x − hu) − f (x + hu))Kd (u)du 2 Td As a result, 1 2 Z k2f (x) − f (x − hu) − f (x + hu)kp Kd (u)du Z s 1 Kd (u)du ≍ hs . .h · 2 Td kf − gkp ≤ Td As for the Hessian of g, we have Z ∂2 2 [∇ g(x)]ii = f (y)Kd,h (x − y)dy ∂x2i Td Z ∂2 f (y) 2 Kd,h (x − y)dy = ∂xi Td Z ∂2 1 f (x − hu) 2 Kd (u)du = 2 h Rd ∂ui Z 1 = 2 f (x − hu) · (δ(ui + 1) − 2δ(ui ) + δ(ui − 1))Kd−1 (u\i )du h Rd Z 1 ∆2 f (x\i − hu\i , xi )Kd−1 (u\i )du\i = 2 h Rd−1 hei where ∆2hei f (x) , f (x + hei ) − 2f (x) + f (x − hei ), with ei being the i-th coordinate vector, and δ(·) is the delta function. As a result, we have Z 1 2 k[∇ g(x)]ii kp ≤ 2 k∆2hei f (x\i − hu\i , xi )kp Kd−1 (u\i )du\i h Rd−1 Z 1 = 2 k∆2hei f (x)kp Kd−1 (u\i )du\i h Rd−1 Z 1 hs · Kd−1 (u\i )du\i ≍ hs−2 . . 2 h Rd−1 32 Similarly, for i 6= j, we have Z ∂2 1 2 f (x − hu) Kd (u)du [∇ g(x)]ij = 2 h Rd ∂ui ∂uj Z 1 = 2 f (x − hu) · (1ui ∈(0,1) − 1ui ∈(−1,0) )(1uj ∈(0,1) − 1uj ∈(−1,0) )Kd−2 (u\(i,j) )du h Rd Z Z 1Z 1 1 = 2 ∆hei ∆hej f (x − hu)Kd−2 (u\(i,j) )dui duj du\(i,j) h Rd−2 0 0 where ∆hei f (x) = f (x + hei ) − f (x) denotes the forward difference. Note that ∆hei ∆hej f (x) = f (x + hei + hej ) − f (x + hei ) − f (x + hej ) + f (x) f (x + hei + hej ) − 2f (x + hei ) + f (x − hei + hej ) = 2 f (x + hei + hej ) − 2f (x + hej ) + f (x − hej + hei ) + 2 f (x − hei + hej ) − 2f (x) + f (x − hej + hei ) − 2 ∆2hei f (x + hei ) + ∆2hej f (x + hej ) − ∆2h(ei +ej ) f (x) = 2 we conclude that k∆hei ∆hej f kp ≤  1 2 k∆hei f kp + k∆2hej f kp + k∆2h(ei +ej ) f kp . hs . 2 Then using the same technique, we also have k[∇2 g(x)]ij kp . hs−2 . Finally, note that kAkop ≤ p kk∇2 gkop kp ≤ Tr(AT A) ≤ d X i,j=1 P i,j |Aij |, we conclude that |[∇2 g(x)]ij | ≤ p d X i,j=1 k[∇2 g(x)]ij kp . hs−2 as desired. B.3 Proof of Lemma 6 Conditioning on N ≥ n2 and applying the Bennett inequality (Lemma 17) to independent random variables Yi = Kh (x − Xi ), we obtain   n ˆ P fh (x) − fh (x) ≥ ǫ N, N ≥ 2   N ǫ2 ≤ 2 exp − 2Var(Kh (x − X1 )) + 2kKk∞ ǫ/3hd   nǫ2 . ≤ 2 exp − 4Var(Kh (x − X1 )) + 4kKk∞ ǫ/3hd 33 For the variance, by the non-negativity of the kernel K and the density f , we have Var(Kh (x − X1 )) ≤ E[Kh (x − X1 )2 ] Z = Kh (x − y)2 f (y)dy Z kKk∞ Kh (x − y)f (y)dy ≤ hd kKk∞ = fh (x). hd (46) Combining these two inequalities yields the desired result. B.4 Proof of Lemma 7 Recall that E[Ĥ1 (x)] = Q(fh (x)), where Q(t) defined in (7) is the best degree-k polynomial that n 1 ln n uniformly approximates −t ln t on the interval [0, 2cnh d ]. Conditioning on N ≥ 2 , by Lemma 15, the bias is upper bounded by |E[Ĥ1 (x)] + fh (x) ln fh (x)| = k X al fh (x)l + fh (x) ln fh (x) l=0 1 2c1 ln n · k2 nhd 1 . nhd ln n . To upper bound the variance, we condition the realization of N and N ≥ Schwarz, we have n 2. By Cauchy- Var(Ĥ1 (x)|N ) ≤ E[Ĥ1 (x)2 |N ] ≤ (k + 1) · Recall (cf. (46)) that k X l=0    −2 X X Y Y N Kh (x − Xj )Kh (x − Xt ) N  . (47) E |al |2 l |J|=l |T |=l j∈J t∈T EKh (x − Xi ) = fh (x) kKk∞ fh (x) . EKh (x − Xi )2 ≤ hd Therefore, if |J ∩ T | = r, we have    r YY kKk f (x) ∞ h E Kh (x − Xj )Kh (x − Xt ) N  ≤ · fh (x)2(l−r) hd j∈J t∈T = kKkr∞ h−dr fh (x)2l−r . Moreover, the number of pairs of subset J, T ⊂ [N ] such that |J ∩ T | = r is 34 N! r!((l−r)!)2 (N −2l+r)! . Hence, for l ≤ k,  −2 N l X |J|=l,|T |=l  E l Y j=1  Kh (x − Xj )Kh (x − Xt ) N  l (l!)2 ((N − l)!)2 X kKkr∞ h−dr fh (x)2l−r N! r!((l − r)!)2 (N − 2l + r)! r=0 l   ((N − l)!)2 X l 2 r!|Kkr∞ h−dr fh (x)2l−r = · N !(N − 2l)! (N − 2l + r)(N − 2l + r − 1) · · · (N − 2l + 1) r r=0  r l X r kKkr∞ h−dr fh (x)2l−r 22l ≤ N − 2l r=0   l X r r 2l kKkr∞ h−dr fh (x)2l−r 2 ≤ n/4 r=0  l  X 4k r 2l kKkr∞ fh (x)2l−r ≤2 nhd r=0    l  X 4kKk∞ c2 ln n r 2c1 ln n 2l−r 2l ≤2 nhd nhd r=0  l    4c1 ln n 2l X 2kKk∞ c2 r = nhd c1 r=0  2l 4c1 ln n ≤2 nhd ≤ (48) where we have used our assumptions that N ≥ n2 ≥ k = c2 ln n, and c1 ≥ 4kKk∞ c2 . By Lemma 15, we have the following coefficient bound:       nhd 2c1 ln n 1−l 3c2 ln 2 2c1 ln n 1−l 3c2 ln n ln ·n ln n. (49) |al | ≤ ·2 ≤ nhd 2c1 ln n nhd Combining (47)–(49) yields Var(Ĥ1 (x)|N ) ≤ (k + 1) · ≤ ≤ .  k  X 2c1 ln n 2(1−l) l=0 nhd (n3c2 ln 2 ln n)2 · 2  4c1 ln n nhd 2l k 16c21 c2 (ln n)5 X 2l · 2 n2−6c2 ln 2 h2d l=0 16c21 c2 (ln n)5 n2−6c2 ln 2 h2d 1 n2−ǫ h2d · c2 ln n · 22k , provided that 8c2 ln 2 < ǫ. Finally, note that conditioning on N ≥ n2 , E[Ĥ1 (x)|N ] does not depend on N , and thus Var(Ĥ1 (x)) = E[Var(Ĥ1 (x)|N )] . as desired. 35 1 n2−ǫ h2d B.5 Proof of Lemma 8 Before proving the lemma, we make several observations. Firstly, note that E[Ĥ2 |N, N ≥ n2 ] does not depend on N , it suffices to prove the result for any specific realization of N ≥ n2 . Secondly, by Lemma 6, with c1 > 0 large enough we have   fh (x) ˆ , 2fh (x)) ≤ n−5d . (50) /( P fh,2 (x) ∈ 2 Finally, note that almost surely there is an upper bound for fˆh,2 (x), fˆh,3 (x): kKk∞ max{fˆh,2 (x), fˆh,3 (x)} ≤ kKh k∞ = . hd We also denote by E3 the conditional expectation taken only with respect to the randomness of the third group of samples. Now the bias is analyzed first. For φ(z) = −z ln z, it is straightforward to see that conditioning 1 ln n on fˆh,2 (x) ≥ fh2(x) ≥ c4nh d , fh (x) E3 [Ĥ2 (x)|fˆh,2 (x) ≥ ] 2 = −fˆh,2 (x) ln fˆh,2 (x) − (1 + ln fˆh,2 (x))(fh (x) − fˆh,2 (x)) − = 2 X φ(k) (fˆh,2 (x)) k=0 k! 1 2fˆh,2 (x) · (fh (x) − fˆh,2 (x))2 (fh (x) − fˆh,2 (x))k φ(3) (ξ1 ) (fh (x) − fˆh,2 (x))3 6 φ(3) (fh (x)) φ(4) (ξ2 ) = φ(fh (x)) − (fh (x) − fˆh,2 (x))3 + (fh (x) − fˆh,2 (x))3 (fh (x) − ξ1 ) 6 6 = φ(fh (x)) − where the last two steps follow from the Taylor expansion, with ξ1 lying between fh (x) and fˆh,2 (x), and ξ2 lying between fh (x) and ξ1 . The central moments of fˆh,2 (x) are computed as follows: |E(fˆh,2 (x) − fh (x)) | = E 3 = !3 N 1 X Kh (x − Xi ) − fh (x) N i=1 1 X E(Kh (x − Xi1 ) − fh (x))· N3 i1 ,i2 ,i3 (Kh (x − Xi2 ) − fh (x))(Kh (x − Xi3 ) − fh (x))| N 1 X |E(Kh (x − Xi ) − fh (x))3 | N3 i=1  1 ≤ 2 EKh (x − Xi )3 + fh (x)3 N   kKk2∞ 1 3 EKh (x − Xi ) + fh (x) ≤ 2 N h2d   4fh (x) kKk2∞ 2 = + fh (x) n2 h2d = 36 and !4 N X 1 Kh (x − Xi ) − fh (x) E(fˆh,2 (x) − fh (x))4 = E N i=1 1 X = 4 E(Kh (x − Xi ) − fh (x))2 E(Kh (x − Xj ) − fh (x))2 N i6=j + N 1 X E(Kh (x − Xi ) − fh (x))4 N4 i=1 N 1 X 1 X 2 2 ≤ 4 EKh (x − Xi )4 EKh (x − Xi ) EKh (x − Xj ) + 4 N N i=1 i6=j  2 3 1 kKk∞ fh (x) 1 kKk∞ fh (x) ≤ 2· + 3· d N h N h3d  2 kKk∞ fh (x) 8 kKk3∞ fh (x) 4 + · . ≤ 2· n hd n3 h3d As a result, conditioning on fˆh,2 (x) ≥ E[Ĥ2 (x)|fˆh,2 (x) ≥ fh (x) 2 , the bias can be upper bounded as fh (x) ] − φ(fh (x)) 2 fh (x) |φ(3) (fh (x))| |E[(fˆh,2 (x) − fh (x))3 |fˆh,2 (x) ≥ ]| 6 2 |φ(4) (ξ2 )| fh (x) + E[|fˆh,2 (x) − fh (x)|3 |ξ1 − f (x)||fˆh,2 (x) ≥ ] 6 2 1 fh (x) ≤ ]| |E[(fˆh,2 (x) − fh (x))3 |fˆh,2 (x) ≥ 2 6fh (x) 2 1 fh (x) + ] E[(fˆh,2 (x) − fh (x))4 |fˆh,2 (x) ≥ 3 3(fh (x)/2) 2 |E(fˆh,2 (x) − fh (x))3 − E(fˆh,2 (x) − fh (x))3 1(fˆh,2 (x) < fh2(x) )| = 6fh (x)2 P(fˆh,2 (x) ≥ fh2(x) ) 8E(fˆh,2 (x) − fh (x))4 − E(fˆh,2 (x) − fh (x))4 1(fˆh,2 (x) < fh2(x) ) + 3fh (x)3 P(fˆh,2 (x) ≥ fh2(x) )   1 fh (x) −2d fh (x)3 2 . (h + fh (x) ) + fh (x)2 (1 − n−5d ) n2 n5d   fh (x)2 fh (x) fh (x)4 1 + 3 3d + + fh (x)3 (1 − n−5d ) n2 h2d n h n5d 1 fh (x) 1 + 3 3d + . 2 2d 2 n h fh (x) n h fh (x) n2 1 fh (x) . + nhd ln n n2 ≤ where the last inequality used the assumption that fh (x) ≥ 37 c1 ln n . 2nhd Now the total bias is upper bounded by |E[Ĥ2 (x)] − φ(fh (x))| fh (x) fh (x) ] − φ(fh (x)) P(fˆh,2 (x) ≥ ) 2 2 fh (x) fh (x) + E[Ĥ2 (x)|fˆh,2 (x) ≤ ] − φ(fh (x)) P(fˆh,2 (x) ≤ ) 2 2 fh (x) |φ(fh (x))| 1 + + . d nh ln n n2 n5d ≤ E[Ĥ2 (x)|fˆh,2 (x) ≥ which completes the proof of the bias bound. Next we start to bound the variance of Ĥ2 , and we condition on the event fˆh,2 (x) ∈ ( fh2(x) , 2fh (x)) (denoted by A) first. First recall the variance bound for fˆh,2 (x): 1 E(Kh (x − X1 ) − fh (x))2 n 1 ≤ EKh (x − X1 )2 n kKh k∞ ≤ EKh (x − X1 ) n kKk∞ fh (x) = . nhd E(fˆh,2 (x) − fh (x))2 = Using Taylor expansion, we have E[(fˆh,2 (x) ln fˆh,2 (x) − fh (x) ln fh (x))2 1A ] = E[(1 + ln ξ)2 (fˆh,2 (x) − fh (x))2 1A ] ≤ 2((1 + ln 2)2 + (ln fh (x))2 )E[(fˆh,2 (x) − fh (x))2 1A ] . (1 + (ln fh (x))2 )E(fˆh,2 (x) − fh (x))2 . fh (x) + fh (x)(ln fh (x))2 , nhd and E[(1 + ln fˆh,2 (x))2 (fˆh,3 (x) − fˆh,2 (x))2 1A ] ≤ 2((1 + ln 2)2 + (ln fh (x))2 )E[(fˆh,3 (x) − fˆh,2 (x))2 1A ] . (1 + (ln fh (x))2 )(E(fˆh,2 (x) − fh (x))2 + E(fˆh,3 (x) − fh (x))2 ) . fh (x) + fh (x)(ln fh (x))2 , nhd and E[(fˆh,2 (x) − 2fˆh,3 (x) + fh (x))2 1A ] ≤ E[(fˆh,2 (x) − 2fˆh,3 (x) + fh (x))2 ] = E(fˆh,2 (x) − fh (x))2 + 4E(fˆh,3 (x) − fh (x))2 fh (x) . . nhd 38 (51) By the variance upper bound of the U -statistic in Lemma 16.  E  1 X N ˆ 2 fh,2 (x) i<j 2 (3) (3) Kh (x − Xi )Kh (x − Xj ) − fh (x)  1A   2   X 1 (3) (3) Kh (x − Xi )Kh (x − Xj ) − fh (x) 1A  = E E3  N  ˆ   2 fh,2 (x) i<j   !2    1 2 )2  2 )(EK )2 2 (EK (EK f (x) A h h h h 1 .E + + − f (x) A h   fˆh,2 (x)2 n n2 fˆh,2 (x) ( )   fh (x)2 (fh (x) − fˆh,2 (x))2 kKk∞ fh (x)3 kKk2∞ fh (x)2 1A ≤E + + 1A (fh (x)/2)2 nhd n2 h2d fˆh,2 (x)2 ( )   fh (x)2 (fh (x) − fˆh,2 (x))2 kKk∞ fh (x)3 kKk2∞ fh (x)2 1A ≤E + + 1A (fh (x)/2)2 (fh (x)/2)2 nhd n2 h2d   .  fh (x) 1 + 2 2d . nhd n h Summing up the previous inequalities, and by the triangle inequality, we have E[(Ĥ2 (x) + fh (x) ln fh (x))2 1A ] fh (x) + fh (x)(ln fh (x))2 fh (x) + fh (x)(ln fh (x))2 + d nhd   nh fh (x) 1 fh (x) + + 2 2d + nhd nhd n h 2 fh (x)(1 + (ln fh (x)) ) 1 . + 2 2d d nh n h . and thus by (50), Var(Ĥ2 (x)) ≤ E[(Ĥ2 (x) + fh (x) ln fh (x))2 ] = E[(Ĥ2 (x) + fh (x) ln fh (x))2 1A ] + E[(Ĥ2 (x) + fh (x) ln fh (x))2 1Ac ] = E[(Ĥ2 (x) + fh (x) ln fh (x))2 1A ] + (fh (x) ln fh (x))2 P(Ac ) . nhd fh (x) 1 fh (x)(1 + (ln fh (x))2 ) − 20 + + n (fh (x) ln fh (x))2 , nhd n2 h2d where we have used the Bennett’s inequality (Lemma 17) in the last step. Note that fh (x) ≥ for c1 large enough we always have n− nhd fh (x) 20 c1 ln n , 2nhd (fh (x) ln fh (x))2 . n−5d . Now a combination of the last two inequalities completes the proof of the variance bound. B.6 Proof of Corollary 2 Corollary 2 follows immediately from the following lemma. 39 Lemma 22. If 0 < 8c2 ln 2 < ǫ, n ≥ 4c2 ln n and c1 is sufficiently large (as in Lemma 6–7), conditioning on N ≥ n2 we have: 1. If fh (x) ≤ c1 ln n , 2nhd |EĤ(x) + fh (x) ln fh (x)| . Var(Ĥ(x)) . 2. If c1 ln n 2nhd < fh (x) ≤ 1 nhd ln n 1 n2−ǫ h2d + + 1 n5d+1 h2d ln n , 1 n5d+2 h4d (ln n)2 . 2c1 ln n , nhd 1 fh (x) |fh (x) ln fh (x)| + + , nhd ln n n2 n5d 1 Var(Ĥ(x)) . 2−ǫ 2d . n h |EĤ(x) + fh (x) ln fh (x)| . 3. If fh (x) ≥ 2c1 ln n , nhd fh (x) |fh (x) ln fh (x)| + , n2 n5d 1 1 fh (x)(1 + (ln fh (x))2 ) + 2 2d + 5d . Var(Ĥ(x)) . d nh n h n |EĤ(x) + fh (x) ln fh (x)| . 1 nhd ln n + Recall that     1 c1 ln n ˆ Ĥ(x) = min Ĥ1 (x), 1−2ǫ d 1 fh,1 (x) < n h nhd   c1 ln n + Ĥ2 (x)1 fˆh,1 (x) ≥ . nhd We analyze the bias and the variance of Ĥ(x) in three different regimes. Note that it still suffices to fixed any specific realization of N ≥ n2 . 1 ln n Case I: fh (x) ≤ c2nh When fh (x) is small, the non-smooth estimator Ĥ1 (x) is essentially used. d . By the independence among subsamples, we have |EĤ(x) + fh (x) ln fh (x)|   1 ≤ |E min Ĥ1 (x), 1−2ǫ d + fh (x) ln fh (x)| n h   c1 ln n ˆ + (E|Ĥ2 (x)| + |fh (x) ln fh (x)|)P fh,1 (x) ≥ nhd 1 ≤ |EĤ1 (x) + fh (x) ln fh (x)| + |EĤ1 (x)1(Ĥ1 (x) > 1−2ǫ d )| n  h c ln n 1 + (E|Ĥ2 (x)| + |fh (x) ln fh (x)|)P fˆh,1 (x) ≥ . nhd Using Lemma 6 and Lemma 7, and |EĤ1 (x)1(Ĥ1 (x) > 1 n1−2ǫ hd )| ≤ (n1−2ǫ hd ) · E[Ĥ1 (x)2 ] . |Ĥ2 (x)| . 1 n1+ǫ hd (ln n)2 ln h−1 ln n 1 + + d + d d 2d nh h h nh ln n 40 we conclude that   1 (ln n)2 ln(n/h) 1 1 + + + nhd ln n n5d nhd hd nh2d ln n 1 1 + . . nhd ln n n5d+1 h2d ln n |EĤ(x) + fh (x) ln fh (x)| . As for the variance, by Lemma 19 and Lemma 20 we know that Var(Ĥ(x))   1 ≤ Var(min Ĥ1 (x), 1−2ǫ d ) n h   + Var(Ĥ2 (x)) + (E min Ĥ1 (x),    c1 ln n ˆ − EĤ2 (x)) P fh,1 (x) ≥ n1−2ǫ hd nhd 2 !    c ln n 1 1 2 P fˆh,1 (x) ≥ + sup |Ĥ2 (x)| ≤ Var(Ĥ1 (x)) + sup |Ĥ2 (x)| + n1−2ǫ hd nhd  2 (ln n)2 ln(n/h) 1 1 1 1 . 2−ǫ 2d + 5d + + + n h n nhd hd nh2d ln n n1−2ǫ hd 1 1 . 2−ǫ 2d + 5d+2 4d . n h n h (ln n)2 1  2 2c1 ln n 1 ln n Case II: c2nh . When fh (x) lies in the intermediate regime, both estimators d < fh (x) ≤ nhd Ĥ1 , Ĥ2 are expected to work well. The bias bound is straightforward: by Lemma 7 and 8, |EĤ(x) + fh (x) ln fh (x)|   1 ≤ |E min Ĥ1 (x), 1−2ǫ d + fh (x) ln fh (x)| + |EĤ2 (x) + fh (x) ln fh (x)| n h 1 ≤ |EĤ1 (x) + fh (x) ln fh (x)| + |EĤ1 (x)1(Ĥ1 (x) > 1−2ǫ d )| n h + |EĤ2 (x) + fh (x) ln fh (x)| 1 1 fh (x) |fh (x) ln fh (x)| 1 + 1+ǫ d + d + + . d nh ln n n h nh ln n n2 n5d fh (x) |fh (x) ln fh (x)| 1 + + . . d nh ln n n2 n5d 41 As for the variance, we use Lemma 19 and Lemma 20 again to obtain Var(Ĥ(x))   1 ≤ Var(min Ĥ1 (x), 1−2ǫ d ) + Var(Ĥ2 (x)) n h   1 + (E min Ĥ1 (x), 1−2ǫ d − EĤ2 (x))2 n h   ≤ Var(Ĥ1 (x)) + Var(Ĥ2 (x)) + E min Ĥ1 (x), 1 n1−2ǫ hd 1 fh (x)(1 + (ln fh (x))2 ) 1 1 . 2−ǫ 2d + + 2 2d + 5d n h nhd n h n   fh (x) |fh (x) ln fh (x)| 2 1 + + + nhd ln n n2 n5d 1 . 2−ǫ 2d n h where in the last step we have used the fact that c1 ln n 2nhd < fh (x) ≤  2 − EĤ2 (x) 2c1 ln n . nhd 1 ln n When fh (x) is large, the smooth estimator Ĥ2 (x) is expected to Case III: fh (x) > 2cnh d . perform well. By Lemma 8, the bias is upper bounded by |EĤ(x) + fh (x) ln fh (x)| ≤ |EĤ2 (x) + fh (x) ln fh (x)|       c ln n 1 1 + | min Ĥ1 (x), 1−2ǫ d | + |fh (x) ln fh (x)| P fˆh,1 (x) ≤ n h nhd   1 1 fh (x) |fh (x) ln fh (x)| 1 . + + + 5d + |fh (x) ln fh (x)| nhd ln n n2 n5d n n1−2ǫ hd fh (x) |fh (x) ln fh (x)| 1 . + + . d nh ln n n2 n5d As for the variance, we use Lemma 19 and Lemma 20 to obtain Var(Ĥ(x))    1  + ≤ Var(Ĥ2 (x)) + Var min Ĥ1 (x), 1−2ǫ d n h    c1 ln n 1 2 ) (E min Ĥ1 (x), 1−2ǫ d − EĤ2 (x)) · P(fˆh,2 (x) < n h nhd fh (x)(1 + (ln fh (x))2 ) 1 1 . + 2 2d + 5d nhd n h n  2 1 d ln h−1 ln n 1 · e−nh fh (x) + |fh (x) ln fh (x)| + + d + + 1−2ǫ d d 2d n h h h nh ln n 2 fh (x)(1 + (ln fh (x)) ) 1 1 . + 2 2d + 5d . nhd n h n 42 B.7 Proof of Lemma 10 For any δ > 0, suppose Ĥn nearly attains the minimax risk in the usual sampling model with sup f ∈Lipsp,d (L0 ) Ef (Ĥn − H(f ))2 ≤ Rn2 + δ. Now we use Ĥn to construct an estimator in the Poisson sampling model. Let N ∼ Poi(nkf k1 ) be the number of samples drawn in the Poisson sampling model, our estimator is just constructed as Ĥ = ĤN . Note that by definition, conditioning on the event that N = m, the Poisson sampling model is just the usual sampling model with sample size m and density kffk1 . As a result, for any P ∈ P, we have EfP (Ĥ − H(fP ))2   2 2   fP fP + 2 H(fP ) − H ≤ 2EfP Ĥ − H kfP k1 kfP k1       2 ∞ X fP fP 2 EfP (Ĥ − H =2 ) |N = m · P(N = m) + 2 H(fP ) − H kfP k1 kfP k1 m=0    ∞ 2 X fP (Rn2 + δ)P(N = n) + 2 H(fP ) − H ≤2 kfP k1 n=0   2 fP 2 ≤ 2c0 · P(N ≤ n/2) + 2R n · P(N > n/2) + 2δ + 2 H(fP ) − H 2 kfP k1 n ≤ 2c0 exp(− ) + 2R2n + 2δ + 4(kfP k1 − 1)2 c0 + 4(kfP k1 ln kfP k1 )2 2 5 where by the proof of Lemma 1 we have c0 , supf ∈Lipsp,d (L0 ) H(f )2 ≤ e−1 + L20 < ∞, and in the last step we have used the Poisson tail inequality (cf. Lemma 18). Note that by definition of P, |kfP k1 − 1| . 1 nhd (ln n)3 and thus we conclude that RnP . R n2 + 1 nhd (ln n)3 + √ δ. The desired result follows by the arbitrariness of δ > 0. B.8 Proof of Lemma 13 We introduce some necessary notions and results from approximation theory first. For functions defined on [0, 1], define the r-th order Ditzian–Totik modulus of smoothness by [DT87] ωϕr (f, t)∞ , sup k∆rhϕ(x) f (x)k∞ (52) 0<h≤t p where ϕ(x) , x(1 − x). This quantity is related to the polynomial approximation error via the following lemma. 43 Lemma 23. [DT87] For any integer u > 0 and n > u, there exists some constant Mu which depends on u but not on t ∈ (0, 1) nor f , such that 1 E0,n (f ; [0, 1]) ≤ Mu ωϕu (f, )∞ n n Mu X 1 (l + 1)u−1 E0,l (f ; [0, 1]) ≥ ωϕu (f, )∞ . nu n l=0 Defining r = q − 1 ≥ 0, we will make use of the second inequality in Lemma 23 to prove that Er,n (x−r ln x; [cn−2 , 1]) & n2r for some proper constant c. The case r = 0 has been handled in [WY16, Lemma 5], and we assume that r > 0. Note that for any function f and interval I, Er,n (f ; I) = inf a1 ,··· ,ar E0,n (f (x) + r X al x−l ; I), l=1 it suffices to prove that for any coefficients a1 , · · · , ar ∈ R, g(x) , x−r ln x + g̃(x) , g(cn−2 + (1 − cn−2 )x), the inequality Pr l=1 al x −l and E0,n (g̃; [0, 1]) ≥ c′ holds with proper universal constants c, c′ independent of the choices of a1 , · · · , ar . For the sake of simplicity, in the sequel we use the following equivalent definition of g(x) (by a proper translation of ar ): g(x) , x −r −1 2 ln(c n x) + r X al x−l . l=1 1 Let u = 1 and m = c− 2 n with c < 1 in Lemma 23, we have m E0,n (g̃; [0, 1]) ≥ 1 X E0,l (g̃; [0, 1]) m l=n n−1 1 X 1 1 1 E0,l (g̃; [0, 1]) ωϕ (g̃, )∞ − ≥ M1 m m l=0 1 n 1 1 ωϕ (g̃, )∞ − E0,0 (g̃; [0, 1]). ≥ M1 m m We distinguish into two cases. If E0,0 (g̃; [0, 1]) ≤ 2m2r , by definition of the Ditzian–Totik modulus of smoothness, there exists universal constants 0 < A < B (independent of c) such that !     r  z −r X 1 z + 1 −r z + 1 −l  z −l 1 ωϕ (g̃, ) ≥ max ln(z + 1) − − ln z + al m m2 m2 m2 m2 z∈[A,B] l=1 = m2r · max h(z) − z∈[A,B] ≥ m2r · inf r X al m2(l−r) hl (z) l=1 max h(z) − b1 ,··· ,br z∈[A,B] r X bl hl (z) l=1 44 where h(z) , (z + 1)−r ln(z + 1) − z −r ln z, hl (z) , (z + 1)−l − z −l , l = 1, · · · , r. It is clear that hl (z), l = 1, · · · , r and h(z) are linearly independent over [A, B], there exists some universal constant C1 > 0 independent of c, a1 , · · · , ar such that inf max h(z) − b1 ,··· ,br z∈[A,B] r X l=1 bl hl (z) ≥ C1 . Hence, in this case we have E0,n (g̃; [0, 1]) ≥   √ C1 − 2 c m2r . M1 (53) Now we consider the second case where E0,0 (g̃; [0, 1]) > 2m2r , which implies that E0,0 (g̃; [0, 1]) ≤ x−r ln(m2 x) + max x∈[m−2 ,1] ≤ m2r · max z −r ln z + z∈[1,∞) ≤ m2r + r X r X al x−l l=1 r X l=1 |al |m2l |al |m2l l=1 1 ≤ E0,0 (g̃; [0, 1]) + r · max |al |m2l . 1≤l≤r 2 As a result, max |al |m2l ≥ 1≤l≤r E0,0 (g̃; [0, 1]) . 2r Suppose the previous maximum is achieved by l∗ , we have 1 ωϕ1 (g̃, ) ≥ max m z∈[A,B]  z+1 m2 −r r  z −r X ln(z + 1) − al ln z + m2 l=1 ∗ ∗ ∗ = |al∗ |m2l · max hl∗ (z) − z∈[A,B] ∗ ≥ |al∗ |m2l · inf  z+1 m2 X m2(l−l ) al m2(r−l ) h(z) − hl (z) al∗ al ∗ ∗ l6=l max hl∗ (z) − bh(z) − b,bl :l6=l∗ z∈[A,B] ∗ ≥ C2 |al∗ |m2l C2 E0,0 (g̃; [0, 1]) ≥ 2r 45 X l6=l∗ bl hl (z) −l  z −l − m2 ! where still by the linear independence, C2 , min ∗ inf 1≤l ≤r b,bl :l6=l∗ max hl∗ (z) − bh(z) − z∈[A,B] X bl hl (z) > 0 l6=l∗ is a universal constant independent of c, a1 , · · · , ar . Hence, in this case we have   √ C2 E0,n (g̃; [0, 1]) ≥ − c E0,0 (g̃; [0, 1]) 2rM1   √ C2 ≥2 − c mr . 2rM1 (54) Combining (53) and (54), we conclude that    √ √ C2 C1 −r −2 · mr − 2 c, 2 − c Er,n (x ln x; [cn , 1]) ≥ min M1 2rM1    √ √ C1 C2 n = min · ( √ )r . − 2 c, 2 − c M1 2rM1 c Now choosing c > 0 small enough completes the proof of the lemma. B.9 Proof of Lemma 14 We first prove the achievability part of the plug-in approach. For kernel K(·) satisfying the five properties under Lemma 2 and fˆh (x) given by (6), Lemma 3 shows that the first approximation error is at most |H(f ) − H(fh )| . hs . For the bias and variance of the plug-in approach we establish the following lemma. R [0,1]d −fˆh (x) ln fˆh (x)dx in estimating H(fh ), Lemma 24. Conditioning on N ≥ n2 , the following pointwise bounds hold: 1 , |Efˆh (x) ln fˆh (x) − fh (x) ln fh (x)| . nhd fh (x)(1 + (ln fh (x))2 ) (ln n)4 Var(fˆh (x) ln fˆh (x)) . + 2 2d . nhd n h In the sequel we assume that Lemma 24 holds, and postpone the proof to the end of this section. Combining the previous three inequalities, comparing them with Corollary 2, and proceeding as in Section 3.3, we have " sup f ∈Lipsp,d (L) Ef  2 H(fˆh ) − H(f ) #1 2 . hs + 1 (ln n)2 1 √ . √ + + nhd n n hd 1 Now the achievability result follows from our choice of h ≍ n− s+d . 1 Next we establish the lower bound. The parametric rate Θ(n− 2 ) is trivial, so we focus only on s the Θ(n− s+d ) part. Suppose that some plug-in approach with kernel K(·) and bandwidth h attains s a worst-case L2 risk o(n− s+d ). We make the following claims: 46 1 1. We must have h ≫ n− s+d . Otherwise, consider f ≡ 1, we have fh ≡ 1 and   Z 1 1 1 2 2 ˆ E(fh (x) − fh (x)) = K (t)dt − 1 & . d n h Rd nhd By Lemma 6, fˆh (x) ≤ 2 with probability at least 1 − n−5d , Taylor expansion with Lagrange remainder term give Efˆh (x) ln fˆh (x) − fh (x) ln fh (x) 1 ≥ E(fˆh (x) − fh (x))2 − n−5d · 2·2 1 & . nhd   kKk∞ fh (x) kKk∞ fh (x) ln + |fh (x) ln fh (x)| nh nh 1 As a result, since h . n− s+d , the overall bias is at least Z   ˆ Efˆh (x) ln fˆh (x) − fh (x) ln fh (x) dx H(f ) − EH(fh ) = [0,1]d & s 1 & n− s+d d nh a contradiction to the assumed performance of H(fˆh ). 1 1 2. We must have h . n− s+d . Otherwise, we have h ≫ n− s+d , and by Lemma 24 and triangle inequality, for any f ∈ Lipsp,d (L) we must have |H(f ) − H(fh )| ≤ |H(f ) − EH(fˆh )| + |EH(fˆh ) − H(fh )| 1 . |H(f ) − EH(fˆh )| + nhd s − s+d ≪n ≪ hs . In the sequel we will construct some f ∈ Lipsp,d (L0 ) such that |H(f )−H(fh )| & hs , establishing the desired contradiction. Let f be the density fP which was constructed in (33) with P consisting of all identical elements (denoted by p), or specifically, f (t) = p · S X i=1 s h g  t − ti h  + (1 − phs ) w(t) , f1 (t) + f2 (t). We choose the parameter p to be a small universal constant so that R f is a density, and choose the smooth function g to satisfy H(g) 6= H(g1 ) for g1 (x) , [0,1]d K(x − y)g(y)dy. Note that the density f ∈ Hds (L0 ) lies in the Hölder ball for some universal constant L0 . By the structure of the kernel-smoothed density, we may write fh (t) = p · S X i=1 s h g1  t − ti h  + f2h (t) + ǫ(t) where f2h (t) is the kernel-smoothed version of f2 (t), and ǫ(t) can be non-zero only in cubes lying on the boundary of [ 14 , 34 ]d . Moreover, since f lies in the Hölder ball, we have kf −fh k∞ . 47 hs and thus kǫk∞ . hs . Noting that the total volume of all cubes lying on the boundary is O(h), we have H(fh ) − H(f ) & (H(f2h ) − H(f2 )) + p · hs (H(g1 ) − H(g)) − hs ln(1/h) · h. Finally, by the monotonicity of entropy, we have H(f2h ) ≥ H(f2 ), H(g1 ) ≥ H(g), and thus the previous inequality becomes H(fh ) − H(f ) & hs − hs+1 ln(1/h) & hs as desired. The proof of the lower bound is complete noting that these two claims contradict each other. Proof of Lemma 24. As usual, we fix any specific value N ≥ n2 . Let φ(x) , x ln x, and g(x) be any twice continuously differentiable function on [0, ∞). By [Tot94, Eqn. (2.5)], for any u, v ≥ 0, |g(v) − g(u) − g ′ (u)(v − u)| ≤ 4(v − u)2 kwg ′′ (w)k∞ . u Choosing u = fh (x), v = fˆh (x) and taking expectation at both sides, and noting that E(fˆh (x) − fh (x))2 ≤ kKk∞ fh (x) fh (x) . d Nh nhd we have |Eφ(fˆh (x)) − φ(fh (x))| ≤ 2kφ − gk∞ + |Eg(fˆh (x)) − g(fh (x))| 4kwg ′′ (w)k∞ · E(fˆh (x) − fh (x))2 fh (x) 1 . kφ − gk∞ + · kwg′′ (w)k∞ . nhd ≤ 2kφ − gk∞ + The previous inequality holds for any g, so we may take infimum over g and reduce the problem to the following lemma: Lemma 25 ( [DT87, Theorem 2.1.1]). For any real-valued function φ defined on [0, ∞) and t > 0, there exists a universal constant C > 0 independent of φ, t such that  kφ − gk∞ + t2 kwg ′′ (w)k∞ ≤ Cωϕ2 (f, t)∞ inf g∈C 2 [0,∞) where ωϕ2 (f, t)∞ is the second-order modulus of smoothness defined in (52) with ϕ(x) = It follows from [DT87, Example 3.4.2] that for φ(x) = x ln x, we have ωϕ2 (φ, t)∞ ≍ t2 . As a result, by the previous arguments and Lemma 25 we obtain |Eφ(fˆh (x)) − φ(fh (x))| . establishing the desired bias bound. 48 1 nhd √ x. For the upper bound on the variance, we distinguish into two cases: fh (x) ≤ c1nhlndn and fh (x) > c1 ln n , where c1 > 0 is the universal constant given in Lemma 6. If fh (x) ≤ c1nhlndn , Lemma 6 implies nhd that fˆh (x) ≤ 2c1 lnd n with probability at least 1 − n−5d , which together with fˆh (x) ≤ kKkd∞ yields nh h Var(fˆh (x) ln fˆh (x)) ≤ E[(fˆh (x) ln fˆh (x))2 ]     kKk∞ kKk∞ 2 2c1 ln n 2c1 ln n 2 −5d + n · ln ln ≤ nhd nhd hd hd (ln n)4 . 2 2d . n h If fh (x) > c1nhlndn , Lemma 6 implies that fˆh (x) ∈ ( fh2(x) , 2fh (x)) with probability at least 1 − n−5d , and then the Taylor expansion with Lagrange remainder term yields Var(fˆh (x) ln fˆh (x)) ≤ E[(fˆh (x) ln fˆh (x) − fh (x) ln fh (x))2 ] . (1 + (ln fh (x))2 ) · E(fˆh (x) − fh (x))2 2  ln n + |f (x) ln f (x)| + n−5d · h h hd fh (x)(1 + (ln fh (x))2 ) . . nhd A combination of these two cases completes the proof of the variance bound. B.10 Proof of Lemma 16 It is straightforward to see EU = (EX1 )2 . As a result, Var(U2 ) = 4 n2 (n − 1)2 X 1≤i<j≤n,1≤i′ <j ′ ≤n E[Xi Xj Xi′ Xj ′ ] − (EX1 )4 . Denote by I0 , I1 , I2 the index set (i, j, i′ , j ′ ) where (i, j) and (i′ , j ′ ) have 0, 1 and 2 elements in common, respectively, we have n! n(n − 1)(n − 2)(n − 3) = , 2!2!(n − 4)! 4 n! = n(n − 1)(n − 2), |I1 | = 1!1!1!(n − 3)!   n n(n − 1) |I2 | = . = 2 2 |I0 | = As a result,  4 |I0 | · (EX1 )4 + |I1 | · (EX12 )(EX1 )2 + |I2 | · (EX12 )2 − (EX1 )4 2 − 1) 4(n − 2) 2(EX12 )2 4n − 6 (EX1 )4 + (EX12 )(EX1 )2 + , =− n(n − 1) n(n − 1) n(n − 1) Var(U2 ) = n2 (n and the result follows. 49 References [BCL+ 04] Lawrence D Brown, Andrew V Carter, Mark G Low, Cun-Hui Zhang, et al. Equivalence theory for density estimation, Poisson processes and Gaussian white noise with drift. The Annals of Statistics, 32(5):2074–2097, 2004. [BDGVdM97] Jan Beirlant, Edward J Dudewicz, László Györfi, and Edward C Van der Meulen. Nonparametric entropy estimation: An overview. International Journal of Mathematical and Statistical Sciences, 6(1):17–39, 1997. [BKB+ 93] Peter J Bickel, Chris AJ Klaassen, Peter J Bickel, Y Ritov, J Klaassen, Jon A Wellner, and YA’Acov Ritov. Efficient and adaptive estimation for semiparametric models. Johns Hopkins University Press Baltimore, 1993. [BLM13] Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration inequalities: A nonasymptotic theory of independence. Oxford University Press, 2013. [BM95] Lucien Birgé and Pascal Massart. Estimation of integral functionals of a density. The Annals of Statistics, pages 11–29, 1995. [BR88] Peter J Bickel and Yaacov Ritov. Estimating integrated squared density derivatives: sharp best order of convergence estimates. Sankhyā: The Indian Journal of Statistics, Series A, pages 381–393, 1988. [BSY16] Thomas B Berrett, Richard J Samworth, and Ming Yuan. Efficient multivariate entropy estimation via k-nearest neighbour distances. arXiv preprint arXiv:1606.00304, 2016. [BZLV16] Yuheng Bu, Shaofeng Zou, Yingbin Liang, and Venugopal V. Veeravalli. Estimation of KL divergence between large-alphabet distributions. submitted to 2016 International Symposium on Information Theory, 2016. [CH04] Jose A Costa and Alfred O Hero. Geodesic entropic graphs for dimension and entropy estimation in manifold learning. IEEE Transactions on Signal Processing, 52(8):2210–2221, 2004. [CL03] T Tony Cai and Mark G Low. A note on nonparametric estimation of linear functionals. Annals of statistics, pages 1140–1153, 2003. [CL05] T Tony Cai and Mark G Low. Nonquadratic estimators of a quadratic functional. The Annals of Statistics, pages 2930–2956, 2005. [CL11] T Tony Cai and Mark G Low. Testing composite hypotheses, Hermite polynomials and optimal estimation of a nonsmooth functional. The Annals of Statistics, 39(2):1012–1041, 2011. [DF17] Sylvain Delattre and Nicolas Fournier. On the Kozachenko–Leonenko entropy estimator. Journal of Statistical Planning and Inference, 185:69–93, 2017. [DL93] Ronald A DeVore and George G Lorentz. Constructive approximation, volume 303. Springer, 1993. 50 [DN90] David L Donoho and Michael Nussbaum. Minimax quadratic estimation of a quadratic functional. Journal of Complexity, 6(3):290–323, 1990. [Don97] David L Donoho. Renormalizing experiments for nonlinear functionals. Festschrift for Lucien Le Cam, pages 167–181, 1997. [DT87] Zeev Ditzian and Vilmos Totik. Moduli of smoothness. Springer, 1987. [EHHG09] Fidah El Haje Hussein and Yu Golubev. On entropy estimation by m-spacing method. Journal of Mathematical Sciences, 163(3):290–309, 2009. [Fan91] Jianqing Fan. On the estimation of quadratic functionals. The Annals of Statistics, pages 1273–1294, 1991. [GM92] Larry Goldstein and Karen Messer. Optimal plug-in estimators for nonparametric functional estimation. The annals of statistics, pages 1306–1328, 1992. [GOV16] Weihao Gao, Sewoong Oh, and Pramod Viswanath. Breaking the bandwidth barrier: Geometrical adaptive entropy estimation. In Advances in Neural Information Processing Systems, pages 2460–2468, 2016. [GOV17] Weihao Gao, Sewoong Oh, and Pramod Viswanath. Demystifying fixed k-nearest neighbor information estimators. In Information Theory (ISIT), 2017 IEEE International Symposium on, pages 1267–1271. IEEE, 2017. [GVdM91] László Györfi and Edward C Van der Meulen. On the nonparametric estimation of the entropy functional. In Nonparametric functional estimation and related topics, pages 81–95. Springer, 1991. [Hal84] Peter Hall. Limit theorems for sums of general functions of m-spacings. In Mathematical Proceedings of the Cambridge Philosophical Society, volume 96, pages 517–532. Cambridge University Press, 1984. [HI80] Rafail Z Hasminskii and Ildar A Ibragimov. Some estimation problems for stochastic differential equations. In Stochastic Differential Systems Filtering and Control, pages 1–12. Springer, 1980. [HJMW17] Yanjun Han, Jiantao Jiao, Rajarshi Mukherjee, and Tsachy Weissman. On estimation of Lr -norms in Gaussian white noise models. In preparation, 2017. [HJW16] Yanjun Han, Jiantao Jiao, and Tsachy Weissman. Minimax rate-optimal estimation of divergences between discrete distributions. arXiv preprint arXiv:1605.09124, 2016. [HKPT12] Wolfgang Härdle, Gerard Kerkyacharian, Dominique Picard, and Alexander Tsybakov. Wavelets, approximation, and statistical applications, volume 129. Springer Science & Business Media, 2012. [HM87] Peter Hall and James Stephen Marron. Estimation of integrated squared density derivatives. Statistics & Probability Letters, 6(2):109–115, 1987. [HM93] Peter Hall and Sally C Morton. On the estimation of entropy. Annals of the Institute of Statistical Mathematics, 45(1):69–88, 1993. 51 [HSPVB07] Katerina Hlaváčková-Schindler, Milan Paluš, Martin Vejmelka, and Joydeep Bhattacharya. Causality detection based on information-theoretic approaches in time series analysis. Physics Reports, 441(1):1–46, 2007. [INH87] Ildar A Ibragimov, Arkadi S Nemirovskii, and Rafail Z Hasminskii. Some problems on nonparametric estimation in Gaussian white noise. Theory of Probability & Its Applications, 31(3):391–406, 1987. [Jaw77] Björn Jawerth. Some observations on Besov and Lizorkin–Triebel spaces. Mathematica Scandinavica, 40(1):94–104, 1977. [JHW16] Jiantao Jiao, Yanjun Han, and Tsachy Weissman. Minimax estimation of the L1 distance. In 2016 IEEE International Symposium on Information Theory (ISIT), pages 750–754. IEEE, 2016. [Joe89] Harry Joe. Estimation of entropy and other functionals of a multivariate density. Annals of the Institute of Statistical Mathematics, 41(4):683–697, 1989. [JS77] Hans Johnen and Karl Scherer. On the equivalence of the K-functional and moduli of continuity and some applications. In Constructive theory of functions of several variables, pages 119–140. Springer, 1977. [JVHW15] Jiantao Jiao, Kartik Venkat, Yanjun Han, and Tsachy Weissman. Minimax estimation of functionals of discrete distributions. Information Theory, IEEE Transactions on, 61(5):2835–2885, 2015. [KA05] Rhoana J Karunamuni and Tom Alberts. On boundary correction in kernel density estimation. Statistical Methodology, 2(3):191–212, 2005. [KKP+ 15] Kirthevasan Kandasamy, Akshay Krishnamurthy, Barnabas Poczos, Larry Wasserman, et al. Nonparametric von mises estimators for entropies, divergences and mutual informations. In Advances in Neural Information Processing Systems, pages 397–405, 2015. [KKPW14] Akshay Krishnamurthy, Kirthevasan Kandasamy, Barnabas Poczos, and Larry Wasserman. Nonparametric estimation of Rényi divergence and friends. In International Conference on Machine Learning, pages 919–927, 2014. [KP96] Gérard Kerkyacharian and Dominique Picard. Estimating nonquadratic functionals of a density using haar wavelets. The Annals of Statistics, 24(2):485–507, 1996. [KSG04] Alexander Kraskov, Harald Stögbauer, and Peter Grassberger. Estimating mutual information. Physical Review E, 69(6):066138, 2004. [KT12] Aleksandr Petrovich Korostelev and Alexandre B Tsybakov. Minimax theory of image reconstruction, volume 82. Springer Science & Business Media, 2012. [Lau96] Béatrice Laurent. Efficient estimation of integral functionals of a density. The Annals of Statistics, 24(2):659–681, 1996. [Lev78] Boris Ya Levit. Asymptotically efficient estimation of nonlinear functionals. Problemy Peredachi Informatsii, 14(3):65–72, 1978. 52 [LNS99] Oleg Lepski, Arkady Nemirovski, and Vladimir Spokoiny. On estimation of the Lr norm of a regression function. Probability theory and related fields, 113(2):221–253, 1999. [MNR17] Rajarshi Mukherjee, Whitney K Newey, and James M Robins. Semiparametric efficient empirical higher order influence function estimators. arXiv preprint arXiv:1705.07577, 2017. [MSGHI16] Kevin R Moon, Kumar Sricharan, Kristjan Greenewald, and Alfred O Hero III. Nonparametric ensemble estimation of distributional functionals. arXiv preprint arXiv:1601.06884, 2016. [MU05] Michael Mitzenmacher and Eli Upfal. Probability and computing: Randomized algorithms and probabilistic analysis. Cambridge University Press, 2005. [Nem00] Arkadi Nemirovski. Topics in non-parametric statistics. Ecole dEté de Probabilités de Saint-Flour, 28:85, 2000. [Nus96] Michael Nussbaum. Asymptotic equivalence of density estimation and Gaussian white noise. The Annals of Statistics, pages 2399–2430, 1996. [Pan04] Liam Paninski. Estimating entropy on m bins given fewer than m samples. Information Theory, IEEE Transactions on, 50(9):2200–2203, 2004. [PR16] Tim Patschkowski and Angelika Rohde. Adaptation to lowest density regions with application to support recovery. The Annals of Statistics, 44(1):255–287, 2016. [PY08] Liam Paninski and Masanao Yajima. Undersmoothed kernel entropy estimators. IEEE Transactions on Information Theory, 54(9):4384–4388, 2008. [RLM+ 16] James Robins, Lingling Li, Rajarshi Mukherjee, Eric Tchetgen Tchetgen, and Aad van der Vaart. Higher order estimating equations for high-dimensional models. The Annals of Statistics (To Appear), 2016. [RLTvdV08] James Robins, Lingling Li, Eric Tchetgen, and Aad van der Vaart. Higher order influence functions and minimax estimation of nonlinear functionals. In Probability and Statistics: Essays in Honor of David A. Freedman, pages 335–421. Institute of Mathematical Statistics, 2008. [SP16] Shashank Singh and Barnabás Póczos. Finite-sample analysis of fixed-k nearest neighbor density functional estimators. In Advances in Neural Information Processing Systems, pages 1217–1225, 2016. [SRH12] Kumar Sricharan, Raviv Raich, and Alfred O Hero. Estimation of nonlinear functionals of densities with confidence. IEEE Transactions on Information Theory, 58(7):4135–4159, 2012. [Ste79] Elias M Stein. Singular integrals and differentiability properties of functions (PMS30). Princeton university press, 1979. [Tao15] Terrence Tao. The Hardy-Littlewood maximal inequality and applications. Lecture notes for MATH 247A: Fourier analysis. 2015. http://www.math.ucla.edu/~tao/247a.1.06f/notes3.pdf. 53 [Tim63] Aleksandr Filippovich Timan. Theory of approximation of functions of a real variable. Pergamon Press, 1963. [TLRvdV08] Eric Tchetgen, Lingling Li, James Robins, and Aad van der Vaart. Minimax estimation of the integral of a power of a density. Statistics & Probability Letters, 78(18):3307–3311, 2008. [Tot94] Vilmos Totik. Approximation by Bernstein polynomials. American Journal of Mathematics, pages 995–1018, 1994. [Tsy08] A. Tsybakov. Introduction to Nonparametric Estimation. Springer-Verlag, 2008. [TVdM96] Alexandre B Tsybakov and EC Van der Meulen. Root-n consistent estimators of entropy for densities with unbounded support. Scandinavian Journal of Statistics, pages 75–83, 1996. [VdV00] Aad W Van der Vaart. Asymptotic statistics, volume 3. Cambridge university press, 2000. [VE92] Bert Van Es. Estimating functionals related to a density by a class of statistics based on spacings. Scandinavian Journal of Statistics, pages 61–72, 1992. [VV11] Gregory Valiant and Paul Valiant. The power of linear estimators. In Foundations of Computer Science (FOCS), 2011 IEEE 52nd Annual Symposium on, pages 403–412. IEEE, 2011. [WKV09] Qing Wang, Sanjeev R Kulkarni, and Sergio Verdú. Universal estimation of information measures for analog sources. Foundations and Trends in Communications and Information Theory, 5(3):265–353, 2009. [WY15] Yihong Wu and Pengkun Yang. Chebyshev polynomials, moment matching, and optimal estimation of the unseen. arXiv preprint arXiv:1504.01227, 2015. [WY16] Yihong Wu and Pengkun Yang. Minimax rates of entropy estimation on large alphabets via best polynomial approximation. IEEE Transactions on Information Theory, 62(6):3702–3720, 2016. 54
7cs.IT
Commonsense Scene Semantics for Cognitive Robotics Towards Grounding Embodied Visuo-Locomotive Interactions Jakob Suchan1 , and Mehul Bhatt1,2 arXiv:1709.05293v1 [cs.RO] 15 Sep 2017 1 Spatial Reasoning. www.spatial-reasoning.com EASE CRC: Everyday Activity Science and Engineering., http://ease-crc.org University of Bremen, Germany 2 Machine Perception and Interaction Lab., https://mpi.aass.oru.se Centre for Applied Autonomous Sensor Systems (AASS) Örebro University, Sweden Abstract We present a commonsense, qualitative model for the semantic grounding of embodied visuo-spatial and locomotive interactions. The key contribution is an integrative methodology combining low-level visual processing with high-level, human-centred representations of space and motion rooted in artificial intelligence. We demonstrate practical applicability with examples involving object interactions, and indoor movement. 1. Introduction Practical robotic technologies and autonomous systems in real-world settings are confronted with a range of situational and context-dependent challenges from the viewpoints of perception & sensemaking, high-level planning & decision-making, human-machine interaction etc. Very many research communities and sub-fields thereof addressing the range of challenges from different perpecsectives have flourished in the recent years: computer vision, artificial intelligence, cognitive systems, human-machine interaction, cognitive science, multi-agent systems, control & systems engineering to name a few. Driven by the need to achieve contextualised practical deployability in real-world non-mundane everyday situations involving living beings, there is now a clearly recognised need for integrative research that combines state of the art methods from these respective research areas. Towards this, the research presented in this paper addresses commonsense visuo-spatial scene interpretation in indoor robotics settings at the interface of vision, AI, and spatial cognition. The focus of this research is on activities of everyday living involving people, robots, movement, and human-machine interaction. Interpreting Embodied Interaction: On Grounded Visuo-Locomotive Perception Visuo-locomotive perception denotes the capability to develop a conceptual mental model (e.g., consisting of abstract, commonsense representations) emanating from multi-sensory perceptions during embodied interactions and movement in a real world populated by static and dynamic entities and artefacts (e.g., moving objects, furniture). Visuo-locomotive perception in the context of cognitive robotics technologies and machine perception & interaction systems involves a complex interplay of high-level cognitive processes. These could, for instance, encompass capabilities such as explainable reasoning, learning, concept formation, sensory-motor control; from a technical standpoint of AI technologies, this requires the mediation of commonsense formalisms for reasoning about space, events, actions, change, and interaction [5]. With visuo-locomotive cognition as the context, consider the task of semantic interpretation of multi-modal perceptual data (e.g., about human behaviour, the environment and its affordances), with objectives ranging from knowledge acquisition and data analyses to hypothesis formation, structured relational learning, learning by demonstration etc. Our research focusses on the processing and semantic interpretation of dynamic visuo-spatial imagery with a particular emphasis on the ability to abstract, reason, and learn commonsense knowledge that is semantically founded in qualitative spatial, temporal, and spatio-temporal relations and motion patterns. We propose that an ontological characterisation of human-activities — e.g., encompassing (embodied) spatio-temporal relations— serves as a bridge between high-level conceptual categories (e.g., pertaining to human-object interactions) on the one-hand, and low-level / quantitative sensory-motor data on the other. I Figure 1: A Sample Activity – “Making a cup of tea” (egocentric view from a head-mounted RGB-D capture device) Commonsense Scene Semantics: Integrated Vision and Knowledge Representation The starting point of the work presented in this paper is in formal commonsense representation and reasoning techniques developed in the field of Artificial Intelligence. Here, we address the key question: How can everyday embodied activities (involving interaction and movement) be formally represented in terms of spatiotemporal relations and movement patterns (augmented by context-dependent knowledge about objects and environments) such that the representation enables robotic agents to execute everyday interaction tasks (involving manipulation and movement) appropriately? We particularly focus on an ontological and formal characterisation of space and motion from a human-centered, commonsense formal modeling and computational reasoning viewpoint, i.e., space-time, as it is interpreted within the AI subdisciplines of knowledge representation and reasoning, and commonsense reasoning, and within spatial cognition & computation, and more broadly, within spatial information theory [1, 5, 6, 8, 9, 24]. We build on state of the art methods for visual processing of RGB-D and point-cloud data for sensing the environment and the people within. In focus are 3D-SLAM data for extracting floor-plan structure based on plane detection in point-clouds, and people detection and skeleton tracking using Microsoft Kinect v2. Furthermore, we combine robot self-localisation and people tracking to localise observed people interactions in the global space of the environmental map. I We emphasise that the ontological and representational aspects of our research are strongly driven by computational considerations focussing on: (a). developing general methods and tools for commonsense reasoning about space and motion categorically from the viewpoint of commonsense cognitive robotics in general, but human-object interactions occurring in the context of everyday activities in particular; (b). founded on the established ontological model, developing models, algorithms and tools for reasoning about space and motion, and making them available as part of cognitive robotics platforms and architectures such as ROS. The running examples presented in the paper highlight the semantic question-answering capabilities that are directly possible based on our commonsense model directly in the context of constraint logic programming. 2. Commonsense, Space, Motion Commonsense spatio-temporal relations and patterns (e.g. left-of, touching, part-of, during, approaching, collision) offer a human-centered and cognitively adequate formalism for logic-based automated reasoning about embodied spatiotemporal interactions involved in everyday activities such as flipping a pancake, grasping a cup, or opening a tea box [8, 26, 27, 30]. Consider Fig. 1, consisting of a sample human activity —“making a cup of tea”— as captured from an egocentric viewpoint with a head-mounted RGB-D capture device. From a commonsense viewpoint, the sequence of high-level steps typically involved in this activity, e.g., opening a tea-box, removing a tea-bag from the box and putting the tea-bag inside a tea-cup filled with water while holding the tea-cup, each qualitatively correspond to high- S PATIAL D OMAIN (QS) Formalisms Spatial Relations (R) Entities (E) Mereotopology RCC-5, RCC-8 [23] disconnected (dc), external contact (ec), partial overlap (po), tangential proper part (tpp), non-tangential proper part (ntpp), proper part (pp), part of (p), discrete (dr), overlap (o), contact (c) proceeds, meets, overlaps, starts, during, finishes, equals left, right, collinear, front, back, on arbitrary rectangles, circles, polygons, cuboids, spheres Rectangle & Block algebra [16] Orientation LR [25] facing towards, facing away, same direction, opposite direction adjacent, near, far, smaller, equi-sized, larger OPRA [21] Distance, Size QDC [19] Dynamics, Motion Space-Time [17, 18] Histories moving: towards, away, parallel; growing / shrinking: vertically, horizontally; passing: in front, behind; splitting / merging; rotation: left, right, up, down, clockwise, couter-clockwise axis-aligned rectangles and cuboids 2D point, circle, polygon with 2D line oriented points, 2D/3D vectors rectangles, circles, polygons, cuboids, spheres rectangles, circles, polygons, cuboids, spheres Table 1: Commonsense Spatio-Temporal Relations for Abstracting Space and Motion in Everyday Human Interaction level spatial and temporal relationships between the agent and other involved objects. For instance, one may most easily identify relationships of contact and containment that hold across specific time-intervals. Here, parametrised manipulation or control actions (Θ1 (θ), ...Θn (θ)) effectuate state transitions, which may be qualitatively modelled as changes in topological relationships amongst involved domain entities. Embodied interactions, such as those involved in Fig. 1, may be grounded using a holistic model for the commonsense , qualitative representation of space, time, and motion (Table 1). In general, qualitative, multi-modal, multidomain1 representations of spatial, temporal, and spatiotemporal relations and patterns, and their mutual transitions can provide a mapping and mediating level between human-understandable natural language instructions and formal narrative semantics on the one hand [8, 13], and symbol grounding, quantitative trajectories, and lowlevel primitives for robot motion control on the other. By spatio-linguistically grounding complex sensory-motor trajectory data (e.g., from human-behaviour studies) to a formal framework of space and motion, generalized (activitybased) qualitative reasoning about dynamic scenes, spatial relations, and motion trajectories denoting single and multiobject path & motion predicates can be supported [14]. For instance, such predicates can be abstracted within a region based 4D space-time framework [3, 4, 18], object interactions [10, 11], and spatio-temporal narrative knowledge [12, 13, 29]. An adequate qualitative spatio-temporal representation can therefore connect with low-level constraintbased movement control systems of robots [2], and also help grounding symbolic descriptions of actions and objects to be manipulated (e.g., natural language instructions such as cooking recipes [28]) in the robots perception. 1 Multi-modal in this context refers to more than one aspect of space, e.g., topology, orientation, direction, distance, shape. Multi-domain denotes a mixed domain ontology involving points, line-segments, polygons, and regions of space, time, and space-time [18]. Refer Table 1. 3. Visuo-Locomotive Interactions: A Commonsense Characterisation 3.1. Objects and Interactions in Space-Time Activities and interactions are described based on visuospatial domain-objects O = {o1 , o2 , ..., oi } representing the visual elements in the scene, e.g., people and objects. The Qualitative Spatio-Temporal Ontology (QS) is characterised by the basic spatial and temporal entities (E) that can be used as abstract representations of domainobjects and the relational spatio-temporal structure (R) that characterises the qualitative spatio-temporal relationships amongst the entities in (E). Towards this, domain-objects (O) are represented by their spatial and temporal properties, and abstracted using the following basic spatial entities: – points are triplets of reals x, y, z; – oriented-points consisting of a point p and a vector v; – line-segments consisting of two points p1 , p2 denoting the start and the end point of the line-segment; – poly-line consisting of a list of vertices (points) p1 , ..., pn , such that the line is connecting the vertices is non-selfintersecting; – polygon consisting of a list of vertices (points) p1 , ..., pn , (spatially ordered counter-clockwise) such that the boundary is non-self-intersecting; and the temporal entities: – time-points are a real t – time-intervals are a pair of reals t1 , t2 , denoting the start and the end point of the interval. The dynamics of human activities are represented by 4dimensional regions in space-time (sth) representing people and object dynamics by a set of spatial entities in time, i.e. ST H = (εt1 , εt2 , εt3 , ..., εtn ), where εt1 to εtn denotes the spatial primitive representing the object o at the time points t1 to tn . stracted by the spatio-temporal characteristics of the in- stracted bydomain-objects, the spatio-temporal of high-level the involved and characteristics may be used for involved domain-objects, and may be used for high-level terpretation and reasoning about scene dynamics. interpretation and reasoning about scene dynamics. 3.2. Spatio-Temporal Characteristics 3.2. Spatio-Temporal Characteristics of Human Activities of Human Activities The space-time histories (sth) used to abstract the dynamThe space-time histories (sth) used to abstract the dynamics of human activities are based on basic spatio-temporal ics of human activities are based on basic spatio-temporal entities obtained the sensed corresponding to entities obtained fromfrom the sensed data, data, corresponding to the declarative model of visuo-locomotive interactions. To the declarative model of visuo-locomotive interactions. To extract entities, we define functions the specific extract thesethese entities, we define functions for theforspecific spatio-temporal properties of domain-objects. I.e., spatio-temporal properties of domain-objects. I.e., the fol-the following functions are used for static properties. lowing functions are used for static spatialspatial properties. person(full_body, [upper_body, lower_body]). person(upper_body, [head, left_arm, right_arm, ...]). ... body_part(left_upper_arm, joint(shoulder_left), joint(elbow_left)). body_part(left_forearm, joint(elbow_left), joint(elbow_left)). ... joint(spine_base, joint(id(0)). joint(spine_mid, joint(id(1))). joint(neck, id(2)). joint(head, id(3)). ... joint(thumb_right, id(24)). Figure Posture Figure 2: 2: Declarative DeclarativeModel ModelofofHuman-Body Human-Body Posture Declarative Model of Visuo-Locomotive Interactions – position: ×R R, × R, gives 3D position – position: O⇥ O× T ! TR→ ⇥ R⇥ gives the 3Dthe position (x,y,z) of anofobject o at aotime-point t; (x,y,z) an object at a time-point t; – size: O⇥ O× T ! TR→ , gives the size an of object o at a o at a – size: R, gives the of size an object time-point t; t; time-point – distance: O⇥ O⇥ !T R,→ gives the distance between – distance: O× TO× R, gives the distance between twotwo objects o and o at a time-point t; 1 o and 2 o at a time-point t; objects 1 2 – angle: O⇥ O⇥ T ! R, gives the angle between two – angle: O× O× T → R, gives the angle between two objects o1 and o2 at a time-point t; objects o1 and o2 at a time-point t; To account for changes in the spatial properties of domainTo account for changes in the spatial properties of domainobjects we use the following functions for dynamic spatioobjects we use the following functions for dynamic spatiotemporal properties. temporal properties. – movement velocity: O⇥ T ⇥ T ! R, gives the – movement velocity: O× oTbetween × T →two R,timegives the amount of movement of an object amount of movement of an object o between two timepoints t1 and t2 ; points t1 and t2 ; – movement direction: O⇥ T ⇥ T ! R, gives the di– movement direction: O× oT between × T→ R , gives rection of movement of an object two time-the dipoints t1 and ; rection oft2movement of an object o between two time- Declarative Model of Visuo-Locomotive Interactions Based on the qualitative spatio-temporal ontology (QS), points t1 and t2 ; Based on the qualitative spatio-temporal ontology (QS), – rotation: O⇥ T ⇥ T ! R, gives the rotation of an obhuman interactions in the environment are represented ushuman interactions in the are represented ject o between two and tthe 2 ; rotation of an ob– rotation: O× time-points T × T → R,t1gives ing a declarative model of environment visuo-locomotive interactions,using a declarative model of visuo-locomotive interactions, encompassing dynamics of humans, objects, and the enviject o between two time-points t1 and t2 ; encompassing dynamics of humans, objects, and the envi- These functions are used to obtain basic spatial entities, e.g. ronmental characteristics. points, lines, regions,are from theto sensor data. Spatio-temporal ronmental characteristics. These functions used obtain basic spatial entities, e.g. relationships (R) between the basic entities in Spatio-temporal E may be • Human Body Pose The human body is represented points, lines, regions, from the sensor data. characterised with respect to arbitrary spatial and spatiousing a declarative model of the body-structure (see • Human Body Pose The human body is represented relationships (R) between the basic entities in E may be temporal domains such as mereotopology, orientation, disFig. 2), within this model we ground the human bodyusing a declarative model of the body-structure (see characterised with respect to arbitrary spatial and spatiotance, size, motion, rotation (see Table 1 for a list of conpose in 3D-data of skeleton joints and body-parts obFig. 2), within this model we ground the human bodytemporal domains such as mereotopology, orientation, disspatio-temporal abstractions). E.g, let D1 , . . . , Dn tained RGB-D pose infrom 3D-data of sensing. skeleton joints and body-parts ob- sidered tance, size, motion, (seeofTable 1 for a list be spatial domains (e.g. rotation the domain axis-aligned rect-of contained from sensing. The semantic structure sidered spatio-temporal abstractions). E.g, let D • Semantics of RGB-D the Environment 1 , . . . , Dn angles). A spatial relation r of arity n (0 < n) is defined be spatial domains (e.g. the domain of axis-aligned rectof the environment is represented using a topological • Semantics of the Environment The semantic structure as: map corresponding to the floor-plan of the environangles). A spatial relation r of arity n (0 < n) is defined of theextracted environment using a topological ment from is3Drepresented point-clouds obtained from as: r ✓ D1 ⇥ · · · ⇥ Dn . map corresponding to the floor-plan of the environ3D-SLAM data. ment extracted from 3D point-clouds obtained from The spatio-temporal dynamics of the scene can then be repr ⊆ D × · · · × Dn . Using3D-SLAM these models, resented based on the relations1holding between the objects data.visuo-locomotive interactions, involving humans, robots, and objects can be declaratively abin the and the changes with inofthem. Thescene, spatio-temporal dynamics the scene can then be repUsing these models, visuo-locomotive interactions, involvresented based on the relations holding between the objects ing humans, robots, and objects can be declaratively abin the scene, and the changes with in them. Space Space Space Space Time Space Time Space Time curved(o) parallel(o1 , o2 ) Space Space moving into(o1 , o2 ) splitting(o1 , o2 ) Space Space Time Time Time Space Space Space cyclic(o) Space merging(o1 , o2 ) Space Time Space Time Time shrinking(o) stationary(o) Space Space Space Time moving(o) Space Time growing(o) Space inside(o1 , o2 ) Space Space Space Time Time overlapping(o1 , o2 ) Space Space Space Space Time discrete(o1 , o2 ) Space Space moving out(o1 , o2 ) Time attached(o1 , o2 ) Figure 3: Commonsense Spatial Reasoning with Space-Time Histories Representing Dynamics in Everyday Human Activities Interaction (Θ) pick up(P, O) put down(P, O) reach f or(P, O) pass over(P1 , P2 , O) Description a person P picks up an object O. a person P puts down an object O. a person P is reaches for an object O. a person P1 passes an object O to another person P2 . Interaction (Θ) moves into(P, F S) passes(P, F S) Description a person P enters a floor-plan structure F S. a person P passes through a floor-plan structure F S. Table 2: Sample Interactions Involved in Everyday Human Activities: Human Object Interactions and Peoples Locomotive Behaviour objects in the scene, at a specific time; these are defined by the involved spatio-temporal dynamics in terms of changes in the status of space-time histories caused by the interaction, i.e. the description consists of (dynamic) spatio-temporal relations of the involved space-time histories, before, during and after the interaction (See Table 2 for exemplary interactions). We use occurs-at(θ, t), and occurs-in(θ, δ) to denote that an interaction θ occurred at a time point t or in an interval δ, e.g., a person reaching for an object can be defined as follows. occurs-in(reach for(oi , oj ), δ) ⊃ person(oi )∧ holds-in(approaching(body part(hand, oi ), oj ), δi )∧ holds-in(touches(body part(hand, oi ), oj ), δj )∧ Spatio-temporal fluents are used to describe properties of the world, i.e. the predicates holds-at(φ, t) and holds-in(φ, δ) denote that the fluent φ holds at time point t, resp. in time interval δ. Fluents are determined by the data from the depth sensing device and represent qualitative relations between domain-objects, i.e. spatio-temporal fluents denote, that a relation r ∈ R holds between basic spatial entities ε of a space-time history at a time-point t. Dynamics of the domain are represented based on changes in spatio-temporal fluents (see Fig. 3), e.g., two objects approaching each other can be defined as follows. holds-in(approaching(oi , oj ), δ) ⊃ during(ti , δ) ∧ during(tj , δ)∧ before(ti , tj ) ∧ (distance(oi , oj , ti ) > distance(oi , oj , tj )). (1) Interactions. Interactions Θ = {θ1 , θ2 , ..., θi } describe processes that change the spatio-temporal configuration of (2) meets(δi , δj ) ∧ starts(δi , δ) ∧ ends(δj , δ). These definitions can be used to represent and reason about people interactions involving people movement in the environment, as well as fine-grained activities based on body pose data. 4. Application: Grounding Visuo-Locomotive Interactions We demonstrate the above model for grounding everyday activities in perceptual data obtained from RGB-D sensing. The model has been implemented within (Prolog based) constraint logic programming based on formalisations of qualitative space in CLP(QS) [7]. Figure 4: RGB-D data of Human Activities with Corresponding Skeleton Data Human Activity Data RGB-D Data (video, depth, body skeleton): We collect data using Microsoft Kinect v2 which provides RGB and depth data. The RGB stream has a resolution of 1920x1080 pixel at 30 Hz and the depth sensor has a resolution of 512x424 pixels at 30 Hz. Skeleton tracking can track up to 6 persons with 25 joints for each person. Further we use the point-cloud data to detect objects on the table using tabletop object segmentation, based on plane detection to detect the tabletop and clustering of points above the table. For the purpose of this paper simple colour measures are used to distinguish the objects in the scene. 3D SLAM Data (3d maps, point-clouds, floor-plan structure): We collect 3D-SLAM data using Real-Time Appearance-Based Mapping (RTAB-Map) [20], which directly integrates with the Robot Operating System (ROS) [22] for self localisation and mapping under real-time constraints. In particular, for semantic grounding presented in this paper, we use the point-cloud data of the 3D maps obtained from RTAB-Map to extract floor-plan structures by, 1) detection of vertical planes as candidate wall-segments, 2) pre-processing of the wall-segments using clustering and line-fitting, and 3) extraction of room structures based on extracted wall-segments and lines. Plane Detection. Planes in the point-cloud data are detected using a region-growing approach based on the normals of points. To extract candidate wall-segments, we select planes, that are likely to be part of a wall, i.e., horizontal, and sufficiently high or connected to the ceiling. These planes are then abstracted as geometrical entities, specified by their position, size, and orientation (given by the normal), which are used for further analysis. Clustering and Line-Fitting. The detected wall-segments are grouped in a two-stage clustering process using densitybased clustering (DBSCAN) [15], in the first step we cluster wall-segments based on their 2D orientation, in the second step, we align all wall-segments based on the average orientation of the cluster they are in and cluster the wall-segments based on the distance between the parallel lines determined by the wall-segments. We use least square linear regression to fit lines to the resulting wall clusters, which provide the structure of the environment. Extracting Room Structures. Candidate structures for rectangular rooms and corridors are determined by the intersection points of the lines fitted to the wall clusters by considering each intersection point as a possible corner of a room or a corridor. The actual rooms and corridors are then selected based on the corresponding wall segments, projected to the lines. Ex 1. Human-Object Interactions Sample Activity: “Making a Sandwich”. The activity of making a sandwich is characterised with respect to the interactions between a human and its environment, i.e. objects the human uses in the process of preparing the sandwich. Each of these interactions is defined by its spatio-temporal characteristics, in terms of changes in the spatial arrangement in the scene (as described in Sec. 3). As an result we obtain a sequence of interactions performed within the track of the particular instance of the activity, grounded in room1 room1 corridor1 corridor1 extract 2D wall-segments extract2D 2D wall-segments wall-segments extract room2 room2 room2 corridor2 corridor2 room1 connection connection extract 2D wall-segments corridor1 extract 2D wall-segments corridor1 connection room1 connection corridor3 corridor3 corridor3 room2 connection room2 connection connection connection connection corridor2 connection corridor2 connection connection connection corridor3 corridor3 Extracting Room Structure based on Line Intersections and Wall-Segments Extracting Room Structure based on Line Intersections and and Wall-Segments Wall-Segments Extracting Room Structure based on Line Intersections and Wall-Segments Plane Detection PlaneDetection Detection Plane Plane Detection Extracting Room Structure based on Line Intersections and Wall-Segments Clusters and Average Orientation of Clusters Clusters and Average Orientation of Clusters Plane Detection Points in each Cluster Points Points in in each each Cluster Cluster Clusters and Average Orientation of Clusters Points in each Cluster Clusters and Average Orientation of Clusters RGBD SLAM - Input Data RGBDSLAM SLAM -- Input Input Data Data RGBD Orientation Clustering Orientation Clustering RGBD SLAM - Input Data RGBD SLAM - Input Data Aligned Distance Clustering Aligned Distance Clustering Aligned Distance Clustering Line-Fitting Orientation Clustering Aligned Distance Clustering Line-Fitting Figure 5: Extracting Floor-Plan Semantics from 3D Data 3D SLAM SLAM Figure5:5:Extracting Extracting Floor-Plan Semantics Figure Floor-Plan Semantics fromfrom 3D SLAM DataData Figure 5: Extracting Floor-Plan Semantics from 3D SLAM Data and moves the hand hand together with the bread back “Person1 reaches for the bread,with picks up a slice of bread, and moves the together the bread back to to thethe and moves the hand together with the bread back to the and moves the hand together with the bread back to the and moves the hand together with the bread back to the chopping board. ” chopping board. ” chopping board. ” chopping board.” chopping board.” The data data we weobtain obtainfrom from the RGB-D sensor consists consists of of 3D3D The data we obtain fromthe theRGB-D RGB-Dsensor sensor consists of 3D The we obtain from the RGB-D sensor consists of 3D The data data we obtain from the RGB-D sensor consists of 3D positions of skeleton joints and tabletop objects for each positions of skeleton joints and tabletop objects for each positions of skeleton joints and tabletop objects for each positions of skeleton skeleton joints jointsand andtabletop tabletopobjects objects each positions of forfor each time-point. time-point. time-point. time-point. time-point. at(joint(id(0), at(joint(id(0), person(id(1))), person(id(1))), at(joint(id(0), person(id(1))), tracking_status(2), tracking_status(2), at(joint(id(0), person(id(1))), pos_3d(point(0.230083,-0.0138919,2.05633)), tracking_status(2), tracking_status(2), pos_3d(point(0.230083,-0.0138919,2.05633)), time_point(2168577589)). pos_3d(point(0.230083,-0.0138919,2.05633)), pos_3d(point(0.230083,-0.0138919,2.05633)), time_point(2168577589)). time_point(2168577589)). time_point(2168577589)). at(joint(id(1), at(joint(id(1), person(id(1))), person(id(1))), tracking_status(2), at(joint(id(1), person(id(1))), at(joint(id(1), person(id(1))), tracking_status(2), pos_3d(point(0.228348,0.275798,1.98048)), tracking_status(2), tracking_status(2), pos_3d(point(0.228348,0.275798,1.98048)), time_point(2168577589)). pos_3d(point(0.228348,0.275798,1.98048)), pos_3d(point(0.228348,0.275798,1.98048)), time_point(2168577589)). ... time_point(2168577589)). ... time_point(2168577589)). at(object(id(0)), type(bread), ... ... at(object(id(0)), type(bread), pos_3d(point(0.223528,0.500194,1.92038)), at(object(id(0)), type(bread), at(object(id(0)), type(bread), pos_3d(point(0.223528,0.500194,1.92038)), time_point(2168577589)). pos_3d(point(0.223528,0.500194,1.92038)), time_point(2168577589)). ... pos_3d(point(0.223528,0.500194,1.92038)), time_point(2168577589)). time_point(2168577589)). ... ... Grounded Interaction Sequence Based on the ... Line-Fitting Line-Fitting Line-Fitting Orientation Clustering the spatio-temporal spatio-temporaldynamics dynamics of thescenario. scenario. As an examthe spatio-temporal AsAs an an examthe spatio-temporal dynamicsofofthe the scenario. example consider the sequence depicted in Fig. 4, the interactions the spatio-temporal dynamics of the scenario. As an examconsider thethe interactions ple consider considerthe thesequence sequencedepicted ple the sequence depictedininFig. Fig.4, 4, interactions in this sequence canbe be described asfollows: follows: plethis consider the sequence depictedas inas Fig. 4, the interactions this sequence can in this sequence can in sequence can bedescribed described follows: in this sequence can be described as follows: “Person1 Person1 reaches reachesfor for the bread, picks up a slice of bread, aa slice of of bread, Person1 reaches forthe thebread, bread,picks picksupup up a slice slice of bread, ““Person1 reaches for the bread, picks bread, sensed Grounded InteractionSequence Sequence Based Basedonon sensed Grounded data Interaction thethe sensed body-pose and the detected objects, a sequence inGrounded Interaction Sequence Based on theofsensed body-pose data and the detected objects, a sequence of body-posecan databeand the detected a sequences sequence of in- interactions queried from theobjects, example using body-pose data and the detected objects, a sequence of interactions canbe bequeried queriedfrom fromthe theexample example sequences using teractions can sequences using the interactive query answering mode of Prolog. teractions can be queried from the example sequences using the interactivequery queryanswering answeringmode mode Prolog. interactive ofof Prolog. ?- grounded_interaction( the interactive query answering mode of Prolog. occurs_in(Interaction, Interval), Grounding). ?- grounded_interaction( grounded_interaction( occurs_in(Interaction, Grounding). ?- grounded_interaction( occurs_in(Interaction,Interval), Interval), This results in all interactions identified in theGrounding). example seoccurs_in(Interaction, Interval), Grounding). results interactions identified in in therespect example This results inall allrespective interactions identified the example quence and in their grounding with to setheseThis results in allrespective interactions identified in respect therespect example sequence and grounding with to to thethe quence and their their respective grounding with spatio-temporal dynamics constituting the interaction, quence and their respective grounding with respect to the spatio-temporal dynamics constituting the interaction, spatio-temporal dynamics constituting the interaction, Interaction = reach_for(person(id(1)), object(bread)), spatio-temporal dynamics constituting the interaction, Interval = interval(t1, t3), Interaction == reach_for(person(id(1)), object(bread)), Interaction reach_for(person(id(1)), object(bread)), Grounding = Points in each Cluster Interval = interval(t1, t3), Interval = interval(t1, t3), Interaction = reach_for(person(id(1)), object(bread)), [holds_in( Grounding = Grounding Interval = =interval(t1, t3), approaching( [holds_in( [holds_in( Grounding = body_part(right_hand, person(id(1))), object(bread)), approaching( approaching( [holds_in( interval(t1,t2)), body_part(right_hand, person(id(1))), object(bread)), body_part(right_hand, person(id(1))), object(bread)), approaching( holds_in( interval(t1,t2)), interval(t1,t2)), body_part(right_hand, person(id(1))), object(bread)), touching( holds_in( holds_in( interval(t1,t2)), body_part(right_hand, person(id(1))), object(bread)), touching( touching( holds_in( interval(t2,t3)]; body_part(right_hand, person(id(1))), object(bread)), body_part(right_hand, person(id(1))), object(bread)), touching( interval(t2,t3)]; interval(t2,t3)]; body_part(right_hand, person(id(1))), object(bread)), interval(t2,t3)]; Interaction = pick_up(person(id(1)), object(bread)), Interaction == pick_up(person(id(1)), object(bread)), Interaction = pick_up(person(id(1)), object(bread)), Interval interval(t4, t6), Interval = interval(t4, t6), t6), Interval interval(t4, Interaction === pick_up(person(id(1)), object(bread)), Grounding Grounding Grounding = Interval = =interval(t4, t6), [occurs_at( [occurs_at( Grounding = [occurs_at( grasp( grasp( [occurs_at( grasp( body_part(right_hand, person(id(1))), object(bread)), body_part(right_hand, person(id(1))), object(bread)), grasp( body_part(right_hand, person(id(1))), object(bread)), timepoint(t4), timepoint(t4), body_part(right_hand, person(id(1))), object(bread)), timepoint(t4), holds_in( holds_in( timepoint(t4), holds_in( attached( attached( holds_in( attached( body_part(right_hand, person(id(1))), object(bread)), body_part(right_hand, person(id(1))), object(bread)), attached( body_part(right_hand, person(id(1))), object(bread)), interval(t5,t8)), interval(t5,t8)), body_part(right_hand, person(id(1))), object(bread)), interval(t5,t8)), holds_in( holds_in( interval(t5,t8)), holds_in( move_up(body_part(right_hand, person(id(1)))), move_up(body_part(right_hand, person(id(1)))), holds_in( move_up(body_part(right_hand, person(id(1)))), interval(t5,t6))]; interval(t5,t6))]; move_up(body_part(right_hand, person(id(1)))), interval(t5,t6))]; ... ... interval(t5,t6))]; ... ... In In particular, the the interaction reach f or(person(id(1)), particular, interaction reach f or(person(id(1)), In particular, the interaction interaction reach f or(person(id(1)), or(person(id(1)), In particular, theoccurring interaction reach ftime-point or(person(id(1)), In particular, the reach ftime-point object(bread)) between t1 and object(bread)) occurring between t1 and object(bread)) occurring between time-point t1 and and object(bread)) occurring between time-point t1 and object(bread)) occurring between time-point t1 t3 t3 is is composed of the spatio-temporal pattern of composed of the spatio-temporal pattern of t3 is is composed of the spatio-temporal pattern of t3 is composed of the the spatio-temporal pattern of t3 composed of spatio-temporal pattern of approaching, stating that the right hand of person approaching, stating that the right hand of person approaching, stating that the during right hand of person approaching, stating that the right right hand of t1person person 1 1 is approaching the bread time-interval approaching, stating that the hand of is approaching the bread during time-interval t1 1to is the the bread duringduring time-interval t1 11t2,approaching ist2,and approaching the bread during time-interval t1 the the pattern touching, stating that that the is approaching bread time-interval t1 to and pattern touching, stating the to t2, and the pattern touching, stating that the to t2, and the pattern touching, stating that the right hand of person 1 is touching the bread durto t2, and the pattern touching, stating that the right of person 1 is touching the bread right handhand of person the dur- during right time-interval to 1t3.is 11 touching Similarly the bread interaction hand oft2person person is touching touching the bread durright hand of is the bread during time-interval t2 to t3. Similarly the interaction ing time-interval t2 tot2object(bread)) t3. Similarly interaction picking up(person(id(1)), isthecomposed of time-interval to t3. Similarly the interaction ing time-interval t2 to t3. Similarly the interaction pick up(person(id(1)), object(bread)) is composed of pick up(person(id(1)), object(bread)) is composed of grasping, attachment and upwards movement, with the pick up(person(id(1)), object(bread)) is composed composed of pick up(person(id(1)), object(bread)) is of grasping, attachment and upwards movement, with the grasping, attachment and upwards movement, with the difference, thatattachment grasping itself isupwards an interaction, that can grasping, attachment and upwards movement, with the and movement, with the difference, grasping isinteraction, an interaction, that can difference, that that grasping itselfitself is an be further grounded in movement dynamics. Thisthat kindcan of difference, that can that in grasping itself is dynamics. an interaction, that can be further grounded in movement This kind be further grounded movement dynamics. This kind of declarative grounding can be used, e.g., for relational learn-kind of be of further grounded in movement dynamics. This kind of grounding canused, be used, e.g., for relational declarative grounding can e.g., for relational learn- learningdeclarative by demonstration, etc.be declarative learngrounding can be used, e.g., for relational learnby demonstration, ing ing by demonstration, etc. etc. ing by demonstration, etc. Ex 2. Visuo-Locomotive Interactions Ex Ex 2. 2.Visuo-Locomotive Interactions Visuo-Locomotive Interactions Ex 2. Activity: Visuo-Locomotive Interactions Sample “Indoor Robot Navigation”. Robots Sample Activity: “Indoor Robot Navigation”. RobotsRobots Sample Activity: “IndoorinRobot Navigation”. having to behave and navigate environments populated Sample Activity: “Indoor Robot Navigation”. Robots Sample Activity: “Indoor Robot Navigation”. Robots having to behave and navigate in environments populated behave and navigate in activities environments populated by having humans to have to understand human and interhaving to behave and navigate in environments populated by humans have to understand human activities and interhaving to behave and navigate in environments populated actions and have to behave accordingly. this context, by humans have to understand humanInactivities and interby humans to understand human and interactions andabstractions havehave to behave accordingly. Inactivities thisIncontext, by humans have toto human activities interhigh-level ofunderstand human everyday activities and the actions and have behave accordingly. thisand context, actions and have to behave accordingly. In this context, high-level abstractions of human everyday activities and the actions and have to behave accordingly. In this context, semantics of the environment can be used to guide robot high-level abstractions of human everyday activities and the high-level abstractions of activities the semantics of the environment can be everyday used to guide robot high-level abstractions of human everyday activities and the decision-making forhuman humans moving theguide envi-and semantics of to theaccount environment can be usedin to robot semantics of the environment can be used to guide robot decision-making to account for humans moving in the envisemantics of the environment can be used to guide robot ronment. decision-making to account for humans moving in the environment. decision-making to decision-making to account account for for humans humans moving moving in in the the envienvironment. ronment. ronment. As an example consider a robot that has to move from room1 to room2, during this movement the robot has to As an example robot that has move from pass through theconsider corridor acorridor2. The to structure of the room1 to room2, during this movement the robot has to environment is represented as follows: pass through the corridor corridor2. The structure of the floorplan_structure(id(room1), type(room)). environment is represented as follows: geom(id(room1), polygon([ point(33.04074928940648, 47.78135448806469), floorplan_structure(id(room1), type(room)). point(41.95226523762394, 53.36407052934558), geom(id(room1), polygon([ point(44.20648040233633, 49.48777998147939), point(33.04074928940648, 47.78135448806469), point(35.17204967399538, 43.83961776145081) point(41.95226523762394, 53.36407052934558), ])). point(44.20648040233633, 49.48777998147939), point(35.17204967399538, 43.83961776145081) floorplan_structure(id(corr1), type(corridor)). ])). geom(id(corr1), polygon([ floorplan_structure(id(corr1), type(corridor)). point(34.17204967399538, 42.83961776145081), geom(id(corr1), polygon([ ... ])). point(34.17204967399538, 42.83961776145081), ... ])). floorplan_structure(id(room2), type(room)). geom(id(room2), polygon([ ... ])). floorplan_structure(id(room2), type(room)). geom(id(room2), polygon([ ... ])). ... ... Based Based on on the the extracted extracted semantic semantic floor-plan floor-plan structure structure and and the the detected people in the environment, the robot can make Based on the extracted semantic floor-plan structure and thededetected people in the environment, the robot can make dedetected people in the environment, the robot can make decisions cisions using using high-level high-level navigation navigation rules, rules, e.g. e.g. defining defining how how cisions using high-level navigation rules, e.g. defining how to behave in narrow passages, such as the corridor to behave in narrow passages, such as the corridor when when to behavepeople in narrowthe passages, such as thecan corridor when there there are are people in in the corridor. corridor. E.g. E.g. we we can define define aa rule rule therea are people the enter corridor. E.g. we(the canrobot definecan a rule that robot can in only a corridor exethat a robot can only enter a corridor (the robot can exethat athe robot can action only enter a corridor (the Structure, robot can execute control enter(F loorplan T )), cute the control action action enter(Floorplan loorplanStructure, Structure, T )), theiscontrol )), ifcute there no person inenter(F the corridor, or the person isTpassifif there is no person in the corridor, or the person is passis no person the corridor, passingthere the corridor in theinsame directionorasthetheperson robot.isFor this ing the corridor in the thesame samedirection directionasasthe therobot. robot.For For this ing the corridor in this example we use a simple action language for planing the acexample we use a simple action language for planing the example werobot, use a simple language for planing ac-actions of the in this action context the predicate possthe at(✓, t) tions the robot, robot, in inthis thiscontext contextthe thepredicate predicateposs poss at(θ, tions of ofthe the t) t) defines spatio-temporal configuration, in whichat(✓, the condefines spatio-temporalconfiguration, configuration,ininwhich which condefines the spatio-temporal thethe control action ✓ can be executed. trol action θ can be executed. trol ✓ can be executed. poss_at( poss_at( enter(fp_struct(id(FS_ID), type(corridor))), enter(fp_struct(id(FS_ID), type(corridor))), timepoint(T)) :timepoint(T)) :not(holds_at( not(holds_at( inside(person(P_ID), fp_struct(FS_ID)), inside(person(P_ID), fp_struct(FS_ID)), timepoint(T))). timepoint(T))). poss_at( poss_at( enter(fp_struct(id(FS_ID), type(corridor))), enter(fp_struct(id(FS_ID), type(corridor))), timepoint(T)) :timepoint(T)) :- holds_at( holds_at( inside(person(P_ID), fp_struct(id(FS_ID),_)), _)), inside(person(P_ID), fp_struct(id(FS_ID), timepoint(T)), timepoint(T)), occurs_in( occurs_in( passing(person(P_ID), fp_struct(id(FS_ID), passing(person(P_ID), fp_struct(id(FS_ID),_), _),Dir1), Dir1), interval(I)), interval(I)), time(during(T, I)), time(during(T, I)), trajectory(person(P_ID), P_Path, trajectory(person(P_ID), P_Path,interval(I)), interval(I)), planed_trajectory(R_Path), planed_trajectory(R_Path), movement_direction(P_Path, Dir1), movement_direction(P_Path, Dir1), movement_direction(R_Path, Dir2), movement_direction(R_Path, Dir2), same_direction(Dir1, Dir2). same_direction(Dir1, Dir2). The above above rules The rules state state that that the the robot robot can can only onlyex-execute the control action enter(f p struct(id(F S SID), ecute the control action enter(f p struct(id(F ID), type(corridor))) if one of the two rules is true. The first type(corridor))) if one of the two rules is true. The first simply states states that that the the robot robot can can enter enter the the corridor corridor ifif rule simply no person person in in the the corridor. corridor. The The second second rule rule states, states, there is no rule simply states that theinside robot the cancorridor, enter theand corridor if is that if there is the there is aa person person inside the corridor, and the person person is there is no through person in thecorridor, corridor.the second passing the robot can enter the through the corridor, theThe robot can rule enterstates, the corricorrithat if there a person inside corridor, andthrough the person dor, if theistrajectory of person passing the trajectory of the thethe person passing through theiscorricorripassing through the corridor, the robot can enter the corridor and the the planed planed path path of of the the robot robot are are passing passing the the corridor corridor dor, if the trajectory of the person passing through the corriin the same same direction. direction. dor and the planed path of the robot are passing the corridor In this way, high-level way, high-level semantic semantic behaviour behaviour descriptions descriptions can can in the same direction. be used for guiding low-level robot controls, such as path for guiding low-level robot controls, such as path In this way, high-level semantic behaviour descriptions can planning, etc. etc. be used for guiding low-level robot controls, such as path planning, etc. 5. 5. Summary Summary and and Outlook Outlook 5. Summary and Outlook Visuo-locomotive Visuo-locomotive sensemaking sensemaking for for practical practical cognitive cognitive robotics in contextualised settings with mobility, Visuo-locomotive sensemaking for practical cognitive robotics in contextualised settings with humans, humans, mobility, and interaction is robotics in contextualised settings with humans, endeavour mobility, reand human-machine human-machine interaction is aa complex complex endeavour requiring integrative methodologies combining the and human-machine is a complex endeavour re- of quiring integrativeinteraction methodologies combining the state state of the from research such quiring methodologies combining the stateAI, ofHCI, the art artintegrative from several several research areas areas such as as vision, vision, AI, HCI, Our the theand art engineering. from several research areasemphasis such as vision, AI, HCI,merit and engineering. Our research research emphasis the particular particular merit and engineering. Our research emphasis the particular merit of combining visual processing with semantic of combining visual processing with semantic knowledge knowledge of representation combining visual processing with semantic knowledge representation and and reasoning reasoning techniques techniques rooted rooted in in artificial artificial representation and reasoningcommonsense techniques rooted in artificial intelligence, particularly reasoning. intelligence, particularly commonsense reasoning. We We have have intelligence, particularly commonsense reasoning. We have presented presented aa declarative declarative commonsense commonsense model model for for groundgroundpresented a declarative commonsense model for the grounding embodied visuo-locomotive interactions; ing embodied visuo-locomotive interactions; the proposed proposed ingmodel embodied visuo-locomotive interactions; the proposed —consisting of a formal characterisation of space, model —consisting of a formal characterisation of space, model —consisting of a formal characterisation of space, time, space-time, and motion patterns— is geared towards time, space-time, and motion patterns— is geared towards time, space-time, and motion patterns— is geared towards such knowledge representation and reasoning capabilities knowledge representation and reasoning capabilities such knowledge representation and reasoning capabilities such as commonsense abstraction, learning, reasoning, embodas commonsense abstraction, learning, reasoning, embodas commonsense abstraction, learning, reasoning, embodied simulation. With aa particular focus on the simulation. With particular focus onrepresentation the representation representation iedied simulation. With a particular focus on the of space-time histories and motion patterns, the model is ilof space-time histories and motion patterns, the model of space-time histories and motion patterns, the model is il- is illustrated with select RGB-D datasets corresponding to lustrated with select RGB-D datasets corresponding to repreplustrated with select RGB-D datasets corresponding to representative activities from a larger dataset of everyday acresentative activities from a larger dataset of everyday resentative activities from a larger dataset of everyday ac- activities. Immediate next steps involve integration with state tivities. Immediate steps involve integration tivities. Immediate nextnext steps involve integration with with state state robot control platforms as of of thethe artart robot control platforms suchsuch as ROS; this this will of the art robot control platforms such as ROS; ROS; this will will be accomplished via integration into the ExpCog commonbe be accomplished via via integration into into the ExpCog commonaccomplished integration the ExpCog commonsense cognition robotics platform for // simsense cognition robotics platform for experimental / simsense cognition robotics platform for experimental experimental simulation purposes, and within openEASE as a state of ulation purposes, andand within openEASE as a as state of theof the ulation purposes, within openEASE a state the cognition-enabled control of robotic control platform artart cognition-enabled control of robotic control platform for for art cognition-enabled control of robotic control platform for 2 2 real robots. real robots. real robots.2 Acknowledgements Acknowledgements Acknowledgements This research is partially funded by the Research This research is partially funded by Germany the Germany Research This research is partially funded by theResearch Germany Research Foundation (DFG) via via the the Collabortive Center Foundation (DFG) Collabortive Research Center Foundation via Activity theActivity Collabortive Research Center (CRC) EASE –(DFG) Everyday Science and Engineer(CRC) EASE – Everyday Science and Engineer(CRC) EASE – Everyday Activity Science and Engineering inging (http://ease-crc.org). We We also also acknowledge (http://ease-crc.org). acknowledge (http://ease-crc.org). WeThomas alsoHudkovic, acknowledge thethe support of of Omar Moussa, Thomas and the Visupport Omar Moussa, Hudkovic, andsupViport of Omar Moussa, Thomas Hudkovic, and Vijayanta Jain jayanta Jain in preparation of parts of the overall activity jayanta Jain in preparation of parts of the overall activity in preparation of parts of the overall activity dataset. dataset. dataset. 2 ExpCog – http://www.commonsenserobotics.org 22ExpCog – http://www.commonsenserobotics.org ExpCog http://www.commonsenserobotics.org openEASE – –http://ease.informatik.uni-bremen.de/ openEASE openEASE –– http://ease.informatik.uni-bremen.de/ http://ease.informatik.uni-bremen.de/ openease/ openease/ openease/ References [1] M. Aiello, I. E. Pratt-Hartmann, and J. F. v. Benthem. Handbook of Spatial Logics. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2007. [2] G. Bartels, I. Kresse, and M. Beetz. Constraint-based movement representation grounded in geometric features. In Proceedings of the IEEE-RAS International Conference on Humanoid Robots, Atlanta, Georgia, USA, October 15–17 2013. [3] B. Bennett, A. G. Cohn, P. Torrini, and S. M. Hazarika. Describing rigid body motions in a qualitative theory of spatial regions. In Proceedings of the Seventeenth National Conference on Artificial Intelligence and Twelfth Conference on on Innovative Applications of Artificial Intelligence, pages 503–509, 2000. [4] B. Bennett, A. G. Cohn, P. Torrini, and S. M. Hazarika. A foundation for region-based qualitative geometry. In Proceedings of the 14th European Conference on Artificial Intelligence, pages 204–208, 2000. [5] M. Bhatt. Reasoning about space, actions and change: A paradigm for applications of spatial reasoning. In Qualitative Spatial Representation and Reasoning: Trends and Future Directions. IGI Global, USA, 2012. [6] M. Bhatt, H. Guesgen, S. Wölfl, and S. Hazarika. Qualitative spatial and temporal reasoning: Emerging applications, trends, and directions. Spatial Cognition & Computation, 11(1):1–14, 2011. [7] M. Bhatt, J. H. Lee, and C. P. L. Schultz. CLP(QS): A declarative spatial reasoning framework. In Spatial Information Theory - 10th International Conference, COSIT 2011, Belfast, ME, USA, September 12-16, 2011. Proceedings, pages 210–230, 2011. [8] M. Bhatt, C. Schultz, and C. Freksa. The ‘Space’ in Spatial Assistance Systems: Conception, Formalisation and Computation. In T. Tenbrink, J. Wiener, and C. Claramunt, editors, Representing space in cognition: Interrelations of behavior, language, and formal models. Series: Explorations in Language and Space. 978-0-19-967991-1, Oxford University Press, 2013. [9] A. G. Cohn and J. Renz. Qualitative spatial reasoning. In F. van Harmelen, V. Lifschitz, and B. Porter, editors, Handbook of Knowledge Representation. Elsevier, 2007. [10] E. Davis. Pouring liquids: A study in commonsense physical reasoning. Artif. Intell., 172(12-13):1540–1578, 2008. [11] E. Davis. How does a box work? a study in the qualitative dynamics of solid objects. Artif. Intell., 175(1):299–345, 2011. [12] E. Davis. Qualitative spatial reasoning in interpreting text and narrative. Spatial Cognition & Computation, 13(4):264– 294, 2013. [13] M. Eppe and M. Bhatt. Narrative based postdictive reasoning for cognitive robotics. In COMMONSENSE 2013: 11th International Symposium on Logical Formalizations of Commonsense Reasoning, 2013. [14] C. Eschenbach and K. Schill. Studying spatial cognition a report on the dfg workshop on ”the representation of motion”. KI, 13(3):57–58, 1999. [15] M. Ester, H. Kriegel, J. Sander, and X. Xu. A density-based algorithm for discovering clusters in large spatial databases [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] with noise. In E. Simoudis, J. Han, and U. M. Fayyad, editors, Proceedings of the Second International Conference on Knowledge Discovery and Data Mining (KDD-96), Portland, Oregon, USA, pages 226–231. AAAI Press, 1996. H. W. Guesgen. Spatial reasoning based on Allen’s temporal logic. Technical Report TR-89-049. International Computer Science Institute Berkeley, 1989. P. J. Hayes. Naive physics I: ontology for liquids. In J. R. Hubbs and R. C. Moore, editors, Formal Theories of the Commonsense World. Ablex Publishing Corporation, Norwood, NJ, 1985. S. M. Hazarika. Qualitative Spatial Change : Space-Time Histories and Continuity. PhD thesis, The University of Leeds, School of Computing, 2005. Supervisor - Anthony Cohn. D. Hernández, E. Clementini, and P. Di Felice. Qualitative distances. Springer, 1995. M. Labbe and F. Michaud. Online Global Loop Closure Detection for Large-Scale Multi-Session Graph-Based SLAM. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 2661–2666, Sept 2014. R. Moratz. Representing relative direction as a binary relation of oriented points. In ECAI, pages 407–411, 2006. M. Quigley, K. Conley, B. P. Gerkey, J. Faust, T. Foote, J. Leibs, R. Wheeler, and A. Y. Ng. Ros: an open-source robot operating system. In ICRA Workshop on Open Source Software, 2009. D. A. Randell, Z. Cui, and A. G. Cohn. A spatial logic based on regions and connection. KR, 92:165–176, 1992. J. Renz and B. Nebel. Qualitative spatial reasoning using constraint calculi. In Handbook of Spatial Logics, pages 161–215. 2007. A. Scivos and B. Nebel. The Finest of its Class: The Natural, Point-Based Ternary Calculus LR for Qualitative Spatial Reasoning. In C. Freksa et al. (2005), Spatial Cognition IV. Reasoning, Action, Interaction: International Conference Spatial Cognition. Lecture Notes in Computer Science Vol. 3343, Springer, Berlin Heidelberg, volume 3343, pages 283– 303, 2004. M. Spranger, J. Suchan, and M. Bhatt. Robust Natural Language Processing - Combining Reasoning, Cognitive Semantics and Construction Grammar for Spatial Language. In IJCAI 2016: 25th International Joint Conference on Artificial Intelligence. AAAI Press, 2016. M. Spranger, J. Suchan, M. Bhatt, and M. Eppe. Grounding dynamic spatial relations for embodied (robot) interaction. In PRICAI 2014: Trends in Artificial Intelligence - 13th Pacific Rim International Conference on Artificial Intelligence, Gold Coast, QLD, Australia, December 1-5, 2014. Proceedings, pages 958–971, 2014. S. Tellex. Natural language and spatial reasoning. PhD thesis, Massachusetts Institute of Technology, 2010. A. Tyler and V. Evans. The semantics of English prepositions: spatial scenes, embodied meaning and cognition. Cambridge University Press, Cambridge, 2003. F. Worgotter, E. E. Aksoy, N. Kruger, J. Piater, A. Ude, and M. Tamosiunaite. A simple ontology of manipulation actions based on hand-object relations. 2012.
2cs.AI
A Minimal OO Calculus for Modelling Biological Systems∗ Livio Bioglio Dipartimento di Informatica Università di Torino Torino, Italy [email protected] In this paper we present a minimal object oriented core calculus for modelling the biological notion of type that arises from biological ontologies in formalisms based on term rewriting. This calculus implements encapsulation, method invocation, subtyping and a simple form of overriding inheritance, and it is applicable to models designed in the most popular term-rewriting formalisms. The classes implemented in a formalism can be used in several models, like programming libraries. 1 Introduction In biology, homogeneous biological entities are usually grouped according to their behaviour. Enzymes are proteins that catalyse (i.e. increase the rates of) chemical reactions, receptors are proteins embedded in a membrane to which one or more specific kinds of signalling molecules may attach producing a biological response, hydrolases are enzymes that catalyse the hydrolysis of a chemical bond, and so on. Such classification is greatly behaviour-driven: the lactase is a hydrolase, then its peculiarity with respect to the other biological entities is that it catalyses the hydrolysis of a particular molecule. It suggests Computer Science types: every biological entity can be classified with a type, containing the sound operations for it. These operations describe only the general behaviours, that may be modelled by means of different formalisms. Like Computer Science types, these Biological types are used to check the correctness of the chemical reactions. In fact, lactase is not just a hydrolase, but a glycoside hydrolase, i.e. it catalyses the hydrolysis of the glycosidic linkage of a sugar to release smaller sugars. If in the system the substrate or the products are not sugars, somewhere there is an error. Moreover, in Biological types we can recognize a subtype relation. Lactase hydrolyse the lactose, that is a disaccharide. Since the disaccharide is identified as a subtype of sugar, the hydrolysis operation associated to the glycoside hydrolase type is correct. Many formalisms originally developed by computer scientists to model systems of interacting components have been applied to Biology: among these, there are Petri Nets [16], Hybrid Systems [2], and the π -calculus [7, 21]. Moreover, new formalisms have been defined for describing biomolecular and membrane interactions, for example [3, 5, 6, 9, 19, 20, 17]. Even if types are used by biologists and studied by computer scientists, curiously they are usually not implemented in Computer Science biological models. Despite the number of formalisms developed by computer scientists and applied to model biological systems, just in the last few years there has been a growing interest on the use of type disciplines to enforce biological properties. In [12] three type systems are defined for the Biochemical Abstract Machine, BIOCHAM (see [1]). In [10] a type system for the Calculus of Looping Sequences (see [3]) has been defined to guarantee the soundness of reduction rules with respect to the requirement of certain elements, and the repellency of other ones. Finally, in [4], group types are used to regulate compartment crossing in the BioAmbients framework [20]. However, none of them exploits the similarities between ∗ This work was partly funded by the project BioBIT of the Regione Piemonte. Ion Petre and Erik De Vink (Eds.): Third International Workshop on Computational Models for Cell Processes (CompMod 2011) EPTCS 67, 2011, pp. 50–64, doi:10.4204/EPTCS.67.6 L. Bioglio 51 E ::= element composition v | x | E +E R ::= rule declaration E → E Figure 1: Biological Rules the types in Biology and in Computer Science. In this paper we present a minimal object oriented core calculus for term-rewriting formalisms, i.e. formalisms based on term rewriting, that models the notion of types used in biology as above described. We implement only the object oriented paradigm skills that, in our view, are basic in modelling biological systems, that is encapsulation, method invocation, subtyping and a simple inheritance. The purpose of this calculus is to facilitate the organizations of rules, and to improve their re-use in the model, or even in other models. By means of subtyping, for example, modellers create a class hierarchy, that can be used in different models like programming libraries: classes and methods are created by expert researchers, but they can also be used by raw users. The remainder of this paper is organized as follows. In Section 2 we formally present the core calculus. In Section 3 we propose classes explaining some enzyme behaviours. In Section 4 we apply our framework to two term-rewriting formalisms, the Calculus of Looping Sequences [3] and the P systems [17]. Finally, in Section 5 we draw conclusions and we discuss some future developments. 2 Core Calculus Term-rewriting formalisms [3, 6, 9, 17] have been applied to modelling biological systems. They are characterized by the syntax of terms and the operational semantics. A term represents the structure of the modelled system, and the reduction rules represent the possible evolutions of the system. Some termrewriting formalisms embed the rules in the terms, other prefer to divide them. In our core calculus, a class contains methods (encapsulation) and extends another class (subtyping); a class inherits all the methods of the class it extends (inheritance). Methods are formed by a sequence of variables (the arguments) and a sequence of reduction rules, expressed in the syntax of the termrewriting formalism, containing these variables. The methods are called on values of the model, i.e. the biological entities, with a sequence of values as arguments (method invocation). The method invocations are replaced by the reduction rules which are method bodies, where the variables are replaced by the values used as arguments. These reduction rules are then used for the evolution of the model. For the sake of generality, in running examples we use the biological rule notation to represent reduction rules: the syntax is depicted in Figure 1. We use the notation E1 ⇋ E2 instead of the pair of reduction rules E1 → E2 and E2 → E1 . For example, the hypothetical class of glycoside hydrolase contains a method to hydrolyse a sugar into two sugars, all of them passed as arguments. This method contains the sequence of reduction rules that models hydrolysis. We assign to lactase the glycoside hydrolase type, and then call on it the hydrolysis method, passing as arguments the lactose and the sugar products. By invocation, we obtain the reduction rules specific for lactase, that will be used for the evolution of the model. In this section we present the formal definition of the calculus. The syntax, definitions and rules of the calculus are inspired by the ones proposed by Igarashi, Pierce and Wadler for Featherweight Java [14], A Minimal OO Calculus for Modelling Biological Systems 52 a minimal core calculus for modelling the Java Type System. 2.1 Syntax Syntax CT ::= class table declaration CL CL ::= class declaration (C 6= Object) class C extends D{M} M ::= method declaration m(C x) R R ::= reduction rule declaration according to the formalism syntax contains variables, values and this I ::= method invocation v.m(v) x variable v value this this Figure 2: Syntax The syntax is given in Figure 2. The metavariables C and D range over class names; m ranges over method names; CL ranges over class declarations; M ranges over method declarations; R ranges over reduction rules, according to the syntax of the formalism; I ranges over method invocations; x ranges over parameter names; v ranges over values, i.e. the symbols of the model. We assume that the set of variables includes the special variable this. Notice that this is never used as argument of a method. We write M as shorthand for M1 . . . Mn and write C for C1 , . . . ,Cn (similarly x, v, etc.). We abbreviate operations on pairs of sequences similarly, writing C x for C1 x1 , . . . ,Cn xn , where n is the length of C and x. Sequences of parameter names and method declarations are assumed to contain no duplicate names. The declaration class C extends D{M} introduces a class named C with superclass D. The new class has the suite of methods M. The methods declared in C are added to the ones declared by D and its superclasses, and may override methods with the same names that are already present in D, or add new functionalities. The class Object has no methods and does not have superclasses. The method declaration m(C x) R introduces a method named m with parameters x of types C. The body of the method is a sequence of reduction rules R, expressed in the syntax of the formalism. The variables x and the special variable this are bound in R. A class table CT is a mapping from class names C to class declarations CL. We assume a fixed class table CT satisfying some sanity conditions: (1) CT (C) = class C . . . for every C ∈ dom(CT ); (2) Object ∈ / dom(CT ); (3) for every class name C (except Object) appearing in CT , we have C ∈ dom(CT ); (4) there are no cycles in the subtype relation induced by CT , i.e. a class cannot extends one of its subclasses. The fixed type environment Γ contains the association between values v and their types C, written v : C. We assume that Γ satisfies some sanity conditions: (1) if v : C ∈ Γ for some v, then C ∈ dom(CT ); (2) every value in the set of values (according to the formalism specifications) is associated to exactly one type in Γ. L. Bioglio 53 For example, we define the class of molecules as follows: class Molecule extends Object{} The Molecule class has the Object class as superclass, and it does not have methods, i.e. molecules do not have any particular behaviour. An enzyme is a protein that catalyse chemical reactions. In an enzymatic reaction, the molecules at the beginning of the process (called substrates) are converted into different molecules (called the products), while the enzyme itself is not consumed by the reaction. We define the class of enzymes as follows: class Enzyme extends Object { action(Molecule S, Molecule P) S + this → this + P } For the sake of simplicity, in our example an enzyme extends an object rather than a protein, jumping a hierarchy level. According to the enzyme definition, the only method of the Enzyme class is action, which converts the variable molecule S (the substrate) into the variable molecule P (the product) in presence of the enzyme (the this variable). In the rest of the paper, the Molecule class and its extensions denotes biological object having no particular behaviour, and the Enzyme class and its extensions denotes biological object having a behaviour. Class tables and environment types are used to create a triple (CT, Γ, P), where P is a model designed according to the formalism specifications. In P we use method invocations instead of reduction rules. The class table CT and the type set Γ are fixed, i.e. they are determined during the model creation and cannot vary during model evolution. 2.2 Auxiliary Definitions For the typing and evaluation of rules, we need a few auxiliary definitions: these are given in Figure 3. The type of a method m in a class C, written mtype(m,C), is a sequence of types C. The sequence gives the types of the arguments of the method m defined in the class C, or in one of its superclasses, if not defined in C. For example, mtype(action, Enzyme) = (Molecule, Molecule) The body of a method m in a class C, written mbody(m,C), is a pair (x, R) of a sequence of variables x and a sequence of reduction rules R. The elements of the pair are the arguments and the reduction rules of the method m defined in the class C, or in one of its superclasses, if not defined in C. For example, mbody(action, Enzyme) = ((S, P), S + this → this + P) 2.3 Evaluation The unique evaluation rule concerns the method invocation v.m(t). In this case, if the value v has type C in Γ, and the method m has arguments x and body R in C, then its evaluation is the sequence of reduction rules R, in which all the occurrences of the variables x are replaced with the values t, and all the 54 A Minimal OO Calculus for Modelling Biological Systems Method type lookup CT (C) = class C extends D{M} m(C x) R ∈ M mtype(m,C) = C CT (C) = class C extends D{M} m is not defined in M mtype(m,C) = mtype(m, D) Method body lookup CT (C) = class C extends D{M} m(C x) R ∈ M mbody(m,C) = (x, R) CT (C) = class C extends D{M} m is not defined in M mbody(m,C) = mbody(m, D) Figure 3: Auxiliary Definitions Method Invocation v : C ∈ Γ mbody(m,C) = (x, R) v.m(t) → [x 7→ t, this 7→ v]R (e-meth) Figure 4: Evaluation occurrences of this are replaced with the value v. A method invocation is placed in the model instead of the reduction rules: once evaluated, the reduction rules of the method become the reduction rules of the model. Phosphoglucose isomerase is an enzyme that catalyses the conversion of glucose-6-phosphate into fructose 6-phosphate (and vice versa) in the second step of glycolysis. In order to model this behaviour, in Γ we associate to the value ph-iso (the phosphoglucose isomerase) the type Enzyme, and to the values glu-6-ph and fru-6-ph (the glucose-6-phosphate and fructose 6-phosphate, respectively) the type Molecule Γ = {ph-iso : Enzyme, glu-6-ph : Molecule, fru-6-ph : Molecule} Instead of the reduction rules, in the model we place the calling of the action method on the ph-iso enzyme, using the molecules as arguments ph-iso.action(glu-6-ph, fru-6-ph) Following the evaluation rule in Figure 4, this method invocation is replaced by the reduction rule glu-6-ph + ph-iso → ph-iso + fru-6-ph As a consequence, we obtain the reduction rule modelling the conversion of glucose-6-phosphate into fructose 6-phosphate. In order to obtain the conversion in the other side, we call the action method on L. Bioglio 55 the ph-iso enzyme swapping the arguments ph-iso.action(fru-6-ph, glu-6-ph) This method invocation is then replaced by the reduction rule fru-6-ph + ph-iso → ph-iso + glu-6-ph After method evaluation, we obtain the reduction rules of the model, representing the possible evolution of the system. 2.4 Typing Subtyping C <: C (t-sub1) C <: D D <: E C <: E CT (C) = class C extends D{M} C <: D (t-sub2) (t-sub3) Figure 5: Subtyping The rules for subtyping are formally defined in Figure 5. The subtype relation between classes is given by the class declarations in the class table CT . The subtype relation is reflexive and transitive. For Enzyme and Molecule classes we derive the following subtype relations: Enzyme <: Enzyme Molecule <: Molecule (by rule (t-sub1)) Enzyme <: Object Molecule <: Object (by rule (t-sub3)) Note that Enzyme is not a subtype of Molecule, then an enzyme cannot be a substrate nor a product of the Enzyme’s action method. The typing rules for method invocations and for method and class declarations are given in Figure 6. Typing statements for method invocations have the form v.m(t) OK, asserting that the method invocation v.m(t) is well formed. The typing rule checks that the types of the values used as arguments in a method invocation are subtypes of the types of the arguments required by the method. Typing statements for method declarations have the form M OK in C, and assert that the method declaration M is well formed in the class C. The typing rule checks that the reduction rules in the method of a class are well formed, according to the types of the arguments and the class. The relation ⊢ serves this purpose, by using the type assignments on its left in the type checking of the element on its right. Different formalisms have different constraints to check if a rule is well formed. For this reason, the modeller must add the proper typing rules to check the well-formedness of a rule, according to the types of the arguments and the class in which it is contained, in addition to the typing rules in Figure 6. Typing statements for class declarations have the form CL OK, stating that the class declaration CL is well formed. The typing rule checks that each method declaration in the class is well formed. As expected, both Enzyme and Molecule classes are OK. 56 A Minimal OO Calculus for Modelling Biological Systems Invocation typing v : C ∈ Γ mtype(m,C) = C t :D∈Γ D <: C v.m(t) OK in C (t-invmeth) Method typing x : C, this : C ⊢ R OK m(C x) R OK in C (t-clmeth) Class typing CT (C) = class C extends D{M} M OK in C class C extends D{M} OK (t-class) Figure 6: Typing Note that the inheritance is very simple: a class inherits all the methods of its superclass, and it can modify the body and the arguments of a method declared in its superclass, i.e. it can change the reduction rules and the arguments associated to a method name. In this way, lower classes can reuse the names of higher classes methods, i.e. more specialised biological entities can focus and specialise the behaviour of more generic biological entities by reusing the name associated to a generic reduction rule. For example, an hydrolase is an enzyme, but it cannot catalyse any reaction except hydrolysis. For this reason, we design hydrolase class as follows: class Hydrolase extends Enzyme { action(Molecule S, Molecule P1 , Molecule P2 ) S + H2 O + this → this + P1 + P2 } The Hydrolase class is an extension of the Enzyme class that overrides the action method. In this way, the generic catalysis described in the Enzyme’s action method is no more available in the Hydrolase class, but the override action method makes available the specific hydrolysis. In the same way, the glycoside hydrolase is an hydrolase, but its substrate and products are sugars. Then the glycoside hydrolase class is designed as an extension of Hydrolase class, that overrides the action method by modifying the types of the arguments, from molecules to sugars: class Sugar extends Molecule{} class GlycosideHydrolase extends Hydrolase { action(Sugar S, Sugar P1 , Sugar P2 ) S + H2 O + this → this + P1 + P2 } L. Bioglio 3 57 Example In this section we show how our calculus can be used to model biological behaviours. As an example, we design classes and method invocations to describe Michaelis-Menten enzyme kinetic, the two-substrates enzyme kinetic and the competitive inhibition kinetic. 3.1 Michaelis-Menten Model In the Michaelis-Menten Model, the enzyme reaction is divided in two stages. In the first stage, the substrate S binds reversibly to the enzyme E, forming the enzyme-substrate complex ES, then in the second one the enzyme catalyses the chemical step in the reaction and releases the product P: E + S ⇋ ES → E + P This basic behaviour is also used in most complex enzyme reactions. In order to model this behaviour, we create two classes, the Enzyme class and the EnzymeComplex class. The first one models an enzyme: it associates itself with a substrate and produces an enzyme-substrate complex. The second one models an enzyme-substrate complex: it dissociates itself in an enzyme and a product. class Enzyme extends Object class EnzymeComplex extends Enzyme { { ass(Molecule S, EnzymeComplex ES) dis(Enzyme E, Molecule P) S + this → ES this → E + P } } Since an enzyme-substrate complex can act as an enzyme, the EnzymeComplex class extends the Enzyme class. In this way, the EnzymeComplex class inherits from Enzyme the ass method by auxiliary definitions. The type environment is Γ = {E : Enzyme, ES : EnzymeComplex, S : Molecule, P : Molecule} The method invocations for reproducing the described behaviour are E.ass(S, ES) ES.dis(E, S) ES.dis(E, P) 3.2 Two-substrates Enzymes Some enzymes catalyse reaction between two substrates. This reaction is usually divided into three stages. In the first, the substrate S1 binds reversibly to the enzyme E, forming the enzyme-substrate complex ES1 , then in the second the substrate S2 binds reversibly to the enzyme-substrate complex ES1 , forming the enzyme-substrate complex ES1 S2 . Finally the enzyme complex ES1 S2 catalyses the chemical step in the reaction and releases the product P: E + S1 ⇋ ES1 + S2 ⇋ ES1 S2 → E + P Note that this is only one of all the possible interactions between an enzyme and two substrates. To model this behaviour, we assign the following types: Γ = {E : Enzyme, ES1 : EnzymeComplex, ES1 S2 : EnzymeComplex, S1 : Molecule, S2 : Molecule, P : Molecule} A Minimal OO Calculus for Modelling Biological Systems 58 The method invocations are the following: E.ass(S1 , ES1 ) ES1 .dis(E, S) ES1 .ass(S2 , ES1 S2 ) ES1 S2 .dis(E, P) ES1 S2 .dis(ES1 , S2 ) 3.3 Competitive Inhibition In Biology, enzyme reaction rates can be decreased by molecules called enzyme inhibitors. There exist a lot of inhibitors kinetics: among others, in Competitive Inhibition the inhibitor I binds to enzyme E producing the complex EI and stops a substrate S from entering the enzyme’s active site and producing the complex ES. The inhibitor and substrate compete for the enzyme (i.e. they cannot bind at the same time): E + S ⇋ ES → E + P E + I ⇋ EI This case is an extension of the Michaelis-Menten Model in Section 3.1, and is modelled by adding the following type environment and method invocations: Γ′ = {EI : EnzymeComplex, I : Molecule} E.ass(I, EI) EI.dis(E, I) 4 Use of Classes in Term-Rewriting Formalisms The calculus in this paper aims to be easily applicable to the most popular term-rewriting formalisms for modelling biological systems. To do so, we just act as follows: 1. set the syntax of reduction rules of the term-rewriting formalism as the syntax of reduction rules of the core calculus; 2. if the reduction rules must respect certain conditions handled by typing, then add the proper typing rules to check their well-formedness; 3. define the class table CT and assign types to values in the type environment Γ according to their biological behaviour; 4. create a triple (CT, Γ, P), where P is a model designed according to the formalism specifications, except for the reduction rules, that are replaced by method invocations. After the evaluation of the method invocations in P, we obtain the model P′ in the formalism form, in which all the reduction rules are consistent with the biological classification and behaviour defined in CT and Γ. We present an implementation of the calculus in two different term-rewriting formalisms: the Calculus of Looping Sequences (CLS) and the P systems. As case study, we present the Porins behaviour. Porins are proteins that cross a cellular membrane and act as a pore through which molecules can diffuse. The molecules which diffuse across the porin depends on the porin itself. Among the porins, aquaporins selectively conduct water molecules in and out of the cell, while preventing the passage of ions and other solutes. Some of them, known as aquaglyceroporins, transport also other small uncharged solutes, such as glycerol, CO2, ammonia and urea across the membrane (see [13]). We design the Porin class to model the porin behaviour, and we present an example of triple and its evaluation, in CLS and P systems formalisms. In particular, we model two kinds of aquaporins: one kind transports only water, the other one transports both urea and water. L. Bioglio 59 4.1 Calculus of Looping Sequences A CLS model [3] is composed by: • a set E of elements; • sets X , S V and T V of element, sequence and term variables, respectively; • a set R of reduction rules (called rewrite rules) in the form P → P, according to the pattern syntax in Figure 7; • a term T , i.e. a pattern without variables. P ::= SP SP ::= ε C ::=  (SP)L ⌋ P P|P X a SP · SP xe x C|T T |C (S)L ⌋C Figure 7: Syntax of Patterns, Sequence Patterns and Contexts in CLS A rewrite rule P1 → P2 states that a term P1 σ , obtained by instantiating variables in P1 by some instantiation function σ , a function that maps variables to terms preserving the kind of the variables, can be transformed into the term P2 σ . According to the context syntax in Figure 7, the term C[P1 σ ] evolve in the term C[P2 σ ] by rewrite rule P1 → P2 , where C[T ] denotes the term obtained by replacing the unique  with T in C. Since in CLS the reduction rules have the form P → P, the rule syntax of the classes becomes R ::= P → P. A model is a pair (T, R), where T is the term depicting the initial state of the system, and R is the set of rewrite rules. Using classes and methods, the set R becomes a set of method invocations, R = {I}, which must be evaluated in an initial phase of system initialisation, before the evaluation of the term, to obtain the rewrite rules of the model. A class modelling the porin behaviour with rewrite rules in CLS syntax is the following: class Porin extends Object { in(Molecule S) S | (this · xe)L ⌋ X → (this · xe)L ⌋ (S | X ) } out(Molecule S) (this · xe)L ⌋ (S | X ) → S | (this · xe)L ⌋ X We use the symbols w for water, u for urea, AW for the aquaporin that transports only water and AWU for the aquaporins that transports both water and urea. In our term, both kinds of aquaporins are included into a membrane: T = w | . . . | w | u | . . . | u | (AW )L ⌋ (ε ) | (AWU )L ⌋ (ε ) The type environment is the following: Γ = {AW : Porin, AWU : Porin, w : Molecule, u : Molecule} A Minimal OO Calculus for Modelling Biological Systems 60 and the class table CT contains the Porin and Molecule classes. The triple is (CT, Γ, P), where P is composed by the term T and the rule set containing the following method invocations: AW.in(w) AWU.out(w) AW.out(w) AWU.in(u) AWU.in(w) AWU.out(u) After the evaluation of the triple, the CLS model is composed by the term T and the rewrite rules w | (AW · xe)L ⌋ X → (AW · xe)L ⌋ (w | X ) w | (AWU · xe)L ⌋ X → (AWU · xe)L ⌋ (w | X ) u | (AWU · xe)L ⌋ X → (AWU · xe)L ⌋ (u | X ) (AW · xe)L ⌋ (w | X ) → w | (AW · xe)L ⌋ X (AWU · xe)L ⌋ (w | X ) → w | (AWU · xe)L ⌋ X (AWU · xe)L ⌋ (u | X ) → u | (AWU · xe)L ⌋ X 4.2 P systems A P-system [17] is a n-tuple Π = (V, µ , M1 , . . . , Mn , (R1 , ρ1 ), . . . , (Rn , ρn ), i0 ), where • V : alphabet; • µ : membrane structure of degree n, with the membrane and the regions labelled in a one-to-one manner with elements in a given set L; • Mi : multisets of symbols (or strings) in V , the symbols contained in the membrane i; • Ri : finite sets of reduction rules (called evolution rules) x → y contained in the membrane i and such that x ∈ V ∗ and y = y′ or y = y′ δ , where y′ ∈ (V × {here, out})∗ ∪ (V × {in j | j ∈ L})∗ ; • ρi : partial order relations over Ri ; • i0 : a label in L which specifies the output membrane. If empty, then the output region is the environment. Consider an evolution rule x → y in the set Ri : if the symbols in x appear in Mi , then these symbols are replaced by the symbols in y according to the rule. If a symbol a appears in y in a pair (a, here), then it will remain in Mi . If a symbol a appears in y in a pair (a, out), then it becomes a symbol of the membrane immediately outside the membrane i, according to the membrane structure µ . If a symbol a appears in y in a pair (a, in j ), and the membrane j is contained in the membrane i according to the membrane structure µ , then it becomes a symbol of the membrane j. If y = y′ δ , then the membrane i and the evolution rules in Ri disappear, and all the symbols in Mi are added to the symbols of the membrane immediately outside the membrane i. Evolution rules are applied following the priority in ρi , and in a non-deterministic way in case of same priority. In a single evolution step, all symbols in all membranes evolve in parallel, and every applicable evolution rule is applied as many times as possible. According to the definitions of evolution rules, the rule syntax becomes R ::= x → y Using classes and methods, each set Ri becomes a set of method invocations, Ri = Ii . In P systems we have two kinds of symbols which may be involved in an evolution rule: the biological entities (contained in V ) and the labels of membranes (contained in L). Since they are different entities, we must design a distinct class for everyone of them. As a solution, we construct the class BioObject for biological entities, and Label for labels, both extending Object. class BioObject extends Object{} class Label extends Object{} L. Bioglio 61 All the biological entities must extend BioObject or one of its subclasses. For example, the definition of the class Molecule is class Molecule extends BioObject{} A class modelling the porin behaviour with P-system evolution rules is the following: class Porin extends BioObject { in(Molecule S, Label J) S → S(inJ ) out(Molecule S) S → S(out) } In this case, the aquaporin that transports only water (w) is contained into the membrane labelled by 1, and the other one, that transports both urea (u) and water, is contained into the membrane labelled by 2. The type environment is the following: Γ = {A : Porin, w : Molecule, u : Molecule, 0 : Label, 1 : Label, 2 : Label} and the class table CT contains the Porin, Molecule and BioObject classes. The triple is (CT, Γ, Π), where Π is the following: Π = ({u, w, A}, [[]2 []3 ]1 , {u, . . . u, w, . . . , w}, 0, / 0, / (A.in(w, 1), A.in(w, 2), A.in(u, 2)), (A.out(w)), (A.out(w), A.out(u)), 1) After the evaluation of the method invocations, we obtain the P-system Π′ = ({u, w, A}, [[]2 []3 ]1 , {u, . . . u, w, . . . , w}, 0, / 0, / (w → w(in1 ), w → w(in2 ), u → u(in2 )), (w → w(out)), (w → w(out), u → u(out)), 1) 5 Conclusions and Future Developments Modularity is the key idea to manage the complexity of biological processes, because it allows molecules or compartments to be specified and then combined. It is usually combined with abstraction, that allows generic properties to be specified independently of specific instances: the result are parametrised modules. These are widely used in formalisms designed to model biological systems: for example, PLingua [11] is a programming language for membrane computing which aims to be a standard to define P systems. A P-Lingua program consists of a set of parametrised programming modules composed by a sequence of sentences in P-lingua: these sentences are the membrane structure of the model or the rules and objects contained into these membranes. Modules are executed by using calls, that assign some values to their parameters. Modules, in particular if parametrised, permit to define a structure and re-use it, but they have a limitation: they are applicable to every molecule, without limitations, while usually modules are designed only for some kinds of molecules. To manage this problem, some formalisms add a simple Type System to modularity and abstraction: this Type System just checks the correspondence between the types of the arguments and the types of the parameters in a module call operation. Biochemical Systems (LBS) [18] 62 A Minimal OO Calculus for Modelling Biological Systems combine rule-based approaches to modelling with modularity. Modules may be parametrised on compartments, rates, and species. Species are typed by the names of their component atomic species and of their modification site types: when a method is called, the Type System checks the correspondence between the types of the arguments and the types of the parameters. A simple Type System is also implemented in Little b [15], a high-level programming language for modular model building. In Little b a modeller can define monomers, composed by a name and a sequence of bond sites: these can connect each other by labelling their bond sites, creating complexes; reactions are pairs of patterns that specify the transformation of complexes matching the first pattern to the second one, and may create or delete links between sites. Sites can be labelled with tags, that specify the kind of link of the site and the kind of links it accepts: this tag-based system serves as Type System, and in particular as a type checker. All the above samples do not let to specify a hierarchy between the typed objects (species for LBS and sites for little b): a hierarchic structure permits more advanced tools and analyses. An example of use of hierarchy to manage the complexity of biological system is the extension of Kappa with agent hierarchies [8]. A Kappa model consists of a collection of rules and agents; each agent has an associated set of sites. Modellers can define variants on an agent by adding or replacing its sites: the variance relation create an agent hierarchy. A generic rule is then expanded into a set of concrete rules by replacing each agent in the rule with all appropriate agents below it in the hierarchy: so the hierarchy is used with the purpose to enable rapid development of large rule sets via the mechanism of generic rules. Moreover, the same hierarchic structure is used for a static analysis of the rule set: an analyser navigates the space of variants of a model looking if, with the current rule set, a specific concrete rule can or cannot take place under a sequence of conditions. Even if this procedure can never prove that a rule is correct, it can be used to reject rules that lead to behaviour incompatible with experimental results. Our calculus takes advantage of modularity, abstraction and hierarchy by constructing a parametrised module hierarchic structure for expressing reduction rules. Using classes instead of modules, our calculus can express the hierarchic structure of Biological ontologies, and also exploit the features of ObjectOriented programming, such as inheritance and subtyping. On the other side, the rules in a class are not visible from outside, then the resolution of the errors becomes more difficult. Finally, our calculus does not specify a meta-language, because it aims to be used with different term-rewriting formalisms: this lack of structure is the more evident difference with the other approaches, but it pays off in terms of expressiveness, because we cannot exploit the expressive power of a particular syntax. Summarizing, modularity allows behaviours to be specified and then combined; hierarchy allows typechecking and re-use of the behaviour; abstraction allows generic properties to be specified independently of specific instances. The modularity, hierarchy and abstraction of the classes enables libraries to be created for generic biological processes, which can be instantiated and re-used repeatedly in different contexts with different arguments. These libraries could be designed and refined by experts, and then made available to all modellers, thereby creating a scientific commons for model building. Moreover, they can be used in different models, ensuring that their reduction rules are consistent with the biological ontology defined in them. These libraries could also be adapted from a formalism to another, rewriting the reduction rules and with small alteration to the hierarchy, if needed. That modularity allows the Bioinformatics field to evolve in a decentralized manner, because any user can develop novel abstractions of the biology being studied in any formalism and contribute these back to the community, that can adapt these classes to any particular formalism. The calculus proposed in this paper implements only very basic features of object-oriented paradigm. In the opinion of the author, these features are the most common and useful in biological modelling, but L. Bioglio 63 increasing the complexity of the modelled systems the need of new features could emerge. For example, sometimes molecules may have different roles depending on the context: our calculus cannot deal with this behaviour, because every value is associated to exactly one type. For this reason, a possible development is surely the study and implementation of other basic and high-level constructs of imperative and object-oriented paradigms, such as data structures, multiple inheritance or parametric polymorphism (also known as generics). In our calculus, the modeller decide which reduction rules to include in a model, but in this way a raw modeller could forget some important rule. A possible evolution is to infer the reduction rules directly from the composition of the model, according to the association between classes and values defined in the type environment. For example, if the term of the model contains a porin, then the system may infer the proper reduction rules to include, in this case the ones modelling the passage of elements through membranes. Moreover, in this way the reduction rules in a model could become dynamic: they could evolve following the evolution of the model, in a correct (from a biological point of view) way, without any external intervention. For example, if, during the evolution of the model, a lactase is created in the term, then the type system may add the proper reduction rules, in this case the ones modelling hydrolysis. Acknowledgements. The author thanks the referees for their helpful comments. The final version of the paper improved due to their suggestions, in particular the Section 5. References [1] BIOCHAM. Available at http://contraintes.inria.fr/BIOCHAM/. [2] Rajeev Alur, Calin Belta, Vijay Kumar & Max Mintz (2001): Hybrid Modeling and Simulation of Biomolecular Networks. In: Hybrid Systems: Computation and Control, LNCS 2034, Springer, pp. 19–32, doi:10.1007/3-540-45351-2 6. [3] Roberto Barbuti, Andrea Maggiolo-Schettini, Paolo Milazzo & Angelo Troina (2006): A Calculus of Looping Sequences for Modelling Microbiological Systems. Fundamenta Informaticæ 72(1–3), pp. 21–35, doi:10.1.1.77.4707. [4] Sara Capecchi & Angelo Troina (2010): Types for BioAmbients. In: From Biology To Concurrency and back, EPTCS 19, pp. 103–115, doi:10.4204/EPTCS.19.7. [5] Luca Cardelli (2005): Brane Calculi. Interactions of Biological Membranes. In: Computational Methods in Systems Biology (CMSB’04), LNCS 3082, Springer, pp. 257–280, doi:10.1.1.105.8399. [6] Nathalie Chabrier-Rivier, Marc Chiaverini, Vincent Danos, Franois Fages & Vincent Schachter (2004): Modeling and Querying Biomolecular Interaction Networks. Theoretical Computer Science 325, pp. 25–44, doi:10.1016/j.tcs.2004.03.063. [7] Michele Curti, Pierpaolo Degano, Corrado Priami & Cosima Tatiana Baldari (2004): Modelling Biochemical Pathways through enhanced π -calculus. Theoretical Computer Science 325(1), pp. 111–140, doi:10.1016/j.tcs.2004.03.066. [8] Vincent Danos, Jérôme Feret, Walter Fontana, Russ Harmer & Jean Krivine (2009): Rule-Based Modelling and Model Perturbation. Transactions on Computational Systems Biology XI 11, pp. 116–137, doi:10.1007/978-3-642-04186-0 6. [9] Vincent Danos & Cosimo Laneve (2004): Formal Molecular Biology. Theoretical Computer Science 325, pp. 69–110, doi:10.1016/j.tcs.2004.03.065. 64 A Minimal OO Calculus for Modelling Biological Systems [10] Mariangiola Dezani-Ciancaglini, Paola Giannini & Angelo Troina (2009): A Type System for Required/Excluded Elements in CLS. In: Developments in Computational Models (DCM’09), EPTCS 9, pp. 38–48, doi:10.4204/EPTCS.9.5. [11] Daniel Dı́az-Pernil, Ignacio Pérez-Hurtado, Mario J. Pérez-Jiménez & Agustin Riscos-Núñez (2008): A PLingua Programming Environment for Membrane Computing. In: Workshop on Membrane Computing, pp. 187–203, doi:10.1007/978-3-540-95885-7 14. [12] François Fages & Sylvain Soliman (2008): Abstract interpretation and types for systems biology. Theoretical Computer Science 403(1), pp. 52–70, doi:10.1016/j.tcs.2008.04.024. [13] Jochen S. Hub & Bert L. de Groot (2008): Mechanism of selectivity in aquaporins and aquaglyceroporins. In: Proceedings of National Academy of Sciences of the USA, 105, pp. 1198–1203, doi:10.1073/pnas.0707662104. [14] Atsushi Igarashi, Benjamin C. Pierce & Philip Wadler (2001): Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and System 23, pp. 396–450, doi:10.1145/503502.503505. [15] Aneil Mallavarapu, Matthew Thomson, Benjamin Ullian & Jeremy Gunawardena: little b. Available at http://www.littleb.org. [16] Hiroshi Matsuno, Atsushi Doi, Masao Nagasaki & Satoru Miyano (2000): Hybrid Petri Net Representation of Gene Regulatory Networks. In: Pacific Symposium on Biocomputing (PSB’00), World Scientific Press, pp. 341–352. [17] Gheorghe Păun (2002): Membrane Computing. An Introduction. Springer. [18] Michael Pedersen & Gordon D. Plotkin (2010): A Language for Biochemical Systems: Design and Formal Specification. Transactions on Computational Systems Biology 12, pp. 77–145, doi:10.1007/978-3-642-11712-1. [19] Corrado Priami & Paola Quaglia (2005): Beta Binders for Biological Interactions. In: Computational Methods in Systems Biology (CMSB’04), LNCS 3082, pp. 20–33, doi:10.1007/978-3-540-25974-9 3. [20] Aviv Regev, Ekaterina M. Panina, William Silverman, Luca Cardelli & Ehud Shapiro (2004): BioAmbients: An Abstraction for Biological Compartments. Theoretical Computer Science 325, pp. 141–167, doi:10.1016/j.tcs.2004.03.061. [21] Aviv Regev, William Silverman & Ehud Shapiro (2001): Representation and Simulation of Biochemical Processes using the Pi-Calculus Process Algebra. In: Pacific Symposium on Biocomputing (PCB’01), 6, pp. 459–470.
5cs.CE
Technical Report: Timing Abstraction of Perturbed LTI systems with L2 -based Event-Triggering Mechanism arXiv:1609.03476v1 [cs.SY] 12 Sep 2016 Arman Sharifi Kolarijani, Manuel Mazo Jr. and Tamás Keviczky Abstract— In networked control systems, the advent of eventtriggering strategies in the sampling process has resulted in the usage reduction of network capacities, such as communication bandwidth. However, the aperiodic nature of sampling periods generated by event-triggering strategies has hindered the schedulability of such networks. In this study, we propose a framework to construct a timed safety automaton that captures the sampling behavior of perturbed LTI systems with an L2 based triggering mechanisms proposed in the Literature. In this framework, the state-space is partitioned into a finite number of convex polyhedral cones, each cone representing a discrete mode in the abstracted automaton. Adopting techniques from stability analysis of retarded systems accompanied with a polytopic embedding of time, LMI conditions to characterize the sampling interval associated with each region are derived. Then, using reachability analysis, the transitions in the abstracted automaton are derived. I. I NTRODUCTION Wireless networked controlled systems (WNCS’s) represent a class of spatially distributed control systems for which the feedback loops are closed via shared communication components possessing limited bandwidth. Several advantages of WNCSs, such as the ease of maintenance and the flexibility of implementation, make them attractive to industrial environments. Meanwhile, WNCS’s are burdened with characteristics, such as limited battery life and communication bandwidth. Under these circumstances, the resource over-utilization caused by (traditional) periodic implementations, the so-called time-driven control (TDC), makes such implementations less appealing for WNCS’s. To address the aforementioned issues, control researchers have proposed event-driven control (EDC) strategies that are aperiodic, such as event-triggered control (ETC) [1] and selftriggered control (STC) [2]. In EDC strategies, the core idea relies on the fact that the dynamics of the control system during the inter-sample interval determine the next sampling instant to attenuate the usage of resources, particularly the communication bandwidth. In these strategies, control task executions only happen when a pre-specified condition is violated. Such condition is called the triggering mechanism (TM). It is derived based on stability and/or performance of the closed-loop system. On the other hand, the schedulability of ETC strategies, due to their aperiodic nature, is more arduous compared to TDC strategies. In fact, in TDC strategies, the control and scheduler designs are naturally decoupled via the (pre-defined) fixed sampling period. This phenomenon is called the separation-of-concerns in the real-time systems community [3]. It is worth mentioning that ETC strategies The authors are with the Delft Center for Systems and Control, Delft University of Technology, The Netherlands. {a.sharifikolarijani,m.mazo,t.keviczky}@tudelft.nl are almost always equipped with a minimum inter-execution time (MIET) to prevent the occurrence of Zeno behavior in the sampling process. This quantity can be technically used in the synthesis of task scheduling. However, it is a conservative approximation of the lower bound on all the possible generated sampling periods. Thus, such synthesis does not make use of the beneficiary characteristics of ETC strategies in an efficient manner. To address this shortcoming, researchers have proposed another class of approaches, the so-called co-design approaches. In this class, the problem of controller and scheduler synthesis for real-time systems is tackled in a unified framework, see e.g. feedback modification to task attributes [4], [5], [6], [7], anytime controllers [8], [9], and event-based control and scheduling [10], [11]. Recently, alternative to the unified frameworks mentioned above, [12], [13] have proposed a decoupling framework to capture the sampling behavior of LTI systems with ISS-based TM’s using timed safety automata (TSA’s). Generally speaking, TSA is a simplified version of timed automaton (TA) [14], [15]. It is a powerful tool to model the timing behavior of real-time systems for scheduling purposes since its reachability analysis is decidable [16], [17]. In this study, following the same path as in [12], [13], we propose a framework to capture the sampling behavior of perturbed LTI systems with the L2 -based TM proposed by [18]. We show that the derived TSA ε-approximately simulates the sampling behavior of the L2 -based ETC system. It is evident that such characterizations can be analyzed independently for scheduling purposes, thus providing a scalable and versatile event-triggered WNCS design procedure. II. P RELIMINARIES n R denotes the n-dimensional Euclidean space, R+ denotes the positive reals. N0 is the set of nonnegative integers, and IR+ is the set of all closed intervals [a, b] such that a, b ∈ R+ and a ≤ b. For any set S, 2S denotes the set of all subsets of S, i.e. the power set of S. Sm×n and Sn are the set of all m × n real-valued matrices and the set of all n × n real-valued symmetric matrices, respectively. For a matrix M , M  0 (or M  0) means M is a negative (or positive) semidefinite matrix and M ≺ 0 (M ≻ 0) indicates M is a negative (positive) definite matrix. Sn+ is the cone of all n × n symmetric positive definite matrices. ⌊x⌋ indicates the largest integer not greater than x ∈ R. |y| and kM k denote the Euclidean norm of a vector y ∈ Rn and the Frobenius norm of a matrix M ∈ Sm×n , respectively. For a matrix M ∈ Sn , λ(M ) and λmax (M ) denote the set of eigenvalues and the largest eigenvalue of M . Consider two sets X, Y ⊆ Rn , their Minkowski sum is given by X ⊕Y := {x+y|x ∈ X and y ∈ Y }. We state the following known results that will be used in Subsection II-A. Lemma 1: ([19]) For any real matrices E, G and real symmetric positive definite matrix P , with compatible dimensions, less than γ [18]. Then, the state-dependent TM, proposed by [18], is given by: EG + GT E T  EP E T + GT P −1 G. Lemma2: ([20])  For all A ∈ Sn×n , if µ(A) = max{µ ∈ AT +A }, then, |eAt | ≤ eµ(A)t . R| µ ∈ λ 2 Proposition 1: (Jensen Inequality [19]) For any matrix + M ∈ Sm with constant entries, scalar γ > 0, vector function ω : [0, γ] → Rm such that the integrations concerned are well defined, then: T Z γ Z γ Z γ T ω(β)dβ. ω(β)dβ M ω (β)M ω(β)dβ ≥ γ where A. L2 -Based ETC System: In this subsection, an overview of the ETC strategy proposed by [18] along with a new result (see Theorem 1) are presented. Consider a sampled-data system that is given by: ˙ = Aξ(t) + Bν(t) + Eω(t), ∀t ∈ [0, τ (x)), ξ(t) ξ(0) = x, ν(t) = −Kx. (2) Furthermore, assume that the disturbance ω is a vanishing type disturbance [18], i.e., 2 ∃W ≥ 0 such that |w(t)| ≤ W |x| , ∀t ∈ [0, τ (x)). (3) Denote by ǫ, the error signal endured by the system (1)(2), ǫ(t) = x − ξx (t) where ξx (t) is the solution of (1). Reformulating (1), the evolution of state and error signals can be rewritten in a compact form as follows: ξx (t) = Λ(t)x + Ω(t) (4) ǫ(t) = (I − Λ(t)) x − Ω(t) (5) and where ( M = (1 − β 2 )I + P BB T P, N = 12 (1 − β 2 )I + P BB T P, (10) and β > 0 is a user-defined scalar related to the TM (9). Theorem 1: Consider the system (1)-(2) with the triggering mechanism (9). Assume there exist a scalar µ and a symmetric matrix Ψ such that µ ≥ 0, Rt Λ(t) = I + 0 eAs ds(A − BK), Rt Ω(t) = 0 eA(t−s) Eω(s)ds. (6) Assume that there exists a quadratic Lyapunov function V (ξ) = ξ T P ξ such that P is the solution to the Algebraic Riccati Equation (ARE) given by: P A + AT P − Q + R = 0 (7) where Φ(t) = Q = P BB P, 1 R = 2 P EE T P, γ γ > 0. (8) The existence of V guarantees that the system (1) with the full-state feedback ν(t) = −Kξ(t) = −B T P ξ(t) is finitegain L2 stable from ω to (xT , uT ) with an induced gain M + Ψ  µI,  Φ1 (t) Φ3 (t) Φ2 (t) Φ4 (t) (11) (12)  , (13) Φ1 (t) = (Λ(t) − I)T M (Λ(t) − I) +tW µλmax (E T E)dA (t)I − N, Φ2 (t) = ΦT3 (t) = (Λ(t) − I)T M T , Φ4 (t) = −Ψ, are satisfied. Then, the sampling period τ (x) generated by (9) is lower bounded by: τ ′ (x) := inf{t > 0| Φ(t)  0}. (14) Proof: Substitute (5) into (9). Then, the TM (9) can be rewritten by: τ (x) = min{t > 0| Fω (x, t) ≥ 0}, ∀x ∈ Rn , (15) where Fω (x, t) = xT [(Λ(t) − I)T M (Λ(t) − I) − N ]x +xT (Λ(t) − I)T M Ω(t) + ΩT (t)M (Λ(t) − I)x +ΩT (t)M Ω(t). (16) T Let λA max denote λmax (A + A ) for the sake of compactness. Using Lemma 1 the terms that are dependent on both x and Ω(t) in Fω (x, t) can be decoupled into: xT (Λ(t) − I)T M Ω(t) + ΩT (t)M (Λ(t) − I)x ≤ ΩT (t)ΨΩ(t) + xT (Λ(t) − I)T M Ψ−1 M (Λ(t) − I)x, (17) where Ψ = ΨT ≻ 0. Then, it follows that: ΩT (t)(M + Ψ)Ω(t) Rt Rt ≤ µ( 0 eA(t−s) Eω(s)ds)T ( 0 eA(t−s) Eω(s)ds) (assuming M + Ψ  µI and µ ≥ 0) Rt A ≤ tµ 0 e(t−s)λmax ω T (s)E T Eω(s)ds (using Jensen’s inequality and Lemma 2) Rt A ≤ tW µλmax (E T E)( 0 eλmax (t−s) ds)|x|2 (using (3)) = tW µλmax (E T E)dA (t)xT x, where where T Ψ ≻ 0, Φ(t)  0, (1) where ξ(t) ∈ Rn , ν(t) ∈ Rm , ω(t) ∈ Rp , τ (x) denotes the sampling period associated with ξ(0), and A, B, and E have compatible dimensions. The control law is implemented in a sample-and-hold manner as follows: 2 (9) 0 0 0 τ (x) := inf{t > 0| ǫT (t)M ǫ(t) ≥ xT N x} dA (t) = ( A 1 (eλmax t λA max t, λA max = 0. − 1), λA max 6= 0 (18) (19) Based on the aforementioned procedure, one concludes that: Fω (x, t) ≤ xT Θ(t)x (20) where Θ(t) = (Λ(t) − I)T (M + M Ψ−1 M )(Λ(t) − I) +tW µλmax (E T E)dA (t)I − N. (21) Then, we employ the Schur complement in order to transform (21) into (13). Note that (21) is not linear in Ψ while (13) is linearly dependent on Ψ. Considering (20), since Φ(t)  0 implies xT Θ(t)x ≥ 0 by the Schur complement, it follows that τ (x) ≥ τ ′ (x). This concludes the proof. Thus, Theorem 1 enables us to avoid the unknown behavior of perturbation ω(t) in analyzing the sampling begavior of (9). However, it is still intractable to use (14) for the analysis since it has to be checked for an infinite number of instants t and it clearly lacks any insight on how the state x at the sampling instant affects the sampling period τ (x). B. Systems and Relations In what follows, we review some notions from the field of system theory to formally characterize the outcome of the proposed framework. Let Z be a set and Q ⊆ Z × Z be an equivalence relation on Z. Then, [z] denotes the equivalence class of z ∈ Z and Z/Q denotes the set of all equivalence classes. A metric (or a distance function) d : Z × Z → R ∪ {+∞} on Z satisfies, ∀x, y, z ∈ Z: i) d(x, y) = d(y, x), ii) d(x, y) = 0 ↔ x = y, and ii) d(x, y) ≤ d(x, z) + d(y, z). The ordered pair (Z, d) is said to be a metric space. Definition 1: (Hausdorff Distance [21]) Assume X and Y are two non-empty subsets of a metric space (Z, d). The Hausdorff distance dH (X, Y ) is given by: max{ sup inf d(x, y), sup inf d(x, y)}. x∈X y∈Y y∈Y x∈X + It follows that the ordered pair (IR , dH ) is a metric space. Now, we introduce some concepts from system theory and particularly a modified notion of quotient system adopted from [12] (see e.g. [22] for the traditional definition). Definition 2 (System [22]): A system is a sextuple ✲ , Y, H) consisting of: (X, X0 , U, • a set of states X; • a set of initial states X0 ⊆ X; • a set of inputs U ; ✲ ⊆ X × U × X; • a transition relation • a set of outputs Y ; • an output map H : X → Y . When the set of outputs Y of a system is endowed with a metric, it is called a metric system. An autonomous system is a system for which the cardinality of its input set is at most one. Definition 3 (Approximate Simulation Relation [22]): Consider two metric systems Sa = ✲ , Ya , Ha ) and Sb = (Xa , Xa0 , Ua , a ✲ , Yb , Hb ) with Ya = Yb , and let (Xb , Xb0 , Ub , b + ε ∈ R+ 0 , where R0 represents the set of nonnegative real numbers. A relation R ⊆ Xa × Xb is an ε-approximate simulation relation from Sa to Sb if the following three conditions are satisfied: 1) ∀xa0 ∈ Xa0 , ∃xb0 ∈ Xb0 such that (xa0 , xb0 ) ∈ R; 2) ∀(xa , xb ) ∈ R, we have d(Ha (xa ), Hb (xb )) ≤ ε; ✲ in Sa 3) ∀(xa , xb ) ∈ R, (xa , ua , x′a ) ∈ a ✲ in Sb satisfying (x′a , x′ ) ∈ R. ∃(xb , ub , x′b ) ∈ b b We say that Sb ε-approximately simulates Sa , denoted by Sa εS Sb , if there exists an ε-approximate simulation relation R from Sa to Sb . Definition 4 (Power Quotient System [12]): Let S = ✲ , Y, H) be an autonomous system and (X, X0 , ∅, R be an equivalence relation on X. The power quotient of S by R, denoted by S/R , is the autonomous system ✲ , Y/R , H/R ) consisting of: (X/R , X/R,0 , ∅, /R • • • • • X/R = X/R; X/R,0 = {x/R ∈ X/R |x/R ∩ X0 6= ∅}; ✲ if ∃(x, u, x′ ) ∈ (x/R , u, x′/R ) ∈ /R ′ ′ x ∈ x/R and x ∈ x/R ; Y/R ⊂ 2Y ; H/R (x/R ) = ∪ H(x). ✲ with x∈x/R Lemma 3 ([12]): Let S be an autonomous metric system, R be an equivalence relation on X, and let the autonomous metric system S/R be the power quotient system of S by R. For any ε ≥ max d(H(x), H/R (x/R )), x∈x/R x/R ∈X/R with d the Hausdorff distance over the set 2Y , S/R εapproximately simulates S, i.e. S εS S/R . Now, we appropriately modify Definition 4 and Lemma 3 for the case that one can construct an over approximation of the power quotient system, namely S̄/R . Definition 5: (Approximate Power Quotient System [13]) ✲ , Y, H) be a system, Let S = (X, X0 , U, R be an equivalence relation on X, and S/R = ✲ , Y/R , H/R ) be the power (X/R , X/R,0 , U/R , /R quotient of S by R. An approximate power quotient of S by R, denoted by S̄/R , is a system ✲ , Ȳ/R , H̄/R ) such that, →⊇→, (X/R , X/R,0 , U/R , ¯ /R ¯ /R /R Ȳ/R ⊇ Y/R , and H̄/R (x/R ) ⊇ H/R (x/R ), ∀x/R ∈ X/R . Corollary 1 ([13]): Let S be a metric system, R be an equivalence relation on X, and let the metric system S̄/R be the approximate power quotient system of S by R. For any ε≥ max d(H(x), H̄/R (x/R )), x∈x/R x/R ∈X/R with d the Hausdorff distance over the set 2Y , S̄/R εapproximately simulates S, i.e. S εS S̄/R . C. Timed Safety Automaton In what follows, we present a formal definition for TSA. A TSA [23] is a directed graph extended with real-valued variables (called clocks) that model the logical clocks. We define C as a set of finitely many clocks. Clock constraints are used to restrict the behavior of the automaton. A clock constraint is a conjunctive formula of atomic constraints of the form x ⊲⊳ n or x − y ⊲⊳ n for x, y ∈ C, ⊲⊳∈ {≤, <, = , >, ≥} and n ∈ N. We use B(C) to denote the set of clock constraints. Definition 6: (Timed Safety Automaton [15]) A timed safety automaton TSA is a sextuple (L, ℓ0 , Act, C, E, Inv) where: • L is a set of finitely many locations (or vertices); ℓ0 ∈ L is the initial location; • Act is the set of actions; • C is a set of finitely many real-valued clocks; C • E ⊆ L × B(C) × Act × 2 × L is the set of edges; • Inv : L → B(C) assigns invariants to locations. The location invariants are restricted to constraints of the form: c ≤ n or c < n where c is a clock and n is a natural number. • D. Problem Statement ✲ , Y, H): Consider the system S = (X, X0 , ∅, n • X = R ; n • X0 = R ; ′ ✲ iff ξx (τ (x)) = x′ given by (1)-(2), and • (x, x ) ∈ (9); + • Y ⊂R ; n + • H : R → R where H(x) = τ (x). The output of the above system generates all possible sequences of inter-sample intervals of the concrete system (1)(2) with the TM (9). Problem 1: Provide a construction of power quotient systems S/P of systems S as defined above. Based on Definition 4, we propose to construct the system ✲ , Y/P , H/P ) where S/P = (X/P , X/P,0 , ∅, /P • • • X/P = Rn/P := {R1 , . . . , Rq }; X/P,0 = Rn/P ; ✲ if ∃x ∈ x/P , ∃x′ ∈ x′ such that (x/P , x′/P ) ∈ /P /P • ξx (H(x)) = x′ as determined by (1)-(2); Y/P ⊂ 2Y ⊂ IR+ , where IR+ represents the set of closed intervals [a, b] such that 0 < a ≤ b; • H/P (x/P ) = [ min H(x), max H(x)] := [τx/P , τ̄x/P ]. x∈x/P x∈x/P ¯ The equivalence relation P on Rn partitions the state space of S (i.e. the ETC system) into the set X/P with a finite cardinality. However, since the exact construction of S/P is in general impossible, we construct instead S̄/P (see Definition 5). Later on, it will be shown that the constructed S̄/P is equivalent to a TSA. III. A BSTRACTIONS OF EVENT- TRIGGERED LTI SYSTEMS In this section, we introduce the framework to solve Problem 1 in the following order: 1) a proper definition of an equivalence relation P on Rn , 2) a tractable approach to compute the output map H̄/P and its corresponding output set Ȳ/P , and 3) a reachability-based analysis to derive the discrete transitions among abstract states x/P . A. State set The type of state set construction approach mainly relies on an intuitive observation from (20). Remark 1: Consider that the right-hand side of (20) is used to analyze the sampling behavior of (15) instead of Fω (x, t). Then, the sampling periods of all states, located on a line that passes through the origin excluding the origin itself, are lower bounded by the same sampling period, i.e. τ ′ (x) = τ ′ (λx), ∀λ 6= 0. It follows that a proper approach to abstract the state space is via partitioning it into a finite number of convex polyhedral cones (pointed at the origin) Rs where s ∈ Sq {1, . . . , q} and s=1 Rs = Rn . This state space abstraction technique is proposed by [24], dividing each of the angular spherical coordinates of x ∈ Rn : θ1 , . . . , θn−2 ∈ [0, π], θn−1 ∈ [−π, π] into m̄ (not necessarily equidistant) intervals resulting in q = m̄(n−1) conic regions. Furthermore, since the term xT Θ(t)x is quadratic in x, it is sufficient to only analyze half of the state space (e.g. by taking θn−1 ∈ [0, π]). Thus, the equivalence relation P to construct the abstraction is given by: (x, x′ ) ∈ P ⇔ ∃ s ∈ {1, . . . , q} s.t. x, x′ ∈ Rs , where q is the number of equivalence classes. Hence, the equivalence classes of P are defined by polyhedral cones pointed at the origin given by Rs = {x ∈ R2 | xT Qs x ≥ 0}, Qs ∈ S2 whenever n = 2 or Rs = {x ∈ Rn | Es x ≥ 0}, Es ∈ Sn×p otherwise. B. Output Map In this subsection, we present how to construct H̄/P and Ȳ/P . For all x ∈ Rs , the output Ȳ/P = H̄/P (x) is equal to the time interval [τs , τ̄s ] indicating τ (x) ∈ [τs , τ̄s ]. We ¯ make use of the polytopic embedding technique¯ proposed by [25]. In the space of real matrices, a sequence of convex polytopes is constructed around the matrix Φ(t). Doing so replaces the evaluation of (14) at infinitely many instants t by the evaluation of Φκ,s at finitely many vertices in the sequence of polytopes generated by Φκ,s . Assume a scalar σ > 0 denoting a time instant for which the TM (9) is enabled in the whole state space, i.e. Φ(t)  0. Consider Nconv + 1 is the number of vertices employed to define the polytope containing Φ(t) in a given time interval, and l ≥ 1 denotes the number of time subdivisions considered in the time interval [0, σ]. Lemma 4: Let s ∈ {1, . . . , q}. Consider a time instant τs ∈ (0, σ], a scalar µ and a symmetric matrix Ψ satisfying ¯(11). If Φ  0 holds ∀(i, j) ∈ Ks = ({0, . . . , Nconv } × ¯τ(i,j),s l {0, . . . , ⌊ ¯σs ⌋}), then, it follows that Φ(t)  0, ∀t ∈ [0, τs ] ¯ with Φ defined in (13) and ˜ Φ(i,j),s = Φ + ηI ¯ ¯ (i,j),s τ l σ k ˆ Σik=0 Φ , j < ⌊ ¯σs ⌋ (i,j),s ( l ) ˜ Φ ¯ τ l (i,j),s = σ ˆ ¯ Σik=0 Φ (τs − j l )k , j = ⌊ ¯σs ⌋, ¯ (i,j),s ¯ (22)   T T Π̌ M L 0,j j ˆ , Φ = ¯ M −Ψ ¯ (0,j),s # " Π̌j k−1 T (23) ) T T (A M Π̂ L k,j j ˆ k! , Φ = ¯ k−1 ¯ (k≥1,j),s 0 M Ak! Π̂j ( and L0,j = Π̌Tj M Π̌j − N + L̃0,j ¯ (24) with L̃0,j  A σ (E T E)  W µ λmax (j σl )(eλmax j l − 1)I  λA  max  for λA max 6= 0, = λmax (E T E)  W µ λA (j σl )2 I   max  for λA max = 0, L1,j = Π̌Tj M Π̂j + Π̂Tj M Π̌j + L̃1,j ¯ (25) (26) ¯ Φ̃ (i,j),s = with L̃1,j =  A σ λmax (E T E)  [(j σl )eλmax j l λA  W µ λA max max A σ +eλmax j l − 1]I for λA max 6= 0,   W µ(2j σl )λmax (E T E)I for λA max = 0, (27) AT A M Π̌j + Π̂Tj M Π̂j + L̃2,j (28) L2,j = Π̌Tj M Π̂j + Π̂Tj ¯ 2! 2! with L̃2,j  A σ (λA )2 (E T E)  [(j σl )eλmax j l max W µ λmax  2! λA  max  A σ +eλmax j l λA = max ]I   for λA max 6= 0,   W µλmax (E T E)I for λA max = 0, Lk≥3,j ¯ k−1 T k−1 = Π̌Tj M Ak! Π̂j + Π̂Tj (A k! i−1 T ) k−1 (A +Π̂Tj (Σi=1 i! M ) k−i−1 A (k−i)! M Π̌j )Π̂j + L̃k,j (29) (30) with L̃k≥3,j η≥  A σ (E T E)  [(j σl )eλmax j l W µ λmax  λA  max  A σ (λA )k−1 +eλmax j l max ]I = (k−1)!  A  for λ = 6 0,  max  0 for λA max = 0, max k (λA max ) k! (31)   σ ′ k ˆ , λmax Φ(t′ + r ) − ΣN k=0 Φk,r (t ) l ¯ (32) ],r∈{0,...,l−1} t′ ∈[0, σ l and Nconv ˆ ′ ′ k ˜ (33) Φ (Nconv ,j) (t ) = Σk=0 Φk,j (t ) . ¯ ¯ Proof: See Appendix. Then, using the S-procedure, the following theorem provides an approach to regionally reduce the conservatism involved in the τs estimates obtained from Lemma 4. ¯ Theorem 2 (Regional Lower Bound Approximation): Consider a scalar τs ∈ (0, σ], a scalar µ and a symmetric matrix Ψ satisfying¯(11), and matrices Φκ,s , κ = (i, j) ∈ Ks , defined as in Lemma 4. If there exist ¯scalars ακ,s ≥ 0 (for ¯ n = 2) or symmetric matrices Uκ,s with nonnegative entries ¯ (for n ≥ 3) such that for all κ ∈ Ks the following LMIs hold:    α(i,j),s Qs 0   0 if n = 2,  Φ(i,j),s + ¯ 0 ¯   0T Es U(i,j),s Es 0    0 if n ≥ 3,  Φ(i,j),s + 0 ¯ 0 ¯ (34) then, the inter-sample time (9) of the system (1)-(2) is regionally bounded from below by τs , ∀x ∈ Rs . ¯ Proof: See Appendix. One can follow a similar approach to find the upper bounds τ̄s on the inter-sample times that is outlined in Lemma 5 and Theorem 3. Lemma 5: Let s ∈ {1, . . . , q}. Consider a time instant τ̄s ∈ [τs , σ], a scalar µ and a matrix Ψ satisfying the LMI ¯ conditions given in Lemma 4. If Φ̄(i,j),s  0 holds ∀(i, j) ∈ Ks = ({0, . . . , Nconv } × {⌊ τ̄σs l ⌋, . . . , l − 1}), then, it follows that Φ(t)  0, ∀t ∈ [τ̄s , σ] with Φ defined in (13) and Φ̄(i,j),s ¯ = −Φ̃ (i,j),s − ηI, ( P i − τ̄s )k Lk,j ( (j+1)σ l Pk=0 i σ k k=0 Lk,j ( l ) if j = ⌊ τ̄σs l ⌋, if j > ⌊ τ̄σs l ⌋, where Lk,j are given by (24)-(31) and η is defined in (32). Proof: See Appendix. Theorem 3 (Regional Upper Bound Approximation): Consider a scalar τ̄s ∈ [τs , σ], a scalar µ and a symmetric matrix Ψ satisfying (11), ¯and matrices Φ̄κ,s , κ = (i, j) ∈ Ks , defined as in Lemma 5. If there exist scalars ᾱκ,s ≥ 0 (for n = 2) or symmetric matrices Ūκ,s with nonnegative entries (for n ≥ 3) such that for all κ ∈ Ks the following LMIs hold:    ᾱ(i,j),s Qs 0   0 if n = 2,  Φ̄(i,j),s − 0   0T Es Ū(i,j),s Es 0    0 if n ≥ 3,  Φ̄(i,j),s − 0 0 (35) then, the inter-sample time (9) of the system (1)-(2) is regionally bounded from above by τ̄s , ∀x ∈ Rs . Proof: Analogous to the proof of Theorem 2. C. Transition Relations In order to find all the transitions in S̄/P , it is required to compute the reachable set of each Rs over the time interval [τs , τ̄s ]. In the sequel, we present how one is able to compute ¯ approximations of the reachable set of each cone by over the Minkowski sum of two sets. The evolution of states over this time interval is given by ξx (τ ) = Λ(τ )x + Ω(τ ). Denote by X[τs ,τ̄s ] (X0,s ) the reachable set of X0,s during the time ¯ interval [τs , τ̄s ], that is given by: ¯ {x′ ∈ Rn | ∃x ∈ X0,s , ∃τ ∈ [τs , τ̄s ], x′ = ξx (τ )}. ¯ Furthermore, define X[1τs ,τ̄s ] (X0,s ) :=¯ {x′ ∈ Rn | ∃x ∈ X0,s , ∃τ ∈ [τs , τ̄s ], x′ = Λ(τ )x}, ¯ X[2τs ,τ̄s ] (X0,s ) ¯ ′ n := {x ∈ R | ∃x ∈ X0,s , ∃τ ∈ [τs , τ̄s ], x′ = Ω(τ )}. ¯ It follows that: L X[τs ,τ̄s ] (X0,s ) := X[1τs ,τ̄s ] (X0,s ) X[2τs ,τ̄s ] (X0,s ). ¯ ¯ ¯ In [12, Section III.B.3], it has been shown that it is enough to consider subsets X0,s ⊂ Rs being convex polytopes with each vertex placed on each of the extreme rays of Rs (excluding the origin) to compute X[1τs ,τ̄s ] (X0,s ). Then, ¯ one can effectively compute an over approximation of the reachable set of a polytope under linear time invariants, denoted by X̂[τs ,τ̄s ] (X0,s ), see e.g. [26]. Furthermore, one ¯ has: Rτ kΩ(τ )k = kR 0 eA(τ −s) Eω(s)dsk τ ≤ R0 keA(τ −s) Eω(s)kds τ ≤ 0 keA(τR −s) kkEk|ω(s)|ds τ W |x|kEk 0 |eµ(A)(τ −s) |ds = ρ(τ )|x| Rτ where ρ(τ ) = W kEk 0 |eµ(A)(τ −s) |ds. Thus, it follows that X[2τs ,τ̄s ] (X0,s ) can be over approximated by a second order ¯ cone given by: X̂[2τs ,τ̄s ] (X0,s ) :=¯ {x′ ∈ Rn | ∃x ∈ X0,s , ∃τ ∈ [τs , τ̄s ], |x′ | ≤ ρ(τ̄s )|x|}. ¯ Rt ∩ X̂[τs ,τ̄s ] (X0,s ) 6= ∅, ¯ (36) 6.7 τ s (upper bound) To compute the transitions in S̄/P , it thus suffices to derive the intersection between the over approximation X̂[τs ,τ̄s ] (X0,s ) and all the conic regions Rt where t ∈ {1,¯ . . . , q}. To compute transitions, it is required to check whether the following convex feasibility problem for each conic region Rt holds: which can be solved by existing convex analysis tools. There exists a transition from abstract state Rs to Rt in S̄/P in the case that (36) is satisfied. 6.6 6.55 6.5 6.45 2 4 6 8 10 12 s (region) 14 16 18 20 2 4 6 8 10 12 s (region) 14 16 18 20 0.3 0.25 τ s (lower bound) D. Timed Safety Automata Representation In this subsection, first, we point out the connection between an abstract state x/P ∈ X/P and its corresponding output y/P ∈ Ȳ/P [12]. The system S̄/P : 1) remains at x/P during the time interval [0, τx/P ), 2) possibly leaves x/P during the time¯ interval [τx/P , τ̄x/P ), and 3) is¯ forced to leave x/P at the time instant τ̄x/P . Thus, the semantics of S̄/P is equivalent to a timed safety automaton given by TSA = (L, ℓ0 , Act, C, E, Inv) where: • L = X/P ¯ ; • ℓ0 := Rs such that ξ(0) ∈ Rs ; • Act = {∗} is an arbitrary symbol; • C = {c}; • E is given by all tuples (Rs , g, a, r, Rt ) such that ✲ , g = {c| c ∈ [τs , τ̄s ]}, a = ∗, (Rs , Rt ) ∈ ¯ /P ¯ and r is given by c := 0; • Inv(Rs ) := {c|c ∈ [0, τ̄s ]}, ∀s ∈ {1, . . . , q}. Finally, in this section, we state the following fact. Although the construction technique presented in this section is offline, it is exponentially dependent on n − 1 (where n is the number of states) and hence it is computationally expensive for higher-order systems. 6.65 0.2 0.15 0.1 0.05 Fig. 1. (Top plot) Upper bounds on regional inter-sample times. (Bottom plot) Lower bounds on regional inter-sample times. found in [13], the derived ε is large. However, one must take into account the possible stabilizing effect of disturbance on the dynamics in (1) can enlarge the derived τ̄s and a more thorough study is due in this regard. In Figure 1, the derived lower and upper bounds are depicted. It is evident that the derived τs compared to the MIET are less conservative and ¯ can be effectively used for scheduling. Figure 2 represents the conic regions s and the associated τs and τ̄s (note that in order to show the lower bounds in ¯a clear manner the lower and upper bounds are depicted, separately). IV. N UMERICAL E XAMPLE with the perturbation bound W = 0.001. We set the scalars, associated with L2 -based TM’s, γ = 100, β = 0.25, see (7)-(8) and (9)-(10). Then, solving the ARE associated with the L2 stability, the control update law (implemented in a sample-and-hold fashion) is computed, that is, ∀t ∈ [tk , tk+1 ): 19 0.2 20 1 2 18 0.4 3 17 4 16 x2 We illustrate the theoretical results of this paper in a numerical example. Consider an LTI sytem, used as an example in [1], and add a perturbation term ω(t) as follows:       ˙ξ(t) = 0 1 ξ(t) + 0 ν(t) + 0 ω(t) (37) 1 1 −2 3 5 0 15 -0.2 -0.4 -0.6 6 14 7 13 8 12 -0.5 11 10 0 x1 9 0.5 Fig. 2. The radial distance from the origin of each asterisk indicates the regional lower bound of the indexed cone. Furthermore, in the case of circles, the distance indicates the regional upper bound of the indexed cone minus 6.2 sec, i.e. τ̄s − 6.2 sec (for the sake of clarity of the figure). ν(t) = −Kξ(tk ) = −[0.2361 6.2367]ξ(tk ), where tk denotes the sampling instants and k ∈ N0 . Now, we set the order of polynomial approximation Nconv = 7, the number of polytopic subdivisions l = 800, the upper bound of the inter-sample intervals σ = 8, the number of angular sub-divisions m̄ = 10, thus, q = 2 × 10(2−1) = 20. Then, applying the results from Section III-B, we get the precision abstraction of ε = 6.100. Compared to the results Moreover, Figure 3 represents the simulation of the control system for a simulation time of 15 sec. It is clear that the bounds derived by the analysis given in Section III-B have been respected by the sampling periods generated by the control system. Figure 4 depicts the result of applying the procedure introduced in Section III-C. inter-sample intervals 2 1.5 1 0.5 0 5 10 15 20 25 30 number of sampling instant 35 40 Fig. 3. Schematic representation of validation of lower bounds during the simulation period, the solid line (dashed line) represents the lower bounds on inter-sample intervals (generated inter-sample intervals during simulation). 20 region index 15 10 5 2 4 6 8 10 12 region index 14 16 18 20 Fig. 4. Schematic representation of set of edges in the timed automaton generated by (37)-(IV). A circle at the coordinate (i, j) denotes an edge from location i to location j. V. C ONCLUSIONS AND F UTURE W ORK We have presented an approach to capture the sampling behavior of perturbed LTI systems with L2 -based triggering mechanisms by timed safety automata. It has been shown that the derived timed automaton ε-approximately simulates the ETC system. The main contribution of this study falls into the subject of synthezing scheduling policies for ETC feedback loops using timed automata. Because of the inherent robustness of ETC strategies to perturbations, they are more appealing in practical applications compared to STC strategies. However, most of the existing ETC strategies are equipped with the quantity of minimum inter-sample time that indicates the maximum utilization of communication bandwidth. Despite the fact that such quantity can practically be used in scheduling of ETC feedback loops, it does not enable the full exploitation of the beneficiary features of ETC strategies in scheduling feedback policies. In fact, using solely such quantity in scheduling policies results in TDClike techniques. Furthermore, in most of decentralized ETC strategies in the literature, the existence of a minimum intersample time among different subsystems is absent, see e.g. [27]. Exploiting the already existing tools for the synthesis of timed automata, one can further extend the results of this study to synthesize conflict-free policies in WNCS’s, see e.g. [12] which proposed a centralized scheduling of feedback policies. Another promising direction to follow is to find a fully decentralized approach instead of the centralized approach proposed in [12]. Moreover, a modification that can be made to the analysis given in this study is related to the regional upper bounds derived in Section III-D. It has been observed that these bounds are relatively large since perturbations can have a stabilizing effect on the error dynamics and as a result cause the enlargement of intersample times. Since these large upper bounds can possibly result in a timed automaton with a large number of transitions, using these timed automata may suffer from scalability issues for scheduling purposes. Therefore, one may assume to arbitrate an upper bound on the triggering mechanism to facilitate the scheduling process. Considering the case of multiple WNCS’s, this type of assumption is closely related to periodic-ETC strategies, see e.g. [28], and the assumed bound can be seen as the network heartbeat forcing ETC feedback loops updates. VI. ACKNOWLEDGMENTS The authors gratefully appreciate the fruitful discussions with Dieky Adzkiya and Nikolaos Kekatos. A PPENDIX Lemma 4: Assume the time interval [0, σ] is divided to l subintervals. This step is related to the reduction of conservatism in polytopic embedding. Let t ∈ [0, σ] be an instant such that it satisfies j σl ≤ t < (j + 1) σl where j ∈ {0, . . . , l − 1} and t = t′ + j σl (t′ ∈ [0, χ], with χ = σl τ l for j < ⌊ ¯σs ⌋ and χ = τs − j σl otherwise). Denote Λ(t) − I ¯ by X (t). One has: "Z σ jl eAs ds+ X (t) = 0 Z 0 t′ e As ds(A Z j σl e As 0 # (38) ds + I) (A − BK). Rewrite (38) into a more compact form as follows: Z t′ X (t) = Π̌j + eAs dsΠ̂j (39) 0 where Π̌j = F̌j (A − BK), Π̂j = F̂j (A − BK) Rjσ F̂j = AF̌j + I. F̌j = 0 l eAs ds, (40) Substitute (39) into (13), it follows: R t′ Φ11 (t) = Π̌Tj M Π̌j + Π̌Tj M ( 0 eAs ds)Π̂j ¯ R t′ +Π̂Tj ( 0 eAs ds)T M Π̌j R t′ R t′ +Π̂Tj ( 0 eAs ds)T M ( 0 eAs ds)Π̂j (41) +tW µλmax (E T E)dA (t)I − N, ′ R t Φ12 (t) = Π̌Tj M + Π̂Tj ( 0 eAs ds)T M, ¯ Φ21 (t) = ΦT12 (t), ¯ (t) = −Ψ. ¯ Φ 22 ¯ Now, we use the polytopic embedding approach proposed by [25] to abstract away t in (13). In the polytopic embedding approach, the underlying idea is as follows. First, we approximate the matrix functionals tW µλmax (E T E)dA (t)I and Φ by their Nconv -th order Taylor series expansions. Note that ¯one has: Z t′ Ai−1 ′ i conv (t ) . (42) eAs ds = ΣN i=1 i! 0 Followed by these approximations, we take into account the introduced error and call the upper bound on this error η. The procedure to find η follows. The exact Taylor expansion ′ k ˆ ˆ of Φ(t) is given by Σ∞ k=0 Φk,j (t ) where Φk,j is given in ¯ ¯ (23). However, in our analysis the Nconv -th order expansion conv ˆ ′ k ˜ of Φ(t), that is Φ (t′ ) = ΣN k=0 Φk,j (t ) has been used. conv ,j) ¯ the approximation is ¯ (Nerror Now, assume the introduced by ′ ˜ R(Nconv ,j) (t′ ) = Φ(t) − Φ (Nconv ,j) (t ) which happens to be ¯ ¯ a symmetric matrix. Hence, one is able to derive an upper bound on R(Nconv ,j) (t′ ) ≤ ηI where the scalar η is given ¯ ˜ by (32). It follows that Φ (t′ ) + ηI  0 implies ¯ (Nconv ,j) ˜ Φ(t)  0. Based on the fact that Φ(Nconv ,j) (·) + ηI is a ¯ the convex embedpolynomial function, one is able to use ding technique in [25] to show that Φ(i,j),s  0, ∀(i, j) ∈ τ ¯l Ks = ({0, . . . , Nconv } × {0, . . . , ⌊ ¯σs ⌋}), with Φ(i,j),s = Pi ¯ k ′ k=0 Lk,j χ + ηI implies (Φ̃Nconv ,j (σ ) + ηI)  0 and as a result Φ(t)  0, ∀t ∈ [0, τs ]. ¯ Theorem 2: Consider ¯scalars α(i,j),s for n = 2 (or ma¯ LMI conditions given in trices U(i,j),s for n ≥ 3) satisfying ¯ (34) for s ∈ {1, . . . , q}. By the virtue of Schur complement and Lemma 4, it follows that Φ(t) + α(i,j),s Qs  0 for ¯ n = 2 (or Φ(t) + EsT U(i,j),s Es  0 for n ≥ 3). Then, ¯ 2 T since ∀x ∈ Rs , {x ∈ R | x Qs x ≥ 0} for n = 2 (or {x ∈ Rn | Es x ≥ 0} for n ≥ 3), the S-procedure implies that xT Φ(t)x ≤ 0, ∀t ∈ [0, τs ]. Finally, Theorem 1 guarantees ¯ that ∀x ∈ Rs , the inter-sample time τ (x) is lower bounded by τs . ¯ Lemma 5 and Theorem 3: A sketch of proof is given. The polytopic embedding according to time of −Φ(t) enable us to show that −Φ(t)  0 (or Φ(t)  0) if Φ̄κ,s  0, ∀κ ∈ Ks . Then, by applying the Schur complement on −Φ(t), it follows −Θ(t)  0 (or Θ(t)  0) and as a result −xT Θ(t)x ≤ 0. Furthermore, considering (20) in Theorem 1, i.e. −Fω (x, t) ≥ −xT Θ(t)x, the claims in Lemma 5 and Theorem 3 follow. R EFERENCES [1] P. Tabuada, “Event-triggered real-time scheduling of stabilizing control tasks,” IEEE Trans. Autom. Control, vol. 52, no. 9, pp. 1680–1685, Sep. 2007. [2] M. Velasco, J. Fuertes, and P. Marti, “The self triggered task model for real-time control systems,” in Work-in-Progress Session of the 24th IEEE Real-Time Systems Symposium, vol. 384, 2003. [3] E. W. Dijkstra, “On the role of scientific thought,” in Selected writings on computing: a personal perspective. Springer, 1982, pp. 60–66. [4] G. Buttazzo, G. Lipari, and L. Abeni, “Elastic task model for adaptive rate control,” in Proc. 19th IEEE Real-Time Systems Symposium, Dec. 1998, pp. 286–295. [5] M. Caccamo, G. Buttazzo, and L. Sha, “Elastic feedback control,” in Proc. 12th Euromicro Conference on Real-Time Systems, 2000, pp. 121–128. [6] C. Lu, J. Stankovic, S. Son, and G. Tao, “Feedback control realtime scheduling: Framework, modeling, and algorithms,” Real-Time Systems, vol. 23, no. 1-2, pp. 85–126, 2002. [7] A. Cervin and J. Eker, “Control-scheduling codesign of real-time systems: The control server approach,” Journal of Embedded Computing, vol. 1, no. 2, pp. 209–224, 2004. [8] R. Bhattacharya and G. Balas, “Anytime control algorithm: Model reduction approach,” Journal of Guidance, Control, and Dynamics, vol. 27, no. 5, pp. 767–776, 2004. [9] D. Fontanelli, L. Greco, and A. Bicchi, “Anytime control algorithms for embedded real-time systems,” in Hybrid Systems: Computation and Control, 2008, pp. 158–171. [10] S. Al-Areqi, D. Gorges, S. Reimann, and S. Liu, “Event-based control and scheduling codesign of networked embedded control systems,” in Proc. Amer. Control Conf., Jun. 2013, pp. 5299–5304. [11] S. Al-Areqi, D. Gorges, and S. Liu, “Stochastic event-based control and scheduling of large-scale networked control systems,” in Proc. European Control Conf., Jun. 2014, pp. 2316–2321. [12] A. Sharifi Kolarijani, D. Adzkiya, and M. Mazo Jr., “Symbolic abstractions for the scheduling of event-triggered control systems,” in Proc. 54th IEEE Conference on Decision and Control, Dec 2015, pp. 6153–6158. [13] A. Sharifi Kolarijani and M. Mazo Jr, “A formal traffic characterization of LTI event-triggered control systems,” to appear in IEEE Trans. Control of Network Systems, arXiv:1503.05816, 2015. [14] R. Alur and R. Kurshan, “Timing analysis in cospan,” Hybrid Systems III, pp. 220–231, 1996. [15] T. A. Henzinger, X. Nicollin, J. Sifakis, and S. Yovine, “Symbolic model checking for real-time systems,” Information and computation, vol. 111, no. 2, pp. 193–244, 1994. [16] R. Alur and D. L. Dill, “A theory of timed automata,” Theoretical computer science, vol. 126, no. 2, pp. 183–235, 1994. [17] K. G. Larsen, P. Pettersson, and W. Yi, “Uppaal in a nutshell,” International Journal on Software Tools for Technology Transfer, vol. 1, no. 1, pp. 134–152, 1997. [18] X. Wang and M. D. Lemmon, “Self-triggered feedback control systems with finite-gain L2 stability,” IEEE Trans. Autom. Control, vol. 54, no. 3, pp. 452–467, 2009. [19] K. Gu, J. Chen, and V. L. Kharitonov, Stability of time-delay systems. Springer Science & Business Media, 2003. [20] C. Van Loan, “The sensitivity of the matrix exponential,” SIAM Journal on Numerical Analysis, vol. 14, no. 6, pp. 971–981, 1977. [21] G. Ewald, Combinatorial convexity and algebraic geometry. Springer Science & Business Media, 2012, vol. 168. [22] P. Tabuada, Verification and Control of Hybrid Systems: A Symbolic Approach. Springer London, Limited, 2009. [23] R. Alur and D. Dill, “A theory of timed automata,” Theoretical Computer Science, vol. 126, no. 2, pp. 183–235, 1994. [24] C. Fiter, L. Hetel, W. Perruquetti, and J.-P. Richard, “A state dependent sampling for linear state feedback,” Automatica, vol. 48, no. 8, pp. 1860–1867, 2012. [25] L. Hetel, J. Daafouz, and C. Iung, “Stabilization of arbitrary switched linear systems with unknown time-varying delays,” Automatic Control, IEEE Transactions on, vol. 51, no. 10, pp. 1668–1674, 2006. [26] A. Chutinan and B. Krogh, “Computing polyhedral approximations to flow pipes for dynamic systems,” in Proc. 37th IEEE Conference on Decision and Control, vol. 2, Dec. 1998, pp. 2089–2094. [27] M. Donkers and W. Heemels, “Output-based event-triggered control with guaranteed-gain and improved and decentralized eventtriggering,” IEEE Trans. Autom. Control, vol. 57, no. 6, pp. 1362– 1376, 2012. [28] W. Heemels, M. Donkers, and A. R. Teel, “Periodic event-triggered control for linear systems,” IEEE Trans. Autom. Control, vol. 58, no. 4, pp. 847–861, 2013.
3cs.SY
Mean and variance of the LQG cost function Hildo Bijl a, Jan-Willem van Wingerden a, Thomas B. Schön b, Michel Verhaegen a a Delft Center for Systems and Control, Delft University of Technology, The Netherlands arXiv:1602.02524v1 [cs.SY] 8 Feb 2016 b Department of Information Technology, Uppsala University, Sweden Please cite this version: Hildo Bijl, Jan-Willem van Wingerden, Thomas B. Schön, Michel Verhaegen. Mean and variance of the LQG cost function. In Automatica, Volume 67, May 2016, Pages 216-223. http://dx.doi.org/10.1016/j.automatica.2016.01.030 Abstract Linear Quadratic Gaussian (LQG) systems are well-understood and methods to minimize the expected cost are readily available. Less is known about the statistical properties of the resulting cost function. The contribution of this paper is a set of analytic expressions for the mean and variance of the LQG cost function. These expressions are derived using two different methods, one using solutions to Lyapunov equations and the other using only matrix exponentials. Both the discounted and the non-discounted cost function are considered, as well as the finite-time and the infinite-time cost function. The derived expressions are successfully applied to an example system to reduce the probability of the cost exceeding a given threshold. Key words: Linear systems; Linear quadratic regulators; LQG control; Lyapunov equation; Probability density function; Matrix algebra. 1 Introduction The Linear-Quadratic-Gaussian (LQG) control paradigm is generally well-understood in literature. (See for instance [1,16,3,12].) There are many methods available of calculating and minimizing the expected cost E[J]. However, much less is known about the resulting distribution of the cost function J. Yet in many cases (like in machine learning applications, in risk analysis and similar stochastic problems) knowledge of the full distribution of the cost function J, or at least knowledge of its variance V[J], is important. That is the focus of this paper. We derive analytical expressions for both the mean E[J] and the variance V[J] of the cost function distribution for a variety of cases. The expressions for the variance V[J] have not been published before, making that the main contribution of this paper. The cost function J is usually defined as an integral Email addresses: [email protected] (Hildo Bijl), [email protected] (Jan-Willem van Wingerden), [email protected] (Thomas B. Schön), [email protected] (Michel Verhaegen). Article published in Automatica 67 (2016) 216–223 over a squared non-zero-mean Gaussian process, turning its distribution into a generalized noncentral χ2 distribution. This distribution does not have a known Probability Density Function (PDF), although its properties have been studied before in literature, for instance in [13,15,14], and methods to approximate it are discussed in [10,6]. No expressions for the variance of the LQG system cost function are given though. In LQG control most methods focus on the expected cost E[J], but not all. For instance, Minimum Variance Control (MVC) (see [12]) minimizes the variance of the output y, while Variance Constrained LQG (VCLQG) (see [4,5]) minimizes the cost function subject to bounds on the variance of the state x and/or the input u. Alternatively, in Minimal Cost Variance (MCV) control (see [8,19]) the mean cost E[J] is fixed through an equality constraint and the cost variance V[J] (or alternatively the cost cumulant) is then minimized. However, expressions for the cost variance V[J] are still not given. This paper is set up as follows. We present the problem formulation in Section 2 and derive the expressions that solve this problem in Section 3, also making use of the Table 1 The theorems with which the mean and variance of J and JT can be found, as well as the requirements for these theorems. If α 6= 0 If α = 0 Requirements E[JT ] Th. 1 Th. 3 A and Aα Sylvester E[J] Th. 2 α < 0 and Aα stable V[JT ] Th. 4 Th. 6 A−α , A, Aα and A2α Sylvester E[J] Th. 5 α < 0 and Aα stable appendices. Section 4 then shows how the equations can be applied to LQG systems, which is subsequently done in Section 5. Finally, Section 6 contains the conclusions. 2 Problem formulation We consider continuous linear systems subject to stochastic process noise. Formally, we write these as dx(t) = Ax(t) dt + dw(t), 3.1 (1) Concerning the evolution of the state, we define µ(t) ≡ E[x(t)], Σ(t) ≡ E[x(t)xT (t)] and Σ(t1 , t2 ) ≡ E[x(t1 )xT (t2 )]. These quantities can be found through the theorems of Appendix A. where w(t) is a vector of Brownian motions. (Note that (1) is not an LQG system, because it is lacking input. The extension to LQG systems will be discussed in Section 4.) As a result, dw(t) is a Gaussian random process with zero-mean and an (assumed constant) covariance of V dt. Within the field of control (see for instance [16]) this system is generally rewritten according to ẋ(t) = Ax(t) + v(t), We define the matrices Aα ≡ A + αI and similarly Q Akα ≡ A + kαI for any number k. We also define Xkα Q and X̄kα to be the solutions of the Lyapunov equations (2) where v(t) is zero-mean Gaussian white noise with intensity V . That is, E[v(t)v T (τ )] = V δ(t − τ ), with δ(.) the Kronecker delta function. From a formal mathematical perspective this simplification is incorrect, because v(t) is not measurable with nonzero probability. However, since this notation is common in the control literature, and since it prevents us from having to evaluate the corresponding Itô integrals, we will stick with it, although the reader is referred to [11] for methods to properly deal with stochastic differential equations. and Σ0 ≡ E[x0 xT0 ]. Q Q T Akα Xkα + Xkα Akα + Q = 0, (6) Q Q + X̄kα Akα + Q = 0. ATkα X̄kα (7) We often have α = 0. In this case A0 equals A, and we similarly shorten X0Q to X Q . The structure inherent in the Lyapunov equation induces interesting properties in Q its solutions Xkα , which are outlined in Appendix B. Q We define the time-dependent solution Xkα (t1 , t2 ) as Q (t1 , t2 ) = Xkα We assume that the initial state x(0) = x0 has a Gaussian distribution satisfying µ0 ≡ E[x0 ] Notation and terminology Z t2 T eAkα t QeAkα t dt. (8) t1 This integral can be calculated efficiently by solving a Lyapunov equation. (See Theorem 14.) Often it hapQ pens that the lower limit t1 of Xkα (t1 , t2 ) equals zero. Q Q To simplify notation, we then write Xkα (t) ≡ Xkα (0, t). Q Another integral solution X̃k1 α,k2 α (T ) is defined as (3) Note that the variance of x0 is not Σ0 , but actually equals Σ0 − µ0 µT0 . We will use two different cost functions in this paper: the infinite-time cost J and the finitetime cost JT , respectively defined as Z ∞ J≡ e2αt xT (t)Qx(t) dt, (4) 0 Z T e2αt xT (t)Qx(t) dt, (5) JT ≡ X̃kQ1 α,k2 α (T ) ≡ Z T eAk1 α (T −t) QeAk2 α t dt. (9) 0 This quantity can be calculated (see [17]) through 0 where Q is a user-defined symmetric weight matrix. The parameter α can be positive or negative. If it is positive, it is known as the prescribed degree of stability (see [1] or [3]), while if it is negative (like in Reinforcement Learning applications) it is known as the discount exponent. 3 h i X̃αQ1 ,α2 (T ) = I 0 exp # !" # " 0 Aα1 Q T . I 0 Aα2 (10) Considering terminology, we say that a matrix A is stable (Hurwitz) if and only if it has no eigenvalue λi with a real part equal to or larger than zero. Similarly, we say that a matrix A is Sylvester if and only if it has no two eigenvalues λi and λj (with possibly i = j) satisfying λi = −λj . This latter definition is new in literature, but to the best of our knowledge, no term for this matrix property has been defined earlier. Mean and variance of the LQG cost function In this section we derive expressions for E[J], E[JT ], V[J] and V[JT ]. An overview of derived theorems, as well as the corresponding requirements, is shown in Table 1. 2 3.2 The expected cost Theorem 3 Consider system (2). Assume that α = 0 and that A is Sylvester. The expected value E[JT ] of the finite-time cost JT (5) is then given by We now examine the expected costs E[J] and E[JT ]. Expressions for these costs are already known for various special cases. (See for instance [3,12].) To provide a complete overview of the subject, we have included expressions which are as general as possible.  E[JT ] = tr (Σ0 − Σ(T ) + T V ) X̄ Q . (18) Theorem 1 Consider system (2). Assume that α 6= 0 and that A and Aα are both Sylvester. The expected value E[JT ] of the finite-time cost JT (5) then equals      −V tr Σ0 − e2αT Σ(T ) + 1 − e2αT X̄αQ . (11) 2α PROOF. If we consider (11) from Theorem 1 as α → 0, then this theorem directly follows. After all, we know 2αT from l’Hôpital’s rule that limα→0 1−e2α = −T . PROOF. From (5) follows directly that Next, we derive expressions for the variances V[J] and V[JT ]. These expressions are new and as such are our main contribution. If we define ∆ = Σ0 −X V , then V[JT ] and V[J] can be found through the following theorems. E[JT ] = tr Z T e2αt Σ(t) dt Q 0 ! 3.3 = tr (Y (T )Q) , (12) Theorem 4 Consider system (2). Assume that α 6= 0 and that A−α , A, Aα and A2α are Sylvester. The variance V[JT ] of the finite-time cost JT (5) is then given by where Y (T ) is defined as the above integral. To find it, we multiply (A.7) by e2αt and integrate it to get T Z e 2αt T Σ̇(t) dt = AY (T )+Y (T )A + 0 Z T e2αt V dt. (13) 2  V[JT ] = 2tr (∆X̄αQ (T ))2 − 2 µT0 X̄αQ (T )µ0   Q e4αT X̄−α (T ) − X̄αQ (T ) + 4tr X V Q X V 4α  ∆ AT T α X2α e Q ∆ Q + 2X2α X̄α (T ) − 2X̃3α,α (T ) . (19) 0 The left part, through integration by parts, must equal Z T 0 The cost variance  e2αt Σ̇(t) dt = e2αT Σ(T ) − Σ0 − 2αY (T ). (14) As a result, Y (T ) must satisfy the Lyapunov equation PROOF. We will start our proof by evaluating E[J 2 ]. If we write x(t1 ) as x1 and x(t2 ) as x2 , then we have  2αT  e −1 2αT Aα Y (T )+Y V + Σ0 − e Σ(T ) = 0. 2α (15) Using Theorem 15, we can now write Y (T ) as (T )ATα + Y (T ) = e2αT − 1 V Xα + XαΣ0 − e2αT XαΣ(T ) . 2α 2 E[J ]=E 0 (16) T 2α(t1 +t2 ) e 0 xT1 Qx1 xT2 Qx2 # dt2 dt1 . (20) Taking the trace and applying Theorem 19 gives us Combining this with (12) and applying Theorem 16 (with F = G = I) completes the proof. E[J 2 ] = Theorem 2 Consider system (2). Assume that α < 0 and that Aα is stable. The expected value E[J] of the infinite-time cost J (4) is then given by    V Q X̄α . E[J] = tr Σ0 − 2α "Z Z T (17) Z TZ T   tr e2αt1 Σ(t1 )Q tr e2αt2 Σ(t2 )Q 0 0   + 2tr e2α(t1 +t2 ) Σ(t2 , t1 )QΣ(t1 , t2 )Q  − 2e2α(t1 +t2 ) µT1 Qµ1 µT2 Qµ2 dt2 dt1 , (21) where µ1 equals E[x(t1 )] = eAt1 µ0 (see Theorem 8) and similarly for µ2 . There are three terms in the above equation. We will denote them by T1 , T2 and T3 , respectively. The first term T1 directly equals E[J]2 (see Theorem 1). This is convenient, because V[J] = E[J 2 ] − E[J]2 , which means that V[J] equals the remaining two terms T2 +T3 . PROOF. If we examine (11) in the limit as T → ∞, then this theorem directly follows. After all, Theorem 8 implies that, for stable Aα , e2αT Σ(T ) → 0 as T → ∞. 3 That leaves T2,3 , which is the most involved term. We can apply the same substitution and interchanging of integrals to find that T2,3 equals The third term T3 is, according to definition (8), equal to Z T3 = −2 T e 2αt 0 T µT0 eA t QeAt µ0 2 µT0 X̄αQ (T )µ0 = −2 dt !2 , (22) 8tr where X̄αQ (T ) can be evaluated through Theorem 14. That leaves T2 . To find it, we first have to adjust the integrals. We note that T2 is symmetric with respect to t1 and t2 . That is, if we would interchange t1 and t2 , the integrand would be the same. As a result, we do not have to integrate over all values of t1 and t2 . We can also only consider all cases where t1 < t2 , integrate over this area, and then multiply the final result by 2. This gives us ! Z Z T e2α(t1 +t2 ) Σ(t2 , t1 )QΣ(t1 , t2 )Q dt2 dt1 0 =8tr T −t2 2α(2t1 +t2 ) At2 e 0 0 Z T X e V 0 V X Qe At1 ∆e AT (t2 +t1 ) T ∆ QX2α (T−t2 )eAα t2 QeAα t2 ! Q dt1 dt2 ! dt2 =T2,3 . (27) ∆ Expanding X2α (T −t2 ) using Theorem 14 turns this into ∆ T2,3 = 8tr X V Q X2α T T2 = 4tr Z TZ . t1 − (23) Now, with t1 < t2 , we can apply Theorem 10 to substitute for Σ(t1 , t2 ). If we subsequently expand the brackets, and use the fact that X V and hence also ∆ is symmetric (see Theorem 12), then the above term turns into Z 0 Z T e A3α (T −t2 ) T T eAα t2 QeAα t2 dt2 0 ∆ AT X2α e α T QeAα t2 dt2 !! (28)    ∆ AT X2α e αTQ V ∆ Q = 8tr X Q X2α X̄α (T ) − X̃3α,α (T ) , T T2 = 4tr  Z TZ +e T e 2α(t1 +t2 ) 0 t1 A(t2 −t1 ) X ∆ eAα T Q 2α where the final term X̃3α,α (T ) can be found through (10). If we now merge all terms together, we find the result which we wanted to prove.  T T eAt2 ∆eA t1 QeAt1 ∆eA t2 Q X V QX V eA T (t2 −t1 ) Q   T + 2eA(t2 −t1 ) X V QeAt1 ∆eA t2 Q dt2 dt1 . (24) Theorem 5 Consider system (2). Assume that α < 0 and that Aα is stable. The variance V[J] of the infinitetime cost J (4) is then given by This expression again has three terms. We call them T2,1 , T2,2 and T2,3 , respectively. First we find T2,1 . We can again note that the integrand is symmetric with respect to t1 and t2 , meaning we can apply the opposite trick of the one we applied at (23). This gives us ! Z Z T T 0 = 2tr Z T T T ∆e 0 !2  AT αt T PROOF. As T → ∞, eAα T and e4αT become zero, X̄αQ (T ) becomes X̄αQ and hence (19) reduces to  QeAα t dt  = 2tr (∆X̄αQ (T ))2 . (25) 0 The next term, T2,2 , is not symmetric in t1 and t2 . To bring both integration bounds back to zero, we now substitute t2 for t2 + t1 . Subsequently interchanging the integrals results in T2,2 = 4tr Z TZ Z T 0 = 4tr e T −t1 2α(2t1 +t2 ) At2 e 0 0 = 4tr (29) eAα t2 ∆eAα t1 QeAα t1 ∆eAα t2 Q dt2 dt1 T2,1 = 2tr   2 V[J] = 2tr (Σ0 X̄αQ )2 − 2 µT0 X̄αQ µ0    V X2α Σ0 Q Q + 4tr X2α − X̄α V X̄α . 4α 4αT Z 0 T −t2 4αt1 e e ! V V AT t2 X QX e T 2  (30) V[J] = 2tr (∆X̄αQ )2 − 2 µT0 X̄αQ µ0    V X ∆ + 4tr X̄αQ X V Q 2X2α − . 4α  Q dt2 dt1 ! Through an excessive amount of elementary rewritings, using both Q = −ATα X̄αQ − X̄αQ Aα and Theorem 17, the above can be rewritten to (29), which is a slightly more elegant version of the above expression. (26) Theorem 6 Consider system (2). Assume that α = 0 and that A is Sylvester. The variance V[JT ] of the finite- dt1 eAα t2 QeAα t2 X V QX V dt2 ! Q X̄−α (T ) − X̄αQ (T ) V X QX V . 4α 4 PROOF. We first prove the expression for E[JT ]. If we insert (A.5) into (12), we find that time cost JT (5) is then given by  2 V[JT ] = 2tr (∆X̄ Q (T ))2 − 2 µT0 X̄ Q (T )µ0     Q + 4tr X V Q X V T X̄ Q − X X (T )  ∆ AT T Q + 2X ∆ X̄ Q (T ) − 2X̃ X e (T ) . (31) E[JT ] = tr T Z + Z 0 T e2αt eAt Σ0 eA t Q dt 0 T Z t e2αt eA(t−s) V eA T (t−s) 0  Q ds dt . (38) We know from [17] that PROOF. We can evaluate (19) from Theorem 4 as α → 0. While doing so, we may use the relation X̄ Q X̄α −α(T )= e C44 = eA2α T , (39) Z T T e e−A2α (T −t) QeAt dt, (40) C12 = 0 Z TZ t T T e C13 = e−A2α (T −t) QeA(t−s) V e−A s ds dt. (41) Q X̄αQ (T )−e4αT X̄−α (T ) e4αT −1 Q X̄−α , (32) + 4α 4α which follows from combining Theorems 14 and 17. From this, we find through application of l’Hôpital’s rule that lim e 4αT Q X̄−α (T ) − X̄αQ (T ) 4α α→0 0 From this (36) directly follows. Proving the expression for V[JT ] is done similarly, but with more bookkeeping. e First of all, C14 equals (see [17]) Q = T X̄ Q − X X (T ). (33) Z TZ tZ By using the above relation, the theorem directly follows. 0 3.4 The method of using Lyapunov solutions to find E[JT ] and V[JT ] has a significant downside: if A or Aα is not Sylvester, the theorems do not hold. By solving integrals using matrix exponentials, according to the methods described in [17], we can work around that problem. A 0 0 V 0 −AT 0 0 0 Q 0 0 0 A2α V 0 0 0 −AT−2α eCT  e · · · C15  .  .. . ..  ,  e · · · C55 (s−r) QeA2α r dr ds dt, 0 Σ(t1 , t2 ) = e 2 . (43) At1 Σ0 e AT t2 Z min(t1 ,t2 ) T + eA(t1 −s) V eA (t2 −s) ds, (44) 0 which is derived in an identical way. For ease of notation, we write Σ(t1 , t2 ) = Σa + Σb , with Σa and Σb the two parts in the above expression. Inserting Σ(t1 , t2 ) into (23) then gives (34) T Z T2 = 2tr T  e2α(t1 +t2 ) ΣTa QΣa Q 0 0   T + 2Σa QΣb Q + ΣTb QΣb Q dt2 dt1 . and write eCT as  Ce  11  . =  ..  e C51 T Then we consider T2 from (23). Instead of applying (A.5), we now use      ,    T e T e T3 = −2 µT0 (C44 ) C12 µ0 Theorem 7 If we define the matrix C as Q 0 s e−A2α (T −t) QeA(t−s) V e−A (42) e with a similar expression for C15 . Next, we will find the terms T3 (see (22)) and T2 (see (23)), which together equal V[JT ]. We can directly see from (22) that T3 equals Finding E[JT ] and V[JT ] using matrix exponentials  −AT2α   0   C= 0   0  0 0 (35) Z (45) The first term T2,aa here equals 2tr then we can find E[JT ] and V[JT ] through Z TZ 0  e T e e E[JT ] = tr (C44 ) (C12 Σ0 + C13 ) , (36)  2 e T e e (37) V[JT ] = 2tr (C44 ) (C12 Σ0 + C13 )  2 e T e e e T e − 2(C44 ) (C14 Σ0 + C15 ) − 2 µT0 (C44 ) C12 µ0 . T e 2α(t1 +t2 ) At2 Σ0 e Qe At1 Σ0 e AT t2 0  = 2tr  = 2tr 5 e AT t1  Z T e2αt eA T 0 e T e (C44 ) C12 Σ0 !2  t QeAt Σ0 dt  2  = T2,aa . ! dt2 dt1 (46) So now we have two methods of finding E[JT ] and V[JT ]. But which one is better? This mainly depends on the time T . Our experiments have shown that, for small times T , using matrix exponentials results in a better numerical accuracy than using Lyapunov solutions, but for large T the situation is exactly the opposite, and the numerical accuracy of the matrix exponential method quickly deteriorates. Similar results have been obtained by [18], which examines the numerical accuracy of both algorithms when finding X Q (T ). The second term T2,ab is given by Z T2,ab = 4tr T T Z Z min(t1 ,t2 ) 2α(t1 +t2 ) At2 Σ0 e A 0 0 0  A(t1 −s) AT (t2 −s) e Ve Q ds dt2 dt1 . e e T t1 Q (47) We want the integration order to be dt2 ds dt1 . If we note that the integration area is described by 0 ≤ s ≤ (t1 , t2 ) ≤ T , we can reorder the integrals. That is, 4 Z TZ t1Z T  T2,ab =4tr (48) . . . dt2 ds dt1 0 0 s Z TZ t1Z T  Z TZ tZ 1 s =4tr . . . dt2 ds dt1 . . . . dt2 ds dt1 − 0 0 0 0 0 So far we have only considered systems of the form (2), but in LQG systems there are also input and output signals. However, in that case we can always rewrite the system on the form (2). In this section we show how to do this. For more details we refer to [1,16,3,12]. 0 We now have two integrals, but we can solve both. If we split up the first one and rewrite the second one, we get First, we consider a system ẋ(t) = Ax(t) + Bu(t) + v(t) with input. Its corresponding cost function equals  Z TZ t1 T T T2,ab =4tr e2αt1 eA t1 QeA(t1 −s) V e−A s ds dt1 0 0 Z T  Z TZ tZ 1 s T e2α(t1 +t2 ) e2αt2 eA t2 QeAt2 dt2 Σ0 − 0 0 0 0  A(t1 −s) AT (t2 −s) AT t1 Qe Ve QeAt2 Σ0 dt2 ds dt1 e  e T e e T e e T e =4tr (C44 ) C13 (C44 ) C12 Σ0 −(C44 ) C14 Σ0 . (49) J= T2,bb = 2tr 0 = 2tr 0 0 min(t1 ,t2Z ) min(t1 ,t2 ) Z TZ tZ Z 2 T t1 0 (52) (53) with X̂α the solution to the algebraic Riccati equation  ATα X̂α + X̂α Aα + Q − X̂α BR−1 B T X̂α = 0. (54) For this optimal gain matrix F (and for any other matrix F ) the system and cost function can be written as . . . ds1 dt2 ds2 dt1 0 0 0  Z TZ t2Z s1Z t1 . . . ds1 dt2 ds2 dt1 . (50) −2 0 e2αt (xT (t)Qx(t) + uT (t)Ru(t)) dt. F = R−1 B T X̂α , 0 0 ∞ It is well-known in literature (see for instance [7]) that the optimal control law minimizing E[J] is a linear control law u(t) = −F x(t). If we assume that Q = QT ≥ 0 and R = RT > 0, then the optimal gain matrix F equals . . . ds2 ds1 dt2 dt1 0 Z 0 Finally there is T2,bb . We first concern ourselves with the integration order and limits. By rearranging integrals, and by using the symmetry between t1 and t2 as well as between s1 and s2 , we can find that Z TZ TZ Application to an LQG system ẋ(t) = (A − BF )x(t) + v(t) = Âx(t) + v(t), Z ∞ J= e2αt xT (t)Q̂x(t) dt, 0 After inserting the integrand, we can rewrite this to (55) (56) 0 2 T T e2αt eA t QeA(t−s) V e−A s ds dt 0 0 Z TZ t2Z sZ 1 t1 T e2α(t1 +t2 ) eA (t1 −s1 ) QeA(t1 −s2 ) V −2 0 0 0 0  AT (t2 −s2 ) A(t2 −s1 ) e Qe V ds1 dt2 ds2 dt1    e T e 2 e T e = 2tr (C44 ) C13 −2(C44 ) C15 . (51) T2,bb = 2tr  Z TZ t where we have Q̂ = Q + F T RF . This shows that the system is now in our original form (2). A similar reduction can be performed when we are dealing with a noisy output equation y(t) = Cx(t) + w(t), where w(t) is zero-mean Gaussian white noise with intensity W . To deal with this output equation, we take a state estimate x̂(t) and update it through ˙ x̂(t) = Ax̂(t) + Bu(t) + K(y(t) − C x̂(t)). By combining all the results, we wind up with (37). 6 (57) ¯ That that the cost J is above a certain threshold J. ¯ is, we aim to minimize p(J > J) where we use J¯ = 1 500, which is roughly ten times the mean. Using 250 000 numerical simulations, with T = 20 s and dt = 0.01 s, we have found that To minimize the state estimation error e(t) = x̂(t) − x(t), we need to choose the observer gain K equal to K = EC T W −1 , (58) where E is the solution to AE + EAT + V − EC T W −1 CE = 0. ¯ ≈ 0.091%, p(J(Fopt ) > J) ¯ ≈ 0.059%. p(J(Fmv ) > J) (59) We need this state estimate in a new optimal control law u = −F x̂. This reduces the system equations to Hence the optimal controller has more than half as many threshold-violating cases as the minimum-variance control law, which is a significantly worse result. " # " #" # " # ẋ A − BF −BF x v = + , (60) x̂˙ KC A − BF − KC x̂ Kw 6 which is again of the form we have seen earlier, albeit with a somewhat larger state vector. Because of this, all the equations that were originally developed for system (2) are applicable to LQG systems as well. 5 The infinite-time cost J has a finite value if and only if Aα is stable and α < 0. In this case, E[J] can be found through Theorem 2 and V[J] through Theorem 5. The finite-time cost JT always has a finite value. The theorems needed to find its mean and variance, as well as the requirements for using these theorems, have been summarized in Table 1. Alternatively, when T is not too large, these two quantities can also be calculated through Theorem 7 using matrix exponentials for any A and α. In this section we look at an example of how to apply the derived equations. In literature, researchers almost always use the controller which minimizes the expected value of the cost. This is done irrespective of the variance of the cost. But if the goal is to keep the cost below a certain threshold, then this may not be the best approach. Consider the two-state system ẋ = 1 # 0 1/20 1 x+ " # 1 0 u + v, Conclusions In this paper, equations have been derived for the mean and the variance of both the infinite-time cost J and the finite-time cost JT . We have seen a case in which the equations can support controller synthesis by reducing the number of extreme cases that occur. Numerical evaluation " (62) (63) (61) Acknowledgements where we will apply Q = I, R = I and α = −0.8 in the cost function. As control law we use u = −F x. We assume that the state x is fully known, and hence only F needs to be chosen. In practice this is often not the case and only a noisy measurement y will be available. To solve this, we can apply the theory from Section 4 and subsequently choose the observer gain K along with F . However, this process is identical to choosing F . So for simplicity of presentation, we only consider selecting F . This research is supported by the Dutch Technology Foundation STW, which is part of the Netherlands Organisation for Scientific Research (NWO), and which is partly funded by the Ministry of Economic Affairs (Project number: 12173, SMART-WIND). The work was also supported by the Swedish research Council (VR) via the project Probabilistic modeling of dynamical systems (Contract number: 621-2013-5524). control matrix follows from (53) as Fopt = hThe optimal i . It minimizes E[J] at E[J(Fopt )] = 154.4. 1.6 9.9 However, we can also minimize V[J] using a basic gradient descent method. This hgives the i minimumvariance control matrix Fmv = 4.4 30.0 with mean cost E[J(Fmv )] = 187.5. This mean cost is significantly larger than E[J]opt , making it seem as if this is a significantly worse control matrix. A Evolution of the state The way in which the state x(t) evolves over time is described by (2). Solving this equation for x(t) results in At x(t) = e x0 + Z t eA(t−s) v(s) ds. (A.1) 0 We use this to derive statistical properties for x(t). These properties are well-known (see for instance [3]), but they are included to give a good overview of existing theory. However, now suppose that we do not care so much about the mean cost. All we want is to reduce the probability 7 Theorem 8 When x(t) satisfies system (2), with the corresponding assumptions on x(0) and v, then x(t) is a Gaussian random variable satisfying µ(t) ≡ E[x(t)] = eAt µ0 , T B Theorem 11 There is a unique solution for X Q , and identically for X̄ Q , if and only if the matrix A is Sylvester. (A.2) At V Σ(t) ≡ E[x(t)x (t)] = e (Σ0 − X )e AT t V + X . (A.3) PROOF. In literature it is known (see [2]) that the Sylvester Equation AX +XB = Q has a unique solution if and only if A and −B do not have a common eigenvalue. Substituting B = AT directly proves the theorem. PROOF. Because x(t) is the sum of Gaussian variables, it will have a Gaussian distribution at all times t. From (A.1), its mean equals µ(t) ≡ E[x(t)] = eAt E[x0 ] = eAt µ0 . Theorem 12 Assume that A is Sylvester. In this case X Q is symmetric if and only if Q is symmetric. (A.4) The expected squared value is found similarly through PROOF. If we take the Lyapunov equation AX Q + X Q AT + Q = 0 and subtract its transpose, we find that T Σ(t) = eAt E[x0 xT0 ]eA t Z tZ t T + eA(t−s1 ) E[v(s1 )v T (s2 )]eA (t−s2 ) ds1 ds2 0 0 Z t T T At = e Σ0 e A t + eA(t−s) V eA (t−s) ds. (A.5)   A X Q −(X Q )T + X Q −(X Q )T AT +(Q−QT )=0.(B.1) This equation has a unique solution (Theorem 11) directly implying that Q = QT if and only if X Q = (X Q )T . 0 Theorem 13 Assume that A is stable. Then A is Sylvester and the Lyapunov equation AX Q + X Q AT + Q = 0 has a unique solution X Q which equals (The reduction of E[v(s1 )v T (s2 )] to V δ(s1 − s2 ) is formally an application of the Itô isometry, as explained in [11].) Next, by substituting s by t − τ , we find that At Σ(t) = e Σ0 e AT t = eAt Σ0 eA T t + Z t e Aτ Ve AT τ ds XQ = (A.6) 0 V + X (t) = eAt (Σ0 − X V )eA T t (A.7) 0 Applying AX + X A + V = 0 completes the proof. +X V eA dt. (B.2) 0 Theorem 14 When A is Sylvester, X Q (t1 , t2 ) can either be found by solving the Lyapunov equation Theorem 10 For t1 < t2 we have t2 t The equation above is a Lyapunov equation with the quantity between brackets as its unique solution X Q . T T T Z ∞ i∞ h T d  At AT t  Q = − eAt QeA t =− dt e Qe dt 0 0 Z ∞  T T (B.3) AeAt QeA t + eAt QeA t AT dt =− 0Z  Z ∞  ∞ T T = −A eAt QeA t dt − eAt QeA t dt AT .     T T Σ̇(t) = A eAt (Σ0 − X V )eA t + eAt (Σ0 − X V )eA t AT   = A Σ(t) − X V + Σ(t) − X V AT  = AΣ(t) + Σ(t)AT − AX V + X V AT . (A.8) Σ(t1 , t2 ) = eAt1 (Σ0 −X V )eA eAt QeA PROOF. The assumption that A is stable directly implies that A is Sylvester and hence (Theorem 11) that X Q exists and is unique. Now we only need to prove (B.2). Because A is stable, we know that limt→∞ eAt = 0. We can hence write Q as PROOF. The derivative of (A.3) equals V ∞ + XV , Theorem 9 The expected squared value Σ(t) satisfies Σ̇(t) = AΣ(t) + Σ(t)AT + V. Z 0 where in the end we have also applied Theorem 14. V Properties of Lyapunov equation solutions T (t2 −t1 ) . (A.9) AX Q(t1 , t2 )+X Q(t1 , t2 )AT+eAt1 QeA T −eAt2 QeA t1 T Furthermore, Σ(t1 , t2 ) = Σ(t2 , t1 ) and Σ(t, t) = Σ(t). or by first finding X Q and then using X Q (t1 , t2 ) = eAt1 X Q eA PROOF. The proof is identical to that of Theorem 8. 8 T t1 − eAt2 X Q eA T t2 . T t2 =0 (B.4) (B.5) PROOF. Per definition, we have PROOF. We first prove (B.4) through it2 h T T T eAt1 QeA t1 − eAt2 QeA t2 = − eAt QeA t t1 Z t2   T d eAt QeA t dt =− dt t1 Z t2  Z t2  T T = −A eAt QeA t dt − eAt QeA t dt AT t1 Q Q t1 T = −AX (t1 , t2 ) − X (t1 , t2 )A . (A + αI)XαQ + XαQ (A + αI)T + Q = 0, (B.13) Q (B.14) Q T AX + X A + Q = 0. By subtracting the two equations, and by using Aα = A + αI, we can get either of two results A(XαQ − X Q ) + (XαQ − X Q )AT + 2αXαQ = 0, (B.15) (B.6) Aα (XαQ − X Q ) + (XαQ − X Q )ATα + 2αX Q = 0. (B.16) To prove (B.5) too, we will use Q = −AX Q − X Q AT and the matrix property eAt A = AeAt to find that  T T T eAt1 QeA t1 −eAt2 QeA t2 = −A eAt1 X Q eA t1 (B.7)    T T T −eAt2 X Q eA t2 − eAt1 X Q eA t1 −eAt2 X Q eA t2 AT . Next, we divide the above equations by 2α. The resulting Lyapunov equations have (B.12) as their solution. C Power forms of Gaussian random variables Theorem 18 Consider a Gaussian random variable x with mean µ and expected squared value Σ ≡ E[xxT ]. For symmetric matrices P and Q we have The above expression actually equals (B.4), except that the part between brackets is replaced by X Q (t1 , t2 ). Because A is Sylvester, the expression has a unique solution X Q (t1 , t2 ), which must equal the part between brackets. E[xT P xxT Qx] = tr(ΣP )tr(ΣQ) + 2tr(ΣP ΣQ) − 2µT P µµT Qµ. Theorem 15 Assume that A is Sylvester and that AC = CA. For any Q and V we then have X CQ+V = CX Q + X V . PROOF. We know from [9] (Appendix F.3) that, for symmetric P and Q, and for a zero-mean process y = x − µ with covariance Y = E[yy T ] = Σ − µµT , we have (B.8) PROOF. Per definition, AX Q + X Q AT + Q = 0 and AX V + X V AT + V = 0. Left-multiplying the first expression by C and adding it to the second gives us   A CX Q +X V + CX Q +X V AT +(CQ+V )= 0. (B.9) E[y T P yy T Qy] = tr(Y P )tr(Y Q)+2tr(Y P Y Q). (C.2) If we apply this result to the expansion of E[xT P xxT Qx] = E[(y+µ)T P (y+µ)(y+µ)T Q(y+µ)] (C.3) and rewrite the result, (C.1) follows. This is a Lyapunov equation with X CQ+V as its solution. Theorem 16 Assume that A is Sylvester. For matrices F and G satisfying AF = F A and AT G = GAT , and for any Q and V , we have   tr QF X V G = tr X̄ Q F V G . (B.10) Theorem 19 Consider Gaussian random variables x and y with joint distribution " # x (C.4) E[xT P xy T Qy] = tr(Σxx P )tr(Σyy Q) + 2tr(Σyx P Σxy Q) − 2µx T P µx µy T Qµy . (C.5) PROOF. This follows directly from Theorem 18 with Theorem 17 Assume that both A and Aα are Sylvester. Q Q For X Q , XαQ , XαX and X Xα we have Q XαQ − X Q = X Xα . 2α ∼N Also define Σab = Kab + µa µb T , where the subscripts a and b can be substituted for x and/or y. For symmetric matrices P and Q we now have  = tr (−AT X̄ Q F X V G − X̄ Q AF X V G)  = tr (−GX̄ Q F X V AT − GX̄ Q F AX V )  = tr GX̄ Q F (−X V AT − AX V )  = tr X̄ Q F V G . (B.11) Q #! " # " Kxx Kxy µx . , Kyx Kyy µy y PROOF. This is directly proven by   tr QF X V G = tr (−AT X̄ Q − X̄ Q A)F X V G XαX = (C.1) ′ x = (B.12) " # x y 9 ′ , P = " # P 0 0 0 ′ , Q = " # 0 0 0 Q . (C.6) References [1] Brian D. O. Anderson and John B. Moore. Optimal Control: Linear Quadratic Methods. Prentice Hall, 1990. [2] R.H. Bartels and G.W. Stewart. Solution of the matrix equation AX + XB = C. Communications of the ACM, 15(9):820–826, 1972. [3] Okko H. Bosgra, Huibert Kwakernaak, and Gjerrit Meinsma. Design Methods for Control Systems. Dutch Institute of Systems and Control (DISC), 2008. [4] Emmanual G. Collins and Majura F. Selekwa. Fuzzy quadratic weights for variance constrained LQG design. In Proceedings of the 38th IEEE Conference on Decision and Control, Phoenix, Arizona, USA, 1999. [5] Richard Conway and Roberto Horowitz. A quasi-Newton algorithm for LQG control design with variance constraints. In Proceedings of the Dynamic Systems and Control Conference, Ann Arbor, Michigan, USA, 2008. [6] Robbert B. Davies. Algorithm AS 155: The distribution of a linear combination of χ2 random variables. Journal of the Royal Statistical Society. Series C (Applied Statistics), 29(3):323–333, 1980. [7] Rudolf E. Kalman. A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82:35– 45, 1960. [8] Bei Kang, Chukwuemeka Aduba, and Chang-Hee Won. Statistical control for performance shaping using cost cumulants. IEEE Transactions on Automatic Control, 59(1):249–255, 2014. [9] David A. Kendrick. Stochastic Control for Economic Models. McGraw-Hill, 1981. [10] Arakaparampil M. Mathai and Serge B. Provost. Quadratic Forms in Random Variables. Taylor & Francis, 1992. [11] Bernt Øksendal. Stochastic Differential Equations. SpringerVerlag, 1985. [12] Karl J. Åström. Introduction to Stochastic Control Theory. Academic Press, 1970. [13] Stephen O. Rice. Mathematical analysis of random noise. Bell System Technical Journal, 23(3):282–332, 1944. [14] Michael K. Sain and Stanley R. Liberty. Performancemeasure densities for a class of LQG control systems. IEEE Transactions on Automatic Control, 16(5):431–439, 1971. [15] Morton I. Schwartz. Distribution of the time-average power of a Gaussian process. IEEE Transactions on Information Theory, 16(1):17–26, 1970. [16] Sigurd Skogestad and Ian Postlethwaite. Multivariable Feedback Control: Analysis and Design. John Wiley & Sons, 2005. [17] Charles F. van Loan. Computing integrals involving the matrix exponential. IEEE Transactions on Automatic Control, 23(3):395–404, 1978. [18] Niklas Wahlström, Patrix Axelsson, and Fredrik Gustafsson. Discretizing stochastic dynamical systems using Lyapunov equations. In Proceedings of the 19th IFAC World Congress, 2014. [19] Chang-Hee Won, Cheryl B. Schrader, and Anthony N. Michel. Advances in Statistical Control, Algebraic Systems Theory, and Dynamic Systems Characteristics. Birkhäuser Boston, 2008. 10
3cs.SY
Neural Network with Unbounded Activation Functions is Universal Approximator Sho Sonoda˚1 and Noboru Murata1 1 Faculty of Science and Engineering, Waseda University arXiv:1505.03654v2 [cs.NE] 29 Nov 2015 Abstract This paper presents an investigation of the approximation property of neural networks with unbounded activation functions, such as the rectified linear unit (ReLU), which is the new de-facto standard of deep learning. The ReLU network can be analyzed by the ridgelet transform with respect to Lizorkin distributions. By showing three reconstruction formulas by using the Fourier slice theorem, the Radon transform, and Parseval’s relation, it is shown that a neural network with unbounded activation functions still satisfies the universal approximation property. As an additional consequence, the ridgelet transform, or the backprojection filter in the Radon domain, is what the network learns after backpropagation. Subject to a constructive admissibility condition, the trained network can be obtained by simply discretizing the ridgelet transform, without backpropagation. Numerical examples not only support the consistency of the admissibility condition but also imply that some non-admissible cases result in low-pass filtering. 1 Introduction Consider approximating a function f : Rm Ñ C by the neural network gJ with an activation function η:RÑC gJ pxq “ J 1ÿ cj ηpaj ¨ x ´ bj q, J j paj , bj , cj q P Rm ˆ R ˆ C (1) where we refer to paj , bj q as a hidden parameter and cj as an output parameter. Let Ym`1 denote the space of hidden parameters Rm ˆ R. The network gJ can be obtained by discretizing the integral representation of the neural network ż gpxq “ Tpa, bqηpa ¨ x ´ bqdµpa, bq, (2) Ym`1 where T : Ym`1 Ñ C corresponds to a continuous version of the output parameter; µ denotes a measure on Ym`1 . The right-hand side expression is known as the dual ridgelet transform of T with respect to η ż dadb : Rη Tpxq “ Tpa, bqηpa ¨ x ´ bq . (3) }a} m`1 Y By substituting in Tpa, bq the ridgelet transform of f with respect to ψ ż Rψ f pa, bq :“ f pxqψpa ¨ x ´ bq}a}dx, (4) Rm under some good conditions, namely the admissibility of pψ, ηq and some regularity of f , we can reconstruct f by Rη: Rψ f “ f. (5) By discretizing the reconstruction formula, we can verify the approximation property of neural networks with the activation function η. ˚ [email protected] 1 In this study, we investigate the approximation property of neural networks for the case in which η is a Lizorkin distribution, by extensively constructing the ridgelet transform with respect to Lizorkin distributions. The Lizorkin distribution space S01 is such a large space that contains the rectified linear unit k (ReLU) z` , truncated power functions z` , and other unbounded functions that have at most polynomial growth (but do not have polynomials as such). Table 1 and Figure 1 give some examples of Lizorkin distributions. Table 1: Zoo of activation functions with which the corresponding neural network can approximate arbitrary functions in L1 pRm q in the sense of pointwise convergence (§ 5.2) and in L2 pRm q in the sense of mean convergence (§ 5.3). The third column indicates the space WpRq to which an activation function η belong (§ 6.1, 6.2). activation function W ηpzq unbounded functions # zk :“ 0 zą0 , zď0 truncated power function k z` rectified linear unit (ReLU) z` S01 softplus function σ p´1q pzq :“ logp1 ` ez q OM unit step function 0 z` S01 (standard) sigmoidal function σpzq :“ p1 ` e´z q´1 OM hyperbolic tangent function tanhpzq OM ` ˘ Gpzq :“ p2πq´1{2 exp ´z 2 {2 S k P N0 S01 bounded but not integrable functions bump functions (Gaussian) radial basis function the first derivative of sigmoidal function 1 σ pzq S Dirac’s δ δpzq S01 Gpkq pzq S oscillatory functions the k th derivative of RBF the k th derivative of sigmoidal function the k th derivative of Dirac’s δ σ pkq pzq δ pkq pzq S S01 0 Recall that the derivative of the ReLU z` is the step function z` . Formally, the following suggestive formula ż ż dadb dadb 1 “ , (6) Tpa, bqη pa ¨ x ´ bq Bb Tpa, bqηpa ¨ x ´ bq }a} }a} m`1 m`1 Y Y holds, because the integral representation is a convolution in b. This formula suggests that once we have Tstep pa, bq for the step function, which is implicitly known to exist based on some of our preceding studies [1, 2], then we can formally obtain TReLU pa, bq for the ReLU by differentiating TReLU pa, bq “ Bb Tstep pa, bq. 1.1 ReLU and Other Unbounded Activation Functions The ReLU [3, 4, 5, 6] became a new building block of deep neural networks, in the place of traditional bounded activation functions such as the sigmoidal function and the radial basis function (RBF). Compared with traditional units, a neural network with the ReLU is said [3, 7, 8, 9, 6] to learn faster because it has larger gradients that can alleviate the vanishing gradient [3], and perform more efficiently because it extracts sparser features. To date, these hypotheses have only been empirically verified without analytical evaluation. It is worth noting that in approximation theory, it was already shown in the 1990s that neural networks with such unbounded activation functions have the universal approximation property. To be precise, if the activation function is not a polynomial function, then the family of all neural networks is dense in some 2 Figure 1: Zoo of activation functions: the Gaussian Gpzq (red), the first derivative G1 pzq (yellow), the 2 second derivative G2 pzq (green); a truncated power function z` (blue), the ReLU z` (sky blue), the unit 0 step function z` (rose). functional spaces such as Lp pRm q and C 0 pRm q. Mhaskar and Micchelli [10] seem to be the first to have shown such universality by using the B-spline. Later, Leshno et al. [11] reached a stronger claim by using functional analysis. Refer to Pinkus [12] for more details. In this study, we initially work through the same statement by using harmonic analysis, or the ridgelet transform. One strength is that our results are very constructive. Therefore, we can construct what the network will learn during backpropagation. Note that for bounded cases this idea is already implicit in [13] and [2], and explicit in [14]. 1.2 Integral Representation of Neural Network and Ridgelet Transform We use the integral representation of neural networks introduced by Murata [1]. As already mentioned, the integral representation corresponds to the dual ridgelet transform. In addition, the ridgelet transform corresponds to the composite of a wavelet transform after the Radon transform. Therefore, neural networks have a profound connection with harmonic analysis and tomography. As Kůrková [15] noted, the idea of discretizing integral transforms to obtain an approximation is very old in approximation theory. As for neural networks, at first, Carroll and Dickinson [16] and Ito [13] regarded a neural network as a Radon transform [17]. Irie and Miyake [18], Funahashi [19], Jones [20], and Barron [21] used Fourier analysis to show the approximation property in a constructive way. Kůrková [15] applied Barron’s error bound to evaluate the complexity of neural networks. Refer to Kainen et al. [22] for more details. In the late 1990s, Candès [23, 24], Rubin [25], and Murata [1] independently proposed the so-called ridgelet transform, which has since been investigated by a number of authors [26, 27, 28, 29, 30, 31]. 3 1.3 Variations of Ridgelet Transform A ridgelet transform Rψ , along with its reconstruction property, is determined by four classes of functions: domain X pRm q, range YpYm`1 q, ridgelet ZpRq, and dual ridgelet WpRq. ψ P ZpRq Rψ $ T P YpYm`1 q X pRm q Q f d (7) Rη: η P WpRq The following ladder relations by Schwartz [32] are fundamental for describing the variations of the ridgelet transform: pfunctionsq D X Ă S Ă DL1 X Ă X 1 pdistributionsq E 1 Ă OC1 Ă DL 1 loooooooooooooomoooooooooooooon integrable DLp X Ă Ă OM X Ă E X 1 DL Ă S 1 Ă D1 p looooooooooooooomooooooooooooooon not always bounded , (8) where the meaning of symbols are given below in Table 2. The integral transform T by Murata [1] coincides with the case for Z Ă D and W Ă E X L1 . Candès [23, 24] proposed the “ridgelet transform” for Z “ W Ă S. Kostadinova et al. [30, 31] defined the ridgelet transform for the Lizorkin distributions X “ S01 , which is the broadest domain ever known, at the cost of restricting the choice of ridgelet functions to the Lizorkin functions W “ Z “ S0 Ă S. 1.4 Our Goal Although many researchers have investigated the ridgelet transform [26, 29, 30, 31], in all the settings Z does not directly admit some fundamental activation functions, namely the sigmoidal function and the ReLU. One of the challenges we faced is to define the ridgelet transform for W “ S01 , which admits the sigmoidal function and the ReLU. 2 2.1 Preliminaries Notations Throughout this paper, we consider approximating f : Rm Ñ C by a neural network g with hidden parameters pa, bq. Following Kostadinova et al. [30, 31], we denote by Ym`1 :“ Rm ˆ R the space of parameters pa, bq. As already denoted, we symbolize the domain of a ridgelet transform as X pRm q, the range as YpYm`1 q, the space of ridgelets as ZpRq, and the space of dual ridgelets as WpRq. We denote by Sm´1 the pm´1q-sphere tu P Rm | }u} “ 1u; by R` the open half-line tα P R | α ą 0u; by H the open half-space R` ˆ R. We denote by N and N0 the sets of natural numbers excluding 0 and including 0, respectively. We denote by r̈ the reflection frpxq :“ f p´xq; by ¨ the complex conjugate; by a À b that there exists a constant C ě 0 such that a ď Cb. 2.2 Class of Functions and Distributions Following Schwartz, we denote the classes of functions and distributions as in Table 2. For Schwartz’s distributions, we refer to Schwartz [32] and Trèves [33]; for Lebesgue spaces, Rudin [34], Brezis [35] and Yosida [36]; for Lizorkin distributions, Yuan et al. [37] and Holschneider [38]. The space S0 pRk q of Lizorkin functions is a closed subspace of SpRk q that consists of elements such that ş k k α all moments vanish. That is, S0 pR q :“ tφ P SpR q | Rk x φpxqdx “ 0 for any α P Nk0 u. The dual space S01 pRk q, known as the Lizorkin distribution space, is homeomorphic to the quotient space of S 1 pRk q by the space of all polynomials PpRk q. That is, S01 pRk q – S 1 pRk q{PpRk q. Refer to Yuan et al. [37, Prop. 8.1] 4 Table 2: Classes of functions and distributions, and corresponding dual spaces. space ApRk q dual space polynomials of all degree PpRk q – smooth functions EpRk q compactly supported distributions E 1 pRk q rapidly decreasing functions SpRk q tempered distributions S 1 pRk q compactly supported smooth functions DpRk q Schwartz distributions D1 pRk q Lp of Sobolev order 8 p1 ď p ă 8q DLp pRk q Schwartz dists. p1{p ` 1{q “ 1q 1 k DL q pR q completion of DpRk q in DL8 pRk q 9 kq BpR Schwartz dists. pp “ 1q 1 k DL 1 pR q slowly increasing functions OM pRk q – – S0 pRk q Lizorkin functions A1 pRk q rapidly decreasing distributions OC1 pRk q Lizorkin distributions S01 pRk q for more details. In this work we identify and treat every polynomial as zero in the Lizorkin distribution. That is, for p P S 1 pRk q, if p P PpRk q then p ” 0 in S01 pRk q. For Sm´1 , we work on the two subspaces DpSm´1 q Ă DpRm q and E 1 pSm´1 q Ă E 1 pRm q. In addition, we 1 1 identify D “ S “ OM “ E and E 1 “ OC1 “ S 1 “ DL p “ D . 2 2 For H, let EpHq Ă EpR q and DpHq Ă DpR q. For T P EpHq, write s 2 t{2 k ` Dk,` Bα Bβ Tpα, βq, s,t Tpα, βq :“ pα ` 1{αq p1 ` β q s, t, k, ` P N0 . The space SpHq consists of T P EpHq such that for any s, t, k, ` P N0 , the seminorm below is finite ˇ ˇ ˇ sup ˇDk,` s,t Tpα, βq ă 8. (9) (10) pα,βqPH The space OM pHq consists of T P EpHq such that for any k, ` P N0 there exist s, t P N0 such that ˇ k,` ˇ ˇD Tpα, βqˇ À pα ` 1{αqs p1 ` β 2 qt{2 . 0,0 (11) The space D1 pHq consists of all bounded linear functionals Φ on DpHq such that for every compact set K Ă H, there exists N P N0 such that ˇż ˇ ˇ ÿ dαdβ ˇˇ ˇ sup |Dk,` @T P DpKq, (12) ˇ Tpα, βqΦpα, βq ˇÀ 0,0 Tpα, βq|, ˇ K α ˇ pα,βqPH k,`ďN where the integral is understood as the action of Φ. The space S 1 pHq consists of Φ P SpHq for which there exists N P N0 such that ˇ ˇż ˇ ÿ ˇ ˇ dαdβ ˇˇ ˇ ˇ @T P SpHq. sup ˇDk,` (13) ˇÀ ˇ Tpα, βqΦpα, βq s,t Tpα, βq , ˇ H α ˇ pα,βqPH s,t,k,`ďN 2.3 Convolution of Distributions Table 3 lists the convergent convolutions of distributions and their ranges by Schwartz [32]. In general a convolution of distributions may neither commute φ ˚ ψ ‰ ψ ˚ φ nor associate φ ˚ pψ ˚ ηq ‰ pφ ˚ ψq ˚ η. According to Schwartz [32, Ch.6 Th.7, Ch.7 Th.7], both D1 ˚ E 1 ˚ E 1 ˚ ¨ ¨ ¨ and S 1 ˚ OC1 ˚ OC1 ˚ ¨ ¨ ¨ are commutative and associative. 2.4 Fourier Analysis The Fourier transform p̈ of f : Rm Ñ C and the inverse Fourier transform q̈ of F : Rm Ñ C are given by ż p f pξq :“ f pxqe´ix¨ξ dx, ξ P Rm (14) Rm ż 1 F pξqeix¨ξ dξ, x P Rm . (15) Fqpxq :“ p2πqm Rm 5 Table 3: Range of convolution (excerpt from Schwartz [32]) case A1 A2 A1 ˚ A2 regularization D 1 1 D1 , DL p, E E, Lp , D compactly supported distribution E1 E 1 , E, D1 E 1 , E, D1 regularization S S, S 1 S, OM Schwartz convolutor OC1 1 1 S, OC1 , DL p, S 1 1 S, OC1 , DL p, S Young’s inequality Lp Lq Lr p1{r “ 1{p ` 1{q ´ 1q Young’s inequality 1 DL p 1 DLq , DL q 1 DL r p1{r “ 1{p ` 1{q ´ 1q The Hilbert transform H of f : R Ñ C is given by ż8 i f ptq Hf psq :“ p.v. dt, s P R π s ´8 ´ t ş8 where p.v. ´8 denotes the principal value. We set the coefficients above to satisfy ypωq “ sgn ω ¨ fppωq, Hf 2 H f psq “ f psq. 2.5 (16) (17) (18) Radon Transform The Radon transform R of f : Rm Ñ C and the dual Radon transform R˚ of Φ : Sm´1 ˆ R Ñ C are given by ż Rf pu, pq :“ f ppu ` yqdy, pu, pq P Sm´1 ˆ R (19) pRuqK ż R˚ Φpxq :“ Φpu, u ¨ xqdu, x P Rm (20) Sm´1 where pRuq :“ ty P R | y ¨ u “ 0u denotes the orthogonal complement of a line Ru Ă Rm ; and dy denotes the Lebesgue measure on pRuqK ; and du denotes the surface measure on Sm´1 . We use the following fundamental results ([17, 39]) for f P L1 pRm q without proof: Radon’s inversion formula K m R˚ Λm´1 Rf “ 2p2πqm´1 f, where the backprojection filter Λm is defined in (24); the Fourier slice theorem ż fppωuq “ Rf pu, pqe´ipω dp, pu, ωq P Sm´1 ˆ R (21) (22) R where the left-hand side is the m-dimensional Fourier transform, whereas the right-hand side is the onedimensional Fourier transform of the Radon transform; and a corollary of Fubini’s theorem ż ż Rf pu, pqdp “ f pxqdx, a.e. u P Sm´1 . (23) R 2.6 Rm Backprojection filter For a function Φpu, pq, we define the backprojection filter Λm as $ & B m Φpu, pq, m even p Λm Φpu, pq :“ % H B m Φpu, pq, m odd. p p (24) where Hp and Bp denote the Hilbert transform and the partial differentiation with respect to p, respectively. It is designed as a one-dimensional Fourier multiplier with respect to p Ñ ω such that m Φpu, ωq “ im |ω|m Φpu, z p Λ ωq. 6 (25) 3 Classical Ridgelet Transform 3.1 An Overview The ridgelet transform Rψ f of f : Rm Ñ C with respect to ψ : R Ñ C is formally given by ż Rψ f pa, bq :“ f pxqψpa ¨ x ´ bq}a}s dx, pa, bq P Ym`1 and s ą 0. (26) Rm The factor |a|s is simply posed for technical convenience. After the next section we set s “ 1, which simplifies some notations (e.g., Theorem 4.2). Murata [1] originally posed s “ 0, which is suitable for the Euclidean formulation. Other authors such as Candès [24] used s “ 1{2, Rubin [25] used s “ m, and Kostadinova et al. [30] used s “ 1 . When f P L1 pRm q and ψ P L8 pRq, by using Hölder’s inequality, the ridgelet transform is absolutely convergent at every pa, bq P Ym`1 . ż ˇ ˇ ˇf pxqψpa ¨ x ´ bq}a}s ˇdx ď }f }L1 pRm q ¨ }ψ}L8 pRq ¨ }a}s ă 8. (27) Rm In particular when s “ 0, the estimate is independent of a and thus Rψ f P L8 pYm`1 q. Furthermore, R is a bounded bilinear operator L1 pRm q ˆ L8 pRq Ñ L8 pYm`1 q. The dual ridgelet transform Rη: T of T : Ym`1 Ñ C with respect to η : R Ñ C is formally given by ż Rη: Tpxq :“ Tpa, bqηpa ¨ x ´ bq}a}´s dadb, x P Rm . (28) Ym`1 The integral is absolutely convergent when η P L8 pRq and T P L1 pYm`1 ; }a}´s dadbq at every x P Rm , ż ˇ ˇ ˇTpa, bqηpa ¨ x ´ bqˇ}a}´s dadb ď }T}L1 pYm`1 ;}a}´s dadbq ¨ }η}L8 pRq ă 8, (29) Ym`1 and thus R : is a bounded bilinear operator L1 pYm`1 ; }a}´s dadbq ˆ L8 pRq Ñ L8 pRm q. Two functions ψ and η are said to be admissible when Kψ,η :“ p2πqm´1 ż8 p η pζq ψpζqp dζ, |ζ|m ´8 (30) is finite and not zero. Provided that ψ, η, and f belong to some good classes, and ψ and η are admissible, then the reconstruction formula Rη: Rψ f “ Kη,ψ f, (31) holds. 3.2 Ridgelet Transform in Other Expressions It is convenient to write the ridgelet transform in “polar” coordinates as ˆ ż Rψ f pu, α, βq “ f pxqψ Rm u¨x´β α ˙ 1 dx, αs (32) where “polar” variables are given by u :“ a{}a}, α :“ 1{}a}, β :“ b{}a}. (33) Emphasizing the connection with wavelet analysis, we define the “radius” α as reciprocal. Provided there is no likelihood of confusion, we use the same symbol Ym`1 for the parameter space, regardless of whether it is parametrized by pa, bq P Rm ˆ R or pu, α, βq P Sm´1 ˆ R` ˆ R. For a fixed pu, α, βq P Ym`1 , the ridgelet function ˆ ˙ u¨x´β 1 ψu,α,β pxq :“ ψ , x P Rm (34) α αs 7 behaves as a constant function on pRuqK , and as a dilated and translated wavelet function on Ru. That is, by using the orthogonal decomposition x “ pu ` y with p P R and y P pRuqK , ˆ ˆ ˙ ˙ p´β 1 u ¨ ppu ` yq ´ β 1 “ ψ b 1pyq. (35) ψu,α,β pxq “ ψ α αs α αs By using the decomposition above and Fubini’s theorem, and assuming that the ridgelet transform is absolutely convergent, we have the following equivalent expressions ¸ ˆ ˙ ż ˜ż p´β 1 dp (36) Rψ f pu, α, βq “ f ppu ` yqdy ψ α αs R pRuqK ˆ ˙ ż p´β 1 “ Rf pu, pq ψ dp (37) α αs żR “ α1´s Rf pu, αz ` βq ψpzqdz (weak form) (38) R ¯ ´ ¯ ´ Ăα pβq, ψα ppq :“ ψ p 1 “ Rf pu, ¨q ˚ ψ α αs ż 1 1´s iωβ p “ fppωuqψpαωqα e dω, 2π R (convolution form) (39) (Fourier slice th. [30]) (40) where R denotes the Radon transform (19); the Fourier form follows by applying the identity Fω´1 Fp “ Id to the convolution form. These reformulations reflect a well-known claim [28, 30] that ridgelet analysis is wavelet analysis in the Radon domain. 3.3 Dual Ridgelet Transform in Other Expressions Provided the dual ridgelet transform (28) is absolutely convergent, some changes of variables lead to other expressions. ż ż Rη: Tpxq “ Tpa, bqηpa ¨ x ´ bq}a}´s db da (41) m R R ż8ż ż “ Tpru, bqηpru ¨ x ´ bqdb du rm´s´1 dr (42) 0 Sm´1 R ˙ ˆ ˙ ˆ ż ż8ż u ¨ x ´ β dβdαdu u β “ , η (polar expression) (43) T α α α αm´s`2 Sm´1 0 R ż ż8ż dzdαdu (weak form) (44) “ T pu, α, u ¨ x ´ αzq ηpzq m´s`1 , α Sm´1 0 R where every integral is understood to be an iterated integral; the second equation follows by substituting pr, uq Ð p}a}, a{}a}q and using the coarea formula for polar coordinates; the third equation follows by substituting pα, βq Ð p1{r, b{rq and using Fubini’s theorem; in the fourth equation with a slight abuse of notation, we write Tpu, α, βq :“ Tpu{α, β{αq. Furthermore, write ηα ppq :“ ηpp{αq{αt . Recall that Radon transform R˚ is given by (20) and ş8 the dual z´1 the Mellin transform M [38] is given by Mf pzq :“ 0 f pαqα dα, z P C. Then, Rη: Tpxq “ R˚ rMrTpu, α, ¨q ˚ ηα sps ` t ´ m ´ 1qs pxq. (45) Note that the composition of the Mellin transform and the convolution is the dual wavelet transform [38]. Thus, the dual ridgelet transform is the composition of the dual Radon transform and the dual wavelet transform. 4 Ridgelet Transform with respect to Distributions Using the weak expressions (38) and (44), we define the ridgelet transform with respect to distributions. Henceforth, we focus on the case for which the index s in (26) equals 1. 8 4.1 Definition and Well-Definedness Definition 4.1 (Ridgelet Transform with respect to Distributions). The ridgelet transform Rψ f of a function f P X pRm q with respect to a distribution ψ P ZpRq is given by ż (46) Rψ f pu, α, βq :“ Rf pu, αz ` βq ψpzqdz, pu, α, βq P Ym`1 R where ş R ¨ ψpzqdz is understood as the action of a distribution ψ. Obviously, this “weak” definition coincides with the ordinary strong one when ψ coincides with a locally integrable function pL1loc q. With a slight abuse of notation, the weak definition coincides with the convolution form ¯ ´ Ăα pβq, pu, α, βq P Ym`1 (47) Rψ f pu, α, βq “ Rf pu, ¨q ˚ ψ where ψα ppq :“ ψ pp{αq {α; the convolution ¨ ˚ ¨, dilation ¨α , reflection r̈, and complex conjugation ¨ are understood as operations for Schwartz distributions. Theorem 4.2 (Balancing Theorem). The ridgelet transform R : X pRm q ˆ ZpRq Ñ YpYm`1 q is well defined as a bilinear map when X and Z are chosen from Table 4. Table 4: Combinations of classes for which the ridgelet transform is well defined as a bilinear map. The first and third columns list domains X pRm q of f and ZpRq of ψ, respectively. The second column lists the range of the Radon transform Rf pu, pq for which we reused the same symbol X as it coincides. The fourth, fifth, and sixth columns list the range of the ridgelet transform with respect to β, pα, βq, and pu, α, βq, respectively. Rψ f pu, α, βq f pxq Rf pu, pq ψpzq X pRm q X pSm´1 ˆ Rq ZpRq BpRq ApHq YpYm`1 q D D D1 E E E 1 1 1 E E D D S1 S S OC1 OC1 S L1 L1 Lp X C 0 1 DL 1 1 DL 1 1 DL p 1 1 D 1 D1 OM OM 1 1 S1 Lp X C 0 S1 S1 1 DL p S1 S1 S S OM The proof is provided in A. Note that each Z is (almost) the largest in the sense that the convolution B “ X ˚ Z converges. Thus, Table 4 suggests that there is a trade-off relation between X and Z, that is, as X increases, Z decreases and vice versa. Extension of the ridgelet transform of non-integrable functions requires more sophisticated approaches, because a direct computation of the Radon transform may diverge. For instance, Kostadinova et al. [30] extend X “ S01 by using a duality technique. In § 5.3 we extend the ridgelet transform to L2 pRm q, by using the bounded extension procedure. Proposition 4.3 (Continuity of the Ridgelet Transform L1 pRm q Ñ L8 pYm`1 q). Fix ψ P SpRq. The ridgelet transform Rψ : L1 pRm q Ñ L8 pYm`1 q is bounded. Proof. Fix an arbitrary f P L1 pRm q and ψ P SpRq. Recall that this case is absolutely convergent. By using the convolution form, ˇ´ ˇ ¯ ˇ Ăα pβqˇˇ ď }f }L1 pRm q ¨ ess sup |ψα pβq| (48) ess sup ˇ Rf pu, ¨q ˚ ψ pu,α,βq pα,βq ď }f }L1 pRm q ¨ ess sup |r ¨ ψprβq| ă 8, (49) pr,βq ş where the first inequality follows by using Young’s inequality and applying R |Rf pu, pq|dp “ }f }1 ; the second inequality follows by changing the variable r Ð 1{α, and the resultant is finite because ψ decays rapidly. 9 The ridgelet transform Rψ is injective when ψ is admissible, because if ψ is admissible then the reconstruction formula holds and thus Rψ has the inverse. However, Rψ is not always injective. For instance, take a Laplacian f :“ ∆g of some function g P SpRm q and a polynomial ψpzq “ z ` 1, which satisfies ψ p2q ” 0. According to Table 4, Rψ f exists as a smooth function because f P SpRm q and ψ P S 1 pRq. In this case Rψ f “ 0, which means Rψ is not injective. That is, ¯ ´ Ăα pβq (50) Rψ f pu, α, βq “ R∆gpu, ¨q ˚ ψ ´ ¯ Ăα pβq (51) “ B 2 Rgpu, ¨q ˚ ψ ´ ¯ Ăα pβq “ Rgpu, ¨q ˚ B 2 ψ (52) “ pRgpu, ¨q ˚ 0q pβq (53) “ 0, (54) where the second equality follows by the intertwining relation R∆gpu, pq “ Bp2 Rgpu, pq [17]. Clearly the non-injectivity stems from the choice of ψ. In fact, as we see in the next section, no polynomial can be admissible and thus Rψ is not injective for any polynomial ψ. 4.2 Dual Ridgelet Transform with respect to Distributions Definition 4.4 (Dual Ridgelet Transform with respect to Distributions). The dual ridgelet transform Rη: T of T P YpYm`1 q with respect to η P WpRq is given by ż żδż Rη: Tpxq “ lim δÑ8 Sm´1 εÑ0 where ş R T pu, α, u ¨ x ´ αzq ηpzq ε R dzdαdu , αm x P Rm (55) ¨ηpzqdz is understood as the action of a distribution η. If the dual ridgelet transform Rη: exists, then it coincides with the dual operator [36] of the ridgelet transform Rη . Theorem 4.5. Let X and Z be chosen from Table 4. Fix ψ P Z. Assume that Rψ : X pRm q Ñ YpYm`1 q is injective and that Rψ: : Y 1 pYm`1 q Ñ X 1 pRm q exists. Then Rψ: is the dual operator pRψ q1 : Y 1 pYm`1 q Ñ X 1 pRm q of Rψ . Proof. By assumption Rψ is densely defined on X pRm q and injective. Therefore, by a classical result on the existence of the dual operator [36, VII. 1. Th. 1, pp.193], there uniquely exists a dual operator pRψ q1 : Y 1 pYm`1 q Ñ X 1 pRm q. On the other hand, for f P X pRm q and T P YpYm`1 q, ż A E xRψ f, TyYm`1 “ f pxqψpa ¨ x ´ bqTpa, bqdxdadb “ f, Rψ: T m . (56) R Rm ˆYm`1 By the uniqueness of the dual operator, we can conclude pRψ q1 “ Rψ: . 5 Reconstruction Formula for Weak Ridgelet Transform In this section we discuss the admissibility condition and the reconstruction formula, not only in the Fourier domain as many authors did [23, 24, 1, 30, 31], but also in the real domain and in the Radon domain. Both domains are key to the constructive formulation. In § 5.1 we derive a constructive admissibility condition. In § 5.2 we show two reconstruction formulas. The first of these formulas is obtained by using the Fourier slice theorem and the other by using the Radon transform. In § 5.3 we will extend the ridgelet transform to L2 . 5.1 Admissibility Condition Definition 5.1 (Admissibility Condition). A pair pψ, ηq P SpRq ˆ S 1 pRq is said to be admissible when there exists a neighborhood Ω Ă R of 0 such that ηp P L1loc pΩzt0uq, and the integral ˜ż ż ¸ p η pζq ψpζqp Kψ,η :“ p2πqm´1 ` dζ, (57) m |ζ| Ωzt0u RzΩ 10 converges and is not zero, where ηp, respectively. ş Ωzt0u and ş RzΩ are understood as Lebesgue’s integral and the action of Using the Fourier transform in W requires us to assume that W Ă S 1 . ş p decays rapidly; The second integral RzΩ is always finite because |ζ|´m P OM pRzΩq and thus |ζ|´m ψpζq therefore, by şdefinition the action of a tempered distribution ηp always converges. The convergence of the first integral Ωzt0u does not depend on the choice of Ω because for every two neighborhoods Ω and Ω1 of ş 0, the residual ΩzΩ1 is always finite. Hence, the convergence of Kψ,η does not depend on the choice of Ω. The removal of 0 from the integral is essential because a product of two singular distributions, which is indeterminate in general, can occur at 0. See examples below. In C, we have to treat |ζ|´m as a locally integrable function, rather than simply a regularized distribution ş ş such as Hadamard’s finite part. If the integrand coincides with a function at 0, then obviously Rzt0u “ R . If ηp is supported in the singleton t0u then η cannot be admissible because Kψ,η “ 0 for any ψ P SpRq. According to Rudin [34, Ex. 7.16], it happens if and only if η is a polynomial. Therefore, it is natural to take W “ S 1 {P – S01 rather than W “ S 1 . That is, in S01 pRq, we identify a polynomial η P PpRq as 0 P S 1 pRq. The integral Kψ,η is well-defined for S01 pRq. Namely Kψ,η is invariant under the addition of a polynomial Q to η Kψ,η “ Kψ,η`Q . (58) Example 5.2 (Modification of Schwartz [32, Ch.5 Th.6]). Let ηpzq “ z and ψpzq “ ΛGpzq with Gpzq “ expp´z 2 {2q. Then, ηppζq “ δpζq and p ψpζq “ |ζ| ¨ Gpζq. In this case the product of the two distributions is not associative ż 1 p.v. ˆ p|ζ| ¨ Gpζq ˆ δpζqq dζ “ 0, |ζ| R ˆ ˙ ż 1 p.v. ˆ |ζ| ¨ Gpζq ˆ δpζqdζ “ Gp0q ‰ 0. |ζ| R On the other hand (57) is well defined ż ż |ζ| ¨ Gpζq ˆ 0 |ζ| ¨ Gpζq Kψ,η “ dζ ` δpζqdζ “ 0. |ζ| |ζ| 0ă|ζ|ă1 1ď|ζ| (59) (60) (61) (62) 0 Example 5.3. Let ηpzq “ z` ` p2πq´1 exp iz and ψpzq “ ΛGpzq. Then, ηppζq “ i ` δpζq ` δpζ ´ 1q ζ and p ψpζq “ |ζ| ¨ Gpζq. The product of the two distributions is not associative ˆ ˆ ˙˙ ż 1 i ˆ |ζ| ¨ Gpζq ˆ ` δpζq ` δpζ ´ 1q dζ “ Gp1q, p.v. |ζ| ζ R ˙ ˆ ˙ ż ˆ 1 i p.v. ˆ |ζ| ¨ Gpζq ˆ ` δpζq ` δpζ ´ 1q dζ “ Gp0q ` Gp1q ‰ 0. |ζ| ζ R (63) (64) (65) On the other hand, (57) is well defined ˆ ˙ ż ż |ζ| ¨ Gpζq i |ζ| ¨ Gpζq ˆ iζ ´1 Kψ,η “ dζ ` p.v. ` δpζq ` δpζ ´ 1q dζ “ 8 ` Gp1q. (66) |ζ| |ζ| ζ 0ă|ζ|ă1 1ď|ζ| p η pζq|ζ|´m is a solution of |ζ|m u p η pζq. By ppζq “ ψpζqp Observe that formally the integrand u ppζq :“ ψpζqp m r taking the Fourier inversion, we have Λ u “ ψ ˚ η. To be exact, ηp may contain a point mass at the origin, such as Dirac’s δ. 11 Theorem 5.4. (Structure Theorem for Admissible Pairs) Let pψ, ηq P SpRq ˆ S 1 pRq. Assume that there exists k P N0 such that ηppζq “ k ÿ cj δ pjq pζq, ζ P t0u. (67) j“0 Assume that there exists a neighborhood Ω of 0 such that ηp P C 0 pΩzt0uq. Then ψ and η are admissible if and only if there exists u P OM pRq such that ¸ ˜ ż k ÿ m j r u ppζqdζ ‰ 0, (68) and Λ u“ψ˚ η´ cj z Rzt0u j“0 where Λ is the backprojection filter defined in (24). In addition, limζÑ`0 |p upζq| ă 8 and limζÑ´0 |p upζq| ă 8. The proof is provided in B. ş Note that the continuity implies local integrability. If ψ has ` vanishing moments with ` ě k, namely R ψpzqz j dz “ 0 for j ď `, then the condition reduces to ˇ ˇż ż ˇ ˇ ˇ ˇ m r u ppζqdζ ‰ 0. (69) Λ u “ ψ ˚ η, ˇ upzqdz ˇ ă 8 and ˇ ˇ R R As a consequence of Theorem 5.4, we can construct admissible pairs as below. Corollary 5.5 (Construction of Admissible Pairs). Given η P S01 pRq. Assume that there exists a neighborhood Ω of 0 and k P N0 such that ζ k ¨ ηppζq P C 0 pΩq. Take ψ0 P SpRq such that ż x0 pζqp η pζqdζ ‰ 0. (70) ζk ψ R Then pkq ψ :“ Λm ψ0 , (71) is admissible with η. Ą pkq The proof is obvious because u :“ ψ0 ˚ η satisfies the conditions in Theorem 5.4. 5.2 Reconstruction Formula Theorem 5.6 (Reconstruction Formula). Let f P L1 pRm q satisfy fp P L1 pRm q and let pψ, ηq P SpRqˆS01 pRq be admissible. Then the reconstruction formula Rη: Rψ f pxq “ Kψ,η f pxq, (72) holds for almost every x P Rm . The equality holds for every point where f is continuous. The proof is provided in C. The admissibility condition can be easily inverted to pψ, ηq P S01 ˆ S. However, extensions to S01 ˆ S01 and S ˆ D1 may not be easy. This is because the multiplication S01 ¨ S01 is not always commutative, nor associative, and the Fourier transform is not always defined over D1 [32]. The following theorem is another suggestive reconstruction formula that implies wavelet analysis in the Radon domain works as a backprojection filter. In other words, the admissibility condition requires pψ, ηq to construct the filter Λm . Note that similar techniques are obtained for “wavelet measures” by Rubin [29, 25]. Theorem 5.7 (Reconstruction Formula via Radon Transform). Let f P L1 pRm q be sufficiently smooth and pψ, ηq P SpRq ˆ S 1 pRq be admissible. Assume that there exists a real-valued smooth and integrable function u such that ż u ppζqdζ “ ´1. (73) Λm u “ ψr ˚ η and R Then, Rη: Rψ f pxq “ R˚ Λm´1 Rf pxq “ 2p2πqm´1 f pxq, holds for almost every x P Rm . 12 (74) The proof is provided in D. Note that here we imposed a stronger condition on u than the u P L1 pRzt0uq we imposed in Theorem 5.4. Recall intertwining relations ([17, Lem.2.1, Th.3.1, Th.3.7]) p´∆q m´1 2 R˚ “ Λm´1 R, and Rp´∆q m´1 2 “ R˚ Λm´1 . (75) Therefore, we have the following. Corollary 5.8. Rη: Rψ “ R˚ Λm´1 R “ p´∆q 5.3 m´1 2 R˚ R “ R˚ Rp´∆q m´1 2 . (76) Extension to L2 By p¨, ¨q and } ¨ }2 , with a slight abuse of notation, we denote the inner product of L2 pRm q and L2 pYm`1 q. Here we endow Ym`1 with a fixed measure α´m dαdβdu, and omit writing it explicitly as L2 pYm`1 ; . . . q. We say that ψ is self-admissible if ψ is admissible in itself, i.e. the pair pψ, ψq is admissible. The following relation is immediate by the duality. Theorem 5.9 (Parseval’s Relation and Plancherel’s Identity). Let pψ, ηq P S ˆ S 1 be admissible with, for simplicity, Kψ,η “ 1. For f, g P L1 X L2 pRm q, ` ˘ pRψ f, Rη gq “ Rη: Rψ f, g “ pf, gq . Parseval’s Relation (77) In particular, if ψ is self-admissible, then }Rψ f }2 “ }f }2 . Plancherel’s identity (78) Recall Proposition 4.3 that the ridgelet transform is a bounded linear operator on L1 pRm q. If ψ P SpRq is self-admissible, then we can extend the ridgelet transform to L2 pRm q, by following the bounded extension procedure [40, 2.2.4]. That is, for f P L2 pRm q, take a sequence fn P L1 X L2 pRm q such that fn Ñ f in L2 . Then by Plancherel’s identity, }fn ´ fm }2 “ }Rψ fn ´ Rψ fm }2 , @n, m P N. (79) The right-hand side is a Cauchy sequence in L2 pYm`1 q as n, m Ñ 8. By the completeness, there uniquely exists the limit T8 P L2 pYm`1 q of Rψ fn . We regard T8 as the ridgelet transform of f and define Rψ f :“ T8 . Theorem 5.10 (Bounded Extension of Ridgelet Transform on L2 ). Let ψ P SpRq be self-admissible with Kψ,ψ“1 . The ridgelet transform on L1 X L2 pRm q admits a unique bounded extension to L2 pRm q, with satisfying }Rψ f }2 “ }f }2 . We say that pψ, ηq and pψ ‹ , η ‹ q are equivalent, if two admissible pairs pψ, ηq and pψ ‹ , η ‹ q define the Ă‹ ˚ η ‹ in common. If pψ, ηq and pψ ‹ , η ‹ q are equivalent, then obviously same convolution ψr ˚ η “ ψ pRψ f, Rη gq “ pRψ‹ f, Rη‹ gq . (80) We say that an admissible pair pψ, ηq is admissibly decomposable, when there exist self-admissible pairs pψ ‹ , ψ ‹ q and pη ‹ , η ‹ q such that pψ ‹ , η ‹ q is equivalent to pψ, ηq. If pψ, ηq is admissibly decomposable with pψ ‹ , η ‹ q, then by the Schwartz inequality pRψ f, Rη gq ď }Rψ‹ f }2 }Rη‹ g}2 . (81) Theorem 5.11 (Reconstruction Formula in L2 ). Let f P L2 pRm q and pψ, ηq P S ˆ S 1 be admissibly decomposable with Kψ,η “ 1. Then, Rη: Rψ f Ñ f, in L2 . (82) The proof is provided in E. Even when ψ is not self-admissible and thus Rψ cannot be defined on L2 pRm q, the reconstruction operator Rη: Rψ can be defined with the aid of η. 13 6 Neural Network with Unbounded Activation Functions In this section we instantiate the universal approximation property for the variants of neural networks. Recall that a neural network coincides with the dual ridgelet transform of a function. Henceforth, we rephrase a dual ridgelet function as an activation function. According to the reconstruction formulas (Theorem 5.6, 5.7, and 5.11), we can determine whether a neural network with an activation function η is a universal approximator by checking the admissibility of η. Table 1 lists some Lizorkin distributions for potential activation functions. In § 6.1 we verify that they belong to S01 pRq and some of them belong to OM pRq and SpRq, which are subspaces of S01 pRq. In § 6.2 we show that they are admissible with some ridgelet function ψ P SpRq; therefore, each of their corresponding neural networks is a universal approximator. 6.1 Examples of Lizorkin Distributions We proved the class properties by using the following propositions. Proposition 6.1 (Tempered Distribution S 1 pRq [40, Ex. 2.3.5]). Let g P L1loc pRq. If |gpzq| À p1 ` |z|qk for some k P N0 , then g P S 1 pRq. Proposition 6.2 (Slowly Increasing Function OM pRq [40, Def. 2.3.15]). Let g P EpRq. If for any α P N0 , |B α gpxq| À p1 ` |z|qkα for some kα P N0 , then g P OM pRq. k Example 6.3. Truncated power functions z` pk P N0 q, which contain the ReLU z` and the step function 1 0 z` , belong to S0 pRq. k k P S01 pRq. q| ď C` p1`|z|qk´` . Hence, z` Proof. For any ` P N0 there exists a constant C` such that |B ` pz` Example 6.4. The sigmoidal function σpzq and the softplus σ p´1q pzq belong to OM pRq. The derivatives σ pkq pzq pk P Nq belong to SpRq. Hyperbolic tangent tanhpzq belongs to OM pRq. The proof is provided in F Example 6.5 ([40, Ex.2.2.2]). RBF Gpzq and their derivatives Gpkq pzq belong to SpRq. Example 6.6 ([40, Ex.2.3.5]). Dirac’s δpzq and their derivatives δ pkq pzq belong to S 1 pRq. 6.2 Kψ,η when ψ is a derivative of the Gaussian Given an activation function η P S01 pRq, according to Corollary 5.5 we can construct an admissible ridgelet function ψ P SpRq by letting ψ :“ Λm ψ0 , (83) where ψ0 P SpRq satisfies ż A E x0 :“ ηp, ψ x0 pζqp ψ η pζqdζ ‰ 0, ˘8. (84) Rzt0u Here we consider the case when ψ0 is given by ψ0 “ Gp`q , (85) for some ` P N0 , where G denotes the Gaussian Gpzq :“ expp´z 2 {2q. ? p The Fourier transform of the Gaussian is given by Gpζq “ expp´ζ 2 {2q “ 2π Gpζq. The Hilbert transform of the Gaussian, which we encounter by computing ψ “ Λm G when m is odd, is given by ˆ ˙ 2i z HGpzq “ ? F ? , (86) π 2 şz where F pzq is the Dawson function F pzq :“ expp´z 2 q 0 exppw2 qdw. k Example 6.7. z` pk P N0 q is admissible with ψ “ Λm Gp``k`1q p` P N0 q iff ` is even. If odd, then Kψ,η “ 0. 14 Proof. It follows from the fact that, according to Gel’fand and Shilov [41, § 9.3], k zx ` pζq “ k! ` πik δ pkq pζq, piζqk`1 k P N0 . Example 6.8. ηpzq “ δ pkq pzq pk P N0 q is admissible with ψ “ Λm G iff k is even. If odd, then Kψ,η “ 0. In contrast to polynomial functions, Dirac’s δ can be an admissible activation function. Example 6.9. ηpzq “ Gpkq pzq pk P N0 q is admissible with ψ “ Λm G iff k is even. If odd, then Kψ,η “ 0. Example 6.10. ηpzq “ σ pkq pzq pk P N0 q is admissible with ψ “ Λm G iff k is odd. If odd, then Kψ,η “ 0. σ p´1q is admissible with ψ “ Λm G2 . The proof is provided in F. 7 Numerical Examples of Reconstruction We performed some numerical experiments on reconstructing a one-dimensional signal and a two-dimensional image, with reference to our theoretical diagnoses for admissibility in the previous section. Table 5 lists the diagnoses of pΛm ψ0 , ηq we employ in this section. The symbols ’`,’ ’0,’ and ’8’ in each cell indicate that Kψ,η of the corresponding pψ, ηq converges to a non-zero constant (`), converges to zero (0), and diverges (8). Hence, by Theorem 5.6, if the cell pψ, ηq indicates ’`’ then a neural network with an activation function η is a universal approximator. Table 5: Theoretical diagnoses for admissibility of ψ “ Λm ψ0 and η. ’`’ indicates that pψ, ηq is admissible. ’0’ and ’8’ indicate that Kψ,η vanishes and diverges, respectively, and thus pψ, ηq is not admissible. 7.1 activation function η ψ “ Λm G ψ “ Λm G1 ψ “ Λ m G2 derivative of sigmoidal ft. σ1 ` 0 ` sigmoidal function σ 8 ` 0 8 8 ` p´1q softplus σ Dirac’s δ δ ` 0 ` unit step function 0 z` 8 ` 0 ReLU z` 8 8 ` linear function z 0 0 0 RBF G ` 0 ` Sinusoidal Curve We studied a one-dimensional signal f pxq “ sin 2πx defined on x P r´1, 1s. The ridgelet functions functions ψ “ Λψ0 were chosen from derivatives of the Gaussian ψ0 “ Gp`q , p` “ 0, 1, 2q. The activation functions η were chosen from among the softplus σ p´1q , the sigmoidal function σ and its derivative σ 1 , the ReLU 0 z` , unit step function z` , and Dirac’s δ. In addition, we examined the case when the activation function is simply a linear function: ηpzq “ z, which cannot be admissible because the Fourier transform of polynomials is supported at the origin in the Fourier domain. The signal was sampled from r´1, 1s with ∆x “ 1{100. We computed the reconstruction formula ż ż dadb Rψ f pa, bqηpax ´ bq , (87) |a| R R 15 by simply discretizing pa, bq P r´30, 30s ˆ r´30, 30s by ∆a “ ∆b “ 1{10. That is, Rψ f pa, bq « N ÿ f pxn qψpa ¨ xn ´ bq|a|∆x, xn “ x0 ` n∆x (88) n“0 Rη: Rf pxq « I,J ÿ Rψ f pai , bj qηpai ¨ x ´ bj q pi,jq“p0,0q ∆a∆b , |ai | ai “ a0 ` i∆a, bj “ b0 ` j∆b (89) where x0 “ ´1, a0 “ ´30, b0 “ ´30, and N “ 200, pI, Jq “ p600, 600q. ψ “ ΛG ψ “ ΛG1 ψ “ ΛG2 Figure 2: Ridgelet transform Rψ f pa, bq of f pxq “ sin 2πx defined on r´1, 1s with respect to ψ. Figure 2 depicts the ridgelet transform Rψ f pa, bq. As the order ` of ψ “ ΛGp`q increases, the localization of Rψ f increases. As shown in Figure 3, every Rψ f can be reconstructed to f with some admissible activation function η. It is somewhat intriguing that the case ψ “ ΛG2 can be reconstructed with two different activation functions. Figures 3, 4, and 5 tile the results of reconstruction with sigmoidal functions, truncated power functions, and a linear function. The solid line is a plot of the reconstruction result; the dotted line draws the original signal. In each of the figures, the theoretical diagnoses and experimental results are almost consistent and reasonable. In Figure 3, at the bottom left, the reconstruction signal with the softplus seems incompletely reconp´1q pζq has a pole ζ ´2 ; thus, we can understand structed, in spite of Table 5 indicating ’8’. Recall that σz p´1q this cell in terms of σ ˚ ΛG working as an integrator, that is, a low-pass filter. In Figure 4, in the top row, all the reconstructions with Dirac’s δ fail. These results seem to contradict the theory. However, it simply reflects the implementation difficulty of realizing Dirac’s δ, because δpzq is a “function” that is almost constantly zero, except for the origin. Nevertheless, z “ ax ´ b rarely happens to be exactly zero, provided a, b, and x are discretized. This is the reason why this row fails. At the bottom left, the ReLU seems to lack sharpness for reconstruction. Here we can again understand that z` ˚ ΛG worked as a low-pass filter. It is worth noting that the unit step function and the ReLU provide a sharper reconstruction than the sigmoidal function and the softplus. In Figure 5, all the reconstructions with a linear function fail. This is consistent with the theory that polynomials cannot be admissible as their Fourier transforms are singular at the origin. 16 ψ “ ΛG1 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 0.5 −1.0 −0.5 y 0.0 0.5 1.0 −1.0 −0.5 y 0.0 0.5 −1.0 −0.5 y 0.0 0.5 1.0 −1.0 −0.5 y 0.0 0.5 y 0.0 −1.0 1.0 0.5 y 0.0 −0.5 −1.0 −1.0 1.0 0.5 −1.0 −0.5 y 0.0 0.5 1.0 0.5 −0.5 −1.0 0.0 x 1.0 −0.5 1.0 −1.0 −0.5 η“σ η “ σ p´1q ψ “ ΛG2 y 0.0 0.5 y 0.0 −1.0 −0.5 η “ σ1 1.0 ψ “ ΛG Figure 3: Reconstruction with the derivative of sigmoidal function σ 1 , sigmoidal function σ, and softplus σ p´1q . The solid line is a plot of the reconstruction result; the dotted line plots the original signal. 17 ψ “ ΛG1 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 0.5 −1.0 −0.5 y 0.0 0.5 1.0 −1.0 −0.5 y 0.0 0.5 −1.0 −0.5 y 0.0 0.5 1.0 −1.0 −0.5 y 0.0 0.5 y 0.0 −1.0 1.0 0.5 y 0.0 −0.5 −1.0 −1.0 1.0 0.5 −1.0 −0.5 y 0.0 0.5 1.0 0.5 −0.5 −1.0 0.0 x 1.0 −0.5 1.0 −1.0 −0.5 0 η “ z` η “ z` ψ “ ΛG2 y 0.0 0.5 y 0.0 −1.0 −0.5 η“δ 1.0 ψ “ ΛG 0 Figure 4: Reconstruction with truncated power functions — Dirac’s δ, unit step z` , and ReLU z` . The solid line is a plot of the reconstruction result; the dotted line plots the original signal. ψ “ ΛG1 −1.0 −0.5 0.0 x 0.5 1.0 1.0 0.5 −0.5 −1.0 −1.0 −0.5 y 0.0 0.5 1.0 ψ “ ΛG2 y 0.0 0.5 y 0.0 −1.0 −0.5 ηpzq “ z 1.0 ψ “ ΛG −1.0 −0.5 0.0 x 0.5 1.0 −1.0 −0.5 0.0 x 0.5 1.0 Figure 5: Reconstruction with linear function ηpzq “ z. The solid line is a plot the reconstruction result; the dotted line plots the original signal. 18 7.2 Shepp-Logan phantom We next studied a gray-scale image Shepp-Logan phantom [42]. The ridgelet functions ψ “ Λ2 ψ0 chosen from the `th derivatives of the Gaussian ψ0 “ Gp`q , p` “ 0, 1, 2q. The activation functions η 0 chosen from the RBF G (instead of Dirac’s δ), the unit step function z` , and the ReLU z` . The original image was composed of 256 ˆ 256 pixels. We treated it as a two-dimensional signal defined on r´1, 1s2 . We computed the reconstruction formula ż ż dadb , Rψ f pa, bqηpa ¨ x ´ bq }a} 2 R R were were f pxq (90) by discretizing pa, bq P r´300, 300s2 ˆ r´30, 30s by ∆a “ p1, 1q and ∆b “ 1. Figure 6 lists the results of the reconstruction. As observed in the one-dimensional case, the results are fairly consistent with the theory. Again, at the bottom left, the reconstructed image seems dim. Our understanding is that it was caused by low-pass filtering. ψ “ Λ2 G1 ψ “ Λ2 G2 η “ z` 0 η “ z` η“G ψ “ Λ2 G 0 Figure 6: Reconstruction with RBF G, unit step z` , and ReLU z` . 19 8 Concluding Remarks We have shown that neural networks with unbounded non-polynomial activation functions have the universal approximation property. Because the integral representation of the neural network coincides with the dual ridgelet transform, our goal reduces to constructing the ridgelet transform with respect to distributions. Our results cover a wide range of activation functions: not only the traditional RBF, sigmoidal k function, and unit step function, but also truncated power functions z` , which contain the ReLU and even Dirac’s δ. In particular, we concluded that a neural network can approximate L1 X C 0 functions in the pointwise sense, and L2 functions in the L2 sense, when its activation “function” is a Lizorkin distribution (S01 ) that is admissible. The Lizorkin distribution is a tempered distribution (S 1 ) that is not a polynomial. As an important consequence, what a neural network learns is a ridgelet transform of the target function f . In other words, during backpropagation the network indirectly searches for an admissible ridgelet function, by constructing a backprojection filter. Using the weak form expression of the ridgelet transform, we extensively defined the ridgelet transform with respect to distributions. Theorem 4.2 guarantees the existence of the ridgelet transform with respect to distributions. Table 4 suggests that for the convolution of distributions to converge, the class X of domain and the class Z of ridgelets should be balanced. Proposition 4.3 states that Rψ : L1 pRm q Ñ S 1 pYm`1 q is a bounded linear operator. Theorem 4.5 states that the dual ridgelet transform coincides with a dual operator. Provided the reconstruction formula holds, that is, when the ridgelets are admissible, the ridgelet transform is injective and the dual ridgelet transform is surjective. For an unbounded η P ZpRq to be admissible, it cannot be a polynomial and it can be associated with a backprojection filter. If η P ZpRq is a polynomial then the product of distributions in the admissibility condition should be indeterminate. Therefore, ZpRq excludes polynomials. Theorem 5.4 rephrases the admissibility condition in the real domain. As a direct consequence, Corollary 5.5 gives a constructive sufficiently admissible condition. After investigating the construction of the admissibility condition, we showed that formulas can be reconstructed on L1 pRm q in two ways. Theorem 5.6 uses the Fourier slice theorem. Theorem 5.7 uses approximations to the identity and reduces to the inversion formula of the Radon transform. Theorem 5.7 as well as Corollary 5.8 suggest that the admissibility condition requires pψ, ηq to construct a backprojection filter. In addition, we have extended the ridgelet transform on L1 pRm q to L2 pRm q. Theorem 5.9 states that Parseval’s relation, which is a weak version of the reconstruction formula, holds on L1 X L2 pRm q. Theorem 5.10 follows the bounded extension of Rψ from L1 X L2 pRm q to L2 pRm q. Theorem 5.11 gives the reconstruction formula in L2 pRm q. k and other activation functions belong to S01 , and that they are admissible with some By showing that z` derivatives of the Gaussian, we proved the universal approximation property of a neural network with an unbounded activation function. Numerical examples were consistent with our theoretical diagnoses on the admissibility. In addition, we found that some non-admissible combinations worked as a low-pass filter; for example, pψ, ηq “ pΛm rGaussians, ReLUq and pψ, ηq “ pΛm rGaussians, softplus). We plan to perform the following interesting investigations in future. 1. Given an activation function η P S01 pRq, which is the “best” ridgelet function ψ P SpRq? In fact, for a given activation function η, we have plenty of choices. By Corollary 5.5, all elements of ˇ ! ) ˇ x0 y is finite and nonzero. , η, ψ Aη :“ Λm ψ0 ˇ ψ0 P SpRq such that xp (91) are admissible with η. 2. How are ridgelet functions related to deep neural networks? Because ridgelet analysis is so fruitful, we aim to develop “deep” ridgelet analysis. One of the essential leaps from shallow to deep is that the network output expands from scalar to vector because a deep structure is a cascade of multi-input multi-output layers. In this regard, we expect Corollary 5.8 to play a key role. By using the intertwining relations, we can “cascade” the reconstruction operators as below Rη: Rψ Rη: Rψ “ R˚ Λk´1 Rp´∆qm´1´ k`` 2 R˚ Λ`´1 R. p0 ď k, ` ď mq (92) This equation suggests that the cascade of ridgelet transforms coincides with a composite of backprojection filtering in the Radon domain and differentiation in the real domain. We conjecture that this point of view can be expected to facilitate analysis of the deep structure. 20 Acknowledge The authors would like to thank the anonymous reviewers for fruitful comments and suggestions to improve the quality of the paper. The authors would like to express their appreciation toward Dr. Hideitsu Hino for his kind support with writing the paper. This work was supported by JSPS KAKENHI Grand Number 15J07517. References [1] N. Murata, An Integral representation of functions using three-layered betworks and their approximation bounds, Neural Networks 9 (6) (1996) 947–956. doi:10.1016/0893-6080(96)00000-7. URL http://www.sciencedirect.com/science/article/pii/0893608096000007 [2] S. Sonoda, N. Murata, Sampling hidden parameters from oracle distribution, in: 24th Int. Conf. Artif. Neural Networks, Vol. 8681, Springer International Publishing, Hamburg, Germany, 2014, pp. 539–546. doi:10.1007/978-3-319-11179-7{\_}68. [3] X. Glorot, A. Bordes, Y. Bengio, Deep sparse rectifier neural networks, in: 14th Int. Conf. Artif. Intell. Stat. (AISTATS 2011), Vol. 15, JMLR W&CP, Fort Lauderdale, FL, USA, 2011, pp. 315–323. URL http://jmlr.org/proceedings/papers/v15/glorot11a/glorot11a.pdf [4] I. Goodfellow, D. Warde-Farley, M. Mirza, A. Courville, Y. Bengio, Maxout networks, in: 30th Int. Conf. Mach. Learn., Vol. 28, JMLR W&CP, 2013, pp. 1319–1327. URL http://jmlr.csail.mit.edu/proceedings/papers/v28/goodfellow13.pdf [5] G. E. Dahl, T. N. Sainath, G. E. Hinton, Improving deep neural networks for LVCSR using rectified linear units and dropout, in: Acoust. Speech Signal Process. (ICASSP), 2013 IEEE Int. Conf., IEEE, 2013, pp. 8609–8613. doi:10.1109/ICASSP.2013.6639346. [6] A. L. Maas, A. Y. Hannun, A. Y. Ng, Rectifier nonlinearities improve neural network acoustic models, in: ICML 2013 Work. Deep Learn. Audio, Speech, Lang. Process., Atlanta, 2013. URL https://sites.google.com/site/deeplearningicml2013/relu_hybrid_icml2013_final. pdf [7] K. Jarrett, K. Kavukcuoglu, M. Ranzato, Y. LeCun, What is the best multi-stage architecture for object recognition?, in: Comput. Vision, 2009 IEEE 12th Int. Conf., Kyoto, 2009, pp. 2146–2153. doi:10.1109/ICCV.2009.5459469. [8] A. Krizhevsky, I. Sutskever, G. E. Hinton, ImageNet classification with deep convolutional neural networks, in: F. Pereira, C. J. C. Burges, L. Bottou, K. Q. Weinberger (Eds.), Adv. Neural Inf. Process. Syst. 25, Curran Associates, Inc., 2012, pp. 1097–1105. URL http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-netw pdf [9] M. D. Zeiler, M. Ranzato, R. Monga, M. Z. Mao, K. Yang, Q. Viet Le, P. Nguyen, A. W. Senior, V. Vanhoucke, J. Dean, G. E. Hinton, On rectified linear units for speech processing, in: Acoust. Speech Signal Process. (ICASSP), 2013 IEEE Int. Conf., IEEE, Vancouver, BC, 2013, pp. 3517–3521. doi:10.1109/ICASSP.2013.6638312. [10] H. Mhaskar, C. A. Micchelli, Approximation by superposition of sigmoidal and radial basis functions, Adv. Appl. Math. 13 (3) (1992) 350–373. doi:10.1016/0196-8858(92)90016-P. URL http://www.sciencedirect.com/science/article/pii/019688589290016P [11] M. Leshno, V. Y. Lin, A. Pinkus, S. Schocken, Multilayer feedforward networks with a nonpolynomial activation function can approximate any function, Neural Networks 6 (6) (1993) 861–867. doi: 10.1016/S0893-6080(05)80131-5. URL http://www.sciencedirect.com/science/article/pii/S0893608005801315 [12] A. Pinkus, Approximation theory of the MLP model in neural networks, Acta Numer. 8 (1999) 143– 195. doi:10.1017/S0962492900002919. 21 [13] Y. Ito, Representation of functions by superpositions of a step or sigmoid function and their applications to neural network theory, Neural Networks 4 (3) (1991) 385–394. doi:10.1016/0893-6080(91) 90075-G. URL http://www.sciencedirect.com/science/article/pii/089360809190075G [14] P. C. Kainen, V. Kůrková, A. Vogt, A Sobolev-type upper bound for rates of approximation by linear combinations of Heaviside plane waves, J. Approx. Theory 147 (1) (2007) 1–10. doi:10.1016/j.jat. 2006.12.009. URL http://linkinghub.elsevier.com/retrieve/pii/S0021904507000081 [15] V. Kůrková, Complexity estimates based on integral transforms induced by computational units, Neural Netw. 33 (2012) 160–7. doi:10.1016/j.neunet.2012.05.002. URL http://www.sciencedirect.com/science/article/pii/S0893608012001311 [16] S. M. Carroll, B. W. Dickinson, Construction of neural nets using the Radon transform, in: Int. Jt. Conf. Neural Networks, 1989. IJCNN., Vol. 1, IEEE, 1989, pp. 607–611. doi:10.1109/IJCNN.1989. 118639. [17] S. Helgason, Integral Geometry and Radon Transforms, Springer-Verlag New York, 2011. doi:10. 1007/978-1-4419-6055-9. [18] B. Irie, S. Miyake, Capabilities of three-layered perceptrons, in: IEEE Int. Conf. Neural Networks, IEEE, 1988, pp. 641–648. doi:10.1109/ICNN.1988.23901. [19] K.-I. Funahashi, On the approximate realization of continuous mappings by neural networks, Neural Networks 2 (3) (1989) 183–192. doi:10.1016/0893-6080(89)90003-8. URL http://www.sciencedirect.com/science/article/pii/0893608089900038 [20] L. K. Jones, A simple lemma on greedy approximation in Hilbert space and convergence rates for projection pursuit regression and neural network training, Ann. Stat. 20 (1) (1992) 608–613. doi: 10.1214/aos/1176348546. [21] A. R. Barron, Universal approximation bounds for superpositions of a sigmoidal function, IEEE Trans. Inf. Theory 39 (3) (1993) 930–945. doi:10.1109/18.256500. [22] P. C. Kainen, V. Kůrková, M. Sanguineti, Approximating multivariable functions by feedforward neural nets, in: M. Bianchini, M. Maggini, L. C. Jain (Eds.), Handb. Neural Inf. Process., Vol. 49 of Intelligent Systems Reference Library, Springer Berlin Heidelberg, 2013, pp. 143–181. doi:10.1007/ 978-3-642-36657-4. [23] E. J. Candès, Harmonic analysis of neural networks, Appl. Comput. Harmon. Anal. 6 (2) (1999) 197–218. doi:10.1006/acha.1998.0248. URL http://www.sciencedirect.com/science/article/pii/S1063520398902482 [24] E. J. Candès, Ridgelets: theory and applications, Ph.D. thesis, Standford University (1998). [25] B. Rubin, The Calderón reproducing formula, windowed X-ray transforms, and radon transforms in Lp -spaces, J. Fourier Anal. Appl. 4 (2) (1998) 175–197. doi:10.1007/BF02475988. URL http://dx.doi.org/10.1007/BF02475988 [26] D. L. Donoho, Tight frames of k-plane ridgelets and the problem of representing objects that are smooth away from d-dimensional singularities in Rn , Proc. Natl. Acad. Sci. United States Am. 96 (5) (1999) 1828–1833. doi:10.1073/pnas.96.5.1828. [27] D. L. Donoho, Ridge functions and orthonormal ridgelets, J. Approx. Theory 111 (2) (2001) 143–179. doi:10.1006/jath.2001.3568. URL http://www.sciencedirect.com/science/article/pii/S0021904501935683 [28] J.-L. Starck, F. Murtagh, J. M. Fadili, The ridgelet and curvelet transforms, in: Sparse Image Signal Process. Wavelets, Curvelets, Morphol. Divers., Cambridge University Press, 2010, pp. 89–118. doi: 10.1017/CBO9780511730344.006. URL http://www.cambridge.org/9780521119139 22 [29] B. Rubin, Convolutionbackprojection method for the k-plane transform, and Calderón’s identity for ridgelet transforms, Appl. Comput. Harmon. Anal. 16 (3) (2004) 231–242. doi:10.1016/j.acha. 2004.03.003. URL http://www.sciencedirect.com/science/article/pii/S1063520304000168 [30] S. Kostadinova, S. Pilipović, K. Saneva, J. Vindas, The ridgelet transform of distributions, Integr. Transform. Spec. Funct. 25 (5) (2014) 344–358. doi:10.1080/10652469.2013.853057. [31] S. Kostadinova, S. Pilipović, K. Saneva, J. Vindas, The Ridgelet Transform and Quasiasymptotic Behavior of Distributions, Oper. Theory Adv. Appl. 245 (2015) 185–197. doi:10.1007/ 978-3-319-14618-8{\_}13. [32] L. Schwartz, Théorie des Distributions, nouvelle Edition, Hermann, Paris, 1966. [33] F. Trèves, Tological Vector Spaces, Distributions and Kernels, Academic Press, 1967. [34] W. Rudin, Functional Analysis, 2nd Edition, Higher Mathematics Series, McGraw-Hill Education, 1991. [35] H. Brezis, Functional Analysis, Sobolev Spaces and Partial Differential Equations, 1st Edition, Universitext, Springer-Verlag New York, 2011. doi:10.1007/978-0-387-70914-7. [36] K. Yosida, Functional Analysis, 6th Edition, Springer-Verlag Berlin Heidelberg, 1995. doi:10.1007/ 978-3-642-61859-8. [37] W. Yuan, W. Sickel, D. Yang, Morrey and Campanato Meet Besov, Lizorkin and Triebel, Lecture Notes in Mathematics, Springer Berlin Heidelberg, 2010. doi:10.1007/978-3-642-14606-0. [38] M. Holschneider, Wavelets: An Analysis Tool, Oxford mathematical monographs, The Clarendon Press, 1995. [39] A. Hertle, Continuity of the radon transform and its inverse on Euclidean space, Math. Zeitschrift 184 (2) (1983) 165–192. doi:10.1007/BF01252856. URL http://dx.doi.org/10.1007/BF01252856 [40] L. Grafakos, Classical Fourier Analysis, 2nd Edition, Graduate Texts in Mathematics, Springer New York, 2008. doi:10.1007/978-0-387-09432-8. [41] I. M. Gel’fand, G. E. Shilov, Generalized Functions, Vol. 1: Properties and Operations, Academic Press, New York, 1964. [42] L. A. Shepp, B. F. Logan, The Fourier reconstruction of a head section, Nucl. Sci. IEEE Trans. 21 (3) (1974) 21–43. doi:10.1109/TNS.1974.6499235. [43] E. M. Stein, Singular Integrals and Differentiability Properties of Functions, Princeton Mathematical Series (PMS), Princeton University Press, 1970. A Proof of Theorem 4.2 A ridgelet transform Rψ f pu, α, βq is the convolution of a Radon transform Rf pu, pq and a dilated distribution ψα ppq in the sense of a Schwartz distribution. That is, ´ ¯ Ăα pβq “ Rψ f pu, α, βq. (93) f pxq ÞÑ Rf pu, pq ÞÑ Rf pu, ¨q ˚ ψ We verify that the ridgelet transform is well defined in a stepwise manner. Provided there is no danger of 1 confusion, in the following steps we denote by X the classes D, E 1 , S, OC1 , L1 , or DL 1. Step 1: Class X pSm´1 ˆ Rq of Rf pu, pq Hertle’s results found [39, Th 4.6, Cor 4.8] that the Radon transform is the continuous injection R : X pRm q ãÑ X pSm´1 ˆ Rq, (94) 1 m where X “ D, E 1 , S, OC1 , L1 , or DL q then Rf P X pSm´1 ˆ Rq, which determines the second 1 ; if f P X pR column. Our possible choice of the domain X is restricted to them. 23 Step 2: Class BpRq of Rψ f pu, α, βq with ´ respect to β¯ Ăα pβq in the sense of Schwartz distributions. By the Fix α ą 0. Recall that Rψ f pu, α, βq “ Rf pu, ¨q ˚ ψ nuclearity of X [33, § 51], the kernel theorem p pRq, X pSm´1 ˆ Rq – X pSm´1 qbX (95) holds. Therefore, we can omit u P Sm´1 in the considerations for pα, βq P H. According to Schwartz’s results shown in Table 3, for the convolution g ˚ ψ of g P X pRq and ψ P ZpRq to converge in BpRq, we can assign the largest possible class Z for each X as in the third column. Note that for X “ L1 we even assumed the continuity Z “ Lp X C 0 , which is technically required in Step 3. Obviously for 1 Z “ D1 , S 1 , Lp X C 0 , or DL p , if ψ P ZpRq then ψα P ZpRq. Therefore, we can determine the fourth column by evaluating X ˚ Z according to Table 3. Step 3: Class ApHq of Rψ f pu, α, βq with respect to pα, βq Fix u0 P Sm´1 and assume f P X pRm q. Write gppq :“ Rf pu0 , pq and ż Wrψ; gspα, βq :“ gpαz ` βqψpzqdz, (96) R then Rψ f pu0 , α, βq “ Wrψ; gspα, βq for every pα, βq P H. By the kernel theorem, g P X pRq. Case 3a: pX “ D and Z “ D1 then B “ E and A “ Eq We begin by considering the case in the first row. Observe that ż ż Bα Wrψ; gspα, βq “ Bα gpαz ` βqψpzqdz “ g 1 pαz ` βqz ¨ ψpzqdz “ Wrz ¨ ψ; g 1 spα, βq, R R ż ż Bβ Wrψ; gspα, βq “ Bβ gpαz ` βqψpzqdz “ g 1 pαz ` βqψpzqdz “ Wrψ; g 1 spα, βq, (97) (98) R R and thus that for every k, ` P N0 , Bαk Bβ` Wrψ; gspα, βq “ Wrz k ¨ ψ; g pk``q spα, βq. (99) Obviously if g P DpRq and ψ P D1 pRq then g pk``q P DpRq and z k ¨ ψ P D1 pRq, respectively, and thus Bαk Bβ` Wrψ; gspα, βq exists at every pα, βq P H. Therefore, we can conclude that if g P DpRq and ψ P D1 pRq then Wrψ; gs P EpHq. Case 3b: pX “ E 1 and Z “ D1 then B “ D1 and A “ D1 q Let g P E 1 pRq and ψ P D1 pRq. We show that Wrψ; gs P D1 pHq, that is, for every compact set K Ă H, there exists N P N0 such that ˇż ˇ ˇ ÿ dαdβ ˇˇ ˇ sup |Bαk Bβ` Tpα, βq|, @T P DpKq. (100) ˇ Tpα, βqWrψ; gspα, βq ˇÀ ˇ K α ˇ pα,βqPH k,`ďN Fix an arbitrary compact set K Ă H and a smooth function T P DpKq, which is supported in K. Take two compact sets A Ă R` and B Ă R such that K Ă A ˆ B. By the assumption that g P E 1 pRq and ψ P D1 pRq, there exist k, ` P N0 such that ˇż ˇ ˇ ˇ ˇ ˇ (101) ˇ upzqgpzqdz ˇ À sup |upkq pzq|, @u P EpRq ˇ R ˇ zPsupp g ˇ ˇż ˇ ˇ ˇ ˇ (102) ˇ vpzqψpzqdz ˇ À sup |v p`q pzq|, @v P DpBq. ˇ zPR ˇ R 24 Observe that for every fixed α, Tpα, ¨q ˚ gr P D1 pRq. Then, by applying (101) and (102) incrementally, ˇż ˇ ż ˇż ż ˇ ż ˇ ˇ dα 8ˇ dαdβ ˇˇ ˇ ˇ ˇ Tpα, β ´ αzqψpzqdz ¨ gpβqdβ ˇ (103) ˇ ˇ Tpα, βq gpαz ` βqψpzqdz ˇď ˇ ˇ R ˇ ˇα α R R 0 R ˇż ˇ ż8 ˇ ˇ dα ˇ ˇ k À sup ˇ Bβ Tpα, β ´ αzqψpzqdz ˇ (104) ˇ ˇα βPsupp g 0 R ż8 ˇ ˇ ˇ ˇ (105) À sup sup ˇBβk`` Tpα, β ´ αzqˇα`´1 dα 0 βPsupp g z ż ˇ ˇ ˇ ˇ (106) “ sup ˇBβk`` Tpα, βqˇα`´1 dα A βPB ˇ ż ˇ ˇ ˇ α`´1 dα, (107) ď sup ˇBβk`` Tpα, βqˇ ¨ A pα,βqPK where the third inequality follows by repeatedly applying Bz rTpα, β ´ αzqs “ p´αqBβ Tpα, β ´ αzq; the fourth inequality follows by the compactness of the support of T. Thus, we conclude that Wrψ; gs P D1 pHq. Case 3c: pX “ S and Z “ S 1 then B “ OM and A “ OM q Let g P SpRq and ψ P S 1 pRq. Recall the case when X “ D. Obviously, for every k, ` P N0 , g pk``q P SpRq and z k ¨ ψ P S 1 pRq, respectively, which implies Wrψ; gs P EpHq. Now we even show that Wrψ; gs P OM pHq, that is, for every k, ` P N0 there exist s, t P N0 such that ˇ ˇ k ` ˇBα Bβ Wrψ; gspα, βqˇ À pα ` 1{αqs p1 ` β 2 qt{2 . (108) Recall that by (99), we can regard Bαk Bβ` Wrψ; gspα, βq as Bα0 Bβ0 Wrψ0 ; g0 spα, βq, by setting g0 :“ g pk``q P SpRq and ψ0 :“ z k ¨ ψ P S 1 pRq. Henceforth we focus on the case when k “ ` “ 0. Since ψ P S 1 pRq, there exists N P N0 such that ˇż ˇ ˇ ˇ ÿ ˇ ˇ sup |z s uptq pzq|, @u P SpRq. (109) ˇ upzqψpzqdz ˇ À ˇ R ˇ s,tďN zPR By substituting upzq Ð gpαz ` βq, we have ˇż ˇ ˇ ˇ ÿ ˇ ˇ sup |z s Bzt gpαz ` βq| ˇ gpαz ` βqψpzqdz ˇ À ˇ R ˇ s,tďN zPR ˇˆ ˇ ˇ p ´ β ˙s ˇ ÿ ˇ ˇ t ptq “ sup ˇ α g ppqˇ ˇ ˇ α s,tďN pPR ÿ À αt´s β s sup |ps g ptq ppq| (110) (111) (112) pPR s,tďN N À pα ` 1{αq p1 ` β 2 qN {2 , (113) where the second equation follows by substituting p Ð αz ` β; the fourth inequality follows because every supp |ps g t ppq| is finite by assumption that g P SpRq. Therefore, we can conclude that if g P SpRq and ψ P S 1 pRq then Wrψ; gs P OM pHq. Case 3d: pX “ OC1 and Z “ S 1 then B “ S 1 and A “ S 1 q Let g P OC1 pRq and ψ P S 1 pRq. We show that Wrψ; gs P S 1 pHq, that is, there exists N P N0 depending only on ψ and g such that ˇ ˇż ˇ ÿ ˇ ˇ dαdβ ˇˇ ˇ ˇ @T P SpHq sup ˇDk,` (114) ˇ Tpα, βqWrψ; gspα, βq ˇÀ s,t Tpα, βq , ˇ H α ˇ α,βPH s,t,k,`ďN where we defined s 2 t{2 k ` Dk,` Bα Bβ Tpα, βq. s,t Tpα, βq :“ pα ` 1{αq p1 ` β q 25 (115) Fix an arbitrary T P SpHq. By the assumption that ψ P S 1 pRq, there exist s, t P N0 such that ˇ ˇż ˇ ˇ ˇ ˇ ˇ upzqψpzqdz ˇ À sup |z t upsq pzq|, @u P SpRq. ˇ ˇ R z (116) Observe that for every fixed α, Tpα, ¨q ˚ gr P SpRq. Then we can provide an estimate as below. ˇ ż ˇż ż ˇż ˇ ż ˇ ˇ dα 8ˇ dαdβ ˇˇ ˇ ˇ ˇ Tpα, βqgpαz ` βqdβ ¨ ψpzqdz ˇ (117) ˇ ˇď ˇ Tpα, βq gpαz ` βqψpzqdz ˇ H ˇ ˇ ˇα α R R 0 R ˇ ż ˇ ż ˇ ˇ dα ˇ t ˇ 0,0 psq À sup ˇz Ds,0 Tpα, βqg pαz ` βqdβ ˇ (118) ˇα R R z ˇ ˇ ż ˇ ż ˇ ˇ dα ˇ t ˇ 0,0 À sup ˇp Ds`t,0 Tpα, βqg psq pp ` βqdβ ˇ (119) ˇ ˇα R R p ż ż ˇ ˇˇ ˇ dβdα ˇ ď (120) sup ˇpt g psq pp ` βqˇˇD0,0 s`t,0 Tpα, βq α R R p ż ż ˇ ˇˇ ˇ dβdα ˇ À sup ˇp1 ` |p ` β|2 qt{2 g psq pp ` βqˇˇD0,0 s`t,t Tpα, βq α R R p (121) ż ˇ dβdα ˇ 0,0 ˇDs`t,t Tpα, βqˇ À (122) α H ż ˇ ˇ ˇ pα ` 1{αq´ε p1 ` β 2 q´δ{2 dβdα , Tpα, βq ď sup ˇD0,0 s`t`ε,t`δ α pα,βqPH H (123) where the second inequality follows by repeatedly applying Bz rgpαz ` βqs “ α ¨ g 1 pαz ` βq and α À α ` 1{α; the third inequality follows by changing the variable p Ð αz and applying pα ` 1{αqs ¨ α´t À pα ` 1{αqs`t ; the fifth inequality follows by applying |p| À p1`p2 q1{2 and Peetre’s inequality 1`p2 À p1`β 2 qp1`|p`β|2 q; the sixth inequality follows by the assumption that p1 ` p2 qt{2 gppq is bounded for any t; the last inequality follows by Hölder’s inequality and the integral is convergent when ε ą 0 and δ ą 1. Case 3e: pX “ L1 and Z “ Lp X C 0 then B “ Lp X C 0 and A “ S 1 q Let g P L1 pRq and ψ P Lp X C 0 pRq. We show that Wrg; ψs P S 1 pHq, that is, it has at most polynomial growth at infinity. Because ψ is continuous, g ˚ ψ is continuous. By Lusin’s theorem, there exists a continuous function g ‹ such that g ‹ pxq “ gpxq for almost every x P R; thus, by the continuity of g ˚ ψ, g ‹ ˚ ψpxq “ g ˚ ψpxq, for every x P R. (124) By the continuity and the integrability of g ‹ and ψ, there exist s, t P R such that |g ‹ pxq| À p1 ` x2 q´s{2 , 2 ´t{2 |ψpxq| À p1 ` x q , s ą 1, (125) tp ą 1 (126) Therefore, ˇż ˇ ˇż ˜ ˆ ˙ ˆ ˙2 ¸´t{2 ˇˇ ˇ x ´ β 1 ˇˇ ˇˇ x´β ˇ ˇ 2 ´s{2 dxˇ À ˇ p1 ` x q dxˇα´1 1` ˇ gpxqψ ˇ R ˇ α α ˇ ˇ R α ˇż ˇ ˇ ´ ¯´t{2 ˇ ˇ ˇ 2 À ˇ p1 ` x2 q´s{2 1 ` px ´ βq dxˇp1 ` α2 qt{2 α´1 ˇ R ˇ À p1 ` β 2 q´ minps,tq{2 pα ` 1{αqt´1 , (127) (128) (129) which means Wrψ; gs is a locally integrable function that grows at most polynomially at infinity. Note that if pt ´ 1qp ă m ´ 1 then Wrψ; gs P Lp pH; α´m dαdβq, because |Wrψ; gspα, βq|p behaves as ´ minps,tq pt´1qp β α at infinity. 1 1 1 1 Case 3f: pX “ DL 1 and Z “ DLp then B “ DLp and A “ S q 1 1 Let g P DL1 pRq and ψ P DLp . We estimate (114). Fix an arbitrary T P SpHq. By the assumption that 26 1 p ‹ ψ P DL P E X Lp pRq such that p pRq, for every fixed α, Tpα, ¨q ˚ ψ P E X L pRq. Therefore, we can take ψ ‹ ‹ ‹ ψ “ ψ a.e. and Tpα, ¨q ˚ ψ “ Tpα, ¨q ˚ ψ. In the same way, we can take g P E X L1 pRq such that g ‹ “ g almost everywhere and Tpα, ¨q ˚ g ‹ “ Tpα, ¨q ˚ g. Therefore, this case reduces to show that if X “ L1 and Z “ Lp then A “ S 1 . This coincides with case 3e. Step 4: Class YpYm`1 q of Rψ f pu, α, βq p The last column pYq is obtained by applying YpYm`1 q “ X pSm´1 qbApHq. Recall that for Sm´1 , as it is 1 1 1 1 1 compact, D “ S “ OM “ E and E “ OC “ S “ DLp “ D . Therefore, we have Y as in the last column of Table 4. B Proof of Theorem 5.4 Let pψ, ηq P SpRq ˆ S 1 pRq. Assume that ηp is singular at 0. That is, there exists k P N0 such that k ÿ ηppζq “ cj δ pjq pζq, ζ P t0u. (130) j“0 Assume there exists a neighborhood Ω of 0 such that ηp P C 0 pΩzt0uq. Note that the continuity implies local integrability. We show that ψ and η are admissible if and only if there exists u P OM pRq such that ˜ ¸ ż k ÿ j m r u ppζqdζ ‰ 0. (131) cj z , and Λ u“ψ˚ η´ Rzt0u j“0 p on the indicator Recall that the Fourier transform OM pRq Ñ OC1 pRq is bijective. Thus, the action of u function 1Rzt0u pζq is always finite. Sufficiency: p η pζq|ζ|´m is defined in the sense of ordinary On Ωzt0u, ηp coincides with a function. Thus the product ψpζqp p η pζq|ζ|´m ppζq. On RzΩ, |ζ|´m is in OM pRzΩq. Thus, the product ψpζqp functions, and coincides with u is defined in the sense of distributions, which is associative because it contains at most one tempered ppζq. Therefore, distribution (S ¨ S 1 ¨ OM ), and reduces to u ˜ż ż ¸ Kψ,η u ppζqdζ, (132) ` “ p2πqm´1 Ωzt0u RzΩ which is finite by assumption. Necessity: ş p η pζq|ζ|´m dζ is absolutely Write Ω0 :“ Ω X r´1, 1s and Ω1 :“ RzΩ0 . By the assumption that Ω0 zt0u ψpζqp convergent and ηp is continuous in Ω0 zt0u, there exists ε ą 0 such that ˇ ˇ ˇ ˇp η pζqˇ À |ζ|m´1`ε , ζ P Ω0 zt0u. (133) ˇψpζqp Therefore, there exists v0 P L1 pRq X C 0 pRzt0uq such that its restriction to Ω0 zt0u coincides with p η pζq “ |ζ|m v0 pζq, ψpζqp ζ P Ω0 zt0u. (134) By integrability and continuity, v0 P L8 pRq. In particular, both limζÑ`0 v0 pζq and limζÑ´0 v0 pζq are finite. However, in Ω1 , |ζ|´m P OM pΩ1 q. By the construction, ψp ¨ ηp P OC1 pRq. Thus, there exists v1 P OC1 pRq such that p η pζq “ |ζ|m v1 pζq, ψpζqp ζ P Ω1 . (135) where the equality is in the sense of distribution. Let v :“ v0 ¨ 1Ω0 ` v1 ¨ 1Ω1 . 27 (136) Clearly, v P OC1 pRq because v0 ¨ 1Ω0 P E 1 pRq and v1 ¨ 1Ω1 P OC1 pRq. Therefore, there exists u P OM pRq such p “ v and that u p η pζq “ |ζ|m u ppζq, ψpζqp By the admissibility condition, ż ζ P Rzt0u. ż ż u ppζqdζ “ v0 pζqdζ ` Ω0 zt0u Rzt0u (137) v1 pζqdζ ‰ 0. (138) Ω1 In consideration of the singularity at 0, we have ˜ ¸ k ÿ pjq p ppζq, ψpζq ηppζq ´ cj δ pζq “ |ζ|m u ζ P R. (139) j“0 By taking the Fourier inversion in the sense of distributions, « ¸ff ˜ k ÿ j r pzq “ Λm upzq, ψ˚ η´ cj z z P R. (140) j“0 C Proof of Theorem 5.6 Let f P L1 pRm q satisfy fp P L1 pRm q and pψ, ηq P SpRq ˆ S01 pRq be admissible. For simplicity, we rescale ψ to satisfy Kψ,η “ 1. Write ż żδż Rψ f pu, α, u ¨ x ´ αzq ηpzq Ipx; ε, δq :“ Sm´1 ε R dzdαdu . αm (141) We show that lim Ipx; ε, δq “ f pxq, δÑ8 εÑ0 a.e. x P Rm . and the equality holds at every continuous point of f . By using the Fourier slice theorem in the sense of distribution, ż ż 1 p η pαωqeiωβ dω Rψ f pu, α, β ´ αzq ηpzqdz “ fppωuqψpαωqp 2π R żR 1 “ fppωuqp upαωq|αω|m eiωβ dω, 2π Rzt0u (142) (143) (144) p η pζq pζ ‰ 0q is defined as in Theorem 5.4. ppζq :“ ψpζqp where |ζ|m u Then, żδ ε ż żδ dα 1 upαωq|ω|m eiωβ dαdω (144) m “ fppωuqp α 2π Rzt0u ε ż ż 1 u ppζqfppωuqeiωβ |ω|m´1 dζdω “ 2π R εď ωζ ďδ ż ż 1 8 u ppζqfppsgnpζqruq exppsgnpζqirβqrm´1 dζdr, “ 2π 0 rεď|ζ|ďrδ (145) (146) (147) where the second equation follows by changing the variable ζ Ð αω with αm´1 dα “ |ω|m´1 |ζ|´m dζ; the third equation follows by changing the variable r Ð |ω| with sgn ω “ sgn ζ. In the following, we substitute ş β Ð u ¨ x. Observe that in Sm´1 du, ż ż p f p´ruq expp´iru ¨ xqdu “ fppruq exppiru ¨ xqdu; (148) Sm´1 Sm´1 hence, we can omit sgn ζ. 28 Then, by substituting β Ð u ¨ x and changing the variable ξ Ð ru, ż Ipx; ε, δq “ (147) du Sm´1 ff ż ż 8 «ż 1 ppζqdζ fppruqeiru¨x rm´1 drdu, “ u 2π Sm´1 0 rεď|ζ|ďrδ ff ż «ż 1 u ppζqdζ fppξqeiξ¨x dζdξ. “ 2π Rm }ξ}εď|ζ|ď}ξ}δ (149) (150) (151) Recall that u p P OC1 pRq; thus, its action is continuous. That is, the limits and the integral commute. Therefore, Rη: Rψ f pxq “ lim Ipx; ε, δq (152) δÑ8 εÑ0 1 “ p2πq ż «ż ff ppζqdζ fppξqeiξ¨x dξ u Rm (153) Rzt0u ż 1 fppξqeiξ¨x dξ p2πqm Rm “ f pxq, a.e. x P Rm (154) “ (155) where the last equation follows by the Fourier inversion formula, a consequence of which the equality holds at x0 if f is continuous at x0 . D Proof of Theorem 5.7 Let f P L1 pRm q and pψ, ηq P SpRq ˆ S 1 pRq. Assume that there exists u P E X L1 pRq that is real-valued, ş ppζqdζ “ ´1. Write Λm u “ ψr ˚ η and R u ż żδż Rψ f pu, α, u ¨ x ´ αzq ηpzq Ipx; ε, δq :“ Sm´1 ε R dzdαdu . αm (156) We show that lim Ipx; ε, δq “ R˚ Λm´1 Rpxq, δÑ8 εÑ0 a.e. x P Rm . In the following we write p¨qα ppq “ p¨qpp{αq{α. By using the convolution form, ż ” ´ ¯ ı Rψ f pu, α, β ´ αzq ηpzqdz “ Rf pu, ¨q ˚ ψr ˚ η pβq (157) (158) α R “ rRf pu, ¨q ˚ pΛm uqα s pβq. (159) Observe that żδ dα pΛ uqα ppq m “ Λm´1 α «ż δ m ε pΛuq ε ´ p ¯ dα α ff α2 « ż ff p{ε 1 “ Λm´1 pΛuqpzqdz p p{δ „ ´p¯ 1 ´ p ¯ 1 “ Λm´1 Hu ´ Hu p ε p δ “ Λm´1 rkε ppq ´ kδ ppqs, (160) (161) (162) (163) where the first equality follows by repeatedly applying pΛuqα “ αΛpuα q; the second equality follows by substituting z Ð p{α; the fourth equality follows by defining ˆ ˙ 1 p 1 for γ “ ε, δ. (164) kpzq :“ Hu pzq and kγ ppq :“ k z γ γ 29 Therefore, we have żδ dα “ rRf pu, ¨q ˚ (163)s pβq (165) m α ε “ m´1 ‰ “ Λ Rf pu, ¨q ˚ pkε ´ kδ q pβq. (166) ş We show that k P L1 X L8 pRq and R kpzqdz “ 1. To begin with, k P L1 pRq because there exist s, t ą 0 such that (159) |kpzq| À |z|´1`s , ´1´t |kpzq| À |z| , as |z| Ñ 0 (167) as |z| Ñ 8. (168) p is odd, then The first claim holds because u is real-valued and thus u ż ppζqdζ Hup0q “ sgnζ ¨ u żR ż ppζqdζ ´ ppζqdζ “ u u p´8,0s (169) (170) p0,8q “ 0. (171) The second claim holds because u P L1 pRq and thus u as well as Hu decays ş at infinity. Then, by the ppζqdζ “ ´1, continuity and the integrability of k, it is bounded. By the assumption that R u ż ż Hupzq dz (172) kpzqdz “ ´ R R 0´z “ ´up0q (173) “ 1. (174) Write Jpu, pq :“ Λm´1 Rf pu, pq. Because k P L1 pRq and ş R (175) kpzqdz “ 1, kε is an approximation of the identity [43, III, Th.2]. Then, a.e. pu, pq P Sm´1 ˆ R. lim Jpu, ¨q ˚ kε ppq “ Jpu, pq, εÑ0 (176) However, as k P L8 pRq, }J ˚ kδ }L8 pSm´1 ˆRq ď δ ´1 }J}L1 pSm´1 ˆRq }k}L8 pRq , (177) a.e. pu, pq P Sm´1 ˆ R. (178) and thus, lim Jpu, ¨q ˚ kδ ppq “ 0, δÑ8 Because it is an approximation to the identity, J ˚ kγ P L1 pSm´1 ˆ Rq for 0 ď γ. Hence, there exists a maximal function M pu, pq [43, III, Th.2] such that sup |pJpu, ¨q ˚ vε qppq| À M pu, pq. (179) 0ăε m´1 Therefore, . That is, if Ω Ă Sm´1 ş |Jpu, ¨q ˚ pvε ´ vδ qpu ¨ xq| is uniformly integrable [35, Ex. 4.15.4] on S satisfies Ω du ď A then ż |Jpu, ¨q ˚ kγ |pu ¨ xqdu À A sup |M pu, pq|, @γ ě 0. (180) u,p Ω Thus, by the Vitali convergence theorem, we have ż : Rη Rψ f pxq “ lim rJpu, ¨q ˚ pvε ´ vδ qspu ¨ xqdu δÑ8 Sm´1 εÑ0 (181) ż Jpu, u ¨ xqdu, “ Sm´1 ˚ m´1 “R Λ Rf pxq. 30 a.e. x P Rm (182) (183) E Proof of Theorem 5.11 Let f P L2 pRm q and pψ, ηq be admissible with Kψ,η “ 1. Assume without loss of generality that pψ, ψq and pη, ηq are self-admissible respectively. Write żδż ż Rψ f pu, α, u ¨ x ´ αzq ηpzq Irf ; pε, δqspxq :“ Sm´1 ε R dzdαdu . αm In the following we write Ωrε, δs :“ Sm´1 ˆ rR` zpε, δqs ˆ R Ă Ym`1 . We show that › › lim ›f ´ Irf ; pε, δqs›2 “ 0. δÑ8 εÑ0 (184) (185) Observe that › › ˇ ˇ ›f ´ Irf ; pε, δqs› “ sup ˇ pf ´ Irf ; pε, δqs, gq ˇ 2 (186) }g}2 “1 ˇ ˇ “ sup ˇ pRψ f, Rη gqΩrε,δs ˇ (187) ˇ ˇ › › ď sup ˇRψ f ˇL2 pΩrε,δsq ›Rη g ›L2 pYm`1 q (188) ˇ ˇ › › “ sup ˇRψ f ˇL2 pΩrε,δsq ›g ›2 (189) Ñ 0 ¨ 1, (190) }g}2 “1 }g}2 “1 }g}2 “1 as ε Ñ 0, δ Ñ 8 where the third inequality follows by the Schwartz inequality; the last limit follows by }Rψ f }L2 pΩrε,δsq , which shrinks as the domain Ωrε, δs tends to H. F Proofs of Example 6.4 and Example 6.10 Let σpzq :“ p1 ` e´z q´1 . Obviously σpzq P EpRq. Step 0: Derivatives of σpzq. For every k P N, σ pkq pzq “ Sk pσpzqq, (191) where Sk pzq is a polynomial defined by $ & zp1 ´ zq Sk pzq :“ % S 1 pzqS pzq 1 k´1 k“1 (192) k ą 1, which is justified by induction on k. Step 1: σ, tanh P OM pRq. Recall that |σpzq| ď 1. Hence, for every k P N, ˇ pkq ˇ ˇσ pzqˇ “ |Sk pσpzqq| ď max |Sk pzq| ă 8. (193) zPr0,1s Therefore, every k P N0 , σ pkq pzq is bounded, which concludes σpzq P OM pRq. Hence, immediately tanh P OM pRq because tanhpzq “ 2σp2zq ´ 1. (194) σ 1 pzq “ pe z{2 ` e´z{2 q´2 . (195) Step 2: σ pkq P SpRq, k P N. Observe that 31 Hence, σ 1 pzq decays faster than any polynomial, which means supz |z ` σ 1 pzq| ă 8 for any ` P N0 . Then, for every k, ` P N0 , ˇ ˇ ˇ ˇ (196) sup ˇz ` σ pk`1q pzqˇ “ sup ˇz ` Sk`1 pσpzqqˇ ď max |z ` σ 1 pzq| ¨ max |Sk1 pσpzqq| ă 8, z z z z which concludes σ 1 P SpRq. Therefore, σ pkq P SpRq for every k P N. Step 3: σ p´1q P OM pRq. Observe that żz σ p´1q pzq “ σpwqdw. (197) 0 Hence, it is already known that rσ p´1q spkq “ σ pk´1q P OM pRq for every k P N. We show that σ p´1q pzq has at most polynomial growth. Write ρpzq :“ σ p´1q pzq ´ z` . (198) Then ρpzq attains at 0 its maximum maxz ρpzq “ log 2, because ρ1 pzq ă 0 when z ą 0 and ρ1 pzq ą 0 when z ă 0. Therefore, ˇ p´1q ˇ ˇσ pzqˇ ď |ρpzq| ` |z` | ď log 2 ` |z|, (199) which concludes σ p´1q pzq P OM . Step 4: η “ σ pkq is admissible with ψ “ Λm G when k P N is positive and odd. x0 y “ xη, ψ0 y. Observe that if k is odd, then σ pkq is an odd η, ψ Recall that η “ σ pkq P SpRq. Hence, xp function and thus xη, ψ0 y “ 0. However, if k is even, then σ pkq is an even function and thus xη, ψ0 y ‰ 0. Step 5: σ and σ p´1q cannot be admissible with ψ “ Λm G. This follows by Theorem 5.4, because both ż ´ ż ´ ¯ ¯ r ˚ σ pzqdz and r ˚ σ p´1q pzqdz, G G R (200) R diverge. Step 6: σ and σ p´1q are admissible with ψ “ Λm G1 and ψ “ Λm G2 , respectively. Observe that both Ă1 ˚ σ “ G r ˚ σ1 u0 :“ G Ă2 ˚ σ p´1q “ G r ˚ σ1 , u´1 :“ G and belong to SpRq. Hence, u0 and u´1 satisfy the sufficient condition in Theorem 5.4. 32 (201)
9cs.NE
Proportionally modular affine semigroups arXiv:1512.01513v2 [math.AC] 10 Jul 2016 J. I. Garcı́a-Garcı́a∗ M. A. Moreno-Frı́as† A. Vigneron-Tenorio‡ Abstract This work introduces a new kind of semigroup of Np called proportionally modular affine semigroup. These semigroups are defined by modular Diophantine inequalities and they are a generalization of proportionally modular numerical semigroups. We give an algorithm to compute their minimal generating sets. We also specialize on the case p = 2. For this case, we provide a faster algorithm to compute their minimal system of generators, prove they are Cohen-Macaulay and Buchsbaum, and determinate their (minimal) Frobenius vectors. Besides, Gorenstein proportionally modular affine semigroups are characterized. Keywords: affine semigroup, Buchsbaum ring, Cohen-Macaulay ring, Frobenius vector, Gorenstein ring, modular Diophantine inequalities, numerical monoid, numerical semigroup. MSC-class 2010: ondary). 20M14 (Primary), 11Y50, 13H10, 11D07 (Sec- Introduction All monoids and semigroups appearing in this work are commutative. For this reason, we omit this adjective in the sequel. Given two non-negative integers a, b with b 6= 0, we denote by a mod b the remainder of the Euclidean division of a by b. For a rational number p/q with gcd(p, q) = 1, we say that p/q = 0 mod b if p = 0 mod b, and for two rational numbers p/q and p0 /q 0 we say that p/q = p0 /q 0 mod b if p/q − p0 /q 0 = 0 mod b. A proportionally modular Diophantine inequality in one variable is an expression of the form ax mod b ≤ cx with a, b and c positive integers. The set S of nonnegative integer solutions of that modular inequality is a numerical semigroup, that is, it is a subset of the set of non-negative integers N that is closed under addition, 0 ∈ S and N \ S has finitely many elements. So, the submonoids of N ∗ Departamento de Matemáticas, Universidad de Cádiz, E-11510 Puerto Real (Cádiz, Spain). E-mail: [email protected]. Partially supported by MTM2014-55367-P (MINECO, Spain), FEDER funds and Junta de Andalucı́a group FQM-366. † Departamento de Matemáticas, Universidad de Cádiz, E-11510 Puerto Real (Cádiz, Spain). E-mail: [email protected]. Partially supported by MTM2014-55367-P (MINECO, Spain), FEDER funds and Junta de Andalucı́a group FQM-298. ‡ Departamento de Matemáticas, Universidad de Cádiz, E-11406 Jerez de la Frontera (Cádiz, Spain). E-mail: [email protected]. Partially supported by MTM2015-65764C3-1-P (MINECO/FEDER, UE) and Junta de Andalucı́a group FQM-366. 1 of the form S = {x ∈ N | ax mod b ≤ cx} are called proportionally modular numerical semigroups. They were introduced in [16], and many papers about them have been written (see, for example [14], [15], [18], [19]). In this work, we introduce proportionally modular affine semigroups as a generalization of proportionally modular numerical semigroups. Instead of using three integers a, b and c, we use two nonnull linear functions f, g : Qp → Q and a natural number b. With these elements, we define the semigroup S = {x ∈ Np | f (x) mod b ≤ g(x)} which it is called proportionally modular affine semigroup. In Theorem 3, we provide an algorithm to compute the minimal generating of S. Besides, we prove that the intersection of every rational straight line with a proportionally modular affine semigroup is isomorphic to a proportionally modular numerical semigroup. This makes possible to view every proportionally modular affine semigroup as a beam of proportionally modular numerical semigroups. In the second part of this work, we focus on proportionally modular affine semigroups of N2 and we explore some of their properties. Using that any nontrivial proportionally modular affine semigroup S of N2 is simplicial, we study some of the properties of its associated semigroup ring k[S] from the semigroup S. These properties are the Cohen-Macaulayness, Gorensteiness and Buchsbaumness, which have been widely studied in ring theory, but if we try to search these kind of rings, few methods to obtain them are found (see [9], [12], [17], [21] and references therein). In particular, we prove that these semigroups are Cohen-Macaulay and Buchsbaum, and we characterize when they are Gorenstein. That allows us to affirm that an application of modular Diophantine inequalities to Commutative Algebra is the construction of special kinds of rings. For these semigroups, we also give a geometrical algorithm for a fast computation of the minimal generating set of S, and we determinate the (minimal) Frobenius vectors of these semigroups (some references to Frobenius vectors are found in [1] and [2]). In this work, all the examples have been done using the software available at [8]. The content of this work is organized as follows: in Section 1, we provide some basic definitions and results on monoids and semigroup rings. In Section 2, we give the definition of proportionally modular semigroup, we represent it as beams of proportionally numerical semigroups, and we show an algorithm to compute its minimal generating set. In Section 3, we provide a faster algorithm to obtain a system of generators of a given proportionally modular affine semigroup of N2 . For this semigroup, we also give its set of (minimal) Frobenius vectors. Finally, in Section 4, we study methods to check the above mentioned properties of the semigroup ring of a proportionally modular affine semigroup of N2 . 1 Preliminaries and notations A semigroup is a pair (S, +), with S a nonempty set and + a binary operation defined on S verifying the associative law. In addition, if there exists an element 0 ∈ S such that a + 0 = 0 + a for all a ∈ S, we say that (S, +) is a monoid. Given a subset A of a monoid S, the monoid generated by A, denoted by hAi, is the least (with respect to inclusion) submonoid of S containing A. When 2 S = hAi, we say that S is generated by A or that A is a system of generators of S. The monoid S is finitely generated if it has a finite generating set. Finitely generated submonoids of Np are known as affine semigroups, and they are called numerical semigroups when p = 1. Given a system of linear equations or linear inequalities, a solution is called N-solution if it is a non-negative integer solution (see [13] for details). For a subset A ∈ Qp , denote by ConvexHull(A) the convex hull of the set A, that is, the smallest convex subset of Qp containing A. In this work, the product ordering in Np is denoted by  . So, given two elements x, y ∈ NpP , x  y if y − x ∈ Np . Besides, we denote by ||x|| the 1-norm p of x (i.e. ||x|| = i=1 |xi |) and Pm by [k] the set {1, . . . , k} for every k ∈ N. We use L(A) to denote the set { i=1 λi ai | λi ∈ Q≥ , ai ∈ A, m ∈ N}, this set is known as the rational cone of A. For a better understanding of the last section of this work, we need to recall some definitions. Let R be a Noetherian local ring, a finite R-module M 6= 0 is a Cohen-Macaulay module if depth(M ) = dim(M ). If R itself is a Cohen-Macaulay module, then it is called a Cohen-Macaulay ring (see [5]). A Gorenstein ring is a special case of Cohen-Macaulay ring: a Gorenstein local ring is a Noetherian commutative local ring R with finite injective dimension, as an R-module (see [3]). The last concept, Buchsbaum ring, is defined as follows: a noetherian R-module M is called a Buchsbaum module is every system of parameters of M is a weak M -sequence, and R is a Buchsbaum ring if it is Buchsbaum module as a module over itself (see [10] and [21] for details). For every (S, +) finitely generated commutative monoid and a field k , we denote by k[S] L the semigroup ring of S over k. Note that k[S] is equal to m∈S kχm endowed with a multiplication which is k-linear and such that χm · χn = χm+n for every m, n ∈ S (see [4]). We say that S is a Cohen-Macaulay/Gorenstein/Buchsbaum semigroup if k[S] is a Cohen-Macaulay/Gorenstein/Buchsbaum ring. 2 Proportionally modular affine semigroups Let f, g : Qp → Q be two nonnull linear functions and let b ∈ N\{0}. If x, y ∈ Np verify f (x) mod b ≤ g(x) and f (y) mod b ≤ g(y), by the linearity of f and g, we have f (x + y) mod b = (f (x) + f (y)) mod b ≤ (f (x) mod b) + (f (y) mod b) ≤ g(x) + g(y) = g(x + y). Clearly, f (0) mod b = 0 ≤ g(0). In this way, the set of N−solutions of every inequality of the form f (x) mod b ≤ g(x) is a submonoid of Np . Every submonoid S of Np obtained as above is called a proportionally modular monoid. Let us suppose that f (x1 , . . . , xp ) = f1 x1 + · · · + fp xp and g(x1 , . . . , xp ) = g1 x1 + · · · + gp xp with fi , gi ∈ Q for all i = 1, . . . , p, and b ∈ Q≥ . If d ∈ N, then an element x ∈ Np verifies f (x) mod b ≤ g(x) if and only if df (x) mod db ≤ dg(x). Hence, by multiplying the inequality f (x) mod b ≤ g(x) by d the least common multiple of the denominators of f1 , . . . , fp , g1 , . . . , gp , and b, we obtain an inequality where db ∈ N and the coefficients of df and dg are integers. So, in the sequel, we assume that f (x1 , . . . , xp ) = f1 x1 + · · · + fp xp and g(x1 , . . . , xp ) = g1 x1 + · · · + gp xp with fi , gi ∈ Z and b ∈ N. Remark 1. If we intersect S with any axis, the set obtained is formed by the elements of Np fulfilling a proportionally modular Diophantine inequality or it is 3 equal to {0}. Thus, this intersection is isomorphic to a proportionally modular numerical semigroup. Besides, every x ∈ Np satisfying g(x) ≥ b belongs to S. Remark 2. Let w = (w1 , . . . , wp ) ∈ Np \ {0} such that gcd(w1 , . . . , wp ) = 1. The set {λw|λ ∈ Q} ∩ Np is equal to {xw | x ∈ N}. If g(w) > 0, then g(xw) > 0 for all x ∈ N \ {0}. Since g(x1 , . . . , xp ) = g1 x1 + · · · + gp xp and f (x1 , . . . , xp ) = f1 x1 + · · · + fp xp with fi , gi ∈ Z for all i ∈ [p], then g(xw) = g(xw1 , . . . , xwp ) = (g1 w1 + · · · + gp wp )x and f (xw) = f (xw1 , . . . , xwp ) = (f1 w1 + · · · + fp wp )x. The element c0 = g1 w1 +· · ·+gp wp is in N and a0 = f1 w1 +· · ·+fp wp belongs to Z. So, xw ∈ S if and only if a0 x mod b ≤ c0 x. Hence, the submonoid {xw | x ∈ N} ∩ S is isomorphic to a proportionally modular numerical semigroup. We suppose now that g(w) = 0. Let u be the nonnull element of {λw|λ ∈ Q} ∩ Np closest to the origin verifying that f (u) mod b ≤ g(u). By the linearity of g we have g(u) = 0 and thus f (u) mod b = 0. Assume that w0 ∈ {λw|λ ∈ Q} ∩ Np and f (w0 ) mod b ≤ g(w0 ). If w0 6∈ {ku | k ∈ N}, consider k 0 ∈ N such that kk 0 uk < kw0 k and k(k 0 + 1)uk > kw0 k. The element w0 − k 0 u ∈ Np verifies g(w0 − k 0 u) = 0, f (w0 − k 0 u) mod b = 0 ≤ g(w0 − k 0 u) and kw0 − k 0 uk < kuk, which is a contradiction. Thus, {λw | λ ∈ Q, f (λw) mod b ≤ g(λw)} ∩ Np is equal to {λu | λ ∈ N} and this submonoid is isomorphic to N. The above two paragraphs allow us to view proportionally modular semigroups as beams of proportionally modular numerical semigroups. In the following result we give an effective proof that a proportionally modular semigroup is finitely generated. This proof is tailored to these semigroups. Theorem 3. Every proportionally modular monoid of Np is finitely generated. Proof. We suppose again that g(x1 , . . . , xp ) = g1 x1 +· · ·+gp xp with g1 , . . . , gp ∈ Z, and denote the p-tuple (x1 , . . . , xp ) by x. Let S be the proportionally modular monoid defined by the inequality f (x) mod b ≤ g(x). We have two straightforward cases: g1 , . . . , gp < 0 and g1 , . . . , gp > 0. If g1 , . . . , gp < 0, then S = {0}. If g1 , . . . , gp > 0, every set {x ∈ Np | g(x) = i} b−1 with i ∈ N is finite. Since Np \ S ⊂ ∪i=0 {x ∈ Np | g(x) = i}, the set Np \ S is finite, and hence a minimal generating set of S can be computed by using [6, Corollary 9]. Assume that there exist i, j ∈ [p] such that gi gj ≤ 0. Let U = {u1 , . . . , ut } be the minimal generating set of the N-solutions of the system of Diophantine equations (see [13])  f (x) mod b = 0, g(x) = 0. Every x ∈ Np verifying g(x) ≥ b is in S and therefore S ∩ {x ∈ Np | g(x) ≥ b} is equal to {x ∈ Np | g(x) ≥ b} (see Remark 1). So, we obtain that p S \ ∪b−1 i=1 {x ∈ N | g(x) = i} = p S ∩ ({x ∈ N | g(x) = 0} ∪ {x ∈ Np | g(x) ≥ b}) = (S ∩ {x ∈ Np | g(x) = 0}) ∪ {x ∈ Np | g(x) ≥ b}. p Take x ∈ S ∩ (∪b−1 i=1 {x ∈ N | g(x) = i}) and assume that g(x) = d with d ∈ {1, . . . , b − 1}. This element is a N-solution of a Diophantine system of equations of the form  f (x) mod b = k, (1) g(x) = d. 4 with k = 0, . . . , d. Let Mdk be the set ofPminimal N-solutions of (1). By [13], t the element x can be expressed as m + i=1 λi ui with m ∈ Mdk and λi ∈ N. Figure 1 illustrates graphically the sets Mdk of an example. Figure 1: Semigroup given by the inequality 5x + 2y + z mod 4 ≤ 3x + y − 4z. We now construct a generating set of the monoid {x ∈ Np | g(x) ≥ b} ∪ (S ∩ {x ∈ Np | g(x) = 0}). An graphical example of this monoid is showed in Figure 1. Let V = {v1 , . . . , vl } be the minimal generating set of {x ∈ Np | g(x) = 0}. Note that bvi ∈ hU i for all i = 1, . . . , l. Since the set L(S) ∩ Np is the cone determined by the hyperplanes g(x) ≥ 0, x1 ≥ 0, . . . , xp ≥ 0, it is a finitely generated monoid (see [20, Section §7.2 and Theorem 16.4]). Define C0 = V ∪ {w11 , . . . , wn1 1 , w12 , . . . , wn2 2 , . . . , w1b−1 , . . . , wnb−1 ,w e1 , . . . , w eq } b−1 the minimal generating set of L(S) ∩ Np satisfying: • g(wji ) = i for all i = 1, . . . , b − 1, and j = 1, . . . , ni . • g(w ej ) ≥ b for all j = 1, . . . , q. Let C1 be the finite set (C0 \ {w11 , . . . , wn1 1 }) ∪ ∪i∈[n1 ] {2wi1 , 3wi1 } ∪ ∪j∈[n1 ] {wj1 + s|s ∈ C0 \ V }. Note that for every element s ∈ C1 , g(s) = 0 or g(s) ≥ 2. Besides, if s ∈ (L(S) ∩ Np ) \ {x ∈ Np | g(x) = 1} we also have that g(s) = 0 or g(s) ≥ 2. If g(s) = 0, then s belongs to the semigroup generated by V ⊂ C1 . If g(s) ≥ 2, we consider λj , νij , µj ∈ N such that s= l X j=1 λj vj + n1 X ν1j wj1 + j=1 ni b−1 X X i=2 j=1 νij wji + q X µj w ej . j=1 For each ν1j > 1, the addend ν1j wj1 can be replace by a non-negative integer linear combination of the elements of {2wj1 , 3wj1 } ⊂ C1 . Since g(s) ≥ 2, if there 5 exists ν1j = 1, then there exists a nonnull coefficient νi0 j 0 with j 0 6= j and/or 0 there exists a nonnull coefficient µj 00 . Hence, wj1 + νi0 j 0 wji 0 or wj1 + µj 00 w ej 00 appears in the expression of s. Note that both elements are obtained as a nonnegative integer linear combination of elements of C1 . In any case, the element s is in the semigroup generated by C1 , and therefore C1 is a system of generators of (L(S) ∩ Np ) \ {x ∈ Np | g(x) = 1}. Once we have the sets C0 and C1 , the sets Ck with k ∈ [b − 1] are obtained recursively as follows: Ck = (Ck−1 \ {w1k , . . . , wnk k }) ∪ ∪i∈[nk ] {2wik , 3wik } ∪ ∪j∈[nk ] {wjk + s|s ∈ Ck−1 \ V }. Reasoning as above, it is straightforward to prove that the set Ck is a system of generators of the semigroup (L(S) ∩ Np ) \ ∪kj=1 {x ∈ Np | g(x) = j}. Thus, Cb−1 is a system of generators of {x ∈ Np | g(x) ≥ b} ∪ {x ∈ Np | g(x) = 0}. Let C be the finite set C = (Cb−1 \ V ) ∪ U. Then, S ∩ {x ∈ Np | g(x) = 0} = hCi ∩ {x ∈ Np | g(x) = 0}. Let Ce be the finite set C∪ [ {z ∈ Np |w ≺ z  w + l X bvi }, i=1 w∈C∩{x∈Np | g(x)≥b} and let s ∈ {x ∈ Np | g(x) ≥ b} ∪ (S ∩ {x ∈ Np | g(x) = 0}). If g(s) = 0, s can e Otherwise, be obtained from the set U ⊂ C. s= X λwb w b+ l X µi vi , i=1 w∈C,g( b w)≥b b with λwb , µi ∈ N. For every µi , let µ0i , ri ∈ N be the quotient and the remainder of the integer division µi /b (µi = µ0i b + ri with ri ∈ [b − 1]). With these values we have l l X X X s= λwb w b+ µ0i bvi + ri vi , i=1 w∈C,g( b w)≥b b where Pl i=1 e and µ0i bvi ∈ hU i ⊂ hCi P w∈C,g( b w)≥b b p i=1 λwb w bi + Pl i=1 ri vi e belong to hCi. Hence, Ce is a system of generators of {x ∈ N | g(x) ≥ b} ∪ (S ∩ {x ∈ Np | g(x) = b−1 d e 0}), and thus a system of generators of S is the finite set C∪(∪ d=1 ∪k=0 Mdk ). From the above proof we obtain an algorithm to compute systems of generators of proportionally modular affine semigroups. Although, with this method it is necessary to solve several system of Diophantine equations (this is a N Pcomplete problem) and consider several big sets of elements. A particular case where we avoid these issues is when p = 2. This case is studied in next sections. We describe a geometrical approach, easier to solve, that allows us to determinate the Cohen-Macaulayness, Gorensteiness and Buchsbaumness. 3 Proportionally modular affine semigroups of N2 This section is about proportional modular semigroups associated to modular Diophantine inequalities into two variables: f (x, y) mod b ≤ g(x, y) where 6 f (x, y) = f1 x + f2 y, g(x, y) = g1 x + g2 y with b ∈ N and f1 , f2 , g1 , g2 ∈ Z. As in previous sections, we denote by S the proportionally modular affine semigroup associated to the above modular inequality. In this section, we provide a geometrical algorithm to compute their minimal generating sets. Besides, their associated (minimal) Frobenius vectors are studied. Given a subset A ⊂ Q2 , we denote by Tint(L(A)) Pmthe topological interior of the cone L(A). This set is equal to Tint(A) = { i=1 λi ai | λi ∈ Q> , ai ∈ A, m ∈ N}. Note that given a subsemigroup S of N2 minimally generated by {s1 , . . . , sp } there exists a minimal set of elements {si1 , . . . , sit } such that Pt its associated cone L(S) is equal to { j=1 λj sij | λj ∈ Q≥ }. The semigroup S is called simplicial whenever L(S) = L({s1 , s2 }). Note that every nontrivial proportionally modular semigroup of N2 is simplicial. Definition 4. Assume g(x, y) = g1 x + g2 y with g1 g2 ≤ 0. Denote by u the generator of the semigroup given by the N-solutions of  g1 x + g2 y = 0, f1 x + f2 y mod b = 0. If g1 6= 0, this element is the minimal solution of ( −g2 fg1 1+f2 g1 y mod b = 0). Analogously, if g2 6= 0 we also obtain only an element. In particular, note that u is a minimal generator of S. The vector u has a nice property which allows to obtain all the elements belonging to S from a strip of S. Lemma 5. Assume g(x, y) = g1 x + g2 y with g1 g2 ≤ 0, let u ∈ N2 be as in Definition 4 and v, w ∈ N2 such that v + u = w. Then, v ∈ S if and only if w ∈ S. Proof. Assume v ∈ S. We have f (v) mod b ≤ g(v) and f (u) mod b = g(u) = 0. Thus, f (w) mod b = f (v + u) mod b = (f (v) + f (u)) mod b ≤ f (v) mod b + f (u) mod b ≤ g(v) = g(v) + g(u) = g(v + u) = g(w). If w ∈ S, we can proceed similarly to obtain that v ∈ S. The following result provides us with an alternative geometrical and effective proof of Theorem 3 for a subsemigroup on N2 . Proposition 6. Every nontrivial proportionally modular semigroup S of N2 is finitely generated. Proof. We have f, g : Q2 → Q. Assume that g(x, y) = g1 x + g2 y with g1 , g2 ∈ Z. If g1 , g2 < 0, then S = {(0, 0)}. For the other cases we distinguish two main cases: g1 , g2 > 0 and g1 g2 ≤ 0. Assume that g1 , g2 > 0. The elements of N2 not belonging to S are in the straight lines g(x, y) = 1, . . . , g(x, y) = b − 1. Furthermore, the intersection of every straight line g(x, y) = d with Q2≥ is the segment with endpoints (0, gd2 ), ( gd1 , 0). Thus, in the straight lines g(x, y) = 1, . . . , g(x, y) = b − 1 there are only a finite number of elements in N2 . Hence, N2 \ S is finite and the minimal generating set S can be obtained from N2 \ S using [6, Corollary 9]. Assume now that g1 g2 ≤ 0. Let u = (u1 , u2 ) be as in Definition 4. The intersection of g(x) = b with one of the two axes is not empty. Assume that 7 this axis is the x-axis and then g1 > 0 and g2 ≤ 0. Let w = ( gb1 , 0) be the point of intersection of the straight line g(x, y) = b with the line y = 0, and e u = (e u1 , 0) ∈ N2 be the minimal generator of the affine semigroup S ∩ OX closest to the origin. By Remark 1, the element e u exists and it is a minimal generator of S. Fixed s = (s1 , s2 ) ∈ S, by Lemma 5, if s2 ≥ u2 , s satisfies s − u ∈ S, and it can be obtained from an element s0 = (s01 , s02 ) ∈ S with s02 < u2 adding λu for some λ ∈ N. In case s belongs to the half-space {(x, y) ∈ R2+ |g(x, y) ≥ b} + e u, the element s − e u belongs to S. Let G be the finite set given by S ∩ (R2 \ (({(x, y) ∈ R2 |g(x, y) ≥ b} + e u) ∪ {(x, y) ∈ R2 |y > u2 })). This set is equal to S ∩ ConvexHull({O, u, u + w + e u, w + e u}) and S \ G is equal to {h + λ1 u + λ2 e u|h ∈ G and λ1 , λ2 ∈ N}. Then, S is finitely generated by the elements belonging to G. Analogously, the case g1 ≤ 0 and g2 > 0 can be solved u = (0, u e2 ) ∈ S the minimal generator of the affine considering w = (0, gb2 ), and e semigroup S ∩ OY closets to the origin. From now on, we denote by w the element {x ∈ R2+ |g(x) = b} ∩ (OX ∪ OY ) when g1 g2 ≤ 0, by G the set S ∩ ConvexHull({O, u, u + w + e u, w + e u}), and by e u the vector (e u1 , 0) or (0, u e2 ) as in above Proposition. In Algorithm 1 we formulate a faster algorithm to compute the minimal generating set of a proportionally modular semigroup in N2 . In this algorithm, Algorithm 1 Computation of the minimal generating set of a proportionally modular affine semigroup S. Input: The proportionally modular Diophantine inequality f (x) mod b ≤ g(x) = g1 x + g2 y. Output: The minimal generating set of S. 1: if g1 , g2 < 0 then return {(0, 0)}. 2: if g1 , g2 > 0 then compute the finite set N2 \ S. The minimal generating set H of S can be obtained from N2 \ S using [6, Corollary 9]. 3: return H. 4: if g1 g2 ≤ 0 then 5: Compute the vector u defined in Definition 4. 6: if g1 ≥ 0 then Se := {(x, 0) | f (x, 0) mod b ≤ g(x, 0)}. 7: if g1 < 0 then Se := {(0, y) | f (0, y) mod b ≤ g(0, y)}. e 8: Compute the minimum minimal generator e u of the subsemigroup S. 9: w := {x ∈ R2+ |g(x) = b} ∩ (OX ∪ OY ). 10: G := S ∩ ConvexHull({O, u, u + w + e u, w + e u}). 11: Obtain H a minimal system of generators from G. 12: return H. for the case g1 , g2 > 0 there exists an alternative way to compute the step 2. Let w1 and w2 be the intersections of {x ∈ Q2 |g(x) = b} with OX and OY respectively, and let e u1 and e u2 be the minimum minimal generators of the semigroups S ∩ OX and S ∩ OY respectively (note e u1 and e u2 are in the minimal generating set of S). Consider J the set ConvexHull({O, w1 + e u1 , w2 + e u2 }). It is straightforward to prove that N2 \ J ⊂ S and every x ∈ N2 \ J satisfies that x − e u1 and/or x − e u2 are/is in S. Thus, the elements belonging to N2 \ J can be obtained from elements in J ∩ S and then a system of generators of S is included in J ∩ S. So, an alternative way to do the step 2 is to compute 8 w1 , w2 , e u1 , e u2 , consider the set J ∩ S and take H the minimal generating set of S from J ∩ S. Example 7. Let f (x, y) = 3x − 2y, g(x, y) = x − 3y, b = 11 and S the proportionally modular affine semigroup defined by the modular inequality f (x, y) mod b ≤ g(x, y). In order to obtain a generating set of S, we follow the steps of Algorithm 1. First, we compute the minimal non null vector u ∈ N2 solving the system of modular equations {f (x, y) mod b ≤ g(x, y), g(x, y) = 0}. In this case we have 7y mod 11 = 0. So, u = (33, 11). For computing e u it is needed to solve the modular equation f (x, 0) mod b ≤ g(x, 0) ≡ 3x mod 11 ≤ x. The proportionally numerical semigroup obtained is the generated by {4, 5, 11}, and therefore e u = (4, 0). The point w = {(x, y) ∈ R2 |g(x, y) = 11} ∩ OX is equal to w = (11, 0). Another set we need is G = S∩ConvexHull({(0, 0), (33, 11), (48, 11), (17, 0)}). The last step is performed taking the minimal elements of G. The software [8] allows us to compute the minimal generating set of S just as follows: In[1]:= ProporcionallyModularAffineSemigroupN2[3, -2, 11, 1, -3] Out[1]= {{4., 0.}, {5., 0.}, {5., 1.}, {8., 1.}, {9., 2.}, {11., 0.}, {13., 3.}, {14., 4.}, {18., 5.}, {19., 6.}, {23., 7.}, {28., 9.}, {33., 11.}} To conclude this section we make a geometric approach to the computation of the Frobenius vectors of a proportionally modular affine semigroup of N2 . By using this approximation, we present an algorithm to determine the minimal Frobenius vectors in these semigroups. Definition 8. We say that an affine semigroup T has a Frobenius vector if there exists an element q ∈ / T belonging to the group G(T ) (the subgroup of Np generated by T ) such that (q + Tint(L(T ))) ∩ G(T ) ⊂ S \ {0}. A Frobenius vector is called minimal Frobenius vector if it is minimal with respect to the product ordering on Np . Proposition 9. Let S ⊂ N2 be a nontrivial proportionally modular semigroup. Then the following hold: • If g1 g2 ≤ 0, the unique minimal Frobenius vector of S is the minimal integer element of ConvexHull({O, u, w, w + u}) \ S closest to the line {x ∈ R2 |g(x) = b}. • If g1 g2 > 0, the (minimal) Frobenius vectors are in the finite set (ConvexHull({O, w1 , w2 }) ∩ N2 ) \ S. Proof. We consider two cases: g1 g2 > 0, and g1 g2 ≤ 0. Assume that g1 g2 > 0, and let w1 and w2 be the unique two elements of {x ∈ R2 |g(x) = b} ∩ (OX ∪ OY ). In this case, note that L(S) is equal to Q2+ and (L(S)∩N2 )\S is the nonempty finite set ∆ = (N2 ∩ConvexHull({0, w1 , w2 }))\S. Any maximal element ω in ∆ satisfies that (ω+Tint(L(S)))∩G(S) ⊂ S. So, these maximal elements are Frobenius vectors. Besides, for any non maximal element ω1 belonging to ∆, there exists ω ∈ ∆ maximal such that ω ∈ ω1 + L(S) but it is possible that there is not a maximal element belonging to ω1 + Tint(L(S)). In 9 that case, ω1 is also a Frobenius vector. Thus, every minimal Frobenius vector is a maximal elements in ∆ or an element ω1 in ∆ such that there is no maximal element belonging to ∆ in ω1 + Tint(L(S)). Assume now g1 g2 ≤ 0. The cone L(S) is generated by u and w, where w is the point {x ∈ R2+ |g(x) = b} ∩ (OX ∪ OY ). Since u is a non-negative vector, any integer element q ∈ L(S) \ (w + L(S)) can be expressed as q = p + λu with λ ∈ N and p ∈ N2 ∩ConvexHull({O, u, w, w +u}). Thus, the minimal Frobenius vectors of S belong to the finite and nonempty set ∆ = (N2 ∩ ConvexHull({O, u, w, w + u})) \ S. Let w be the minimal closest point to the line {g(x) = b} belonging to ∆. We have (w + Tint(L(S))) ∩ N2 ⊂ S. Besides, for any other integer element q ∈ (L(S) \ S) \ (w + L(S)) there exists λ ∈ N such that w + λu ∈ / S and w + λu ∈ q + L(S). Thus q is not a minimal Frobenius vector and we conclude that S has a unique minimal Frobenius vector which is the minimal of the closest elements to {g(x) = b} belonging to ∆. An algorithm to compute the minimal Frobenius vectors can be formulated from the above Proposition. Example 10. In this example we illustrate the concept of minimal Frobenius vector. Let f (x, y) = 3x + 2y, g(x, y) = x − y and b = 10 be the elements of the modular inequality f (x, y) mod b ≤ g(x, y) and S be its proportionally modular semigroup associated. The point u is (2, 2) and w = (10, 0). Figure 2 illustrates the situation. The black points are the points in S, the dashed lines 6 5 4 3 2 1 0 X 0 5 10 15 Figure 2: Example of minimal Frobenius vector. are {g(x, y) = 0} and {g(x, y) = b} respectively, the shady region is the set ConvexHull({O, u, w, w + u}), and the point w = (9, 1) is the unique minimal Frobenius vector. Note that w + λu, with λ ∈ N, is again a Frobenius vector. 4 Some properties of proportionally modular semigroups of N2 . In this section we study the Cohen-Macaulayness, Gorensteinness and Buchsbaumness of proportionally modular affine semigroups of N2 . For this objective we consider only simplicial proportionally modular semigroups, and this occurs if the coefficients g1 and g2 of g(x, y) = g1 x + g2 y are not both lesser than or 10 equal to zero. Denote by S the proportionally modular semigroup of the Nsolutions of f (x, y) mod b ≤ g(x, y), and by G the set defined after Proposition 6. Again, u is the vector defined in Definition 4 and e u is the vector that appears after Proposition 6. The following result characterizes Cohen-Macaulay simplicial affine semigroups of N2 . Proposition 11. ([7, Corollary 2]) Let T ⊆ N2 be an affine simplicial semigroup, the following conditions are equivalent: 1. T is Cohen-Macaulay. 2. For all v ∈ (L(T ) ∩ N2 ) \ T , v + s1 or v + s2 does not belong to T where s1 and s2 are minimal generators of T such that L(T ) = hs1 , s2 i. As in the proof Proposition 6, if g1 and g2 satisfies g1 g2 > 0, N2 \ S is finite. So, S is simplicial but does not satisfy the second condition of Proposition 11, and thus S is not Cohen-Macaulay. For this reason, in what follows we assume that g1 g2 ≤ 0. Besides, we assume that the trivial case S = N2 does not happen. Fixed these conditions, next result characterizes the Cohen-Macaulay proportionally modular semigroup. Corollary 12. Any proportionally modular semigroup S is Cohen-Macaulay. Proof. With the fixed conditions, the semigroup S is an affine simplicial semigroup (Proposition 6) and the vector u can be considered as one of the minimal generator s1 or s2 appearing in Proposition 11. By Lemma 5, for any v ∈ (L(S) ∩ N2 ) \ S it is verified that v + u ∈ / S. So, S is Cohen-Macaulay. We focus now our attention on the Gorenstein property. We characterize this property in terms of the intersection of the Apéry sets of some minimal generators belonging to the extremal rays of its associated cone. Recall that the Apéry set associated to an element s in any semigroup T is the set Ap(s) = {a ∈ T |a − s ∈ / T }. The following result appears in [17, Theorem 4.6]. Theorem 13. For a given affine simplicial semigroup T, the following conditions are equivalent: 1. T is Gorenstein. 2. T is Cohen-Macaulay and ∩2i=1 Ap(si ) has a unique maximal element (with respect to the order defined by T ) where where s1 and s2 are minimal generators of T such that L(T ) = hs1 , s2 i. Since u and e u are minimal generators of S and L(S) = hu, e ui, the study of the set Ap(u) ∩ Ap(e u) allows us to check whether a proportional modular semigroup is Gorenstein or not. Lemma 14. Let S be a proportional modular semigroup verifying the fixed conditions. The set Ap(u) ∩ Ap(e u) is equal to the finite set {h ∈ G|h − u, h − e u∈ / S}. Proof. Let s be an element belonging to S \ G. Using a similar argument of the proof of Proposition 6, we obtain that S \ G is the set {h + λ1 u + λ2 e u|h ∈ G and λ1 , λ2 ∈ N}. Note that the vectors u and e u can be considered as the minimal generators s1 and s2 of Theorem 13, and then (∩2i=1 Ap(si ))∩(S\G) = ∅. Therefore, Ap(s1 ) ∩ Ap(s2 ) = {h ∈ G|h − s1 , h − s2 ∈ / S}. 11 Corollary 15. Let S be a proportional modular semigroup verifying the fixed conditions. The semigroup S is Gorenstein iff there exists a unique maximal element belonging to {h ∈ G|h − u, h − e u∈ / S}. For the last result of this work we have to define a semigroup associated to S. In general, given an affine semigroup T minimally generated by {s1 , . . . , st }, denote by T the affine semigroup {s ∈ Np |s + si ∈ T, ∀i = 1, . . . , t}. In [9], it is given a characterization of Buchsbaum simplicial semigroups T in terms of their semigroups T . Theorem 16. [9, Theorem 5] The following conditions are equivalent: 1. T is an affine Buchsbaum simplicial semigroup. 2. T is Cohen-Macaulay. Corollary 17. Let S be a proportional modular semigroup verifying the fixed conditions. Then, S is Buchsbaum. Proof. Note that the element u ∈ S is a minimal generator of S, and that for every a ∈ L(S) \ S, a + u ∈ / S. Thus, S = S. Since S is Cohen-Macaulay (see Corollary 12), by Theorem 16, S is Cohen-Macaulay. Example 18. Consider the modular inequality 7x − y mod 5 ≤ x − 14y. Its minimal generating set is: In[1]:= ProporcionallyModularAffineSemigroupN2[7, -1, 5, 1, -14] Out[1]= {{3., 0.}, {4., 0.}, {5., 0.}, {16., 1.}, {17., 1.}, {18., 1.}, {29., 2.}, {31., 2.}, {44., 3.}, {57., 4.}, {70., 5.}} By the previous results, this semigroup is Cohen-Macaulay, Gorenstein and Buchsbaum. These properties can be checked externally by using Macaulay2 with the following commands (see [11] for computing with Macaulay2): installPackage("MonomialAlgebras") V={{3, 0}, {4, 0}, {5, 0}, {16, 1}, {17, 1}, {18, 1}, {29, 2}, {31, 2}, {44, 3}, {57, 4}, {70, 5}} isCohenMacaulayMA V isGorensteinMA V isBuchsbaumMA V All the outputs obtained are true. References [1] A. Assi. The Frobenius vector of a free affine semigroup. Journal of Algebra and Its Applications, 11(4): 1250065 (10 pages), 2012. [2] A. Assi, P. A. Garcı́a-Sánchez, and I. Ojeda. Frobenius vectors, hilbert series and gluings. ArXiv:1311.1988 [math.AC]. [3] H. Bass. On the ubiquity of Gorenstein rings. Math. Z., 82:8–28, 1963. 12 [4] E. Briales, A. Campillo, C. Marijuán, and P. Pisón. Minimal systems of generators for ideals of semigroups. J. Pure Appl. Algebra, 124(1-3):7–30, 1998. [5] W. Bruns and J. Herzog. Cohen-Macaulay rings, volume 39 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1993. [6] J. I. Garcı́a-Garcı́a, M. A. Moreno-Frı́as, A. Sánchez-R.-Navarro, and A. Vigneron-Tenorio. Affine convex body semigroups. Semigroup Forum, 87(2):331–350, 2013. [7] J. I. Garcı́a-Garcı́a and A. Vigneron-Tenorio. Computing families of CohenMacaulay and Gorenstein rings. Semigroup Forum, 88(3):610–620, 2014. [8] J. I. Garcı́a-Garcı́a and A. Vigneron-Tenorio. ProporcionallyModularAffineSemigroupN2, a software system to solve a proportionally modular inequality in N2 . Available at http://departamentos.uca.es/C101/ pags-personales/alberto.vigneron/p_m_a_s_n2.zip. [9] P. A. Garcı́a-Sánchez and J. C. Rosales. On Buchsbaum simplicial affine semigroups. Pacific J. Math., 202(2):329–339, 2002. [10] S. Goto. On Buchsbaum rings. J. Algebra, 67(2):272–279, 1980. [11] D. R. Grayson and M. E. Stillman. Macaulay2, a software system for research in algebraic geometry. Available at http://www.math.uiuc.edu/ Macaulay2/. [12] C. Huneke. Hyman Bass and ubiquity: Gorenstein rings. In Algebra, Ktheory, groups, and education (New York, 1997), volume 243 of Contemp. Math., pages 55–78. Amer. Math. Soc., Providence, RI, 1999. [13] P. Pisón-Casares and A. Vigneron-Tenorio. N-solutions to linear systems over Z. Linear Algebra Appl., 384:135–154, 2004. [14] A. M. Robles-Pérez and J. C. Rosales. Proportionally modular numerical semigroups with embedding dimension three. Publ. Math. Debrecen, 84(34):319–332, 2014. [15] J. C. Rosales. The maximum proportionally modular numerical semigroup with given multiplicity and ratio. Semigroup Forum, 82(1):83–95, 2011. [16] J. C. Rosales, J. I. Garcı́a-Sánchez, P. A. Garcı́a-Garcı́a, and J. M. UrbanoBlanco. Proportionally modular Diophantine inequalities. J. Number Theory, 103(2):281–284, 2003. [17] J. C. Rosales and P. A. Garcı́a-Sánchez. On Cohen-Macaulay and Gorenstein simplicial affine semigroups. Proc. Edinburgh Math. Soc. (2), 41(3):517–537, 1998. [18] J. C. Rosales, P. A. Garcı́a-Sánchez, and J. M. Urbano-Blanco. The set of solutions of a proportionally modular Diophantine inequality. J. Number Theory, 128(3):453–467, 2008. 13 [19] J. C. Rosales and J. M. Urbano-Blanco. Irreducible proportionally modular numerical semigroups. Publ. Math. Debrecen, 78(2):359–375, 2011. [20] A. Schrijver. Theory of linear and integer programming. Wiley-Interscience Series in Discrete Mathematics. John Wiley & Sons, Ltd., Chichester, 1986. A Wiley-Interscience Publication. [21] J. Stückrad and W. Vogel. Buchsbaum rings and applications. An interaction between algebra, geometry and topology. Springer-Verlag, Berlin, 1986. 14
0math.AC
Geometric Rescaling Algorithms for Submodular Function Minimization arXiv:1707.05065v2 [math.OC] 2 Nov 2017 Daniel Dadush∗ [email protected] László A. Végh†‡ [email protected] Giacomo Zambelli ‡ [email protected] Abstract We present a new class of polynomial-time algorithms for submodular function minimization (SFM), as well as a unified framework to obtain strongly polynomial SFM algorithms. Our new algorithms are based on simple iterative methods for the minimum-norm problem, such as the conditional gradient and the Fujishige-Wolfe algorithms. We exhibit two techniques to turn simple iterative methods into polynomial-time algorithms. Firstly, we use the geometric rescaling technique, which has recently gained attention in linear programming. We adapt this technique to SFM and obtain a weakly polynomial bound O((n4 · EO + n5 ) log(nL)). Secondly, we exhibit a general combinatorial black-box approach to turn any strongly polynomial εL-approximate SFM oracle into a strongly polynomial exact SFM algorithm. This framework can be applied to a wide range of combinatorial and continuous algorithms, including pseudo-polynomial ones. In particular, we can obtain strongly polynomial algorithms by a repeated application of the conditional gradient or of the Fujishige-Wolfe algorithm. Combined with the geometric rescaling technique, the black-box approach provides a O((n5 · EO + n6 ) log2 n) algorithm. Finally, we show that one of the techniques we develop in the paper, “sliding”, can also be combined with the cutting-plane method of Lee, Sidford, and Wong [27], yielding a simplified variant of their O(n3 log2 n · EO + n4 logO(1) n) algorithm. ∗ Centrum Wiskunde & Informatica. Supported by NWO Veni grant 639.071.510. London School of Economics. ‡ Supported by EPSRC First Grant EP/M02797X/1. † 1 1 Introduction Given a finite set V , a function f : 2V → Z is submodular if f (X) + f (Y ) ≥ f (X ∩ Y ) + f (X ∪ Y ) ∀X, Y ⊆ V. (1) We denote n := |V |. Examples include the graph cut function, the coverage function, or the entropy function. Submodularity can be interpreted as a diminishing returns property and is therefore important in economics and game theory. Submodular optimization is widely applied in machine learning and computer vision (see e.g. [1]). We will assume that the function f is given via an evaluation oracle: for every set S ⊆ V , we can query the value f (S) in time EO. We will assume throughout that f (∅) = 0; this is without loss of generality. In the submodular function minimization (SFM) problem, the objective is to find a minimizer of this function: min f (S). S⊆V (SFM) The first polynomial-time – indeed, strongly polynomial – algorithm was given by Grötschel, Lovász, and Schrijver in 1981, using the ellipsoid method [19]. It remained an important goal to find a strongly polynomial combinatorial algorithm, which was resolved in 2000, independently by Schrijver [30], and by Iwata, Fleischer, and Fujishige [23]. The best current running time of a combinatorial algorithm is O(n5 · EO + n6 ) by Orlin [28]. A recent breakthrough result by Lee, Sidford, and Wong [27] gave an improved variant of the ellipsoid method with running time O(n3 log2 n · EO + n4 logO(1) n). However, the above algorithms do not appear to work well for large scale instances that arise in applications such as speech recognition or image segmentation. A line of recent work has focused on exploiting special structure of submodular functions that arise in these applications, such as decomposability [13, 12, 26, 32]. But for general functions, simple iterative algorithms appear to outperform the provably polynomial algorithms [18]. In particular, the Fujishige-Wolfe minimum-norm point algorithm [15, 34] appears to be among the best ones in practice [1, 18], despite the fact that the first pseudo-polynomial running time bound was given as recently as 2014, by Chakrabarty et al. [5]. Our contributions This paper presents polynomial-time algorithms based on simple iterative methods such as the conditional gradient algorithm or the Fujishige-Wolfe algorithm. We exhibit two different techniques to improve the performance of these algorithms to polynomially bounded. The first technique uses geometric rescaling, whereas the second provides a unified combinatorial framework for strongly polynomial SFM algorithms. In what follows, we provide an overview of both techniques. Geometric rescaling has recently gained attention for linear programming. We use the “Full Support Image Algorithm” from [8]; this was also obtained independently by Hoberg and Rothvoß [21]. This is a general algorithmic technique to turn simple iterative algorithms to polynomial-time algorithms for LP feasibility, by adaptively changing the scalar product. The first such algorithms were given by Betke [3], and by Dunagan and Vempala [10]; we refer the reader to [8] for an overview of the literature. The method is also applicable to conic problems in the oracle model [2, 7, 8, 29]. Geometric rescaling algorithms are inherently for feasibility problems. The immediate application of [8] to (SFM) would only provide the optimum value to (SFM) using binary search1 . However, doing so would not provide us a primal optimal solution (that is, a minimizer set), nor a dual certificate of optimality (as in Theorem 2.1). We introduce new techniques to obtain both primal and dual optimal solutions. The sliding technique is used to obtain a primal optimal solution: we reduce the optimization problem (SFM) to a dynamically changing feasibility problem. In case of infeasibility, the geometric rescaling algorithms terminate when a certain number of iterations is reached, without providing a 1 Indeed, any polynomial-time algorithm for conic feasibility can be turned into a weakly-polynomial algorithm for (SFM) using binary search. For example, in a recent note Fujishige [17] shows how an algorithm of Chubanov [7] can be used in this framework. 2 Farkas certificate of infeasibility. The pull-back technique enables to identify a dual optimality certificate (and more generally, an approximate dual solution). This technique is also applicable in the general LP setting. Our geometric rescaling algorithm finds both primal and dual optimal solutions, in running time O((n4 · EO + n5 ) log(nL)). Here, the complexity parameter L denotes the largest norm of a point in the base polytope. This matches the best weakly polynomial guarantees [22, 24] prior to [27]. Building on the geometric rescaling technique, we also obtain a strongly polynomial O((n5 · EO + n6 ) log2 n). This is obtained from a unified combinatorial framework that can turn any strongly polynomial εL-approximate SFM-oracle into an exact strongly polynomial algorithm. In fact, pseudo-polynomial poly(n, 1/ε) running time suffices. Hence, somewhat surprisingly, we can even use the conditional gradient or the Fujishige-Wolfe algorithm to obtain strongly polynomial running times. We can also apply this unified framework to the cutting plane method. Using the cutting plane technique by Lee, Sidford, and Wong [27], we obtain a much simpler SFM algorithm than the one described in their paper, with the same running time bound O(n3 log2 n · EO + n4 logO(1) n). Interestingly, our variant based on cutting-planes does not rely on the Lovász extension, as is the case both for Lee, Sidford, and Wong, and for Grötschel, Lovász, and Schrijver. Rather, we apply the cutting plane method to the strict feasibility problem for a suitably defined convex set. This is made possible by the use of the same sliding technique developed for our geometric rescaling algorithm. The general combinatorial framework is based on maintaining a ring family guaranteed to contain all minimizer sets, where the size of the family decreases through the algorithm until a minimizer is found. This technique was introduced by Iwata, Fleischer, and Fujishige [23], and used in multiple subsequent papers, such as Iwata and Orlin [24], and Lee, Sidford, and Wong [27]. We note that this technique traces back to strongly polynomial algorithms for minimum-cost flows, pioneered by Tardos [33]. Our implementation also adopts a simplified variant of the bucketing technique of [27] that leads to a factor n improvement in the running time as compared to the original framework of [23]. An advantage of our unified framework is that, unlike all previous papers where the combinatorial arguments on the ring-family are intertwined with the details of some “basic” algorithm – which can be combinatorial in nature as in [23] and [24] or continuous as in [27] – here we use a black-box approach, by explicitly formulating the approximate oracle requirement, and then showing that the “basic” routine fulfills those requirements. The rest of the paper is structured as follows. Section 2 contains problem definitions and the necessary background, including an overview of the relevant iterative methods. Section 3 presents the weakly polynomial geometric rescaling algorithm to solve SFM. Section 4 presents the general framework for strongly polynomial algorithms. In Section 5, we describe the pull-back technique that enables the implementation of the approximate oracle using our geometric rescaling method. Finally, Section 6 shows how the cutting plane methods can be used in the strongly polynomial framework. 2 Preliminaries We refer the reader to [31, Sections 44-45] on the basics of submodular optimization; this contains all definitions and basic results presented next. The survey [1] provides an overview of continuous algorithms for submodular function minimization. For a vector z ∈ RV , we denote by P z(v) the component of z relative to v, and for a subset S ⊆ V we use the notation z(S) = v∈S z(v). For a number a ∈ R, we let a+ = max{0, a} and a− = min{0, a}; hence, a = a+ + a− . Similarly, given a vector z ∈ RV , we denote z + = (z(v)+ )v∈V and z − = (z(v)− )v∈V . The base polytope and the greedy algorithm The submodular base polytope B(f ) of a submodular function f is defined as B(f ) := {x ∈ RV : x(S) ≤ f (S) ∀S ⊆ V, x(V ) = f (V )}. 3 This polytope is non-empty for every submodular function f . The elements of B(f ) are called bases, and the vertices are the extreme bases. The extreme bases correspond to permutations of the ground set. More precisely, for any ordering v1 , v2 , . . . , vn of V , the following point is a vertex of B(f ), and every vertex is of this form for some ordering: x(v1 ) := f ({v1 }), x(vi ) := f ({v1 , . . . , vi }) − f ({v1 , . . . , vi−1 }) ∀i = 2, . . . , n. (2) Furthermore, given a weight function w : V → R, one can compute an extreme base minimizing w⊤ x by the greedy algorithm GreedyMin(f, w) as follows: order the vertices in V so that w(v1 ) ≤ w(v2 ) ≤ . . . ≤ w(vn ), and output x defined by (2) as the optimal solution. The value of the minimum-cost is then given by min w⊤ x = x∈B(f ) n−1 X i=1 f ({v1 , . . . , vi })(w(vi ) − w(vi+1 )) + f (V )w(vn ). (3) The subroutine GreedyMin(f, w) requires O(n · EO + n log n) arithmetic operations. If w has several entries with the same value, then there are multiple ways to sort the elements of V in ascending value of w, each giving rise to a different optimal extreme base of B(f ). The extreme bases corresponding to the possible tie-breakings are the vertices of the face of B(f ) minimizing w⊤ x. If v1 , . . . , vn is the ordering computed by GreedyMin(f, w), we define def MinSet(f, w) = argmin{f (S) : S = {v1 , . . . , vi }∃i ∈ [n]}. (4) A min-max characterization of (SFM) was given by Edmonds: Theorem 2.1 (Edmonds [11]). For a submodular function f : 2V → R, we have max{x− (V ) : x ∈ B(f )} = min{f (S) : S ⊆ V }. (5) We will often use the following simple consequence. Assume that for some x ∈ B(f ), S ⊆ V , and ε > 0, we have f (S) ≤ x− (V ) + ε. Then f (S) ≤ f (T ) + ε for any T ⊆ V . Complexity parameters There are multiple complexity parameters relevant for SFM. def def def Lf = max{kzk1 : z ∈ B(f )}, Lf,2 = max{kzk2 : z ∈ B(f )}, Ff = max{|f (S)| : S ⊆ V }. That is, Lf and Lf,2 √are the maximum 1 and 2-norms of the (extreme) bases of B(f ). Clearly, Lf,2 ≤ Lf ≤ nLf,2 . It is also well-known that Lf = Θ(Ff ) (see e.g. [6, Lemma 5], and also [20, 25]). Some of our algorithms require the explicit knowledge of a complexity parameter. We can use the following upper-bounds. Let α(v) = max{f ({v}), |f (V ) − f (V \ {v})|}. Then, for every z ∈ B(f ), |z(v)| ≤ P α(v) (see [16, Section 3.3]). Hence, we can upper bound Ff ≤ Lf ≤ α(V ) and Lf,2 ≤ v∈V α(v)2 . On the other hand, α(v) ≤ Ff for all v ∈ V . To summarize, log(nZ) P is within a constant factor of the same value for any choice of Z ∈ {Ff , Lf , Lf,2 , α(V ), v α(v)2 }. Since our running time bounds will contain such terms, the choice of the specific complexity parameter does not matter. The minimum-norm point problem Fujishige [15] showed a reduction of (SFM) to the following convex quadratic optimization problem. Theorem 2.2 (Fujishige [15]). Let z be the unique optimal solution to   1 min kxk22 : x ∈ B(f ) . 2 (6) Then, the set S ∗ = {v ∈ V : z(v) < 0} is a minimizer of (SFM). Furthermore, |f (S ∗ )| ≤ √ nkzk2 . 4 We remark that the set S ∗ in the above claim is in fact the inclusion-wise minimal minimizer to (SFM) [15]. Note that in case of f (V ) = 0, Theorems 2.1 and 2.2 imply that the minimizer of the 2-norm also minimizes the 1-norm in B(f ). An approximate optimal solution to (6) can be converted to an approximate optimal solution to (5), as stated below (see [5, Theorem 5]). Theorem 2.3. Assume that z ∈ B(f ) satisfies that kzk22 ≤ z ⊤ x + δ 2 for any x ∈ B(f ). Let S = MinSet(f, z). Then, f (S) ≤ z − (V ) + 2nδ. Consequently, f (S) ≤ f (T ) + 2nδ for any T ⊆V. 2.1 Iterative methods for SFM Convex optimization algorithms can be naturally applied to SFM, either by solving the quadratic formulation (6), or by minimizing the so-called Lovász-extension, which we do not discuss here. We refer the reader to [1] for an overview of such algorithms. Here, we briefly outline two important algorithms based on (6). The conditional gradient algorithm The conditional gradient, or Frank-Wolfe alPk gorithm maintains a point y ∈ B(f ), represented as a convex combination y = i=1 λi gi of extreme bases. It is initialized with y = g for an arbitrary extreme base g. Every iteration runs GreedyMin(f, y) to obtain an extreme base g ′ . If y ⊤ g ′ ≥ kyk22 , then y is the minimum-norm point in B(f ), and the algorithm terminates. Otherwise, y is replaced by the minimum-norm point y ′ on the line segment [y, g ′ ]. The standard convergence analysis of the conditional gradient algorithm, together with Theorem 2.3 provide the following convergence bound (see e.g. [1, Sec 10.8]). Theorem 2.4. For any δ > 0, within O(n/δ 2 ) iterations of the conditional gradient algorithm, we obtain a y ∈ B(f ) such that for S = MinSet(f, y), we have f (S) ≤ y − (V ) + O(δLf,2 ). The total running time is O((n2 · EO + n2 log n)/δ 2 ). The Fujishige-Wolfe algorithm Wolfe [34] gave a finite algorithm for finding the minimum-norm point in a polytope given by its vertices; his algorithm can also be interpreted as an active set method [1]. Fujishige adapted Wolfe’s algorithm to SFM [15, 18]. We now give a brief sketch of the algorithm; for a more detailed description, see [5, 18, 34]. An affinely independent set of points X ∈ Rn is called a corral if the orthogonal projection of 0 to the affine hull of X is in the relative interior of the convex hull of X. In particular, the optimal solution to the minimum-norm point problem can be obtained by a corral, comprising vertices of the face of a polytope containing the minimum-norm point. Every major cycle of the Fujishige-Wolfe algorithm starts and ends with a corral formed by extreme bases in B(f ). The algorithm is initialized with an arbitrary extreme base (note that every singleton set is a corral). Let X be the corral at the beginning of a major cycle, and let y be the projection of 0 to the affine hull of X; this can be obtained by a closedform formula. Let us run GreedyMin(f, y) to obtain an extreme base g ′ . If y ⊤ g ′ ≥ kyk22 , then the algorithm terminates with y as the minimum-norm point in B(f ). Otherwise, we consider X ′ = X ∪ {g ′ }, which is also affinely independent. We set x̄ = y, and compute y ′ as the projection of 0 to the affine hull of X ′ . If y ′ is in the relative interior of conv(X ′ ), the major cycle terminates with the new corral X ′ . Otherwise, we start a minor cycle: we replace X ′ by the extreme points of the face of the conv(X ′ ) that contains the intersection point [x̄, y ′ ] ∩ conv(X ′ ); the new x̄ is defined to be this intersection point. Minor cycles are repeated until a corral is obtained. Finite convergence is guaranteed since kx̄k2 decreases in every major and minor cycle, and the number of corrals is finite. However, a bound on the convergence rate was only recently given in [5]. Theorem 2.5 (Chakrabarty et al. [5]). For any δ > 0, within O(n2 /δ 2 ) iterations (major and minor cycles) of Wolfe’s algorithm, we obtain a y ∈ B(f ) such that for S = MinSet(f, y), we have f (S) ≤ y − (V ) + O(δLf,2 ). The total running time is O((n3 · EO + n5 )/δ 2 ). 5 The line-Fujishige-Wolfe algorithm There is a natural way to speed up the convergence of the Fujishige-Wolfe algorithm, by combining it with the conditional gradient step. For the minimum-norm point algorithm, Betke [3, Algorithm 2.8] proposed such a variant; the authors are not aware of this algorithm having been used in the submodular context. The only change compared to the Fujishige-Wolfe algorithm is that at the beginning of every major cycle, x̄ is set to be the minimum-norm point on the line segment [y, g ′ ] instead of y. This is the same as the optimal line search in the conditional gradient method. Consequently, in every major cycle we make at least as much progress as in the conditional gradient algorithm. It is easy to see that in the Fujishige-Wolfe algorithm the total number of iterations is at most twice the total number of major cycles. The iteration bound in Theorem 2.5 can be improved to O(n/δ 2 ), and the total running time to O((n2 ·EO+n4 )/δ 2 ). 3 Weakly polynomial algorithm via rescaling The geometric rescaling algorithm The Full Support Image Algorithm in [8, Section 3.2] is applicable to the following oracle setting. Let Σ ⊆ Rn be non-empty, full dimensional cone; our aim is to find a feasible point in the interior. We are given a separation oracle for int(Σ); that is, for any vector w, the oracle decides whether w ∈ int(Σ), and if not, it returns a vector z such that z ⊤ w ≤ 0 but z ⊤ y > 0 for all y ∈ int(Σ). Then the algorithm finds a point in int(Σ) in O(n3 log ω̂ −1 ) calls to the separation oracle, where ω̂ is a condition number which we will define in Section 3.3. The parameter ω̂ can be lower bounded by the width of the cone Σ, defined as the radius of the largest ball contained in Σ and centered on the surface of the unit sphere. Consider now a submodular function f with f (V ) = 0. Assume we want to decide whether f (S) ≥ 0 for all S ⊆ V , that is, if S = ∅ is an optimal solution to (SFM). This is equivalent to 0 ∈ B(f ) (note that f (V ) = 0 is needed for this equivalence). Consider now the cone Σ = {w ∈ Rn : w⊤ y ≥ 0 ∀y ∈ B(f )}. This cone has a non-empty interior whenever (6) is different from 0, or equivalently, if 0 ∈ / B(f ). A separation oracle for Σ is provided by GreedyMin(f, w). Consequently, if the algorithm does not terminate in the required running time bound, we can conclude that f (S) ≥ 0 for all S ⊆ V . We can use this algorithm in a binary search framework to solve (SFM). When querying minS⊆V f (S) ≥ −µ for a µ > 0, we shift f (S) by f (S) + µ for every S ( V , S 6= ∅. The main drawback of this algorithm is that it only provides the optimum value, but does not give either an optimal set S, nor a dual certificate as in Theorem 2.1. Also, the binary search leads to an additional factor log Ff in the running time. In this section, we describe a variant of this algorithm, which provides a primal optimal solution, and does not require binary search. This will be achieved by dynamically shifting or “sliding” the function f throughout the algorithm, as explained below. However, the algorithm does not directly return a dual certificate of optimality. This can be obtained using the pull-back technique introduced in Section 5; see also the remark after Theorem 4.1. We start by describing the sliding framework. Besides the geometric rescaling algorithm described next, this technique will also be useful for devising simple cutting plane algorithms for SFM in Section 6. Sliding the function Throughout the algorithm, we maintain a value µ ∈ Z+ , along with a set W , such that f (W ) = −µ. We initialize µ = max{0, −f (V )}, and set W = ∅ or W = V accordingly. Hence −µ gives an upper bound on minS⊆V f (S). The algorithm terminates once it concludes that f (W ) = minS⊆V f (S) for the current W . We define the function fµ : 2V → Z as ( 0, if S = ∅ or S = V, def fµ (S) = (7) f (S) + µ, otherwise. This operation is known as the µ-enlargement of the function f (see Fujishige [16, Section 3.1(d)]). 6 Lemma 3.1. For a submodular function f and a value µ ≥ max{0, −f (V )}, the function fµ is submodular. If 0 ∈ B(fµ ), then −µ ≤ f (S) for every S ⊆ V . Furthermore, B(fµ ) ⊆ B(fµ′ ) whenever µ ≤ µ′ . Proof. The function f ′ (S) = f (S) + µ is clearly submodular. We obtain fµ from f ′ by decreasing the value of f ′ (∅) and f ′ (V ); note that the bound on µ guarantees that these are both nonnegative. This maintains submodularity, since for any choice of X and Y , the RHS in (1) decreases by at least as much as the LHS when replacing f ′ by fµ . If 0 ∈ B(fµ ), then 0 ≤ fµ (S) for any S ⊆ V . If S ∈ / {∅, V }, then this gives f (S) ≥ −µ; the choice of µ guarantees the same for S = ∅ and S = V . For µ′ ≥ µ, the containment B(fµ ) ⊆ B(fµ′ ) follows, since the constraints x(S) ≤ fµ′ (S) are implied by the constraints x(S) ≤ fµ (S). The following Lemma will be used to update the value of µ. Lemma 3.2. Consider a value µ ≥ max{0, −f (V )}, and let w : V → R be a cost function such that min{w⊤ x : x ∈ B(fµ )} > 0. For S = MinSet(fµ , w),we have f (S) < −µ. Proof. Let v1 , . . . , vn be the ordering of V returned by GreedyMin(f, w). Recall that w(v1 ) ≤ w(v2 ) ≤ . . . ≤ w(vn ). From (3) we see that the maximum value of w⊤ x over B(fµ ) can be written as ⊤ w x= n−1 X i=1 (f ({v1 , . . . , vi }) + µ)(w(vi ) − w(vi+1 )). Since w⊤ x > 0 and w(vi ) − w(vi+1 ) ≤ 0 for i = 1, . . . , n − 1, it follows that f ({v1 , . . . , vi }) < −µ for some value of i, implying the claim. Lemma 3.3. Consider a value µ ≥ max{0, −f (V )} such that µ = −f (W ) for some W ⊆ V . Then, Lfµ ≤ 4Lf . Proof. For any permutation of the ground set, let g and g ′ be the corresponding extreme bases in B(f ) and in B(fµ ), respectively. These only differ in the first and last elements: respectively by +µ, and by −µ − f (V ). Hence, kg ′ k1 ≤ kgk1 + 2µ + |f (V )|. Note that µ ≤ Lf ; this is because µ = −f (W ) for a certain set W , and therefore any permutation that starts with the elements of W will give an extreme base of 1-norm at least |f (W )|. Also, |f (V )| ≤ Lf . The claim follows. 3.1 The sliding von Neumann algorithm The Full Support Image Algorithm uses the von Neumann algorithm as the basic subroutine. The von Neumann algorithm was described in [9] to find a feasible solution to the system A⊤ y > 0 for a matrix A ∈ Rn×p . It can be P seen as a variant of the conditional gradient algorithm for minimizing 21 kyk2 over y = Ax, xi = 1, x ≥ 0. The main difference between the conditional gradient and the von Neumann algorithm is that the latter one only needs to decide whether the optimum value is positive. As a consequence, it does not require a minimization oracle for y ⊤ z over the convex hull of the columns. Instead, one only needs to decide whether this minimum is positive, and if not, find a column ai such that y ⊤ ai < 0. This will be important for SFM, since we have to run the von Neumann algorithm not over B(f ), but over the convex hull of the normalized extreme bases (with respect to a certain norm). When applied to SFM, the von Neumann algorithm would only be able to decide whether 0 ∈ B(f ), or equivalently, if f (S) ≥ 0 (assuming f (V ) = 0). Our sliding von Neumann algorithm (Algorithm 1) works directly for SFM, using the adaptive shifting fµ described above. At any point when the algorithm would conclude 0 ∈ / B(fµ ), the value of µ is increased, and the algorithm continues with the modified problem. This technique is analogous to the sliding objective function method when applying the ellipsoid algorithm to optimization problems, see e.g. [4]. However, we do not change a single constraint (corresponding to the objective function), but modify almost every constraint in the feasible region B(f ). The key feature of geometric rescaling algorithms is that the scalar product changes from the standard Euclidean one. The input includes a positive semidefinite matrix Q ∈ Rn×n , 7 Algorithm 1 The sliding von Neumann algorithm Input: A submodular function f : 2V → Z, a value µ ≥ max{0, −f (V )}, a set W ⊆ V with f (W ) = −µ, a positive definite matrix Q ∈ Rn×n , and an ε > 0. Output: • A value µ′ ≥ µ and a set W ′ ⊆ V with f (W ′ ) = −µ′ , 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: • bases g1 , . . . , gk ∈ B(fµ′ ), x ∈ Rk , y ∈ Rn such that P y = ki=1 xi gi /kgi kQ , ~e⊤ x = 1, x ≥ 0, and kykQ ≤ ε. Pick g1 as an arbitrary vertex of B(fµ ). Set x1 := 1, y := g1 /kg1 kQ . Let k := 2. while kykQ > ε do Let gk ← GreedyMin(fµ , Qy). if y ⊤ Qgk > 0 then ⊲ sliding W :=MinSet(fµ , Qy); δ := −fµ (W ); µ := −f (W ); Set v1 and vn to be the first and last elements of V in increasing order by the weight vector Qy. gk (v1 ) := gk (v1 ) + δ; gk (vn ) := gk (v1 ) − δ. end if D E y − kggkkkQ , y Q λ := 2 ; gk y − kgk kQ Q y := (1 − λ)y + λgk /kgk kQ ; ⊲ min Q-norm point on [y, gk /kgk kQ ] 12: xk := λ; 13: for i = 1, . . . , k − 1 do xi := (1 − λ)xi 14: k := k + 1 return µ, W , the vectors g1 , . . . , gk , x, and y. 11: def def and we use the scalar product hx, yiQ = x⊤ Qy; this induces the norm kxkQ = hx, xiQ . The overall algorithm in Section 3.2 runs the sliding von Neumann algorithm several times, each time with a different scalar product Q. Let us now give an overview of Algorithm 1. We initialize the parameter µ = max{0, −f (V )}, and work with fµ ; µ may increase during the algorithm. We maintain a vector y, which is a convex combination of vectors in B(fµ ), divided by their Q-norms. At every iteration, we call GreedyMin(fµ , Qy) to obtain an extreme base gk ∈ B(fµ ) minimizing y ⊤ Qx over ⊤ B(f h µ ). Ifiy Qgk ≤ 0, then we update y to the minimum Q-norm point on the line segment y, kggkkkQ (which is given by the choice of λ in line 10). Consider now the case y ⊤ Qgk > 0. This means that Qy is the normal vector of a hyperplane separating B(fµ ) from 0. In particular, this implies that minS⊆V fµ (S) < 0, that is, minS⊆V f (S) < −µ. In this case, we “slide” the function, by updating µ to a larger value as follows. We update W := MinSet(fµ , Qy) and µ := −f (W ). Lemma 3.2 guarantees that this strictly increases the value of µ by a positive δ. We change gk to represent the output of GreedyMin(fµ , Qy) for the new value of µ; this can be obtained by changing the first and last components of gk in the decreasing order of the elements v of V with respect to the weight function Qy. Lemma 3.4. Algorithm 1 terminates in ⌈1/ε2 ⌉ iterations. At any point of the algorithm P y/γ ∈ B(f ), where γ = ki=1 λi /kgi kQ . Proof. According to Lemma 3.2, whenever we change µ, we set a larger value, and y ⊤ Qgk ≤ 0 8 after the change. According to Lemma 3.1, the polytope B(fµ ) becomes larger at this change; hence all previous gi ’s will bases in B(fµ ), although they are not extreme bases (vertices) anymore. This implies the second claim. The iteration bound follows by the standard argument for von Neumann’s algorithm [9]: 1/kyk2Q increases by at least 1 at every update. Similarly to Algorithm 1, one can adapt the Fujishige-Wolfe or the line-Fujishige-Wolfe algorithm to this setting, that is, with sliding the value µ, and using GreedyMin(fµ , Qy) instead of GreedyMin(f, y). 3.2 Geometric rescaling algorithm for SFM Algorithm 2 Rescaling-SFM Input: A submodular function f : 2V → Z. Output: A set W minimizing f (W ). 1: Set Q := In , R := In . 2: Set µ := max{0, −f (V )}. 3: if f (V ) < 0 then W := V , else W := ∅. 4: for i = 1, . . . , T do 5: Call Sliding von Neumann(f, µ, W, Q, ε) to obtain the new values of µ and W , and vectors g1 , . . . , gk , x, y. 6: If y = 0, then stop; return W 7: rescale ! k X xi 1 ⊤ ; Q := R−1 . (8) R+ R := 2 gi gi (1 + ε)2 kg k i Q i=1 return W . Algorithm Rescaling-SFM is shown in Algorithm 2. It is the adaptation of the Full Support Image Algorithm to our submodular setting, using the sliding von Neumann algorithm. We need to modify the algorithm and its analysis to reflect that the feasible region keeps changing due to the updates to the value of µ. We use the parameters def ε= 1 , 20n def T = 5n log(nLf,2 ). The value µ keeps increasing during the algorithm; it is updated within the sliding von Neumann subroutine. We also maintain a set W with f (W ) = −µ. The algorithm stops after T rescalings. At this point, we conclude from a volumetric argument that the current W is the minimizer of f . We show the following running time bound. Theorem 3.5. Algorithm Rescaling-SFM finds an optimal solution to (SFM) in time O((n4 · EO + n5 ) log(nLf,2 )). Note that, P the definition of T requires knowing the value of Lf,2 ; we can replace it by the bound v∈V α(v)2 as in Section 2. As noted there, this changes the overall running time bound only by a constant factor. We also note that the rescaling formula (8) uses the denominator (1 + ε)2 instead of 1 + ε as in [8]. This is needed in the proof of Lemma 5.2 in Section 5. Nevertheless, the analysis in [8] remains valid by choosing, as we did here, ε smaller by a constant factor. Let us also note that Hoberg and Rothvoß [21, Section 2.1] present an alternative rescaling method, which uses only rank-1 rescaling in an appropriately chosen random direction; the algorithm admits the same complexity bounds. This variant can also be adapted to the SFM setting. 9 3.3 Analysis Let us define the ellipsoid def E(R) = {x ∈ Rn : x⊤ Rx ≤ 1}. Further, let def Σµ = {w ∈ Rn : w⊤ x ≥ 0 ∀x ∈ B(fµ )}, def Fµ = Σµ ∩ Bn . (9) Σµ is the set of normal vectors of hyperplanes that weakly separate 0 from B(fµ ). A vector in the interior of Σµ gives a strong separation, and verifies that 0 ∈ / B(fµ ). This in turn implies that fµ (S) < 0 for some set S ⊆ V , and thus the minimum value of f is strictly less than the current estimate −µ. The main ideas of the analysis are showing that (a) the ellipsoid E(R) contains the set Fµ at every iteration (Lemma 3.7), and that (b) the volume of E(R) keeps decreasing by a constant factor at every rescaling (Lemma 3.9). For an integer valued f , one can lower bound the volume in terms of n and Lf,2 , assuming that Fµ has a nonempty interior. Hence, at termination one can conclude that the interior of Fµ is empty, which implies that fµ ≥ 0, or equivalently, the minimum value of the function is −µ for the current µ. The analysis below provides a slightly different argument than the volume analysis, by bounding the Q-norm of the bases used during the algorithm. This will be needed for the “pull-back” argument for finding a dual certificate of optimality in Section 5. Clearly, GreedyMin(fµ , w) can be used as a separation oracle for Σµ . Further, Lemma 3.2 implies that if µ′ ≥ µ, then Σµ′ ⊆ Σµ and Fµ′ ⊆ Fµ . As in [8], for a convex set X ⊂ Rn and a vector a ∈ Rn , we define the width def widthX (a) = max{a⊤ z : z ∈ X}. Further, we define the condition number def ω̂µ = min x∈B(fµ )\{0} widthFµ (x) . kxk2 A key estimate for the running time analysis is the following. Lemma 3.6. Assume minS⊆V f (S) < −µ ≤ min{0, f (V )}. Then 1 ω̂µ ≥ √ . 4 nLf,2 Proof. Lemma 3.3 asserts Lfµ ,2 ≤ 4Lf,2 , that is, kxk2 ≤ 4Lf,2 for every x ∈ B(fµ ). The claim follows by showing √ widthFµ (x) ≥ 1/ n. (10) To prove this, we note that the assumption of the lemma implies 0 ∈ / B(fµ ). Let z denote the minimum norm point in B(fµ ), and let ẑ = z/kzk2. Then for every x ∈ B(fµ ), ẑ ⊤ x ≥ kzk2. √ √ By Theorem 2.2, if S is the minimizer of fµ , then 1 ≤ |fµ (S)| ≤ nkzk2 . Thus ẑ ⊤ x ≥ 1/ n. Since ẑ ∈ Fµ , this provides the bound on widthFµ (x) for every x ∈ B(fµ ). We will use the following results from [8]. Lemma 3.7 ([8, Lemma 3.6]). Throughout the algorithm, Fµ ⊆ E(R) holds. Proof. The main part of the proof in [8] is showing that, the said property is maintained at every rescaling. A new phenomenon in the submodular setting is that the set Fµ also changes when µ increases in the sliding von Neumann algorithm. But as noted above, Fµ only decreases in these iterations, hence the property is maintained. Lemma 3.8 ([8, Lemma 3.7]). Throughout the algorithm, kxkQ ≥ ω̂µ kxk2 must hold for every x ∈ B(f ). 10 Proof. This follows by [8, Lemma 2.15], asserting that kxkQ = widthE(R) (x), and from the definition of ω̂µ . Lemma 3.9 ([8, Lemma 3.8]). The determinant of R increases at least by a factor 16/9 at every rescaling. Lemma 3.10 ([8, Lemma 3.9]). At any stage of the algorithm, there exists a point gk ∈ B(fµ ) used during one of the previous sliding von Neumann iterations with kgk k2 . kgk kQ ≤ p det(R)1/n − 1 Proof of Theorem 3.5. The algorithm performs T = 5n log(nLf,2 ) rescalings. Lemma 3.9 shows that after T rescalings, det(R) ≥ (16/9)T . Then Lemma 3.10 implies that, after T rescalings, there exists a point gk ∈ B(fµ ) with kgk kQ < kgk k2 /(4nLf,2 ). Now Lemma 3.8 would contradict Lemma 3.6 if the assumption minS⊆V f (S) < −µ were true. Since the algorithm maintains a set W with f (W ) = −µ, we can conclude that f (W ) = −µ = minS⊆V f (S). This shows that the algorithm correctly terminates. The algorithm calls the sliding von Neumann subroutine T = O(n log(nLf,2 )) times; each call takes at most ⌈1/ε2 ⌉ = O(n2 ) iterations. At the kth iteration of von Neumann, it takes time time O(n · EO + n log n) to run GreedyMin and time O(k) to update the coefficients x1 , . . . , xk . These give a bound of O(n3 · EO + n4 ) for each sliding von Neumann subroutine. Further, every rescaling has to compute O(n2 ) outer products gi gi⊤ , add their weighted sum to R, and compute Q = R−1 . The computation is dominated by computing the outer products, which take altogether O(n4 ) time. Hence the iterations between two subsequent rescalings take time O(n3 · EO + n4 ), yielding the claimed complexity bound. 4 Strongly polynomial algorithms In this section, we provide a general scheme to convert an approximate SFM algorithm to a strongly polynomial one. We assume that the SFM algorithm is provided via the following oracle. Oracle Approx-SFM Input: A submodular function f : 2V → Z and δ > 0. Output: A set W ⊆ V , and a vector y ∈ B(f ) such that f (W ) ≤ y − (V ) + δLf . Further, assume y is given as a convex combination of bases of B(f ). The set W returned by the oracle is clearly within δLf from the optimal solution to (SFM). In particular, if δ < 1/Lf , then W is optimal. Let AO(f, δ) denote the running time of the oracle. We assume that the oracle makes at least one call to the greedy algorithm, which implies that AO(f, δ) is at least n · EO. Various algorithms in the literature provide implementations of the approximation oracle. Among them: • the conditional gradient method, in time O((n2 · EO + n2 log n)δ −2 ) (Theorem 2.4); • the Fujishige-Wolfe algorithm in O((n3 · EO + n5 )δ −2 ) (Theorem 2.5); • the Iwata-Orlin weakly polynomial algorithm [24], in time O((n4 ·EO+n5 ) log(nδ −1 ));2 • the Sidford-Lee-Wong cutting plane method in O(n2 ·EO log(nδ −1 )+n3 logO(1) (nδ −1 )) (see Section 6). The following theorem shows how the oracle can be implemented using RescalingSFM. This will be proved in Section 5. 2 This is not explicitly stated in [24], however their analysis shows that, in time O((n4 · EO + n5 ) log(nδ −1 )), they a set W ⊆ V and a point x ∈ B(f ) such that x(W ) = f (W ), x(v) ≥ 0 for , and Φ(x) := pall v ∈ V \ W P obtain + 2 2 2 − + − − (x (v)) ≤ δ L /n. This implies that f (W ) = x (W ) + x (W ) ≤ x (V ) + nΦ(x) ≤ x (V ) + δLf . f v∈W 11 Theorem 4.1. Setting T = O(n log(nδ −1 )) in Algorithm 2, from its output one can compute a set W ⊆ V and a point y ∈ B(f ), expressed as a convex combination of O(n3 log(nδ −1 )) extreme bases of B(f ), such that f (W ) ≤ y − (V ) + δLf . The running time is O((n4 · EO + n5 ) log(nδ −1 )). Finding a dual certificate in Rescaling-SFM For an integer valued f , a pair W and y satisfying the requirements of Approx-SFM(f, 1/Lf ) are an optimal pair of primal and dual solutions as in Theorem 2.1. Hence the algorithm of Theorem 4.1 for δ = 1/Lf 5 provides a dual certificate of optimality in time O((n4 · EO √ + n ) log(nLf )), the same as the complexity bound as in Theorem 3.5 (using that Lf ≤ nLf,2 ). Identifying the structure of optimal solutions The following lemma provides a simple way to identify sets that must be contained in every optimal solution. Lemma 4.2. Let y and W denote the output of Approx-SFM(f, δ). If y(v) < −δLf , then v must be contained in every minimizer of f . Proof. Let S ⊆ V \ {v}. Then f (S) ≥ y(S) ≥ y − (V \ {v}) ≥ f (W ) − y(v) − δLf > f (W ). This shows that S cannot be an optimal solution to (SFM). Once we find such an element v, minimizing f can be reduced to minimizing the condef traction f ′ : 2V \{v} → Z, defined as f ′ (S) = f (S ∪ {v}) − f ({v}). Our other main tool to identify structural properties of optimal solutions is the following. Lemma 4.3. Let y ∈ B(f ), U ⊆ V , and v ∈ V \ U . Assume that y(v) > −y − (V \ U ). Then any minimizer to (SFM) that contains v must contain some element of U . Proof. Let S ⊆ V \ U , v ∈ S. Then f (∅) = 0 < y(v) + y − (V \ U ) ≤ f (S), hence S cannot be a minimizer. 4.1 Ring families A set family F ⊆ 2V is called a ring family, if X, Y ∈ F implies X ∩ Y, X ∪ Y ∈ F . The function f : F → Z is a submodular function over the ring family F , if (1) holds for any X, Y ∈ F . Submodular function minimization over ring families has been well-studied and can be reduced to standard submodular function minimization [31, Chapter 49]. This is the underlying framework of the strongly polynomial SFM algorithm by Iwata, Fleischer, and Fujishige [23], and has been subsequently used in several other algorithms, e.g. in [24, 27]. Starting with the entire ring family F = 2V , these algorithms make progress by gradually restricting the function to a smaller ring family that must contain all minimizers. Our algorithm follows the same overall scheme. A compact representation of a ring family can be obtained via a directed graph (V, F ) such that X ∈ F if and only if δF+ (X) = 0, that is, no arc in F leaves X. In what follows, let us assume that F is an acyclic graph. This is without loss of generality, since strongly connected components can be contracted to single vertices; indeed, given the set of elements C defining a strongly connected component of F , any minimizer of (SFM) must either contain C or be disjoint from C. The acyclic graph D = (V, F ) defines a partial order F . We have u F v if there exists a directed path in F from v to u. In other words, u F v if and only if u is contained in every X ∈ F that contains v. We say that an ordering of the vertices is consistent with the graph F , if u is ordered before v whenever u F v. The following definitions and results are similar to those in [31, Section 49.3]. For a set X ⊆ V , let def def X ↓ = {u ∈ V : ∃v ∈ X, u  v}, X ↑ = {u ∈ V : ∃v ∈ X, v  u} def def ↓ ↑ x↓ = {x} , x↑ = {x} . Thus, X ↓ is the unique minimal element of F containing X. We define def ℓ(v) = f ((V \ v ↑ ) ∪ {v}) − f (V \ v ↑ ). 12 Let us define f ↓ : 2V → Z by def f ↓ (X) = f (X ↓ ) − ℓ− (X ↓ \ X). Lemma 4.4. The function f ↓ is submodular on 2V with f ↓ (S) ≥ f (S ↓ ) for all S ⊆ V and f ↓ (S) = f (S) for every S ∈ F . Consequently, minimizing f on the ring family F is equivalent to minimizing f ↓ on 2V . The complexity of GreedyMin(f ↓ , w) can be bounded by O(n · EO + n2 ), where EO is the complexity to evaluating f . Proof. We need the following. Claim 4.5. For every X, Y ∈ F with X ⊆ Y , we have ℓ(Y \ X) + f (X) ≤ f (Y ). Proof. Let us take the elements of Y \ X in a consistent order with  as z1 , . . . , zr . Then, Zi = X ∪ {z1 , . . . , zi } ∈ F for each i ∈ [r], and Zi ⊆ (V \ zi ↑ ) ∪ {zi }. Submodularity implies f (Zi ) − f (Zi−1 ) ≥ ℓ(zi ). The claim follows by adding up all these inequalities. To prove that f ↓ is submodular, we show that f ↓ = b where b : 2V → Z is defined by def b(X) = min{f (Y ) − ℓ− (Y \ X) : X ⊆ Y, Y ∈ F }. The submodularity of b follows by [14, Theorem 14.3.4A], using that ℓ− (Y ) ≤ f (Y ) for every Y ∈ F by Claim 4.5. Let us show that b = f ↓ . By definition, b(X) ≤ f ↓ (X) for any X ⊆ V . Consider now Y ∈ F such that Y ) X ↓ . Again by Claim 4.5, we have f (Y ) ≥ f (X ↓ ) + ℓ− (Y \ X ↓ ); this implies that X ↓ is the minimizer in the definition of b, therefore f = b. The nonpositivity of ℓ− gives that f ↓ (S) ≥ f (S ↓ ) for all S ( V ; it is clear that f ↓ (S) = f (S) for all S ∈ F , S 6= V . Regarding the complexity of GreedyMin, one needs to compute the values of f ↓ ({v1 , . . . , vi }) for every i ∈ [n] for a given order of the vertices; thus, we need ↓ to find the sets Si = {v1 , . . . , vi } . We can assume that F is maintained as a transitive graph. When moving from i to i + 1, we need to compute Si+1 = Si ∪ vi ↓ , which can be done in O(n) time. Adding the ℓ− values also take O(n) time for each set. Hence, we obtain an overhead O(n2 ) over the O(n · EO) oracle queries and O(n log n) time for sorting the ground set. Claim 4.6. For every v ∈ V , ℓ(v) = f ↓ (V ) − f ↓ (V \ {v}). In particular, y(v) ≥ ℓ(v) for every y ∈ B(f ↓ ). ↓ Proof. If V \{v} ∈ / F , then V \ {v} = V , therefore f ↓ (V )−f ↓ (V \{v}) = f (V )−f (V )+ℓ(v) by definition of f ↓ . If V \ {v} ∈ F , then v ↑ = {v}, therefore f ↓ (V ) − f ↓ (V \ {v}) = f (V ) − f (V \ {v}) = f ((V \ v ↑ ) ∪ {v}) − f (V \ v ↑ ) = ℓ(v). For the last part, note that for any extreme base g of B(f ↓ ), g(v) = f ↓ (S) − f ↓ (S \ {v}) for some S ⊆ V containing v, and by submodularity f ↓ (S) − f ↓ (S \ {v}) ≥ f ↓ (V ) − f ↓ (V \ {v}) = ℓ(v). We will use the following bound on the complexity parameter of f ↓ . Claim 4.7. Assuming that f (V ) ≤ 0, we have |ℓ− (V )|/|V | ≤ Lf ↓ ≤ 2|ℓ− (V )|. Proof. By Claim 4.6 y(v) ≥ ℓ(v) for all v ∈ V and for every y ∈ B(f ↓ ), therefore y − (V ) ≥ ℓ− (V ). This shows that kyk1 = f ↓ (V ) − 2y − (V ) ≤ −2ℓ− (V ), using also that f ↓ (V ) ≤ 0. For the lower bound, let us choose v ∈ V with lowest value of ℓ− (v). Thus, |ℓ− (v)| ≥ |ℓ− (V )|/|V |. Consider any extreme base g of B(f ↓ ) from an order where v comes last. Then by the first part of Claim 4.6 g(v) = ℓ(v), hence Lf ↓ ≥ kgk1 ≥ |g(v)| = |ℓ(v)| ≥ |ℓ− (v)| ≥ |ℓ− (V )|/|V |. 13 Algorithm 3 The basic strongly polynomial algorithm Input: A submodular function f : 2V → Z with f (V ) ≤ 0, and δ > 0. Output: An optimal solution to (SFM) 1: Initialize F := ∅, T := ∅. 2: while ℓ− (V ) < 0 do ↓, δ) to obtain W and y ∈ B(f ↓ ), represented as a 3: Call Approx-SFM(fP convex combination y = ki=1 xi gi . 4: for z ∈ V such that f (V \ z ↑ ) > −|V | · y − (V \ z ↑ ) do P 5: Compute y ′ = ki=1 xi gi′ by bringing all elements of z ↑ backward in the order defining gi . 6: for v ∈ V \ z ↑ such that y ′ (v) > −y ′ − (V \ z ↑ ) do 7: add arc (v, z) to F . 8: for v ∈ V such that (y(v) < 2ℓ− (V )δ) do ⊲ contraction 9: Replace f by f (S ∪ v ↓ ) − f (v ↓ ) on the ground set V := V \ v ↓ . 10: Set f (V ) := min{0, f (V )}. 11: Set T := T ∪ v ↓ . 12: Contract all strongly connected components of F to single nodes. return the pre-image of T in the original ground set. 4.2 The basic strongly polynomial scheme Algoritm 3 builds a ring family F represented by a directed graph F with the property that F contains all optimal solutions to (SFM); thus, minimizing f is equivalent to minimizing the modified function f ↓ . We formulate the algorithm with a general value of δ, and show that it terminates within n2 iterations for the choice δ = 1/(3n3 ). In particular, we show the following running time bound. We denote by AO↓ (f, δ) the maximum AO(f ↓ , δ), where f ↓ ranges over all possible choices of ring families F containing all optimal solutions to (SFM). We note that, since as in Lemma 4.4, Greedy-Min(f ↓ , w) uses time O(n2 · EO + n2 ) instead of O(n2 · EO + n log n), thus AO↓ (f, δ) is upper bounded by the worst case running time bound on AO(f, δ) plus n/ log(n) times the worst case bound on the number of calls to the greedy algorithm of AO(f, δ). Theorem 4.8. Using δ = 1/(3n3 ), Algoritm 3 finds the optimal solution to (SFM) in time O(n2 AO↓ (f, 1/(3n3 ))+ n3 k ·EO+ n4 k), where k is an upper bound on the number of extreme bases in the convex combination returned by Approx-SFM. Using the bounds from Theorems 2.4 and 2.5, we obtain O(n10 · EO + n11 ) using the conditional gradient algorithm, and O(n11 · EO + n12 ) using the Fujishige-Wolfe algorithm. Note that, k = O(n/δ 2 ) = O(n7 ) for conditional gradient, whereas k = O(n) for FujishigeWolfe. While these running times are high polynomials, we emphasize that they can be obtained by repeated applications of simple iterative methods, without using any form of scaling. Theorem 4.1 gives a running time O((n6 · EO + n7 ) log n) using the Rescaling-SFM algorithm. In Section 4.3, we give an enhanced version of the algorithm with running time O((n5 · EO + n6 ) log2 n). Let us now give an overview of Algoritm 3. Each main iteration calls the oracle ApproxSFM(f ↓ , δ). Two types of contractions are used. All cycles in F can be contracted to single elements, since an optimal solution can contain either all or no element of a cycle (line 12). The other type of contraction (in line 9) reduces the size of the ground set by eliminating elements that must be contained in every optimal solution. The set T represents the set of elements eliminated by contractions. Thus, the submodular function at the current stage will be defined as f (S ∪ T ) − f (T ) for the original input function f , with the possible exception of f (V ). Therefore, the complexity of evaluating the current f is still EO. We will use n below to denote the size of the original ground set V . 14 The other main step of the algorithm is adding new arcs to F . The following lemma shows the validity of these steps and that either of these operations should occur in every iteration. Lemma 4.9. Every v ∈ V contracted in line 9 must be contained in all minimizers of (SFM), and every arc (v, z) added to F in line 7 satisfies the property that every minimizer that contains v must also contain z. If δ ≤ 1/(3n3 ), then every iteration either contracts an element or adds a new arc to F . Proof. In line 6, Lemma 4.3 implies that every minimizer of f ↓ that contains v, must also contain some element of z ↑ . By definition, if a minimizer contains an element of z ↑ , then it must contain z. It follows that every minimizer containing v must also contain z, therefore the new arc (v, z) is valid. Consider a v such that y(v) < 2ℓ− (V )δ in line 9. Lemma 4.2 and Claim 4.7 imply that v is contained in every minimizer of f ↓ , and so must be also all elements of v ↓ . By induction, we must have that v ↓ is contained in every minimizer of f . Finally, we need to show that if δ ≤ 1/(3n3 ), then every iteration adds some arc to F in line 6 or contracts some element in line 9. Note that, if the algorithm enters the while loop when |V | = 1, say V = {v}, then y(v) = f (V ) = ℓ− (V ) < 2ℓ− (V )δ, so the algorithm contracts v in line 9, and subsequently terminates. Assume that |V | ≥ 2 and that no element is contracted in line 9. Then y(v) ≥ 2ℓ− (V )δ for all v ∈ V , and thus f ↓ (S) ≥ y − (V ) ≥ 2|V | · ℓ− (V )δ ∀S ⊆ V. (11) Since f ↓ (S) = f (S) for S ∈ F , and F contains all minimizers of f , we have that f (S) ≥ 2|V | · ℓ− (V )δ ∀S ⊆ V. (12) Note that, by construction and from the fact that V \ z ↑ ∈ F , for every i ∈ [k] we have \ z ↑ ) = f ↓ (V \ z ↑ ) = f (V \ z ↑ ), and gi′ (u) ≥ gi (u) for every u ∈ V \ z ↑ . It follows that y (V \ z ↑ ) = f (V \ z ↑ ) and y ′ (u) ≥ y(u) for all u ∈ V \ z ↑ . Assume that f (V \ z ↑ ) > −|V | · y − (V \ z ↑ ), as in the condition in line 4. It follows that gi′ (V ′ − y ′ (V \ z ↑ ) = f (V \ z ↑ ) > −|V | · y − (V \ z ↑ ) ≥ −|V | · y ′ (V \ z ↑ ). − This in turn implies the existence of v ∈ V \ z ↑ such that y ′ (v) > −y ′ (V \ z ↑ ) in line 6. Finally, we show that if (12) holds, then at least one z ∈ V satisfies f (V \ z ↑ ) > |V | · |y − (V )|, (13) a bound which is slightly stronger than the condition f (V \ z ↑ ) ≥ −|V | · y − (V \ z ↑ ) in line 4. Hence, at least on new arc will be added to F . We choose z ∈ V such that ℓ(z) is the most negative possible. In particular, ℓ(z) ≤ ℓ− (V )/|V |. By (12) we have ℓ− (V ) ≥ ℓ(z) = f ((V \ z ↑ ) ∪ {z}) − f (V \ z ↑ ) ≥ 2|V | · ℓ− (V )δ − f (V \ z ↑ ). |V | (14) Consequently, ↑ − f (V \ z ) ≥ |V | · |ℓ (V )| · 1 |V | 2 ! − 2δ . 2 From the assumption δ ≤ 1/(3n3 ) ≤ 1/(3|V |3 ) we obtain 1/|V | − 2δ ≥ 2|V |δ since |V | ≥ 2. Therefore (13) follows since f (V \ z ↑ ) ≥ 2|V |2 · |ℓ− (V )|δ ≥ |V | · |y − (V )|. The final inequality follows using (11). Proof of Theorem 4.8. Lemma 4.9 justifies the contraction steps and the addition of new arcs to F , and shows that the number of main iterations is at most n2 . Let us also note that after every contraction, we decrease the value of f (V ) if it becomes positive (that is, if f (V ) > f (v ↑ ) before the contraction of v). This operation clearly maintains submodularity. 15 It is also safe in the sense that it may not lead to an incorrect output with respect to the original function. Indeed, note that at termination the algorithm returns the current set of T , which are elements that must be contained in every minimizer of the original function. Hence, the algorithm outputs the unique minimal solution to (SFM). On the other hand, if f (V ) was ever decreased, then we decrease it to the same value as f (∅). Therefore it can never become the unique minimizer. If the algorithm terminates with the entire ground set V , then it follows that f (V ) was never decreased during the algorithm. Let us now estimate the running time. Besides the calls to Approx-SFM, the running time is dominated by computing the gi′ bases in line 5, which altogether require O(nk · EO + n2 k) for every iteration, and this is required O(n2 ) times. 4.3 Speeding up the algorithm The algorithm described in the previous section needs to identify O(n2 ) arcs in F . In the worse case, each iteration may only identify a single arc, resulting in O(n2 ) calls to Approx-SFM. On the other hand, if we were able to guarantee that |ℓ− (z)| is within a factor O(nb ) from − |ℓ (V )| for a constant fraction of all z ∈ V for some constant b ≥ 1, the analysis in the proof of Lemma 4.9 implies that for δ = 1/O(nb+2 ) we would guarantee f (V \ z ↑ ) ≥ −ny − (V \ z ↑ ) for all such z ∈ V . Thus, after running Approx-SFM(f ↓ , 1/O(nb+2 )), we could extend F by Θ(n) new arcs. If this property held in all iterations, then O(n) calls to Approx-SFM would suffice. However, the the number of z ∈ V with |ℓ− (z)| value “close” to |ℓ− (V )| can be o(n). To deal with this situation, we apply the “bucketing” technique of Lee, Sidford, and Wong [27]. Instead of the entire V , we restrict our function in every iteration to a suitably chosen V̄ ⊆ V , and run Approx-SFM restricted to this set with δ = n−O(log n) . We will obtain θ(V̄ ) new arcs in this iteration. Thus, if Approx-SFM has running time O((|V̄ |4 · EO + |V̄ |5 ) log2 n), then the amortized cost of extending F by an arc will be O((n3 · EO + n4 ) log2 n). We note that this improvement is only applicable if AO(f, δ) depends logarithmically on 1/δ. Since δ can be quasi-polynomial, the conditional gradient or Fujishige-Wolfe methods would not even be polynomial in this framework. The following lemma adapts the argument in Section 15.4.1 in [27]. Lemma 4.10. Let f : 2V → Z be a submodular function, F a ring family containing all minimizers of f , and f ↓ : 2V → Z be the corresponding function defined by f and F . Then in O(n · EO) time we can find a nonempty subset V̄ ⊆ V and a positive integer b = O(log n), such that • For every z ∈ V \ V̄ , we have ℓ(z) > 2ℓ− (V )/(2n)4b . • There exist at least |V̄ |/2 distinct z ∈ V̄ such that ℓ(z) ≤ 2ℓ− (V )/(2n)4b−4 . def Proof. Let us define V t = {z ∈ V : ℓ(z) ≤ 2ℓ− (V )/(2n)4t } for t = 1, 2, . . .. Clearly, V 1 6= ∅, as it contains z with the smallest ℓ(z) value. Let b be the smallest value such that |V b | ≤ 2|V b−1 |. Clearly, b = O(log n), and choosing V̄ = V b satisfies both requirements. For the set V̄ and value b as in the lemma, let f¯ : 2V̄ → Z denote the restriction of f ↓ to the ground set V̄ , and let us set def δ̄ = 1 , (2n)4b def δ = 2n2 + 1 , (2n)4b (15) Let us call Approx-SFM(f¯, δ̄) to obtain the vector ȳ ∈ B(f¯) defined as a convex combination of extreme bases ḡ1 , . . . , ḡk ∈ B(f¯), and a set W ⊆ V̄ such that f¯(W ) ≤ ȳ − (V̄ ) + δ̄Lf¯. Let us now extend ȳ ∈ RV̄ to y ∈ RV as follows. For v ∈ V̄ , we let y(v) = ȳ(v). Then, consider an arbitrary order v1 , . . . , vn−|V̄ | of V \ V̄ , and set y(vj ) := f ↓ (V̄ ∪ {v1 , . . . , vj }) − f ↓ (V̄ ∪ {v1 , . . . , vj−1 }). Let us also define g1 , . . . , gk ∈ RV , by gi (v) = ḡi (v) for v ∈ V̄ , gi (v) = y(v) for v ∈ V \ V̄ (i = 1, . . . , k). Note that, by definition, g1 , . . . , gk are extreme bases of B(f ↓ ), and y is a convex combination of g1 , . . . , gk . 16 Lemma 4.11. For the vector y and set W as above, we have that y ∈ B(f ↓ ), and f ↓ (W ) ≤ y − (V ) + δLf ↓ . Proof. By definition f ↓ (W ) = f¯(W ) and Lf¯ ≤ Lf ↓ , because f¯ is a restriction of f ↓ . Therefore, f ↓ (W ) ≤ ȳ − (V̄ ) + δ̄Lf ↓ . Claim 4.12. y(v) ≥ ℓ− (v) for every v ∈ V \ V̄ . Proof. If v = vj , then y(v) = f ↓ (V̄ ∪ {v1 , . . . , vj }) − f ↓(V̄ ∪ {v1 , . . . , vj−1 }) ≥ f ↓ (V ) − f ↓ (V \ {v}) by submodularity. Further, f ↓ (V ) − f ↓ (V \ {v}) ≥ ℓ− (v) by Claim 4.6. We have y − (V ) = ȳ − (V̄ )+y − (V \V̄ ). By the choice of V̄ , we have ℓ− (v) ≥ 2ℓ− (V )/(2n)4b = 2ℓ (V )δ̄ for every v ∈ V \ V̄ . Using the claim above, we get y − (V \ V̄ ) ≥ 2nℓ− (V )δ̄. Thus, y − (V ) ≥ ȳ − (V̄ ) + 2nℓ− (V )δ̄ ≥ ȳ − (V̄ ) − 2n2 δ̄Lf ↓ . Here, the last inequality used the lower bound in Claim 4.7. Consequently, − f ↓ (W ) ≤ y − (V ) + (2n2 + 1)δ̄Lf ↓ = y − (V ) + δLf ↓ . This proof shows that we can implement Approx-SFM(f, δ) by calling Approx-SFM(f¯, δ̄), and adding the remaining V \ V̄ elements by O(n) value oracle queries, which is time O(n · EO + n2 ) for the function f ↓ . Let us modify Algorithm 3 as follows. In every iteration, we compute V̄ and b as in Lemma 4.10, and use this modified implementation of Approx-SFM with δ as defined in (15). Theorem 4.13. The above described modification of Algorithm 3 finds an optimal solution to (SFM) in time O(n · AO↓ (f, n−O(log n) ) + n3 k · EO + n4 k), where k is an upper bound on the number of extreme bases returned by Approx-SFM. Using the implementation with Rescaling-SFM, the running time is O((n5 · EO + n6 ) log2 n). Proof. They key observation is that, at every call of the approximation oracle, if no nodes are contracted at line 9, then at least 21 |V̄ | new arcs are added to F . This follows by showing that f (V \ z ↑ ) > −|V | · y − (V \ z ↑ ) holds for at least half of the elements z of V̄ . Indeed, as in the proof of Lemma 4.9, we can assume that y(v) ≥ 2ℓ− (V )δ for all v ∈ V and that (12) holds. By Lemma 4.10 and our choice of V̄ , half of the elements of V̄ satisfy ℓ(z) ≤ 2ℓ− (V )/(2n)3b−3 = − 2ℓ (V )δ(2n)4 /(2n2 + 1). Hence, as in (14), the assumption (12) implies that   1 (2n)4 ↑ − 2 − > |V | · |y − (V )|, − f (V \ z ) ≥ 2|V | · ℓ (V )δ − ℓ(z) ≥ 2|V | · |ℓ (V )|δ |V |2 (2n2 + 1) |V | where the last inequality uses that |y − (V )| ≤ 2|V | · |ℓ− (V )|δ because of the assumption y(v) ≥ 2ℓ− (V )δ for all v ∈ V , and that the expression in the brackets is ≥ 1 for n ≥ 2. The running time of Approx-SFM(f¯, δ̄) is AO(f¯, n−O(log n) ). Consequently, the amortized cost of an oracle call per new arc is AO(f¯, n−O(log n) )/|V̄ |. Since AO depends at least linearly on |V̄ |, this can be upper bounded by AO(f, n−O(log n) )/|V |. Hence, the total time of the oracle calls is O(n · AO(f, n−O(log n) ), which is O((n5 · EO + n6 ) log2 n) for RescaledSFM. We also have to recompute the convex combinations in line 5. For every new arc, this requires recomputing k extreme bases, in total time O(n3 k · EO + n4 k). 5 The pull-back technique for Rescaling-SFM The main purpose of this section is to prove Theorem 4.1, that is implement Approx-SFM using Rescaling-SFM. We will use a “pull-back” technique. Recall that in RescalingSFM, we keep modifying the matrix Q defining the scalar product. Lemmas 3.9 and 3.10 guarantee that after t rescalings, there we can identify a vector g ∈ B(fµ ) that has a small Q-norm for the current Q, and the bound decreases geometrically with t. Our key technical claim, Lemma 5.2, shows a constructive way to identify a vector v ∈ B(fµ ) with 17 kvk2 ≤ kgkQ . Provided a vector v with small 2-norm (and thus small 1-norm), we can easily satisfy the requirements of the Approx-SFM, using the following lemma. Lemma 5.1. Let µ ≥ max{0, −f (V )} and W ⊆ V such that f (W ) = −µ. Let µ1 , µ2 , · · · , µh ∈ Ph [0, µ], and for i = 1, . . . , h let gi be a basis of the base polytope B(fµi ). Given v = i=1 λi gi Ph where λ ≥ 0 and i=1 λi = 1, in time O(nh) we can compute y ∈ B(f ), given as a convex combination of h extreme bases of B(f ), such that f (W ) ≤ y − (V ) + kvk1 . 2 Proof. For i = 1, . . . , h, let ḡi be the basis of B(f ) defined by the same ordering which Ph defined the basis gi of B(fµi ). Define y := i=1 λi ḡi . Observe that, given i ∈ [h], if v1 , . . . , vn is the ordering defining gi , then ḡi (v1 ) = gi (v1 ) − µi , ḡi (vj ) = gi (vj ) for j = 2, . . . , n − 1, and ḡi (vn ) = gi (vn ) + µi + f (V ). Thus, computing ḡ1 , . . . , ḡh requires time O(h) and computing y requires time O(nh). Furthermore, we have that kḡi k1 ≤ kgi k1 + 2µ + f (V ). This implies that kyk1 ≤ kvk1 + 2µ + f (V ) = kvk1 − 2f (W ) + f (V ). Since kyk1 = f (V ) − 2y − (V ), the above implies f (W ) ≤ kvk1 + f (V ) − kyk1 kvk1 = y − (V ) + . 2 2 Our next Lemma enables pulling back a vector with small Q-norm to a vector with no larger 2-norm. This is done gradually, by pulling back at each rescaling of RescalingSFM. The columns of the matrix A will be the bases used in the current iteration of the sliding von Neumann algorithm. We also note that this technique is applicable to the general Full Support Image Algorithm in [8], enabling to find approximate solutions as well as dual certificates of infeasibility. Lemma 5.2. Let A ∈ Rn×p , R ∈ Sn+ , and Q = R−1 . Let x ∈ Rp+ such that y := Pp ai i=1 xi kai kQ satisfies kykQ ≤ ε. Define 1 R = (1 + ε)2 ′ def R+ p X i=1 ! xi T ai ai , kai k2Q (16) def and Q′ = (R′ )−1 . For every v ∈ Rn , there exists µ ∈ Rp+ such that kv + AµkQ ≤ kvkQ′ . Moreover, such a vector µ can be computed in time O(n2 p). def Proof. For the given v ∈ Rn , we define u = def β = max i∈[p] hai , uiQ kai kQ , def µi = 1 RQ′ v and let (1 + ε)2 xi kai kQ   hai , uiQ β− kai kQ for i ∈ [p] (17) We will show that the statement is satisfied by the choice of µ ∈ Rp+ defined above. These values can be clearly computed in O(n2 p) time. First, we observe that, by substituting the definitions of R′ and u, we obtain v = R′ QRQ′ v = u + p X xi i=1 hai , uiQ kai kQ ai , kai kQ which, from the definition of µ and β, implies that v + Aµ = u + βy. 18 (18) Next, notice that kvkQ′ p v T Q′ R ′ Q′ v = = ≥ 1 (1 + ε) (v T Q′ )R(Q′ v) + v T Q′ p X i=1 1 1 (v T Q′ R)Q(RQ′ v) 2 = (1 + ε)kukQ . (1 + ε) xi ai aT i kai k2Q ! Q′ v ! 12 From the above and observing that |β| ≤ kukQ , from the definition of β, we have kv + AµkQ ≤ kukQ + |β|kykQ ≤ (1 + ε)kukQ ≤ kvkQ′ , where the first inequality follows from (18) and the triangle inequality. We are ready to prove Theorem 4.1, showing how Approx-SFM can be implemented using Rescaling-SFM. Proof of Theorem 4.1. Run algorithm Rescaling-SFM(f ), setting the limit on the number of rescalings to a number T = cn log(nδ −1 ) for some constant c to be specified later. At the end of the execution, we identified a value µ and a set W ⊆ V such that f (W ) = −µ. Let g1 , . . . , gh be all the points in B(fµ ) used in the sliding von Neumann iterations during the execution of the algorithm. By Lemma 3.10, for an appropriate choice of c, after T rescalings there exists k ∈ [h] such that 2δ kgk kQ ≤ √ kgk k2 . 3 n Let ĝk = gk /kgk k2 . The running time of Rescaling-SFM(f ) with the above choice of T is O((n4 EO + n5 ) log(nδ −1 )). Note also that h ∈ O(n3 log(nδ −1 )), thus finding k requires time O(n5 log(nδ −1 )) to compute the Q-norms of g1 , . . . , gh . By applying Lemma 5.2 for T times (considering the rescaling matrices used in the Ph algorithm in reverse order), we can find a vector µ ∈ Rh+ such that kĝk + i=1 µi gi k2 ≤ kĝk kQ . Recall that each rescaling matrix is defined by at most n2 vectors among g1 , . . . , gh , therefore each application of Lemma 5.2 requires time O(n4 ) (assuming that the matrices Q and R used at every rescaling are saved in memory so we do not need to recompute them). Thus, overall, the time required to compute µ is O(n5 log(nδ −1 )). Ph Define α = 1 + kgk k2 · i=1 µi , and λ ∈ Rh+ by ( kgk k2 µi i ∈ [h] \ {k} α λi = 1+kgk k2 µk i =k α Ph Ph Define v := i=1 λi gi . Observe that i=1 λi = 1, thus v ∈ Bfµ . Computing v requires time O(n4 log(nδ −1 )), since we need to sum h n-dimensional vectors. Furthermore, kvk1 ≤ h X √ kgk k2 √ nkvk2 = n µi g i ĝk + α i=1 2 ≤ √ nLfµ ,2 kĝk kQ ≤ 2δLf , where the last inequality follows from the fact that Lfµ ,2 ≤ Lfµ ≤ 3Lf by Lemma 3.3. By Lemma 5.1, in time O(n4 log(nδ −1 )) we can compute y ∈ B(f ) satisfying f (W ) ≤ 1 − y − (V ) + kvk 2 ≤ y (V ) + δLf . Remark 5.3. The bound O(n5 log(nδ −1 )) for computing µ in the above proof was assuming O(n2 ) time for computing Q-scalar products hg, uiQ . We note that this can be easily improved by a factor n: we can assume that Qg was precomputed and stored during Rescaling-SFM for all bases g used during the sequence of rescalings. Indeed, it was necessary to compute the norms kgkQ in the sliding von Neumann algorithm. Thus, the bound improves to O(n4 log(nδ −1 )); however, this does not change the overall running time estimate. 19 6 Cutting plane method The current best cutting plane method for finding a point in a convex set provided by a separation oracle is due to Lee, Sidford, and Wong [27]. If κ is n times the ratio of the radius of an initial ball containing the convex feasible region and the radius of a ball contained inside, then their algorithm finds a feasible point in O(n · SO log κ + n3 logO(1) κ), where SO is the complexity of an (exact) separation oracle. In Part III of their paper, they apply this algorithm for submodular function minimization, and obtain the current best running time bound, O(n3 log2 n·EO+n4 logO(1) n) (see [27, Section 15.4]). This is obtained by combining their cutting plane algorithm with an improved version of the combinatorial framework of ring families; one of their important new contributions is the bucketing technique we also use in Section 4. In this section, we present an alternative way of applying their cutting plane method to SFM. We prove the same running time bound in a substantially simplified way. Firstly, instead of using the Lovász extension as in [19] and in [27], we apply the cutting plane method to find a feasible solution in Fµ , as defined in (9). We use the sliding technique as in Section 3 for the cutting plane algorithm. Secondly, we employ the combinatorial framework in a black-box manner, by implementing Approx-SFM via the Lee-SidfordWong algorithm. The combinatorial interpretation of the certificate returned by the cutting plane method turns out to be much easier than in [27]. Weakly polynomial algorithm Let us start by exhibiting a weakly polynomial O(n2 log(nLf,2 ) · EO + n3 logO(1) (nLf,2 )) algorithm for SFM, which is the same as the running time in [27]. We use a slight modification of the cutting plane algorithm [27, Section 6.4, Algorithm 2]. We start with µ = max{0, −f (V )}, and maintain a set W with f (W ) = −µ throughout. For the current iterate x(k) , GreedyMin(fµ , x(k) ) is used as the separation oracle for int(Fµ ), which returns an extreme base g of B(fµ ). If g ⊤ x(k) > 0, then x(k) ∈ int(Fµ ), thus, x(k) is feasible. In this case, instead of terminating, we modify the value of µ as in the sliding von Neumann algorithm. That is, we set W = MinSet(fµ , x(k) ), and set the new value µ′ = −f (W ). From Lemma 3.2, we see that x(k) ∈ / int(Fµ′ ). Thus, we can continue with adding a new cutting plane. Note that Fµ′ ⊆ Fµ if µ′ > µ. Hence, all previous separations remain valid. (Again, this is similar to the sliding objective technique, although we are changing all constraints of the polytope simultaneously.) When −µ is the minimum value of f , Lµ has no points in the interior, therefore we stop when the volume of the current relaxation becomes too small. In this setting, we have SO = n·EO+n log n. For every value of µ, Fµ ⊆ Bn by definition, and √ Lemma 3.6 implies that,√as long as minS⊆V f (S) < −µ, Fµ contains a ball of radius 1/(4 nLf,2 ). Hence, κ = O( nLf,2 ), giving the desired running time bound. Let us note that, even using the original ellipsoid method, as in Grötschel, Lovász, and Schrijver [19], one can obtain O((n3 · EO + n4 ) log(nLf,2 )), since the original ellipsoid algorithm finds a feasible point in time O((n2 · SO + n4 ) log κ) in the oracle model. Interestingly, even such a simple and direct use of the standard ellipsoid method, compared to the usual approach of minimizing the Lovász extension, provides a running time that is a factor n lower than any weakly-polynomial SFM-algorithm known prior to the work of Lee-Sidford-Wong [27]. Strongly polynomial algorithm Let us now show an O((n4 · EO + n5 ) log(nδ −1 )) implementation of Approx-SFM(f, δ) using the Lee-Sidford-Wong cutting plane method. We use Theorem 31 from [27]. For K = Fµ (for any value of µ), by definition Fµ ⊆ Bn ⊆ Bn∞ (1), that is, R = 1. Due to the sliding, the algorithm cannot find a feasible solution, and thus it always returns a thin direction as follows. Theorem 6.1 ([27, Theorem 31]). For any ε ∈ [0, 1], in expected time O(n log(n/ε)) · SO + n3 logO(1) (n/ε)), the (sliding) cutting plane method returns a value µ, and constraints a⊤ i x ≥ bi for i ∈ [h], where h = O(n), kai k2 = 1, which are all valid for Fµ . Each of these constraint is either an original box constraint, that is xj ≥ −1 or −xj ≥ −1, or an inequality returned by the separation oracle. Let P denote the intersection of these hyperplanes. 20 Further, we obtain non-negative numbers t1 , t2 , t3 , . . . , th with t1 = 1, and a point x∗ ∈ P , which satisfy the following: √ (a) kx∗ k2 ≤ 3 n, Ph √ = O( nε log(1/ε)), (b) i=1 ti ai 2 ∗ (c) a⊤ i x − bi ≤ ε, ⊤ P Ph √ h (d) x∗ − i=1 ti bi ≤ O( nε log(1/ε)). i=1 ti ai The output certifies that the region P ∩ Bn∞ (1) has small width in the direction of Ph Ph a1 . In fact, for ā = i=1 ti ai and b̄ = i=1 ti bi , the valid inequality ā⊤ x ≥ b̄ is “close” to ⊤ ⊤ n −a⊤ 1 x ≥ −b1 . Indeed, from (b) we see that a1 x+ā x = O(nε log(1/ε)) for every x ∈ B∞ (1). Then, (c) and (d) imply that b1 + b̄ = O(nε log(1/ε)). We show that for an appropriately chosen ε, this can be used to implement ApproxSFM(f, δ). Lemma 6.2. For an appropriate ε such that δ = Ω(n3/2 ε log(1/ε)), from the output of the cutting plane method we can obtain W and y as required for Approx-SFM(f, δ), that is, f (W ) ≤ y − (V ) + δLf . Proof. Let [h] = Ib ∪Is , where Ib is the set of indices i such that a⊤ i xi ≥ bi is a box constraint, and Is is the set of indices corresponding to constraints from the separation oracle. Each constraint in Is is of the form ai = gi /kgi k2 and bi = 0, where gi is an extreme base of B(fµi ), where µi ≤ µ was the value of µ at the time this cutting plane was added. The lemma will easily follow from the next claim. P Claim 6.3. The index 1 is in Is , and i∈Is ti ai 2 = O(nε log(1/ε)). Proof. First, we show that 1 ∈ Is . For a contradiction, assume that 1 ∈ Ib , that is, a1 = ej or a1 = −ej for some j ∈ [n] and b1 = −1. As noted above, b1 + b̄ = O(nε log(1/ε)); hence, b̄ > 0 follows (for small enough ε). This is a contradiction, since bi = −1 for all i ∈ Ib , and bi = 0 for all i ∈ Is . b̄ = O(nε log(1/ε)). Again, this√implies that P P Thus, 1 ∈ Ib , and therefore b1 = 0. Thus,P t a t a + t = O(nε log(1/ε)). Together with i∈Is i i 2 = O( nε log(1/ε)) i∈Ib i i i∈Ib i P from (b), we get that i∈Is ti ai 2 = O(nε log(1/ε)), as required.   P P P ti ti ti 1 Let v = i∈Is kgi k2 . Since 1 ∈ Is , we have we i∈Is kgi k2 ≥ Lf,2 ≥ i∈Is kgi k2 gi / 1 Lf . Hence, it follows that kvk1 ≤ √ X √ nkvk2 ≤ Lf n ti a i i∈Is 2 = O(Lf n3/2 ε log(1/ε)) ≤ 2δLf . Then, Lemma 5.1 is applicable to provide the certificate for Approx-SFM(f, δ). Note that the set W with f (W ) = −µ has been maintained during the cutting plane algorithm. Combining with Theorem 4.13, the total complexity of the oracle calls is O((n3 · EO + n ) log(nLf,2 )). However, the total time for recomputing the extreme bases as in line 5 in Algorithm 3 would consume time O(n4 · EO + n5 ), since k = O(n). To decrease this term by a factor n, we can adapt the same trick as in the proof of Lemma 79 in [27]. At the expense of selecting δ to be smaller by a factor n, it suffices to recompute only one of the gi ’s, instead of the entire combination. 4 21 Comparison to the Lee-Sidford-Wong SFM algorithm Let us now compare our approach to the SFM algorithm described in [27, Part III]. We employ the same cutting plane method, and a common framework is using ring families; our bucketing argument has been adapted from [27]. Their combinatorial framework is more complex than ours: upper bounds analogous to the lower bounds ℓ(z) are needed, and accordingly, their algorithm identifies both outgoing and incoming arcs, as well as removes elements which cannot be contained in any minimizer. The simple trick that enables us to work only with lower bounds, and identify only incoming arcs is repeatedly truncating the value of f (V ); thus, we can bound Lf ↓ in terms of ℓ− (V ), as in Claim 4.7. Our black-box approach clearly separates the combinatorial argument from the cutting plane method, which is used only inside the oracle. In contrast, these two ingredients cannot be clearly separated in [27]. They use the cutting plane method for the formulation using the Lovász extension, and they transform the cutting plane certificate to identify a small norm convex combination in the base polytope. This is analogous to, but substantially more complicated than, our Lemma 6.2. In particular, it is not always possible to identify such a combination, since the constraints of the feasible region can have large coefficients. In such cases, these large coefficients can be used to fix some of the variables to 0 and 1, and hence make progress in terms of the ring family. In contrast, the certificate from our sliding cutting plane algorithm on Fµ can be straightforwardly translated in Lemma 6.2 to satisfy the requirements of the approximate oracle. References [1] F. Bach. Learning with submodular functions: A convex optimization perspective. Foundations and Trends in Machine Learning, 6(2-3):145–373, 2013. [2] A. Belloni, R. M. Freund, and S. Vempala. An efficient rescaled perceptron algorithm for conic systems. Mathematics of Operations Research, 34(3):621–641, 2009. [3] U. Betke. Relaxation, new combinatorial and polynomial algorithms for the linear feasibility problem. Discrete & Computational Geometry, 32(3):317–338, 2004. [4] R. G. Bland, D. Goldfarb, and M. J. Todd. The ellipsoid method: A survey. Operations research, 29(6):1039–1091, 1981. [5] D. Chakrabarty, P. Jain, and P. Kothari. Provable submodular minimization using Wolfe’s algorithm. In Advances in Neural Information Processing Systems (NIPS), pages 802–809, 2014. [6] D. Chakrabarty, Y. T. Lee, A. Sidford, and S. C.-w. Wong. Subquadratic submodular function minimization. In ACM Symposium on Theory of Computing (STOC), pages 1220–1231, 2017. [7] S. Chubanov. A polynomial algorithm for linear feasibility problems given by separation oracles. http://www.optimization-online.org/DB HTML/2017/01/5838.html, 2017. [8] D. Dadush, L. A. Végh, and G. Zambelli. Rescaling algorithms for linear programming. Part I: Conic feasibility. arXiv preprint arXiv:1611.06427, 2016. [9] G. B. Dantzig. Converting a converging algorithm into a polynomially bounded algorithm. Technical report, Stanford University, 1991. [10] J. Dunagan and S. Vempala. A simple polynomial-time rescaling algorithm for solving linear programs. Mathematical Programming, 114(1):101–114, 2008. [11] J. Edmonds. Submodular functions, matroids, and certain polyhedra. Edited by G. Goos, J. Hartmanis, and J. van Leeuwen, 11, 1970. [12] A. R. Ene and H. L. Nguyen. Random coordinate descent methods for minimizing decomposable submodular functions. In Proceedings of the 32nd International Conference on Machine Learning (ICML), 2015. [13] A. R. Ene, H. L. Nguyen, and L. A. Végh. Decomposable submodular function minimization: Discrete and continuous. arXiv preprint arXiv:1703.01830, 2017. 22 [14] A. Frank. Connections in combinatorial optimization. Number 38 in Oxford lecture series in mathematics and its applications. Oxford Univ Pr, 2011. [15] S. Fujishige. Lexicographically optimal base of a polymatroid with respect to a weight vector. Mathematics of Operations Research, 5(2):186–196, 1980. [16] S. Fujishige. Submodular functions and optimization, volume 58. Elsevier, 2005. [17] S. Fujishige. A note on submodular function minimization by Chubanov’s LP algorithm. http://www.optimization-online.org/DB HTML/ 2017/09/6217.html, 2017. [18] S. Fujishige and S. Isotani. A submodular function minimization algorithm based on the minimum-norm base. Pacific Journal of Optimization, 7(1):3–17, 2011. [19] M. Grötschel, L. Lovász, and A. Schrijver. Geometric algorithms and combinatorial optimization, volume 2. Springer Science & Business Media, 2012. [20] E. Hazan and S. Kale. Online submodular minimization. Journal of Machine Learning Research, 13(Oct):2903–2922, 2012. [21] R. Hoberg and T. Rothvoß. An improved deterministic rescaling for linear programming algorithms. In International Conference on Integer Programming and Combinatorial Optimization (IPCO), pages 267–278, 2017. [22] S. Iwata. A faster scaling algorithm for minimizing submodular functions. SIAM Journal on Computing, 32(4):833–840, 2003. [23] S. Iwata, L. Fleischer, and S. Fujishige. A combinatorial strongly polynomial algorithm for minimizing submodular functions. Journal of the ACM (JACM), 48(4):761–777, 2001. [24] S. Iwata and J. B. Orlin. A simple combinatorial algorithm for submodular function minimization. In Proceedings of the twentieth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1230–1237, 2009. [25] S. Jegelka and J. A. Bilmes. Online submodular minimization for combinatorial structures. In Proceedings of the 28th International Conference on Machine Learning (ICML11), pages 345–352, 2011. [26] S. Jegelka, H. Lin, and J. A. Bilmes. On fast approximate submodular minimization. In Advances in Neural Information Processing Systems (NIPS), pages 460–468, 2011. [27] Y. T. Lee, A. Sidford, and S. C.-w. Wong. A faster cutting plane method and its implications for combinatorial and convex optimization. In Foundations of Computer Science (FOCS), pages 1049–1065, 2015. [28] J. B. Orlin. A faster strongly polynomial time algorithm for submodular function minimization. Mathematical Programming, 118(2):237–251, 2009. [29] J. Peña and N. Soheili. A deterministic rescaled perceptron algorithm. Mathematical Programming, 155(1-2):497–510, 2016. [30] A. Schrijver. A combinatorial algorithm minimizing submodular functions in strongly polynomial time. Journal of Combinatorial Theory, Series B, 80(2):346–355, 2000. [31] A. Schrijver. Combinatorial optimization - Polyhedra and Efficiency. Springer, 2003. [32] P. Stobbe and A. Krause. Efficient minimization of decomposable submodular functions. In Advances in Neural Information Processing Systems (NIPS), 2010. [33] É. Tardos. A strongly polynomial minimum cost circulation algorithm. Combinatorica, 5(3):247–255, 1985. [34] P. Wolfe. Finding the nearest point in a polytope. 11(1):128–149, 1976. 23 Mathematical Programming,
8cs.DS
Real-time Dynamic MRI Reconstruction using Stacked Denoising Autoencoder Angshul Majumdar Indraprastha Institute of Information Technology, New Delhi, India Abstract In this work we address the problem of real-time dynamic MRI reconstruction. There are a handful of studies on this topic; these techniques are either based on compressed sensing or employ Kalman Filtering. These techniques cannot achieve the reconstruction speed necessary for real-time reconstruction. In this work, we propose a new approach to MRI reconstruction. We learn a non-linear mapping from the unstructured aliased images to the corresponding clean images using a stacked denoising autoencoder (SDAE). The training for SDAE is slow, but the reconstruction is very fast - only requiring a few matrix vector multiplications. In this work, we have shown that using SDAE one can reconstruct the MRI frame faster than the data acquisition rate, thereby achieving real-time reconstruction. The quality of reconstruction is of the same order as a previous compressed sensing based online reconstruction technique. Introduction In Magnetic Resonance Imaging (MRI) one pressing problem is to reduce the data acquisition time. In recent times Compressed Sensing (CS) based techniques are employed to achieve this end. The K-space is partially sampled (thereby reducing scan time); the image is recovered by exploiting its sparsity in some transform domain. CS based MRI reconstruction techniques have gained immense popularity in MRI reconstruction [1-17]. CS based reconstruction is slow, requiring solution of a non-smooth optimization problem that needs to be solved iteratively. This is not an issue for most scenarios including static scans (clinical diagnosis) or studies involving functional MRI. However there may be situations where we would like to recover the image on-the-fly, i.e. in real-time, e.g. in image-guided surgery or tracking problems (catheter tracking) [18, 19]. There are two approaches for causal real-time dynamic MRI reconstruction. The first approach is to apply Kalman Filtering techniques [18, 19] - these are fast, but do not yield very good quality images. The other approach is based on CS based techniques [20-23] - these improve reconstruction quality but are comparatively slow. CS based techniques cannot recover the images in real-time. The reconstruction methods proposed so far suffer from the obvious trade-off between the reconstruction quality and reconstruction speed. If the K-space is uniformly under-sampled, and the image recovered by an Hermetian of the Fourier transform, we would notice aliasing artifacts. CS proposes randomly / incoherent under-sampling. If the Hermetian of the Fourier transform is applied, we would still notice aliasing artifacts but these artifacts would be unstructured. It is not possible to design a linear inverse operator that can obtain an image from the partially sampled K-space - be it random or periodic undersampling. In every iteration CS does a nonlinear thresholding operation that progressively removes the unstructured noiselike artifacts and extracts the image. Thus in essence CS is a non-linear inversion operator. In this work we take a completely new approach to MRI reconstruction based on the Deep Learning framework - we will LEARN the non-linear inversion operation. More specifically our work is based on stacked denoising autoencoders (SDAE). During training the input to the SDAE will be the unstructured aliased (noisy) image (obtained by applying the Hermetian of the Fourier transform to the partially sampled K-space) while the output is the corresponding clean image. SDAE will learn the non-linear analysis (forward) and the synthesis (backward) mapping from the noisy image to the clean image. During testing the Hermetian of the Fourier transform is applied on the partially sampled K-space; the resulting noisy image is input to the SDAE and we will expect a clean version of it at the output. Proponents of SDAE (and other deep learning tools like Restricted Botzman Machines and Convolutional Neural Networks) argue that, they can learn arbitrary non-linear inversion operations given enough data. The SDAE is not related to CS. But since CS is a non-linear inversion operator; we hope that SDAE will be a good tool to learn the non-linear inversion operation and yield good quality images. SDAE requires a huge amount of data and very large training time (in days). However, once the nonlinear mapping is learnt the run-time is very fast. It only requires a few matrix vector products (depending on the depth of the SDAE). Thus in practice, the learned SDAE can be used for real-time MRI reconstruction. Literature Review Dynamic MRI Reconstruction Dynamic MRI reconstruction is an active area of research and there are a lot of papers on this subject. We will only cover some of the major techniques. Offline Reconstruction The dynamic MRI data acquisition model can be expressed succinctly. Let xt, denote the MR image frame at the tth instant. We assume that the images are of size N x N, but are vectorized; T is the total number of frames collected. Let yt be the k-space data for the tth frame. The problem is to recover all Xt’s (t=1…T) from the collected k-space data yt’s. The MR imaging equation for each frame is as follows, yt  RFxt   (1) where R is the sub-sapling mask, F is the Fourier mapping from the image space to the K-space, yt is the acquired K-space data, xt is the tth frame and η is white Gaussian noise. A typical CS approach [1, 2] employs wavelet transform for sparsifying the spatial redundancies in the image domain and Fourier transform for sparsifying along the temporal direction. This is a realistic assumption since both [1, 2] of them worked on dynamic imaging of the heart where the change over time is quasi-periodic, thereby leading to a compact (sparse) support in the Fourier frequency domain. The data from (1) can be organized in the following manner, y  RFx   (2)  y1   x1    where y  ... and x   ...     xT   yT  In both [1, 2] the standard CS optimization problem was proposed to reconstruct the MR image data x from the k-space samples y, 2 min y  RFx 2   W  F1D ( x) 1 x (3) where W  F1D is the Kronecker product of the wavelet transform (for sparsifying in space) and 1D Fourier transform (for sparsifying along temporal direction). In the original studies [1, 2] the Kronecker product was not used; we introduced it to make the notation more compact. The 1D Fourier transform may not always be the ideal choice for sparsifying along the temporal direction (if the signal is not of periodic nature); in such a case 1D wavelet transform may be a better choice. Some other studies [3-5] assumed the image to be sparse in x-f space, i.e. the signal was assumed to be sparse in I  F1D basis (where I is the Dirac basis). In these studies [3-5], the emphasis was on the solver for (3); they used the FOCUSS [6] method for minimizing (3). However, in practice any other state-of-the-art l1norm minimization solver (e.g. Spectral Projected Gradient L1 or Nesterov’s Algorithm) will work. Some other studies [7, 8] either assumed the MR image frames to be spatially sparse or were only interested in the ‘change’ between the successive frames. These studies did not explicitly exploit the redundancy of the MR frames in the spatial domain, rather they only applied a Total Variation (TV) regularization in the temporal domain. The optimization problem is the following, 2 min TVt ( x) subject to y  RFx 2   x (4) N2 where TVt   || t xi || and  t denotes the temporal differentiation for the ith pixel. i 1 There is yet another class of methods that reconstruct the dynamic MRI sequence as a rank deficient matrix. The k-space acquisition model is the same as (1), but instead of concatenating the data as columns in (2), the data is stacked as columns in the following manner, Y  RFX   (5) where Y   y1 | ...| yT  , X   x1 | ...| xT  and   1 | ...| T  . In [9, 10] it is argued that the matrix X is rank deficient, since it can be modeled as a linear combination of very few temporal basis functions. Based on this assumption, [9, 10] proposed solving the inverse problem by matrix factorization, min Y  RF (UV ) U ,V 2 F where X=UV such that X is low-rank. (6) Solving the inverse problem via matrix factorization was an academic exercise. It did not yield the same level of accuracy as CS based techniques. However, later studies proposed combining the two [11-14]. In [12, 13] it was shown that good results are obtained when the rank deficiency of the signal in x-t space is combined with the sparsity in the x-f space. The following optimization problem was proposed to solve for the dynamic MRI sequence min Y  RFX X 2 F  1 I  F1D vec(X) 1  2 X * (7) In recent times, there are a few techniques that proposed learning the sparsifying basis in an adaptive fashion during signal reconstruction. This is dubbed as Blind Compressed Sensing (BCS) [15]. Here it is assumed that the dynamic MRI sequence can be sparsely represented in a learned basis by exploiting the temporal correlation, i.e. X = ZD where D is the sparsifying dictionary and Z is the coefficients. Unlike a fixed sparsifying basis like Fourier, D is learnt simultaneously with Z. The corresponding problem is formulated as: min Y  F ( ZD) D, Z 2 F  1 Z 1 +2 D 2 (8) F This formulation was proposed in [16]. An extension of this basic formulation was proposed in [17]. The first difference between [16] and [17] is that in the later, the sparsifying dictionary is learnt along the spatial direction and not along the temporal direction. Second, [17] exploits the low-rank structure of the dynamic MRI sequence ([16] handles it implicitly by controlling the number of atoms in the dictionary). Third, [17] proposes an analysis prior BCS formulation instead of the commonly used synthesis prior. The reconstruction was formulated via the minimization of the following problem [17] min Y  FX D ,X 2 2  1 DX 1  2 X *  3 D 2 F (9) Online Reconstruction All the studies discussed so far are off-line reconstruction techniques. Online reconstruction techniques reconstruct the image corresponding to the current frame, given the reconstructed images till the previous time frame. In applications of dynamic MRI such as MRI guided surgery the reconstruction has to be performed in real-time. Online reconstruction does not guarantee a real-time solution. For being real-time, a reconstruction technique should be able to recover the images as fast as the frames are acquired. Online dynamic MRI reconstruction is a new area of research and there are only a handful of papers on this subject. The most straightforward way to handle the online dynamic MR reconstruction is to use Kalman Filtering. That is exactly what is done in [16, 17] MRI reconstruction is formulated as a dynamical system and a Kalman filter model is proposed, xt  xt 1  ut (10a) yt  RFxt  t (10b) where the pixel values xt is the state variable, the k-space sample yt is the observation, ηt is the observation noise and ut is the innovation in state variables. In general the Kalman filter is computationally intensive since it requires explicit matrix inversion for computing the covariance matrix. However, in [18, 19], this problem was alleviated by diagonalization of the covariance matrix. This diagonalization was only possible under some simplifying assumptions. The problem with such a diagonal covariance is that the pixel values are assumed to change independently over time. This is not realistic. The diagonality assumption was also subject to sampling requirements – the sampling had to be non-uniform and non-Cartesian. In most practical systems, the sampling is Cartesian. In [20] Kalman filtering of the wavelet coefficients is proposed. The filter model is the following, t  t 1  ut (11a) yt  RFW T t  t (11b) where  t is the wavelet transform coefficient vector for the tth frame. This work was motivated by the findings of compressed sensing. The benefit of this approach is that wavelet whitens the spatial correlations, and hence the diagonality assumption is more feasible compared to the previous studies that operated in the pixel domain. The paper [20] proposed a further check over the Kalman update, i.e. when the error between the prediction and the actual data becomes large, instead of a filter update full reconstruction using CS technique is done. In another work [21], it was proposed that instead of solving the image at the current time frame, the difference between the previous frame and the current one can be reconstructed instead. The following optimization problem is proposed, min yt  RFxt 1  RFW t t 2 2   t 1 (12) where xt 1 is the reconstructed image for the previous frame and  t is the wavelet transform of the difference between the previous and the current frame. The main assumption of [21] is that the sparsity pattern varies slowly with time. For each time frame, the difference of the wavelet transform coefficients  t is computed, from which an intermediate estimate of the wavelet coefficients of current frame is obtained as, t  t 1  t (13) The intermediate estimate is thresholded (via hard thresholding) and all the values below a certain threshold τ are discarded. The value of the thresholded wavelet coefficients are not of importance, but their indices are. Assuming that the set of indices having non-zero values after thresholding is Ω, the final value of the wavelet transform coefficient is estimated as, t  ( RFW T )† yt (14) where ( )† denotes the Moore-Penrose pseudo-inverse and ( ) indicates that only those columns of the matrix has been chosen that are indexed in Ω. In [22] a simpler approach was proposed. It was postulated that the difference between subsequent frames is sparse. The sparse difference frame can be directly estimated using CS techniques and added to the previous frame. 2 min yt  RF ( xt 1  xt ) 2   xt xt (15) 1 where xt  xt 1  xt . This simple technique yields good results in general. But this was improved further by replacing the previous frame as the reference frame by a linear prediction [23]. The assumption is that the difference between the linear prediction of the current frame and the current frame will be sparser than the difference between the previous frame and the current frame; such a difference could be recovered with fewer Kspace measurements and hence improve temporal resolution of dynamic MRI. W W’ Output Layer Input Layer Autoencoder Hidden Layer Fig. 1. Simple Single Layer Autoencoder An autoencoder consists (as seen in Fig. 1) of two parts – the encoder maps the input to a latent space, and the decoder maps the latent representation to the data [24, 25]. For a given input vector (including the bias term) x, the latent space is expressed as: h  Wx (16) Here the rows of W are the link weights from all the input nodes to the corresponding latent node. The mapping can be linear [26], but in most cases it is non-linear. Usually a sigmoid function is used, leading to: h   (Wx) (17) The sigmoid function shrinks the input (from the real space) to values between 0 and 1. Other non-linear activation functions (like tanh) can be used as well. The decoder portion reverse maps the latent variables to the data space. x  W ' (Wx) (18) Since the data space is assumed to be the space of real numbers, there is no sigmoidal function here. During training the problem is to learn the encoding and decoding weights – W and W’. In terms of signal processing lingo, W is the analysis operator and W’ is the synthesis operator. These are learnt by minimizing the Euclidean cost: arg min X  W ' (WX ) W ,W ' 2 F (19) Here X  [ x1 | ...| xN ] consists all the training sampled stacked as columns. The problem (19) is clearly Output Layer Input Layer non-convex. It is solved by gradient descent techniques since the sigmoid function is smooth and continuously differentiable. ……… Hidden Layer 1 Hidden Layer L Fig. 2. Stacked Autoencoder There are several extensions to the basic autoencoder architecture. Stacked / Deep autoencoders [27] have multiple hidden layers (see Fig. 2). The corresponding cost function is expressed as follows: arg min X  g f (X ) W1 ...WL1 ,W '1 ...W 'L 2 F (20) where g  W1 ' W2 '...WL '  f ( X )   and f   WL 1 WL 2 ... (W1 X )   Solving the complete problem (20) is computationally challenging. The weights are usually learned in a greedy fashion – one layer at a time [28]. Stacked denoising autoencoders [29] are a variant of the basic autoencoder where the input consists of noisy samples and the output consists of clean samples. Here the encoder and decoder are learnt to denoise noisy input samples. Another variation for the basic autoencoder is to regularize it, i.e. arg min X  g f ( X ) (W ) s 2 F  R(W , X ) (21) The regularization can be a simple Tikhonov regularization – however that is not used in practice. It can be a sparsity promoting term [30] or a weight decay term (Frobenius norm of the Jacobian) as used in the contractive autoencoder [31]. The regularization term is usually chosen so that they are differentiable and hence minimized using gradient descent techniques. Proposed Approach (a) (b) (c) Fig. 1. (a) Original, (b)Reconstruction from Variable Density Random Sampling, (c) Reconstruction from Periodic Undersampling In Fig. 1a. we show image of the Shepp-Logan phantom. Fig. 1b shows reconstruction by applying the Hermetian of the Fourier operator for variable density random sampling (a pattern popular in CS based MRI reconstruction). Fig. 1c. shows reconstruction by applying the Hermetian of the Fourier operator for uniform (regular) undersampling. We see that for regular undersampling, aliasing artifacts are present this is expected. For variable density undersampling the aliasing is unstructured - it is more noiselike. Ideally, we would get even more unstructured artifacts if we used a completely random sampling mask, but this is not practically feasible for accelerating MRI scans. The K-space data acquisition model is expressed as, y  RFx   (22) where the symbols have their usual meaning. CS exploits the sparsity of the image in a transform domain for recovery. Assuming that the sparsifying transform is tight-frame or orthogonal, (22) can be expressed as, y  RFW T    (23) Here W is the sparsifying transform. CS recovery algorithms based on l1-norm minimization usually proceed in two steps   Gradient descent - which is a linear operation Thresholding - which is a non-linear operation. These two steps are iterated till convergence. Greedy algorithms for sparse recovery also proceed iteratively. The exact steps depend on the algorithm in use, but all of them have a non-linear operation either in the form of sorting (OMP [32]) or thresholding (Stagewise OMP [33]). All CS recovery techniques are non-linear inversion operators. The main advantage of CS is that it is non-adaptive. But the disadvantage of CS is that it is iterative and hence time consuming; therefore not fit for problems where reconstruction speed is of concern. That is the reason, CS based techniques have not been very successful in real-time dynamic MRI reconstruction. In this work, we propose to employ a stacked denoising autoencoder (SDAE) to learn the non-linear inversion in an adaptive fashion. As discussed before, autoencoders have a simple non-linear activation function associated with the neurons. Proponents of deep learning believe that autoencoders (and other related tools like Restricted Boltzman Machines) can learn arbitrary non-linear functional relationships given enough data. However there is no mathematical analysis to support this claim. In practice it has been found to give extremely good results. In some recent studies where SDAE was used for image denoising [26, 30] it was observed that SDAEs can compete with state-of-the-art denoising techniques like BM3D [34] and KSVD [35]. Connection with Dictionary Learning The KSVD has popularised dictionary learning in signal processing and machine learning. It has been used in almost every perceivable image processing scenario. The original KSVD formulation learns a dictionary that can represent the training data in a sparse fashion. The model is X=DSZ where X is the data, DS is the learnt dictionary and Z are the sparse coefficients. In general dictionary learning can be expressed as, min X  DS Z DS , Z 2 F  Z (24) 1 The problem (24) is solved by alternately updating DS (dictionary / codebook) and Z (sparse code). This is the so called synthesis prior formulation where the task is to find a dictionary that will synthesize / generate signals from sparse coefficients. There is an alternate co-sparse analysis prior dictionary learning paradigm [36] where the goal is to learn a dictionary such that when it is applied on the data the resulting coefficient is sparse. The model is D Xˆ  Z . The corresponding learning problem is framed as: A minˆ X  Xˆ DA , X 2 F   DA Xˆ 1 (25) The autoencoder learns the analysis and the synthesis dictionaries simultaneously. The learning technique for a single layer autoencoder is (19); we repeat it for the sake of convenience. min X  WS (WA X ) WA ,WS 2 F (26) It does not specifically look for a sparse solution (hence there is no sparsity promoting term). For the linear activation function, it is the same as jointly learning the analysis and the synthesis dictionaries. Design Principle To design an autoencoder, there are two design aspects that needs to be specified - the number of hidden layers and the number of nodes in these hidden layers. In principle it is possible to learn arbitrary nonlinear functional relationships with a single layer having a very large number of nodes - usually much larger than the dimensionality of the input samples. But this is not usually preferred. This is because, to learn a large number of weights the volume of training data needs to be very large. This is usually not available. Over the years, proponents of SDAE and other deep learning tools have proposed a stacked approach instead. I/P H1 H2 H1 O/P Fig. 2. Two Layer SDAE Usually the number of nodes in the hidden layers reduce as one goes deeper into the SDAE. For example consider a document retrieval system; in [37] it was shown that starting from a 2000 length term frequency feature it is possible to learn a binary code (2 nodes) by using a multi-layer autoencoder with 500 neurons in the first layer, 250 in the 2nd hidden layer and 2 in the deepest layer. To understand the learning process, we take a simple SDAE in Fig. 2. First the weights corresponding to the outermost hidden layer (H1) is learnt by solving the following problem. min X  WS1 (WA1 X ) 1 1 WA ,WS 2 F (27) This learns the weights and gives us the first level features Z   (WA1 X ) . The first level features are now used as training data for the second input layer. The weights for the second layer is solved by, min Z  WS2 (WA2 Z ) 2 2 WA ,WS 2 F (28) This process can be continued if there are more than 2 hidden layers. There is no analytical rule that helps design an autoencoder. It is largely based on the experience of the researcher. Bengio and Hinton have independently suggested that care must be taken while reducing the number of nodes, the reduction should not be too fast or too soon. Proposed Architecture In this work we are considering images of size 100 X 100. A variable density random sampling pattern is used for subsampling the K-space. The K-space data acquisition is modeled as (22). The input to the SDAE is the unstructured (noiselike) aliased image obtained by, xˆ  F H RT y (29) The output consists of corresponding clean images. The SDAE learns the mapping from the noisy input to the clean output. During operation, we expect the SDAE to yield a clean image when presented with a noisy aliased image. We propose to use a 2 hidden layer, 3 hidden layer and 4 hidden layer SDAE. The number of nodes in the first hidden layer is 2500, in the second hidden layer it is kept to 625 and in the third hidden layer it is kept to be 144. The sigmoid activation function is used throughout, i.e.  (t )  1 1  et (30) It has been observed in [30] that Sparsity improves the denoising performance of autoencoders. Therefore we have learnt the weights of the deepest (bottleneck) layer using a sparsity promoting regularization. min X  WS (WA X ) WA ,WS 2 F   WA X 1 (31) The issue with adding the sparsity promoting term is that we had to learn the SDAE for 2 layers, 3 layers and 4 layers separately. Experimental Results The experimental data for training was obtained from the Laboratory of Neuro Imaging (LONI) at the University of Southern California. The dataset contains about 17424 volumes; and multiple slices in each volume. In total we have used about 100,000 images for training the SDAE's. For testing we use the same datasets as in [22]. The experimental evaluation was performed on five sets of data. Two myocardial perfusion MRI datasets were obtained from [38]. These datasets were used in [8]. We will call these two sequences to be called the Cardiac Perfusion Sequence 1 and 2. The data was collected on a 3T Siemens scanner. Radial sampling trajectory was used; 24 radial sampling lines were acquired for each time frame. The full resolution of the dynamic MR images is 128 x 128. About 6.7 samples were collected per second. The scanner parameters for the radial acquisition were TR=2.5–3.0 msec, TE=1.1 msec, flip angle = 12° and slice thickness = 6 mm. The reconstructed pixel size varied between 1.8 mm2 and 2.5 mm2. Each image was acquired in a ~ 62-msec read-out, with radial field of view (FOV) ranging from 230 to 320 mm. Unfortunately, for these datasets, the fully sampled k-space scans are not available. Therefore the reconstruction results obtained from [8] is taken as the basis images for comparison. The third and fourth datasets comprise of the Larynx and Cardiac sequence respectively. The data has been obtained from [39]. The larynx sequence is of size 256 x 256 and the cardiac sequence is of size 128 x 18 for each time frame. Six images were collected per second. We do not have further details pertaining to the MRI acquisition for these datasets. In this paper, follow the same protocol as in [22]; we have simulated radial sampling with 24 lines (for keeping it at par with the aforementioned dataset) for each image. Our final dataset is obtained from [40]. It consists of a dynamic MRI scan of a person repeating the word ‘elgar’. This is the Speech Sequence. The image is of resolution 180 x 180 and is obtained at the rate of 6 frames per second. This dataset was collected to study the tongue positions during speech. The MRI acquisition parameters related to this study are not reported here. For this sequence, we simulated radial k-space sampling with 24 lines. For our experiments we have resized all the images to size 100 X 100 before simulating the K-space acquisition. This is done to maintain parity between our proposed SDAE and other techniques. Results on Reconstruction Accuracy The reconstruction accuracy is measured in terms of Normalised Mean Squared Error (NMSE). The proposed technique is compared with one offline and two online techniques. The offline technique is k-t SLR [11]. The implementation for the same has been obtained from the authors' website [41]. The online techniques we compared against are Kalman Filtering [18] and Differential CS [22]. The author's of Kalman Filtering shared their code with us, we are grateful for them. The code of Differential CS is available with us. The reconstruction errors and the standard deviations are shown in the following Table. Table 1. Mean and the Standard Deviation of the NMSEs on different datasets Dataset k-t SLR Cardiac Perfusion 1 Cardiac Perfusion 2 Larynx 0.123, ±0.040 0.185, ±0.061 0.028, ±0.012 0.075, ±0.022 0.221, ±0.055 Cardiac Speech Kalman Filter 0.340, ±0.112 0.442, ±0.184 0.048, ±0.020 0.127, ±0.101 0.435, ±0.106 Diff CS 0.179, ±0.067 0.228, ±0.089 0.032, ±0.015 0.079, ±0.028 0.313, ±0.087 SDAE-2 Layer 0.207, ±0.098 0.358, ±0.113 0.043, ±0.021 0.0101, ±0.057 0.396, ±0.093 SDAE-3 Layer 0.183, ±0.056 0.305, ±0.067 0.038, ±0.015 0.084, ±0.027 0.350, ±0.060 SDAE-4 Layer 0.181, ±0.045 0.302, ±0.052 0.035, ±0.010 0.083, ±0.021 0.346, ±0.052 We observe that k-t SLR yields the best results. This is understandable - it is an offline technique and has access to the whole dataset for reconstruction. It exploits the spatio-temporal correlation from all the frames and therefore yields the best result. The results from Kalman filter are the worst. This has been observed before as well [22, 23]. The Kalman Filter makes certain simplifying assumptions (like motion being Gaussian and the pixels being uncorrelated) which simplifies the algorithm but in turn reduces the time accuracy. The Differential CS method yields good results, it is between k-t SLR and Kalman Filter. The problem with this approach is that the error keeps on accumulating; here the difference between every frame and the previous one is being reconstructed. The error incurred in reconstructing a frame is accumulated in subsequent frames therefore the error keeps on increasing with time. Our proposed approach based on SDAE (2, 3 and 4 layers) yield higher error than Differential CS but is lower than the Kalman Filtering. We find that from the 2 (hidden) layer Sparse SDAE to 3 layer architecture, there is significant reduction in the mean and standard deviations of NMSEs. From the 3rd layer to the 4th layer there is only marginal reduction in mean NMSE but a significant improvement in standard deviation. The decrease in the standard deviation is owing to the averaging effect of the SDAE. We have reported NMSE since it has been widely used as a metric for comparing MRI reconstruction. But NMSE or PSNR is not a good metric to represent subjective quality; SSIM is a better choice in that respect. In Table 2 we report the mean SSIM for all the datasets obtained from different reconstruction techniques. Table 2. Mean SSIMs on different datasets Dataset k-t SLR Diff CS 0.85 Kalman Filter 0.69 Cardiac Perfusion 1 Cardiac Perfusion 2 Larynx 0.78 SDAE-2 Layer 0.72 SDAE-3 Layer 0.76 SDAE-4 Layer 0.75 0.87 0.66 0.80 0.73 0.79 0.77 0.93 0.76 0.85 0.82 0.84 0.84 Cardiac Speech 0.94 0.76 0.78 0.61 0.86 0.70 0.82 0.65 0.83 0.68 0.83 0.66 The results from Table 2 are almost similar to Table 1, except that we see the 4 Layer sparse SDAE actually yields slightly worse results than the 3 Layer structure. Although the 4 layer structure yields better results in terms NMSE, in terms of perceptual quality it is likely to be worse. For visual evaluation sample reconstructed images are shown in Fig. 1. The difference in reconstruction quality can be better evaluated from the difference images. These are shown in Fig. 2. The difference is magnified 10 times for visual evaluation. Fig. 1. Reconstructed Images. Left to Right - Cardiac, Larynx and Speech. Top to Bottom - Ground-truth; k-t SLR; Kalman Filter Reconstruction, Differential CS Reconstruction; Proposed SDAE Reconstruction (3 Layer) Fig. 2. Difference Images. Left to Right - Cardiac, Larynx and Speech. Top to Bottom - Ground-truth; k-t SLR; Kalman Filter Reconstruction, Differential CS Reconstruction; Proposed SDAE Reconstruction (3 Layer) From the difference images it is clearly seen that k-t SLR yields the best results. Kalman Filter yields the worst reconstruction, there are a lot of reconstruction artifacts. The recovery results from the Differential CS formulation and our proposed SDAE are almost similar. However we want to reiterate that Differential CS gradually accumulated error. Our method does not. We are independently reconstructing every frame. They are not part of any sequence. To emphasize it, we show the reconstructed and difference images of the speech sequence for the 3rd, 15th and 60th frames. One can see the error gradually increases with time for the Differential CS technique. We find that the error gradually increases for Differential CS - this is observed both from reconstructed and difference images. For our method (SDAE - 3 layer) the reconstruction is uniform. Fig. 3. Differential CS reconstruction and proposed reconstruction. Top row - reconstructed images for Differential CS; 2nd row - Reconstructed images from proposed method (SDAE - 3 layer). 3rd Row difference images from Differential CS; Last Row - difference images from proposed reconstruction. Left to Right - 3rd, 15th and 60th frames. Results on Reconstruction Speed Here we discuss the average reconstruction speeds from the three online techniques - Kalman Filter, Differential CS and Proposed. The experiments were run on a Core i7 CPU (3.1 GHz) having a 16 GB RAM running 64 Windows 7. The platform is Matlab 2012a. As mentioned before, for all the experiments we have resized the images to size 100 X 100. The average reconstruction time from Kalman Filter is 0.33 seconds and from the Differential CS technique it is 0.13 seconds. For our proposed 2 layer SDAE the average reconstruction time is 0.0274 seconds, for 3 layer SDAE it is 0.0300 seconds 0.0310 seconds. For images of size around 100 X 100 pixels, the data acquisition rate is usually between 6 to 7 frames per second (at full resolution). With acceleration (partial K-space sampling) this frame rate can go up higher 18 to 21 frames per second for 3 fold acceleration. Studies like Differential CS can only reconstruct 7-8 frames per second. The Kalman Filter method is even slower (3 frames per second). Only our method can recover the frames at the required speed. SDAE only requires a few matrix vector multiplications (depending on the depth of the architecture); Our 3 layer SDAE can process 33 frames per second. Conclusion This is the first work that proposes to frame MRI reconstruction from partial K-space samples in the stacked denoising autoencoder framework. Our technique requires a long training phase but a very short runtime. Hence, we believe it can be used for real time dynamic MRI reconstruction. We carried out extensive experiments to corroborate our proposal. The major bottleneck of our approach is that it is only applicable to images of fixed size. We have assumed images to be size 100 X 100. The SDAE is learnt for this particular image dimension; to handle images of other sizes another SDAE needs to be learnt. However since training the SDAE is an offline process, it does not hamper the performance in any fashion. Here we have assumed that the K-space sampling mask remains fixed and does not change with time. The autoencoder learns to get rid of the unstructured aliasing artifacts thus introduced. However, it is possible to change the sampling mask. In that case our proposed SDAE may not work and one may need to introduce training samples corresponding to all possible sub-sampling masks. In the future, we would like to work on this problem. We believe that learning an entirely new SDAE may not be necessary, and we can use domain adaptation concepts to handle the aliasing artifacts introduced by the variation in sampling masks. References [1] U. Gamper, P. Boesiger, S. Kozerke, “Compressed sensing in dynamic MRI”, Magnetic Resonance in Medicine, Vol. 59 (2), pp. 365 – 373, 2008. [2] M. Lustig, J.M. Santos, D.L. Donoho, J.M Pauly “k-t SPARSE: High Frame Rate Dynamic MRI Exploiting SpatioTemporal Sparsity” ISMRM '06. [3] H. Jung, J. C. Ye, E. Y. Kim, “Improved k-t BLAST and k-t SENSE using FOCUSS”, Phys Med Biol, Vol. 52, pp. 3201– 3226, 2007. [4] H. Jung, J. Park, J. Yoo, and J. C. Ye, “Radial k-t FOCUSS for High-Resolution Cardiac Cine MRI”, Magnetic Resonance in Medicine, Vol. 63, pp. 68–78, 2010. [5] H. Jung, J. Park, J. Yoo, and J. C. Ye, “k-t FOCUSS: A General Compressed Sensing Framework for High Resolution Dynamic MRI”, Magnetic Resonance in Medicine, Vol. 61, pp. 103–116, 2009. [6] B. D. Rao and K. Kreutz-Delgado, “An affine scaling methodology for best basis selection,” IEEE Transactions on Signal Processing, Vol.47 (1), pp.187-200, 1999. [7] L. Chen, M. C. Schabel, E. V. R. DiBella, “Reconstruction of dynamic contrast enhanced magnetic resonance imaging of the breast with temporal constraints”, Magnetic Resonance Imaging, Vol. 28 (5), pp. 637-645, 2010. [8] G. Adluru, C. McGann, P. Speier, E. G. Kholmovski, A. Shaaban and E. V. R. DiBella, “Acquisition and Reconstruction of Undersampled Radial Data for Myocardial Perfusion Magnetic Resonance Imaging”, Journal of Magnetic Resonance Imaging, Vol. 29, pp. 466-473, 2009. [9] B. Zhao, J. P. Haldar, C. Brinegar, Z. P. Liang, “Low rank matrix recovery for real-time cardiac MRI”, International Symposium on Biomedical Imaging, pp.996~999, 2010. [10] J. P. Haldar, Z.-P. Liang, “Low-Rank Approximations for Dynamic Imaging”, IEEE International Symposium on Biomedical Imaging: From Nano to Macro, Chicago, 2011, pp. 1052-1055. [11] S. Goud, Y. Hu, E. DiBella, M. Jacob, “Accelerated dynamic MRI exploiting sparsity and low-rank structure”, IEEE Trans. Medical Imaging, pg 1042-1054, Vol. 30, May 2011. [12] B. Zhao, J. P. Haldar, A. G. Christodoulou, Z.-P. Liang, “Image Reconstruction from Highly Undersampled (k,t)-Space Data with Joint Partial Separability and Sparsity Constraints”, IEEE Transactions on Medical Imaging 31:1809-1820, 2012. [13] A. Majumdar, "Improved Dynamic MRI Reconstruction by Exploiting Sparsity and Rank-Deficiency", Magnetic Resonance Imaging, Vol. 31(5), pp. 789-95, 2013. [14] A. Majumdar, R. K. Ward and T. Aboulnasr, "Non-Convex Algorithm for Sparse and Low-Rank Recovery: Application to Dynamic MRI Reconstruction", Magnetic Resonance Imaging, Vol. 31 (3), pp. 448 - 455. [15] Gleichman S, Eldar YC. Blind Compressed Sensing. IEEE Trans. on Information Theory 2011; 57: 6958-6975. [16] Lingala SG, Jacob M. Blind Compressed Sensing Dynamic MRI. IEEE Transactions on Medical Imaging 2013; 32: 1132114532. [17] A. Majumdar, “Improving Synthesis and Analysis Prior Blind Compressed Sensing with Low-rank Constraints for Dynamic MRI Reconstruction”, Magnetic Resonance Imaging, Vol. 33(1), pp. 174-179, 2015 [18] Uygar Sümbül, Juan M. Santos, and John M. Pauly, “A Practical Acceleration Algorithm for Real-Time Imaging”, IEEE Transactions on Medical Imaging, Vol. 28 (12), 2009. [19] Uygar Sümbül, Juan M. Santos, and John M. Pauly, “Improved Time Series Reconstruction for Dynamic Magnetic Resonance Imaging”, IEEE Transactions on Medical Imaging, Vol. 28 (7), 2009. [20] N. Vaswani and W. Lu, “Modified-CS: Modifying Compressive Sensing for Problems with Partially Known Support”, IEEE Transactions on Signal Processing, Vol. 58 (9), 2010 [21] N. Vaswani, “LS-CS-Residual (LS-CS): Compressive Sensing on Least Squares Residual”, IEEE Transactions on Signal Processing, Vol.58 (8), pp.4108-4120, 2010. [22] A. Majumdar, R. K. Ward and T. Aboulnasr, “Compressed Sensing Based near Real-Time Online Dynamic MRI Reconstruction”, IEEE Transactions on Medical Imaging, Vol. 31 (2), pp. 2253 – 2266, 2012. [23] A. Majumdar, “Motion Predicted Online Dynamic MRI Reconstruction from Partially Sampled K-Space Data”, Magnetic Resonance Imaging, Vol. 31 (9), pp. 1578–1586, 2013. [24] Rumelhart, D. E., Hinton, G. E., and Williams, R. J. "Learning representations by back-propagating errors", Nature, 323, 533-536, 1986 [25] Baldi, P. and Hornik, K.. Neural networks and principal component analysis: Learning from examples without local minima. Neural Networks, 2, 53-58, 1989 [26] M. Chen, Z. Xu, K. Weinberger and F. Sha, "Marginalized Denoising Autoencoders for Domain Adaptation", arXiv:1206.4683 [27] Bengio, Y. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2 (1),1-127. 2009 [28] Bengio, Y., Lamblin, P., Popovici, D., and Larochelle, H. Greedy layer-wise training of deep net works. Advances in Neural Information Processing Systems 19, pp. 153-160. 2006 [29] Vincent, P., Larochelle, H., Lajoie, I., Bengio, Y., and Manzagol, P.-A. Stacked denoising autoen coders: Learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 11, 3371-3408, 2010. [30] K. H. Cho, "Simple Sparsification Improves Sparse Denoising Autoencoders in Denoising Highly Noisy Images", ICML 2013. [31] S Rifai, P Vincent, X Muller, X Glorot, Y Bengio, "Contractive auto-encoders: Explicit invariance during feature extraction", ICML 2011. [32] J. A. Tropp and A. C. Gilbert, “Signal recovery from random measurements via Orthogonal Matching Pursuit”, IEEE Trans. Inform. Theory, vol. 53, num. 12, pp. 4655-4666, Dec. 2007 [33] Donoho, D.L.; Tsaig, Y.; Drori, I.; Starck, J.-L., "Sparse Solution of Underdetermined Systems of Linear Equations by Stagewise Orthogonal Matching Pursuit," Information Theory, IEEE Transactions on , vol.58, no.2, pp.1094,1121, Feb. 2012 [34] K. Dabov, A. Foi, V. Katkovnik, and K. Egiazarian, “Image denoising with block-matching and 3D filtering,” Proc. SPIE Electronic Imaging '06, no. 6064A-30, San Jose, California, USA, January 2006. [35] M. Aharon, M. Elad, and A.M. Bruckstein, "The K-SVD: An Algorithm for Designing of Overcomplete Dictionaries for Sparse Representation", the IEEE Trans. On Signal Processing, Vol. 54, no. 11, pp. 4311-4322, November 2006 [36] R. Rubinstein, T. Peleg and M. Elad, Analysis K-SVD: A Dictionary-Learning Algorithm for the Analysis Sparse Model, IEEE Trans. on Signal Processing, Vol. 61, No. 3, Pages 661-677, March 2013 [37] G. E. Hinton and R. Salakhutdinov, "Discovering Binary Codes for Fast Document Retrieval by Learning Deep Generative Models.", Topics in Cognitive Science, Vol 3, pp 74-91, 2011. [38] http://home.engineering.iastate.edu/~chenlu/csresidual.htm [39] http://www.sci.utah.edu/bisti.html [40] http://www.phon.ox.ac.uk/jcoleman/Dynamic_MRI.html [41] http://research.engineering.uiowa.edu/cbig/content/software
9cs.NE
arXiv:1709.07139v2 [cs.LO] 3 Oct 2017 Learning to Prove Safety over Parameterised Concurrent Systems (Full Version) Yu-Fang Chen Chih-Duo Hong Anthony W. Lin Philipp Rümmer Academia Sinica Oxford University Oxford University Uppsala University Abstract—We revisit the classic problem of proving safety over parameterised concurrent systems, i.e., an infinite family of finite-state concurrent systems that are represented by some finite (symbolic) means. An example of such an infinite family is a dining philosopher protocol with any number n of processes (n being the parameter that defines the infinite family). Regular model checking is a well-known generic framework for modelling parameterised concurrent systems, where an infinite set of configurations (resp. transitions) is represented by a regular set (resp. regular transducer). Although verifying safety properties in the regular model checking framework is undecidable in general, many sophisticated semi-algorithms have been developed in the past fifteen years that can successfully prove safety in many practical instances. In this paper, we propose a simple solution to synthesise regular inductive invariants that makes use of Angluin’s classic L∗ algorithm (and its variants). We provide a termination guarantee when the set of configurations reachable from a given set of initial configurations is regular. We have tested L∗ algorithm on standard (as well as new) examples in regular model checking including the dining philosopher protocol, the dining cryptographer protocol, and several mutual exclusion protocols (e.g. Bakery, Burns, Szymanski, and German). Our experiments show that, despite the simplicity of our solution, it can perform at least as well as existing semi-algorithms. I. I NTRODUCTION Parameterised concurrent systems are infinite families of finite-state concurrent systems, parameterised by the number n of processes. There are numerous examples of parameterised concurrent systems, including models of distributed algorithms which are typically designed to handle an arbitrary number n of processes [33], [54]. Verification of such systems, then, amounts to proving that a desired property holds for all permitted values of n. For example, proving that the safety property holds for a dining philosopher protocol entails proving that the protocol with any given number n of philosophers (n ≥ 3) can never reach a state when two neighbouring philosophers eat simultaneously. For each given value of n, verifying safety/liveness is decidable, albeit the exponential state-space explosion in the parameter n. However, when the property has to hold for each value of n, the number of system configurations a verification algorithm has to explore is potentially infinite. Indeed, even safety checking is already undecidable for parameterised concurrent systems [9], [12], [31]; see [13] for a comprehensive survey on the decidability aspect of the parameterised verification problem. Various sophisticated semi-algorithms for verifying parameterised concurrent systems are available. These semialgorithms typically rely on a symbolic framework for repre- senting infinite sets of system configurations and transitions. Regular model checking [43], [7], [14], [15], [6], [1], [22], [46], [66] is one well-known symbolic framework for modelling and verifying parameterised concurrent systems. In regular model checking, configurations are modelled using words over a finite alphabet, sets of configurations are represented as regular languages, and the transition relation is defined by a regular transducer. From the research programme of regular model checking, not only are regular languages/transducers known to be highly expressive symbolic representations for modelling parameterised concurrent systems, they are also amenable to an automata-theoretic approach (due to many nice closure properties of regular languages/transducers), which have often proven effective in verification. In this paper, we revisit the classic problem of verifying safety in the regular model checking framework. Many sophisticated semi-algorithms for dealing with this problem have been developed in the literature using methods such as abstraction [4], [5], [21], [20], widening [15], [23], acceleration [58], [43], [11], and learning [55], [56], [39], [64], [63]. One standard technique for proving safety for an infinite-state systems is by exhibiting an inductive invariant Inv (i.e. a set of configurations that is closed under an application of the transition relation) such that (i) Inv subsumes the set Init of all initial configurations, but (ii) Inv does not intersect with the set Bad of unsafe configurations. In regular model checking, the sets Init and Bad are given as regular sets. For this reason, a natural method for proving safety in regular model checking is to exhibit a regular inductive invariant satisfying (i) and (ii). The regular set Inv can be constructed as a “regular proof” for safety since checking that a candidate regular set Inv is a proof for safety is decidable. A few semi-algorithms inspired by automata learning — some based on the passive learning algorithms [39], [56], [2] and some others based on active learning algorithms [56], [63]— have been proposed to synthesise a regular inductive invariant in regular model checking. Despite these semi-algorithms, not much attention has been paid to applications of automata learning in regular model checking. In this paper, we are interested in one basic research question in regular model checking: can we effectively apply the classic Angluin’s L∗ automata learning [8] (or variants [59], [45]) to learn a regular inductive invariant? Hitherto this question, perhaps surprisingly, has no satisfactory answer in the literature. A more careful consideration reveals at least two problems. Firstly, membership queries (i.e. is a word w reachable from Init ?) may be asked by the L∗ algorithm, which amounts to checking reachability in an infinite-state system, which is undecidable in general. This problem was already noted in [55], [56], [63], [64]. Secondly, a regular inductive invariant satisfying (i) and (ii) might not be unique, and so strictly speaking we are not dealing with a well-defined learning problem. More precisely, consider the question of what the teacher should answer when the learner asks whether v is in the desired invariant, but v turns out not to be reachable from Init ? Discarding v might not be a good idea, since this could force the learning algorithm to look for a minimal (in the sense of set inclusion) inductive invariant, which might not be regular. Similarly, let us consider what the teacher should answer in the case when we found a pair (v, w) of configurations such that (1) v is in the candidate Inv , (2) w∈ / Inv , and (3) there is a transition from v to w. In the ICElearning framework [36], [35], [55], the pair (v, w) is called an implication counterexample. To satisfy the inductive invariant constraint, the teacher may respond that w should be added to Inv , or that v should be removed from Inv . Some works in the literature have proposed using a three-valued logic/automaton (with “don’t know” as an answer) because of the teacher’s incomplete information [38], [26]. a) Contribution: In this paper, we propose a simple and practical solution to the problem of applying the classic L∗ automata learning algorithm and its variants to synthesise a regular inductive invariant in regular model checking. To deal with the first problem mentioned in the previous paragraph, we propose to restrict to length-preserving regular transducers. In theory, length-preservation is not a restriction for safety analysis, since it just implies that each instance of the considered parameterised system is operating on bounded memory of size n (but the parameter n is unbounded). Experience shows that many practical examples in parameterised concurrent systems can be captured naturally in terms of length-preserving systems, e.g., see [53], [7], [6], [43], [22], [58], [1]. The benefit of the restriction is that the problem of membership queries is now decidable, since the set of configurations that may reach (be reachable from) any given configuration w is finite and can be solved by a standard finite-state model checker. For the second problem mentioned in the previous paragraph, we propose that a strict teacher be employed in L∗ learning for regular inductive invariants in regular model checking. A strict teacher attempts to teach the learner the minimal inductive invariant (be it regular or not), but is satisfied when the candidate answer posed by the learner is an inductive invariant satisfying (i) and (ii) without being minimal. [In this sense, perhaps a more appropriate term is a strict but generous teacher, who tries to let a student pass a final exam whenever possible.] For this reason, when the learner asks whether w is in the desired inductive invariant, the teacher will reply NO if w is not reachable from Init . The same goes with an implication counterexample (v, w) such that the teacher will say that an unreachable v is not in the desired inductive invariant. We have implemented the learning-based approach in a prototype tool with an interface to the libalf library, which includes the L∗ algorithm and its variants. Despite the simplicity of our solution, it (perhaps surprisingly) works extremely well in practice, as our experiments suggest. We have taken numerous standard examples from regular model checking, including cache coherence protocols (German’s Protocol), selfstabilising protocols (Israeli-Jalfon’s Protocol and Herman’s Protocol), synchronisation protocols (Lehmann-Rabin’s Dining Philosopher Protocol), secure multi-party computation protocols (Dining Cryptographers Protocol [25]), and mutual exclusion protocols (Szymanski’s Protocol, Burn’s Protocol, Dijkstra’s Protocol, Lamport’s bakery algorithm, and ResourceAllocator Protocol). We show that L∗ algorithm can perform at least as well as (and, in fact, often outperform) existing semialgorithms. We compared the performance of our algorithm with well-known and established techniques such as SATbased learning [56], [55], [52], [53], abstract regular model checking (ARMC), which is based on abstraction-refinement using predicate abstractions and finite-length abstractions [20], [21], and T(O)RMC, which is based on extrapolation (a widening technique) [16]. Our experiments show that, despite the simplicity of our solution, it can perform at least as well as existing semi-algorithms. b) Related Work: The work of Vardhan et al. [64], [63] applies L∗ learning to infinite-state systems and, amongst other, regular model checking. The learning algorithm attempts to learn an inductive invariant enriched with “distance” information, which is one way to make membership queries (i.e. reachability for general infinite-state systems) decidable. This often makes the resulting set not regular, even if the set of reachable configurations is regular, in which case our algorithm is guaranteed to terminate (recall our algorithm is only learning a regular invariant without distance information). Conversely, when an inductive invariant enriched with distance information is regular, so is the projection that omits the distance information. Unfortunately, neither their tool Lever [64], nor the models used in their experiments are available, so that we cannot make a direct comparison to our approach. A learning algorithm allowing incomplete information [38] has been applied in [56] for inferring inductive invariants of regular model checking. Although the learning algorithm in [38] uses the same data structure as the standard L∗ algorithm, it is essentially a SAT-based learning algorithm (its termination is not guaranteed by the Myhill-Nerode theorem). Despite our results that SAT-based learning seems to be less efficient than L∗ learning for synthesising regular inductive invariants in regular model checking, SAT-based learning is more general and more easily applicable when verifying other properties, e.g., liveness [53], fair termination [49], and safety games [57]. View abstraction [5] is a novel technique for parameterised verification. Comparing to parameterised verification based on view abstraction, our framework (i.e. general regular model checking framework with transducers) provides a more expressive modelling language that is required in specifying protocols with near-neighbour communication (e.g. Dining Cryptographers and Dining Philosophers). 2 When preparing the final version, we found that a very similar algorithm had already appeared in Vardhan’s thesis [62, Section 6] from 2006; in particular, including the trick to make a membership query (i.e. point-to-point reachability) decidable by bounding the space of the transducers. The research presented here was conducted independently, and considers several aspects that were not yet present in [62], including experimental results on systems that are not counter systems (parameterised concurrent systems with topologies), and heuristics like the use of shortest counterexamples and caching. We cannot compare our implementation in detail with the one from [62], since the latter tool is not publicly available. c) Organisation: The notations are defined in Section II. A brief introduction to regular model checking and automata learning is given in Section III and Section IV, respectively. The learning-based algorithm is provided in Section V. The result of the experiments is in Section VI. III. R EGULAR MODEL CHECKING Regular model checking (RMC) is a uniform framework for modelling and automatically analysing parameterised concurrent systems. In the paper, we focus on the regular model checking framework for safety properties. Under the framework, each system configuration is represented as a word in Σ∗ . The sets of initial configurations and of bad configurations are captured by regular languages over Σ. The transition relation is captured by a regular and length-preserving relation on Σ∗ . We use a triple (I, T , B) to denote a regular model checking problem, where I is an FA recognizing the set of initial configurations, T is a transducer representing the transition relation, and B is an FA recognizing the set of bad configurations. Then the regular model checking problem (I, T , B) asks if T ∗ (I) ∩ B = ∅. A standard way to prove T ∗ (I) ∩ B = ∅ is to find a proof based on a set V satisfying the following three conditions: (1)I ⊆ V (i.e. all initial configurations are contained in V ), (2) V ∩ B = ∅ (i.e. V does not contain bad configurations), (3) T (V ) ⊆ V (i.e. V is inductive: applying T to any configuration in V does not take it outside V ). We call the set V an inductive invariant for the regular model checking problem (I, T , B). In the framework of regular model checking, a standard method for proving safety (e.g. see [56], [7]) is to find a regular proof, i.e., an inductive invariant that can be captured by finite automaton. Because regular languages are effectively closed under Boolean operations and taking pre-/post-images w.r.t. finite transducers, an algorithm for verifying whether a given regular language is an inductive invariant can be obtained by using language inclusion algorithms for FA [3], [19]. II. P RELIMINARIES a) General Notations: Let Σ be a finite set of symbols called alphabet. A word over Σ is a finite sequence of symbols of Σ. We use λ to represent an empty word. For a set I ⊆ Σ∗ and a relation T ⊆ Σ∗ × Σ∗ , we define T (I) to be the postimage of I under T , i.e., T (I) = {y | ∃x. x ∈ I ∧(x, y) ∈ T }. Let id = {(x, x) | x ∈ Σ∗ } be the identity relation. We define T n for all n ∈ N in the standard way by induction: T 0 = id, and T k = T ◦T k−1 , where ◦ denotes the composition of relations. T ∗ denote the transitive closure of T , i.e., S∞ Let ∗ i T = i=1 T . For any two sets A and B, we use A ⊖ B to denote their symmetric difference, i.e., the set A \ B ∪ B \ A. b) Finite Automata and Transducer: In this paper, automata/transducers are denoted in calligraphic fonts A, B, I, T to represent automata/transducers, while the corresponding languages/relations are denoted in roman fonts A, B, I, T . A finite automaton (FA) is a tuple A = (Q, Σ, δ, q0 , F ) where Q is a finite set of states, Σ is an alphabet, δ ⊆ Q × Σ × Q is a transition relation, q0 ∈ Q is the initial state, and F ⊆ Q is the set of final states. A run of A on a word w = a1 a2 a3 · · · an is a sequence of states q0 , q1 , · · · , qn such that (qi , ai+1 , qi+1 ) ∈ δ. A run is accepting if the last state qn ∈ F . A word is accepted by A if it has an accepting run. The language of A, denoted by A, is the set of word accepted by A. A language is regular if it can be recognised by a finite automaton. A is a deterministic finite automaton (DFA) if |{q ′ | (q, a, q ′ ) ∈ δ}| ≤ 1 for each q ∈ Q and a ∈ Σ. Let Σλ = Σ ∪ {λ}. A (finite) transducer is a tuple T = (Q, Σλ , δ, q0 , F ) where Q is a finite set of states, δ ⊆ Q × Σλ × Σλ × Q is a transition relation, q0 ∈ Q is the initial state, and F ⊆ Q is the set of final states. We say that T is length-preserving if δ ⊆ Q × Σ × Σ × Q. We define relation δ ∗ ⊆ Q × Σ∗ × Σ∗ × Q as the smallest relation satisfying (1) (q, λ, λ, q) ∈ δ ∗ for any q ∈ Q and (2) (q1 , x, y, q2 ) ∈ δ ∗ ∧ (q2 , a, b, q3 ) ∈ δ =⇒ (q1 , xa, yb, q3 ) ∈ δ ∗ . The relation represented by T is the set {(x, y) | (q0 , x, y, q) ∈ δ ∗ ∧ q ∈ F }. A relation is regular and length-preserving if it can be represented by a length-preserving transducer. Example 1 (Herman’s Protocol). Herman’s Protocol is a selfstabilising protocol for n processes (say with ids 0, . . . , n − 1) organised as a ring structure. A configuration in the Herman’s Protocol is correct iff only one process has a token. The protocol ensures that any system configuration where the processes collectively holding any odd number of tokens will almost surely be recovered to a correct configuration. More concretely, the protocol works iteratively. In each iteration, the scheduler randomly chooses a process. If the process with the number i is chosen by the scheduler, it will toss a coin to decide whether to keep the token or pass the token to the next process, i.e. the one with the number (i + 1)%n. If a process holds two tokens in the same iteration, it will discard both tokens. One safety property the protocol guarantees is that every system configuration has at least one token. The protocol and the corresponding safety property can be modelled as a regular model checking problem (I, T , B). Each process has two states; the symbol T denotes the state that the process has a token and N denotes the state that the process does not have a token. The word NNTTNN denotes a system configuration with six processes, where only the processes with numbers 2 and 3 are in the state with tokens. The set of initial configurations is I = N∗ T(N∗ TN∗ TN∗ )∗ , i.e., an odd number of processes has tokens. The set of bad configuration is B = N∗ , i.e., all tokens have disappeared. We use the regular 3 Algorithm 1: The improved L∗ algorithm by Rivest and Schapire Input: A teacher answers Mem(w) and Equ(A) about a target regular language R and the initial observation table (S, E, T ). 1 repeat 2 while (S, E, T ) is not closed do 3 Find a pair (x, a) ∈ S × Σ such that ∀y ∈ S : row E (xa) 6= row E (y). Extend S to S ∪ {xa} and update T using membership queries accordingly; 4 Build a candidate DFA Ah = (S, Σ, δ, λ, F ), where δ = {(s, a, s′ ) | s, s′ ∈ S ∧ row E (sa) = row E (s)}, the empty string λ is the initial state, and F = {s | T (s) = ⊤ ∧ s ∈ S}; 5 if Equ(Ah ) = (false, w), where w ∈ A ⊖ R then Analyse w and add a suffix of w to E; 6 until Equ(Ah ) = true; 7 return Ah is the minimal DFA for R; language E = ((T, T) + (N, N)) to denote the relation that a process is idle. The transition relation T can be specified as a union of the following regular expressions: (1) E ∗ [Idle], (2) E ∗ (T, N)(T, N)E ∗ + (T, N)E ∗ (T, N) [Discard both tokens], and (3) E ∗ (T, N)(N, T)E ∗ + (N, T)E ∗ (T, N) [Pass the token]. IV. AUTOMATA L EARNING Suppose R is a regular target language whose definition is not directly accessible. Automata learning algorithms [8], [59], [45], [17] automatically infer a FA A recognising R. The setting of an online learning algorithm assumes a teacher who has access to R and can answer the following two queries: (1) Membership query Mem(w): is the word w a member of R, i.e., w ∈ R? (2) Equivalence query Equ(A): is the language of FA A equal to R, i.e., A = R? If not, it returns a counterexample w ∈ A ⊖ R. The learning algorithm will then construct a FA A such that A = R by interacting with the teacher. Such an algorithm works iteratively: In each iteration, it performs membership queries to get from the teacher information about R. Using the results of the queries, it proceeds by constructing a candidate automaton Ah and makes an equivalence query Equ(Ah ). If Ah = R, the algorithm terminates with Ah as the resulting FA. Otherwise, the teacher returns a word w distinguishing Ah from R. The learning algorithm uses w to refine the candidate automaton of the next iteration. In the last decade, automata learning algorithms have been frequently applied to solve formal verification and synthesis problems, c.f., [27], [24], [39], [38], [26], [32]. More concretely, below we explain the details of the automata learning algorithm proposed by Rivest and Schapire [59] (RS), which is an improved version of the classic L∗ learning algorithm by Angluin [8]. The foundation of the learning algorithm is the Myhill-Nerode theorem, from which one can infer that the states of the minimal DFA recognizing R are isomorphic to the set of equivalence classes defined by the following relations: x ≡R y iff ∀z ∈ Σ∗ : xz ∈ R ↔ yz ∈ R. Informally, two strings x and y belong to the same state of the minimal DFA recognising R iff they cannot be distinguished by any suffix z. In other words, if one can find a suffix z ′ such that xz ′ ∈ R and yz ′ ∈ / R or vice versa, then x and y belong to different states of the minimal DFA. The algorithm uses a data structure called observation table (S, E, T ) to find the equivalence classes correspond to ≡R , where S is a set of strings denoting the set of identified states, E is the set of suffixes to distinguish if two strings belong to the same state of the minimal DFA, and T is a mapping from (S ∪ (S · Σ)) · E to {⊤, ⊥}. The value of T (w) = ⊤ iff w ∈ R. We use row E (x) = row E (y) as a shorthand for ∀z ∈ E : T (xz) = T (yz). That is, the strings x and y cannot be identified as two different states using only strings in the set E as the suffixes. Observe that x ≡R y implies row E (x) = row E (y) for all E ⊆ Σ∗ . We say that an observation table is closed iff ∀x ∈ S, a ∈ Σ : ∃y ∈ S : row E (xa) = row E (y). Informally, with a closed table, every state can find its successors wrt. all symbols in Σ. Initially, S = E = {λ}, and T (w) = Mem(w) for all w ∈ {λ} ∪ Σ. The details of of the improved L∗ algorithm by Rivest and Schapire can be found in Algorithm 1. Observe that, in the algorithm, two strings x, y with x ≡R y will never be simultaneously contained in the set S. When the equivalence query Equ(A) returns false together with a counterexample w ∈ A ⊖ R, the algorithm will perform a binary search over w using membership queries to find a suffix e of w and extend E to E ∪{e}. The suffix e has the property that ∃x, y ∈ S, a ∈ Σ : row E (xa) = row E (y) ∧ row E∪{e} (xa) 6= row E∪{e} (y), that is, add e to E will identify at least one more state. The existence of such a suffix is guaranteed. We refer the readers to [59] for the proof. Proposition 1. [59] Algorithm 1 will find the minimal DFA R for R using at most n equivalence queries and n(n + n|Σ|) + n log m membership queries, where n is the number of state of R and m is the length of the longest counterexample returned from the teacher. Because each equivalence query with a false answer will increase the size (number of states) of the candidate DFA by at least one and the size of the candidate DFA is bounded by n according to the Myhill-Nerode theorem, the learning algorithm uses at most n equivalence queries. The number of membership queries required to fill in the entire observation table is bounded by n(n + n|Σ|). Since a binary search is used to analyse the counterexample and the number of counterexample from the teacher is bounded by n, the number of membership queries required is bounded by n log m. We would like to introduce the other two important variants of the L∗ learning algorithm. The algorithm proposed by Kearns and Vazirani [45] (KV) uses a classification tree data structure to replace the observation table data structure of the classic L∗ algorithm. The algorithm of Kearns and Vazirani has a similar query complexity to the one of Rivest and 4 Mem(w) Learner w ∈ T ∗ (I)? yes or no Equ(Ah ) false, w exist. Pathological cases where only non-regular inductive invariant exist do not, however, seem to occur frequently in practice, c.f., [21], [39], [20], [22], [61], [58], [51]. Answering a membership query on a word w, i.e., checking whether w ∈ T ∗ (I), is the easy part: since T is lengthpreserving, we can construct an FA recognising Post |w| = {w′ | |w′ | = |w| ∧ w′ ∈ T ∗ (I)} and then check if w ∈ Post |w| . In practice, Post |w| can be efficiently computed and represented using BDDs and symbolic model checking. For an equivalence query on a candidate FA Ah , we need to check if Ah can be used as an inductive invariant for the regular model checking problem (I, T , B). More concretely, we check the three conditions (1) I ⊆ Ah , (2) Ah ∩ B = ∅, and (3) T (Ah ) ⊆ Ah using Algorithm 2. Teacher (1)I ⊆ Ah ? (2)Ah ∩ B = ∅? (3)T (Ah ) ⊆ Ah ? (I, T , B) = true and an inductive invariant A or (I, T , B) = false and a word w ∈ T ∗ (I) ∩ B Fig. 1. Overview: using automata learning to solve the regular model checking problem (I, T , B). Recall that we use calligraphy font for automata/transducers and roman font for the corresponding languages/relations. Schapire [59]; it uses at most n equivalence queries and n2 (n|Σ| + m) membership queries. However, the worst case bound of the number of membership queries is very loose. It assumes the structure of the classification tree is linear, i.e., each node has at most one child, which happens very rarely in practice. In our experience, the algorithm of Kearns and Vazirani usually requires a few more equivalence queries, with a significant lower number of membership queries comparing to Rivest and Schapire when applied to verification problems. The NL∗ algorithm [17] learns a non-deterministic finite automaton instead of a deterministic one. More concretely, it makes use of a canonical form of nondeterministic finite automaton, named residual finite-state automaton (RFSA) to express the target regular language. In some examples, RFSA can be exponentially more succinct than DFA recognising the same languages. In the worst case, the NL∗ algorithm uses O(n2 ) equivalence queries and O(m|Σ|n3 ) membership queries to infer a canonical RFSA of the target language. Algorithm 2: Answer equivalence query on candidate FA Input: An FA Ah and an RMC problem (I, T , B) 1 if I 6⊆ Ah then 2 Find a word w ∈ I \ Ah ; 3 return (false, w) to the learner; 4 else if Ah ∩ B 6= ∅ then 5 Find a word w ∈ Ah ∩ B; 6 if w ∈ T ∗ (I) then Output {cex = w, (I, T , B) = false} and halt; 7 else return (false, w) to the learner; 8 else if T (Ah ) 6⊆ Ah then 9 Find a pair of words (w, w′ ) ∈ T such that w ∈ Ah but w′ ∈ / Ah ; 10 if w ∈ T ∗ (I) then return (false, w′ ) to the learner; 11 else return (false, w) to the learner; 12 else Output {inv = Ah , (I, T , B) = true} and halt; V. A LGORITHM We apply automata learning algorithms, including Angluin’s L∗ and its variants, to solve the regular model checking problem (I, T , B). Those learning algorithms require a teacher answering both equivalence and membership queries. Our strategy is to design a “strict teacher” targeting the minimal inductive invariant T ∗ (I). For a membership query on a word w, the teacher checks if w ∈ T ∗ (I), which is decidable under the assumption that T is length-preserving. For an equivalence query on a candidate FA Ah , the teacher analyses if Ah can be used as an inductive invariant in a proof of the problem (I, T , B). It performs one of the following actions depending on the result of the analysis (Fig. 1): • Determine that Ah does not represent an inductive invariant, and return false together with an explanation w ∈ Σ∗ to the learner. • Conclude that (I, T , B) = true, and terminate the learning process with an inductive invariant Ah as the proof. • Conclude that (I, T , B) = false, and terminate the learning with a word w ∈ T ∗ (I) ∩ B as an evidence. Similar to the typical regular model checking approach, our learning-based technique tries to find a “regular proof”, which amounts to finding an inductive invariant in the form of a regular language. Our approach is incomplete in general since it could happen that there only non-regular inductive invariants If the condition (1) is violated, i.e., I 6⊆ Ah , there is a word w ∈ I \ Ah . Since I ⊆ T ∗ (I), the teacher can infer that w ∈ T ∗ (I) \ Ah and return w as a positive counterexample to the learner. A counterexample is positive if it represents a word in the target language that was missing in the candidate language. The definition negative counterexamples is symmetric. If the condition (2) is violated, i.e., Ah ∩ B 6= ∅, there is a word w ∈ Ah ∩ B. The teacher checks if w ∈ T ∗ (I) by constructing Post |w| and checking if w ∈ Post |w| . If w 6∈ T ∗ (I), the teacher obtains that w ∈ Ah \ T ∗ (I) and returns false together with w as a negative counterexample to the learner. Otherwise, the teacher infers that w ∈ T ∗ (I) ∩ B and outputs (I, T , B) = false with the word w as an evidence. The case that the condition (3) is violated, i.e., T (Ah ) 6⊆ Ah , is more involved. There exists a pair of words (w, w′ ) ∈ T such that w ∈ Ah ∧ w′ ∈ / Ah . The teacher will check if w ∈ T ∗ (I). If it is, then the teacher knows that w′ ∈ T ∗ (I) ∧ w′ ∈ / Ah and hence returns false together with w′ as a positive counterexample to the learner. If w ∈ / T ∗ (I), then the teacher ∗ knows that w ∈ / T (I) ∧ w ∈ Ah and hence returns false together with w as a negative counterexample to the learner. If all conditions hold, the “strict teacher” shows its generosity (Ah might not equal to T ∗ (I), but it will still pass) and 5 concludes that (I, T , B) = true with a proof using Ah as the inductive invariant. VI. E VALUATION To evaluate our techniques, we have developed a prototype2 in Java and used the libalf library [18] as the default inference engine. We used our prototype to check safety properties for a range of parameterised systems, including cache coherence protocols (German’s Protocol), self-stabilising protocols (Israeli-Jalfon’s Protocol and Herman’s Protocol), synchronisation protocols (Lehmann-Rabin’s Dining Philosopher Protocol), secure multi-party computation protocol (David Chaums’ Dining Cryptographers Protocol), and mutual exclusion protocols (Szymanski’s Protocol, Burn’s Protocol, Dijkstra’s Protocol, Lamport’s Bakery Algorithm, and Resource-Allocator Protocol). Most of the examples we consider are standard benchmarks in the literature of regular model checking (c.f. [4], [5], [20], [22], [58]). Among them, German’s Protocol and Kanban are more difficult than the other examples for fully automatic verification (c.f. [4], [5], [44]). Based on these examples, we compare our learning method with existing techniques such as SAT-based learning [55], [56], [52], [53], extrapolating [16], [47], and abstract regular model checking (ARMC) [20], [21]. The SAT-based learning approach encodes automata as Boolean formulae and exploits a SAT-solver to search for candidate automata representing inductive invariants. It uses automata-based algorithms to either verify the correctness of the candidate or obtain a counterexample that can be further encoded as a Boolean constraint. T(O)RMC [16], [47] extrapolates the limit of the reachable configurations represented by an infinite sequence of automata. The extrapolation is computed by first identifying the increment between successive automata, and then overapproximating the repetition of the increment by adding loops to the automata. ARMC is an efficient technique that integrates abstraction refinement into the fixed-point computation. It begins with an existential abstraction obtained by merging states in the automata/transducers. Each time a spurious counterexample is found, the abstraction can be refined by splitting some of the merged states. ARMC is among the most efficient algorithms for regular model checking [39]. The comparison of those algorithms are reported in Table I, running on a MinGW64 system with 3GHz Intel i7 processor, 2GB memory limit, and 60-second timeout. The experiments show that the learning method is quite efficient: the results of our prototype are comparable with those of the ARMC algorithm3 on all examples but Kanban, for which the minimal inductive invariant, if it is regular, has at least 400 states. On the other hand, our algorithm is significantly faster than ARMC in two cases, namely German’s Protocol and Dining Cryptographers. ARMC comes with a bundle of options and heuristics, but not all of them work for our benchmarks. We have tested all the heuristics available from the tool and adopted the ones4 that had the best performance in our experi- Theorem 1 (Correctness). If the algorithm from Fig. 1 terminates, it gives correct answer to the RMC problem (I, T , B). To see this, observe that the algorithm provides an inductive invariant when it concludes (I, T , B) = true and a word in T ∗ (I) ∩ B when it concludes (I, T , B) = false. In addition, if one of the L∗ learning algorithms1 from Section IV is used, we can obtain an additional result about termination: Theorem 2 (Termination). When T ∗ (I) is regular, the algorithm from Fig. 1 is guaranteed to terminate in at most k iterations, where k is the size of the minimal DFA of T ∗ (I). Proof. Observe that in the algorithm, the counterexample obtained by the learner in each iteration locates in the symmetric difference of the candidate language and T ∗ (I). Hence, when T ∗ (I) can be recognized by a DFA of k states, the algorithm will not execute more than k iterations by Proposition 1. Two remarks are in order. Firstly, the set T ∗ (I) tends to be regular in practice, e.g., see [21], [39], [20], [22], [61], [58], [10], [11], [51], [50]. In fact, it is known that T ∗ (I) is regular for many subclasses of infinite-state systems that can be modelled in regular model checking [61], [51], [41], [11], [50] including pushdown systems, reversal-bounded counter systems, two-dimensional VASS (Vector Addition Systems with States), and other subclasses of counter systems. Secondly, even in the case when T ∗ (I) is not regular, termination may still happen due to the “generosity” of the teacher, which will accept any inductive invariant as an answer. Considerations on Implementation: The implementation of the learning-based algorithm is very simple. Since it is based on standard automata learning algorithms and uses only basic automata/transducer operations, one can find existing libraries for them. The implementation only need to take care of how to answer queries. The core of our implementation has only around 150 lines of code (excluding the parser of the input models). We provide a few suggestions to make the implementation more efficient. First, each time when an FA recognising Post k is produced, we store the pair (k, Post k ) in a cache. It can be reused when a query on any word of length k is posed. We can also check if Post k ∩B = ∅. The algorithm can immediately terminate and return (I, T , B) = false if Post k ∩ B 6= ∅. Second, for each language inclusion test, if the inclusion does not hold, we suggest to return the shortest counterexample. This heuristic helped to shorten the average length of strings sent for membership queries and hence reduced the cost of answering them. Recall that the algorithm needs to build the FA of Post k to answer membership queries. The shorter the average length of query strings is, the fewer instances of Post k have to be built. 2 Available at https://github.com/ericpony/safety-prover . at http://www.fit.vutbr.cz/research/groups/verifit/tools/hades. 4 The heuristics are structure preserving, backward computation, and backward collapsing with all states being predicates. See [21] for explanations. 3 Available 1 If N L∗ is used, the bound in Theorem 2 will increase to O(k 2 ). 6 Name Bakery [33] Burns [4] Szymanski [60] German [37] Dijkstra [4] Dijkstra, ring [29], [34] Dining Crypto. [25] Coffee Can [53] Herman, linear [40] Herman, ring [40] Israeli-Jalfon [42] Lehmann-Rabin [48] LR Dining Philo. [53] Mux Array [34] Res. Allocator [30] Kanban [5], [44] Water Jugs [65] The RMC problems #label Sinit Tinit Strans 3 3 3 5 12 3 3 10 11 9 9 118 581 3 3 17 42 1 1 13 12 3 3 13 14 10 30 17 6 8 18 13 2 2 4 4 2 2 4 9 2 3 6 24 6 4 4 14 4 4 4 3 6 3 3 4 3 3 3 7 3 25 48 98 11 5 6 23 Ttrans 19 125 412 9.5k 827 199 70 34 10 22 62 96 10 31 25 250 132 Sbad 3 3 13 4 3 3 12 5 1 1 1 3 3 3 4 37 5 Tbad 9 36 40 2112 126 36 70 8 1 1 1 13 4 18 9 68 12 Time 0.0s 0.2s 0.3s 4.8s 0.1s 1.4s 0.1s 0.0s 0.0s 0.0s 0.0s 0.1s 0.0s 0.0s 0.0s t.o. 0.1s RS Sinv 6 8 43 14 9 22 32 3 2 2 4 8 4 5 5 – 24 Tinv 18 96 473 8134 378 264 448 18 4 4 8 48 16 30 15 – 264 Time 0.5s 1.1s 1.6s t.o. 1.7s 0.9s t.o. 0.2s 0.2s 0.4s 0.1s 0.5s 0.2s 0.4s 0.0s t.o. t.o. SAT Sinv 2 2 2 – 2 2 – 2 2 2 2 2 2 2 1 – – Tinv 5 10 21 – 24 14 – 7 4 4 4 11 6 7 3 – – T(O)RMC Time Sinv 0.0s 6 0.1s 7 2.0s 51 t.o. – 6.1s 8 t.o. – t.o. – 0.1s 6 0.0s 2 0.0s 2 0.0s 4 0.8s 19 0.1s 7 0.2s 4 0.0s 4 t.o. – t.o. – Tinv 11 38 102 – 83 – – 13 4 4 8 105 18 14 9 – – ARMC Time 0.0s 0.0s 0.1s 10s 0.3s 0.1s 7.2s 0.0s 0.0s 0.0s 0.0s 0.0s 0.0s 0.0s 0.0s 3.5s 0.0s TABLE I C OMPARING THE PERFORMANCE OF DIFFERENT RMC TECHNIQUES . # LABEL STANDS FOR THE SIZE OF ALPHABET; S X AND T X STAND FOR THE NUMBERS OF STATES AND TRANSITIONS , RESPECTIVELY, IN THE AUTOMATA / TRANSDUCERS . RS IS THE RESULT OF OUR PROTOTYPE USING R IVEST AND S CHAPIRE ’ S VERSION OF L∗ ; SAT, T(O)RMC, AND ARMC ARE THE RESULTS OF THE OTHER THREE TECHNIQUES . the set T ∗ (I) is regular, which is not guaranteed by approaches based on a fixed-point computation (e.g., the ARMC [21]). An interesting research question is whether L∗ algorithm can be effectively used for verifying other properties, e.g., liveness. Acknowledgements: This article is a full version of [28]. We thank anonymous referees for their useful comments. Rümmer was supported by the Swedish Research Council under grant 2014-5484. ments. The performance of SAT-based learning is comparable to the previous two approaches whenever inductive invariants representable by automata with few states exist. However, as its runtime grows exponentially with the sizes of candidate automata, the SAT-based algorithm fails to solve four examples that do not have small regular inductive invariants. T(O)RMC seems to suffer from similar problems as it timeouts on all examples that cannot be proved by the SAT-based approach. Table II reports the results of the learning-based algorithm geared with different automata learning algorithms implemented in libalf. As the table shows, these algorithms have similar performance on small examples; however, the algorithm of Rivest and Schapire [59] and the algorithm of Kearns and Varzirani [45] are significantly more efficient than the other algorithms on some large examples such as Szymanski and German. Table II shows that Kearns and Varzirani’s algorithm can often find smaller inductive invariants (fewer states) than the other L∗ variants, which explains the performance difference. For NL∗ , our implementation pays an additional cost to determinise the learned FA in order to answer the equivalence queries; this cost is significant when a large invariant is needed. Recall that our approach uses a “strict but generous teacher”. Namely, the target language of the teacher is T ∗ (I) for an RMC problem (I, T , B). We have tried the version where a “flexible and generous teacher” is used, that is, the target language of the teacher is the complement of (T −1 )∗ (B). The performance, however, is worse than that of our current version. This result may reflect the fact that the set T ∗ (I) is “more regular” (i.e., can be expressed by a DFA with fewer states) than the set (T −1 )∗ (B) in practical cases. R EFERENCES [1] P. A. Abdulla. Regular model checking. STTT, 14(2):109–118, 2012. [2] P. A. Abdulla, M. F. Atig, Y. Chen, L. Holík, A. Rezine, P. Rümmer, and J. Stenman. String constraints for verification. In CAV’14, pages 150–166. [3] P. A. Abdulla, Y. Chen, L. Holík, R. Mayr, and T. Vojnar. When simulation meets antichains. In TACAS’10, pages 158–174. [4] P. A. Abdulla, G. Delzanno, N. B. Henda, and A. Rezine. Regular model checking without transducers (on efficient verification of parameterized systems). In TACAS’07, pages 721–736. [5] P. A. Abdulla, F. Haziza, and L. Holík. All for the price of few. In VMCAI’13, pages 476–495. [6] P. A. Abdulla, B. Jonsson, M. Nilsson, J. d’Orso, and M. Saksena. Regular model checking for LTL(MSO). STTT, 14(2):223–241, 2012. [7] P. A. Abdulla, B. Jonsson, M. Nilsson, and M. Saksena. A survey of regular model checking. In CONCUR’04, pages 35–48. [8] D. Angluin. Learning regular sets from queries and counterexamples. Inf. Comput., 75(2):87–106, 1987. [9] K. R. Apt and D. Kozen. Limits for automatic verification of finite-state concurrent systems. IPL, 22(6):307–309, 1986. [10] S. Bardin, A. Finkel, J. Leroux, and L. Petrucci. FAST: acceleration from theory to practice. STTT, 10(5):401–424, 2008. [11] S. Bardin, A. Finkel, J. Leroux, and P. Schnoebelen. Flat acceleration in symbolic model checking. In ATVA’05, pages 474–488. [12] N. Bertrand and P. Fournier. Parameterized verification of many identical probabilistic timed processes. In FSTTCS’13, volume 24 of LIPIcs, pages 501–513. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik. [13] R. Bloem, S. Jacobs, A. Khalimov, I. Konnov, S. Rubin, H. Veith, and J. Widder. Decidability of Parameterized Verification. Synthesis Lectures on Distributed Computing Theory. Morgan & Claypool Publishers, 2015. [14] B. Boigelot. Symbolic Methods for Exploring Infinite State Spaces. PhD thesis, Université de Liège, 1999. [15] B. Boigelot, A. Legay, and P. Wolper. Iterating transducers in the large (extended abstract). In CAV’03, pages 223–235. [16] B. Boigelot, A. Legay, and P. Wolper. Omega-regular model checking. In TACAS’04, pages 561–575. [17] B. Bollig, P. Habermehl, C. Kern, and M. Leucker. Angluin-style learning of NFA. In IJCAI’09, pages 1004–1009. VII. C ONCLUSION The encouraging experimental results suggest that the performance of the L∗ algorithm for synthesising regular inductive invariants is comparable to the most sophisticated algorithm for regular model checking for proving safety. From a theoretical viewpoint, learning-based approaches (including ours and [55], [56], [39]) have a termination guarantee when 7 Bakery Burns Szymanski German Dijkstra Dijkstra, ring Dining Crypto. Coffee Can Herman, linear Herman, ring Israeli-Jalfon Lehmann-Rabin LR D. Philo. Mux Array Res. Allocator Kanban Water Jugs Time 0.0s 0.2s 0.3s 4.8s 0.1s 1.4s 0.1s 0.0s 0.0s 0.0s 0.0s 0.1s 0.0s 0.0s 0.0s >60s 0.1s RS Sinv 6 8 43 14 9 22 32 3 2 2 4 8 4 5 5 – 24 Tinv 18 96 473 8134 378 264 448 18 4 4 8 48 16 30 15 – 264 Time 0.0s 0.5s 2.4s 13s 0.4s 2.7s 0.2s 0.0s 0.0s 0.0s 0.0s 0.2s 0.2s 0.0s 0.0s >60s 0.5s L∗ Sinv 6 8 51 15 9 20 34 3 2 2 4 8 4 5 4 – 25 Tinv 18 96 561 8715 378 240 476 18 4 4 8 48 16 30 12 – 275 Time 0.1s 0.2s 1.2s 26s 0.1s 8.9s 0.2s 0.0s 0.0s 0.0s 0.0s 0.1s 0.0s 0.0s 0.0s >60s 0.5s L∗ c Sinv 6 8 41 15 9 22 38 4 2 2 4 8 5 5 5 – 25 Tinv 18 96 451 8715 378 264 532 24 4 4 8 48 20 30 15 – 275 Time 0.0s 0.2s 0.3s 4.2s 0.2s 1.5s 0.1s 0.0s 0.0s 0.0s 0.0s 0.1s 0.0s 0.0s 0.0s >60s 0.1s KV Sinv 6 8 41 14 9 14 19 3 2 2 4 8 4 5 5 – 24 Tinv 18 96 451 8134 378 168 266 18 4 4 8 48 16 30 15 – 264 Time 0.1s 0.4s 1.4s 40s 0.2s 1.8s 0.3s 0.0s 0.0s 0.0s 0.0s 0.2s 0.0s 0.0s 0.0s >60s 0.5s NL∗ Sinv 6 6 59 15 10 20 36 4 2 2 4 8 8 5 5 – 25 Tinv 18 72 649 8715 420 240 504 24 4 4 8 48 32 30 15 – 275 TABLE II C OMPARING THE PERFORMANCE BASED ON DIFFERENT AUTOMATA LEARNING ALGORITHMS . T HE COLUMNS L∗ , L∗ c, RS, KV, AND NL∗ ARE THE ∗ RESULTS OF THE ORIGINAL L ALGORITHM BY A NGLUIN [8], A VARIANT OF L∗ THAT ADDS ALL SUFFIXES OF THE COUNTEREXAMPLE TO COLUMNS , THE VERSION BY R IVEST AND S HAPIRE [59], THE VERSION BY K EARNS AND VAZIRANI [45], AND THE NL∗ ALGORITHM [17], RESPECTIVELY. [18] B. Bollig, J.-P. Katoen, C. Kern, M. Leucker, D. Neider, and D. R. Piegdon. libalf: The automata learning framework. In CAV’10, pages 360–364. [19] F. Bonchi and D. Pous. Checking NFA equivalence with bisimulations up to congruence. In POPL’13, pages 457–468. [20] A. Bouajjani, P. Habermehl, A. Rogalewicz, and T. Vojnar. Abstract regular tree model checking. ENTCS, 149(1):37–48, 2006. [21] A. Bouajjani, P. Habermehl, and T. Vojnar. Abstract regular model checking. In CAV’04, pages 372–386. [22] A. Bouajjani, B. Jonsson, M. Nilsson, and T. Touili. Regular model checking. In CAV’00, pages 403–418. [23] A. Bouajjani and T. Touili. Widening techniques for regular tree model checking. STTT, 14(2):145–165, 2012. [24] M. Chapman, H. Chockler, P. Kesseli, D. Kroening, O. Strichman, and M. Tautschnig. Learning the language of error. In ATVA’15, pages 114–130. [25] D. Chaum. The dining cryptographers problem: Unconditional sender and recipient untraceability. Journal of Cryptology, 1(1):65–75, 1988. [26] Y. Chen, A. Farzan, E. M. Clarke, Y. Tsay, and B. Wang. Learning minimal separating DFA’s for compositional verification. In TACAS’09, pages 31–45. [27] Y. Chen, C. Hsieh, O. Lengál, T. Lii, M. Tsai, B. Wang, and F. Wang. PAC learning-based verification and model synthesis. In ICSE’16, pages 714–724. [28] Y.-F. Chen, C.-D. Hong, A. W. Lin, and P. Rümmer. Learning to prove safety over parameterised concurrent systems. In FMCAD’17. [29] E. W. Dijkstra, R. Bird, M. Rogers, and O.-J. Dahl. Invariance and nondeterminacy [and discussion]. Philosophical Transactions of the Royal Society of London A: Mathematical, Physical and Engineering Sciences, 312(1522):491–499, 1984. [30] A. F. Donaldson. Automatic techniques for detecting and exploiting symmetry in model checking. PhD thesis, University of Glasgow, 2007. [31] J. Esparza. Parameterized verification of crowds of anonymous processes. Dependable Software Systems Engineering, 45:59–71, 2016. [32] A. Farzan, Y. Chen, E. M. Clarke, Y. Tsay, and B. Wang. Extending automated compositional verification to the full class of omega-regular languages. In TACAS’08, pages 2–17. [33] W. Fokkink. Distributed Algorithms. MIT Press, 2013. [34] L. Fribourg and H. Olsén. Reachability sets of parameterized rings as regular languages. ENTCS, 9:40, 1997. [35] P. Garg, C. Löding, P. Madhusudan, and D. Neider. ICE: A robust framework for learning invariants. In CAV’14, pages 69–87. [36] P. Garg, C. Löding, P. Madhusudan, and D. Neider. Learning universally quantified invariants of linear data structures. In CAV’13, pages 813– 829. [37] S. M. German and A. P. Sistla. Reasoning about systems with many processes. JACM, 39(3):675–735, 1992. [38] O. Grinchtein, M. Leucker, and N. Piterman. Inferring network invariants automatically. In IJCAR’06, pages 483–497. [39] P. Habermehl and T. Vojnar. Regular model checking using inference of regular languages. ENTCS, 138(3):21–36, 2005. [40] T. Herman. Probabilistic self-stabilization. IPL, 35(2):63–67, 1990. [41] O. H. Ibarra. Reversal-bounded multicounter machines and their decision problems. J. ACM, 25(1):116–133, 1978. [42] A. Israeli and M. Jalfon. Token management schemes and random walks yield self-stabilizing mutual exclusion. In PODC’90, pages 119–131. [43] B. Jonsson and M. Nilsson. Transitive closures of regular relations for verifying infinite-state systems. In TACAS’00, pages 220–234. [44] A. Kaiser, D. Kroening, and T. Wahl. Dynamic cutoff detection in parameterized concurrent programs. In CAV’10, pages 645–659. [45] M. J. Kearns and U. V. Vazirani. An Introduction to Computational Learning Theory. MIT press, 1994. [46] Y. Kesten, O. Maler, M. Marcus, A. Pnueli, and E. Shahar. Symbolic model checking with rich assertional languages. TCS, 256(1-2):93–112, 2001. [47] A. Legay. T(O)RMC: A tool for (ω)-regular model checking. In CAV’08, pages 548–551. [48] D. Lehmann and M. O. Rabin. On the advantages of free choice: a symmetric and fully distributed solution to the dining philosophers problem. In POPL’81, pages 133–138. [49] O. Lengál, A. W. Lin, R. Majumdar, and P. Rümmer. Fair termination for parameterized probabilistic concurrent systems. In TACAS’17. [50] J. Leroux and G. Sutre. Flat counter automata almost everywhere! In ATVA’05, pages 489–503. [51] A. W. Lin. Accelerating tree-automatic relations. In FSTTCS’12, pages 313–324. [52] A. W. Lin, T. K. Nguyen, P. Rümmer, and J. Sun. Regular symmetry patterns. In VMCAI’16, pages 455–475. [53] A. W. Lin and P. Rümmer. Liveness of randomised parameterised systems under arbitrary schedulers. In CAV’16, pages 112–133. [54] N. A. Lynch, I. Saias, and R. Segala. Proving time bounds for randomized distributed algorithms. In PODC’94, pages 314–323. [55] D. Neider. Applications of Automata Learning in Verification and Synthesis. PhD thesis, RWTH Aachen, 2014. [56] D. Neider and N. Jansen. Regular model checking using solver technologies and automata learning. In NFM, pages 16–31, 2013. [57] D. Neider and U. Topcu. An automaton learning approach to solving safety games over infinite graphs. In TACAS’16, pages 204–221. [58] M. Nilsson. Regular Model Checking. PhD thesis, Uppsala Univ., 2005. [59] R. L. Rivest and R. E. Schapire. Inference of finite automata using homing sequences. Inf. Comput., 103(2):299–347, 1993. [60] B. K. Szymanski. A simple solution to Lamport’s concurrent programming problem with linear wait. In ICS’88, pages 621–626. [61] A. W. To and L. Libkin. Algorithmic metatheorems for decidable LTL model checking over infinite systems. In FoSSaCS’10, pages 221–236. 8 [62] A. Vardhan. Learning To Verify Systems. PhD thesis, Department of λ Computer Science, University of Illinois at Urbana-Champaign, 2006. λ ⊥ N [63] A. Vardhan, K. Sen, M. Viswanathan, and G. Agha. Learning to verify ⊤ T safety properties. In ICFME’04, pages 274–289. T T [64] A. Vardhan and M. Viswanathan. LEVER: A tool for learning based N ⊥ verification. In CAV’06, pages 471–474. TT ⊥ N [65] Wikipedia. Liquid water pouring puzzles. TN ⊤ https://en.wikipedia.org/w/index.php?title=Liquid_water_pouring_puzzles&oldid=764748113, 2017. [Accessed: 24-February-2017]. Fig. 2. Using learning to solve the RMC problem (I, T , B) of Herman’s [66] P. Wolper and B. Boigelot. Verifying systems with infinite but regular Protocol. The table on the left is the content of the observation table used by state spaces. In CAV’98, pages 88–97. the automata learning algorithm of Rivest and Shaphire [59] and the automaton on the right is the inferred candidate DFA. VIII. A PPENDIX We provide some more examples for regular model checking in the appendix. Example 2 (RMC of the Herman’s Protocol). Consider the RMC problem of Herman’s Protocol in Example 1. Initially, several membership queries will be posed to the teacher to produce the closed observation table on the left of Fig. 2. In this example, the teacher returns ⊤ only for words containing an odd number of the symbol T. The learner will then construct the candidate FA Ah on the right of Fig. 2 and pose an equivalence query on Ah . Observe that Ah can be used as an inductive invariant in a regular proof. It is easy to verify that I = N∗ T(N∗ TN∗ TN∗ )∗ ⊆ Ah and Ah ∩ B = Ah ∩ N∗ = ∅. The condition (3) T (Ah ) ⊆ Ah of a regular proof can be proved to be correct based on the following observation: the FA Ah recognises exactly the set of all configurations with an odd number of tokens. When tokens are discarded in a transition, the total number of discarded tokens in all processes is always 2. The other two types of transitions will not change the total number of tokens in the system. It follows that taking a transition from any configurations in Ah will arrive a configuration with an odd number of tokens, which is still in Ah . The verification of Herman’s Protocol finishes after the first iteration of learning and hence we cannot see how the learning algorithm uses a counterexample for refinement. Below we introduce a slightly more difficult problem. Example 3 (RMC of the Israeli-Jalfon’s Protocol). IsraeliJalfon’s Protocol is a routing protocol of n processes organised in a ring-shaped topology, where a process may hold a token. Again we assume the processes are numbered from 0 to n − 1. If the process with the number i is chosen by the scheduler, it will toss a coin to decide to pass the token to the left or right, i.e. the one with the number (i − 1)%n or (i + 1)%n. When two tokens are held by the same process, they will be merged. The safety property of interest is that every system configuration has at least one token. The protocol and the corresponding safety property can be modelled as a regular model checking problem (I, T , B), together with the set of initial configurations I = (T + N)∗ T(T + N)∗ T(T+ N)∗ , i.e., at least two processes have tokens, and the set of bad configurations B = N∗ , i.e., all tokens have disappeared. Again we use the regular language E = ((T, T) + (N, N)) 9 to denote the relation that a process is idle, i.e, the process does not change its state. The transition relation T then can be specified as a union of the regular expressions in Figure 3. E ∗ (T, N)((T, T) + (N, T))E ∗ , ((T, T) + (N, T))E ∗ (T, N) E ∗ ((T, T) + (N, T))(T, N)E ∗ , (T, N)E ∗ ((T, T) + (N, T)) (Pass the token right) (Pass the token left) Fig. 3. The Transition Relation of Israeli-Jalfon’s Protocol When the automata learning algorithm of Rivest and Shaphire is applied to solve the RMC problem, we can obtain an inductive invariant with 4 states in 3 iterations. The first candidate FA in Fig. 4(a) is incorrect because it does not include the initial configuration TT. By analysing the counterexample TT, the learning algorithm adds the suffix T to the set E. The second candidate FA in Fig. 4(b) is still incorrect because it contains an unreachable bad configuration NNN. The learning algorithm analyses the counterexample NNN and adds the suffix N to the set E. This time it obtains the candidate FA in Fig. 4(c), which is a valid regular inductive invariant. λ ⊥ ⊥ ⊥ λ T N T, N (a) First candidate automaton λ T TT N TN TTT TTN λ ⊥ ⊥ ⊤ ⊥ ⊤ ⊤ ⊤ T ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ T, N T, N T, N (b) Second candidate automaton λ T N TT TN NT NN TTT TTN λ ⊥ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ T ⊥ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ N ⊥ ⊤ ⊥ ⊤ ⊤ ⊤ ⊥ ⊤ ⊤ T N N T, N T T, N (c) Third candidate automaton Fig. 4. Using learning to solve the RMC problem (I, T , B) of IsraeliJalfon’s Protocol. The table on the left of each sub-figure is the content of the observation table used by the automata learning algorithm of Rivest and Shaphire [59]. 10
6cs.PL
Strictly proper kernel scores and characteristic kernels on compact spaces Ingo Steinwart Johanna F. Ziegel arXiv:1712.05279v1 [math.FA] 14 Dec 2017 December 15, 2017 Abstract Strictly proper kernel scores are well-known tool in probabilistic forecasting, while characteristic kernels have been extensively investigated in the machine learning literature. We first show that both notions coincide, so that insights from one part of the literature can be used in the other. We then show that the metric induced by a characteristic kernel cannot reliably distinguish between distributions that are far apart in the total variation norm as soon as the underlying space of measures is infinite dimensional. In addition, we provide a characterization of characteristic kernels in terms of eigenvalues and -functions and apply this characterization to the case of continuous kernels on (locally) compact spaces. In the compact case we further show that characteristic kernels exist if and only if the space is metrizable. As special cases of our general theory we investigate translation-invariant kernels on compact Abelian groups and isotropic kernels on spheres. The latter are of particular interest for forecast evaluation of probabilistic predictions on spherical domains as frequently encountered in meteorology and climatology. 1 Introduction Probabilistic forecasts of uncertain future events are issued in a wealth of applications, see Gneiting and Katzfuss (2014) and the references therein. To assess the quality and to compare such forecasts, proper scoring rules are a well-established tool, see Gneiting and Raftery (2007), and in applications, it is usually even desirable to work with strictly proper scoring rules. A broad class of proper scoring rules are so-called kernel scores, which are constructed using a positive definite kernel. Unfortunately, however, no general conditions are available to decide whether a given kernel induces a strictly proper kernel score. As detailed below in Theorem 1.1, strict propriety of a kernel score is intimately connected to the kernel being characteristic, a notion that has been studied in the machine learning literature for a decade, see e.g. Gretton et al. (2007); Fukumizu et al. (2009); Sriperumbudur et al. (2010a, 2011) as well as the recent survey of Muandet et al. (2017) and the references therein. In this paper, we study characteristic kernels on compact spaces extending results of Micchelli et al. (2006) and Sriperumbudur et al. (2010a, 2011). As a consequence, we can characterize strictly proper kernel scores on compact Abelian groups and the practically highly relevant example of spheres. To describe our results in more detail, let us formally introduce some of the notions mentioned above. To this end, let (X, A) be a measurable space and let M1 (X) denote the class of all probability measures onR X. For P ⊆ M1 (X), a scoring rule is a function S : P × X → [−∞, ∞] such that the integral S(P, x) dQ(x) exists for all P, Q ∈ P. The scoring rule is called proper 1 with respect to P if Z S(P, x) dP (x) ≤ Z S(Q, x) dP (x), for all P, Q ∈ P, (1) and it is called strictly proper if equality in (1) implies P = Q. Recall that if the class P consists of absolutely continuous probability measures with respect to some σ-finite measure µ on X then the logarithmic score S(P, x) := − log p(x), where p is the density of P , is a widely used example of a strictly proper scoring rule for density forecasts. Another well-known is the Brier Pm example 2 score for distributions on X = {1, . . . , m} that is defined as S(P, i) := j=1 pj + 1 − 2pi , where pi = P ({i}), i = 1, . . . , m. Finally, for X = R, the continuous ranked probability score (CRPS) is given by Z Z Z 1 |y − y ′ | dP (y) dP (y ′ ). |y − x| dP (y) − S(P, x) := 2 R R R It is strictly proper with respect to the class of all probability measures with finite first moment, see e.g. Gneiting and Raftery (2007, Section 4.2), and consequently it can be used to evaluate predictions of density forecasts as well as probabilistic forecasts of categorical variables. Various other examples can be found in Gneiting and Raftery (2007). One general class of proper scoring rules are kernel scores. To this end, let k : X × X → R be a symmetric function. We call k a kernel, if it is positive definite, that is, if n X i,j=1 ai aj k(xi , xj ) ≥ 0 (2) for all natural numbers n, all a1 , . . . , an ∈ R, and all x1 , . . . , xn ∈ X. It is strictly positive definite if equality in (2) implies a1 = · · · = an = 0 whenever the points x1 , . . . , xn are mutually distinct. Let us assume that k is measurable and define Z p o n k k(x, x) dP (x) < ∞ . M1 (X) := P ∈ M1 (X) X k Cauchy-Schwarz inequality For a bounded kernel p k, we have that M1 (X) = M1 (X), and the p k k(x, y) ≤ k(x, x) k(y, y) for kernels shows that, for all P, Q ∈ M1 (X), the kernel k is integrable with respect to the product measure P ⊗ Q. Definition 1.1. The kernel score Sk associated with a measurable kernel k on X is the scoring rule Sk : Mk1 (X) × X → R defined by Z Z Z 1 k(ω, ω ′ ) dP (ω) dP (ω ′ ). Sk (P, x) := − k(ω, x) dP (ω) + 2 Kernel scores are a broad generalization of the CRPS, and in fact, also the Brier score can be rewritten as a kernel score, see Gneiting and Raftery (2007, Section 5.1). However, the logarithmic score does not belong to this class. If X is a Hausdorff space and k is continuous, then Gneiting and Raftery (2007, Theorem 4) show that Sk is proper with respect to all Radon probability measures on X. Their result is based on Berg et al. (1984, Theorem 2.1, p. 235), where it is fundamental that the kernel is continuous. In this respect we remark that the definition of a kernel score of Gneiting and Raftery (2007) is more general than ours as it allows for kernels being only conditionally positive definite. While this level of generality is fruitful for example in the case X = Rd , we believe that it is sufficient to consider only positive definite kernels for compact 2 spaces. Indeed, note that if X is compact and separable and there is a strictly positive probability R measure ν on its Borel sets, then, if we only consider kernels k such that X k(x, y) dν(x) does not depend on y, we know by Bochner (1941, Theorem 2) that conditionally positive definite kernels and positive definite kernels are the same up to a constant. In our framework, it is possible to show propriety of the kernel score without requiring continuity of the kernel using the theory of reproducing kernel Hilbert spaces (RKHS); see Theorem 1.1 below. In addition, we obtain a condition for when the kernel score is actually strictly proper. Theorem 1.1. Let k be a measurable kernel with RKHS H with norm k·kH and Φ : Mk1 (X) → H be the kernel embedding defined by Z Φ(P ) := k(·, ω) dP (ω) . (3) Then the kernel score satisfies Φ(P ) − Φ(Q) 2 H =2 Z Sk (Q, x) dP (x) − Z  Sk (P, x) dP (x) (4) for all P, Q ∈ Mk1 (X). In particular, Sk is a proper scoring rule with respect to Mk1 (X), and it is strictly proper if and only if Φ is injective. In the machine learning literature a bounded measurable kernel is called characteristic if the kernel (mean) embedding Φ : M1 (X) → H defined by (3) is injective. Consequently, Theorem 1.1 shows that, for bounded measurable kernels k, strictly proper kernel scores Sk are exactly those for which k is characteristic. In particular, the wealth of examples and conditions for characteristic kernels can be directly used to find new strictly proper scoring rules and vice versa. While Theorem 1.1 is an interesting observation for both machine learning applications and probabilistic forecasting, its proof is actually rather trivial. In the rest of the paper, we therefore focus on more involved aspects of characteristic kernels, and strictly proper kernel scores, respectively. We introduce the necessary mathematical machinery on kernels and their interaction with (signed) finite measures in Section 2. In particular we recall that a bounded measurable kernel k with RKHS H induces a semi-norm k · kH on M(X), the space of all finite signed measures on X, via the kernel mean embedding, that is via the left-hand side of (4). In Section 3.1, we study this semi-norm for general X. In particular, Theorem 3.1 shows that for injective kernel embeddings, k · kH fails to be equivalent to the total variation norm on M(X) if and only if dim M(X) = ∞, and Corollary 3.8 gives an even sharper result on M1 (X). In view of (4), these results show that the value on the right-hand side of (4) is not proportional to the (squared) total variation norm. Besides some structural results on characteristic kernels, see Lemmas 3.3 and 3.4, we further present a simple computation of the left-hand side of (4) in terms of eigenvalues and -functions of a suitable integral operator. In Section 3.2, we then exploit our general theory to obtain new results for bounded continuous kernels on locally compact Hausdorff spaces. The main question of interest is when such kernels are universal or characteristic. In Theorem 3.17 and Corollary 3.18 we give characterization results in terms of eigenfunctions of certain integral operators. We also provide insight concerning the difference of considering Borel or Radon measures on locally compact Hausdorff spaces in the study of kernel embeddings, see Theorems 3.13 and 3.14. As a result, it turns out in Theorem 3.15 that continuous characteristic kernels on compact Hausdorff spaces only exist if the spaces are metrizable. In Section 4, we apply the characterization results of Section 3.2 to translation-invariant kernels on compact Abelian groups and to isotropic kernels on spheres. All proofs can be found in Section 5. 3 2 Preliminaries In this section we recall some facts about reproducing kernels and their interaction with measures. To this end, let (X, A) be a measurable space. We denote the space of finite signed measures on X by M(X) and write M+ (X) and M1 (X) for the subsets of all (non-negative) finite, respectively probability measures. Moreover, we write  M0 (X) := µ ∈ M(X) : µ(X) = 0 . As usual we equip M(X) and its subsets above with the total variation norm k · kTV . Recall that k · kTV is complete and hence M(X) is a Banach space. Moreover, M0 (X) is closed subspace of co-dimension 1, which contains, e.g. all differences of probability measures. Moreover, for every P ∈ M1 (X) we have M(X) = RP ⊕ M0 (X) . (5) Given a measurable function f : X → R and a measure ν on X we write [f ]∼ for the νequivalence class of f . Similar, we denote the space of p-times ν-integrable functions by Lp (ν) and the corresponding space of ν-equivalence classes by Lp (ν). Note that this rather pedantic notation becomes very useful when dealing with RKHSs since these spaces consist of functions that can be evaluated pointwise in a continuous fashion, whereas such an evaluation does, in general, not make sense for elements in Lp (ν). To formally introduce kernel mean embeddings, we need to recall the notion of Pettis integrals. To this end let, let H be a Hilbert space and f : X → H be a function. Then f is weakly measurable, if hw, f i : X → R is measurable for all w ∈ H. Similarly, f is weakly integrable with respect to a measure ν on (X, A), if hw, f i ∈ L1 (ν) for all w ∈ H. In this case, there exists a unique iν (f ) ∈ H, called the Pettis integral of f with respect to ν, such that for all w ∈ H we have Z hw, f i dν , hw, iν (f )i = X see e.g. Diestel and Uhl (1977, Chapter II.3) together with the reflexivity of H and the identity H = H ′ between H and its dual H ′ . Using the Hahn-Jordan decomposition, it is not hard to see that iµ (f ) can analogously R be defined for finite signed measures µ. In the following, we adopt the more intuitive notation X f dµ := iµ (f ), so that the defining equation above becomes Z Z hw, f i dµ . (6) f dµ = w, X X Furthermore, in the case of probability measures µ, we sometimes also write Eµ f := iµ (f ). Let us now use Pettis integrals to define kernel mean embeddings. To this end, let H be an RKHS over X with kernel k and canonical feature map Φ : X → H, that is Φ(x) := k(·, x) for all x ∈ X. Then Φ is weakly measurable if and only if hh, Φi = h is measurable for all h ∈ H, and therefore, we conclude that Φ is weakly integrable with respect to some measure ν on X, if and only if h ∈ L1 (ν) for all h ∈ H. By a simple application of the closed graph theorem, the latter is equivalent to the continuity of the map [ · ]∼ : H → L1 (ν). In this respect recall that H consists of measurable functions if and only if k is separately measurable, that is k(·, x) : X → R is measurable for all x ∈ X, see Steinwart and Christmann (2008, Lemma 4.24), and [ · ]∼ : H → L1 (ν) is continuous if, e.g. Z p k(x, x) dν(x) < ∞ , (7) 4 see e.g. Steinwart and Christmann (2008, Theorem 4.26). Obviously, the latter condition is still sufficient for finite signed measures if one replaces ν by |ν|. For a separately measurable kernel k with RKHS H we now write n o Mk (X) := µ ∈ M(X) : H ⊂ L1 (µ) , and analogously we define Mk+ (X) and Mk1 (X). Obviously, Mk (X) is a vector space containing all Dirac measures and using (7) it is not hard to see that Mk (X) = M(X), if k is bounded. In fact, the latter is also necessary for Mk (X) = M(X) as a combination of Sriperumbudur et al. (2010a, Proposition 2) with Steinwart and Christmann (2008, Lemma 4.23) shows. Moreover, our considerations above show that Mk (X) is the largest set on which we can define the kernel embedding Z Z k(·, x) dµ(x) . Φ dµ = Φ(µ) := X X Note that the map Φ : Mk (X) → H is linear, and for Dirac measures δx we have Φ(δx ) = Φ(x). Consequently kµkH := kΦ(µ)kH defines a new semi-norm on Mk (X), and by a double application of (6) we further have Z Z k(x, x′ ) dµ1 (x) dµ2 (x′ ) . hΦ(µ1 ), Φ(µ2 )iH = X (8) X Note that this semi-norm is a norm, if and only if the kernel embedding Φ : Mk (X) → H is injective and by (8) the latter is equivalent to Z Z 2 kµkH = k(x, x′ ) dµ(x) dµ(x′ ) > 0 . (9) for all µ ∈ Mk (X) \ {0}. This leads to the following definition. Definition 2.1. Let k be a measurable kernel on X and M ⊂ Mk (X). Then k is called strictly integrally positive definite with respect to M, if (9) holds for all µ ∈ M with µ = 6 0. It is well-known, that using (6) the semi-norm introduced above can also be computed by Z Z Z hf, Φi dµ Φ dµ = sup Φ dµ = sup f, kµkH = H f ∈BH X f ∈BH X X Z f dµ , (10) = sup f ∈BH X where BH denotes the closed unit ball of H. Consequently, we have kµkH ≤ k[ · ]∼ : H → L1 (µ)k, 1/2 and if k is bounded, then Φ : M(X) → H is continuous with kΦ : M(X) → Hk ≤ kkk∞ . In particular, if k is bounded and Φ : M(X) → H is injective, then k · kH defines a new norm on M(X) that is dominated by k · kTV and that describes a Euclidean geometry with inner product (8). Unless dim M(X) < ∞, however, both norms are not equivalent, as we will see in Theorem 3.1. With the help of the new semi-norm k · kH on Mk (X) we can now define a semi-metric on k M1 (X) by setting Z Z γk (P, Q) := kP − QkH = sup f ∈BH 5 f dP − f dQ for P, Q ∈ Mk1 (X). Here, we note that the second equality, which follows from our considerations above, has already been shown by Sriperumbudur et al. (2010a, Theorem 1). Similarly, the following definition is taken from Fukumizu et al. (2008); Sriperumbudur et al. (2010a). Definition 2.2. A bounded measurable kernel k on X is called characteristic, if the kernel mean embedding Φ|M1 (X) : M1 (X) → H is injective. Clearly, k is characteristic, if and only if γk is a metric, and a literal repetition of Sriperumbudur et al. (2010a, Lemma 8) shows: Proposition 2.3. Let (X, A) be a measurable space and k be a bounded measurable kernel on X. Then the following statements are equivalent: i) k is strictly integrally positive definite with respect to M0 (X). ii) k is characteristic. Now, let ν be a measure on X, k be a measurable kernel on X, and H be its RKHS. We further assume that the map Ik,ν : H → L2 (ν) given by f 7→ [f ]∼ is well-defined and compact. For an example of such a situation recall Steinwart and Scovel (2012, Lemma 2.3), which shows that Ik,ν is Hilbert-Schmidt if Z k(x, x) dν(x) < ∞ . (11) X Obviously, the latter holds, if e.g. k is bounded and ν is a finite measure. Now assume that Ik,ν is well-defined and compact. Then, the associated integral operator Tk,ν : L2 (ν) → L2 (ν), defined by i hZ k(x, ·)f (x) dν(x) , Tk,ν f = f ∈ L2 (ν) , ∼ X ∗ denotes the see e.g. Steinwart and Scovel (2012, Lemma 2.2), where Ik,ν satisfies Tk,ν = adjoint of Ik,ν . In particular, Tk,ν is compact, positive, and self-adjoint, and if (11) is satisfied, Tk,ν is even nuclear. Moreover, the spectral theorem in the form of Steinwart and Scovel (2012, Lemma 2.12) gives us an at most countable, ordered family (λi )i∈I ⊂ (0, ∞) converging to 0 and a family (ei )i∈I ⊂ H such that: ∗ , Ik,ν ◦ Ik,ν • (λi )i∈I are the non-zero eigenvalues of Tk,ν including multiplicities, • ([ei ]∼ )i∈I is an L2 (ν)-ONS of the corresponding eigenfunctions with L2 (ν) span{[ei ]∼ : i ∈ I} L2 (ν) = [H∼ ] , (12) √ • ( λi ei )i∈I is an ONS in H. Here, we say that an at most countable family (αi )i∈I ⊂ [0, ∞) converges to 0, if either I = {1, . . . , n} or I = N and limi→∞ αi = 0. P Note that for nuclear Tk,ν , we additionally have i∈I λi < ∞, and if k is bounded, kei k∞ < ∞ holds for all i ∈ I. Finally, Steinwart and Scovel (2012, Theorem 3.1) show that the injectivity of Ik,ν : H → L2 (ν) is equivalent to either of the following statements: √ i) ( λi ei )i∈I is an ONB of H. 6 ii) For all x, x′ ∈ X we have k(x, x′ ) = X λi ei (x)ei (x′ ) . (13) i∈I Obviously, if one of these conditions is true, then H is separable, and Steinwart and Scovel (2012, Corollary 2.10) show that the convergence in (13) is absolute and we even have k(·, x) = P i∈I λi ei (x)ei with unconditional convergence in H. Let us now recall some notions related to measures on topological spaces, see e.g. Bauer (2001, Chapter IV) for details. To this end, let (X, τ ) be a Hausdorff (topological) space and ν be a measure on its Borel-σ-algebra B(X). Then ν is a Borel measure, if ν(K) < ∞ for all compact K ⊂ X and ν is called strictly positive, if ν(O) > 0 for all non-empty O ∈ τ . Moreover, a finite measure ν on B(X) is a (finite) Radon measure if it is regular, i.e. if for all B ∈ B(X) we have ν(B) = sup{ν(K) : K compact and K ⊂ B} = inf{ν(O) : O open and B ⊂ O} . A finite signed Radon measure is simply the difference of two finite Radon measures. In the following, we denote the space of all finite signed Radon measures by M∗ (X) and the cone of (non-negative) finite Radon measures by M∗+ (X). As usual, M∗ (X) is equipped with the norm of total variation. Obviously, every finite Radon measure is a finite Borel measure, and by Ulam’s theorem, see e.g. Bauer (2001, Lemma 26.2), the converse implication is true if X is a Polish space. In this respect recall that compact, metrizable spaces are Polish. Now let X be a locally compact Hausdorff space and C0 (X) be the space of continuous functions vanishing at infinity. As usual, we equip C0 (X) with the supremum norm. Then, Riesz’s representation theorem for locally compact spaces, see e.g. Hewitt and Stromberg (1965, Theorem 20.48 together with Definition 20.41, Theorem 12.40, Definition 12.39, and a simple translation into the real-valued case using Theorem 12.36) shows that M∗ (X) → C0 (X)′ Z   f dµ µ 7→ f 7→ hf, µi := (14) X is an isometric isomorphism. In the compact case, in which C0 (X) coincides with the space of continuous functions C(X), this can also be found in e.g. Dunford and Schwartz (1958, p. 265, Theorem IV.6.3). Given a locally compact Hausdorff space X, a continuous kernel k on X with RKHS H is called universal if H ⊂ C0 (X) and H is dense in C0 (X) with respect to k · k∞ . Note that for compact X the inclusion H ⊂ C0 (X) is automatically satisfied. Examples of universal kernels as well as various necessary and sufficient conditions for universality can be found in e.g. Steinwart (2001); Micchelli et al. (2006); Sriperumbudur et al. (2011); Chen et al. (2016) and the references mentioned therein. 3 New Characterizations In this section we first compare the norms k · kH and k · kTV and show that in infinite dimensional they are never equivalent. By establishing some structural result for characteristic kernels, we then demonstrate that characteristic kernels cannot reliably distinguish between distributions that are far away with respect to k · kTV . We further relate the eigenfunctions of the kernel to the metric γk and with the help of this relation we investigate continuous kernels on (locally) compact spaces. Finally, we characterize on which compact spaces X there do exist characteristic kernels. 7 3.1 General results In this subsection we investigate the semi-norm k · kH on M(X) for bounded kernels and general X. We begin with a result that compares k · kH with k · kTV . Theorem 3.1. Let (X, A) be a measurable space and H be the RKHS of a bounded and measurable kernel k on X such that the kernel embedding Φ : M(X) → H is injective. Then, the following statements are equivalent: i) The space M(X) is finite dimensional. ii) The norms k · kH and k · kTV on M(X) are equivalent. iii) The norm k · kH on M(X) is complete. iv) The kernel embedding Φ : M(X) → H is surjective. Theorem 3.1 shows that for most cases of interest (M(X), k · kH ) is not a Hilbert space. To illustrate the fourth statement of Theorem 3.1, recall that the space   Hpre := Φ(µ) : µ ∈ span{δx : x ∈ X} is dense in H, see e.g. Steinwart and Christmann (2008, Theorem 4.21). Moreover, the space span{δx : x ∈ X} is, in a weak sense, dense in M(X), and therefore it is natural to ask whether every f ∈ H is of the form f = Φ(µ) for some µ ∈ M(X). Theorem 3.1 tells us that the answer is no, unless M(X) is finite dimensional. In this respect recall that it has been recently mentioned by Simon-Gabriel and Schölkopf (2016) that the kernel embedding Φ is, in general, not surjective. However, the authors do not provide any example, or conditions, for non-surjective Φ. Two examples of non-surjective kernel embeddings Φ are provided by Pillai et al. (2007, Section 3), while our Theorem 3.1 shows that actually all injective Φ fail to be surjective whenever we have dim M(X) = ∞. Our next goal is to show that for characteristic kernels on infinite dimensional spaces M(X) there always exists probability measures that have maximal k · kTV -distance but arbitrarily small k · kH -distance. To this end, we need a couple of preparatory results. We begin with the following lemma that investigates the effect of 1X ∈ H. Lemma 3.2. Let (X, A) be a measurable space and H be the RKHS of a bounded and measurable kernel k on X. If 1X ∈ H, then M0 (X) is k · kH -closed in M(X), and if k is, in addition, characteristic, then the kernel embedding Φ : M(X) → H is injective. The next simple lemma computes the k · kH -norm of measures if H is an RKHS of the sum of two kernels. Lemma 3.3. Let (X, A) be a measurable space, and k1 , k2 be bounded measurable kernels on X with RKHSs H1 and H2 . Let H be the RKHS of the kernel k = k1 + k2 . Then for all µ ∈ M(X) we have kµk2H = kµk2H1 + kµk2H2 . In particular, if k1 is characteristic or has an injective kernel embedding, then the same is true for k. 8 In Sriperumbudur et al. (2010a, Corollary 11) it has already be show that the sum of two bounded, continuous translation-invariant kernels on Rd is characteristic, if at least one summand is characteristic. Lemma 3.3 shows that this kind of inheritance holds in the general case. Our next lemma considers products of kernels. In particular it shows that such products can only be characteristic if the involved factors are strictly integrally positive definite. Lemma 3.4. Let (X1 , A1 ) and (X2 , A2 ) be measurable spaces and k1 , k2 be a bounded, measurable kernels on X1 and X2 , respectively. We denote the RKHSs of k1 and k2 by H1 and H2 . Moreover, let H be the RKHS of the kernel k := k1 · k2 on X1 × X2 . Then, for all µ1 ∈ M(X1 ) and µ2 ∈ M(X2 ) we have kµ1 ⊗ µ2 kH = kµ1 kH1 · kµ2 kH2 . In particular, if dim M(X1 ) ≥ 2 and dim M(X2 ) ≥ 2, and k is characteristic, then k1 and k2 are strictly integrally positive definite with respect to M(X1 ) and M(X2 ), respectively. At first glance it seems that Lemma 3.4 contradicts Sriperumbudur et al. (2010a, Corollary 11), which shows that the product of two bounded, continuous, translation-invariant kernels on Rd is characteristic on Rd as soon as at least one factor is characteristic. However, a closer look reveals that their result considers the restriction of the product to the diagonal, whereas we treat the unrestricted kernel. Later in Corollary 3.16, we will see that, on compact spaces, the product of two strictly integrally positive definite kernels gives a strictly integrally positive definite kernel on the product. The following lemma compares strictly integrally positive definite kernels with respect M(X) and M0 (X). In an implicit form, it has already been used, and a similar statement is SimonGabriel and Schölkopf (2016, Theorem 32). Lemma 3.5. Let (X, A) be a measurable space, and k be a bounded measurable kernel on X. Moreover, let M ⊂ M(X) be a subspace with M ∩ M1 (X) 6= ∅ and M0 := M ∩ M0 (X). Then the following statements are equivalent: i) k is strictly integrally positive definite with respect to M0 . ii) k + 1 is strictly integrally positive definite with respect to M. iii) k + 1 is strictly integrally positive definite with respect to M0 . We have already seen in Theorem 3.1 that in the infinite-dimensional case the norms k·kH and k · kTV are not equivalent on M(X). Intuitively, this carries over to the subspace M0 (X). The following result confirms this intuition as long as M0 (X) is a k · kH -closed subspace of M(X). Theorem 3.6. Let (X, A) be a measurable space such that dim M(X) = ∞ and H be the RKHS of a bounded and measurable kernel k on X such that the kernel embedding Φ : M(X) → H is injective. If M0 (X) is a k · kH -closed subspace of M(X), then k · kH and k · kTV are not equivalent on M0 (X). The non-equivalence of k · kH and k · kTV on M0 (X) has already been observed in some particular situations. For example, Sriperumbudur et al. (2010a, Theorem 23) show that for universal kernels on compact metric spaces, γk metrizes the weak topology (in probabilist’s terminology) on M1 (X), and since for dim M(X) = ∞ this weak topology is strictly coarser than the k · kTV topology, we see that k · kH and k · kTV cannot be equivalent for such kernels. In addition, the non-equivalence can also be obtained from Sriperumbudur et al. (2010a, Theorems 21 and 24) for 9 other continuous kernels on certain metric spaces. Finally recall that M0 (X) is a k · kH -closed subspace of M(X) if 1X ∈ H by Lemma 3.2. With the help of Theorem 3.6 the next result shows that characteristic kernels cannot reliably distinguish between distributions that are far away in total variation norm. Theorem 3.7. Let (X, A) be a measurable space such that dim M(X) = ∞ and H be the RKHS of a characteristic kernel k on X. Then for all ε > 0 there exist distributions Q1 , Q2 ∈ M1 (X) such that kQ1 − Q2 kTV = 2 and kQ1 − Q2 kH ≤ ε. Theorem 3.7 only shows that there are some distributions that cannot be reliably distinguished. The following corollary shows that such distributions actually occur everywhere. Corollary 3.8. Let (X, A) be a measurable space such that dim M(X) = ∞ and H be the RKHS of a characteristic kernel k on X. Then for all P ∈ M1 (X), δ ∈ (0, 2], and ε ∈ (0, δ) there exist Q1 , Q2 ∈ M1 (X) such that kP − Qi kTV ≤ δ for i = 1, 2, kQ1 − Q2 kTV = δ, and kQ1 − Q2 kH ≤ ε. The next goal of this subsection is to investigate the k·kH -norm with the help of the eigenvalues and -functions of the integral operator Tk,ν . We begin with the following lemma that computes the inner product (8) by these eigenvalues and -functions. Lemma 3.9. Let (X, A, ν) be σ-finite measure space and k be a bounded, measurable kernel with RKHS H for which Ik,ν : H → L2 (ν) is compact and injective. Then, for all µ1 , µ2 ∈ M(X), we have Z Z   Z Z X ei dµ2 , k(x, x′ ) dµ1 (x) dµ2 (x′ ) = λi · ei dµ1 · X X X X i∈I where (λi )i∈I ⊂ (0, ∞) and (ei )i∈I ⊂ H are as at (13). For an interpretation of this lemma, we write, for bounded measurable f : X → R and µ ∈ M(X), Z f dµ . hf, µi := X Combining Lemma 3.9 with (8) we then have Φ(µ1 ), Φ(µ2 ) H = X i∈I λi hei , µ1 ihei , µ2 i . In other words, all calculations regarding inner products and norms of the kernel embedding µ 7→ Φ(µ) can be carried over to a weighted ℓ2 -space. To formulate the following theorem, we denote, for a σ-finite measure ν on (X, A), the set of all ν-probability densities contained in L2 (ν) by ∆(ν), that is Z o n h dν = 1 . ∆(ν) := [h]∼ ∈ L2 (ν) ∩ L1 (ν) : [h]∼ ≥ 0 and X Moreover, we write P2 (ν) := {h dν : [h]∼ ∈ ∆(ν)} for the corresponding set of probability measures. With the help of these preparations we can now formulate the following theorem that characterizes non-characteristic kernels on P2 (ν) and that also establishes a result similar to Theorem 3.7 for non-characteristic kernels. 10 Theorem 3.10. Let (X, A, ν) be σ-finite measure space and k be a bounded, measurable kernel with RKHS H for which Ik,ν : H → L2 (ν) is compact and injective. Then for all [h]∼ , [g]∼ ∈ ∆(ν) and P := h dν, Q := g dν the kernel mean distance can be computed by X λi h[h − g]∼ , [ei ]∼ i2L2 (ν) . (15) γk2 (P, Q) = i∈I Moreover, the following statements are equivalent: i) There exist Q1 , Q2 ∈ P2 (ν) with Q1 6= Q2 and γk2 (Q1 , Q2 ) = 0. R ii) There exists an [f ]∼ ∈ L1 (ν) ∩ [H]⊥ ∼ with [f ]∼ 6= 0 and X f dν = 0. iii) There exist [h1 ]∼ , [h2 ]∼ ∈ ∆(ν) with [h1 ]∼ 6= [h2 ]∼ such that for all i ∈ I we have h[h1 ]∼ , [ei ]∼ iL2 (ν) = h[h2 ]∼ , [ei ]∼ iL2 (ν) . Moreover, if one, and thus all, statements are true we actually find for all P ∈ P2 (ν) and ε ∈ (0, 2) some Q1 , Q2 ∈ P2 (ν) with kP − Qi kTV ≤ ε, kQ1 − Q2 kTV = ε, and γk2 (Q1 , Q2 ) = 0. Equation (15) can also be used to show that under certain circumstances k · kH cannot reliably identify, for example, the uniform distribution. The following result, which is particularly interesting in view of Section 4, illustrates this. Corollary 3.11. Let (X, A, ν) be a probability space and k be a bounded, measurable kernel with RKHS H for which Ik,ν : H → L2 (ν) is compact and injective. Assume that there is one eigenfunction ei0 with ei0 = 1X . In addition assume that there are constants c1 > 0 and c∞ < ∞ with kei kL1 (ν) ≥ c1 and kei k∞ ≤ c∞ for all i ∈ I. For α := c−1 ∞ and j 6= i0 consider the signed measure Qj := (1X + αej )dν. Then Qj is actually a probability measure and for P := ν we have kP − Qj kTV ≥ c1 c−1 ∞ kP − Qj kH = λj c−2 ∞ . The last result of this subsection provides some necessary conditions for characteristic kernels. Corollary 3.12. Let (X, A, ν) be finite measure space and k be a bounded, measurable kernel with RKHS H for which Ik,ν : H → L2 (ν) is compact and injective. Then the following statements are true: i) If codim[H]∼ ≥ 2 in L2 (ν), then k is not characteristic. ii) If codim[H]∼ ≥ 1 in L2 (ν) and 1X ∈ H, then k is not characteristic. 3.2 Continuous Kernels on Locally Compact Subsets In this subsection, we apply the general theory developed so far to bounded continuous kernels on locally compact Hausdorff spaces (X, τ ). Let us begin with some preparatory remarks. To this end, let k be a bounded and continuous kernel on X whose RKHS H satisfies H ⊂ C0 (X). In the following we call such a k a C0 (X)-kernel. Our goal in this section is to investigate when C0 (X)-kernels are universal or characteristic. We begin with the following result that provides a necessary condition for the existence of strictly integrally positive definite kernels. 11 Theorem 3.13. Let (X, τ ) be a locally compact Hausdorff space with M∗ (X) 6= M(X). Then no C0 (X)-kernel is strictly integrally positive definite with respect to M(X). Note that Sriperumbudur et al. (2011) restrict their considerations to characteristic kernels on locally compact Polish spaces, for which we automatically have M∗ (X) = M(X) by Ulam’s theorem, see e.g. Bauer (2001, Lemma 26.2). Some other papers, however, do not carefully distinguish between Borel and Radon measures, which, at last consequence, means that their results only hold if we additionally assume M∗ (X) = M(X). Theorem 3.13 shows that this restriction is natural, and actually no restriction at all. Furthermore note that for compact spaces X one can use Theorem 3.13 to show that M∗ (X) = M(X) is necessary for the existence of characteristic kernels. We skip such a result since later in Theorem 3.15, we will be able to show an even stronger result. Before we formulate our next result we need a bit more preparation. To this end, let k be a C0 (X)-kernel on a locally compact space (X, τ ). Then we have H ⊂ C0 (x) and a quick closedgraph argument shows that the corresponding inclusion operator I : H → C0 (X) is bounded. By the identification C0 (X)′ = M∗ (X) in (14) and the simple calculation Z Z hh, k(x, ·)iH dµ(x) = hh, Φ(µ)iH , h dµ = hIh, µiC0 (X),M∗ (X) = X X which holds for all h ∈ H, µ ∈ M∗ (X) we further find that the adjoint I ′ of I is given by I ′ = Φ. This simple observation leads to the following characterization, which has already been shown for compact spaces X by Micchelli et al. (2006, Proposition 1) and for locally compact Polish spaces by Sriperumbudur et al. (2011, Proposition 4). Although the proof of the latter paper also works on general locally compact Hausdorff spaces, we decided to add the few lines for the sake of completeness. Theorem 3.14. Let (X, τ ) be a locally compact Hausdorff space and k be a C0 (X)-kernel. Then the following two statements are equivalent: i) k is strictly integrally positive definite with respect to M∗ (X). ii) k is universal. With the help of Theorem 3.14 we can now show that for characteristic kernels on compact spaces X it suffices to consider metrizable X. A similar result for universal kernels, which is included in the following theorem, has already been derived by Steinwart et al. (2006). Theorem 3.15. For a compact topological Hausdorff space (X, τ ) the following statements are equivalent: i) There exists a universal kernel k on X. ii) There exists a continuous characteristic kernel k on X. iii) X is metrizable, i.e. there exists a metric generating the topology τ . If one and thus all statements are true, (X, τ ) is a compact Polish space and M∗ (X) = M(X). Theorem 3.15 shows that on compact spaces we may only expect universal or characteristic kernels, if the topology is metrizable. Since in this case we have M∗ (X) = M(X), Theorem 3.14 and Proposition 2.3 show the well-known result that every universal kernel is characteristic. In general, the converse implication is not true, but adding some structural requirements, both notions may coincide. The following corollary illustrates this by showing that for product kernels universal and characteristic kernels coincide. 12 Corollary 3.16. Let (X1 , τ1 ) and (X2 , τ2 ) be non-trivial compact metrizable spaces and k1 , k2 be continuous kernels on X1 and X2 , respectively. For the kernel k := k1 · k2 on X1 × X2 the following statements are then equivalent: i) k is universal. ii) k is characteristic. iii) k1 and k2 are universal. Our next theorem, which provides a characterization of universal kernels with the help of the eigenfunctions of the integral operator Tk,ν , is an extension of Micchelli et al. (2006, Corollary 5) from compact to arbitrary locally compact Hausdorff spaces. Before we present it, let us first make some preparatory remarks. To this end, let ν be a strictly positive and σ-finite Borel measure on X. For P the matter of concreteness note that if X contains a dense, countable subset (xi )i≥1 then ν := i≥1 δxi satisfies these assumptions and therefore we always find such measures on e.g. compact metric spaces. Now, let k be a bounded and continuous kernel on X satisfying (11). Then H consists of continuous functions and Steinwart and Scovel (2012, Corollary 3.5) show that (13) holds for all x, x′ ∈ X, and consequently, the assumptions of Lemma 3.9, Theorem 3.10, and Corollary 3.12 are satisfied. With these preparations we can now formulate the following characterization of universal kernels, where we note that the equivalence between i) and ii) has essentially been shown in (Sriperumbudur et al., 2010b, Proposition 12). Theorem 3.17. Let (X, τ ) be a locally compact Hausdorff space, ν be a strictly positive, σ-finite Borel measure on X, and k be a C0 (X)-kernel satisfying (11). In addition, let (ei )i∈I be the eigenfunctions of Tk,ν in (13). Then the following statements are equivalent: i) k is universal. ii) For all µ ∈ M∗ (X) satisfying R X ei dµ = 0 for all i ∈ I we have µ = 0. iii) The space span{ei : i ∈ I} is dense in C0 (X). If one, and thus all, statements are true and ν ∈ M∗ (X), then ([ei ]∼ )i∈I is an ONB of L2 (ν). Our next result characterizes universal and characteristic kernels on compact spaces with the help of the eigenfunctions and -values of a suitable Tk,ν . In view of Theorem 3.15 it suffices to consider compact spaces that are Polish. Corollary 3.18. Let (X, τ ) be a compact metrizable space and k be a continuous kernel with RKHS H. Moreover, let (λi )i∈I ⊂ [0, ∞) be a family converging to 0 and (ei )i∈I ⊂ C(X) be a family such that span{ei : i ∈ I} is dense in C(X) and X k(x, x′ ) = λi ei (x)ei (x′ ) i∈I holds for all x, x′ ∈ X. If there is a strictly positive, finite and regular Borel measure ν on X such that ([ei ]∼ )i∈I is an ONS in L2 (ν), then: i) k is universal if and only if λi > 0 for all i ∈ I. ii) If ei0 = 1X for some i0 ∈ I, then k is characteristic if and only if λi > 0 for all i 6= i0 . iii) If 1X ∈ H and ei 6= 1X for all i ∈ I, then k is characteristic if and only if λi > 0 for all i ∈ I. 13 4 Characteristic kernels on spaces with additional structure In this section, we apply the developed theory to translation-invariant or isotropic kernels on compact Abelian groups or spheres, respectively. 4.1 Compact Abelian Groups In this subsection we apply the theory developed so far to translation-invariant kernels on compact Abelian groups. Here the main difficulty lies in the fact that one traditionally considers kernels on groups that are C-valued, while we are only interested in R-valued kernels. Although at first glance, one may not expect any problem arising from this discrepancy, it turns out that it actually does make a difference when constructing an ONB of L2 (ν) with the help of characters as soon as we have more than one self-inverse character. Our first goal is to make the introducing remarks precise. To this end, let (G, +) be a compact Abelian group, and ν be its normalized Haar measure. As usual, we write L2 (G) := L2 (ν), and for later use recall that ν is strictly positive and regular, see e.g. Hewitt and Ross (1963, p. 193/4). Moreover, let (Ĝ, ·) be the dual group of G, which consists of characters e : G → T, where T denotes, as usual, the unit circle in C, see e.g. Hewitt and Ross (1963, Chapter Six) and Folland (1995, Chapter 4.1). For notational purposes, we assume that we have another group (I, +) that is isomorphic to (Ĝ, ·) by some mapping i 7→ ei . This gives ei+j = ei ej , e0 = 1G , and since we further have eē = 1G for all e ∈ Ĝ, our notation also yields e−i = ēi . In particular, we have Re e−i = Re ei and Im e−i = − Im ei for all i ∈ I, and for all i ∈ I with i = −i the latter equality immediately yields Im ei = 0. Finally, for i ∈ I and x, y ∈ G we have ei (−y + x) = ei (x) = ei (y)ei (x) = e−i (y)ei (x) , ei (y) and from this it is easy to derive both, Re ei (−x) = Re ei (x) and Im ei (−x) = − Im ei (x), as well as Re ei (−y + x) = Re ei (x) Re ei (y) + Im ei (x) Im ei (y) . (16) Note that for i ∈ I with i = −i, the latter formula can be simplified using Im ei = 0. Now, it is well-know that ([ei ]∼ )i∈I is an ONB of L2 (G, C), see e.g. Folland (1995, Corollary 4.26) and using this fact a quick application of the Stone-Weierstrass theorem shows that (ei )i∈I is also dense in C(G, C). Let us construct a corresponding ONB in L2 (G). To this end, we write I0 := {i ∈ I : i = −i} for the set of all self-inverse elements of I. Moreover, we fix a partition I+ ∪ I− = I \ I0 such that i ∈ I+ implies −i ∈ I− for all i ∈ I \ I0 . Obviously, the sets I0 , I+ , I− form a partition of I. Let us now define the family (e∗i )i∈I by   Re ei √ ∗ ei := 2 Re ei  √ 2 Im ei if i ∈ I0 if i ∈ I+ if i ∈ I− . (17) The next result shows that (e∗i )i∈I is the desired family. Lemma 4.1. Let (G, +) be a compact Abelian metric group. Then each family (e∗i )i∈I given√by (17) is an ONB of L2 (G) and span{e∗i : i ∈ I} is dense in C(G). Finally, we have ke∗i k∞ ≤ 2 for all i ∈ I. 14 In the following, we call a kernel k on an Abelian group (G, +) translation invariant, if there exists a function κ : G → R such that k(x, x′ ) = κ(−x + x′ ) for all x, x′ ∈ G. Clearly, k is continuous, if and only if κ is. The following lemma provides a representation of translation invariant kernels. Lemma 4.2. Let (G, +) be a compact Abelian group, (e∗i )i∈I be a family of the form (17), and k : G × G → R be a bounded, measurable function. Then the following statements are equivalent: i) k is a bounded, measurable, and translation invariant kernel on G. ii) There exists a summable family (λi )i∈I ⊂ [0, ∞) such that X X k(x, x′ ) = λi e∗i (x)e∗i (x′ ) = λi Re ei (x − x′ ) , λi >0 (18) λi >0 where the series converge absolutely for all x, x′ ∈ G as well as uniformly in (x, x′ ). If one, and thus both, statements are true, then k is continuous, (λi )i∈I are all, possibly vanishing, eigenvalues of Tk,ν , and (e∗i )i∈I is an ONB of the corresponding eigenfunctions. For an interpretation of the representation (18) recall that κ(−x+x′ ) = k(x, x′ ) for all x, x ∈ G and hence (18) gives X X κ(x) = λi Re ei (−x) = λi Re ei (x) λi >0 λi >0 for all x ∈ G. Consequently, the second equality in (18) is Bochner’s theorem, see e.g. Hewitt and Ross (1970, Theorem 30.3), in the case of R-valued kernels on compact Abelian groups. Unlike this classical theorem, however, the second equality in (18) also describes how the representing measure of κ on Ĝ is given by the eigenvalues of Tk or TkC . In the following, we do not need this information, in fact, we only mentioned the second equality to provide a link to the existing theory. Instead, the first equality in (18), which replaces the characters of G by the eigenfunctions of Tk , is more important for us, since this equality actually is the Mercer representation of k in the sense of (13) and therefore the theory developed in the previous sections becomes applicable. The next result is an extension of Theorem 3.15 to translation-invariant kernels on compact Abelian groups. Theorem 4.3. Let (G, +) be a compact Abelian group. Then the following statements are equivalent: i) G is metrizable. ii) Ĝ is at most countable. iii) There exists a translation-invariant universal kernel on G. iv) There exists a universal kernel on G. v) There exists a translation-invariant characteristic kernel on G. vi) There exists a continuous characteristic kernel on G. Note that the equivalence between i) and ii) can also be shown without using translationinvariant kernels, see e.g. Morris (1979, Proposition 3) or Hewitt and Ross (1963, Theorem 24.15). Our proof, to the contrary, is solely RKHS-based. Our next result characterizes universal and characteristic translation-invariant kernels on compact Abelian groups. In view of Theorem 4.3, it suffices to consider the metrizable case. 15 Corollary 4.4. Let (G, +) be a compact metrizable Abelian group and k be a translation-invariant kernel on G with representation (18). Then we have: i) k is universal if and only if λi > 0 for all i ∈ I. ii) k is characteristic if and only if λi > 0 for all i 6= 0. Corollary 4.4 generalizes Sriperumbudur et al. (2010a, Theorem 14 and Corollary 15) from Td to arbitrary compact metrizable Abelian groups. Moreover, recall that these authors also provide a couple of translation-invariant characteristic kernels on T that enjoy a closed form. As mentioned in the beginning of this section, the major difficulty in deriving a Mercer representation (18) for translation-invariant kernels is the handling of self-inverse characters other than the neutral element. The simplest example of a group G whose dual Ĝ contains more than one self-inverse is the quotient group (Z2 , +) of (Z, +) with its subgroup 2Z. Indeed, besides the neutral element e0 , Ẑ2 only contains the character e1 given by e1 (0) := 1 and e1 (1) := −1. Clearly, this gives e21 = e0 and thus e1 is self-inverse. Now note that a function k : Z2 × Z2 → R can be uniquely described by a 2-by-2 matrix K = (k(x, x′ ))x,x′ ∈Z2 and a simple calculation shows that k is a kernel if and only if k(0, 1) = k(1, 0), k(0, 0) ≥ 0, k(1, 1) ≥ 0, and k(0, 0)k(1, 1) ≥ k2 (0, 1). Moreover, k is translation-invariant as soon as it is constant on its diagonal, and in this case the previous conditions reduce to k(0, 1) = k(1, 0) k(0, 0) = k(1, 1) ≥ |k(0, 1)| . and (19) Now, let k be a translation-invariant kernel on Z2 and λ0 , λ1 ≥ 0 be the coefficients in (18). Then a simple calculation shows that the describing matrix K is given by   λ0 + λ1 λ0 − λ1 K= , λ0 − λ1 λ0 + λ1 and therefore it is not hard to see by Corollary 4.4 that k is characteristic, if and only if k(0, 0) 6= k(0, 1). Similarly, k is universal, if and only if k(0, 0) 6= ±k(0, 1). While this example seems to be rather trivial, it already has some important applications. For example, assume that our input space X is a product space for which some components belong to a compact metrizable Abelian group, while the remaining components are only allowed to attain the values 0 and 1. In other words, X is of the form X = G × Zd2 , where G is a compact metrizable Abelian group and d ≥ 1. Now, an intuitive way to construct a (translation-invariant) characteristic kernel k on X is to take a product k := kC · kD , where kC and kD are kernels on G and Zd2 , respectively. By Corollary 3.16 we then know that k is characteristic (or universal) if and only if both kC and kD are universal. Clearly, if kD is itself a product of kernels k1 , . . . , kd then kD is almost automatically translation-invariant and universal. Indeed, if all ki satisfy (19) with ki (0, 0) 6= ±ki (0, 1), then each ki is translation-invariant and universal, and thus so is kD . It seems fair to say that most “natural” choices of ki will satisfy these assumptions. On the other hand, translation-invariant universal kernels kC on G are completely characterized by Corollary 4.4, and thus it is straightforward to characterize all translation-invariant characteristic kernels k on G × Zd2 of product type k := kC · kD . However, their representation (18) is a bit more cumbersome. Indeed, any element (e, ω) ∈ Ĝ × Ẑd = G\ × Zd with self-inverse e ∈ Ĝ and arbitrary 2 2 ω ∈ Zd2 is self-inverse, where the equality in the sense of group isomorphisms can e.g. be found in Folland (1995, Proposition 4.6). Consequently, the set I0 , which intuitively may be viewed as a small set of unusual characters, may actually be rather large. 16 Note that the set Z2 appears in data analysis settings whenever we have categorical variables with two possible values, which quite frequently is indeed the case. Now we have seen around (19) that most natural choices of kernels on Z2 are actually translation-invariant, and for these kernels the results of this subsection applies. Similarly, if we have a categorical variable with an even number m of possible values that have a cyclic nature, for example hours of a day or months of a year, then Zm can be used to describe these values, and kernels that respect the cyclic nature are translation-invariant. Clearly m/2 is self-inverse in Zm , and therefore our theory again applies. For more on structural properties of compact Abelian groups as well as for further examples we refer to Hewitt and Ross (1963, §25) and Hofmann and Morris (2013, Chapter 8). 4.2 Spheres In this subsection we consider isotropic kernels k on Sd for d ≥ 1, that is kernels of the form k(x, y) = ψ(θ(x, y)), where θ(·, ·) = arccosh·, ·i is the geodesic distance on Sd and h·, ·i denotes the standard scalar product on Rd+1 . Following Gneiting (2013), let Ψd be the class of all continuous functions ψ on [0, π] such that k(x, y) = ψ(θ(x, y)) is a kernel on Sd , and define Ψ∞ := ∩d Ψd . We d write Ψ+ d ⊂ Ψd for the class of functions that induce a strictly positive definite kernel on S , and + + + + set Ψ∞ := ∩d Ψd . It holds that Ψd+1 ⊂ Ψd and Ψd+1 ⊂ Ψd , see Gneiting (2013, Corollary 1). The following two theorems are our main results on characteristic kernels on Sd . Theorem 4.5. Let k be an isotropic kernel on Sd induced by some ψ ∈ Ψd+2 or by some ψ ∈ Ψ+ d+1 . Then the following statements are equivalent: i) k is characteristic. ii) k is universal. iii) k is strictly positive definite on Sd , that is, ψ ∈ Ψ+ d. d Theorem 4.5 shows in particular that any ψ ∈ Ψ+ d+1 induces a characteristic kernel on S . For 2 the practically most relevant case of S , all the parametric families of isotropic positive definite functions in Gneiting (2013, Table 1) are in Ψ+ 3 and thus all of them are characteristic and yield 2 strictly proper kernel scores on S by Theorem 1.1 and Theorem 4.5. Theorem 4.6. Let k be an isotropic kernel on Sd induced by ψ ∈ Ψ∞ . Then the following statements are equivalent: i) k is characteristic. ii) k is universal. iii) k is strictly positive definite, that is, ψ ∈ Ψ+ ∞. Theorem 4.6 is analogous to the result of Sriperumbudur et al. (2011, Proposition 5) for radial kernels on Rd . For the proofs of Theorems 4.5 and 4.6, we need to introduce some preliminaries. By Schoenberg (1942) the functions in Ψ∞ have a representation of the form ψ(θ) = ∞ X bn (cos(θ))n , n=0 17 θ ∈ [0, π], (20) where (bn )n is a summable sequence of non-negative coefficients termed the ∞-Schoenberg sequence of ψ. Schoenberg (1942) also showed that the functions in Ψd have a representation as ψ(θ) = ∞ X (d−1)/2 bn,d n=0 Cn (cos θ) (d−1)/2 Cn (1) , θ ∈ [0, π], where (bn,d )n is a summable sequence of non-negative coefficients termed the d-Schoenberg sequence of ψ, and Cnλ , λ > 0, n ∈ N0 are the Gegenbauer polynomials; see the Digital Library of Mathematical Functions (DLMF) (2011, 18.3.1). For λ = 0, we set Cn0 (cos θ) := cos(nθ). Definition 4.7. A sequence of non-negative real numbers (bn )n∈N0 fulfills condition b, if bn > 0 for ∞-many even and ∞-many odd integers. Remark 4.8. For ψ ∈ Ψ∞ or ψ ∈ Ψd , d ≥ 2, the induced isotropic kernel is strictly positive definite if and only if its Schoenberg sequence fulfills condition b, see Menegatto (1992, 1994) and Chen et al. (2003). For d = 1, condition b remains a necessary condition for ψ ∈ Ψ+ 1 as shown by Menegatto (1995). However, it is not sufficient any more. A simple sufficient condition for ψ ∈ Ψ+ 1 that is useful for our purposes but which is not necessary is that there is n0 such that bn,1 > 0 for all n ≥ n0 . See Menegatto et al. (2006) for a necessary and sufficient condition in the case d = 1. Lemma 4.9. If ψ ∈ Ψd+2 , then it is strictly positive definite on Sd if and only if bn,d > 0 for all n ∈ N0 . The set Ψ+ d \Ψd+2 ⊂ Ψd is not empty and also contains elements with bn,d > 0 for all n ≥ 0. To construct an explicit example, take any summable sequence (bn )n∈N0 of positive real numbers such that b2 > (d(d + 3)/2)b0 . Let ψ be the function with d-Schoenberg sequence (bn )n∈N0 . Then ψ ∈ Ψ+ d , fulfills bn,d > 0 for all n ≥ 0, and, by Gneiting (2013, Corollary 4), it is not a member of Ψd+2 . Lemma 4.10. If ψ ∈ Ψ+ d+1 , then bn,d > 0 for all n ≥ 0. After these preliminary considerations concerning Schoenberg sequences, we will now show Theorem 4.5 by applying Corollary 3.18. To this end, let (en,j )n∈N0 ,j=1,...,N (d,n) denote an orthonormal basis ofspherical harmonics on Sd . The polynomial en,j has order n and N (d, n) =   n+d − n+d−2 n n−2 ; see for example Groemer (1996, Theorem 3.1.4), where we note that he works on Sd−1 while we work on Sd . In particular, e0,0 = 1. By Groemer (1996, Theorem 3.3.3), (d−1)/2 Cn (hx, yi) (d−1)/2 Cn (1) N (d,n) X 1 = en,j (x)en,j (y), N (d, n) (21) j=1 hence any isotropic kernel on Sd induced by ψ ∈ Ψd has a Mercer representation of the form (13) with λn,j = bn,d /N (d, n). Moreover, Groemer (1996, Corollary 3.2.7) shows that the space span{en,j : n ∈ N0 , j = 1, . . . , N (d, n)} is dense in C(Sd ). Similar to Sriperumbudur et al. (2010a, Theorem 9) for translation invariant kernels on Rd , Corollary 3.18 yields the following theorem. Theorem 4.11. The kernel induced by ψ ∈ Ψd is i) universal if and only if bn,d > 0 for all n ≥ 0. 18 ii) characteristic if and only if bn,d > 0 for all n ≥ 1. For the proof of the converse of Theorem 4.6, we need the following proposition. Proposition 4.12. Let k be a kernel on Sd induced by ψ ∈ Ψ∞ . If k is characteristic, then ψ is strictly positive definite, that is ψ ∈ Ψ+ ∞. 5 5.1 Proofs Proofs related to Section 1 For the proof of Theorem 1.1 we assume that the general results on kernel mean embeddings recalled in Section 2 up to Definition 2.2 of characteristic kernels are available. Note that these results do not involve kernel scores at all, so that there is no danger of circular reasoning. Proof of Theorem 1.1: As explained around (7), the condition P ∈ Mk1 (X) ensures that Φ(P ) defined by (3) is indeed an element of H. Now (4) follows from (8), namely ZZ ZZ ZZ kΦ(P ) − Φ(Q)k2H = k(x, y) dP (x) dP (y) + k(x, y) dQ(x) dQ(y) − 2 k(x, y) dP (x) dQ(y) Z  Z =2 Sk (P, x) dQ(x) − Sk (Q, x) dQ(x) . The remaining assertions directly follow from (4). 5.2 Proofs related to Section 3.1 Proof of Theorem 3.1: iv) ⇒ iii). By assumption, Φ : M(X) → H is bijective and since H is complete, so is k · kH on M(X). iii) ⇒ ii). Consider the identity map id : (M(X), k · kTV ) → (M(X), k · kH ). Since we have already seen in Section 2 that kµkH ≤ [ · ]∼ : H → L1 (µ) ≤ kkk∞ · kµkTV holds for all µ ∈ M(X), the identity map is continuous. In addition, it is, of course, bijective, and since both (M(X), k · kTV ) and (M(X), k · kH ) are complete, the open mapping theorem, see e.g. Megginson (1998, Corollary 1.6.8) shows that both norms are equivalent. ii) ⇒ i). By the arguments of Diestel et al. (1995, page 63f) the space (M(X), k · kTV ) is a socalled L1,λ -space for all λ > 1, see Diestel et al. (1995, page 60) for a definition, while the Euclidean structure of k · kH on M(X), which is inherited from (H, k · kH ), shows that (M(X), k · kH ) is an L2,λ -space for all λ > 1. Let us now assume that dim M(X) = ∞. Then, Diestel et al. (1995, Corollary 11.7) shows that (M(X), k · kTV ) has only trivial type 1, while (M(X), k · kH ) has optimal type 2. However, the definition of the type of a space, see Diestel et al. (1995, page 217), immediately shows that equivalent norms always share their type, and hence k · kH and k · kTV are not equivalent on M(X). i) ⇒ iv). If M(X) is finite dimensional, the σ-algebra A is finite. Since k is assumed to be measurable, we then see that k can only attain finitely many different values, and consequently, the canonical feature map Φ : X → H also attains only finitely many different values, say f1 , . . . , fm ∈ H. Using Steinwart and Christmann (2008, Theorem 4.21), we conclude that H = span{f1 , . . . , fm }. We now define Ai := Φ−1 ({fi }) for i = 1, . . . , m. By construction A1 , . . . , Am 19 form a partition of X with Ai ∈ A and Ai 6= ∅ for all i = 1, . . . , m. Let us fix some xi ∈ Ai . For the corresponding Dirac measures we then have Φ(δxi ) = Φ(xi ) = fi and since Φ : M(X) → H is linear we find span{f1 , . . . , fm } ⊂ Φ(M(X)). This shows the surjectivity of the kernel embedding. Proof of Lemma 3.2: Let (µn ) ⊂ M0 (X) be a sequence that converges to some µ ∈ M(X) in k · kH . Then we have µn (X) = 0 for all n ≥ 1 and we need to show µ(X) = 0. The latter, however, follows from (10), namely Z |µ(X)| = 1X d(µn − µ) ≤ k1X kH kµn − µkH → 0 . Let us now assume that k is characteristic. Then Proposition 2.3 shows that k is strictly integrally positive definite with respect to M0 (X), and hence kµkH > 0 for all µ ∈ M0 (X) \ {0}. Now let µ ∈ M(X) \ M0 (X) and P be some probability measure on X. By (5) we then find an α ∈ R and some µ0 ∈ M0 (X) such that αP + µ0 = µ, and since µ 6∈ M0 (X) we actually have α 6= 0. Using this decomposition, and (10) we now find Z |α| 1 >0 1X d(αP + µ0 ) = kµkH = kαP + µ0 kH ≥ k1X kH k1X kH and hence Φ : M(X) → H is injective, see (9). Proof of Lemma 3.3: By the definition of the k · kH -norm and (8) we have Z Z 2 k1 (x, x′ ) + k2 (x, x′ ) dµ(x) dµ(x′ ) = kµk2H1 + kµk2H2 . kµkH = X X Moreover, if k1 is characteristic, then kµk2H1 > 0 for all µ ∈ M0 (X) \ {0} by Proposition 2.3 and the just established formula then yields kµk2H > 0 for these µ. Consequently, k is characteristic. Repeating the argument for M(X) yields the last assertion. Proof of Lemma 3.4: By the definition of the k · kH -norm and (8) we have Z Z 2 k1 (x1 , x′1 ) · k2 (x2 , x′2 ) dµ1 ⊗µ2 (x1 , x2 ) dµ1 ⊗µ2 (x′1 , x′2 ) kµ1 ⊗ µ2 kH = X1 ×X2 X1 ×X2 Z Z k1 (x1 , x′1 ) · k2 (x2 , x′2 ) dµ1 (x1 ) dµ1 (x′1 ) dµ2 (x2 ) dµ2 (x′2 ) = = X1 ×X1 X2 ×X2 kµ1 k2H1 · kµ2 k2H2 , where we note that the application of Fubini’s theorem is possible, since the kernels are bounded and the measures are finite. Now assume that k is characteristic, but, say, k1 is not strictly integrally positive definite with respect to M(X1 ). Then there exists a µ1 ∈ M(X1 ) with µ1 6= 0 but kµ1 kH1 = 0. Moreover, since dim M(X2 ) ≥ 2, the decomposition (5) gives a µ2 ∈ M0 (X2 ) with µ2 6= 0. Let us define µ := µ1 ⊗ µ2 . Our construction then yields µ 6= 0 and µ(X1 × X2 ) = µ1 (X1 )·µ2 (X2 ) = 0, that is µ ∈ M0 (X1 ×X2 ), while the already established product formula shows kµkH = kµ1 kH1 · kµ2 kH2 = 0. By Proposition 2.3 we conclude that k is not characteristic. Proof of Lemma 3.5: Let Φ1 denote the canonical feature map of the kernel k1 = 1X×X and H1 its RKHS. Moreover, we write H + 1 for the RKHS of k + 1. For later use, we note that (8) implies hΦ1 (µ), Φ1 (µ0 )iH1 = 0 for all µ ∈ M(X) and µ0 ∈ M0 (X). iii) ⇒ ii). Let us fix a P ∈ M ∩ M1 (X). Similar to (5) we then have M = RP ⊕ M0 . Indeed, “⊃” and RP ∩ M0 = {0} are trivial and for µ ∈ M it is easy to see that µ − µ(X)P ∈ M0 . 20 Now, we need to prove kµkH+1 > 0 for all µ = αP + µ0 ∈ RP ⊕ M0 with µ 6= 0. By iii) we already know this in the case α = 0, and thus we further assume α 6= 0. Then Lemma 3.3 and (8) together with our initial remark yield kµk2H+1 = kµk2H + hΦ1 (µ), Φ1 (µ)iH1 = kµk2H + α2 kP k2H1 + 2αhΦ1 (P ), Φ1 (µ0 )iH1 + kµ0 k2H1 = kµk2H + α2 and since α 6= 0, we conclude kµk2H+1 > 0. ii) ⇒ iii). This is trivial. iii) ⇔ i). For µ0 ∈ M0 ⊂ M0 (X), Lemma 3.3 together with our initial remark shows kµ0 k2H+1 = kµ0 k2H +kµ0 k2H1 = kµ0 k2H . From this equality the equivalence immediately follows. Proof of Theorem 3.6: For some fixed P ∈ M1 (X) we consider the map π : RP ⊕ M0 (X) → M(X) αP + µ0 7→ µ0 . By (5), π is a linear map π : M(X) → M(X) with π 2 = π and ran π = M0 (X), and hence a projection onto M0 (X). Moreover, M0 (X) is k · kH -closed by assumption and therefore π is k·kH -continuous, see Megginson (1998, Theorem 3.2.14). Let us now assume that k·kH and k·kTV were equivalent on M0 (X). Our goal is to show that this assumption implies the equivalence of k · kH and k · kTV on M(X). To this end we fix some sequence (µn ) ∈ M(X) and some µ ∈ M(X) with kµn − µkH → 0. By (5) we then find αn , α ∈ R with µn = αn P + π(µn ) and µ = αP + π(µ). Using the k · kH -continuity of π, we then find kπ(µn ) − π(µ)kH → 0, and since we assumed that k · kH and k · kTV are equivalent on M0 (X), we conclude that kπ(µn ) − π(µ)kTV → 0. In addition, we have kP kH > 0 by the injectivity of the kernel embedding, and therefore |αn − α| · kP kH ≤ kµn − µkH + kπ(µn ) − π(µ)kH → 0 shows that αn → α. Combining these considerations, we find kµn − µkTV ≤ |αn − α| · kP kTV + kπ(µn ) − π(µ)kTV → 0 . Summing up, we have seen that kµn − µkH → 0 implies kµn − µkTV → 0 for every sequence (µn ) ∈ M(X), and consequently, the identity map id : (M(X), k · kH ) → (M(X), k · kTV ) is continuous. This yields k·kTV ≤ k id k·k·kH on M(X), and since we also have k·kH ≤ kkk∞ ·k·kTV we see that k·kH and k·kTV are indeed equivalent on M(X). This, however, contradicts Theorem 3.1, and hence our assumption that k · kH and k · kTV were equivalent on M0 (X) is false. Proof of Theorem 3.7: Let us first assume that 1X ∈ H. By Lemma 3.2 we then see that the kernel embedding Φ : M(X) → H is injective, and Theorem 3.6 thus shows that k · kH and k · kTV are not equivalent on M0 (X). Since k · kH is dominated by k · kTV , we consequently find a sequence (µn ) ⊂ M0 (X) and some δ > 0 such that kµn kH → 0 and inf n≥1 kµn kTV ≥ δ. − + − Let us consider the Hahn-Jordan decomposition µn = µ+ n − µn with µn , µn ∈ M+ (X). Since + − µn ∈ M0 (X), we have µn (X) = µn (X). We define Q(1) n := µ+ n µ+ n (X) and 21 Q(2) n := µ− n . µ+ n (X) (1) (2) Clearly, this yields Qn , Qn ∈ M1 (X) and − µ+ n (X) + µn (X) = 2. µ+ n (X) (2) kQ(1) n − Qn kTV = Moreover, we have (2) kQ(1) n − Qn kH = kµn kH kµn kH ≤ 2δ−1 kµn kH , = 1 + kµ k µn (X) n TV 2 (1) (2) and by choosing n sufficiently large we can therefore guarantee kQn − Qn kH ≤ ε. Let us now consider the case 1X 6∈ H. By Lemma 3.3 we then see that the kernel k̃ := k + 1 is characteristic. Let us write H1 := R1X for the RKHS of the constant kernel k1 := 1X×X . Then x 7→ (k(x, ·), k1 (x, ·)) ∈ H × H1 is a feature map of the kernel k + 1 in the sense of (Steinwart and Christmann, q 2008, Definition 4.1) if H × H1 is equipped with the usual Hilbert space norm k(w, w1 )k := kwk2H + kw1 k2H1 and consequently an application of (Steinwart and Christmann, 2008, Theorem 4.21) shows that the RKHS H̃ of k + 1 is given by H̃ = H + H1 . The latter yields 1X ∈ H̃. The already considered case thus shows that for all ε > 0 there exist distributions Q1 , Q2 ∈ M1 (X) such that kQ1 − Q2 kTV = 2 and kQ1 − Q2 kH̃ ≤ ε. Moreover, for µ := Q1 − Q2 ∈ M0 (X) we see by Lemma 3.3 and (8) that Z Z ε2 ≥ kQ1 −Q2 k2H̃ = kµk2H̃ = kµk2H + 1X×X dµ dµ = kµk2H +µ(X)·µ(X) = kµk2H = kQ1 −Q2 k2H we have shown the assertion in the second case, too. Proof of Corollary 3.8: Let us fix some P ∈ M1 (X), δ ∈ (0, 1] and ε ∈ (0, 2δ). By Theorem 3.7 there then exist distributions Q̃1 , Q̃2 ∈ M1 (X) with kQ̃1 − Q̃2 kTV = 2 and kQ̃1 − Q̃2 kH ≤ ε. We define Qi := (1 − δ)P + δQ̃i ∈ M1 (X) for i = 1, 2. A simple calculation then shows that kQ1 − Q2 kTV = δkQ̃1 − Q̃2 kTV = 2δ , and analogously, we find kQ1 −Q2 kH ≤ δε ≤ ε. Finally, we have kP −Qi kTV = δkP − Q̃i kTV ≤ 2δ, and hence we obtain the assertion for δ̃ := 2δ. Proof of Lemma 3.9: Let us first assume that µ1 , µ2 ∈ M+ (X). For x, x′ ∈ X we define k̃(x, x′ ) := X i∈I λi |ei (x)| · |ei (x′ )| . Then the Cauchy-Schwarz inequality together with (13) gives X X X k̃(x, x′ ) = λi |ei (x)| · |ei (x′ )| ≤ λi e2i (x) · λi e2i (x′ ) = k(x, x) · k(x′ , x′ ) i∈I i∈I i∈I for all x, x′ ∈ X, and since k is bounded, we conclude that k̃ is also bounded, and hence k̃ ∈ L2 (µ1 ⊗ µ2 ). Moreover, for finite J ⊂ I and x, x′ ∈ X we have X i∈J λi ei (x)ei (x′ ) ≤ k̃(x, x′ ) . 22 Using Fubini’s theorem, (13), Lebesgue’s dominated convergence theorem, and yet another time Fubini’s theorem, we thus find Z Z Z X λi ei (x)ei (x′ ) d(µ1 ⊗µ2 )(x, x′ ) k(x, x′ ) dµ1 (x) dµ2 (x′ ) = X X×X i∈I X = XZ λi ei (x)ei (x′ ) d(µ1 ⊗µ2 )(x, x′ ) XZ Z λi ei (x)ei (x′ ) dµ1 (x) dµ2 (x′ ) . X×X i∈I = X i∈I X From the latter the assertion immediately follows. − Finally, let us assume that µ1 , µ2 ∈ M(X). Using the Hahn decomposition µ1 = µ+ 1 − µ1 and − µ2 = µ+ 2 − µ2 as well as the fact that the expressions on the left and right of the desired equation are linear in the involved measures, we then obtain the assertion by the already established case. Proof of Theorem 3.10: Clearly, the signed measure µ := P − Q has the ν-density h − g and we have [h − g]∼ ∈ L2 (ν) ∩ L1 (ν). Now we find (15) by (8) and Lemma 3.9, namely Z Z Z 2 X ′ ′ 2 2 k(x, x ) dµ(x) dµ(x ) = λi · ei dµ γk (P, Q) = kµkH = X X = X i∈I ii) ⇒ i). We split f into f = know that f+ X i∈I f− λi · Z X ei · (h − g) dν 2 . f+ − with ≥ 0 and f − ≥ 0. By our assumption we then Z Z + f − dν > 0 f dν = c := X X For δ > 0, h ∈ ∆(ν) and P := h dν ∈ P2 (ν) we define h1 := (1 + δc)−1 (h + δf + ) and h2 := (1 + δc)−1 (h + δf − ) and consider the corresponding measures Q1 := h1 dν and Q2 := h2 dν. The construction immediately ensures Q1 , Q2 ∈ P2 (ν). Moreover, we have Z Z h + δch h + δf + |h − h1 | dν = kP − Q1 kTV = − dν 1 + δc X 1 + δc X Z δch − δf + = dν 1 + δc X Z δ |ch| + |f + | dν ≤ 1 + δc X 2δc = , 1 + δc and analogously we find kP − Q2 kTV ≤ 2δc/(1 + δc). In addition, we have Z Z 1 δ 2δc + − kQ1 − Q2 kTV = |δf − δf | dν = |f | dν = 1 + δc X 1 + δc X 1 + δc and by using that {2δc/(1 + δc) : δ > 0} = (0, 2) we obtain the norm conditions for Q1 and Q2 . Finally, (15) yields X δ X λi h[f ]∼ , [ei ]∼ i2L2 (ν) = 0 , γk2 (Q1 , Q2 ) = λi h[h1 − h2 ]∼ , [ei ]∼ i2L2 (ν) = 1 + δc i∈I i∈I 23 which shows i) as well as the final assertion. i) ⇒ iii). Let Q1 and Q2 be according to i) and [h1 ]∼ , [h2 ]∼ ∈ ∆(ν) be their ν-densities. Then Q1 6= Q2 implies [h1 ]∼ 6= [h2 ]∼ , and (15) yields X 2 λi [h1 − h2 ]∼ , [ei ]∼ L2 (ν) . 0 = γk2 (P, Q) = i∈I Since λi > 0 for all i ∈ I, we then conclude that h[h1 − h2 ]∼ , [ei ]∼ i2L2 (ν) = 0 for all i ∈ I, which in turn implies iii). iii) ⇒ ii). We define f := h1 − h2 . Clearly, we have [f ]∼ ∈ L2 (ν) ∩ L1 (ν) and f 6= 0. Moreover, h1 , h2 ∈ ∆(ν) gives Z Z Z f dν = X X h1 dν − X h2 dν = 1 − 1 = 0 . Finally, the equality h[h1 ]∼ , [ei ]∼ iL2 (ν) = h[h2 ]∼ , [ei ]∼ iL2 (ν) , which holds for all i ∈ I, implies h[f ]∼ , [ei ]∼ iL2 (ν) = 0 for all i ∈ I, and hence [f ]∼ ∈ [H]⊥ ∼. Proof of Corollary 3.11: Let hj := (1X + αej ) be the ν-density of Qj . Using kej k∞ ≤ c∞ and α = c−1 ∞ , we then find hj ≥ 0, and since [ei0 ]∼ ⊥ [ej ]∼ we further find Z Z ej ei0 dν = 1 . hj dν = 1 + α X X Consequently, Qj is a probability measure. Moreover, we find Z Z |αej | dν ≥ c1 c−1 1X − hj dν = kP − Qj kTV = ∞ X X and (15) implies kP − Qj k2H = X i∈I λi h[1X − hj ]∼ , [ei ]∼ i2L2 (ν) = X i∈I λi h[−αej ]∼ , [ei ]∼ i2L2 (ν) = λj c−2 ∞ . This shows the assertion. Proof of Corollary 3.12: In both cases it suffices to show ii) of Theorem 3.10. R i). Since codim[H]∼ ≥ 2 there exist linearly independent [f1 ]∼ , [f2 ]∼ ∈ [H]⊥ ∼ . If X f2 dν = 0 R then there is nothing left to prove, and if X f2 dν 6= 0 then a quick calculation shows that R f1 dν · f2 f := f1 − RX X f2 dν is the desired function. ⊥ ii). R Since codim[H]∼ ≥ 1, there exists an [f ]∼ ∈ [H]∼ \ {0} and from 1X ∈ H we conclude that X f dν = h[f ]∼ , [1X ]∼ iL2 (ν) = 0. 5.3 Proofs related to Section 3.2 Proof of Theorem R3.13: We fix a C0 (X)-kernel k and a finite signed measure µ ∈ M(X) \ M∗ (X). Then f 7→ X f dµ defines a bounded linear operator C0 (X) → R, and by (14) there thus exists a µ∗ ∈ M∗ (X) such that Z Z f dµ∗ f dµ = X X 24 for all f ∈ C0 (X). By H ⊂ C0 (X) and (10) we conclude that kµ−µ∗ kH = 0 while our construction ensures µ 6= µ∗ . Proof of Theorem 3.14: Using the already observed identity I ′ = Φ and Megginson (1998, Theorem 3.1.17) we see that I has a dense image if and only if Φ : M∗ (X) → H is injective. By (9) we then conclude that k is universal if and only if k is strictly integrally positive definite with respect to M∗ (X). Proof of Theorem 3.15: i) ⇔ iii). This has been shown in Steinwart et al. (2006, Theorem 2). Moreover, it is well-known that compact metrizable Hausdorff spaces are Polish. The equality M∗ (X) = M(X) then follows from Ulam’s theorem, see e.g. Bauer (2001, Lemma 26.2). i) ⇒ ii). If there exists a universal kernel k, then we have already shown that M∗ (X) = M(X). Consequently, k is strictly integrally positive definite with respect to M(X) by Theorem 3.14, and thus characteristic by Proposition 2.3. ii) ⇒ i). Assume that there exists a characteristic kernel k. By Proposition 2.3 we know that k is strictly integrally positive definite with respect to M0 (X). Then k + 1 is a bounded and continuous kernel, which is strictly integrally positive definite with respect to M(X) by Lemma 3.5. Using M∗ (X) ⊂ M(X) and Theorem 3.14 we conclude that k is universal. Proof of Corollary 3.16: i) ⇒ ii). Since (X1 × X2 , τ1 ⊗ τ2 ) is a compact metrizable space, we have M∗ (X1 × X2 ) = M(X1 × X2 ), and hence the implication follows from Proposition 2.3 and Theorem 3.14. ii) ⇒ iii). Since (X1 , τ1 ) and (X2 , τ2 ) are assumed to be non-trivial, we find dim M(X1 ) ≥ 2 and dim M(X2 ) ≥ 2. Now iii) follows from Lemma 3.4 and Theorem 3.14. iii) ⇒ i). This can be shown by the theorem of Stone-Weierstraß, see e.g. Steinwart et al. (2016, Lemma A.5) for details. Proof of Theorem 3.17: Before we begin, we write E := span{ei : i ∈ I} and denote the RKHS of k by H. ii) ⇔ iii). Via the isomorphism (14) between C0 (X)′ and M∗ (X) we easily see that ii) is equivalent to the statement ϕ′|E = 0 =⇒ ϕ′ = 0 for all ϕ′ ∈ C0 (X)′ and by Hahn-Banach’s theorem, see e.g. Dunford and Schwartz (1958, p. 64, Corollary II.3.13), the latter is equivalent to iii). iii) ⇒ i). The chain of inclusions E ⊂√H ⊂ C0 (X) immediately√gives the desired implication. i) ⇒ iii). Clearly, we have E = span{ λi ei : i ∈ I} and since ( λi ei )i∈I is an ONB of H, we H conclude that E = H. Let us now fix an ε > 0 and an f ∈ C0 (X). Since k is universal, there then exists an h ∈ H with kf − hk∞ ≤ ε and for this h our initial consideration yields an e ∈ E with ke − hkH ≤ ε. Combining both estimates we find kf − ek∞ ≤ kf − hk∞ + kh − ek∞ ≤ ε + kkk∞ kh − ekH ≤ (1 + kkk∞ ) ε , and hence E is dense in C0 (X). To check the last statement, let us assume that E is dense in C0 (X). Using that ν is finite we then see that E is also dense in C0 (X) with respect to k · kL2 (ν) , and since C0 (X) is dense in L2 (ν) by the regularity of ν, see e.g. Bauer (2001, Theorem 29.14), we conclude that E is dense in L2 (ν). This shows that [E]∼ = span{[ei ]∼ : i ∈ I} is dense in L2 (ν), and therefore ([ei ]∼ )i∈I is indeed an ONB of L2 (ν). Proof of Corollary 3.18: i). Let us first assume that λi > 0 for all i ∈ I. By Steinwart and Scovel (2012, Lemma 2.6 and Theorem 2.11) we then see that k is of the form considered in Theorem 3.17, and since span{ei : i ∈ I} is dense in C0 (X) by our assumption, we conclude that 25 k is universal. To show the converse implication we set I ∗ := {i ∈ I : λi > 0} and assume that k is universal but I ∗ 6= I. By the definition of I ∗ we have X k(x, x′ ) = λi ei (x)ei (x′ ) i∈I ∗ for all x, x′ ∈ X, and by Steinwart and Scovel (2012, Lemma 2.6 and Theorem 2.11) we thus conclude that (ei )i∈I∗ is the family considered in Theorem 3.17. Consequently, this sub-family ([ei ]∼ )i∈I ∗ is already an ONB in L2 (ν), which, however, is impossible for I ∗ 6= I. ii). Let us first assume that k is characteristic and that there exists an j 6= i0 with λj = 0. We ν(X) < ∞. Moreover, [ej ]∼ ⊥ [ei ]∼ for all i 6= j implies both R have [ej ]∼ ∈ L1 (ν) because ⊥ , where in the last step we used (12). Consequently, k cannot be e dν = 0 and [e ] ∈ [H] j ∼ ∼ X j characteristic by Theorem 3.10. Conversely, assume that λi > 0 for all i 6= i0 . If λi0 > 0 then k is actually universal by the already established part i), and thus characteristic. If λi0 = 0, then the kernel X λi ei (x)ei (x′ ) + ei0 (x)ei0 (x′ ) k(x, x′ ) + 1 = i6=i0 is universal by part i) and thus k is characteristic by Theorem 3.14, Lemma 3.5, Proposition 2.3, and M∗ (X) = M(X). iii). If λi > 0 for all i ∈ I, then i) shows that k is universal, and by Theorem 3.14, Proposition 2.3, and M∗ (X) = M(X) we conclude that k is characteristic. To show the converse implication, we assume that k is characteristic and there is an i0 ∈ I with λi0 = 0. Since ([ei ]∼ )i∈I is an ONS in L2 (ν) and [ei0 ]∼ 6∈ [H]∼ = span{[ei ]∼ : λi > 0}, see (12), we conclude that [ei0 ]∼ ∈ [H]⊥ ∼ . On the other hand, 1X ∈ H gives [1X ]∼ ∈ [H]∼ , and thus we find Z ei0 dν . 0 = h[ei0 ]∼ , [1X ]∼ iL2 (ν) = X Finally, [ei0 ]∼ 6= 0 is obvious and [ei0 ]∼ ∈ L1 (ν) follows from ν(X) < ∞, so that Theorem 3.10 shows that k is not characteristic. 5.4 Proofs related to Section 4.1 Proof of Lemma 4.1: To check that (e∗i )i∈I is an ONS, we first observe that the equivalences i = j ⇔ −i = −j and i = −j ⇔ −i = j imply for ai , aj ∈ {−1, 1} that h[ei + ai ēi ]∼ , [ej + aj ēj ]∼ iL2 (G,C) = h[ei ]∼ + ai [e−i ]∼ , [ej ]∼ + aj [e−j ]∼ iL2 (G,C) = h[ei ]∼ , [ej ]∼ i + aj h[ei ]∼ , [e−j ]∼ i + ai h[e−i ]∼ , [ej ]∼ i + ai aj h[e−i ]∼ , [e−j ]∼ i = (1 + ai aj )δi,j + (ai + aj )δi,−j . Let us first consider i, j ∈ I0 . Then we have i = j if and only if i = −j, that is δi,j = δi,−j , and thus we find 1 h[e∗i ]∼ , [e∗j ]∼ iL2 (G) = h[ei + ēi ]∼ , [ej + ēj ]∼ iL2 (G,C) = δi,j . 4 Similarly, for i, j ∈ I+ we cannot have δi,−j = 1, since this would imply i ∈ I− , and hence we obtain 1 h[e∗i ]∼ , [e∗j ]∼ iL2 (G) = h[ei + ēi ]∼ , [ej + ēj ]∼ iL2 (G,C) = δi,j , 2 26 and for i, j ∈ I− we find by an analogous reasoning that 1 h[e∗i ]∼ , [e∗j ]∼ iL2 (G) = h[ei − ēi ]∼ , [ej − ēj ]∼ iL2 (G,C) = δi,j . 2 For the mixed cases, in which i and j belong to different partition elements I0 , I+ , or I− we clearly have i 6= j, and hence the above calculation reduces to h[ei + ai ēi ]∼ , [ej + aj ēj ]∼ iL2 (G,C) = (ai + aj )δi,−j . Now, if i ∈ I0 and j 6∈ I0 , then we cannot have i = −j and hence we obtain h[e∗i ]∼ , [e∗j ]∼ iL2 (G) = 0. For the same reason we find for i ∈ I+ and j ∈ I− with i 6= −j that h[e∗i ]∼ , [e∗j ]∼ iL2 (G) = 0. Finally, for i ∈ I+ and j ∈ I− with i = −j we have h[e∗i ]∼ , [e∗j ]∼ iL2 (G) = 1 h[ei + ēi ]∼ , i · [ej − ēj ]∼ iL2 (G,C) = −i · (1 − 1) · δi,−j = 0 , 2 and therefore we conclude that ([e∗i ]∼ )i∈I is an ONS in L2 (G). Our next goal is to show that span{e∗i : i ∈ I} is dense in C(G). To this end, we fix an f ∈ C(G) and an ε > 0. Since f ∈ C(G, C) and (ei )i∈I , is dense in C(G, C), there then exists a finite set J ⊂ I and (aj )j∈J ⊂ C such that X aj ej (x) − f (x) < ε , sup x∈G j∈J and from this conclude that  X X X aj ej (x) − Re f (x) Re aj Re ej (x) − Im aj Im ej (x) − f (x) = sup Re sup x∈G j∈J x∈G j∈J ≤ sup j∈J X x∈G j∈J aj ej (x) − f (x) < ε. In other words, the span of (Re ei )i∈I ∪ (Im ei )i∈I is dense in C(G). However, our initial considerations showed that Re ei = Re e−i and Im ei = − Im e−i for all i ∈ I as well as Im ei = 0 for all i ∈ I0 , and therefore span{e∗i : i ∈ I} is dense in C(G), too. Finally, ν is regular, and therefore C(G) is dense in L2 (G), see e.g. Bauer (2001, Theorem 29.14). Consequently, span{e∗i √: i ∈ I} is dense in L2 (G), and therefore (e∗i )i∈I is an ONB of L2 (G). The estimate ke∗i k∞ ≤ 2 follows from |ei (x)| = 1 for all x ∈ G. Proof of Lemma 4.2: Let ν be the Haar measure of G. i) ⇒ ii). For a character ei ∈ Ĝ and x ∈ G a simple calculation shows Z Z Z ′ ′ ′ ′ ′ ′ κ(x′ )ei (x + x′ ) dν(x′ ) κ(−x + x )ei (x ) dν(x ) = k(x, x )ei (x ) dν(x ) = G G G = λi ei (x) , where λi := G κ(x′ )ei (x′ ) dν(x′ ). Now, since k is R-valued, the integral operator TkC : L2 (G, C) → L2 (G, C) is self-adjoint and the previous calculation shows that each character ei gives an eigenvector [ei ]∼ ∈ L2 (G, C) of TkC with eigenvalue λi . Using that eigenvalues of self-adjoint operators are real numbers, we then find R Tk [Re ei ]∼ = TkC [Re ei ]∼ = λi [Re ei ]∼ Tk [Im ei ]∼ = TkC [Im ei ]∼ = λi [Im ei ]∼ 27 for all i ∈ I. Now recall that for i ∈ I0 we have Im ei = 0 and therefore these functions Im ei are not eigenvectors of Tk : L2 (G) → L2 (G). By Lemma 4.1 we thus conclude that ([e∗i ]∼ )i∈I is an ONB of eigenvectors of Tk with corresponding eigenvalues (λi )i∈I , and in particular, there are no further eigenvalues than these. Moreover, (λi )i∈I is summable since (11) holds. Moreover, for i ∈ I we have λi = λ−i , where we note that for i 6∈ I0 the corresponding eigenvalues have thus a geometric multiplicity of at least two. Since ν is finite and strictly positive, we thus see that k enjoys a Mercer representation (13) for the index set I ∗ := {i ∈ I : λi > 0} and the sub-family (e∗i )i∈I ∗ . Moreover, for x, x′ ∈ G this representation yields X k(x, x′ ) = λi e∗i (x)e∗i (x′ ) λi >0 = X λi Re ei (x) Re ei (x′ ) +2 X i∈I0 :λi >0 i∈I+ :λi >0 = X  λi Re ei (x) Re ei (x′ ) + Im ei (x) Im ei (x′ ) λi Re ei (−x′ + x) + 2 i∈I0 :λi >0 = X X λi Re ei (−x′ + x) i∈I+ :λi >0 λi Re ei (−x′ + x) , λi >0 where in the second √ to last step we used (16) and the last step rests on Re ei = Re e−i . In addition, ∗ supi∈I kei k∞ ≤ 2 together with the summability of (λi )i∈I quickly shows that the series converge both absolutely and uniformly. Finally, the continuity of k follows from the uniform convergence in (18) and e∗i ∈ C(G) for all i ∈ I. ii) ⇒ i). We first observe that Lemma 4.1 together with Steinwart and Scovel (2012, Lemma 2.6) shows that (18) does indeed define a kernel k, and its translation invariance is built into the √ ∗ construction. Clearly, k is measurable and supi∈I kei k∞ ≤ 2 together with the summability of (λi )i∈I shows that k is bounded. Proof of Theorem 4.3: The equivalences i) ⇔ iv) ⇔ vi) have already been shown in Theorem 3.15, and iii) ⇒ iv) is trivial. In addition, if one of the conditions iii) - vi) are satisfied, Theorem 3.15 shows that M∗ (G) = M(G), where in the case of v) we additionally need Lemma 4.2. Therefore Lemma 3.5 together with Proposition 2.3 and Theorem 3.14 shows that a continuous kernel k is characteristic if and only if k + 1 is universal. This yields the equivalences iv) ⇔ vi), and by the last statement in Lemma 4.2, also iii) ⇔ v). It thus suffices to show that ii) ⇒ iii) and i) ⇒ ii). ii) ⇒ iii). If Ĝ is at most P countable, so is I, and hence there exists a family (λi )i∈I with λi > 0 for all i ∈ I and i∈I λi < ∞. The kernel k, which is constructed by (18), is then translation-invariant and continuous, and by Corollary 3.18 it is also universal. i) ⇒ ii). By Schurle (1979, Theorem 3.2.11 and Corollary 3.3.2) we know that G is completely regular and hence Conway (1990, Theorem V.6.6.) shows that G is metrizable if and only if C(G) is separable. We therefore see that C(G) is separable. In addition, since ν is regular, Bauer (2001, Theorem 29.14) shows that C(G) is dense in L2 (G). Consequently, L2 (G) is separable, and since (e∗i )i∈I is an ONB of L2 (G), we conclude that I, and thus Ĝ, is at most countable. Proof of Corollary 4.4: Since the Haar measure ν on G is a finite, regular, and strictly positive Borel measure, we see by Lemma 4.1 that all assumptions of Corollary 3.18 are satisfied. Moreover, we have e∗0 = 1G . Now the assertions follow from Corollary 3.18. 28 5.5 Proofs related to Section 4.2 Proof of Proof of Theorem 4.5: We first consider the case ψ ∈ Ψd+2 . If the kernel k on Sd induced by ψ is strictly positive definite then Lemma 4.9 implies that bn,d > 0 for all n ≥ 0. By Theorem 4.11, k is then universal and characteristic. Conversely, if k is universal or characteristic then bn,d > 0 for all n ≥ 1 by Theorem 4.11, thus it is strictly positive definite by Remark 4.8. + In the case ψ ∈ Ψ+ d+1 , we have ψ ∈ Ψd , and hence it suffices to show that k is universal and characteristic. This, however, follows from Lemma 4.10 and Theorem 4.11. Proof of Theorem 4.6: Suppose that the kernel k is induced by ψ ∈ Ψ+ ∞ . Then bn,d > 0 for all n ∈ N0 by Lemma 4.10 and hence the kernel is universal and characteristic by Theorem 4.11. Suppose now that k is characteristic. By Proposition 4.12 we obtain that ψ ∈ Ψ+ ∞. Proof of Lemma 4.9: It is clear from the results of (Chen et al., 2003) that bn,d > 0 for all n ∈ N0 is a sufficient condition for ψ being strictly positive definite. Suppose now that ψ ∈ Ψd+2 ∩ Ψ+ d. Gneiting (2013, Corollary 4) implies that if b2k+2,d > 0 (b2k+1,d > 0) for some k, then b2k′ +2,d > 0 (b2k′ +1,d > 0) for all k′ ≤ k. This yields the claim by Remark 4.8. Proof of Lemma 4.10: This is shown in Gneiting (2013, Proof of Corollary 1(b)). Proof of Proposition 4.12: Assume that ψ is not strictly positive definite, or, by Remark 4.8, does not satisfy condition b. We will show that it cannot be characteristic. First, we construct a special class of probability densities p on Sd such that we explicitly know the integrals Z ck,j (p) := Sd ek,j (y)p(y) dσ(y) (22) with respect to the basis of spherical harmonics. Here, σ is the surface area measure on Sd R normalized such that Sd dσ = 1. Fix v0 ∈ Sd and a ∈ [−1, 1]\{0}. We have |Cn(d−1)/2 (x)| ≤ Cn(d−1)/2 (1) , x ∈ [−1, 1], see (DLMF, 18.14.4 for d ≥ 2), and therefore, for all n ≥ 1, x ∈ Sd , we have (d−1)/2 pn,a (x) := 1 + a Cn (hv0 , xi) (d−1)/2 Cn (1) ≥ 0, (23) R (d−1)/2 (hv0 , ·i) is a spherical and Sd pn,a (x) dσ(x) = 1, where for the last equality we used that Cn harmonics of degree n and thus orthogonal to e0,0 = 1Sd . Consequently, pn,a is a probability density function on Sd with respect to the surface area measure σ. Note that pn,a and pn′ ,a induce different probability measures on Sd for n 6= n′ . We obtain ck,j (pn,a ) = δk,0 + δk,n a ek,j (v0 ) N (d, k) using (21), and the Funk-Hecke Theorem (Groemer, 1996, Theorem 3.4.1) yields that Z hx, yin ek,j (y) dσ(y) = λnk ek,j (x), x ∈ Sd , j = 1, . . . , N (d, k), Sd where λnk Γ((d + 1)/2) (d−1)/2 −1 (1) C = √ πΓ(d/2) k Z 1 −1 29 (d−1)/2 t n Ck (t)(1 − t2 )(d−2)/2 dt. (24) Since the family (en,j )n∈No ,j=1,...,N (d,k) is an ONB of L2 (Sd ), we obtain the following Mercer representation of the bounded and continuous kernel (x, y) 7→ hx, yin on Sd n hx, yi = (d,k) ∞ NX X λnk ek,j (x)ek,j (y) , (25) k=0 j=1 where for each x the convergence is uniform in y by Steinwart and Scovel (2012, Corollary 3.5). (d−1)/2 is even for k even and odd for k odd, one obtains that λnk = 0 if k − n is odd. Using that Ck (d−1)/2 are orthogonal with respect to the weight function (1 − t2 )(d−2)/2 DLMF, 18.3.1, The Ck therefore λnk = 0 for k > n. Finally, the formula DLMF, 18.17.37 for the Mellin transform yields that π2d−n−1 Γ(k + d − 1)Γ(n + 1) λnk = > 0 k ≤ n, k − n even. k+d+n k!Γ( d−1 )Γ( n−k+2 ) 2 )Γ( 2 2 For a probability density p on Sd , we have by (20) and (25) for x ∈ Sd , Z S d k(x, y)p(y) dσ(y) = (d,k) ∞ X n NX X bn λnk ek,j (x)ck,j (p) n=0 k=0 j=1 = ∞ X N (d,k) zk k=0 X ck,j (p)ek,j (x), j=1 P n where zk = ∞ n=k bn λk and ck,j (p) is defined at (22). If bn = 0 for all even n ≥ n0 then zk = 0 for all even k ≥ n0 . If bn = 0 for all odd n ≥ n0 then zk = 0 for all odd k ≥ n0 . Let us start with the case that bn = 0 for all even n ≥ n0 , i.e. zk = 0 for all even k ≥ n0 . For all m ∈ N0 , we have ck,j (p2m,a ) = 0 for k odd by (24), where pn,a is defined at (23). Hence, for 2m ≥ n0 and x ∈ Sd , we obtain Z k(x, y)p2m,a (y) dσ(y) Sd = n0 X zk k=0,k even N (d,k)  X j=1  a ek,j (v0 ) ek,j (x) = z0 , δk,0 + δk,2m N (d, k) which shows that the kernel mean embedding maps all these densities to the constant function with value z0 . Consequently, k is not characteristic. Suppose now that bn = 0 for all odd n ≥ n0 , i.e. zk = 0 for all odd k ≥ n0 . For all m ∈ N0 , we have ck,j (p2m+1,a ) = δk,0 for k even by (24). Hence, for 2m + 1 ≥ n0 and x ∈ Sd , we obtain Z k(x, y)p2m+1,a (y) dσ(y) Sd = z0 + n0 X k=1,k odd N (d,k) zk X δk,2m+1 j=1 a ek,j (v0 )ek,j (x) = z0 , N (d, k) which again shows that the kernel mean embedding maps all these densities to the constant function with value z0 . Consequently, k is not characteristic. 30 References H. Bauer. Measure and Integration Theory. De Gruyter, Berlin, 2001. C. Berg, J. P. R. Christensen, and P. Ressel. Harmonic Analysis on Semigroups. Springer, New York, 1984. S. Bochner. Hilbert distances and positive definite functions. Ann. of Math., 42:647–656, 1941. D. Chen, V. A. Menegatto, and X. Sun. A necessary and sufficient condition for strictly positive definite functions on spheres. Proc. Amer. Mat. Soc., 131:2733–2740, 2003. W. Chen, B. Wang, and H. Zhang. Universalities of reproducing kernels revisited. Appl. Anal., 95:1776– 1791, 2016. J. B. Conway. A Course in Functional Analysis. Springer-Verlag, New York, 2nd edition, 1990. J. Diestel and J. J. Uhl. Vector Measures. American Mathematical Society, Providence, 1977. J. Diestel, H. Jarchow, and A. Tonge. Absolutely Summing Operators. Cambridge University Press, Cambridge, 1995. Digital Library of Mathematical Functions (DLMF). Release date 2011-08-29. National Institute of Standards and Technology from http://dlmf.nist.gov/, 2011. N. Dunford and J. T. Schwartz. Linear Operators, Part I: General Theory. Interscience Publishers, Inc., New York, 1958. G. B. Folland. A course in Abstract Harmonic Analysis. CRC Press, Boca Raton, FL, 1995. K. Fukumizu, A. Gretton, X. Sun, and B. Schölkopf. Kernel measures of conditional dependence. In J. C. Platt, D. Koller, Y. Singer, and S. T. Roweis, editors, Advances in Neural Information Processing Systems 20, pages 489–496. 2008. K. Fukumizu, B. Sriperumbudur, A. Gretton, and B. Schölkopf. Characteristic kernels on groups and semigroups. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou, editors, Advances in Neural Information Processing Systems 21, pages 473–480. Curran Associates, Inc., 2009. T. Gneiting. Strictly and non-strictly positive definite functions on spheres. Bernoulli, 19:1327–1349, 2013. T. Gneiting and M. Katzfuss. Probabilistic forecasting. Ann. Rev. Stat. Appl., 1:125–151, 2014. T. Gneiting and A. E. Raftery. Strictly proper scoring rules, prediction, and estimation. J. Amer. Statist. Assoc., 102:359–378, 2007. A. Gretton, K.M. Borgwardt, M. Rasch, B. Schölkopf, and A.J. Smola. A kernel method for the two-sampleproblem. In P. B. Schölkopf, J. C. Platt, and T. Hoffman, editors, Advances in Neural Information Processing Systems 19, pages 513–520. MIT Press, 2007. H. Groemer. Geometric applications of Fourier series and sperical harmonics. Cambridge University Press, New York, 1996. E. Hewitt and K.A. Ross. Abstract Harmonic Analysis. Vol. I. Springer-Verlag, Berlin, 1963. E. Hewitt and K.A. Ross. Abstract Harmonic Analysis. Vol. II. Springer-Verlag, Berlin, 1970. E. Hewitt and K. Stromberg. Real and Abstract Analysis. A Modern Treatment of the Theory of Functions of a Real Variable. Springer-Verlag, New York, 1965. 31 K.H. Hofmann and S.A. Morris. The Structure of Compact Groups: A Primer for the Student – A Handbook for the Expert. De Gruyter, Berlin, 3rd edition, 2013. R. E. Megginson. An Introduction to Banach Space Theory. Springer-Verlag, New York, 1998. V. A. Menegatto. Interpolation on spherical spaces. PhD thesis, University of Texas at Austin, 1992. V. A. Menegatto. Strictly positive definite kernels on the Hilbert sphere. Appl. Anal., 55:91–101, 1994. V. A. Menegatto. Strictly positive definite kernels on the circle. Rocky Mountain J. Math., 25:1149–1163, 1995. V. A. Menegatto, C. P. Oliveira, and A. P. Peron. Strictly positive definite kernels on subsets of the complex plane. Comput. Math. Appl., 51:1233–1250, 2006. C. A. Micchelli, Y. Xu, and H. Zhang. Universal kernels. J. Mach. Learn. Res., 7:2651–2667, 2006. S.A. Morris. Duality and structure of locally compact Abelian groups. . .for the layman. Mathematical Chronicle, 8:39–56, 1979. K. Muandet, K. Fukumizu, B. Sriperumbudur, and B. Schölkopf. Kernel mean embedding of distributions: A review and beyond. Foundations and Trends in Machine Learning, 10:1–141, 2017. N.S. Pillai, Q. Wu, F. Liang, S. Mukherjee, and R.L. Wolpert. Characterizing the function space for Bayesian kernel models. J. Mach. Learn. Res., 8:1769–1797, 2007. I. J. Schoenberg. Positive definite functions on spheres. Duke Math. J., 9:96–108, 1942. A.W. Schurle. Topics in Topology. Elsevier North Holland, 1979. C.-J. Simon-Gabriel and B. Schölkopf. Kernel distribution embeddings: Universal kernels, characteristic kernels and kernel metrics on distributions. Technical report, 2016. URL https://arxiv.org/abs/1604.05251. B. K. Sriperumbudur, A. Gretton, K. Fukumizu, B. Schölkopf, and G. R. G. Lanckriet. Hilbert space embeddings and metrics on probability measures. J. Mach. Learn. Res., 11:1517–1561, 2010a. B. K. Sriperumbudur, K. Fukumizu, and G. R. G. Lanckriet. Universality, characteristic kernels and RKHS embedding of measures. J. Mach. Learn. Res., 12:2389–2410, 2011. B.K. Sriperumbudur, K. Fukumizu, and G. Lanckriet. On the relation between universality, characteristic kernels and rkhs embedding of measures. volume 9, pages 773–780, 2010b. I. Steinwart. On the influence of the kernel on the consistency of support vector machines. J. Mach. Learn. Res., 2:67–93, 2001. I. Steinwart and A. Christmann. Support Vector Machines. Springer, New York, 2008. I. Steinwart and C. Scovel. Mercer’s theorem on general domains: on the interaction between measures, kernels, and RKHSs. Constr. Approx., 35:363–417, 2012. I. Steinwart, D. Hush, and C. Scovel. Function classes that approximate the Bayes risk. In G. Lugosi and H. U. Simon, editors, Proceedings of the 19th Annual Conference on Learning Theory, pages 79–93, New York, 2006. Springer. I. Steinwart, P. Thomann, and N. Schmid. Learning with hierarchical Gaussian kernels. Technical report, Fakultät für Mathematik und Physik, Universität Stuttgart, 2016. URL http://arxiv.org/abs/1612.00824. 32
10math.ST
Exemplar or Matching: Modeling DCJ Problems with Unequal Content Genome Data Zhaoming Yin2 , Jijun Tang1,3∗ , Stephen W. Schaeffer4 and David A. Bader2? arXiv:1705.06559v1 [cs.DS] 18 May 2017 1 3 School of Computer Science and Technology, Tianjin University, China 2 School of Computational Science and Engineering, Georgia Institute of Technology, USA Dept. of Computer Science and Engineering, University of South Carolina, USA 4 The Huck Institutes of Life Sciences, Pennsylvania State University, USA Abstract. The edit distance under the DCJ model can be computed in linear time for genomes with equal content or with Indels. But it becomes NP-Hard in the presence of duplications, a problem largely unsolved especially when Indels are considered. In this paper, we compare two mainstream methods to deal with duplications and associate them with Indels: one by deletion, namely DCJ-Indel-Exemplar distance; versus the other by gene matching, namely DCJ-Indel-Matching distance. We design branch-and-bound algorithms with set of optimization methods to compute exact distances for both. Furthermore, median problems are discussed in alignment with both of these distance methods, which are to find a median genome that minimizes distances between itself and three given genomes. Lin-Kernighan (LK ) heuristic is leveraged and powered up by sub-graph decomposition and search space reduction technologies to handle median computation. A wide range of experiments are conducted on synthetic data sets and real data sets to show pros and cons of these two distance metrics per se, as well as putting them in the median computation scenario. Keywords: Genome Rearrangement, Double-cut and Join (DCJ ), LinKernighan Heuristic. 1 Introduction Over the last years, many distance metrics have been introduced to calculate the dissimilarity between two genomes by genome rearrangement [2,3,5,30]. Among them, DCJ distance is largely studied in recent years due to its capability to model various forms of rearrangement events, with a cheap cost of linear time computation. However, when consiering duplications, the distance computation becomes NP-hard [10] and APX-hard [1,12] for various distance models. There are two approaches to treat duplications, both are targeted at removing duplicated genes, so that existing linear algorithms can be utilized subsequently. ? Corresponding Authors 2 The first approach identifies the so called exemplar genes [23] in order to retain one copy gene in each duplicated gene family, while the other assigns one-toone matching to every duplicated genes in each gene family [24, 25]. Situated in the context of duplications, gene insertion and deletion (Indels) are also important rearrangement events that results in unequal contents [8]. Pioneer works were conducted to study the sorting and distance computation by reversals with Indels [17]. Later on, the DCJ-Indel distance metric was introduced to take advantages of the DCJ model. Braga et al [7] proposed the first framework to compute the DCJ-Indel distance; Compeau later simplified the problem with a much more elegant distance formula [13]. In this paper, we adapt the previous research results to design algorithms that procure the ability to handle both duplications and Indels when computing DCJ distance. As evolutionary analysis generally involves more than two species, it is necessary to extend the above distances to deal with multiple genomes. Since three species form the smallest evoliutionary tree, it is critical to study the median problem, which is to construct a genome that minimizes the sum of distances from itself to the three input genomes [6, 18]. The median problem is NP-hard under most distance metrics [4, 9, 21, 27]. Several exact algorithms have been implemented to solve the DCJ median problems on both circular [27, 29] and linear chromosomes [26,28]. Some heuristics are brought forth to improve the speed of median computation, such as linear programming (LP) [9], local search [16], evolutionary programming [14], or simply searching on one promising direction [22]. All these algorithms are intended for solving median problems with equal content genomes, which are highly unrealistic in practice. In this paper, we implement a Lin-Kernighan heuristic leveraging the aforementioned two distance metrics to compute DCJ median when duplications and Indels are considered. 2 2.1 Background Genome Rearrangement Events and their Graph Representations Genome Rearrangement Events The ordering of a genome can be changed through rearrangement events such as reversals and transpositions. Fig 1 shows examples of different events of a single chromosome (1 -2 3 4 -5 6 7). In the examples, we use signed numbers to represent different genes and their orientations. Genome rearrangement events involve with multiple combinatorial optimization problems and graph representation is common to abstract these problems. In this part, we will address the foundations of using the breakpoint graph to abstract genome rearrangement events. Breakpoint Graph Given an alphabet A, two genomes Γ and Π are represented by two strings of signed (+ or −) numbers (representing genes) from A. Each gene a ∈ A is represented by a pair of vertices head ah and tail at ; If a is positive 3 Fig. 1. Example of different rearrangement events. (a) Example of BPG (b) Example of DCJ Fig. 2. Examples of BPG; and DCJ operations. ah is putted in front of at , otherwise at is putted in front of ah . For a, b ∈ A, if a, b ∈ Γ and are adjacent to each other, their adjacent vertices will be connected by an edge. For a telomere genes, if it exists in a circular chromosome, two end vertices will be connected by an edge; if it exists in a linear chromosome, two end vertices will be connected to a special vertex called CAP vertex. If we use one type of edges to represent adjacencies of gene order Γ and another type of edges to represent adjacencies of gene order Π, the resulting graph with two types of edges is called breakpoint graph (BPG). Fig 2(a) shows the BPG for gene order Γ (1,-2,3,-6,5) (edge type: solid edges) which has one circular chromosome and Π (1,2,3,7,4) (edge type: dashed edges) which has one linear chromosome. DCJ operation Double-cut and join (DCJ ) operations are able to simulate all rearrangement events. In a BPG, these operations cut two edges (within one genome) and rejoin them using two possible combinations of end vertices (shown in Fig 2(b)). 2.2 Distance computation DCJ distance DCJ distance of genomes with the same content can be easily calculated by enumerating the number of cycles/paths in the BPG [30], which is of linear complexity. DCJ-Indel distance When Indels are introduced in BPG, with two genomes Γ and Π, the vertices and edges of a closed walk form a cycle. In Fig 2(a), the 4 walk (1t , (1t ; 2h ), 2h , (2h ; 3h ), 3h , (3h ; 2t ), 2t , (2t ; 1t ), 1t ) is a cycle. A vertex v is π-open (γ-open) if v 6∈ Γ (v 6∈ Π). An unclosed walk in BPG is a path. Based on different kinds of ends points of paths, we can classify paths into different types. If the two ends of a path are CAP vertices, we simply denote this path as p0 . If a path is ended by one open vertex and one CAP, we denote it as pπ (pγ ). If a path is ended by two open vertices, we denote it by the types of its two open vertices: for instance, pπ,γ represents a path that ends with a π-open vertex and a γ-open vertex. In Fig 2(a), the walk (5t , (5t ; 1h ), 1h , (1h ; CAP ), CAP ) is a pγ path and the walk (6t , (6t ; 3t ), 3t , (3t ; 7h ), 7h ) is a pγ,π path. A path is even (odd), if it contains even (odd) number of edges. In [13], if |A|= N the DCJ distance between two genomes with Indels but without duplications is calculated by equation (1). We call this distance DCJ-Indel distance. From this equation, we can easily get the DCJ-Indel distance between Γ and Π in Fig 2(a) as 4. dindel (Γ, Π) = N − [|c|+|pπ,π |+|pγ,γ |+bpπ,γ c] (1) 1 0 γ π π γ + (|peven |+min(|podd |, |peven |) + min(|podd |, |peven |) + δ) 2 Where δ = 1 only if pπ,γ is odd and either |pπodd |> |pγeven |, |pγodd |> |pγeven | or |pπodd |< |pγeven |, |pγodd |< |pγeven |; Otherwise, δ = 0. DCJ-Exemplar(Matching) distance There are in general two approaches to cope with duplicated genes. One is by removing all but keeping one copy in a gene family to generate an exemplar pair [23] and the other is by relabeling duplicated genes to ensure that every duplicated gene has unique number [24, 25]. Both of these two distances can be computed with BPG using branch-andbound methods. For both of the distance metrics, the upper bound can be easily derived by assigning an arbitrary mapping to two genomes then computing their mutual distance. In paper [23] regarding exemplar distance, it’s proved that by removing all occurrences of unfixed duplicated gene families, the resulting distance is monotony decreasing, hence the resulting distance can be served as a lower bound. In paper [11] regarding matching distance, the authors proposed a way for computing lower bounds by measuring the number of breakpoints between two genomes, which might not directly imply the lower bound between genomes with Indels. However, it is still possible to use this method to find a ‘relaxed’ lower bound. Distance Estimation Note that mathematically optimized distance might not reflect the true number of biological events, thus several estimation methods such as EDE or IEBP are used to rescale these computed distances [19] to better fit true evolutionary history. 2.3 Median Computation If there are three given genomes, the graph constructed by pre-defined BPG rule is called a Multiple Breakpoint Graph (MBG). Figure 3(a) shows an ex- 5 (a) MBG (b) 0-matching (c) Adequate subgraph and edge shrinking Fig. 3. (top) Examples of MBG with three input genomes: (1,2,3,4) (solid edges); (1,2,-3,4) (dashed edges) and (2,3,1,-4) (dotted edges).; (middle) 0-matching operation; (bottom) edge shrinking operations. ample of MBG with three input genomes. When there are only equal content genomes, the DCJ median problem can be briefly described by finding a maximum matching (which is called 0-matching) in MBG. Figure 3(b) shows an example of 0-matching which is represented by gray edges. In [29], it is proven that a type of sub-graph called adequate sub-graph (AS) could be used to decompose the graph with edge shrinking operations, which are shown in Figure 3(c). Unfortunately, there is no branch-and-bound based median algorithm that deals with unequal content genomes. In the following section, we will show that it is actually difficult to design such algorithm. 3 3.1 Approaches Proposed Distance Metrics We have discussed DCJ, DCJ-Indel and DCJ-Exemplar(Matching) distances, here we formally define the DCJ-Indel-Exemplar(Matching) distances as follows: Definition 1. An exemplar string is constructed by deleting all but one occurrence of each gene family. Among all possible exemplar strings, the minimum distance that one exemplar string returns is the DCJ-Indel-Exemplar distance. Definition 2. A matching string is constructed by assigning a one-to-one mapping to each occurrence of genes in a gene family and relabel them to distinct markers. Among all possible matching strings, the minimum distance that one matching string returns is the DCJ-Indel-Matching distance. 6 Fig. 4. Examples of exemplar and matching distance in the form of BPG representation. Figure 4 shows examples of BPG representation of exemplar mapping from genome Γ (1, -2, 3, 2, -6, 5) and genome Π (1, 2, 3, 7, 2, 4) to Γ (1, 3, 2, 6, 5) and genome Π (1, 3, 7, 2, 4), and a matching that mapping from genome Γ (1, -2, 3, 2, -6, 5) and genome Π (1, 2, 3, 7, 2, 4) to Γ (1, -2, 3, 2’, -6, 5) and genome Π (1, 2’, 3, 7, 2, 4). We can use branch-and-bound methods which are applied in DCJ-Exemplar (Matching) distances to solve these two distances. 3.2 Optimization Methods Optimal Assignments Although branch-and-bound algorithms are based on enumerating the number of cycles/path in BPG, it is not necessary to enumerate every component in the graph, as both [11, 25] indicated that there are some specific patterns in BPG which can be fixed before the distance computation. In this paper, we will extend their result in our optimization methods for DCJIndel-Exemplar(Matching) distances. To begin with, we define some terms for future explanation. There are two categories of vertices in a BPG: one connects exactly one edge of each edge type (in this paper edge types are expressed by such as dotted, dashed edges etc.), they are called regular vertices; the other connects fewer or more than one edges of each edge type, they are called irregular vertices. A subgraph in a BPG that only 7 contains regular vertices is defined as regular subgraph, while one that contains irregular vertices is defined as irregular subgraph. In BPG with two genomes Γ and Π, vertices and edges of a closed walk form a cycle. Theorem 1. In a BPG, an irregular subgraph which is a cycle of length 2 can be fixed before computation without losing accuracy. Proof. Without loss of generality, the proof is sound for both DCJ-Indel-Exemplar and DCJ-Indel-Matching distances. We prove the theorem under two cases: 1. for the subgraph in the component which only contains cycles, this is a case that is exactly the same as mentioned in [25], proof. 2. for the subgraph in the component which contains paths, since no type of the paths has count more than one (which is the count of a cycle), following the similar proof strategy in [25], we can get the same conclusion.  Adopting Morph Graph Methods to Condense BPG If a gene family has multiple copies of the gene, its corresponding two vertices (head and tail) in the BPG will have degree of more than one. In contrary, vertex representations of those singleton genes always have degree of one or zero. Once an ‘exemplar’ or ‘matching’ is fixed, only edges incident to vertices that have degree of more than one have been changed. We can view the computation of exemplar or matching distance as the process of morphing (or streaming) [32] the BPG in order to find an ad hoc shape of the BPG that achieves optimality. Following this hint, we can bridge out all vertices that are stable and just investigate these dynamically changing vertices without lossing accuracy. Suppose there are V vertices in the BPG, where Vs are stable and Vd are dynamic, the asymptotic speedup for this morph BPG strategy will be O( VVd ). Harness the Power of Divide-and-Conquer Approach to Reduce the Problem Space In the paper by Nguyen et al [20], the authors proposed a divide and conquer method to quickly calculate the exemplar distance. Inspired by their idea, we propose the following divide-and-conquer method to compute the above two distances based on the BPG. We have the follow observation: Theorem 2. The DCJ-Indel-Exemplar (Matching) distance is optimal iff the choices of exemplar edges (cycle decomposition) in each connected components of BPG are optimal. Proof. Since it’s obvious that for regular connected component of BPG, there is only one choice of edges, the proof under this case is trivial. For irregular connected component of BPG, we prove by contrary: suppose there is another edge selection that can result in a better distance, based on the corresponding BPG, there must be at least one connected component that has a better edge selection, replacing it with a better edge selection will result in a better distance, which violates the assumption.  8 22 Algorithm 1: DCJIndelExem(Matc)Distance Input: G1 and G2 Output: Minimum distance d optimization methods on G1 , G2 ; 0 0 G1 , G2 ←randomly init exemplar(matching) of all duplicated genes of G1 , G2 ; G∗1 , G∗2 ←remove all duplicated genes of G1 , G2 ; 0 0 min_ub ← DCJIndel(G1 , G2 ) ; ∗ ∗ min_lb ← DCJIndel(G1 , G2 ) ; Init search list L of size min_ub − min_lb and insert G1 , G2 ; while min_ub > min_lb do + G+ 1 , G2 ← pop from L[min_lb]; for pair ∈ all mappings of next available duplicated gene do + + + G+ 1 , G2 ← G1 , G2 fix the exemplar(matching) of pair ; 0 0 + G+ 1 , G2 ←randomly init exemplar(matching) of rest duplicated genes + G1 , G+ 2; +∗ +∗ + G1 , G2 ←remove rest duplicated genes G+ 1 , G2 ; +0 +0 ub ← DCJIndel(G1 , G2 ) ; +∗ lb ← DCJIndel(G+∗ 1 , G2 ) ; if lb > min_ub then + discard G+ 1 , G2 if ub < min_ub then min_ub = ub; else if ub = max_lb then return d = ub ; else + insert G+ 1 , G2 into L[lb] 23 return d = min_lb; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Combining three optimization methods in tandem with the branch-and-bound framework, we can summarize our algorithm to compute DCJ-Indel-Exemplar (Matching) distance as outlined in Algorithm 1. 3.3 Adapting Lin-Kernighan Heuristic to Find the Median Genome Problem Statement Not surprisingly, finding the median genome that minimizes the DCJ-Indel-Exemplar(Matching) distance is challenging. To begin with, given three input genomes, there are multiple choices of possible gene content selections for the median; however, since identifying gene content is simpler and there exists very accurate and fast methods to fulfil the task [15], we are more interested on a relaxed version of the median problem that assumes known gene content on the median genome. Which is formally defined as: 9 Definition: Given the gene content of a median genome, and gene orders of three input genomes. Find an adjacency of the genes of the median genome that minimize the DCJ-Indel-Exemplar(Matching) distance between the median genome and the three input genomes. The DCJ-Indel-Exemplar(Matching) median problem is not even in the class of NP because there is no polynomial time algorithm to verify the results. It is hard to design an exact branch-and-bound algorithm for the DCJ-IndelExemplar(Matching) median problem mainly because the DCJ-Indel distance violates the property of triangular inqueality which is required for a distance metrics [31]. Furthermore, when there are duplicated genes in a genome, it is possible that there are multiple edges of the same type connecting to the same vertex of a 0-matching, which leads to ambiguity in the edge shrinking step and makes the followed branch-and-bound search process very complicated and extremely hard to implement. To overcome these problems, we provide an adaption of Lin-Kernighan (LK ) heuristic to help solving this challenging problem. Design of the Lin-Kernighan Heuristic The LK heuristic can generally be divided into two steps: initialize the 0-matching for the median genome, and LK search to get the result. The initialization problem can be described as: given the gene contents of three input genomes, find the gene content of the median genome that minimizes the sum of the number of Indels and duplications operations required to transfer the median gene content to the gene contents of the other three genomes. In this paper, we design a very simple rule to initialize the median gene content: given the counts of each gene family occurred in the three genomes, if two or three counts are the same, we simply select this count as the number of occurrence of the gene family in the median genome; if all three counts are different, we select the median count as the number of occurrence of the gene family in the median genome. After fixing the gene content for the median genome, we randomly set up the 0-matching in the MBG. The followed LK heuristic selects two 0-matching edges on the MBG of a given search node and performs a DCJ operation, obtaining the MBG of a neighboring search node. We expand the search frontier by keeping all neighboring search nodes to up until the search level L1. Then we only examine and add the most promising neighbors to the search list until level L2. The search is continued when there is a neighbor solution yielding a better median score. This solution is then accepted and a new search is initialized from the scratch. The search will be terminated if there are no improvement on the result as the search level limits have been reached and all possible neighbors have been enumerated. If L1 = L2 = K, the algorithm is called K-OPT algorithm. Adopting Adequate Sub-graphs to Simplify Problem Space By using the adequate subgraphs [26, 29], we can prove that they are still applicable for decomposing the graph in the DCJ-Indel-Exemplar(Matching) median problem. 10 Algorithm 2: DCJIndelExem(Matc)Median 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Input: MBG G, Search Level L1 and L2 Output: 0-matching of G Init search list L of size L1; Init 0-matching of G; currentLevel ← 0 and Improved ← true; while Improved = true do currentLevel ← 0 and Improved ← f alse; Insert G into L[0]; while currentLevel < L2 do G0 ← pop from list L[currentLevel]; if G0 improves the median score then G ← G0 ; Improved ← true and break ; if currentLevel < L1 then for x ∈ ∀ 0-matching pairs of G do G0 ← perform DCJ on G0 using x; if num_pair(x) > δ then Insert G0 into L[currentLevel + 1] ; else G0 ← perform DCJ on G0 using x = argmax num_pair(x) ; x 18 19 20 if num_pair(x) > δ then Insert G0 into L[currentLevel + 1] ; currentLevel ← currentLevel + 1 ; return 0-matching of G; Lemma 1. As long as the irregular vertices do not involve, regular subgraphs are applicable to decompose MBG. Proof. If there are d number of vertices that contain duplicated edges in MBG, we can disambiguate the MBG by generating different subgraphs that contain only one of the duplicateQ edge. We call these subgraphs disambiguate MBG, (dMBG), and there are O( i<d deg(i)) number of d-MBGs. If a regular adequate subgraph exists in the MBG, it must also exists in every d-MBG. Based on the 0-matching solution, we can transform every d-MBG into completed d-MBG (cdMBG) by constructing the optimal completion [13] between 0-matching and all the other three types of edges. After this step, the adequate subgraphs in every d-MBG still exist in every cd-MBG, thus we can use these adequate subgraphs to decompose cd-MBG for each median problem without losing accuracy.  Search Space Reduction Methods The performance bottleneck with the median computation is in the exhaustive search step, because for each search level we need to consider O(|E|2 ) possible number of edge pairs, which is O(|E|2L1 ) in total. Unlike the well-studied traveling salesman problem (TSP) where it is cheap to find the best neighbor, here we need to compute the DCJ-Indel- 11 Exemplar(Matching) problem,NP-hard distance, which makes this step extremely expensive to conclude. Noticing that if we search neighbors on edges that are on the same 0-i color altered connected component (0-i-comp), the DCJ-IndelExemplar(Matching) distance for genome 0 and genome i is more likely to reduce [32], thus we can sort each edge pair by how many 0-i-comp they share. Suppose the number of 0-i-comp that an edge pair x share is num_pair(x), when the algorithm is in the exhaustive search step (currentLevel < L1), we set a threshold δ and select the edge pairs that satisfy num_pair(x) > δ to add into the search list. When it comes to the recursive deepening step, we select the edge pair that satisfy argmax num_pair(x) to add into the search list. This strategy x has two merits: 1) some of the non-promising neighbor solution is eliminated to reduce the search space; 2) the expensive evaluation step which make a function call to DCJ-Indel-Exemplar(Matching) distance is postponed to the time when a solution is retrieved from the search list. The LK based median computation algorithm is as Algorithm 2 shows. 4 Experimental Results We implement our code with python and C++: the python code realized the optimization methods while the C++ code is implemented on a parallel branchand-bound framework OPTKit. We conduct extensive experiments to evaluate the accuracy and speed of our distance and median algorithms using both simulated and real biological data. Experimental tests ran on a machine with linux operating system configured with 16 Gb of memory and an Intel(R) Xeon(R) CPU E5530 16 core processor, each core has 2.4GHz of speed. All of the experiments ran with a single thread. We choose to use g++-4.8.1 as our compiler. 4.1 Distance Computation To the best of our knowlege, there is no software package that can handle both duplications and Indels. We compare our DCJ-Indel-Exemplar (Matching) distances with GREDO [25], a software package based on linear programming that can handle duplications. Simulated Data The simulated data sets are generated with genomes containing 1000 genes. The Indels rate is set (γ) as 5%, inline with the duplication rate (φ) as 10%. Considering GREDO can not process Indel data, all Indels for GREDO are removed. We compare the change of distance estimation with the variation of mutation rate (θ, which grows from 10% to 100%. The experimental results for simulated data are displayed in Figure 5. 1. For computational time, since the results of time spans over a range of thousands of seconds, we display the time with log scale to construe results clearly. 12 (a) Time result for simulated data. (b) Distance result for simulated data. Fig. 5. Experimental results for distance computation using simulated data. (a) γ = φ = 0% and θ varies from 10% to 100%. (b) γ = φ = 5% and θ varies from 10% to 60%. Fig. 6. Experimental results for median computation applying DCJ-Indel-Exemplar distance. When the mutation rate is less than 50%, all three methods perform similarly, with the fact that GREDO is faster than both of our branch-and-bound methods. However, GREDO slows down dramatically when the mutation 13 Distance Results Data Time Results GREDO Exem Matc GREDO Exem Matc brownrat_chicken 1678 24546 24704 3604.28 172.73 7.45 brownrat_gorilla 1274 17922 17966 5707.13 12.64 12.10 brownrat_human 1083 17858 17900 3725.76 12.14 12.19 brownrat_mouse 790 15433 15445 3725.66 14.51 15.06 chicken_gorilla 1491 16379 16421 3725.62 7.54 7.57 chicken_human 1521 16231 16276 3725.65 7.74 7.47 chicken_mouse 1528 15712 15745 3726.03 9.82 8.16 gorilla_human 486 17798 17798 3607.63 13.94 13.81 gorilla_mouse 860 18914 18935 4816.31 12.60 12.13 human_mouse 749 18126 18144 94.64 12.45 12.61 Table 1. Experimental results for disntance computation with real data set. (a) γ = φ = 5% and θ varies from 10% to 100%. (b) γ = φ = 10% and θ varies from 10% to 100%. Fig. 7. Experimental results for median computation applying DCJ-Indel-Matching distance. rate is increased, while our branch-and-bound based method takes less increased time to finish. 14 2. For computational accuracy, we show the distance results corrected by EDE approach which is one of the best true distance estimator. As for simulated data, we can see that when the mutation rate is small (< 50%) GREDO under estimate the distance as opposed to our two branch-and-bound methods; but it will over estimate the distance with the growth of mutation rate. Real data We prepare the real data sets using genomes downloaded from Ensenble and processed them following the instructions in [25]. The real data set contains 5 species: brown-rat, chicken, human, mouse and gorilla. For DCJ-IndelExemplar (Matching) distance, we only convert the Ensenmble format to adapt the data to our program. Meanwhile, just as the simulated data, all Indels in real data set for GREDO are removed. The results for real data are shown in Table 1. 1. For computational time, the branch-and-bound method shows orders of magnitudes of speed up compared with GREDO. We analyze the data, the reason can be construed as the existance of multiple connected comonent in BPG. So that our method can divide the graph into much smaller size, versus GREDO which doesn’t have this mechanism. 2. For computational accuracy, the distance results of the real data gives us a taste of how frequently Indels happend in the genome evolution. We can see orders of magnitude of difference between our distance results and GREDO, which is mainly due to the large amount of Indels in the real data set. Note that we did not change the way GREDO compute its distance as in paper [25], in the real distance computation, we should consider Indels in alignment with duplications. 4.2 Median Computation Median Computation We simulate the median data of three genomes using the same strategy as in the distance simulation. In our experiments, each genome is “evolved” from a seed genome, which is identity, and they all evolve with the same evolution rate (θ, γ and φ). The sequence length in the median experiments are reduced to 50, due to performance issues. DCJ-Indel-Exemplar median We analyze the result of using LK algorithm with L1 = 2 and L2 = 3, and the K-OPT algorithm of K = 2. Search space reduction methods are used, with δ = 2 and δ = 3 respectively. 1. To begin with, we compare our result along with equal content data, since there are already benchmark programs to help us performing analysis. We run the exact DCJ median solver (we use the one in [32]) to compare our heuristic with the exact median results. In Fig 6(a), it shows the accuracy of our heuristic versus the exact result. It is shown that when θ ≤ 60%, all results of the LK and K-OPT methods are quite close to the exact solver. 15 For parameter of δ = 2, both LK and K-OPT methods can generate exactly the same results for most of the cases. 2. As for the median results for unequal contents, we set both γ and φ to 5% and increase the mutation (inversion) rate θ from 10% to 60%. We compare our results with the accumulated distance of the three genomes to their simulation seed. Although it can not show the accuracy of our method (since we do not have an exact solver), it can be used as an indicator of how close that our method is to the real evolution. Fig 6(b) shows that when δ = 3, both the LK and K-OPT algorithms get results quite close to the real evolutionary distance. DCJ-Indel-Matching median Since DCJ-Indel-Exemplar median has already given us the result of how LK performs against exact solver, and how different parameters of LK performs. With these things in mind, we choose to use LK with L1 = 2 and L2 = 3 having δ = 2 as the configuration for our DCJ-IndelMatching median solver. We use the same data as in the previous experiments, and the experimental results are shown in Figure 7(a) and Figure 7(b). We can see that in general, the new implementation is quite close to the real result when γ = 5% and φ = 5% and slightly worse than real result when γ = 10% and φ = 10%. 5 Conclusion In this paper, we proposed a new way to compute the distance and median between genomes with unequal contents (with Indels and duplications). Our distance method can handle Indels which is ubiquitous in the real data set, and is proved to be more efficient as opposed to GREDO. We designed a LinKernighan based method to compute median, which can get close to optimal results in alignment with the exact median solver, and our methods can handle duplications and Indels as well. 6 Acknowledgements This Research was sponsored in part by the NSF OCI-0904461 (Bader), OCI0904179, IIS-1161586 (Tang) and OCI- 0904166 (Schaeffer). References 1. Angibaud, S., Fertin, G., Rusu, I., Thévenin, A., Vialette, S.: On the approximability of comparing genomes with duplicates. J. Graph Algorithms Appl. 13(1), 19–53 (2009) 16 2. Bader, D.A., Moret, B.M.E., Yan, M.: A linear-time algorithm for computing inversion distance between signed permutations with an experimental study. Journal of Computational Biology 8, 483–491 (2001) 3. Bafna, V., Pevzner, P.A.: Sorting by transpositions. SIAM J. Discrete Math. 11(2), 224–240 (1998) 4. Bergeron, A., Mixtacki, J., Stoye, J.: On sorting by translocations. In: Journal of Computational Biology. pp. 615–629. Springer (2005) 5. Blin, G., Chauve, C., Fertin, G.: The breakpoint distance for signed sequences. In: Proc. CompBioNets 2004. vol. Text in Algorithms, Volume 3, pp. 3–16. King’s College London (2004) 6. Bourque, G., Pevzner, P.A.: Genome-Scale Evolution: Reconstructing Gene Orders in the Ancestral Species. Genome Res. 12(1), 26–36 (2002) 7. Braga, M.D.V., Willing, E., Stoye, J.: Genomic distance with dcj and indels. In: Proceedings of the 10th international conference on Algorithms in bioinformatics. pp. 90–101. WABI’10, Springer-Verlag, Berlin, Heidelberg (2010) 8. Brewer, C., Holloway, S., Zawalnyski, P., Schinzel, A., FitzPatrick, D.: A chromosomal duplication map of malformations: Regions of suspected haplo and triplolethality and tolerance of segmental aneuploidy in humans. The American Journal of Human Genetics 64(6), 1702 – 1708 (1999) 9. Caprara, A.: The Reversal Median Problem. INFORMS Journal on Computing 15(1), 93–113 (2003) 10. Chauve, C., Fertin, G., Rizzi, R., Vialette, S.: Genomes containing duplicates are hard to compare. In: Proc Int. Workshop on Bioinformatics Research and Applications (IWBRA). LNCS, vol. 3992, pp. 783–790. Springer-Verlag, Reading, UK (2006) 11. Chen, X., Zheng, J., Fu, Z., Nan, P., Zhong, Y., Lonardi, S., Jiang, T.: Assignment of orthologous genes via genome rearrangement. IEEE/ACM Trans. Comput. Biology Bioinform. 2(4), 302–315 (2005) 12. Chen, Z., Fu, B., Zhu, B.: Erratum: The approximability of the exemplar breakpoint distance problem. In: FAW-AAIM. p. 368 (2012) 13. Compeau, P.E.C.: A simplified view of dcj-indel distance. In: Proceedings of the 12th international conference on Algorithms in Bioinformatics. pp. 365–377. WABI’12, Springer-Verlag, Berlin, Heidelberg (2012) 14. Gao, N., Yang, N., Tang, J.: Ancestral genome inference using a genetic algorithm approach. PLoS ONE 8(5) (2013) 15. Hu, F., Zhou, J., Zhou, L., Tang, J.: Probabilistic reconstruction of ancestral gene orders with insertions and deletions. IEEE/ACM Trans. Comput. Biology Bioinform. 11(4), 667–672 (2014), http://doi.ieeecomputersociety.org/10.1109/ TCBB.2014.2309602 16. Lenne, R., Solnon, C., Stutzle, T., Tannier, E., Birattari, M.: Reactive Stochastic Local Search Algorithms for the Genomic Median Problem. In: Carlos Cotta, J.v.H. (ed.) Eighth European Conference on Evolutionary Computation in Combinatorial Optimisation (EvoCOP). pp. 266–276. LNCS, Springer (Mar 2008) 17. Mabrouk, N.E.: Sorting Signed Permutations by Reversals and Insertions/Deletions of Contiguous Segments. Journal of Discrete Algorithms 1(1), 105– 122 (2001) 18. Moret, B.M.E., Tang, J., san Wang, L., Warnow, Y.: Steps toward accurate reconstructions of phylogenies from gene-order data. J. Comput. Syst. Sci 65, 508–525 (2002) 17 19. Moret, B.M.E., Wang, L.S., Warnow, T., Wyman, S.K.: New approaches for reconstructing phylogenies from gene order data. In: ISMB (Supplement of Bioinformatics). pp. 165–173 (2001) 20. Nguyen, C.T., Tay, Y.C., Zhang, L.: Divide-and-conquer approach for the exemplar breakpoint distance. Bioinformatics 21(10), 2171–2176 (May 2005) 21. Pe’er, I., Shamir, R.: The median problems for breakpoints are np-complete. Elec. Colloq. on Comput. Complexity 71 (1998) 22. Rajan, V., Xu, A.W., Lin, Y., Swenson, K.M., Moret, B.M.E.: Heuristics for the inversion median problem. BMC Bioinformatics 11(S-1), 30 (2010) 23. Sankoff, D.: Genome rearrangement with gene families. Bioinformatics 15(11), 909– 917 (1999) 24. Shao, M., Lin, Y.: Approximating the edit distance for genomes with duplicate genes under dcj, insertion and deletion. BMC Bioinformatics 13(S-19), S13 (2012) 25. Shao, M., Lin, Y., Moret, B.M.E.: An exact algorithm to compute the dcj distance for genomes with duplicate genes. In: RECOMB. pp. 280–292 (2014) 26. Xu, A.W.: Dcj median problems on linear multichromosomal genomes: Graph representation and fast exact solutions. In: RECOMB-CG. pp. 70–83 (2009) 27. Xu, A.W.: A fast and exact algorithm for the median of three problem: A graph decomposition approach. Journal of Computational Biology 16(10), 1369–1381 (2009) 28. Xu, A.W., Moret, B.M.E.: Gasts: Parsimony scoring under rearrangements. In: WABI. pp. 351–363 (2011) 29. Xu, A.W., Sankoff, D.: Decompositions of multiple breakpoint graphs and rapid exact solutions to the median problem. In: Proceedings of the 8th international workshop on Algorithms in Bioinformatics. pp. 25–37. WABI ’08, Springer-Verlag, Berlin, Heidelberg (2008) 30. Yancopoulos, S., Attie, O., Friedberg, R.: Efficient sorting of genomic permutations by translocation, inversion and block interchange. Bioinformatics 21(16), 3340– 3346 (2005) 31. Yancopoulos, S., Friedberg, R.: Sorting genomes with insertions, deletions and duplications by dcj. In: Nelson, C.E., Vialette, S. (eds.) RECOMB-CG. Lecture Notes in Computer Science, vol. 5267, pp. 170–183. Springer (2008) 32. Yin, Z., Tang, J., Schaeffer, S.W., Bader, D.A.: Streaming breakpoint graph analytics for accelerating and parallelizing the computation of dcj median of three genomes. In: ICCS. pp. 561–570 (2013)
5cs.CE
Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model Alexander Heußner University of Bamberg, Germany Christopher M. Poskitt Claudio Corrodi Benjamin Morandi Department of Computer Science ETH Zürich, Switzerland To harness the power of multi-core and distributed platforms, and to make the development of concurrent software more accessible to software engineers, different object-oriented concurrency models such as SCOOP have been proposed. Despite the practical importance of analysing SCOOP programs, there are currently no general verification approaches that operate directly on program code without additional annotations. One reason for this is the multitude of partially conflicting semantic formalisations for SCOOP (either in theory or by-implementation). Here, we propose a simple graph transformation system (GTS) based run-time semantics for SCOOP that grasps the most common features of all known semantics of the language. This run-time model is implemented in the stateof-the-art GTS tool GROOVE, which allows us to simulate, analyse, and verify a subset of SCOOP programs with respect to deadlocks and other behavioural properties. Besides proposing the first approach to verify SCOOP programs by automatic translation to GTS, we also highlight our experiences of applying GTS (and especially GROOVE) for specifying semantics in the form of a run-time model, which should be transferable to GTS models for other concurrent languages and libraries. 1 Introduction Background Multi-core and distributed architectures are becoming increasingly ubiquitous, as the focus for delivering computing performance shifts from CPU clock speeds—now reaching their natural limits—to concurrency. Harnessing this power, however, requires a fundamentally different approach to writing software; developers must program with concurrency, asynchronicity, and parallelism in mind. Traditionally this has been achieved through threads, synchronising via low-level constructs like locks and semaphores. This approach, while still pervasive, is difficult to master and notoriously error prone; deadlocks, data races, and other concurrency faults are all-too-easy to introduce, yet are challenging to detect and debug. In an effort to alleviate this task for programmers, a number of high-level libraries and languages have been proposed that provide simpler-to-use models of concurrency. Examples include Grand Central Dispatch [11] and SCOOP [20], both of which support asynchronous concurrent programming through abstractions that are safer and simpler to grasp than threads. The concurrency mechanisms of SCOOP, for example, exclude data races by design. Despite such abstractions, programs may still exhibit rich, complex behaviours that are difficult to fully comprehend through testing alone. There is a pressing need for formal models of these systems to facilitate reasoning, comparisons, and understanding, as well as to bring them within reach of current verification tools and techniques. Initial Problem The intricate features of these libraries and languages—including locking, waiting queues, asynchronous remote calls, and dynamic and automatic thread generation—lead to formal models with verification decision questions (e.g. deadlock detection and the verification of temporal, behavioural properties) that are undecidable. Existing approaches to tackle this theoretical challenge fall c A. Heußner, C.M. Poskitt, C. Corrodi & B. Morandi A. Rensink & E. Zambon (Eds.): Graphs as Models 2015 (GaM’15) This work is licensed under the EPTCS 181, 2015, pp. 32–47, doi:10.4204/EPTCS.181.3 Creative Commons Attribution License. A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 33 mainly into two categories: verification algorithms working on restrictions to simple approximations, e.g. by extended automata models or Petri nets [12, 2], or semi-algorithmic approaches on models that try to cover the original features as faithfully as possible, e.g. by bounded model checking [7]. In the context of SCOOP—a high-level object-oriented concurrency model, implemented as an extension to Eiffel—there are currently no analysis or verification approaches that work directly on a program’s source code without additional annotations. Recent first steps into the analysis and prevention of deadlocks in SCOOP are either based on checking Coffman’s deadlock conditions on an abstract semantic level [5], or require code to be annotated with locking orders [28]. In earlier work [4], SCOOP programs were translated by hand to models in the process algebra CSP for e.g. deadlock analysis; but these models were too large for the leading CSP tools to cope with, and required a new tool to be custom-built for the purpose (which is no longer maintained today). No further verification approaches for behavioural properties, e.g. specified in some temporal logic, exist yet. In addition, these concurrent libraries and languages often have semantics that are not fully formally specified, or are associated with multiple semantics—whether existing as formal specifications or implicitly, by implementation. The choice of the “right” semantic formalisation, however, is a substantial prerequisite for the analysis and verification of a program’s source code. SCOOP, for example, has at least four established, different semantic formalisations [29, 19, 4, 21]. This “semantic plurality” is an additional source of complication for verification approaches, such as the one we propose in this paper. Our Approach As a first step, we develop—from the core of the language up—a formal model permitting the simulation and verification of SCOOP programs. The rich semantic features of SCOOP regarding concurrency, (basic) object-orientation, and especially asynchronicity are grasped with the help of graph transformation systems (GTS) that are parameterised by different underlying semantic variants. We also supply a compiler to automate the task of generating input graphs from SCOOP source code. These are then analysed with the help of GROOVE, a state-of-the-art GTS tool, which already includes basic model checking algorithms for GTS. Contribution & (Closely) Related Work The contribution of the paper is thus manifold: first, we provide a formal GTS-based model that covers SCOOP’s basic features and can be seen as a new, additional operational semantics for the language. Second, this GTS-model can also be seen as a new general runtime environment for analysing and verifying object-oriented concurrent programs that share SCOOP’s main features, including approximations of SCOOP. Third, the given analysis approach serves as a first step towards a general framework for verifying concurrent asynchronous programs by also highlighting modelling best practices, which can be transferred to the analysis and verification of other libraries, e.g. Grand Central Dispatch, in a similar way. Combining all these aspects, we provide, to our knowledge, the first approach for verifying a subset of SCOOP programs on the code level with respect to behavioural specifications—including deadlock freedom. Only the advanced typing mechanisms and some Eiffel-specific features of SCOOP are currently out of reach for our automatic verification approach. For the broader verification community, this paper demonstrates how a GTS-based semantics and tool can be effectively used to model, simulate, and facilitate verification for a concurrent programming language that abstracts away from threads and has a “frequently evolving” run-time. For the graph modelling community, this paper presents our experiences of applying a state-of-the-art GTS tool to a non-trivial and practical modelling and verification problem. The two closest related works are [4] and [19], which both share our first step of providing a new operational semantics for SCOOP. Whereas the former formalises the semantics with the help of a pro- 34 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model cess algebraic model in CSP, the latter defines a semantics based on rewriting logic in Maude. Relying on “classical” process algebra, the expression of real asynchronicity between concurrent threads and asynchronous remote method calls are not fully supported by the CSP model—contrary to the model we propose. The comprehensive Maude formalisation is currently seen by the community as the gold standard for SCOOP and coined our understanding of SCOOP’s semantics; our model, in contrast, focuses more on the core asynchronous and concurrent features of SCOOP, but can be extended to capture the advanced language features inherited from Eiffel (cf. later comparison in Section 5 for details). Both the CSP and Maude models were used successfully to resolve ambiguities in the original, informal descriptions of SCOOP’s semantics, but are insufficient for general verification tasks. Directly harvesting, for example, the more expressive and complete Maude implementation for deadlock analysis does not scale on even toy examples like the Dining Philosophers program (presented later). Plan of the Paper After introducing SCOOP’s main concurrency features (Section 2), we present a formal model which for the sake of simplicity, ignores “local” object-orientation and corresponds to a subset of SCOOP that we will call CoreSCOOP (Section 3). We show how to render CoreSCOOP programs as GTS models (Section 4). Afterwards, we describe how we extended our GTS model for SCOOP to include full object-orientation, and present a workflow for translating SCOOP programs into GROOVE models (Section 5). The latter then allows us to verify programs written in SCOOP with the general algorithms already implemented in GROOVE (Section 6). We conclude with a comparison to related work on GTS-based verification of concurrent object-oriented systems (other references to related work are stated in the corresponding sections) and provide an outlook on our current research. 2 SCOOP: A Concurrent Asynchronous OO Model SCOOP Simple Concurrent Object-Oriented Programming (SCOOP) [20, 19] is a concurrent, asynchronous, and object-oriented programming model that—with its intricate semantics—provided the motivation and challenge for the work in this paper. The most thorough implementation of the model is as an extension to Eiffel, but it has also been explored within the context of Java [27]; we shall focus on the former, and take “SCOOP” in the following to be a synonym for both the model and this principal implementation. In SCOOP, every object is handled by a processor, a concurrent thread of control with the exclusive right to call methods on the objects it handles. In this context, object references may point to objects handled by the same processor (non-separate objects), or to objects handled by other ones (separate objects). Given an object reference x and a method m that is a command (i.e. does not return a result), a method call x.m is executed synchronously if x is non-separate. If x is separate, then the handler of x is sent a request to execute the method asynchronously. This latter case is the main source of concurrency in SCOOP programs, which is based essentially on message passing between processors. The possibility of an object having a different handler is captured in the type system by the keyword separate. In order to prevent data races, calls to a separate object x are only allowed if the current object’s processor holds a lock on the handler of x. The programmer does not manage these locking requirements explicitly, but rather expresses them implicitly in the formal argument lists of methods: if the arguments of a method contain separate objects, then the objects’ handlers will all be locked (simultaneously, atomically, and automatically—at least conceptually) before the method is executed, and released when it is finished. A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 35 Listing 1: Snippet of the PHILOSOPHER class from a Dining Philosophers solution in SCOOP [26] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 live -- Each Philosopher eats times_to_eat times do from until times_to_eat < 1 loop print ( " P h i l o s o p h e r " + Current . id . out + " w a i t i n g f o r f o r k s .%N" ) eat ( left_fork , right_fork ) print ( " P h i l o s o p h e r " + Current . id . out + " h a s e a t e n .%N" ) times_to_eat : = times_to_eat − 1 end end eat ( left , right : separate FORK ) -- Eat , having acquired left and right forks do -- Here , eating takes place end left_fork , right_fork : separate FORK -- References to forks used for eating Dining Philosophers Example A simple example highlighting the intricacies and expressiveness of SCOOP is an implementation of the Dining Philosophers problem: a number of philosophers sit at a round table that provides only single forks between adjacent pairs, and these philosophers must concurrently and correctly alternate between eating and thinking. The caveat of course is that a philosopher may only eat if they hold both the fork to their left and the fork to their right, and algorithms must “pick up” the forks in such a way that prevents a cyclic deadlock from arising. Consider Listing 1, which contains an excerpt from the PHILOSOPHER class of a well-known SCOOP solution (available at [26]). Each philosopher and fork object is handled by its own processor. Upon creation, each philosopher is “launched” by calling the (argumentless) live method, causing them to concurrently begin the process of eating and thinking. To eat, a philosopher calls the eat method, passing the separate object references for the two forks. Eating does not commence until the handlers of these forks are locked by the philosopher’s handler; conceptually, this occurs simultaneously, avoiding the possibility of deadlock from e.g. every philosopher locking their left forks only and then waiting indefinitely on their right ones. Concurrency, Asynchronicity, and Locking SCOOP has a number of other features and behaviours detailed more thoroughly in [19]; here, we briefly describe only queries and contracts. First, given a separate object reference x and a method m that is a query (i.e. returns a result), a call q = x.m is always executed synchronously; if x has a separate handler, then the current object’s handler simply waits for the result to be returned. Secondly, SCOOP maintains and extends the Eiffel tradition of annotating methods with preconditions (keyword require) and postconditions (ensure). In the sequential setting, these are (optionally) checked before and after every execution of the method. In the concurrent setting, however, preconditions are instead interpreted as wait conditions that must be synchronised on. Conceptually, the execution of a routine is delayed until simultaneously the precondition is satisfied and the handlers of the formal arguments are locked. This allows the programmer to express synchronisation conditions at a high level of abstraction. These concepts require execution-time support from an effective run-time environment. The current run-time [19] associates each processor with a lock and request queue. A method call on a separate object is enqueued on its handler’s request queue, which is processed in FIFO order. The call may only be enqueued if the lock on the handler is held. The run-time is responsible for correctly synchronising on wait conditions and locking the handlers of formal arguments at the beginning of methods, as well as releasing them at the end. The run-time must balance these design needs with the need to permit 36 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model a reasonable level of performance (e.g. by reducing resource contentions). As such, and as a major challenge for our work, the “official” run-time is frequently evolving, and several alternatives have been proposed and/or developed, e.g. [20, 19, 29]. 3 A GTS-based Model of CoreSCOOP Our first step is to present a run-time model for the core behaviours of SCOOP, i.e. remote method calls, FIFO queues, and locking. This model, named Concurrent Processor Model (CPM), strips away the object-oriented features of SCOOP, grasping only a subset of the language and focusing on processors equipped with simple data. This allows us to: (i) highlight the fundamental peculiarities of SCOOP as model of concurrency in a more fine-grained formal setting, and (ii) present the basic building blocks of our approach in more detail, as we extend CPM to include full object-orientation in Section 5. From CoreSCOOP to CPM Stripping “local” object-oriented features from SCOOP (e.g. self-calls, non-separate calls) and focusing on remote synchronous and asynchronous method calls (i.e. queries and commands) via FIFO queues, as well as locking in a concurrent setting, leads to a subset of the SCOOP language we call CoreSCOOP in the following. We formalise the run-time model for CoreSCOOP by the Concurrent Processor Model (CPM). CPM is represented by a graph transformation system in which configurations are given by directed graphs conforming to the type graph of Figure 1. Note that the type graph uses a UML-like notation with type attributes and constraints. The semantic model of CoreSCOOP is inspired by the current “standard” formalisation of SCOOP’s semantics in [19]. It consists of a set of processors that run concurrently. Each processor is the handler of data in local memory, which is represented as a mapping from variable names (x1 , . . . xm ) to integers. There is no global shared memory, only processor local memory, and this memory can only be accessed by or via its processor. Processors sequentially handle method calls via incoming requests that are related to a control-flow graph encoding of the underlying CoreSCOOP methods. Thus, a running processor that handles a current request is in a current state belonging to this request method type’s control flow graph. Incoming requests are stored by each processor in a FIFO queue before being locally executed. Each processor has a finite set of known neighbour processors, i.e. those accessible for synchronous or asynchronous remote calls, which are stored by reference (the variables r1 , . . . , rn ). Processors can dynamically generate new processors (and assign these directly to local reference variables). Each remote call and its context, i.e. the call’s parameters, which consist of integer values (i.e. p1 , . . . pk ) and processor references (r1 , . . . , rl ), is stored as a request. Requests implement “value passing”, e.g. requests can pass references to newly generated processors. The return value for queries, i.e. synchronous remote calls, is stored in a special local variable accessible to the caller (variable result). In CPM, there are neither local calls, i.e. calls to oneself, nor local recursion. CPM includes explicit locking between processors, i.e. each processor can be locked by at most one (distinct) processor. CoreSCOOP’s implicit locking can thus be translated to CPM’s explicit locking, however at a different level of granularity. In general, CPM is able to simulate the execution of programs written in CoreSCOOP, which is not possible the other way round due to this different level of atomicity in both models. A processor handling a request “walks” the corresponding part of the control-flow graph by updating the current state according to the actions’ semantics, given as graph transformation rules (see Section 4 for example configurations and a rule for commands). Handling of queues, local scheduling of each processor (i.e. terminating the currently handled request and advancing to the next in the waiting queue), instantiation of parameters, etc., is handled by global scheduling rules, which also assure that Poskitt,Practical C. Corrodi, and B. Morandi 37 6A. Heußner, C.M. Towards Graph-Based Verification for an Object-Oriented Concurrency Model handler 0..1 in Action label: Stmt out Control State Final State lock no outgoing edge head Initial State meth: Meth no incoming edge 0..1 Abstract Element 0..1 Queue System State next 0..1 0..1 tail one and only one initial state for each m 2 Meth Control-flow Data result: Z x1 : Z ... xm : Z r1 : Processor[0..1] ... rn : Processor[0..1] Request p1 : Z currentRequest . . . pk : Z 0..1 r1 : Processor[0..1] ... * queue rl : Processor[0..1] requestType 0..1 * currentState Processor 0..1 * Waiting Queue Abstract Elements form a linear queue where head points to the front, next to the subsequent element, and tail to the back of the queue Memory State Figure 1: Type graph for CPM’s configurations as class diagram with constraints, where we assume disjoint finite sets of variable names (p1 , . . . , x1 . . . ), and reference names (r1 , . . . ); let Meth be a finite set of method names, and Z be the set of integer numbers, B of Booleans; the cardinality of association edges is "1" if not noted otherwise; the different regions highlight the different modules of the model each local processor advances as far as possible. Note that the walking of the control-flow graph and the scheduler are generic, i.e. represented by a set of GTS rules independent of the SCOOP program. We refer to [26] for the full formal model directly represented as GTS (that can be browsed and simulated with GROOVE). Modularity of CPM Configurations of CPM, i.e. global states of the system, can be partitioned into four main parts, which are also visible in Figure 1: (i) a representation of the underlying SCOOP program in the form of a control-flow graph; (ii) a system of concurrently running processors, each one possibly handling a request; these processors represent the system state; (iii) a waiting queue for each processor that stores pending requests; (iv) local memory state for each processor. The control flow component can be derived directly from the original CoreSCOOP program’s control flow graph (at a pre-compilation step) and its structure does not dynamically change, contrary to the state of the run-time environment (processors, queues, data). This partitioning is also mirrored by the GTS’s underlying rules that treat the walking of the control flow graph separately from the queue’s policies, the management of the memory, and global scheduling. The fixed simple interfaces (in form of the model components’ loose coupling due to the typed associations queue, handler, currentState, and requestType) between these modules allow us to plug in different behaviours for each module, e.g. different queueing semantics. Thus we can either adapt different existing SCOOP semantics (e.g. FIFO queues versus queues of queues [29]) or directly apply abstraction mechanisms in the context of verification (e.g. a counting abstraction of the queue’s content, or predicate abstraction for the data) by small modular changes to the underlying rules. Furthermore, the global abstract scheduling rules can be parameterised in this way, e.g. to include different kinds of garbage collection in the global scheduler or different rule prioritisations that keep the state space small, such as always preferring to terminate processors that are currently in a final state. 38 4 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model Simulating CPM in GROOVE We realised CPM—our run-time model for CoreSCOOP—in GROOVE, an established tool for simulating and analysing GTS-based semantics. This section describes how we approached and achieved this task. First, we justify our choice of GROOVE, and then show (by example) how CPM configurations, rules, and rule applications are represented in the tool. Finally, we discuss the issue of CPM’s soundness. 8 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model The GTS Tool GROOVE We chose GRaphs for Object-Oriented VErification (GROOVE) [14, 13] as A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi our platform to implement and analyse theAnCPM models. Most existing GTS tools are in theory expresexample of a CPM configuration in GROOVE is given sive enough to cover CPM. GROOVE however was already applied for the analysis of (non-concurrent) in Figure 2. This shows a subobject-oriented programs in Java [24]. graph Furthermore, GROOVE contains a (finite-state) model checker of a configuration that can be reached in the CPM encodthat has proven sufficient for the analysis and verification of dynamic state systems [7, 18]. As reported ing of the full dining philosoin [31], GROOVE can typically handle phers systems up(see to[26]). 4 million states, which should leave enough SCOOPwith program are two Processors in this room for our first experiments. Finally, There GROOVE convinced us with a gentle learning curve, its ease of configuration, but only one (APadaption and extension to our needs, as PLICATION) well as itsisactive community. currentlydevelopment executState init method = "APPLICATION.make" in Op Action aexp constant assign value = 1 var = "v_1" out Data_Var name = "v_2" value = 2 Data_Var Data_Var name = "v_1" name = "v_3" var value = 1 value = 1 var State out var Data in Action new name = "FORK" ref = "r_1" 9 ref Ref_Var name = "r_1" handler Processor name = "APPLICATION" Data points_to handler lock Processor name = "FORK" in_method ing a method (current_state). State in This Processor has both a referAction Action to (points_to)CPM and a lock command assign_ref Representing CPM Configurations inence GROOVE configurations are represented out State in GROOVE out State in method = "FORK.make" ref = "r_2" on the FORK processor (i.e. it has ref = "r_1" value = "r_1" quite straightforwardly, with control-flow, systemrightstate, waiting queue(s), and memory state (as in the the exclusive to enqueue requests). Neither Processor is stor- Implementing CPM Semantics in GROOVE The semantics of CPM is implemented via a set of type graph of Figure 1) all encoded in the same graph. 2: Afalling CPM rendered GROOVE rules, broadly intoconfiguration one of three categories: actionin rules, processor rules, and error ing any method parameters, and GROOVE Figure Action rules are used to fire transitions in the control-flow subgraph. Processor rules handle preControl-flow is rendered as static their waiting queues are empty. rules. and post-processing, e.g. expression evaluation, parameter instantiation, waiting queue insertion, exiting from final states. Error rules are used to detect irregular or undesirable states (their use in verification is State transition systems in the graph. These Data_Var discussed in Section 6). We use rule priorities extensively to prevent “unnecessary” interleavings of rule init applications name = "v_2" method = "APPLICATION.make" organised by priority to prevent unnecessary interleavings. comprise State nodes, where entry value = 2 Rules: priorities to prevent unnecessary interleavings. Interleaving limited to processors proceeding in acrossData_Var actions. Higher-priority rules handle pre-/post-processing, e.g. expression evaluation / cleanup points are labelled with init and a Data_Var Op Action aexp en/dequeieing, instantiating parameters, which is local to processor. Progress as much as possible, inname = "v_1" name = "v_3" constant assign terleave on action steps. Fine-grained priorities when order doesn’t matter, e.g. constant vs. variable method name, and exit points with fi- value var valueDo =as1 much as possible value = 1 step (universal quantifiers of GROOVE). =1 evaluation. in a single var = "v_1" ongoing work: experimenting with optimisation that progresses actions as much as possible when nal. A transition between two State var var out effects are local, interleave at synchronisation points. Ref_Var Data how many rules for actions, how many rules for scheduler, rules for errors. State Data ref name = "r_1" nodes is encoded as a pair of edges (in Referee comments: need MORE examples and data about the implementation, which is a core in handler contribution. Example of rule application? Basicpoints_to data, e.g. number of rules for control flow structures and out) and an Action node labelled handler and execution? Action Referee comment: example rule uses methods although there are no objects. We need to explain Processor new lock with a CPM action (e.g. command, Processor since name = methods "FORK"execute on encapsulated data, name = "FORK" what “method” means in this context (it’s object-like, = "APPLICATION" but notname true O-O since we cannot have more than one object on a single processor). ref = "r_1" query, lock, assign). Encoding actions Let us take a closer look at the GTS rule implementing an active processor taking a transition, labelled current_state out by a command action, and targeting a processor, the lock of which (for the sake of simplicity) is already as nodes—as opposed to labelled edges held. Recall that in SCOOP and thus in CPM, commands are asynchronous remote method calls on State in between states—facilitates a clean way Action Action of modelling action parameters. Simcommand assign_ref out State in out State method = "FORK.make" ref = "r_2" ple action parameters, such as a variref = "r_1" value = "r_1" able to assign to, are encoded as attributes of Action nodes; compound ac- Simulating CPM Actions in GROOVE IGNORE TEXT BELOW Figure 2: A CPM configuration rendered in GROOVE tion parameters on the other hand, such The semantics of CPM is implemented via a set of GROOVE rules, broadly falling into one of three action rules, rules, and error rules.incident Action rules used to nodes. fire transitions in as a Boolean expression to be evaluated,categories: are modelled asprocessor abstract syntax trees toare Action the control-flow subgraph. Processor rules handle pre- and post-processing, e.g. expression evaluation, Furthermore, for actions that trigger methods other processors (i.e. commands, queries), anrules arbitrary parameteron instantiation, waiting queue insertion, exiting from final states. Error are used to detect irregularrepresent or undesirabledata states (their useinstantiated in verification is discussed in Section 6). use rule number of method parameter nodes (which to be and available forWethe du-priorities ration of a method) can be attached to the corresponding Action nodes. These encode, via attributes, the parameter name, as well as the integer or reference variable to instantiate and pass as the method parameter. System state, waiting queue(s), and memory state are rendered as dynamic parts of the graph. Each Processor node handles a Data node. Data nodes are incident to Data_Var and Ref_Var nodes, which respectively store the handling Processor’s integer variables (via attributes) and reference variables (via A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 39 edges). Processors may hold locks on other Processors (represented by lock edges), and may be in a control State (represented by a current_state edge). Furthermore, they have waiting queues of requests to be executed, represented as “linked lists” of Queue_Item nodes over next-labelled edges. Each such node is labelled with the method (i.e. the particular transition system) to be executed, and is attached to nodes that store the values of any method parameters expected. An example of a CPM configuration in GROOVE is given in Figure 2. This shows a subgraph of a configuration that can be reached in the CPM encoding of the full Dining Philosophers SCOOP program (see [26]). There are two Processors in this configuration, but only one (APPLICATION) is currently executing a method (current_state). This Processor has both a reference to (points_to) and a lock on the FORK processor (i.e. it has the exclusive right to send requests). Neither Processor is storing any method parameters, and their waiting queues are empty. Simulating CPM Actions in GROOVE The semantics of CPM is simulated in GROOVE by two sets of graph transformation rules: action rules, and scheduling rules. Action rules facilitate the firing of transitions in the control-flow part of the graph, and the corresponding updates to the system and memory state. They model the basic behaviours of SCOOP processors: variable assignment, condition evaluation, processor creation, asynchronous commands, synchronous queries, and simultaneously (un)locking multiple processors. An action rule can be applied to a CPM configuration when: (i) a processor is in a control-flow state incident to a correspondingly-labelled action; and (ii) the prerequisites of the action are satisfied, e.g. every processor targeted by a lock action is available to be locked. Action rules are atomic, in that the firing of a transition occurs in a single, indivisible step (e.g. locking multiple processors occurs instantly, as it appears to SCOOP programmers). This is achieved by extensive use of GROOVE’s powerful matching constructs such as universal quantification, which allows for a single rule to handle arbitrarily many instances of particular sub-structures (e.g. arbitrary numbers of method parameters). Furthermore, action rules are assigned the same (and lowest) priority in GROOVE, meaning that non-determinism (and thus interleaving) is modelled at the level of atomic processor actions, as opposed to partial evaluations (thereby mitigating one source of state space explosion). Scheduling rules handle queues, local scheduling of each processor (e.g. advancing to the next request), and any local pre- or post-processing required for action rules; more generally, they advance processors as much as possible in-between actions. While action rules necessarily model non-determinism— different interleavings model different orders in which requests are enqueued, and thus potentially different program outcomes—scheduling rules avoid it as much as possible, since the steps between actions are local to processors. This is achieved by rule priorities in GROOVE. In particular, all scheduling rules have higher priorities than action rules, meaning that all local scheduling is simulated before exploring the non-determinism of actions. Furthermore, no two scheduling rules have the same priority, ensuring that their execution is as deterministic as possible to reduce the number of states to explore. Assigning such fine-grained rule priorities did, however, require some care. It is ultimately unimportant, for example, whether a constant or variable in an expression is evaluated first, so we arbitrarily fixed the priority of the scheduling rule for constants to be higher. On the other hand, if we had assigned the scheduling rule for terminating requests (i.e. in final states) to be of higher priority than scheduling rules that perform post-processing immediately after actions (e.g. “resetting” an evaluated expression after assigning it), then a fault would have been introduced into the model. Let us take a closer look at the action rule for commands, depicted in Figure 3 using GROOVE’s colour coding. Recall that in SCOOP (and thus in CPM), a command is an asynchronous remote method 40 Towards Graph-Based Verification for an Object-Oriented Concurrency Model9 A. Heußner, C.M. Poskitt,Practical C. Corrodi, and B. Morandi State current_state Active Processor & its Data Processor lock string in name points_to Ref_Var ref Action command method param param string method processor Data State init method processor string current_state instance @ Param_Ref insert_into method Param_Data 8 out State Processor handler ref 8 @ instance @ @ Param_Data param Queue_Item param Param_Ref Command Action with Parameters Transition in Control Flow New Request Figure 3: Example action rule for commands in GROOVE (GROOVE’s rule colour coding: dashed blue elements only exist on the left-hand side of rule (thus will be deleted), bold green elements on the right-hand side (thus will be generated), black ones persist) call on a concurrently running processor10that is locked byPractical the current processor. point of the Model Towards Graph-Based VerificationThe for anstarting Object-Oriented Concurrency rule is an active processor that is currently in a state (current_state) that could fire a command action. instantiated parameters. This is then inserted into the target Processor’s waiting queue via a separate, The command action is given by the following: (i) a pointer (points_to) from a reference variable highly prioritised scheduling rule. For illustration, the result of applying the action rule to Figure 2 is (Ref_Var) to the target Processor; (ii) thegiven name of the method totransition call, via ofthethe Action node;contains in Figure 4. Observe that the has an beenattribute fired, and that resulting Queue_Item the same method name as the Action node, and is waiting to be enqueued by the processor and (iii) some number of instantiated method parameters (Param_Data, Param_Ref). The firing of the that the reference variable r_1 points to. rule advances the processor’s current state IGNORE (current_state) TEXT BELOWand at the same time generates a new request (as Queue_Item) equipped with the State Data_Var init method name and all (via “∀”) “8”) instanname = "v_2" method = "APPLICATION.make" value = 2 tiated parameters. This is then later inin Data_Var Data_Var Op Action serted into the target Processor’s waitaexp name = "v_1" name = "v_3" constant assign var value = 1 value = 1 ing queue via a separate, highly priori- value = 1 var = "v_1" var var out tised scheduling rule. For illustration, Ref_Var Data State Data ref name = "r_1" the result of applying the action rule in points_to handler handler Action to Figure 2 is given in Figure 4. ObProcessor new lock Processor name = "FORK" name = "FORK" serve that the transition has been fired, name = "APPLICATION" ref = "r_1" insert_into that the resulting Queue_Item contains out Queue_Item State the same method name as the Action method = "FORK.make" current_state in node, and that it is waiting to be enAction Action command assign_ref out State queued by the Processor that the referin out State method = "FORK.make" ref = "r_2" ref = "r_1" value = "r_1" ence variable r_1 points to. The current prototype of CPM is available at [26]. How many rules for actions, how many rules for scheduler? Referee comments: need MORE examples and data about the implementation, which is a core At present, it comprises 19 action rules contribution.Figure Example4: of rule application? data, e.g. number of rules for control Effect of theBasic command rule on Figure 2 flow structures and execution? and 34 scheduling rules. Referee comment: example rule uses methods although there are no objects. We need to explain what “method” means in this context (it’s object-like, since methods execute on encapsulated data, but not true O-O since we cannot have more than one object on a single processor). Soundness Formally establishing the soundness (or “faithfulness”) of CPM is an important step, which NOTE FOR FINAL VERSION: check that this is a true reflection of how parameters are currently would rely on either the existence of a working definitive language semantics, or an in-depth comparison with Soundness • discussing faithfulness of CPM would require a fixed formal semantics for SCOOP/ CoreSCOOP (which does not exist) or an in-depth comparison with existing semantic approaches • latter requires a more stringent formal representation of CPM, e.g. by graph programs with an operational semantics, and corresponding semantic proofs (equivalence, simulation, etc.) • beyond scope of the paper (but important step for future work) • for this paper, which is about the first piece of the puzzle, we took a more lightweight approach to the issue A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 41 one of the proposed semantic approaches to SCOOP. Since the former is lacking, we have attempted to be faithful to the comprehensive operational semantics proposed by Morandi et al. [19] which is “executable” in Maude. To prove soundness with respect to this semantics would however require a more stringent formal representation of CPM, e.g. as graph programs [22], and corresponding semantic proofs (e.g. equivalence/(bi-)simulation). We are addressing this as ongoing work, but it is beyond the scope of this first, proof-of-concept paper. In the meantime, we took a more lightweight approach to gain confidence in the soundness of CPM, through example-driven testing and an expert review. For the former, we looked at the SCOOP examples supplied with the EiffelStudio IDE, which demonstrate idiomatic usage of SCOOP’s concurrency mechanisms to solve a number of classical synchronisation problems. We focused on two programs in particular—Dining Philosophers and Single-Element Producer Consumer—which only ever create one object per processor, and thus were CoreSCOOP programs that straightforwardly map to CPM actions (recall that CPM does not model the notion of multiple local objects). With these programs, we then tested the faithfulness of CPM by: (i) visualising and manually inspecting program executions in the GROOVE simulator; (ii) exploring the state space for abnormal states (e.g. unsatisfied action pre-requisites, such as the absence of a lock edge for a command) using the LTL model checker (see Section 6); and (iii) comparing the effects of action rules against the informal and formal descriptions of SCOOP in [19]. In addition to testing, we also held a one-day “expert review” with B. Morandi and other SCOOP researchers from ETH, during which we demonstrated and discussed the CPM rules in detail with the goal to ensure that the rules fully corresponded to their understanding of SCOOP/CoreSCOOP. 5 Towards Full-Fledged SCOOP, Approximations, and Translations In this section, we look beyond CPM and CoreSCOOP to consider three ongoing extensions to the work. First, we describe our effort to extend the model with full object-orientation, and thus make it expressive enough for a wider class of SCOOP programs. Second, we discuss how CPM can be used as a basis for exploring alternative SCOOP semantics and model approximations. Finally, we report on a prototype tool for automatically generating GROOVE input from SCOOP (and thus also CoreSCOOP) programs. From CPM to CPM+OO CPM allowed us to “boil down” SCOOP to the core of its asynchronous, concurrent behaviour, and study it in a formal setting without the full complexity of object-orientation. Our aim however is practical verification, and in practice, SCOOP programmers extensively use objects: ultimately we need to support them. The benefits of a simpler formal model aside, one might wonder why we did not start with full object-orientation from the outset if practical verification was always in mind. This is because it allowed a separation of concerns: we could first isolate and model concurrency-viaprocessors in a clean, simple setting, and then separately extend it with the object-oriented and Eiffelspecific languages features that are not core to the concurrency model. Our modelling approach has essentially been to identify this core, formalise it, then gradually add the missing details and behaviours. We are extending CPM to CPM with Object-Orientation (CPM+OO), a richer run-time model capable of expressing and simulating SCOOP programs with multiple objects per processor and non-separate method calls (i.e. targetting local objects). The present version of CPM+OO is the result of the following process: (i) replacing simple data in the CPM type graph with objects; (ii) updating the rules that then no longer conform, in consultation with the semantics of [19]; and (iii) testing (including regression testing for CoreSCOOP programs). Our first goal was to support all of the existing actions of CPM, but with data organised into objects. 42 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model We began by updating the type graph, replacing simple data with object nodes connected to attributes; attributes being integers (as before) or references to other objects (not processors). The advantage in changing the type graph first is the instant feedback from GROOVE, which highlights the rules that no longer conform and thus need updating (i.e. every rule that processed or extracted data). In general, these were not radical updates: the core behaviour captured in CPM remained the same, and the semantics of actions did not fundamentally change. What had to be updated was the structure of data that sat on top of this core, as well as remote calls to processors which became remote calls to objects. In other words, the question we were asking at each step was “how do we correctly embed objects into the semantics of this action” and emphatically not “how do we model this asynchronous behaviour for objects”. With CPM “objectified”, we could turn to modelling behaviours only possible with data organised into objects, most notably, non-separate calls (calls to objects on the same processor). There is of course no reason to acquire locks in the non-separate case, and the processor simply executes the method immediately. To model this, we had to first model the call stack, also allowing us to capture recursion and local variables—important, practical details, but ultimately on top of (and not crucial to) the concurrency at the core. The present prototype of CPM+OO, available to download from [26], includes all of the features discussed, as well as arbitrary names for attributes (e.g. buffer instead of r_1), separate queries in expressions, reference expressions, and (optional) postcondition checking. To gain confidence that the extension to CPM+OO remained sound, we followed a similar testing approach to that described in Section 4, but using a wider selection of the example SCOOP programs distributed with EiffelStudio (since the model is now expressive enough to simulate them). In addition, we also: (i) used a number of simple sequential programs (i.e. SCOOP programs with only one processor) to focus some testing on the new rules for non-separate calls; and (ii) performed “regression testing”, in the sense of ensuring that CoreSCOOP programs do not behave differently in CPM+OO to basic CPM. CPM+OO does not yet cover all of SCOOP: many of the Eiffel-specific mechanisms (agents, once routines, exceptions) and their interactions with SCOOP have not been captured, nor have some advanced run-time mechanisms such as separate callbacks. We also have ignored inheritance for the moment (following [19]), viewing it as an advanced typing mechanism and a separate problem for us to tackle. We do not anticipate substantial difficulty in adding them to CPM+OO; it is our plan to eventually include them by the same methodology, which we view as a promising, practical means of facilitating verification for a rich, complex concurrency model like SCOOP. Run-Time Alternatives and Approximations An alternative to this gradual extension of CPM is to use it as a basis for exploring and prototyping alternative semantics. For SCOOP this is particularly important, since the model has so many competing semantics; most recently a proposal to replace each FIFO queue with a queue of queues [29]. Changing the GTS implementation of the waiting queue, for example, is relatively straightforward due to the model’s modularity (see Section 3). Rather than changing the SCOOP compiler first, and risking the discovery of fundamental problems after having committed the time, we propose modifying CPM first, comparing execution traces, and ensuring that the changes retain the high-level guarantees of the model and any other desired properties. We are exploring this usage of CPM as ongoing work, but envisage that such prototyping can be achieved in an analogous way to adding object support: modify the type graph first (e.g. replace the FIFO queue with a queue of queues), revise the affected rules, and test. A similar idea is to implement approximations of CPM directly in the GTS, by plugging in different scheduling rules. As an example, we replaced the FIFO queues of processors with bags (see [26]), thereby removing the guarantee of processors executing their requests in the order they were received. A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 43 This is an over-approximation in the sense that all the behaviours of FIFO queues are included in the state space, but several other infeasible behaviours are included too (hence verification of the approximation implies verification of the program, but a counterexample may simply be spurious). Going further, we could, for example, over-approximate CPM by a Petri net (also represented as a GTS). Translating SCOOP Programs to GROOVE We are developing a tool (to be published as part of a Master’s thesis) that automatically translates SCOOP programs to input graphs for GROOVE. The tool targets the same subset of the SCOOP language that CPM+OO prototype formalises (it completely handles, for example, all of the SCOOP programs in [26]). The current prototype first creates a syntax tree of the input classes using the ANTLR4 parser generator in conjunction with an existing SCOOP grammar. Since the input graph requires some typing information (for example, there are different action nodes for integer and reference assignment), the tool passes through the syntax tree twice; first to gather typing information, and then again to generate an intermediate representation of the program that is closely related to the input graph. Finally, the tool passes through the intermediate representation and generates the corresponding input graph as an XML file conforming to the Graph eXchange Language. This graph can then be interpreted and analysed by GROOVE. 6 Verification of SCOOP Programs In this section we explore how a SCOOP program, once translated to our run-time model in GROOVE, can be verified by (bounded) model checking. After discussing the kinds of properties that can be checked, we illustrate the detection of deadlock in a faulty Dining Philosophers SCOOP solution, and obtain some first verification impressions in a small evaluation of five SCOOP programs. Verification The GROOVE model checker can be used for automatic analyses that are based on the idea of determining the presence (or absence) of a state that violates some expected property of the program. One such property—the absence of deadlocks—provided the initial motivation for this work. The range of properties that can be verified, however, is much broader; two contrasting examples include the absence of calls to void (null) object references, and the absence of states that violate postconditions (see [26]). This is achieved by extending the run-time model with a set of error rules (assigned the highest priority) that match if and only if the current configuration violates a particular property. An error rule for deadlock, for example, will match if there is a cycle of processors in states preceding lock actions, such that each lock action requires, in turn, a resource held by the next in the cycle. To catch a void call, on the other hand, an error rule will match if a processor is in a state immediately before an action that targets a void reference variable. Then, verification by model checking is simply a matter of expressing—in a temporal logic formula over rules—that none of these error rules are ever applied in the state space. For programs that have an infinite state space (our examples here do not, but those derived from general SCOOP programs may), GROOVE supports bounded model checking, which, although unable to fully guarantee correctness, does provide a means of searching for the presence of counterexamples. See [7] for details on bounded model checking with GROOVE. Recall the Dining Philosophers example from Listing 1. This implementation avoids the possibility of deadlock because the eat method requires the simultaneous acquisition of locks on the handlers of the forks (in CPM, this implicit locking is expressed in a single action). Suppose that the philosophers instead call bad_eat, as given in Listing 2. This implementation permits executions that lead to deadlock, since philosophers now pick up their forks in turn (which in CPM, then maps to two distinct locking actions). 44 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model Listing 2: Snippet of a Dining Philosophers implementation that may deadlock 1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency bad_eat do print ( " P h i l o s o p h e r " + Current . id . out + " w aListing i t i n g 2:f oSnippet r l e f of t af oDining r k .%N" ) Philosophers implementation that may deadlock pickup_left_then_right ( left_fork ) 1 bad_eat 2 do end print ( " P h i l o s o p h e r " + Current . id . out + " w a i t i n g f o r l e f t f o r k .%N" ) pickup_left_then_right ( left : separate FORK 34) pickup_left_then_right ( left_fork ) do 5 end 6 pickup_left_then_right print ( " P h i l o s o p h e r " + Current . id . out + " w a i t i n g f o r r i(gleft h t : fseparate o r k .%N"FORK ) ) 7 do pickup_right ( right_fork ) 8 print ( " P h i l o s o p h e r " + Current . id . out + " w a i t i n g f o r r i g h t f o r k .%N" ) end 9 pickup_right ( right_fork ) 10 end pickup_right ( right : separate FORK ) 11 pickup_right ( right : separate FORK ) do 12 do -- Here , eating takes place 13 -- Here , eating takes place 14 end end In particular, if every philosopher locks the hanRef_Var Ref_Var name = "r_2" name = "r_2" dlers of their left forks by reaching line 8, ref ref the system will deadlock since every fork is points_to points_to Data Data locked, preventing the philosophers from entering Processor Processor pickup_right. Using the error rules for deadname = "FORK" name = "FORK" handler handler lock and the model checker of GROOVE, faulty lock lock executions are automatically unearthed and reProcessor Processor ported, i.e. paths through the state space from the name = "PHILOSOPHER" name = "PHILOSOPHER" initial configuration to states exhibiting the struccurrent_state current_state tural “deadlock pattern”. The relevant part of such Action Action lock out State in out State lock a deadlocked state for two philosophers is given State in lock_1 = "r_1" lock_1 = "r_2" in Figure 5. Here, the philosophers have already Referee comments: larger evaluation, i.e. examples recently formalised by Claudio (including locked their left forks, and both are waiting tospace reduction results). Figure 5: Anodeadlocked CPM“other configuration comments: comparison against analysis approaches of both examples”. P lock their right ones (on reference variables r_2). Referee some words to explain why we don’t do this. Since the right fork of each philosopher is the already-locked left fork of the other, neither processor can fire the action, and the system is deadlocked. Evaluation We performed a small study on the model checking of our running example, as wel While this particular bug is somewhat contrived, does illustrate a discorda between theProducer-Consumer programanotheritSCOOP program implementing single-element scenario (both av online [26]). While these programs are smaller than what one might write in practice, we wanted mer’s level of abstraction—“here are the concurrent objects that my method needs”—and a run-time that initial impressions about the size of graphs, the size of state spaces, and the performance of GROO attempts to handle it all under the hood, but can ultimately programmer ignores (ortool is unaware First, wefail usedifthethe current version of our translation to generate input graphs from the D of) how it works. Beyond this example, there are more subtle ways in which deadlock can unintentionally Philosophers program—both a version that calls eat (DPE) and a version that calls bad_eat (D and [28]. the single-element Producer-Consumer program (PC). Then, for these programs, we recorde and accidentally be introduced in SCOOP programs about graph sizes, the time to check for deadlock, the time to explore the full (finite) state spaces, a amount of memory used. Table 1 presents this information, computed on an off the shelf workstatio Intel Core i7-4810MQ CPU and 16 GB presented values are the medians of fiv Evaluation To obtain some initial impressions of verification performance, wemain ranmemory. a smallThe study on the Here, n refers to the number of philosophers (in DPE and DPB) or the number of elements to prod current CPM+OO prototype. We devised ten benchmarks from various configurations of five SCOOP PC). Time was measured using the GNU time utility; the results represent the elapsed (wall clock programs: Dining Philosophers, both a version in that callsMemory eat (DPE) and another calls integrated bad_eat seconds. usage was extracted from that GROOVE’s profiling. Finally, the explo (DPB), single-element Producer Consumer (PC), Dining Savages (DS), and Cigarette Smokers (CS). These are available at [26] and were adapted (i.e. to replace unsupported features like inheritance) from the example SCOOP programs provided with EiffelStudio (except for CS, which we implemented). First, we used the current version of our translation tool to generate input graphs. Then, for these programs, we recorded data about graph sizes, the time to check for deadlock, the time to explore the full (finite) state spaces, and peak memory usage. Table 1 presents this information, computed on an off-the-shelf workstation with Intel Core i7-4810MQ CPU and 16 GB main memory. The presented values are the medians of five tests. Here, n refers to the number of philosophers (for DPE and DPB), the number of elements to produce (for PC), or, for DS, respectively the pot size, number of A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 45 Table 1: First impression of verification performance Program (n) DPE (2) DPE (5) DPB (2) DPB (5) PC (5) PC (20) DS (2,2,2) DS (2,3,2) DS (2,4,1) CS Start Graph (nodes/edges) 326/496 326/496 322/488 322/488 371/563 371/563 440/668 441/668 441/668 559/866 Final Graph (nodes/edges) 362/582 389/653 378/644 447/836 393/621 393/621 470/749 478/769 486/789 608/1000 LTL Deadlock time (s) (states/transitions) 1.10 824/838 32.37 20,428/20,906 0.84 708/712 175 74,942/77,378 3.51 2,152/2,194 12.98 8,362/8,539 11.48 5,976/6,081 388 103,190/106,260 2,448 396,011/414,462 417 65,275/70,008 time (s) 1.18 29.10 1.33 204 3.30 12.84 10.82 256 941 370 Full state space (states/transitions) Mem. [stddev] (GB) 824/838 0.65 [0.11] 20,428/20,906 4.23 [0.98] 1,108/1,134 0.55 [0.09] 122,714/127,425 5.62 [0.20] 2,152/2,194 0.64 [0.14] 8,362/8,539 1.42 [0.24] 5,976/6,081 1.41 [0.32] 103,190/106,260 5.71 [0.29] 306,401/319,018 7.28 [0.63] 65,275/70,008 5.27 [0.23] savages, and hunger. Time was measured using System.nanoTime(); the results represent the elapsed (wall clock) time in seconds. Memory usage was measured using Java’s MemoryPoolMXBean and related classes. Finally, the exploration strategies used were bfs/final/infinite and ltl(prop = !F error_deadlock)/final/infinite for the full state space and LTL exploration respectively. The graph sizes differ little between initial and final states, with the only variation due to the creation and manipulation of processors, their waiting queues, and objects in the local memory. Note the performance discrepancy between LTL checking and full state space exploration. For DPB, which may deadlock, LTL checking is faster since finding one counterexample is enough to return an answer. For all the other programs, which do not deadlock, checking the formula incurs an overhead. Across most of the benchmarks, we would argue that the times are acceptable and practical (especially given the infeasibility of model checking the Maude semantics [19]). An exception is DS, where the overhead for LTL checking is substantial for n = (2, 4, 1). Understanding the reasons for this is part of an ongoing, broader investigation into the scalability and limits of the tool for verifying SCOOP programs. 7 Conclusion Related Approaches for GTS-based Specification and Analysis of Concurrent OO Programs Verifying concurrent object-oriented programs with GTS-based models is an emerging trend in software specification and analysis, especially for approaches rooted in practice. See [23] for a good overview discussion, based on a lot of personal experience, on the general appropriateness of GTS for this task. Closest to our semantic run-time model is the QDAS model presented in [12], which represents an asynchronous, concurrent waiting queue based model with global memory as GTS, for verifying programs written in Grand Central Dispatch. Despite the formalisation as GTS, there is, however, no direct compiler to GTS yet. The Creol model of [17] focuses on asynchronous concurrent models but without more advanced remote calls via queues as needed for SCOOP. Analysis of the model can be done via an implementation in a term rewriting tool [16]. Existing GTS-based models for Java only translate the code to a typed graph similar to the control-flow sub-graph of CPM [24, 6]. A different approach is taken by [9], which abstracts a GTS-based model for concurrent OO systems [10] to a finite state model that can be verified using the SPIN model checker. GROOVE itself was already used for verifying concurrent distributed algorithms on an abstract GTS level [13], but not on a run-time level as in our approach. However, despite the intention to apply generic frameworks for the specification, analysis, and verification of object-oriented concurrent programs, e.g. in [30, 8], there are no existing publicly available tools implementing this long-term goal that are powerful enough for SCOOP. 46 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model Outlook Our current approach allows for automatically verifying SCOOP programs, with the help of a simple toolchain consisting of a compiler from SCOOP to a GTS-based run-time model that then can be analysed and verified with GROOVE. A streamlined instance of our toolchain, including a publicly available version of the compiler, will be available soon at [26]. As already mentioned, our run-time model can be seen as another operational semantics for SCOOP programs: a more detailed formal comparison with competing formalisations, e.g. [19], is currently on the way based on a more stringent formalisation of the CPM model and its extensions. The given verification approach and modelling choices can also be applied to other concurrent asynchronous libraries and languages, e.g. the alternative concurrent Eiffel model CAMEO [3], and the existing GTS formalisation of Grand Central Dispatch [12]. As a future step, we want to include verification approaches beyond the strategies of GROOVE, which will depend on novel abstraction techniques for CPM (and its extensions), e.g. in the spirit of pattern abstraction [25], or cluster abstraction [1]. As a lot of verification properties can be boiled down to MSO properties on the underlying GTS, we also plan to enrich the verification techniques for concurrent asynchronous object-oriented programs with ideas from program logics for GTS, e.g. as detailed in [15, 22]. We also plan to publish the current toolchain in a more convenient front end by providing a bridge from existing SCOOP IDEs to GROOVE. Funding/Acknowledgements. The underlying research was partially funded by the European Research Council under FP7/2007-2013 / ERC Grant agreement no. 291389. We thank B. Meyer and the SCOOP community for valuable “scooped” discussions and A. Rensink for feedback on the internals of GROOVE. Finally, we thank the anonymous GaM referees for their insightful comments, which helped to improve this paper. References [1] P. Backes & J. Reineke (2014): Analysis of Infinite-State Graph Transformation Systems by Cluster Abstraction. In: Proc. VMCAI 2015, LNCS 8931, Springer, pp. 135–152, doi:10.1007/978-3-662-46081-8_8. [2] P. Baldan, A. Corradini & B. König (2008): Unfolding Graph Transformation Systems: Theory and Applications to Verification. In: Concurrency, Graphs and Models, LNCS 5065, Springer, pp. 16–36, doi:10.1007/978-3-540-68679-8_3. [3] P. J. Brooke & R. F. Paige (2009): Cameo: an alternative model of concurrency for Eiffel. Formal Aspects of Computing 21(4), pp. 363–391, doi:10.1007/s00165-008-0096-1. [4] P. J. Brooke, R. F. Paige & J. L. Jacob (2007): A CSP model of Eiffel’s SCOOP. Formal Aspects of Computing 19(4), pp. 487–512, doi:10.1007/s00165-007-0033-8. [5] G. Caltais & B. Meyer (2014): Coffman Deadlocks in SCOOP. In: Proc. NWPT 2014. Online version at http://arxiv.org/abs/1409.7514. [6] A. Corradini, F. L. Dotti, L. Foss & L. Ribeiro (2004): Translating Java Code to Graph Transformation Systems. In: Proc. ICGT 2004, LNCS 3256, Springer, pp. 383–398, doi:10.1007/978-3-540-30203-2_27. [7] G. Delzanno & R. Traverso (2013): Specification and Validation of Link Reversal Routing via Graph Transformations. In: Proc. SPIN 2013, LNCS 7976, Springer, pp. 160–177, doi:10.1007/978-3-642-39176-7_11. [8] F. L. Dotti, L. M. Duarte, L. Foss, L. Ribeiro, D. Russi & O. Marchi dos Santos (2005): An Environment for the Development of Concurrent Object-Based Applications. In: Proc. GraBaTs 2004, ENTCS 127, Elsevier, pp. 3–13, doi:10.1016/j.entcs.2004.12.026. [9] A. P. Lüdtke Ferreira, L. Foss & L. Ribeiro (2007): Formal Verification of Object-Oriented Graph Grammars Specifications. In: Proc. GT-VC 2006, ENTCS 175, Elsevier, pp. 101–114, doi:10.1016/j.entcs.2007.04.020. [10] A. P. Lüdtke Ferreira & L. Ribeiro (2005): A Graph-based Semantics For Object-oriented Programming Constructs. In: Proc. CTCS 2004, ENTCS 122, Elsevier, pp. 89–104, doi:10.1016/j.entcs.2004.06.053. A. Heußner, C.M. Poskitt, C. Corrodi, and B. Morandi 47 [11] Grand Central Dispatch (GCD) Reference. https://developer.apple.com/library/mac/ documentation/Performance/Reference/GCD_libdispatch_Ref/index.html. Acc.: Dec. 2014. [12] G. Geeraerts, A. Heußner & J.-F. Raskin (2013): Queue-Dispatch Asynchronous Systems. In: Proc. ACSD 2013, IEEE, pp. 150–159, doi:10.1109/ACSD.2013.18. [13] A. H. Ghamarian, M. de Mol, A. Rensink, E. Zambon & M. Zimakova (2012): Modelling and analysis using GROOVE. Intern. J. on Softw. Tools for Techn. Trans. 14(1), pp. 15–40, doi:10.1007/s10009-011-0186-x. [14] GRaphs for Object-Oriented VErification GROOVE (project web page). http://groove.cs.utwente. nl/. Acc.: Dec. 2014. [15] A. Habel & K.-H. Pennemann (2009): Correctness of high-level transformation systems relative to nested conditions. Mathem. Struct. in Comp. Sci. 19(2), pp. 245–296, doi:10.1017/S0960129508007202. [16] E. B. Johnsen, O. Owe & E. W. Axelsen (2005): A Run-Time Environment for Concurrent Objects With Asynchronous Method Calls. In: Proc. WRLA 2004, ENTCS 117, Elsevier, pp. 375–392, doi:10.1016/j.entcs.2004.06.012. [17] E. B. Johnsen, O. Owe & I. Chieh Yu (2006): Creol: A type-safe object-oriented model for distributed concurrent systems. Theor. Comput. Sci. 365(1-2), pp. 23–66, doi:10.1016/j.tcs.2006.07.031. [18] H. Kastenberg & A. Rensink (2006): Model Checking Dynamic States in GROOVE. In: Proc. SPIN 2006, LNCS 3925, Springer, pp. 299–305, doi:10.1007/11691617_19. [19] B. Morandi, M. Schill, S. Nanz & B. Meyer (2013): Prototyping a Concurrency Model. In: Proc. ACSD 2013, IEEE, pp. 170–179, doi:10.1109/ACSD.2013.21. [20] P. Nienaltowski (2007): Practical framework for contract-based concurrent object-oriented programming. Doctoral dissertation, ETH Zürich. [21] J. S. Ostroff, F. Ahmadi Torshizi, H. F. Huang & B. Schoeller (2009): Beyond contracts for concurrency. Formal Aspects of Computing 21(4), pp. 319–346, doi:10.1007/s00165-008-0073-8. [22] C. M. Poskitt & D. Plump (2014): Verifying Monadic Second-Order Properties of Graph Programs. In: Proc. ICGT 2014, LNCS 8571, Springer, pp. 33–48, doi:10.1007/978-3-319-09108-2_3. [23] A. Rensink (2010): The Edge of Graph Transformation - Graphs for Behavioural Specification. In: Graph Transformations and Model-Driven Engineering, LNCS 5765, Springer, pp. 6–32, doi:10.1007/978-3-64217322-6_2. [24] A. Rensink & E. Zambon (2009): A Type Graph Model for Java Programs. In: Proc. FMOODS 2009, LNCS 5522, Springer, pp. 237–242, doi:10.1007/978-3-642-02138-1_18. [25] A. Rensink & E. Zambon (2012): Pattern-Based Graph Abstraction. In: Proc. ICGT 2012, LNCS 7562, Springer, pp. 66–80, doi:10.1007/978-3-642-33654-6_5. [26] Supplementary Material. http://www.swt-bamberg.de/gam2015_supp/. [27] F. A. Torshizi, J. S. Ostroff, R. F. Paige & M. Chechik (2009): The SCOOP Concurrency Model in Javalike Languages. In: Proc. CPA 2009, Concurrent Systems Engineering Series 67, IOS Press, pp. 7–27, doi:10.3233/978-1-60750-065-0-7. [28] S. West, S. Nanz & B. Meyer (2010): A Modular Scheme for Deadlock Prevention in an Object-Oriented Programming Model. In: Proc. ICFEM 2010, LNCS 6447, Springer, pp. 597–612, doi:10.1007/978-3-64216901-4_39. [29] S. West, S. Nanz & B. Meyer (2015): Efficient and reasonable object-oriented concurrency. In: Proc. PPoPP 2015, ACM, pp. 273–274, doi:10.1145/2688500.2688545. [30] E. Zambon & A. Rensink (2011): Using Graph Transformations and Graph Abstractions for Software Verification. In: Proc. ICGT-DS 2010, ECEASST 38. [31] E. Zambon & A. Rensink (2014): Solving the N-Queens Problem with GROOVE - Towards a Compendium of Best Practices. In: Proc. GT-VMT 2014, ECEASST 67.
6cs.PL
Optimal model order reduction with the Steiglitz-McBride method for open loop data ⋆ arXiv:1610.08534v1 [cs.SY] 26 Oct 2016 Niklas Everitt a, Miguel Galrinho a, Håkan Hjalmarsson a a ACCESS Linnaeus Center, School of Electrical Engineering, KTH - Royal Institute of Technology, Sweden Abstract In system identification, it is often difficult to find a physical intuition to choose a noise model structure. The importance of this choice is that, for the prediction error method (PEM) to provide asymptotically efficient estimates, the model orders must be chosen according to the true system. However, if only the plant estimates are of interest and the experiment is performed in open loop, the noise model may be over-parameterized without affecting the asymptotic properties of the plant. The limitation is that, as PEM suffers in general from non-convexity, estimating an unnecessarily large number of parameters will increase the chances of getting trapped in local minima. To avoid this, a high order ARX model can first be estimated by least squares, providing non-parametric estimates of the plant and noise model. Then, model order reduction can be used to obtain a parametric model of the plant only. We review existing methods to perform this, pointing out limitations and connections between them. Then, we propose a method that connects favorable properties from the previously reviewed approaches. We show that the proposed method provides asymptotically efficient estimates of the plant with open loop data. Finally, we perform a simulation study, which suggests that the proposed method is competitive with PEM and other similar methods. Key words: System identification, Steiglitz-McBride, High order ARX-modeling, maximum likelihood. 1 Introduction The prediction error method (PEM) is a well-know approach for estimation of parametric models [5]. If the model orders are chosen correctly, a quadratic cost function provides asymptotically efficient estimates when the noise is Gaussian. The drawback is that, in general, PEM requires solving a non-convex optimization problem, which can converge to minima that are only local. Alternative methods, such as subspace [15] or instrumental variable [10] methods, do not suffer from nonconvexity, being useful to provide initialization points for PEM. Other methods first estimate a high order (nonparametric) model. In general, this is an ARX model, for which the global minimum of the prediction error cost function can be found by least squares. Because ⋆ This work was supported by the Swedish Research Council under contract 2015-05285 and by the European Research Council under the advanced grant LEARN, contract 267381. The material in this paper was not presented at any conference. Email addresses: [email protected] (Niklas Everitt), [email protected] (Miguel Galrinho), [email protected] (Håkan Hjalmarsson). Preprint submitted to Automatica it is high order, this estimate will have high variance. However, it can be reduced to a parametric model description of low order. If the model reduction step is performed according to an exact maximum likelihood (ML) criterion, the low order estimates are asymptotically efficient [16]. This approach still requires, in general, solving a non-convex optimization problem. Another possibility to perform model order reduction from a high order non-parametric model is with the weighted null-space fitting (WNSF) method [2]. Although it can be motivated by an exact ML criterion, this criterion is not minimized explicitly. Rather, it is interpreted as a weighted least squares problem by fixing the parameters in the weighting. One problem with estimation of parametric models is the choice of model orders. If this choice can sometimes be based on physical intuition for the plant, the noise model order is usually a more abstract concept. This has been observed in [8], where a frequency domain method is proposed to estimate a parametric model of the plant and a non-parametric noise model. Because this approach does not require a noise model order selection, it can be seen as more user friendly. If the data are obtained in open loop, the asymptotic 29 January 2018 by properties of the plant and noise model estimates obtained with PEM are uncorrelated, if the two transfer functions are independently parametrized [5]. Therefore, when a parametric noise model estimate is not of interest, asymptotically efficient estimates of the plant can be obtained as long as the noise model order is chosen high enough for the system to be in the model set. The limitation of choosing the noise model order arbitrarily large with PEM is that, as more parameters are estimated, the complexity of the problem increases, and it is more difficult to find the global minimum. yt = G◦ (q)ut + H ◦ (q)et , (1) where G◦ (q) and H ◦ (q) are rational functions in the time shift operator q −1 (q −1 xt := xt−1 ) according to ◦ ◦ l1◦ q −1 + · · · + lm q −ml L◦ (q) l G (q) = ◦ = ◦ , ◦ q −mf F (q) 1 + f1◦ q −1 + · · · + fm f ◦ ◦ H ◦ (q) = However, if a non-parametric ARX model is estimated, there are no issues with local minima, while the order is arbitrarily large. Then, for the model reduction step, an approximate asymptotic ML criterion allows separating the estimation of the plant and noise model [16]. This allows obtaining asymptotically efficient estimates of the plant in open loop without the high order structure of the noise model affecting the difficulty of the problem. Nevertheless, the model reduction step still requires solving a non-convex optimization problem. The ASYM method [17] is based on this approach. 1 + c◦1 q −1 + · · · + c◦mc q −mc C ◦ (q) = ◦ . ◦ D (q) 1 + d◦1 q −1 + · · · + d◦md q −md The transfer functions G◦ , H ◦ , and 1/H ◦ are assumed to be stable. The polynomials L◦ and F ◦ —as well as C ◦ and D◦ —do not share common factors. Let the input sequence {ut } be a realization of a stochastic process generated by a random sequence {wt }. Also, let Ft−1 be the σ-algebra generated by {es , ws , s ≤ t − 1}. Then, the following assumption applies for the input signal. Assumption 2.2 (Input) The sequence {ut } is defined by Another approach that does not require a parametric noise model is the BJSM method [18]. This method uses a non-parametric ARX model estimate to pre-filter the input and output data, creating a pre-filtered data set for which the output noise is approximately white. Then, a noise model is no longer required when estimating the plant based on the pre-filtered data set. Instead of explicitly minimizing a non-convex function, BJSM applies the Steiglitz-McBride to the pre-filtered data set. In [18], it is shown that this procedure is asymptotically efficient in open loop. However, there are two limitations. First, even if the true noise model is known exactly, a non-parametric estimate is still required to achieve efficiency. Second, although the method does not apply local non-linear optimization techniques, the number of Steiglitz-McBride iterations needs to tend to infinity to obtain a consistent estimate. ut = Fu (q)wt , where Fu (q) is a stable and inversely stable finite dimensional filter, where {wt } is independent of {et }, satisfying E [wt |Ft−1 ] = 0,   E wt2 |Ft−1 = σ◦2 , |wt | ≤ C, ∀t for some finite positive finite constant C. Assumption 2.2 implies that the system is operating in open loop. Also, Fu can be interpreted as the stable minimum phase spectral factor of the input spectrum. For the noise, the following assumption applies. Our contributions are the following. First, we make a connection between ASYM and BJSM, and propose a method—termed Model Order Reduction SteiglitzMcBride (MORSM)—connecting ideas from both. Second, we show that MORSM is asymptotically efficient in open loop with one iteration. Third, we perform a simulation study, where we observe that MORSM has better finite sample convergence properties than BJSM, and that it is a viable alternative to PEM. Assumption 2.3 (Noise) {et } is a stochastic process that satisfies E [et |Ft−1 ] = 0, |et |10 ≤ C, ∀t for some positive finite constant C. 3 2   E e2t |Ft−1 = σ◦2 , Preliminaries The Prediction Error Method The idea of the prediction error method (PEM) is to minimize a cost function of the prediction errors. In this section, we discuss how PEM can be used to estimate a model of the system (2.1). First, we consider a BoxJenkins (BJ) model, and then a high order ARX model. Assumption 2.1 (True system) The system has scalar input ut , scalar output yt and is subject to scalar noise et . The relationship between these signals is given 2 3.1 for brevity) Box-Jenkins model In a Box-Jenkins model, G(q) and H(q) are rational transfer functions parameterized independently, according to yt = G(q, θ)ut + H(q, α)et , MCR and (3) " ◦ − FG ◦ H ◦ Γm −π 1 F ◦ H ◦ Γm #" #∗ ◦ − FG ◦ H ◦ Γm 1 F ◦ H ◦ Γm Φu dω, (4) An important remark is that minimizing the loss function (5) is a non-convex optimization problem. Therefore, a good initialization point is required to converge to the global minimum. For Box-Jenkins models, an initialization point that is sufficiently close to the global minimum is particularly challenging to obtain. Moreover, the problem becomes yet more challenging if we want to let the order of the noise model H(q, α) be arbitrarily large, as PEM will have increased problems with local minima. ◦ We assume that H (q) is in the model set defined by H(q, α) (i.e., mc ≥ m◦c and md ≥ m◦d ). Moreover, the order of the polynomials of G◦ (q) are assumed to be known (i.e., mf = m◦f and ml = m◦l ). For simplicity of notation only, we also assume that m := mf = ml . The one step ahead prediction errors of the BJ model (2) are given by 3.2   L(q, θ) D(q, α) yt − ut . εt (θ, α) = C(q, α) F (q, θ) High order ARX model To circumvent the limitations of solving a non-convex optimization problem, we consider the following approach. Note that the system (1) can be represented as The parameter estimates using PEM with a quadratic cost function are determined by minimizing the loss function N 1 X 2 ε (θ, α), N t=1 t π When {et } is Gaussian, PEM with a quadratic cost func−1 tion is asymptotically efficient, meaning that MCR corresponds to the Cramér-Rao lower bound—the smallest possible asymptotic covariance matrix for a consistent estimator [5]. Again, we recall that only the orders of G◦ (q) need to be chosen correctly to achieve efficiency, while H(q, α) only needs to include H ◦ (q). Thus, if only a model for G◦ (q) is of interest, and the order of H ◦ (q) is unknown, mc and md can be let grow to infinity (guaranteeing that H ◦ (q) is in the model set) without asymptotically affecting the estimate of θ. L(q, θ) l1 q −1 + · · · + lml q −ml G(q, θ) = = , F (q, θ) 1 + f1 q −1 + · · · + fmf q −mf C(q, α) 1 + c1 q −1 + · · · + cmc q −mc H(q, α) = = , D(q, α) 1 + d1 q −1 + · · · + dmd q −md VN (θ, α) = Z h i⊤ with Γm (q) = q −1 . . . q −m and Φu the spectrum of the input {ut }. (2) where h i⊤ θ = f 1 . . . f mf l 1 . . . l ml , h i⊤ α = c1 . . . cmc d1 . . . dmd . 1 = 2πσ◦2 A◦ (q)yt = B ◦ (q)ut + et , (6) where (5) ∞ X 1 =: 1 + a◦k q −k , A (q) := ◦ H (q) ◦ k=1 where N is the number of data samples. We denote PEM by θ̂N the estimate of θ obtained by minimizing (5). Moreover, θ◦ corresponds to the vector θ evaluated at the coefficients of F ◦ (q) and L◦ (q). ∞ X G◦ (q) =: b◦k q −k B (q) := ◦ H (q) ◦ k=1 are stable transfer functions (by Assumption 2.1). Since the system operates in open loop (Assumption 2.2), it is well known that, when PEM is applied to the model (2), the asymptotic covariance matrix of the PEM parameter estimate θ̂N is given by [5] Consider also the ARX model A(q, η n )yt = B(q, η n )ut + et , where i h −1 PEM PEM , − θ◦ )⊤ = σ◦2 MCR lim N E (θ̂N − θ◦ )(θ̂N N →∞ A(q, η n ) = 1 + where (we omit the argument of the transfer functions n X k=1 3 ak q −k , B(q, η n ) = n X k=1 bk q −k ,(7) and n n where R̄n and r̄n are the limits of RN and rN w.p.1, respectively. h i⊤ η n = a1 . . . an b 1 . . . b n . Here, we assumed, without loss of generality, that A(q) and B(q) are both modeled with n coefficients. Note that (6) is not in the model set defined by (7) due to the truncation by n coefficients. Nevertheless, the stability assumption on G◦ (q) and 1/H ◦ (q) implies that {a◦k } and {b◦k } are sequences converging to zero. Thus, if n is chosen large enough, (7) can model (6) with good accuracy. To guarantee that the true system (6) is asymptotically in the model set defined by the ARX model (7), n should be allowed to grow to infinity. Accordingly, we let the model order depend on the sample size N . For our theoretical results, we use the following assumption. Assumption 3.1 (Model order) It holds that An advantage of ARX models is that they are linear in the model parameters. In particular, the PEM estimate of η n is obtained by minimizing the cost function VN (η n ) = N 1 X [A(q, η n )yt − B(q, η n )ut ]2 , N t=1 n(N ) → ∞, n(N )4+δ /N → 0, for some δ > 0. (8) n(N ) Introduce the notation η̂N := η̂N erence, which can be done by linear least squares. Thus, it can be solved as follows. Write (7) as where n −1 n := [RN ] rN , (10) sup n RN n rN ω N 1 X n = ϕ yt . N t=1 t and (11) A(ejω , η̂N ) − A◦ (ejω ) ( n RN n −1 if [RN ] + δ 2 I2n otherwise 2 < 2/δ 2 = O(m(N )), p m(N ) = n(N ) log N/N (1 + d(N )) + d(N ) ∞ X k=n(N )+1 n RN # B(ejω , η̂N ) − B ◦ (ejω ) d(N ) := where n RN,reg = " where In the analysis, we will use the slightly modified estimate n n n := [RN,reg ]−1 rN , η̂N (13) Lemma 3.1 Assume that Assumptions 2.1, 2.2, 2.3 and 3.1 hold. Then with probability 1, where N 1 X n n ⊤ ϕ (ϕ ) , = N t=1 t t (12) The asymptotic properties of η̂N have been established in [6]. We will need the following result on the rate of convergence of the ARX model. (9) Then, the least squares estimate of η n is given by n,ls η̂N and, for future ref- h i⊤ η◦n := a◦1 . . . a◦n b◦1 . . . b◦n , h i⊤ η◦ := a◦1 a◦2 . . . b◦1 b◦2 . . . . yt = (ϕnt )⊤ η n + et , h i⊤ ϕnt = −yt−1 . . . −yt−n ut−1 . . . ut−n . N →∞ N →∞ , |a◦k | + |b◦k | ≤ C̄ρn(N ) , (14) for some C̄ < ∞ and ρ < 1. n for some small δ > 0. The reason is that η̂N is easier to analyze statistically, while the first and second order n,ls n statistical properties of η̂N and η̂N are asymptotically identical [6]. PROOF. See Appendix A. Lemma 3.1 implies that, as N tends to infinity, the coefficients of A(q, η̂N ) converge to those of A◦ (q) = 1/H ◦ (q), and the coefficients of B(q, η̂N ) converge to those of B ◦ (q) = G◦ (q)/H ◦ (q). Therefore, B(q, η̂N )/A(q, η̂N ) can be used as a high order estimate of G◦ (q), and It follows from Assumption 2.2 and Assumption 2.3 (see [6] for details), n η̂N → η̄ n := [R̄n ]−1 r̄n , 4 1/A(q, η̂N ) as a high order estimate of H ◦ (q). We thus define these high order estimates by G(q, η̂N ) := B(q, η̂N ) , A(q, η̂N ) H(q, η̂N ) := timate G(q, θ). In this section, we discuss available approaches to do so. 1 . (15) A(q, η̂N ) 4.1 Despite the simplicity of ARX models, they are not appropriate to model (2.1) for most practical uses. As the order n is required to be arbitrarily large, the estimated model will have unacceptably high variance. Being a sufficient statistic, η̂N and its covariance can be used to obtain an estimate of θ that is asymptotically efficient. This can be done using an exact ML criterion [16]. Let η n (θ, α) be the parameter vector η n obtained from θ and α, satisfying the relations Nevertheless, the high order ARX model estimate can be used to obtain a model of low order, reducing the variance. This can be done efficiently without re-using the data. The reason is that the estimate η̂N and its covariance are asymptotically a sufficient statistic for our problem. To observe this, consider the infinite order ARX model yt = ϕ⊤ (16) t η + et , where h i⊤ ϕt := −yt−1 −yt−2 . . . ut−1 ut−2 . . . , (17) h i⊤ η := a1 a2 . . . b1 b2 . . . . (18) A(q, η) = = Ce − 12 2σ◦ N Y − 1 p e 2πσ◦2 t=1 PN ⊤ ⊤ η ϕt ϕt η+2 ϕ⊤ yt η t=1 t  e − 12 2σ◦ ⊤ 4 G(q, θ) . H(q, α) (20) −1 [η̂N − η n (θ, α)] , (21) where cov (η̂N ) denotes the covariance of the estimated vector η̂N . Since this covariance matrix is in general unknown, in practice the cost function (21) requires an approximation. We consider two possibilities that do not affect the asymptotic properties of the obtained estimates. One possibility consists in replacing [cov (η̂N )]−1 by a n consistent estimate—for example, RN [16]. In this case, we minimize PN y2 t=1 t . (19) where we treat σ◦2 as a known constant (in this case, because it is a scalar, it does not influence the estimation of the parameters of interest). Then, it follows from [4] P PN ⊤ ⊤ that RN := N t=1 ϕt ϕt and rN := t=1 ϕt yt form a sufficient statistic for the data y N . Alternatively, since −1 η̂N = RN rN , we can say that η̂N and RN are the sufficient statistic. However, when n is finite, there is a bias error induced by the truncation of the parameter sequences {ak } and {bk }. If that error is assumed to be n small, the estimate η̂N will contain practically the same information about the system dynamics as the data. If the order n is allowed to tend to infinity as a function of the sample size N , according to Assumption 3.1, then the estimate η̂N is, asymptotically, a sufficient statistic. Thus, the data could in principle be disregarded, and η̂N alone be used to obtain an estimate of a lower order model that is asymptotically efficient. t=1 B(q, η) = [η̂N − η n (θ, α)] [cov (η̂N )] yt −ϕ⊤ η t 2 2σ◦ PN 1 , H(q, α) This procedure consists in minimizing Then, the probability density function of y N := {yt }N t=1 given η is f (θ; y N ) = Exact Maximum Likelihood n [η̂N − η n (θ, α)] , [η̂N − η n (θ, α)]⊤ RN (22) which yields asymptotically efficient estimates of G(q, θ) and H(q, α). Because η n (θ, α) is nonlinear in general, minimizing (22) is a non-convex optimization problem. Another possibility is to write the covariance matrix as function of the low order parameters θ and α—denoted Rn (θ, α) (see [16] for details). In this case, we minimize the criterion ⊤ [η̂N − η n (θ, α)] Rn (θ, α) [η̂N − η n (θ, α)] , (23) Although minimizing (23) seems, at first sight, more complicated than minimizing (22), it is observed in [16] that the cost function (23) can be approximated by an asymptotic ML criterion that allows separating the estimation of G(q, θ) and H(q, α), while still providing asymptotically efficient estimates. Model Reduction Having estimated a high order ARX model, we are interested in using this estimate to obtain a low order es- 5 4.2 Consider the following three steps. First, an ARX model Asymptotic Maximum Likelihood (ASYM) F (q, θ)yt = L(q, θ)ut + et As shown in [16], minimizing (23) is asymptotically the same as minimizing Z 0 2π G(eiω , η̂N ) − G(eiω , θ) σ̂ 2 + 2π Z 2π Φu (eiω ) 2 |H(eiω , η̂N )| H(eiω , η̂N ) − H(eiω , α) 0 2 |H(eiω , η̂N )| 2 is estimated using least squares, providing an initilial0 ization estimate θ̂N . Second, the output and input are filtered by 2 dω ytf = 2 dω, (24) Z 2π 0 n G(eiω , η̂N ) − G(eiω , θ) 2 uft = 1 1 ) F (q, θ̂N ut . Φu (eiω ) |H(eiω , η̂N )| 1 providing a new estimate—θ̂N . Then, we can continue to iterate by repeating Steps 2 and 3. We define the k estimate obtained at iteration k by θ̂N . 2 dω. Notice that, since the true system has an OE structure, and we are estimating an ARX model, we are actually minimizing, in Step 1, the function (25) VN (θ) = 2  N  B(q, η̂N ) 1 X − G(q, θ) A(q, η̂N )ut . VN (θ) = N t=1 A(q, η̂N ) (26) Minimizing (26) is still a non-convex optimization problem. However, it is pointed out in [17] that this minimization problem has an advantage over directly estimating G(q, θ) using PEM, which makes the method numerically more reliable. Because the output is not used explicitly in (26), and the noise contribution is only present indirectly through the high order estimates, the influence of the disturbance is reduced. N 1 X 2 [F (q, θ)yt − L(q, θ)ut ] , N t=1 (27) which, evaluated at the true parameter θ◦ , equals VN (θ◦ ) = N 1 X 2 [F (q, θ◦ )et ] . N t=1 (28) From (28), we observe the true parameter θ◦ does not correspond to the cost function of a white sequence. 0 Consequently, the initialization estimate θ̂N is not consistent. However, at iteration k we have, evaluated at θ = θ◦ , " #2 N 1 X F (q, θ◦ ) VN (θ◦ ) = (29) et . k ) N t=1 F (q, θ̂N BJSM method So, assuming convergence to the true parameters (i.e., k θ̂N → θ◦ , as k → ∞ and N → ∞), (29) asymptotically corresponds to (5) for an OE model structure. In alternative to using local non-linear optimization techniques, the BJSM method uses the SteiglitzMcBride iterations. The idea of BJSM is to first estimate a high order ARX model and then apply the Steiglitz-McBride method [12] to a data set pre-filtered by the ARX model estimate. The estimates obtained are asymptotically efficient in open loop. Because BJSM uses the Steiglitz-McBride, we start by reviewing the latter. 4.3.1 yt , F (q, θ)ytf = L(q, θ)uft + et , The idea of the ASYM method [17] is to minimize the time domain equivalent to (25) for finite sample size: 4.3 1 ) F (q, θ̂N Third, least squares is applied to the ARX model σ◦2 . where σ̂ is a consistent estimate of Because the first term in (24) is only dependent on G(q, θ) and the second term on H(q, α), G(q, θ) can be estimated by minimizing the first term. Then, the minimization problem we are interested in becomes VN (θ) = 1 Convergence of the Steiglitz-McBride has been studied in [14], where it is shown that the method is locally convergent when the additive output noise is white. Moreover, it will be globally convergent if the signal-to-noise ratio is sufficiently large. Assuming convergence, the estimates are asymptotically Gaussian distributed. However, in general, the covariance of the estimated param−1 eters does not asymptotically attain MCR . Steiglitz-McBride The setting for the Steiglitz-McBride algorithm is when the transfer function H ◦ (q) equals one (i.e., C ◦ (q) = D◦ (q) = 1). The objective is to estimate L(q, θ) and F (q, θ). The Steiglitz-McBride is thus an attempt to minimize (5), but it only does so consistently with additive white noise, and even then it is not asymptotically efficient. 6 4.3.2 would maintain the data set unchanged when applying the filtering (30), and BJSM would simply be reduced to the Steiglitz-McBride method, which is not asymptotically efficient. If, on the other hand, it is not assumed that A◦ (q) = 1 and an estimate A(q, η̂N ) is still computed, BJSM will be asymptotically efficient. Thus, although an FIR model is asymptotically a sufficient statistic for a system of OE structure (like the ARX model is for BJ structures) it is not possible to make use of this information when applying the BJSM method, since it does not exploit the full statistical properties of the high order model. BJSM In [18], the Box-Jenkins Steiglitz-McBride (BJSM) algorithm is introduced. This algorithm copes with two limitations of the Steiglitz-McBride. First, it is consistent for systems with BJ structure, instead of only OE. Second, it is asymptotically efficient for open loop data. The method uses the following procedure. First, an ARX model (7) is estimated with least squares. Second, the original data set is pre-filtered by A(q, η̂N ). Third, the Steiglitz-McBride algorithm is applied to the pre-filtered data set. As for the second limitation, we observe that although BJSM avoids solving a non-convex optimization problem by applying the Steiglitz-McBride algorithm, it has the disadvantage of requiring the number of iterations of the Steiglitz-McBride to tend to infinity in order to provide consistent and asymptotically efficient estimates [18]. To bypass this problem but still avoid a non-convex minimization procedure, we use the Steiglitz-McBride with the ASYM method. This will allow us to obtain an asymptotically efficient estimate in one iteration. Recall that, to be convergent, the Steiglitz-McBride algorithm requires that H ◦ (q) = 1. The main idea of BJSM is thus to use A(q, η̂N ) as an estimate of [H ◦ (q)]−1 and pre-filter the data according to ytpf = A(q, η̂N )yt , upf t = A(q, η̂N )ut . Then, the pre-filtered data satisfies ytpf = L◦ (q) pf u + A(q, η̂N )H ◦ (q)et , F ◦ (q) t (30) 5 Model Order Reduction Steiglitz-McBride which asymptotically is according to, due to Lemma 3.1, ytpf ≈ L◦ (q) pf u + et . F ◦ (q) t The objective of our approach is to minimize (26) without using a non-convex optimization method. To do so, we use an approach that combines ideas from ASYM and BJSM. (31) Since (31) is of OE structure, the Steiglitz-McBride algorithm can be applied to the data set {ytpf , upf t }. First, we write (26) as Notice that, if we were to apply PEM to the pre-filtered data set, we would minimize, motivated by (31), 2 N  1 X pf L(q, θ) pf y − VN (θ) = u . N t=1 t F (q, θ) t 2 N  1 X L(q, θ) B(q, η̂N )ut − A(q, η̂N )ut . N t=1 F (q, θ) (33) Then, we notice that (33) has the same form as (32) if we define VN (θ) = (32) To avoid an explicit non-convex minimization problem, we use the Steiglitz-McBride method instead. Although the Steiglitz-McBride is not asymptotically efficient, the BJSM method is when used with open loop data [18]. ytpf := B(q, η̂N )ut , upf t := A(q, η̂N )ut , (34) and thus the same idea (i.e., applying the SteiglitzMcBride to {ytpf, upf t }) can be used. However, not all the information in η̂N is being used, as the filtering (30) only uses A(q, η̂N ). In other words, the ARX model is not used as a sufficient statistic for this problem. For the method to still be asymptotically efficient, the output data are used when constructing the pre-filtering. This leads to two limitations. The only difference between this approach and BJSM is in the pre-filtered output. Comparing (34) and (30), we pf observe that upf t are defined similarly, but yt are different. The difference lies in the true output not being used to construct the new pre-filtered data set. Rather, it is simulated from the input and the ARX model estimate. Indeed, we can simulate the output with The first is a counter-intuitive result. Suppose that H ◦ (q) = 1 (i.e., the true system is already of OE structure). Then, we have that A◦ (q) = 1, and estimating a finite impulse response (FIR) model would suffice to asymptotically model the true system. However, this yts := 7 B(q, η̂N ) ut , A(q, η̂N ) (35) On the other hand, the alternative pre-filtering, which disregards the original data, satisfies   L◦ (q) pf B(q, η̂N ) L◦ (q) pf yt = ◦ u t + − upf t . (37) F (q) A(q, η̂N ) F ◦ (q) and then apply the same filter as in (30), but on the simulated output, according to ytpf = A(q, η̂N )yts = B(q, η̂N )ut , (36) obtaining the proposed pre-filter (34). This is a noise-free equation, except for the noisy parameters in the ARX model. However, from Lemma 3.1, the second term in (37) tends to zero asymptotically. As consequence, the variance of the error sequence being minimized by the Steiglitz-McBride iterations disappears asymptotically, and only one iteration is required. In summary, the proposed method is as follows: (1) estimate an ARX model using the input-output data {ut , yt }, t = 1, . . . , N , according to (10); pf (2) construct the pre-filtered data {upf t , yt }, according to (34); pf (3) apply the Steiglitz-McBride method with {upf t , yt } to obtain estimates L(q, θ̂N ) and F (q, θ̂N ) of L◦ (q) and F ◦ (q), respectively. We observe that the proposed method essentially consists of applying the Steiglitz-McBride algorithm to perform model order reduction based on an asymptotic ML criterion. We will thus refer to the method as Model Order Reduction Steiglitz-McBride (MORSM). The idea of using the Steiglitz-McBride to, in some sense, perform model order reduction, is not new. Variants of the Steiglitz-McBride method have been applied to estimate rational filters from an impulse response estimate, instead of applying the method directly to data (see, e.g., [1, 7, 9]). However, although some of these procedures are in some sense optimal under specific conditions, we consider a quite general system identification problem and motivate the application of the method based on an ML criterion. This, as we proceed to show, not only provides asymptotically efficient estimates under a quite general class of systems and external signals, but also does so in one iteration. Note that the pre-filtered data set (34) only depends on the original output data {yt } through the least squares estimate η̂N . With this method, we use the high order ARX model as an asymptotic sufficient statistic for our problem, and disregard the data without loss of information. Indeed, as will be shown in the next section, this procedure is asymptotically efficient for open loop data. Moreover, there are two advantages for disregarding the data after the high order ARX model has been estimated. Although these are formally shown in the next section, we observe them here, supported by intuitive explanations. 6 First, the pre-filter (34) uses the complete statistical information contained in the estimate η̂N . So, if the noise contribution affecting the true system (1) is white, a high-order FIR model can be estimated instead of an ARX. In this case, A(q, η̂N ) = 1. Asymptotic Properties In this section, we analyze both the convergence and asymptotic covariance of the proposed method. To derive these results, we will need a formal expression for the estimate of θ at iteration k + 1 of the MORSM algorithm. Define Second, this procedure asymptotically (in N ) only requires one iteration. To intuitively understand why this is the case, we recall why the Steiglitz-McBride is an iterative method. Note that the initialization step of the Steiglitz-McBride minimizes (27), which, when evaluated at the true parameters, as in (28), does not correspond to a cost function of white sequence. Therefore, 0 the initialization estimate θ̂N is biased. Then, we start iterating. At the first iteration, the cost function evaluated 0 0 at θ◦ is given by (29) with F (q, θ̂N ). Because F (q, θ̂N ) is biased, the true parameter will still not correspond to the cost function of a white sequence. Therefore, the 1 new estimate θ̂N will not be consistent either. However, by continuing to iterate, it can be shown that, under the k conditions observed in [13], θ̂N → θ◦ , as k → ∞ and N → ∞. Concerning the original BJSM method, since the pre-filtered data is according to (30), it is asymptotically approximately an OE model structure, and a similar procedure takes place. B(q, η) ut , yt (η◦ , θ) = F (q, θ) A(q, η) ut , yt (η◦ , θ) = ut (η, θ) = F (q, θ) yt (η, θ) = B ◦ (q) ut , F (q, θ) A◦ (q) ut , F (q, θ) and ξt (η, θ) = L◦ (q) B(q, η) − B ◦ (q) ut (η, θ) F ◦ (q) B ◦ (q) A(q, η) − A◦ (q) yt (η, θ). − A◦ (q) The same definition also applies to vector valued signals, such as (9). Using that the pre-filtered data set consists of filtered versions of ut and that G(q) can be represented both 8 using L◦ (q) and F ◦ (q) as well as using B ◦ (q) and A◦ (q), we have that 0 is, θ̂N is a consistent estimate of θ◦ . This was not the case for the BJSM algorithm. 1 1 L◦ (q)A◦ (q) ytpf = ◦ upf . (38) B(q, η̂N ) F (q)B ◦ (q) A(q, η̂N ) t For the asymptotic covariance, we have the following theorem. ut = Filtering (38) by F ◦ (q) Theorem 6.2 Let Assumptions 2.1, 2.2, 2.3, and 3.1 hold. Then, i h −1 k k , lim N E (θ̂N − θ◦ )(θ̂N − θ◦ )⊤ = σ◦2 MCR A(q, η̂N )B(q, η̂N ) , A◦ (q)F (q, η̂N ) N →∞ we arrive at the noise-free equation F ◦ (q) √ −1 k and N (θ̂N − θ◦ ) ∼ AsN(0, σ◦2 MCR ) for k ≥ 1, where N stands for the normal distribution. A(q, η̂N ) B(q, η̂N ) k k yt (η̂N , θ̂N ) = L◦ (q) ut (η̂N , θ̂N ) ◦ A (q) B ◦ (q) PROOF. See Appendix D. relating the pre-filtered data. Equivalently, k k k F ◦ (q)yt (η̂N , θ̂N ) = L◦ (q)ut (η̂N , θ̂N ) + F ◦ (q)ξt (η̂N , θ̂N ), From Theorem 6.2, we observe that the proposed method has the same asymptotic covariance as PEM with Gaussian noise (6). Therefore, it is asymptotically efficient with open loop data. Moreover, the asymptotic efficient estimate is obtained in one iteration, at k = 1. which can be written in regression form as k k ⊤ k ) = [ϕm (η̂N , θ̂N )] θ◦ + F ◦ (q)ξt (η̂N , θ̂N ). (39) yt (η̂N , θ̂N k Given θ̂N , the next parameter estimate in the Steiglitzk+1 , is defined as the least squares McBride iterations θ̂N estimate of θ◦ in the linear regression (39): k+1 θ̂N = [R m k −1 m k (η̂N , θ̂N )] r (η̂N , θ̂N ), 7 In this section, we perform two Monte Carlo simulations to study the performance of the method. First, we illustrate how it converges in one iteration of the Steiglitz-McBride, while BJSM does not. Then, we perform a study with random systems, and observe that the method often has better finite sample convergence properties than PEM. (40) where N 1 X m n n ⊤ R (η , θ) = ϕ (η , θ)(ϕm t (η , θ)) , N t=m+1 t m n rm (η n , θ) = 7.1 N 1 X m n ϕ (η , θ)yt (η n , θ). N t=m+1 t For the simulation, the data are generated by Theorem 6.1 Let Assumptions 2.1, 2.2, 2.3, and 3.1 hold. Then, as N → ∞, w.p. 1, One iteration scheme In the first simulation, we compare MORSM and BJSM. The practical difference between these methods is in the pre-filtering only. In particular, MORSM does not use the noisy output to construct the pre-filtered data set. The consequence is that the method provides asymptotically efficient estimates in one iteration. Notice that (39) is a linear regression form of (37) with the notable difference that the error made in the ARX k model enters linearly into ξt (η̂N , θ̂N ). As before, the ARX model error tends to zero asymptotically. This is, in essence, what enables the following results. k θ̂N → θ◦ Simulations yt = for all k ≥ 0 q −1 + 0.1q −2 1 + 0.7q −1 u + et . t 1 − 1.2q −1 + 0.6q −2 1 − 0.9q −1 (41) One hundred Monte Carlo simulations are performed with eight sample sizes logarithmically spaced between N = 200 and N = 20000. The sequence {ut } is obtained by 1 wt , (42) ut = −1 1 − q + 0.89q −2 where {wt } and {et } are independent Gaussian white sequences with unit variance. PROOF. See Appendix B. Theorem 6.1 implies that the proposed algorithm achieves consistency in the initialization estimate—that 9 tion errors. The estimate corresponding to the minimizer of this cost function is asymptotically efficient, meaning that is has asymptotically the minimum possible covariance for a consistent estimator. The limitation is that this cost function is, in general, non-convex. Seeking the global minimum requires local non-linear optimization techniques, and it is not guaranteed to be found. As the number of parameters to estimate increases, PEM has increasingly more difficulty in finding the global minimum. RMSE 100 PEM MORSM1 MORSM100 BJSM1 BJSM100 10−1 10−2 In the following simulation, we will compare the performance of PEM and the proposed method with randomly generated systems, with structure 103 104 N yt = Fig. 1. Average RMSE as function of sample size for several methods, obtained from 100 Monte Carlo runs with a fixed system. where {ut } is given as in the previous simulation, and {et } is Gaussian white noise with variance chosen to obtain a signal-to-noise ratio We compare PEM, BJSM (one and 100 iterations), and MORSM (one and 100 iterations). All methods estimate a plant parameterized with the correct orders, and PEM also estimates a correctly parameterized noise model. For BJSM and the proposed method, an ARX model of order 50 is estimated in the first step. As the objective of this simulation is to observe convergence and asymptotic variance properties, PEM is started at the true parameters, and all methods assume known initial conditions. PN (ut )2 SNR = PN t=1 = 10. ◦ 2 t=1 (H (q)et ) (43) where g ◦ is the impulse response of G◦ (q) and ĝ is the impulse response of the estimated plant model. In Fig. 1, we observe that MORSM and BJSM perform similarly with 100 iterations for all the sample size range used. MORSM performs slightly worse with one iteration than with 100 for small sample sizes, but they have the same performance for larger N . However, the same is not true for BJSM with one iteration, for which the RMSE does not even decrease with increasing sample size. An important practical aspect in implementing the proposed method is how to choose the ARX model order, in case we do not previously have information of an appropriate order to choose. As we have seen, theoretically the ARX model order should tend to infinity as function of the sample size. However, for practical purposes it is sufficient to choose an order that can correctly capture the dynamics of the true system. We then propose the following procedure to choose the order of the ARX model. Since our objective is to minimize the loss function (5) using an indirect approach, we repeat the estimation for a grid of ARX model orders, and choose the low order model that minimizes (5). Since we do not compute a low order noise model, the highest order ARX polynomial A(q, η̂N ) is used instead of 1/H(q, α) when computing this loss function. Although this is a very noisy estimate, the error induced will be the same for every computation, and should not have a considerable influence In conclusion, if a sufficiently amount of iterations are performed, both MORSM and BJSM attain the asymptotic covariance of PEM. However, BJSM theoretically needs the Steiglitz-McBride iterations to tend to infinity, while MORSM only needs one iteration. 7.2 (45) The coefficients of L◦ (q) are generated from a uniform distribution, with values between −1 and 1. The coefficients of the remaining polynomials are generated such that F ◦ (q), C ◦ (q), and D◦ (q) have all roots inside a half-ring in the unit disc with a radius between 0.7 and 0.9, with positive real part. We do this with the objective of studying a particular class of systems: namely, the systems are effectively of fourth order (i.e., no poles are considerably dominant over others), they can be approximated by ARX models roughly of orders between 30 and 100, and they resemble physical systems. The results are presented in Fig. 1, where the average root mean square error (RMSE) of the impulse response from 1000 Monte Carlo runs is presented for each sample size. The RMSE is given by RMSE = kg ◦ − ĝk2 , l1◦ q −1 + l2◦ q −2 + l3◦ q −3 + l4◦ q −4 ut 1 + f1◦ q −1 + f2◦ q −2 + f3◦ q −3 + f4◦ q −4 1 + c◦1 q −1 + c◦2 q −2 + c◦3 q −3 + c◦4 q −4 et , (44) + 1 + d◦1 q −1 + d◦2 q −2 + d◦3 q −3 + d◦4 q −4 Comparison with PEM According to a prediction error criterion, the best model is the one that minimizes a cost function of the predic- 10 100 in choosing the best model. For the class of systems we consider, we choose the ARX model order from a grid of values between 25 and 125, spaced with intervals of 25. 90 FIT Moreover, when more than one iteration is used, the same criterion can be applied to optimize over the number of iterations—that is, we choose the model obtained at the iteration that minimizes the cost function (5). 80 PEM true PEM MORSM1 MORSM20 BJSM20 We compare the following methods: 70 • the prediction error method, initialized at the true parameters (PEM true); • the prediction error method, initialized with the standard MATLAB procedure (PEM); • the Box-Jenkins Steiglitz-McBride method, with 20 iterations (BJSM20); • the Model Order Reduction Steiglitz-McBride method, with 20 iterations (MORSM20); • the Model Order Reduction Steiglitz-McBride, with one iteration (MORSM1). 60 104 N Fig. 2. Average FIT for several methods, obtained from 100 Monte Carlo runs with random systems. With only one iteration, MORSM performs worse than with 20 iterations for the range of sample sizes used, but their performances becomes closer as larger sample sizes are used. Theoretically, we have shown that MORSM only requires one iteration to provide asymptotically efficient estimates. However, we observe that in practice (i.e., for finite sample size), MORSM performs better with more iterations, comparing MORSM1 and MORSM20 in Fig. 2. The fact that in practice MORSM requires more than one iteration to converge does not render it irrelevant in comparison to BJSM. As we observe in Fig. 2, BJSM with 20 iterations does not attain the same asymptotic performance of MORSM because 20 iterations do not seem to be sufficient for BJSM to converge in this simulation, while they are sufficient for MORSM. PEM stops with a maximum of 1000 iterations and a function tolerance of 10−5 , and estimates initial conditions. MORSM and BJSM truncate initial conditions. Note that a procedure to estimate initial conditions for this type of methods has been proposed in [3], but it is only applicable if the plant and noise model share the same poles (e.g., ARMA, ARMAX) or if the noise model poles are known (e.g., OE), which is not the case of BJ models. The performance of each method is evaluated by calculating the FIT of the impulse response of the plant, given by, in percent,   RMSE FIT = 100 1 − ◦ , kg − ḡ o k 103 8 (46) Conclusion In this paper, we propose a least squares method for estimation of models with a plant parameterized by a rational transfer function and a non-parametric noise model. We show that the method provides consistent and asymptotically efficient estimates of the plant if data are obtained in open loop. where ḡ o is the average of g ◦ . The results are presented in Fig. 2, with the average FIT as function of sample size. We assume that PEM, when initialized at the true parameters, converges to the global optimum. Comparing PEM initialized at the true parameters and with the standard MATLAB procedure, we conclude that the latter must sometimes fail to reach the global optimum. Essentially, the method performs model order reduction based on an asymptotic ML criterion using the SteiglitzMcBride method. We thus name it Model Order Reduction Steiglitz-McBride (MORSM). The method uses ideas from the ASYM and BJSM methods. However, unlike ASYM, we avoid a non-convex optimization procedure by applying Steiglitz-McBride; unlike BJSM, we propose a procedure that only requires one iteration to provide asymptotically efficient estimates. With 20 iterations, MORSM does not seem to reach the global minimum of the prediction error cost function for small sample sizes. However, for sample sizes around 4000 and larger, this minimum seems to be attained since MORSM performs similar to PEM initialized at the true parameters. This suggests that MORSM may be a viable alternative to PEM when PEM has difficulty in finding the global minimum. Finally, we perform two simulation studies to analyze the performance of the method, from which the following 11 By standard continuity arguments, with probability 1 are observed. First, MORSM is asymptotically efficient in one iteration, while BJSM is not. Second, even when extra iterations are required for convergence with finite sample sizes, MORSM still converges in less iterations than BJSM. Third, MORSM may be a viable alternative to PEM, specially when PEM has difficulty in finding the global minimum. Rm (η̂N , θ) > 0 for large enough N . Hence, for N large enough, using (39) in (40) Future work will include application of MORSM for closed loop and for estimation of systems embedded in networks. A k+1 k −1 θ̂N = θ◦ + [Rm (η̂N , θN )] N X 1 k k · ϕm (η n , θN )F ◦ (q)ξt (η̂N , θ̂N ). (B.4) N t=m+1 t Proof of Lemma 3.1 Now, since {ut } is uniformly bounded and 1/F (q, θ) is uniformly stable, it follows that The result follows from Theorem 3.1 in [6]. Next, we verify the conditions of that theorem. Assumption 2.1 and the finite dimensionality of G◦ and H ◦ implies that max(|ak |, |bk |) ≤ Cρk k ϕm t (η̂N , θN ) ≤ C1 , (A.1) for some C1 < ∞, and furthermore, by Lemma 3.1, it follows that for some C < ∞ and 0 < ρ < 1. This implies that Condition S1 holds. Furthermore, the bound (A.1) implies the inequality in (14) for some C̄ < ∞. Assumption 2.3 clearly implies Condition S2 (for any p ≤ 5). Assumption 3.1 implies Conditions D1 and D3. Thus all conditions in Theorem 3.1 of [6] have been verified and the result in the lemma follows from this theorem. B k F ◦ (q)ξt (η̂N , θ̂N ) = O(m(N )). It thus follows that Proof of Theorem 6.1 k+1 θ̂N − θ◦ = O(m(N )), Using Parseval’s formula, we have R̄(θ) = 1 2π Z π " −π #" #∗ −B ◦ Γm −B ◦ Γm ◦ A Γm ◦ A Γm (B.5) for any k ≥ 0 and Φu dω (B.1) |F (θ)|2 k+1 θ̂N − θ◦ → 0, as N → ∞, w.p. 1. We notice that R̄(θ) > 0 whenever θ is in the stability region for the coefficients of polynomials of degree m S̄ := {θ : F (z, θ) = 0 ⇒ |z| < 1} ⊂ R2m C This section includes a few results needed for the proof of Theorem 6.2 in Section D. We introduce the notation f (N ) = O(g(N )) Pn −k and LemmaPC.1 Assume that X(q) = k=1 xk q n −l Z(q) = l=1 zl q are stable filters and let v(t) be quasistationary. Then, to mean that f (N ) decays to zero with the rate g(N ), i.e., that there exists some positive constants C and N0 such that for all N ≥ N0 , N 1 X X(q)v(t)Z(q)v(t) N t=m+1 kf (N )k ≤ C|g(N )| as N → ∞. From Lemma 3.1 it follows that Rm (η̂N , θ) − R̄(θ) = O(m(N )). Auxiliary lemmas (B.2) for some C < ∞. (B.3) 12 2 ≤ kXk2 kZk2 C where PROOF. N 1 X k X(q)v(t)Z(q)v(t) N t=m+1 N n n X 1 X X xk vt−k zl vt−l = N t=m+1 k=1 = n X xk k=1 ≤ ≤ n X k=1 n X k=1 n X l=1 |xk |2 |xk | 2 zl 2 n X l=1 n X l=1 2 1 N 2 2 1 N vt−k vt−l |fki | ≤ Cλk , 2 for some C < ∞, − l) λ < 1, (C.7) and that there is a causal exponentially stable inverse vt−k vt−l t=m+1 N Rvv (k (C.6) Suppose that F1 , F2 and F3 are exponentially stable, i.e., for an exponentially stable Fi 2 t=m+1 N X (C.5) k=0 l=1 N X |zl |2 |zl | h i Γn (q) = q −1 . . . q −n , ∞ X Fi (q) = fki q −k . 2 2 F̃2 (q) = ∞ X f˜k2 q −k , k=0 ≤ kXk2 kZk2 C 2 , Let γ = [ P∞ k=1 dk q −k |f˜k2 | < Cλk . (C.8) 0 ] be exponentially stable. Then where the last equality is due to the quasi stationarity of v(t). kγ − PSn[γ]k2 ≤ Cλn , for some C < ∞, λ < 1. (C.9) Lemma C.2 Let Assumptions 2.1, 2.2, 2.3, and 3.1 be in force. Let Υ n be an m × 2n deterministic matrix, with m fixed. Then, we have that √ N Υ n (η̂N − η̄ n ) ∼ AsN(0, P ), (C.1) PROOF. We will construct an explicit approximation to γ that belongs to Sn . Let i hP ∞ −l F̃u γ = 0 , l=1 βl z which is exponentially stable since both γ and F̃2 are exponentially stable. Take as approximation for γ i hP n −l , γ̂n = β F (z)z 0 l=1 l 2 where P = σ◦2 lim Υ n [R̄n ]−1 (Υ n )⊤ , n→∞ (C.2) if the limit exists. which by construction belongs to SΨ . Introduce the noh i tation γ = γ1 γ2 . Hence PROOF. See [6, Theorem 7.3]. γk − PSΨ̃[γ] Lemma C.3 Let {xn } be a sequence of random variables that is asymptotically Gaussian distributed— {xn } ∼ AsN(0, P ). Let {Mn } be a sequence of random square matrices that converge in probability to a nonsingular matrix M , and {bn } be a sequence of random vectors that converges in probability to b. Also, let yn = Mn xn + bn . = F2 (z) F̃2 (z)γ1 − (C.3) ≤ kF2 (z)k2 Lemma C.4 Let Sn be the subspace of L22 spanned by the rows of 0 ∞ X 2 n X βl z −l l=1 βl z −l l=n+1 2 ! 2 ≤ Cλn , for some C < ∞ and λ < 1 since F2 and F̃2 γ are exponentially stable. PROOF. See [11, Lemma B.4]. F3 Γn ≤ kγ − γ̂n k2 n X = γ1 − βl F2 (z)z −l l=1 Then, yn converges in distribution to N (b, M P M ⊤ ). " # −F1 F3 Γn F2 Γn 2 , D Proof of Theorem 6.2 We start by using (B.4) to write √ k+1 −1 N (θ̂N − θ◦ ) = M N xN , (C.4) 13 where established using Lemma 3.1: k MN = Rm (η̂N , θN ) N X 1 k ◦ k xN = √ ϕm t (η̂N , θN )F (q)ξt (η̂N , θ̂N ). N t=m+1 k Ξm (η̂N , θN ) = O(m(N )) m k m ◦ Φ (η̂N , θN ) − Φ (η̂N , θ ) = O(m(N )) kΦm (η̂N , θ◦ ) − Φm (η ◦ , θ◦ )k = O(m(N )) k Ξm (η̂N , θN ) − Ξm (η̂N , θ◦ ) = O(m2 (N )) kΦm (η ◦ , θ◦ )k = O(1) From (B.3) and Theorem 6.1, for k ≥ 1, we have that MN → MCR , as N → ∞, For √future reference, we will establish the limit N m2 (N ). The dominating term in m(N ) is of p n(N ) log N/N and terms with d(N ) will be neglected. For N large enough, we have w.p. 1. Assume for now (we will prove it later) that xN ∼ AsN(0, P ). lim Then, using Lemma C.3, we have that √ k+1 −1 −1 N (θ̂N − θ◦ ) ∼ AsN(0, MCR P MCR ). D.1 (D.2) (D.3) (D.4) (D.5) (D.6) N →∞ √ √ log N N n(N )2 N →∞ N  2  4+δ 4+δ n(N ) log N = 0, = lim δ N →∞ N N 4+δ N m2 (N ) = lim (D.1) where the first term goes to zero by Assumption 3.1. xN Using Lemma C.1 and Lemma C.3 with (D.2) and (D.3), it follows that difference between xN and We will now establish the asymptotic distribution and covariance of xN . To this end, we first define " n N X 1 k √ Φm (η̂N , θ◦ )ut Ξm (η̂N , θN )ut N t=m+1 # −B(q, η )Γm 1 , F (q, θ) A(q, η n )Γm F ◦ (q) Ξm (η n , θ) := ◦ A (q)F (q, θ) " # h i A(q, η n ) − A◦ (q) · −B ◦ (q) A◦ (q) . B(q, η n ) − B ◦ (q) Φm (η n , θ) := (D.7) tend to zero as N → ∞ w.p.1, and therefore they have the same asymptotic distribution and the same asymptotic covariance. We will analyze (D.7) instead. Similarly, using Lemma C.1 and Lemma C.3 with (D.2) and (D.4), it follows that difference between (D.7) and N X 1 k √ Φm (η ◦ , θ◦ )ut Ξm (η̂N , θN )ut N t=m+1 k Then we rewrite ξt (η̂N , θN ) as B(q, η̂N ) (A(q, η̂N ) − A◦ (q))ut k ) A◦ (q)F ( q, θN A(q, η̂N ) (B(q, η̂N ) − B ◦ (q))ut + ◦ k ) A (q)F (q, θN B ◦ (q) (A(q, η̂N ) − A◦ (q))ut =− ◦ k ) A (q)F (q, θN A◦ (q) (B(q, η̂N ) − B ◦ (q))ut + ◦ k ) A (q)F (q, θN 1 k = ◦ Ξm (η̂N , θN )ut . F (q) k ξt (η̂N , θN )=− (D.8) tend to zero as N → ∞ w.p.1, and we will analyze (D.8) instead. Similarly, using Lemma C.1 and Lemma C.3 with (D.5) and (D.6), the difference between (D.8) and N 1 X m ◦ √ Φ (η , θ◦ )ut Ξm (η̂N , θ◦ )ut N t=m+1 (D.9) tend to zero as N → ∞ w.p.1, and we will analyze (D.9) instead. We can thus express xN as We rewrite Ξm (η̂N , θ◦ )ut as N X 1 k k xN = √ Φm (η̂N , θN )ut Ξm (η̂N , θN )ut . N t=m+1 #⊤ " −B ◦ (q)ut Γn 1 (η̂N − η̄ n ) Ξ (η̂N , θ )ut = ◦ A (q) A◦ (q)ut Γn 1 = ◦ ϕnt (η◦ , θ◦ )⊤ (η̂N − η̄ n ). (D.10) A (q) m We will in the remainder of the proof need some properties regarding the filters Φm and Ξm that are easily 14 ◦ with Thus, we have shown that xN has the same distribution and covariance as √ TN := Z n N (η̂N − η̄ n ), (D.11) γ= " ◦ − FG ◦ H ◦ Γm 0m×1 1 F ◦ H ◦ Γm 0m×1 # Fu , where where the last equality is due to the fact that the added column in the right argument of the inner product is multiplied by the zero column in γ when the inner product is taken. Hence, we can write the asymptotic covariance matrix of TN as N X F ◦ (q) n ϕm (η , θ ) Zn = ϕ (η◦ , θ◦ )⊤ , (D.12) ◦ ◦ t ◦ (q) t A t=m+1 and we will analyze TN instead. D.2   −1 lim E TN TN⊤ = σ◦2 hγ, Ψ i hΨ, Ψ i hΨ, γi Asymptotic covariance of TN N →∞ = σ◦2 hPSΨ[γ], PSΨ[γ]i , Using Lemma C.2, we have that (D.16) where SΨ is the subspace in L1×2 spanned by the rows 2 of Ψ . Lemma C.4 gives that, as n → ∞, Sγ ⊆ SΨ and TN ∼ AsN(0, Q), where   lim E TN TN⊤ = σ◦2 hγ, γi = σ◦2 MCR . N →∞ Q = σ◦2 lim Z n [R̄n ]−1 (Z n )⊤ , n→∞ (D.13) D.3 provided the right hand side limit exists. This will be shown next. We start by analyzing R̄n .   R̄n = E ϕnt (ϕnt )⊤ = hΨ, Ψ i , (D.14) Consider TN defined in (D.11). As observed in Section D.2, it follows from Lemma C.2 that TN ∼ AsN(0, σ◦2 MCR ). where hf, gi := Z Summing up (D.17) √ The asymptotic normality of N (θ̂N −√θ̂◦ ) follows from (D.1) and (D.17), together with that N (θ̂N − θ̂◦ ) has the same asymptotic distribution as TN . From (D.1) and (D.17), it now follows that π f (ejω )g(ejω )∗ dω, −π and with Ψ given by # " −G◦ Γn H ◦ Γn U◦ Ψ= Γn 0n×1 √ −1 k − θ◦ ) ∼ AsN(0, σ◦2 MCR ). N (θ̂N (D.18) References and U◦ is a spectral factor of the the covariance matrix of the input ut and the noise et , given by # " Fu 0 . U◦ = 0 σ◦ [1] A. G. Evans and R. Fischl. Optimal least squares time-domain synthesis of recursive digital filters. IEEE Transactions on Audio and Electroacoustics, 21(1):61–65, 1973. [2] M. Galrinho, C. R. Rojas, and H. Hjalmarsson. A weighted least-squares method for parameter estimation of structured models. In 53rd IEEE Conference on Decision and Control, pages 3322–3327, 2014. For (D.12), we have that   F ◦ (q) n n m ⊤ Z = E ϕt (η◦ , θ◦ ) ◦ ϕt (η◦ , θ◦ ) A (q) " #⊤  #" ◦ ◦ −G Γ u −B Γ u n t ◦ m t  = E  F◦ A Γ u Γ u n t F◦ m t *" # + # " G◦ − F ◦ H ◦ Γm 0n×1 −G◦ Γn 0n×1 = Fu Fu , 1 Γn 0n×1 F ◦ H ◦ Γm 0n×1 = hγ, Ψ i , (D.15) [3] M. Galrinho, C. R. Rojas, and H. Hjalmarsson. On estimating initial conditions in unstructured models. In 54th IEEE Conference on Decision and Control, pages 2725–2730, 2015. [4] E. L. Lehmann and G. Casella. Theory of point estimation. Springer texts in statistics. Springer, New York, 1998. [5] L. Ljung. System Identification. Theory for the User, 2nd ed. Prentice-Hall, 1999. [6] L. Ljung and B. Wahlberg. Asymptotic properties of the least-squares method for estimating transfer functions and disturbance spectra. Adv. Appl. Prob., 24:412–440, 1992. 15 [7] J. H. McClellan and D. Lee. Exact equivalence of the Steiglitz-McBride iteration and IQML. IEEE Transactions on Signal Processing, 39(2):509–5012, 1991. [8] J. Schoukens, Y. Rolain, G. Vandersteen, and R. Pintelon. User friendly Box-Jenkins identification using nonparametric noise models. In 50th IEEE Conference on Decision and Control, Orlando, Florida, USA, 2011. [9] A. K. Shaw. Optimal identification of discrete-time systems from impulse response data. IEEE Transactions on Signal Processing, 42(1):113–120, 1994. [10] T. Söderström and P. Stoica. Instrumental Variable Methods for System Identificaiton. Springer Verlag, New York, 1983. [11] T. Söderström and P. Stoica. System identification. PrenticeHall, Inc., 2001. [12] K. Steiglitz and L. E. McBride. A technique for the identification of linear systems. IEEE Transactions on Automatic Control, 10:461–464, 1965. [13] P. Stoica and M. Jansson. MIMO system identification: Statespace and subspace approximations versus transfer function and instrumental variables. IEEE Transactions on Signal Processing, 48(11):3087–3099, 2000. [14] P. Stoica and T. Söderström. The Steiglitz-McBride identification algorithm revisited—convergence analysis and accuracy aspects. IEEE Transactions on Automatic Control, 26(3):712–717, 1981. [15] P. van Overschee and B. de Moor. Subspace identification for linear systems: theory, implementation, applications. Kluwer Academic Publishers, Boston, 1996. [16] B. Wahlberg. Model reduction of high-order estimated models: the asymptotic ML approach. International Journal of Control, 49(1):169–192, 1989. [17] Y. Zhu. Multivariable System Identification for Process Control. Pergamon, 2001. [18] Y. Zhu and H. Hjalmarsson. The Box-Jenkins SteiglitzMcBride algorithm. Automatica, 65:170–182, 2016. 16
3cs.SY
Institutional Metaphors for Designing Large-Scale Distributed AI versus AI Techniques for Running Institutions arXiv:1803.03407v1 [cs.AI] 9 Mar 2018 Alexander Boer and Giovanni Sileno Abstract Artificial Intelligence (AI) started out with an ambition to reproduce the human mind, but, as the sheer scale of that ambition became apparent, quickly retreated into either studying specialized intelligent behaviours, or proposing overarching architectural concepts for interfacing specialized intelligent behaviour components, conceived of as agents in a kind of organization. This agent-based modeling paradigm, in turn, proves to have interesting applications in understanding, simulating, and predicting the behaviour of social and legal structures on an aggregate level. This chapter examines a number of relevant cross-cutting concerns, conceptualizations, modeling problems and design challenges in large-scale distributed Artificial Intelligence, as well as in institutional systems, and identifies potential grounds for novel advances. 1 Introduction These days, analogies carry easily between simulations of social settings and architectures for minds. We for instance casually speak of electronic and computational institutions as alternatives for traditional institutional arrangements, in recognition of the increasingly important role that the digital world, and automated decision making, plays within our social structures. Equally casually, normative multiagent systems, based on institutionalist vocabulary, may be introduced as a design metaphor for large-scale distributed Artificial Intelligence (AI). Alexander Boer Leibniz Center for Law, University of Amsterdam, Postbus 1030, 1000 BA, Amsterdam, the Netherlands. e-mail: [email protected] Giovanni Sileno LTCI, Télécom ParisTech, Université Paris-Saclay, 46, rue Barrault, 75013 Paris, France. e-mail: [email protected] 1 2 Alexander Boer and Giovanni Sileno Drawing from existing work in agent-based modeling in the area of law, we examine in this chapter a number of relevant cross-cutting concerns, conceptualizations, modeling problems and design challenges that apply to both large-scale distributed Artificial Intelligence and agent-based modeling and simulation of socialinstitutional structures. 1.1 Modeling the Mind As a discipline, Artificial Intelligence (AI) started out with an ambition to reproduce the human mind as a monolithic computer program. The problem of reproducing intelligence in technology was taken on as an ambitious functional decomposition exercise, with intelligence playing the role of the high-level function to be reproduced in a computer program through reconstruction from smaller functions realized by simple well-understood input-output modules. The nature of the constituent primitive modules was already clear to early computer scientists: logical inference and knowledge structures should play a key role, because introspection, common sense psychology and current concepts of rationality suggested so (Newell and Simon, 1976). The General Problem Solver of Newell, Shaw, and Simon (1959) may be considered the archetype of this approach, and is often used in this role in lectures about the history of AI. In architectures of this type, the problem of scaling up from the simplest toy examples of reasoning to plausible intelligent function, even in restricted cognitive niches, becomes one of managing a complex knowledge representation in a logic-based representation language, with the properties of the logical language enforcing some of the required modularity, or non-interaction, between the represented knowledge structures. As soon as this required modularity breaks down, that is, when knowledge structures interact in unforeseen and undesirable ways, the construction of the higher level function intelligence may catastrophically fail, in an obvious way if we are lucky, for instance if the constraints enforced by the representation language are violated, or insidiously, through unintelligent behaviour, in many other cases. The AI system following this architectural paradigm, from an engineering point of view, in a sense lacks sufficient adaptive capacity, or resilience, to reliably deal with the addition of new knowledge structures. 1.2 The Scale Problem The scale problem, in an architecture of this type, continually presents itself as a knowledge representation problem: there is always too little background knowledge available to correctly scope knowledge structures, and eventually the system will make inferences that are not true, and, more importantly, obviously not intelligent. Hence we historically find attempts in AI: Institutional Metaphors vs AI Techniques 3 • To uncover and study types of background assumptions like for instance the infamous frame assumption (Morgenstern, 1996) that are usually overlooked and threaten modularity; • To codify massive amounts of common sense background knowledge for general AI use (Lenat, 1995), in the hope of eventually reaching critical mass; • To find at least some knowledge structures that have universal appeal, and therefore exhibit the required modularity from an engineering point of view, and codify these as definitions into so-called top ontologies (Sowa, 1995) for reuse among the different modules of a distributed system, and • To try to scope defeasibility in logical reasoning (Pollock, 1975) and restore the required modularity by designing new logics and representation languages that deal with defeasibility in a principled manner, containing undesirable interactions between knowledge structures. The research tradition that deals with these problems is historically called the symbolic AI tradition. Its main impact is perhaps in steering away the mainstream philosophy of the field from mathematical logic and a disdain of logical inconsistency and irrationality, and bringing it towards more psychologically valid views of reasoning and rationality. Another, concurrent response to the scale problem has been to decompose the AI problem into two more manageable types of problems, licensing AI researchers to limit their attention to either: 1. studying well-defined specialized intelligent behaviours (e.g. playing chess, or recognizing human faces, or finding good solutions to a job-shop scheduling problem) in specific contexts of use, and 2. proposing overarching architectural concepts for interfacing specialized intelligent behaviour components. These are conceived of as agents, each competent in a limited number of intelligent behaviours, in a kind of virtual organization creating and maintaining the appearance of being one (more) generally intelligent agent to the outside world. Solving the first type of problem has direct, viable commercial applications that justify financing research, but is often belittled as not-really-AI due to its obvious lack of adaptive potential. Solving the second problem has traditionally received little attention, but in recent years is sometimes indirectly considered in the context of addressing the responsibility gap caused by increasing reliance on networks of autonomous systems (e.g. autonomous vehicles, or autonomous weapons). 1.3 Engineering a Mind as an Ecology of Minds For the purposes of this chapter, we are mainly concerned with the second problem: architectural concepts. Archetypical for this response are the agents in the visionary society of mind of Minsky (1988) (“The power of intelligence stems from our vast 4 Alexander Boer and Giovanni Sileno diversity, not from any single, perfect principle”, p. 308), but also the more concrete intelligent creatures of Brooks (1991) in Intelligence without representation. According to Brooks, the fundamental decomposition of intelligence should not be into modules which must interface with each other via a shared knowledge representation, but into independent creatures, that interface directly to an environment through perception and action, and exhibit a certain ecological validity within that environment, whatever that environment may be. The key takeaway here is to consider the relationship between the creature and the environment, niche, or ecology it lives in. Clearly, specialized intelligent behaviours in a specific niche can often be successfully isolated. Some problems, e.g. playing chess, may be successfully attacked with specialized, explicit knowledge representation and an appropriate search algorithm. Others, e.g. face recognition, are less amenable to solution by introspection, and may be achieved not with knowledge representation, but with machine learning algorithms on large databases of correctly labeled examples that exemplify the intelligent behaviour to be acquired. We are indeed increasingly becoming accustomed to the ability of computers to perform well in specific intelligent behaviours in specific contexts, often even beyond the levels of performance attainable to human beings. At the same time, we are aware that techniques do not generalize beyond a specific niche, and do not generally label them as intelligent, perhaps because we intuitively understand they lack the adaptive capacity that characterizes true intelligence. The second problem of AI identified above, i.e. of finding architectural concepts for creating and maintaining the appearance of being one agent, has given us multiagent systems, composed of multiple interacting agents in an environment, each with independent perception and action functions, and no global knowledge of the social system of which they are part. A key property of multi-agent system architecture is that there is no central controller agent with dictatorial powers over the others, as this would simply be the functional decomposition approach that does not work. Instead more complex forms of organization and control are investigated, always with the ulterior goal of improving adaptive capacity of systems. Although multi-agent system research has yielded many valuable theoretical insights into the functioning of organizations, no examples spring to mind of systems of practical value that successfully combine interesting sets of intelligent behaviours using this paradigm. It is however interesting to consider one well known system that does combine different intelligent behaviours and has demonstrated some success in finding the right intelligent creature for the right ecological niche: IBMs Watson (Ferrucci et al., 2010). Watson has, amongst other applications, shown great competence at winning the game show Jeopardy, and is famous mainly for that achievement. Clearly it does, from our perspective, only one thing very well: answering questions (QA). But the interesting thing is that it answers different kinds of questions using a number of completely different QA approaches with overlapping competence. Architecturally, it behaves like a coalition of intelligent QA creatures that compete against each other to produce the best answer to a question, and in the process of doing so it acquires feedback on its performance and becomes better at selecting the best competitor based on features of the question and the proposed Institutional Metaphors vs AI Techniques 5 answer. This competitive setting in itself is a convincing example of a winning departure from the traditional functional decomposition approach, and a move towards more interesting organizational metaphors. Multi-agent system technologies and concepts have thus far enjoyed most success indirectly as fuel for the agent-based modeling paradigm with interesting applications in understanding, simulating, and predicting the behaviour of real-world socio-legal structures on an aggregate level. However, agent-based modeling deals with a different type of problem, somehow dual to the ecological perspective illustrated above: settling which elements are required to specify one agents behaviour. Whereas specifications based on simple reflex architectures or mathematical functions are plausibly sufficient for studying certain phenomena of scale that may be understood even using simplistic models of economic rationality, the human vocabulary concerning social actors often refers to intentional and normative categories, focusing primarily on qualitative rather than quantitative aspects of behaviour. Since the beginning of the 90s, research efforts have been put in place on cognitive agents and normative multi-agent systems, aiming to define agreed computational infrastructures building upon inferential interpretative templates such as the theory of mind and various theories of normative positions from law, institutional economics, and linguistics. Theory of mind is exemplified by the belief-desire-intention or BDI agent paradigm of i.a. Bratman (1987), and Rao and Georgeff (1995). The normative positions input usually draws from literature on norms (Alchourrón and Bulygin, 1971), normative relationships (Hohfeld, 1913), and speech acts (Austin, 1975). Typically, the main objective of these contributions is not to provide empirically plausible models of human reasoning, but to maintain a high-level but exact specification of the agent from an external perspective using terminology that remains comprehensible for humans. 1.4 Purpose and Plan of the Chapter This short introduction gave an informal overview over general concerns shared by AI and computer science on the one hand, and cognitive, social, and legal sciences on the other. At closer inspection, however, cross-pollinations between these domains are driven by different motivations. Limiting our view to a technical feasibility perspective, we are facing two different complex adaptive system design problems, to be solved with the same knowledge resources: • the problem of modeling, simulating, and reasoning about complex socio-institutional arrangements like law, markets, business, etc. • the problem of designing complex information system arrangements based on design metaphors drawing from vocabulary on minds and institutions. Clearly, application domains like electronic institutions are particularly fascinating for researchers from both traditions, because they make us face both design problems at once. 6 Alexander Boer and Giovanni Sileno Our present aim is to introduce the main challenges at stake on both sides, in a way to inspire the reader to further reflection. For this purpose, we prefer a highlevel, non-technical presentation over an exhaustive literature review. In the concluding section, we identify a number of potential grounds for novel advances in the application of institutional metaphors to distributed AI, and the application of AI techniques in modeling, analyzing, and evaluating social-institutional arrangements. 2 Agency as Unity 2.1 External and Internal Views In abstract terms, all problems reviewed in the introduction are expressions of a general tension between unity and multiplicity. Multiplicity attempts to recover where unity fails, or to achieve what cannot begin to be achieved by individuals alone; on the other hand, multiplicity is made up of unities, which, seen as an aggregate, might qualify as a unity again. Recursively, unities might contain multiplicities in themselves. In this reconstruction, two points of view co-exist: external (addressing a unity acting within an environment) and internal (addressing a system with several components). An organization can be seen externally as one single socio-economic actor, consuming and producing certain resources (products, services, etc.) for certain goals; internally, it can be seen for instance as an arrangement of roles embodied by individual employees, but also by a network of business units, daughter organizations and coordinated partners. In the same way, a decision-support system or the guidance system of an autonomous vehicle can be seen as single pieces of software, producing results relevant to a given task, given certain computational and informational resources; or as wholes of interconnected modules providing functions necessary for the system to run. Not unexpectedly, internal and external views can be found in standard modeling practices, cf. UML; or in software engineering, with notions as orchestration and choreography. But why is something seen as a unity (externally) or as a multiplicity (internally)? More precisely, as we are dealing here with entities meant to act within the world, what does it mean to appear to be one agent to the outside world? 2.2 What Agents Look Like, Externally When interpreting a scene, observers frame it depending on the most pertinent cut determined by their point of view. Taking a famous example by Hart and Honor (1985), a farmer may see a drought as producing a great famine in his country, but an international authority may instead put responsibility on the government of that Institutional Metaphors vs AI Techniques 7 country, because it has not prevented it by building up adequate reserves. Plausible criteria used to settle upon the stance for the observer to apply are the informativity (the capacity of drawing relevant conclusions with it), and the cognitive effort required (cf. relevance theory (Sperber and Wilson, 1986), simplicity theory (Dessalles, 2013)). Amongst the possible interpretative attitudes available to the observer, the intentional stance (Dennett, 1987) is more prone to prediction errors, but also the one producing highly informative results at reasonable cost. For instance, it would be difficult to interpret a childs action towards approaching some sweets by utilizing only information about his physical state or by evolutionary considerations. Similar considerations apply also on the interpretation of the behaviour of groups, organizations, countries, or artificial intelligent systems as intentional agents. 2.3 Intentional Ascriptions and Articulations as Reasons Taking an intentional stance, observers attribute to an agent beliefs, desires, and intents; and consider him as a rational entity, i.e. one which “will act to further its goals in the light of its beliefs” (Dennett, 1987), and they can construct, with an adequate approximation, what he will do next. Seeing this process as enabling the ascription of reasons to explain the conduct of an agent, we reveal the constituents of mentalization (Fonagy and Target, 1997), or more precisely, of rationalization of behaviour. A certain entity (a person, a country, a natural phenomenon) is seen as an agent because observers are able to ascribe certain beliefs, desires, and intents to it obtaining relatively correct predictions. The same applies when one agent observes introspectively his own behaviour, articulating his motivations as reasons for action. Both having articulated beliefs, desires, and intents, and being able to ascribe beliefs, desires, and intents to an agent clearly assist in communication between social agents. Mercier and Sperber (2011) make this point forcefully: evolutionary speaking, the main function of reasoning using knowledge structures must be argumentation. However, a different outcome might be expected depending whether we take the agent or the observer point of view. Traditional experiments on confirmation bias in human reasoning consistently show an interesting imbalance between producing and evaluating arguments: when arguing for a claim, humans seem to suffer strongly from confirmation bias (i.e. of selectively collecting or remembering evidence), but when arguing against the same claim they are capable of refuting weak, biased arguments based on selective use of evidence. Mercier and Sperber point out connections between the outcomes of these experiments and the rationality of the process of dialectical argumentation in a court setting, of which one could say that overall it aims (and generally succeeds) at producing truth even if the arguing participants are just trying to win an argument. This setting is ruled by the burden of proof, the duty to produce evidence for claims (Walton, 1988). Burdens of proof are systematically allocated to agents based on whether winning the claim improves ones position, and, when one considers legal norms, burdens of proof can generally 8 Alexander Boer and Giovanni Sileno be statically allocated to propositions in the condition of a rule. When considered from the perspective of burden of proof, the charge of irrationality in producing arguments loses its force. Instead we wonder how rules become statically connected to communication settings, and which part of a rule exists to serve which interest. 2.4 Scripting Behaviour and the Resulting Ecology But how it is possible for an observer to ascribe a certain behaviour to the agent, when in principle the number of courses of action the agent might be committed to is infinite? In the traditional approach to decision theory, a rational decision-maker decides a solution to a problem by selecting the best of the candidate solutions. A similar optimization principle is at the base of the homo oeconomicus axioms used in classic economic theory: agents are self-interested, maximizing their utility functions. The initial infinite potential ascriptions are then reduced to a small list of (economically) rational ones. There are many ways in which one can frame criticisms against those assumptions, and explain how we should deal with the boundedness of human rationality: decision problems in the real world are always potentially too complex, making it prohibitive and practically impossible to perform maximization over all possible alternatives. Heuristics, rules and procedures emerge as a natural response of the agent to unpredictable errors in selecting the best solution. Heiner (1983) identifies the root of this general phenomenon in the gap between an agents competence at solving a problem and the difficulty of a decision problem in an environment, called the C-D gap. Heiner convincingly argues that for big C-D gaps an agent will generally over time perform more effectively and efficiently by following simple rules rather than attempting to maximize. A good chess player will for instance tend towards playing specific routine openings to capitalize on his experience in the types of games that develop from those openings, and get more creative in the middle and late game, even though standard interpretations of rationality would suggest that the best move becomes easier to guess late in the game as complexity decreases. In social settings this tends to result in institutionalization of social interactions, as the actors involved all perform better if the interactions are predictable to the extent they can be. There are for instance a number of valid ways to conclude a sales transaction, but a supermarket will accommodate only one of them to structure interactions and reduce the cognitive load imposed on participants. The result is that agent engages in a kind of ecological niche construction (Bardone, 2011), associating relatively simple sets of rules to social roles he might play in interactions with an environment, dependent on what model he chooses for that environment. Institutional Metaphors vs AI Techniques 9 2.5 Social Intelligence as Compressing Behaviour Simplifying, an agent and an environment could be modeled as programs that exchange symbols, with the environment sending reward signals to the agent in reaction to its output signals. Hutter (2006) defines intelligent behaviour in terms of an agent’s expected reward in an environment (and universal intelligence in terms of all conceivable environments). The agent has the task to predict which outputs will maximize the future reward. This general formulation covers for instance game playing (where one’s competence is determined by the ability to predict the opponent’s moves) and question-answering (predict the answer that will be rewarded). To be competent at prediction, the agent essentially has to guess the program that its environment (or opponent) runs. This is the same problem as compression of data: to discover a small program (the prediction mechanism) that reproduces the body of data (the symbols from the environment). This explains the establishment of the Hutter prize: a reward for setting a new standard for compressing a large body of data: being able to compress well is closely related to acting intelligently. A similar intuition is formalized by algorithmic information theory, synthesized by the expression “understanding is compression” (Chaitin, 2005). As a concept of intelligence, intelligence as compression is a powerful abstraction, but also one that has clear limitations from an ecological point of view (Dowe, Hernández-Orallo, and Das, 2011). Firstly, it does not account for the origin of the reward mechanism. In lossy compression schemes (in audio and video compression) we for instance discard part of the data from the environment as noise rather than signal to be reproduced, because it does not matter (i.e. no reward is given) to the human viewer. Without such an external reference, we however have no account of how our intelligent agent makes the distinction between useless and useful data, and always compressing everything is not an ecologically valid approach to dealing with the cognitive limitations of an intelligent agent in a complex environment. In other words, a theory of intelligence should be dealing with Heiner’s C-D gap. The second limitation deals with social environments, and is in this context obvious. The intelligence as compression concept accounts for learning by induction from examples, but not for social learning through interaction with other agents. It cannot account for shared vocabulary between agents (i.e. ontology), not with argumentation, and not with the exchange of instructions and rules between agents. Any account of these omissions would need to explain how agents keep their programs sufficiently similar to exchange pieces of them with other agents. Nevertheless, the core observation of the intelligence as compression approach remains of interest: Confronted with an environment, or with another agent, intelligence involves, among other things, the ability to select or create of a program that can be ascribed to that environment or agent, or to select or create a correlative program to drive rewarding interactions with that agent or environment. 10 Alexander Boer and Giovanni Sileno 2.6 Specifying Intentional Agents The traditional AI perspective internalizes the intentional stance and considers agents as intelligent systems, entities performing certain actions in order to achieve certain goals, depending on their knowledge. Consider for instance the uncompromising external perspective towards agents taken by Newell in his seminal paper on the knowledge level 1982. Knowledge and goals are ascribed to an agent to explain its behaviour, and are separable from the structures and mechanisms that create that behaviour. In a sense, Newell proposes that the key problem of Artificial Intelligence is to create models of observed agent behaviour within the bounds of some design constraints, a model of deliberation loosely referred to as the principle of rationality. The question of how to reproduce mechanisms that create the behaviour is secondary, and in practice often easier if the design problem is well-defined, and the goals of the agent are easy to identify (as long as one is focusing on things like chess, or recognizing faces for that matter). Considering goals as (a kind of) desires, this approach can be aligned to the traditional philosophical account of practical rationality, based on a belief-desire architecture (BD). Bratman (1987) convincingly argued against such two-parameter characterizations. In principle, a BDI framework allows us to consider that agents may have conflicting, inconsistent desires (e.g. to eat the chocolate and to follow a weight-loss plan), but those that are eventually selected for the actual conduct have to be consistent; it is this selection, reified as intention, that captures the deliberative aspect of agency. However, for the reasons exposed above, in contrast to the traditional view of deliberative agent—according to which agents take rational decisions by weighing reasons—one could rather start from an interpretative basis, considering that agents might reproduce already established courses of action (or scripts). For their ex-post nature, scripts reify deliberations already occurred. Intentions, as commitments towards courses of actions, are then reduced again to low-order volitional states selected by higher-order desires in accordance to the abilities and knowledge ascribed to the agent. Evidently, what is obtained through an interpretative standpoint can be remapped in generative terms, i.e., entering the agent’s mind, the same mental states can be used as the drivers for his conduct. It is to satisfy his intents that the agent behaves in a certain way. It is unimportant to acknowledge whether such mental states actually exist or are epiphenomena of other unconscious activities of the brain. The principle of responsibility in our legal systems is based on the assumption that such mental states are significant to reason about human behaviour (cf. (Sileno, Saillenfest, and Dessalles, 2017)). Institutional Metaphors vs AI Techniques 11 2.7 Agentive Positions In previous works ((Sileno, Boer, and Engers, 2015), extended in (Sileno, 2016, Ch. 7)) we recognized four primitive categories required to specify the behaviour of an agent: commitments, expectations, affordances, susceptibilities (CAES). Informally, they roughly correspond to what the agent wants, what he believes, what (he perceives) he is able to do, and what he is disposed to react to. Any instance of one of these classes is a position that the agent takes with respect to the environment. Commitments, as a category, include all motivational states. There may be commitments which are acceptable for the agent (desires), commitments which are preferred by the agent, and finally commitments which are selected by the agent (intents), eventually triggering an intention leading a certain course of action. The introduction of prioritization at the level of preferences serves to solve possible inconsistencies, allowing a conflict-free selection of the desires to which the agent may commit as intents. From a generative perspective, commitment can be interpreted as agentive dispositions having enough stability to drive action. In this sense, all living beings, even the most primitive, are functionally provided with the commitment to survive. On the other hand, we have also to take into account that not all reasons for action necessarily refer to concrete objectives: e.g. desires promoting values strongly influence the behaviour of agents, but at a deeper level in the rationalization. Expectations reflect the situatedness of the subject in the world. What the agent expects from the world is what he believes the world is, actually and potentially. The actual category mirrors the traditional definition of beliefs. The potential category identifies what, according to the agent, the world may bring about under certain conditions, and corresponds to the usual meaning associated with expectation. For the intelligence as compression hypothesis, expectations cover the role of program that the environment runs, used by the agent to maximize the available rewards for the given commitments. Affordances (or abilities) can be seen as an opportunities of action—possibilities of the agent to adopt certain behaviours, in certain conditions, to achieve certain results. Affordances interact with commitments to define which behaviour the agent will eventually select. Susceptibilities are attitudes specifying the reactive aspect of agency; an agent is susceptible to a certain event if he exhibits some reaction to its occurrence, at the epistemic or motivational level. 2.8 Reactive Architectures What is the role of these components in reasoning? Theoretically, the simplest reflex agent is specified by a single reactive rule: at the occurrence of a certain condition, he performs a certain action. Diagrammatically, his behavior builds upon three 12 Alexander Boer and Giovanni Sileno components: a rule (R), an ability (A) associated to the action required by R and a susceptibility (S) associated to the triggering condition activating the rule. R S A Suppose the rule R to be a reactive rule of the type “if perception then do action”; using the previous elements, the susceptibility S would enable the transmission of perception, the ability A would enable the performance of action. If R, A, S hold, if perception is captured, the action is performed. More in general, R may also be instantiated by a non-conflicting rule-base; in this case A and S could stand as sets of abilities/susceptibilities associated to the rules in R (the diagram makes abstraction of the individual associations). R may be also a mathematical formula (a transformational rule); in this case S denotes the ability to collect the required input parameters, and A the ability to compute the expression specified by R. Increasing the complexity of the world to be taken into account to activate R—as for instance memory aspects, that cannot be perceived in the environment in realtime—we need to introduce a model of the world (M), i.e. a simplified representation adequately interpreting the sensory inputs. R A M S This architecture is however opaque for providing reasons to action, because what links M and R in driving action is a mere syntaxic relation. In contrast, if we posit the rule in terms of a commitment (C) to a condition to be satisfied, the minimal model triggering the action corresponds to the negation of the belief (E) that the satisfying condition does hold. This new architecture would provide intuitive reasons to explain behaviour: the agent acts because there is a conflict between what he wants and what (he thinks) it holds. However, three dependencies still need to be added for a plausible agent architecture: • enactive perception (from the set of active commitments, amongst which C, to S): the perceptual experience has to be entrenched with the course of action to Institutional Metaphors vs AI Techniques 13 which the agent is committed, mostly to be ready to anticipate potential (usually negative) outcomes by adequate monitoring; • affordance activation (from the set of active expectations, amongst which E, to A): because the epistemic conflict is specified at higher-level, an additional informational channel is needed to contextualize the capabilities of the agent to the current situation; • affordance inhibition (from a commitment C’, stronger than C, to A): a certain action may produce consequences which are in conflict with stronger desires; in this case, even if perceived, the associated affordance is inhibited to prevent the triggering of the action. The resulting diagram is as follows (red arrows are dependencies building upon conflicts, blue circle-headed arrows are inhibitors, densely dotted arrows refer to sets of active commitments/expectactions): C' > A C E < E' S For symmetry, the figure reports with sparsely dotted arrows a negative impact of desire on the creation of belief, and the inhibition of susceptibility due to a stronger epistemic commitment. Interestingly, those links capture distortions actually observable in human reasoning, as tunnel vision, denial of evidence, wishful thinking, etc. They are distortions because they reduce the agent’s grounding to perceptual evidence, and therefore they limit the possibility of epistemic alignment with other agents with a different set of commitments. The analysis should be also extended to the negative counterparts: e.g. a negative commitment towards T is the desire of T not holding, a negative affordance is the ability of inhibiting a certain outcome to occur by performing a certain action, etc. It can be shown that these components activate different reasoning constructs, and therefore provide a different characterization and response. Interestingly, this is in accordance with the observation of Mercier and Sperber (2011) about the difference between pro and against arguing behaviours. 14 Alexander Boer and Giovanni Sileno 3 Institutions and Collective Agency 3.1 Going Internal: Control vs Ecological Structures The external point of view is basis for interpretation, the internal one is for design. In social systems the implementation layer consists of agents, therefore design corresponds to deciding structural arrangements that enable those agents to form robust organizations in order to achieve higher-order goals. The agents will operate through a mix of cooperation, coordination, and competition in problem solving, in all cases with limited information exchange and limited commitment to shared vocabulary and rules. Evidently, by distributing the (operational, computational) charge to networks of independent agents, we are naturally evolving from control structures to ecological structures. The difference between the two categories is best visualized by the distinction (originating with Deleuze and Guattari (1980), recently revisited by De Landa (2006)) of the totality vs assemblage conceptualizations of wholes, summarized in the following table: Totality Assemblage organic composition (e.g. heart in body) components specified by relations of interiority: all their properties are manifest components exist only as part of the system dependencies logically necessary ecological coupling (e.g. symbiosis) failures compromise the system failures irritate the system components specified by relations of exteriority: only part of their properties is manifest components exist even in absence of system dependencies contextually obligatory The passage from totality to assemblage requires several conceptual steps. For the sake of the argument, let us image we start from a monolithic software implementing an IT service, made up of several internal modules. The first step is adding redundancy in the system, i.e. components potentially providing similar functions. If there is only one module that implements a required function for the IT service to run and this module fails, the application will stop working properly. If there are a number of modules that might be invoked providing overlapping functions, the service resilience will generally increase and the problem will become rather one of an economic nature—i.e. of settling on an adequate resource distribution strategy amongst these modules. However, the IT service example still considers a core module that is dispatching resources to the others, depending on its requirements (just like MapReduce (Dean and Ghemawat, 2008) for service resilience relies on a scheduler allocating resources). As a second step this constraint need to be relaxed. Institutional Metaphors vs AI Techniques 15 A pure assemblage has no core module: there is no co-coordinator putting preferential requirements in the foreground. (In nature, maintenance functions emerge as a selection effect: assemblages not able to sustain themselves disappear.) Third, components of an assemblage exist independently of whether the assemblage holds or not. In other words, components of a totality are fully specified by their actual properties within the system (relations of interiority), whereas components of an assemblage have dispositions which are not amongst those manifest in the context of that specific assemblage (relations of exteriority). Considering the components of the assemblage as agents, whose intent satisfaction counts as reward obtained by the environment, we can draw the following general templates: • competition: agents are committed to the same target, but its satisfaction by one produces a (physical or symbolic) scarcity for the others; • cooperation: agents have dependent commitments, i.e. the satisfaction of one agent’s intent is required for or facilitates the satisfaction of another agent’s intent; symmetric dependencies are at the base of mutualism and enable maintenance functions (as in the symbiosis example); • coordination: a structured mechanism (resulting from an individual or collective agency) distributes rewards and punishment to the agents specifically to obtain higher-order goals. A discriminating factor between cooperation and coordination schemes can be the presence of explicit signalization. For instance, symbiosis exists even without communications. 3.2 The Central Role of Failures Institutions are instead a prototypical example of mechanisms of coordination: they build upon symbolic means, and form an infrastructure providing rewards and punishments (the famous carrots and sticks) to social actors, modifying those available from the non-institutional environment. Note how competition aspects are for the most extra-institutional (e.g. the choice of a sale price in a market). Focusing in particular on the legal system as an institution, its practical function is to intervene when an (institutional) failure supposedly occurs in social interactions, i.e. when the institutional expectations of one of the parties involved aren’t met. From a functional point of, ex-post judicial interpretations are meant to make explicit the normative positions of the parties before the failure, and then to associate the institutional response if the failure is confirmed, building upon the sources of law. Normative sources are then used as reasons to enrich behavioural models ascribed of the parties. 16 Alexander Boer and Giovanni Sileno 3.3 Hohfeldian Prisms Hohfeld’s analysis of fundamental legal concepts (Hohfeld, 1913) starts from a similar interpretative consideration and captures two distinct dimensions—the obligative (or deontic) dimension and the potestative (or capacitive) dimension—of the legal relations holding between two social actors that are bound by legal provisions. The resulting framework brings two crucial innovations. First, the consideration that concrete normative relations cannot be expressed on the mere basis of deontic modalities. For operational purposes, it is crucial to make explicit which party is the addressee of the normative proposition and which party is the beneficiary, i.e. whose interests are protected or promoted (cf. the teleological aspect highlighted by Sartor (2006)). Thus, the notion of claim embodies the idea of right as the protection of an interest via a corresponding duty. A privilege corresponds instead to the absence of duty, and when it holds the other party has noclaim to advance. By observing the intuitive correspondence of duty with obligation and privilege with permission (in the common meaning of faculty, not the formal one), we added a negative dimension to the traditional Hohfeldian square, obtaining the first Hohfeldian prism (A, E, Y are the positions of the deontic triangle of contrariety) (Sileno, Boer, and Engers, 2014): beneficiary addressee right to protection against claim E right to performance A forb obl Y no-claim duty – + faculty privilege The second innovation is the explicit consideration of the dimension of institutional change, centered around the notion of power. Hohfeld insists also on the characterization of institutional power with volitional control, that is, with intentionality. A person holding such a power has the institutional ability to deliberately alter legal relations (e.g. transfer of ownership) by performing certain acts. Rather than using terms of addressee and beneficiary when considering the action, the two parties can be distinguished as (potential) performer (enacting the power) and recipient (suffering from the enactment). Correlative to power, liability means being subjected to that power, while the opposite immunity means to be kept institutionally untouched by the other party performing the action (who, in turn, is a position of disability). As before, introducing a negative dimension we unveil the second Hohfeldian prism, discovering the neglected positions of negative liability and negative Institutional Metaphors vs AI Techniques 17 power, relevant to contrast institutions (for an extended analysis of the Hohfeldian prisms, see (Sileno, 2016, Ch. 4)): performer recipient "right" to be not followed along power E right to be followed along A forb ... obl .. Y disability liability – + faculty to follow along immunity The visual representation given by the prisms (or squares, as in the original contribution) makes explicit the symmetry and duality of the relations between two parties. Focusing on a specific perspective, as for instance that of the addressee, three (two, without the negative attitudes) positions, i.e. points on a virtual dimension— are available to describe where that party stands. This position is strictly linked to the position of the other party. One may think of those diagrams as a game board in which when one player moves, he moves both checkers at the same time (correlativity axiom). Thus, the difference between, for example, duty and claim is just one of point of view, as they describe the same binding. 3.4 Interface between Normative and Agentive Positions At a theoretical level, the four agentive categories of commitment, expectation, affordance and susceptibility can be put in direct correspondence with the four normative categories duty, claim, power and liability, interpreting the environment as the correlative party to the agent (Sileno, Boer, and Engers, 2015). The distinction can be traced as one of intrinsic vs extrinsic attitudes of one agent’s behaviour. Social norms (including legal norms) provide reasons for the agent—by attempting to influence the rewards of the environment—to promote or demote certain actionselections in his conduct (via obligations and prohibitions), or even create the possibility of certain action-selections (via institutional power). Let us divide all institutional knowledge in class-norm (N) and token-fact (F) types of components. Modifying rewards of the environment, they supposedly play a role in the expectation category within one agent’s reasoning. Intuitively, to facilitate normative alignment between agents, norms should be as much as possible accessible, and therefore require a public medium of transmission. The case of institutional facts is a bit different; to protect sensible information, they should be in 18 Alexander Boer and Giovanni Sileno principle shared only on a institutional coordination basis. However, this distinction is not so strong as it seems: the universal ambition of the modern rule of law can be seen rather as a special case, consequence of the large base of addressees; companies do not necessarily want to share their policies widely, and social groups may have unique customs not explained to outsiders, with the effect of facilitating the distinction of in-group and out-of-group interactions. We can redraw the reactive architecture presented above, adding these institutional elements, and making explicit the type of transformational powers at stake: • directive power, of bringing the commitment C in action; • operational power, of performing the action to achieve a certain goal, by means of the ability A; • enabling power, of activating the ability A (cf. the dual disabling power); • regulatory power, of transforming the individual commitment C to the social commitment N; • publishing power, of reifying the norm N on an artifact publicly accessible; • interpretative power, of interpreting observations, producing beliefs and expectations E; • monitoring power, of perceiving a certain input, by means of a susceptibility S; • attention power, of activating the susceptibility S (cf. the dual diverting power); • declarative power, of transforming the individual belief E to a social fact F; • registering power, of reifying the fact F on an artifact. They are illustrated by the following diagram (dashed arrows): publishing power N F declarative power regulative power E C directive power enabling power A operational power registering power interpretative power S attention power monitoring power Note that norms and institutional facts play a role at an epistemic level first. Furthermore, all powers require to be activated by specific actions, and therefore their applications hide a commitment, activating in turn directive power, operational power, etc. Institutional Metaphors vs AI Techniques 19 3.5 Distributed Agency Hypothesizing that the functions illustrated in such a reactive architecture are correct, we should find them independently from whether the agency is implemented in a control or an ecological system. In effect, one can recognize the basis for the famous trias politica: the executive, legislative and judiciary branches can be seen as concentrating on themselves the directive, regulative and interpretative powers of a collective agency. The principle of separation of powers can be explained as aiming to maintain the balances present in the standard reasoning architecture: N puts constraints on E, but E has the power to re-contextualize them by producing F, in turn inhibiting/enabling the abilities A available for C. Finally, even if C could be in principle transformed in N, N contains also previous decisions, taken by supposedly different power-holders, plausibly establishing constraints on C’s regulative maneuvers. If the same actor holds both, e.g. the directive and interpretative powers, there is a short-circuit in the architecture because interpretation could be forced to enable this actor’s commitments, rather than respecting those consolidated in the norms. Most interventions of the judiciary occur on an asynchronous basis: the triggering event is a social actor (the plaintiff) that supposedly experienced an institutional failure and goes to the court. This means that the monitoring power is left to each social participants. Media outlets are instead characterized as actors that (generally compete to) hold attention power. The increasing presence of global online platforms centralizing socio-economic transactions, as well as the agglomeration of institutional administrative repositories is also opening possibilities of upstream monitoring by the entities having access to such information. De Mulder and Meijer (2012) have argued for an extension of the principle of separation of powers to a tetras politica, including these potential monitoring branches. The point makes sense, but, looking on our diagrams, it should be enriched also by an analysis on registering power, probably the next frontier of innovation if smart contracts or related technologies (e.g. block-chain) will enter into the institutional operational cycle. 3.6 Maintenance Functions Although we have recognized in collective agencies functions ascribed to a single agent, we have not explained how this is actually possible. For systemic maintenance, we expect the existence of some enforcement mechanism, that is able to guide and maintain to a good extent individuals in principle independent to form an assemblage. (Consider again the symbiosis example, the contextual obligation of interaction is a consequence of the positive reward of such an organization, with respect to absence of interaction.) Enforcement actions generalize this principle, as they supposedly provide an institutional response to failures and strengthen the general compliance using rewards and sanctions, but the enforcement is not necessarily due to mere legal mechanisms, 20 Alexander Boer and Giovanni Sileno but also to social or physical dispositions (e.g. regulations of right-hand/left-hand traffic are issued in the presence of a sort of natural enforcement: not complying with the correct driving direction would have direct and possibly terrible consequences). However, legal transactions have the crucial advantage of putting in the foreground explicit protections to the risks of lack of coordination between the parties. The general evolution of contemporary enforcement practices—observable not only in modern legal systems, but also in school, parenting and informal groupings— has been nicely synthesized by Dari-Mattiacci and Geest (2013) as “the rise of carrots and the decline of sticks”. The authors propose a theory explaining this tendency. In short, from an economic perspective, punishment-based systems are more efficient in simple settings, i.e. when the burden of compliance can be well specified and distributed amongst the involved parties. Reward-based systems, on the other hand, are more efficient when the regulator has difficulties specifying the burden, or the burden is not well distributed amongst the social participants. As modern societies become more complex, heterogeneity of contexts and tasks is increasing, and so reward-based systems are becoming more common. At first glance, we could write any contract either in carrot-style or in stick-style and they would be identical, at least from an algebraic point of view. However, experiments conducted in behavioral economics on similar formulations found out that the two rephrasings are not the same (Kahneman and Tversky, 1979). Even at the analytical level, Dari-Mattiaci and Geest observe that there is an intrinsic difference due to the monitoring component: if monitoring is not perfect, the two formulations are different because a party that is not monitored in a carrot-based system counts as being non-compliant; whereas, in a stick-based system, it counts as being compliant. In practice, as observed by Boer (2014), a reward regime assumes that most people are non-compliant; a punishment regime assumes that most people are compliant. Boer proposes then the following evidence criteria to decide whether an enforcement system is based on carrots or on sticks: • a reward regime requires the production of evidence of compliance, • a punishment regime requires the production of evidence of non-compliance. These criteria switch the attention from internal, subjective aspects relative to the parties to external aspects specified in regulations. Interestingly, these are related to the burden of proof, usually distributed amongst claimants (for evidence of noncompliance) and addressees (for evidence of compliance). 4 Pluralism as Ecological Diversity 4.1 Epistemological Pluralism Interestingly, the dichotomy totality vs assemblage captures also the distinction between formal and informal conceptual (symbolic) systems. The difficulty of con- Institutional Metaphors vs AI Techniques 21 straining natural language in formal semantics is well known. The regularity of association of linguistic terms to a certain interpretation is a consequence of a relative regularity of the environment, of the perceptual apparatus, of the knowledge and of the commitments of the locutors—but a change within one of those aspects might entail a change in the associations as well. Taking into account this phenomenon means to accept epistemological pluralism. Furthermore, beyond inter-agent pluralism (agents, for being independent, do not share the same knowledge), there is also an intra-agent pluralism to be considered, due to ontological stratification (Boer, 2009). For instance, a road may be seen as a curved line while looking at directions on a map, as a surface while driving, or as a volume while putting asphalt to build it. The alternative cuts, as with the intentional stance, are due to the different properties of the entity which are relevant to the task in focus. Any alignment of vocabularies or ontologies cannot be successful without an adequate analysis of the underlying commitments to the domain. Normative systems, which are defined symbolically, prototypically suffer from this problem, because the possible contexts in which they might operate cannot be predicted in advance, but at the same time, they can also be seen as a prototypical solution to the problem, because they attempt to consolidate goals in higher-order, abstract form, leaving the specification of further contextualization at need. 4.2 Normative Pluralism But there is another level of assemblage to be taken into account for normativity: agents belong to a single normative system only in a ideal case. Think of all the rules and norms, written and unwritten, that we encounter in daily life. At home we did certain chores because we at some point agreed to a distribution of them, or perhaps simply because they are expected of us. We followed both traffic rules, and informal driving etiquette, on the roads while traveling to and from work. We parked the car following rules and directions, greeted colleagues following social conventions, and perhaps followed directions about where not to smoke or not to drink our coffee and where to discard our paper coffee cup. Finally we are writing this chapter following grammar and spelling rules, instructions about structuring chapters, and conventions about citation and plagiarism, working to meet a deadline. These norms belong to different types, and we recognize them as part of different complex systems of norms. Some are based in law, others in social conventions of society at large, in social conventions of the academic field, those of a particular building, or even of a small private circle. Any of these norms we may have noticed or not noticed, regarded or disregarded, and followed or violated, consciously or unconsciously. And for the most part we hardly thought about them, which is, when we do think about them, really amazing, since normative pluralism does pose two really interesting questions (see e.g. Twining (2010)). The first question is: how do we notice norms, and detect and resolve conflicts between pairs of norms as they arise? 22 Alexander Boer and Giovanni Sileno When two norms are in conflict they are so because they either: • disaffirm each other, i.e. appear to label the same intention as both strongly permitted and not permitted, or • appear to require of us that we adopt two intentions that jointly are inconsistent with our beliefs and hence cannot be executed jointly if our beliefs are correct, for instance if we ought to have our cake and eat it. From the point of view of the norms we might state that norms may be grouped into a normative order, which is an institutionalized system of norms aimed at ordering social relationships between members of a community or group. Conflicts between these norms are largely ironed out within the system of norms, and norms for determining applicability and priority of norms may determine the outcome of new conflicts. This is however only possible to the extent that agreed upon norms on conflict resolution and prioritization can be established within the community or group, noticing applicability of norms is not itself the overriding concern, and the outcomes of the conflict resolution process remain acceptable to the members of the community, i.e. the right norms are applied. 4.3 Value Pluralism The second question is: how do we measure how norms perform overall if they are to be effective in a plurality of norm environments? Recalling that systems of norms range from the public, with universal appeal, to the most private, the problem of measuring norm performance is relevant at all levels of granularity, from an intra-agent and inter-agent perspective. The individual agent, and the organization, and whole communities form judgments about the performance of individual norms, and the problem of forming opinions about individual norms in a plurality of norm environments is rather ill-defined if it is the norm environment itself that frames what rational action is. One might naively think of this problem as a quantitative one, of measuring overall levels of compliance. From the perspective of the values served by norms this is however typically ill-advised. A norm performs well if it works, or is complied with, in those environments where it is useful, and doesn’t work, or is violated, in those environments where its value is outweighed by more important values served by other, competing norms that (should) take precedence. As such, overall compliance levels do not necessarily mean something, if they are not properly scoped to a niche in which norms should be complied with. Institutional Metaphors vs AI Techniques 23 4.4 Pluralisms and Social Niches A general pattern could be traced at this point. Intra-agent epistemological pluralism emerges from simplifying the agent-environment coupling relatively to functional niches, determining the explicit articulation of several agent-environment couplings. Inter-agent pluralism aggregates those articulations, and the commitments exploiting them, resulting in a set of agent-roles available within a social niche. Normative and value pluralism can be seen as components of the previous ones, aggregating respectively social coordination (institutional) and reward model aspects. Other possible inflections are political pluralism, necessary base for democracy; and legal pluralism, a special case of normative pluralism, necessary requirement for jurisdiction in international matters. In other words, pluralisms come together with accepting an ecological view of social systems: they mirror the diversity (of aspects) of the social niches available within a society, at a certain point in time. This implies that rules can be understood and modeled only within the context of social roles. All effort to capture regularities, rules or associated epiphenomena without considering the niche that is using them is going to fail, because as soon as the relative distribution of niches in society changes, the model foundations will change too. 5 Discussion 5.1 Institutional Metaphors for Large-Scale Distributed AI With the increasing use of block-chain technology, of smart contracts, of the Internet of Things and, more in general, of distributed, computational, possibly autonomous, systems, it is relevant to apply the previous conceptualizations to assess how much of the institutional mechanisms identified in the legal domain have a correspondence in computational social systems. Despite the name, “smart contracts” do not embody any problem-solving method, nor are specified by assigning normative positions to parties as in usual contracts. Their main innovation, as with the block-chain, is the distributed ledger, used both for “contract” publication and for registration of the related transactions, removing the requirement of a explicit maintainer (e.g. a bank, a public administration, a notary, etc.). They are creating the basis for a potential infrastructural centralization of registration power. Unfortunately, by collapsing normative functions to the implementation layer, these artifacts are fundamentally opaque to users. Second, they do not enable architecturally the negative feedback of interpretative power on directive power for novel or exceptional contexts not taken into account at design time. This heavily undermines the reasonableness of the solution for institutional operationalizations. In spirit, they do not differ from paperclip maximizers (Bostrom, 2003). 24 Alexander Boer and Giovanni Sileno In recent years, many efforts have been directed towards the development of secure operating systems. Traditionally, most implementations builds upon solutions in the spirit of access control lists (ACL), i.e. mapping each user and object to a series of operations allowed to perform on it (e.g. read, write, execute) (Ferraiolo, Barkley, and Kuhn, 1992). These permissions are usually called also privileges, or authorizations; but at closer inspection, it is a conflated version of the homonym Hohfeldian position. Without such a permission, the user is disabled to perform that action, not prohibited. For their dematerialized content, computers are not so different from institutional systems: they both builds upon symbol-processing mechanisms. In this sense, writing a file is not a physical operation, but an institutional operation, and so, to perform it the user is required to have the correspondent power. Capability-based security models are implicitly based on this, using communicable tokens for authorization known as capabilities (e.g. Levy, 1984). The principle of least privilege (or least authorization) requires that capabilities are assigned only within the actual purpose of the application. However, considering authorization merely as power carries additional concerns. In actual socio-legal settings, the most common usage of permission of A is when the agent has the (usually physical) power to perform A, but is prohibited from doing it. More in general, permission is needed because power has a too low granularity to capture higher-order effects. For instance, even if a single action per se may be allowed (enabled), that action in a course of actions, or together with other actions, may bring about unauthorized results (consider e.g. denial of service (DoS) types of attacks exploiting trusted applications). Consider, as an additional example of engineering “blindness” to social semantics, the endless discussions about of what fragment is logic to be offered for knowledge representation in the semantic web, mostly focusing around computability and halting problem vs. the fact that, as soon as you open up an interface to the outside world through a SPARQL interface, the system can be trivially brought to its knees by a DoS attack regardless of the fragment of logic adopted. Evidently, failure cases extracted from ex-post evaluations can be used effectively for monitoring potential preparations of known schemes, but the actual problem, resolved in human societies by using deontic directives, is to specify principled reasons as a basis or anchor to qualify new types of failures within the existing normative framework. Focusing now on AI methods, the most interesting results obtained in these last years comes from an hybrid application of deep learning methods with reinforcement learning (e.g. AlphaGo, (Silver et al., 2016)). Also genetic algorithms can be interpreted as issued through evolutionary reinforcement. For the nature of the tasks, most reinforcements can be associated to a centralized reward system, providing the agent with something positive/negative (that he wouldn’t have had otherwise) if he attains an outcome qualified positively/negatively. These are only two amongst the six (primitive) possible figures of reward/punishment regimes that can be identified in institutional systems (see (Sileno, 2016, section 9.5)). But there is a more profound problem that undermines their generalization towards less specialized problems: the need of specifying clear-cut reward/punishment functions. Institutional Metaphors vs AI Techniques 25 In effect, AI researchers and practitioners (and in general problem-solvers) tend to think that the identification of goals is the easy part—and how to get to these targets the hard part. However, when conceiving applications that are required to adapt to the user, or to the social environment, this presumption rapidly collapses, and couldn’t be otherwise for at least three reasons: for the many possible configurations of preferences between social participants, for such configurations being highly contextual, and for most preferences to be tacit. The main weakness of contemporary AI lies in trying to capitalize too much on optimizing and reasoning about the evidence and options for action (generate & test paradigm) within known requirements, constraints and problem formulation, rather than looking into underlying phenomena of niche construction and adaptiveness, and finding requirements as related to social roles. Deciding to target social roles, rather than formulating requirements on an individual basis, follows from Heiner’s theory and is cognitively supported by the observation that also humans actually perform better at deontic reasoning than evidential reasoning (Mercier and Sperber, 2011), and acquire this ability earlier (as small children). Interestingly, the AI & Law discipline can be thought as originating from reversing the general AI attitude, by focusing strongly on the conflict between goals, and the mechanisms by which we acquire and select them (normativity, or, even more deeply, values). Capitalizing on this experience, even considering the automatic discovery of ecological niches too ambitious, one could still aim for the automated design of compositions of social roles meant to achieve certain given requirements. The core problem in obtaining such construction would be of detecting and solving the internal role conflicts, and doing so by internalizing pluralism (normative, value, epistemological). A critical part in the design would lie in settling adequate data and knowledge roles, the ones which carry data and knowledge between behavioural niches. An improvident centralization of data, for instance, might enable the utilization of the collected information for purposes non-intended by the dataproviding agents. This unveils the need of a principle of least information calibrated to the adequateness of reasons for access to information (dependent on the social role attributed to the requestor and thus the social context), rather than a token-based principle of least privilege (dependent on the requestor). 5.2 AI Techniques for Running Institutions In the current globalization trend, all socio-economic actors (private individuals, private companies, NGOs, and public institutions) become more and more active at an international scale, and institutional interdependencies pass from exceptional to normal operative conditions. Operating concurrently within different legal jurisdictions, these actors are subject to an ever-changing compound of rules (e.g. national provisions, international treaties, standards), whose complexity naturally increases with the number of international activities maintained. This carries risks of misalignment, which may lead such actors to suffer enforcement actions and institutions to 26 Alexander Boer and Giovanni Sileno suffer failures. On the other hand, as their activities occur at international level, those actors have the possibility to establish practices—for instance, aiming to reduce the burden of compliance with environmental, labor, or privacy regulations; or to implement schemes of tax avoidance, tax evasion, or money laundering—which are not yet (or impossible to be) recognized by formal institutions at national level. From a theoretical perspective, increase of complexity means an increase of the C-D gap for the agents, and therefore a pressure towards establishing simpler, more manageable operational rules, at the potential expense of the normative elaboration conducted upfront and of the diversity of cases that may occur, and that would instead require, to serve the citizens’ interests, a dedicated response. In this context, AI, and in particular AI & Law, could provide methodological and computational support for consolidating the rational functioning of collective agencies. Beyond classic problems-solving tasks for operational purposes (e.g. planning, scheduling), here we refer in particular to methods supporting higher-order functions of rational agency as the one highlighted above. In current practices, one can observe little attention to pluralisms within organizational settings, caused by focusing on implementation and optimization of “normal” provision patterns—the so-called happy flow. Consequently, even if presumption of compliance utilized at the rule design phase is generally untested, patterns of failure are put outside the scope of attention. Thus, even if numerically negligible, failures in service delivery absorb proportionally more and more resources, and result in a more complicated experience for the service consumer (the anecdotal problems of machine bureaucracy, cf. (Seddon, 2008)). Symptomatic of this situation are unrealistic ways to quantify and measure performance, little attention to the systemic meaning of failures, and no implementation of a systematic diagnosis process that would reduce the operational burden (as for instance that presented in (Sileno, Boer, and Engers, 2017)). On a par with this, there are excessive expectations about the information that can be obtained from big data analysis, implausible because the niches in which data is generated are completely neglected. On the other hand, collective agencies risk to take an attitude of paralyzing realism, when they put excessive attention on capturing pluralism in society matters at high granularity, as they become unable of completing the aggregating requirements phase necessary to proceed to the directive and then operational or regulative phase. Both machine-bureaucracy and paralyzing-realism scenarios results from not settling upon an adequate systematization of environmental modeling (too little, or too much). The solution lies in establishing adequate networks in which to distribute the burden of capturing social requirements and scenarios of non-compliance, to be transmitted, maintained and processed for support to the design/development phase and of the operational phases (e.g. with automatic model-based interpretation, including diagnostics, see (Boer and Engers, 2011a,b; Sileno, 2016; Sileno, Boer, and Engers, 2017)). Institutional Metaphors vs AI Techniques 27 5.3 Converging Opportunities Despite current hopes, even introducing big data analytics methods, the qualitative depth of the knowledge available to decision-makers of collective agencies cannot substantially improve. Such value can be captured only by the introduction of more principled modeling and simulation methods targeting social niches, together with knowledge maintenance, refinement and alignment techniques. This choice would have as a direct consequence a concrete reduction of the C-D gap, and then would provide a strong support for the design of more intelligent—backed up by reasons and better situated with respect to the environment—rules for organizations. Current attention for privacy matters offers an interesting test-bench for the previous considerations, as it requires to model norms about information use in niches and flows between niches (c.f. contextual integrity, (Nissenbaum, 2009)), to systematize attention to failures, and to adopt a diagnosis point of view towards organizations and organizational goals. In the light of the conceptualizations presented in the previous sections, a starting point for this innovation is a sufficiently rich way of describing and reasoning about social roles, as for instance captured by Hohfeldian and CAES positions. Actually, because normative positions enter within the reasoning cycle as expectations, CAES descriptions offer a complete frame within which we expect role players to be “boundedly rational”, and for this reason they can be used to characterize the problems—of modeling, design, planning, monitoring, diagnosis, assessment, see e.g. (Breuker, 1994)—that the agents must solve in a certain social role, and the knowledge resources they require for that. The harder the problem (from a C-D gap perspective), the harder is to verify as an observer that the agent is doing as expected, and for this reason the agent will need to argue its choices to other participants in the environment to explain that he acted correctly. Evidently, the agent in that role is biased in its information collection by its CAES description requirements, and therefore, to correctly check ex-post whether he took good decisions, we may need to rely for rationality at a higher level on the dialectical process taking place between the agents. A typical solution, compatible with Heiner’s theory of predictable behaviour, would be to come up with an increasingly rigorous burden of proof protocol for justifying decisions. If, on the other hand, performance can be easily scored (e.g. on recognizing faces, for instance) the depth of the reasoning process to be articulated can be minimal. This brings us to the design problem of deciding whether to utilize tacit knowledge methods (e.g. based on statistics) or explicit knowledge methods. Evidently, the first are for their nature (typically feed-forward) faster than the second. But there is something more than performance at stake. For Watson like systems, the results of the question-answering “race” amongst competing agents are clear: the judge-user is supposed to know the answer, there will be no requests about “why” that answer is correct. On similar lines, consider a mobile phone unlocking application based on face recognition. On the other hand, when a diagnostic device settles on the conclusion “the patient has the appendicitis”, it is natural for the user to demand why, expecting reasons that are acceptable to 28 REFERENCES him. Similarly, a public administration cannot (or at least shouldn’t) deny e.g. a parking license or citizenship without explaining why. The social role demanded of the intelligent agents in the two types of applications is different, and this difference is at the root of the recent calls for explainable AI (Core et al., 2006). When AI devices have social relevance, they cannot neglect to provide reasons (determined by their role) for their functioning. To conclude, if we solve the social-role acquisition problem, we can solve the explainable AI problem, because we will be able to identify higher-order burden of proof (and possibly protocols) that can be used to distribute computation to possibly specialized agents. The explainable AI problem is at the root of our problems in designing complex, adaptive AI systems, as illustrated by the confused use of knowledge structures in the history of AI. If we solve the social-role acquisition problem, we can also improve the functioning of our institutions, because we would have a better environmental model in which to implement and test new institutional mechanisms, and in which to interpret social data. Automating the social role acquisition problem from scratch would require the acquiring agent to be embedded in the social system in the same—or a very similar—way humans are. This is at present not a realizable condition. A first step towards solving the social-role acquisition problem is however realizable: considering collective requirements as those that communities reify in institutions, and applying the lessons that can be learned there in engineering. References Alchourrón, C. E. and E. Bulygin (1971). Normative systems. Springer-Verlag. Austin, J. L. (1975). How to Do Things with Words. Harvard University Press. Bardone, E (2011). Seeking Chances: From Biased Rationality to Distributed Cognition. Springer Berlin Heidelberg. Boer, A. (2009). Legal Theory, Sources of Law and the Semantic Web. IOS Press. – (2014). “Punishments, rewards, and the production of evidence”. In: Proceedings of the 26th international conference on Legal Knowledge and Information Systems (JURIX 2014). Vol. FAIA 271. IOS Press, pp. 97–102. Boer, A. and T. van Engers (2011a). “An Agent-based Legal Knowledge Acquisition Methodology for Agile Public Administration”. In: ICAIL 2011: The Thirteenth International Conference on Artificial Intelligence and Law. – (2011b). “Diagnosis of Multi-Agent Systems and Its Application to Public Administration”. In: Business Information Systems Workshop. Vol. LNBIP 97, pp. 258–269. Bostrom, N. (2003). “Ethical Issues in Advanced Artificial Intelligence”. In: Cognitive, Emotive and Ethical Aspects of Decision Making in Humans and in Artificial Intelligence 2, pp. 12–17. REFERENCES 29 Bratman, M (1987). Intention, plans, and practical reason. Harvard University Press. Breuker, J. (1994). “Components of problem solving and types of problems”. In: Proceedings of the International Conference on Knowledge Engineering and Knowledge Management (EKAW1994) LNCS 867, pp. 118–136. Brooks, R. A. (1991). “Intelligence without representation”. In: Artificial Intelligence 47.1987, pp. 139–159. Chaitin, G. (2005). “Epistemology as Information Theory: From Leibniz to ”. In: Alan Turing Lecture on Computing and Philosophy, E-CAP’05, European Computing and Philosophy Conference. Core, M., H. Lane, M. Van Lent, D. Gomboc, S. Solomon, and M. Rosenberg (2006). “Building explainable artificial intelligence systems”. In: Proceedings of the international conference on Innovative Applications of Artificial Intelligence (IAAI) 21.2, pp. 1766–1773. Dari-Mattiacci, G. and G. D. Geest (2013). “The Rise of Carrots and the Decline of Sticks”. In: University of Chicago Law Review 80.1, pp. 341–392. De Landa, M. (2006). A new philosophy of society: Assemblage theory and social complexity. Continuum Intl Pub Group. De Mulder, R. and A. Meijer (2012). “From Trias to Tetras Politica: The Need for Additional Checks and Balances. Illustrated by Immigration Law”. In: Public Administration in the Information Age: Revisited 19, pp. 36–45. Dean, J. and S. Ghemawat (2008). “MapReduce: Simplified Data Processing on Large Clusters”. In: Communication of the ACM 51.1, pp. 107–113. Deleuze, G. and F. Guattari (1980). Mille plateaux. Éditions de Minuit. Dennett, D. C. (1987). The Intentional Stance. Cambridge, Massachusetts: MIT Press. Dessalles, J. L. (2013). “Algorithmic simplicity and relevance”. In: Algorithmic probability and friends 7070 LNAI, pp. 119–130. Dowe, D. L., J. Hernández-Orallo, and P. K. Das (2011). “Compression and intelligence: Social environments and communication”. In: Proceedings of the 8th International Conference on Artificial General Intelligence. Vol. 6830 LNAI. LNAI 9205, pp. 204–211. Ferraiolo, D., J. Barkley, and R. Kuhn (1992). “Role-Based Access Controls”. In: ACM Transactions on Information and System Security 2.1, pp. 34–64. Ferrucci, D. et al. (2010). “Building Watson: An Overview of the DeepQA Project”. In: AI Magazine 31.3, p. 59. Fonagy, P. and M. Target (1997). “Attachment and reflective function: their role in self-organization”. In: Development and psychopathology 9.4, pp. 679–700. Heiner, R. (1983). “The origin of predictable behavior”. In: The American economic review 73.4, pp. 560–595. Hohfeld, W. N. (1913). “Some Fundamental Legal Conceptions as Applied in Judicial Reasoning”. In: Yale Law Journal 23.1, pp. 16–59. Hutter, M. (2006). The Human knowledge compression prize. URL: http : / / prize.hutter1.net. 30 REFERENCES Kahneman, D. and A. Tversky (1979). “Prospect Theory: An Analysis of Decision under Risk”. In: Econometrica 47, pp. 263–291. Lenat, D. B. (1995). “CYC: A Large-scale Investment in Knowledge Infrastructure”. In: Communication of the ACM 38.11, pp. 33–38. Mercier, H. and D. Sperber (2011). “Why do humans reason? Arguments for an argumentative theory”. In: Behavioral and brain sciences 34.2, pp. 57–74. Minsky, M (1988). Society of mind. Simon & Schuster. Morgenstern, L. (1996). “The problem with solutions to the frame problem”. In: The Robot’s Dilemma Revisited: The Frame Problem in AI. Norwood, NJ: Ablex Publishing Corp., pp. 1–40. Newell, A. (1982). “The Knowledge Level”. In: Artificial Intelligence 18.1, pp. 87– 127. Newell, A., J. C. Shaw, and H. A. Simon (1959). “Report on a general problemsolving program”. In: Proceedings of the International Conference on Information Processing, pp. 256–264. Newell, A. and H. A. Simon (1976). “Computer Science As Empirical Inquiry: Symbols and Search”. In: Communication of the ACM 19.3, pp. 113–126. Nissenbaum, H. (2009). Privacy In Context: Technology Policy And The Integrity Of Social Life. Stanford University Press, p. 304. Pollock, J. L. (1975). Knowledge and Justification. Princeton University Press. Rao, A. S. and M. P. Georgeff (1995). “BDI Agents: From Theory to Practice”. In: Proceeding of the 1st International Conference on Multi-agent Systems (ICMAS), pp. 312–319. Sartor, G. (2006). “Fundamental legal concepts: A formal and teleological characterisation”. In: Artificial Intelligence and Law 14.1, pp. 101–142. Seddon, J. (2008). Systems Thinking in the Public Sector. Triarchy Press. Sileno, G. (2016). “Aligning Law and Action”. PhD thesis. University of Amsterdam. Sileno, G., A. Boer, and T. van Engers (2014). “On the Interactional Meaning of Fundamental Legal Concepts”. In: Proceedings of the 27th International Conference on Legal Knowledge and Information Systems (JURIX 2014). Vol. FAIA 271, pp. 39–48. – (2015). “Commitments, Expectations, Affordances and Susceptibilities: Towards Positional Agent Programming”. In: Proceedings fo the 18th Conferences on Principles and Practice of Multi-Agent Systems (PRIMA 2015). Vol. LNCS 9387, pp. 687–696. – (2017). “Reading Agendas Between the Lines, an Exercise”. In: Artificial Intelligence & Law 25.1. Sileno, G., A. Saillenfest, and J.-L. Dessalles (2017). “A Computational Model of Moral and Legal Responsibility via Simplicity Theory”. In: Proceedings of the 30th Int. Conf. on Legal Knowledge and Information Systems (JURIX 2017) FAIA 302, pp. 171–176. Silver, D. et al. (2016). “Mastering the Game of Go without Human Knowledge”. In: Nature 529.7587, pp. 484–489. REFERENCES 31 Sowa, J. F. (1995). “Top-level Ontological Categories”. In: International Journal Human-Computational Studies 43.5-6, pp. 669–685. Sperber, D and D Wilson (1986). Relevance: Communication and Cognition. Wiley. Twining, W. (2010). “Normative and Legal Pluralism: A Global Perspective”. In: Duke Journal of Comparative & International Law 20.2000, pp. 473–517. Walton, D. N. (1988). “Burden of proof”. In: Argumentation 2.2, pp. 233–254.
2cs.AI
Efficient Parallel Strategy Improvement for Parity Games⋆ arXiv:1705.02313v1 [cs.DS] 5 May 2017 John Fearnley Department of Computer Science, University of Liverpool, UK Abstract. We study strategy improvement algorithms for solving parity games. While these algorithms are known to solve parity games using a very small number of iterations, experimental studies have found that a high step complexity causes them to perform poorly in practice. In this paper we seek to address this situation. Every iteration of the algorithm must compute a best response, and while the standard way of doing this uses the Bellman-Ford algorithm, we give experimental results that show that one-player strategy improvement significantly outperforms this technique in practice. We then study the best way to implement one-player strategy improvement, and we develop an efficient parallel algorithm for carrying out this task, by reducing the problem to computing prefix sums on a linked list. We report experimental results for these algorithms, and we find that a GPU implementation of this algorithm shows a significant speedup over single-core and multi-core CPU implementations. 1 Introduction Parity games. A parity game is a zero-sum game played on a finite graph between two players called Even and Odd. Each vertex of the graph is labelled with an integer priority. The players move a token around the graph to form an infinite path, and the winner is determined by the parity of the largest priority that is visited infinitely often: Even wins if and only if it is even. Parity games have attracted much attention in the verification community, because they capture the expressive power of nested least and greatest fixpoint operators, as formalized in the modal µ-calculus and other fixpoint logics [11]. In particular, deciding the winner in parity games is polynomial-time equivalent to checking non-emptiness of non-deterministic parity tree automata, and to the modal µ-calculus model checking, two fundamental algorithmic problems in automata theory, logic, and verification [7,27,11]. Strategy Improvement. We study strategy improvement for solving parity games, which is a local search technique that iteratively improves the strategy of one of the two players until an optimal strategy is found. Much like the simplex method for linear programming, and policy iteration algorithms for MDPs, ⋆ This work was supported by EPSRC grant EP/P020909/1 “Solving Parity Games in Theory and Practice.” strategy improvement algorithms can solve large parity games in a very small number of iterations in practice. The first strategy improvement algorithm devised specifically for parity games was given by Vöge and Jurdziński [30], and since then several further algorithms have been proposed [2,20,26]. Every strategy improvement algorithm uses a switching rule to decide how to proceed in each step. Theoretically, √the best known switching rule is the random-facet rule, which provides a 2O( n log n) upper bound on the number of strategy improvement iterations [21]. However, this is a single switch rule, which which only switches one edge in each iteration. In practice, we would expect an arbitrarily chosen initial strategy to differ from an optimal strategy by O(n) edges, and so a single switch rule will necessarily cause the strategy improvement algorithm to take at least O(n) iterations. In this paper, we focus on the greedy all-switches switching rule, which switches every vertex that can be switched in each iteration. This rule has been found to perform very well in practice, and as our experimental results confirm, greedy all-switches strategy improvement can solve games with more than ten million vertices in under one-hundred iterations. Practical aspects of strategy improvement. Although strategy improvement can solve large games using only a handful of iterations, experimental work has found that it performs very poorly in practice. For example, Friedmann and Lange performed an experimental study [10] in which the all-switches variant of the Vöge-Jurdziński algorithm was compared with Jurdziński’s small-progress measures algorithm [16] and Zielonka’s recursive algorithm [32]. They found that, in some cases, the Vöge-Jurdziński algorithm takes longer than an hour to solve games with under one-hundred thousand vertices, whereas the recursive algorithm can scale to problems that are an order of magnitude larger. The reason for this is that, although the algorithm uses a very small number of iterations, the cost of performing each step is very high. In particular, the Vöge-Jurdziński algorithm, which has served as the standard benchmark for strategy improvement algorithms, has a step complexity of O(n2 ), even in games with a small number of priorities1 . In fact, there are existing algorithms that avoid this high step complexity. Björklund, Sandberg and Vorobyov present an algorithm whose step complexity is O(n · d), where d is the number of distinct priorities used in the game. While d can be as large as n in the case where every vertex has a distinct priority, in practice d is often a very small constant such as 2 or 4. Luttenberger observed [20] that a particularly simple algorithm is obtained if one combines the BjörklundVorobyov strategy improvement algorithm for mean-payoff games [2], with the discrete valuation used by the Vöge-Jurdziński algorithm. This algorithm also has O(n · d) step complexity, and is the one that we will focus on in this paper. Our contribution. Our goal in this paper is to show that all-switches strategy improvement can be used in practice to solve large parity games efficiently. As 1 This is because the algorithm requires that every vertex has a distinct priority, and so comparing two valuations requires O(n) time. we have mentioned above, the number of iterations needed by the algorithm is usually tiny, and so our effort is dedicated towards improving the cost of computing each step. The main contributions of this paper are: Best response computation. In each iteration of strategy improvement, the algorithm has a strategy for one of the two players, and must compute a best response strategy for the opponent. This can be a very expensive operation in practice. For the algorithm studied in this paper, this boils down to solving a solving a shortest paths problem that can contain negative weights. The natural approach is to apply the Bellman-Ford algorithm. However, the first contribution of this paper is to show that there is a better approach: best responses can be computed using a one-player version of strategy improvement. The performance of strategy improvement algorithms on shortest paths problems was studied by Cochet-Terrasson and Gaubert [3]. While they showed that the number of improvement iterations is at most O(|V ||E|), their experimental results on random graphs found that strategy improvement was outperformed by the Bellman-Ford algorithm. They found that, while they typically both take the same number of iterations, one iteration of strategy improvement is more expensive than one iteration of Bellman-Ford. Nevertheless, for the case of parity games, we give experimental evidence to show that one-player strategy improvement outperforms the Bellman-Ford algorithm when computing best responses. The experimental data shows that part, but not all, of this improvement is due to the fact that we can initialize the algorithm with the best response from the previous iteration. A parallel algorithm for strategy improvement. Once we fix the decision to use one-player strategy improvement to compute best responses, we turn our attention towards the best way to implement this. In recent years, hardware manufacturers have made little progress in speeding up single-core CPU workloads, but progress continues to be made by adding more cores to CPUs. Moreover, GPUs continue to be made more powerful, and the rise of general purpose computing on GPUs has found many prominent applications, for example, in the training of deep neural networks. For this reason, we argue that good parallel implementations are required if we are to use an algorithm in practice. The second contribution of this paper is to develop an efficient parallel algorithm for computing a strategy improvement iteration. The decision to use one-player strategy improvement to compute best responses means that the only non-trivial task is to compute the valuation of a pair of strategies. We show that this task can be reduced to an instance of list ranking, a well-studied problem that requires us to compute the prefix-sum of a linked list. The first work optimal parallel algorithm for list ranking was given by Cole and Vishkin [4]. However, their algorithm is complex and difficult to implement in practice. Helman and Jájá give a simpler randomized algorithm that is work efficient with high probability [12], and in particular it has been shown to work well on modern GPU hardware [31]. We give a modification of the Helman-Jájá algorithm that can be used to compute a valuation in a parity game. Experimental results. We have produced CPU and GPU implementations of the aforementioned parallel algorithm. The third contribution of this paper is to provide experimental results. We use the recently developed benchmark suite of Keiren [18], which unlike previous benchmarks from PGSolver [10], contains large parity games derived from real verification tasks. We find that our implementation scales to parity games with tens of millions of vertices, and that the limiting factor is memory rather than run time. We also compare a single-threaded sequential CPU implementation with a multithreaded parallel CPU implementation and a GPU implementation, which both use list ranking algorithm described above. While the parallel CPU implementation fails to deliver a meaningful speedup, the GPU implementation delivers an average speedup of 10.37. Related work. Strategy improvement originated from the policy iteration algorithms that are used to solve Markov decision processes [25], and can be seen as a generalisation of this method to the two-player setting. The method was first proposed by Hoffman and Karp in order to solve two-player concurrent stochastic games [1]. It was then adapted by Condon [5] to solve simple-stochastic games, and by Puri to solve discounted games [24]. Parity games can be reduced in polynomial time to discounted and simple-stochastic games [15,33], so both of these algorithms could, in principle, be used to solve parity games, but both reductions require the use of large rational numbers, which makes doing so impractical. The greedy all-switches switching rule has received much attention in the past. Its good experimental performance inspired research into whether it always terminates after polynomially many iterations. However, Friedmann showed that this was not the case [9], by giving an example upon which the algorithm takes exponential time. Recently, it has even been shown that deciding whether a given strategy is visited by the algorithm is actually a PSPACE-complete problem [8]. There has been much previous work on solving parity games in parallel. Most of the work so far has focused on the small progress measures algorithm [16], because it can be ,implemented in parallel in an straightforward way. In the first paper on this topic, van de Pol and Weber presented a multi-core implementation of the algorithm [28], and Huth, Huan-Pu Kuo, and Piterman presented further optimizations to that algorithm [14]. Two papers have reported on implementations on the parallel Cell processor used by the Playstation 3 [17,29]. For parallel implementations of strategy improvement, there are two relevant papers. Hoffman and Luttenberger have given GPU implementations of various algorithms for solving parity games [13]. In particular, they implemented the strategy improvement algorithm that is studied in this paper, but they used the Bellman-Ford algorithm to compute best responses. Meyer and Luttenberger have reported on a GPU implementation of the Björklund-Vorobyov strategy improvement algorithm for mean-payoff games [22]. 2 Preliminaries Parity games. A parity game is played between two players called Even and Odd. Formally, it is a tuple G = (V, VEven , VOdd , E, pri), where (V, E) is a directed graph. The sets VEven and VOdd partition V into the vertices belonging to player Even, and the vertices belonging to player Odd, respectively. The priority function pri : V → N assigns a positive natural number to each vertex. We define DG = {p ∈ N : pri(v) = p for some v ∈ V } to be the set of priorities that are used in G. We make the standard assumption that there are no terminal vertices, which means that every vertex is required to have at least one outgoing edge. A positional strategy for player Even is a function that picks one outgoing edge for each Even vertex. More formally, a positional strategy for Even is a function σ : VEven → V such that, for each v ∈ VEven we have that (v, σ(v)) ∈ E. Positional strategies for player Odd are defined analogously. We use ΣEven and ΣOdd to denote the set of positional strategies for players Even and Odd, respectively. Every strategy that we consider in this paper will be positional, so from now on, we shall refer to positional strategies as strategies. A play of the game is an infinite path through the game. More precisely, a play is a sequence v0 , v1 , . . . such that for all i ∈ N we have vi ∈ V and (vi , vi+1 ) ∈ E. Given a pair of strategies σ ∈ ΣEven and τ ∈ ΣOdd , and a starting vertex v0 , there is a unique play that occurs when the game starts at v0 and both players follow their respective strategies. So, we define Play(v0 , σ, τ ) = v0 , v1 , . . . , where for each i ∈ N we have vi+1 = σ(vi ) if vi ∈ VEven , and vi+1 = τ (vi ) if vi ∈ VOdd . Given a play π = v0 , v1 , . . . we define: MaxIo(π) = max{p : ∃ infinitely many i ∈ N s.t. pri(vi ) = p}, to be the largest priority that occurs infinitely often along π. The winner is determined by the parity of this priority: a play π is winning for player Even if MaxIo(π) is even, and we say that π is winning for Odd if MaxIo(π) is odd. A strategy σ ∈ ΣEven is a winning strategy for a vertex v ∈ V if, for every (not necessarily positional) strategy τ ∈ ΣOdd , we have that Play(v, σ, τ ) is winning for player Even. Likewise, a strategy τ ∈ ΣOdd is a winning strategy for v if, for every (not necessarily positional) strategy σ ∈ ΣEven , we have that Play(v, σ, τ ) is winning for player Odd. The following fundamental theorem states that parity games are positionally determined. Theorem 1 ([6,23]). The set of vertices V can be partitioned into winning sets (WEven , WOdd ), where Even has a positional winning strategy for all v ∈ WEven , and Odd has a positional winning strategy for all v ∈ WOdd . The computational problem that we are interested in is, given a parity game, to determine the partition (WEven , WOdd ). 3 Strategy Improvement In this section, we describe the strategy improvement algorithm that we will consider in this paper. The algorithm, originally studied by Luttenberger [20], is a combination of the Björklund-Vorobyov strategy improvement algorithm for mean-payoff games [2], with the discrete strategy improvement valuation of Vöge and Jurdziński [30]. Strategy improvement algorithms select one of the two players to be the strategy improver. In this description, and throughout the rest of the paper, we will select player Even to take this role. A modified game. At the start of the algorithm, we modify the game by introducing a new sink vertex s into the graph. For each vertex v of the Even player, we add a new edge from v to the sink. The idea is that, at any point player Even can choose to take the edge to s and terminate the game. The owner and priority of s are irrelevant, since the game stops once s is reached. Admissible strategies. A strategy σ ∈ ΣEven is said to be admissible if player Odd cannot force and odd cycle when playing against σ. More formally, σ is admissible if, for every strategy τ ∈ ΣOdd we have that Play(v, σ, τ ) either arrives at the sink s, or that MaxIo(Play(v, σ, τ )) is even. The strategy improvement algorithm will only consider admissible strategies for player Even. Valuations. The core of a strategy improvement algorithm is a valuation, which measures how good a given pair of strategies is from a given starting vertex. For our algorithm, the valuation will count how many times each priority occurs on a given path, so formally a valuation will be a function of the form DG → Z, and we define ValsG to be the set of all functions of this form. Given an admissible strategy σ ∈ ΣEven for Even, a strategy τ ∈ ΣOdd for Odd, and a vertex v ∈ V , we define the valuation function Valσ,τ (v) : V → ValsG ∪ {⊤} as follows. – If π = Play(v, σ, τ ) is infinite, then we define Valσ,τ (v) = ⊤ – If π = Play(v, σ, τ ) is finite, then it must end at the sink s. The valuation of v will count the number of times that each priority appears along π. Formally, if π = v0 , v1 , . . . , vk , s, then for each p ∈ DV we define a valuation L ∈ ValsG as follows: L(p) = {i ∈ N : pri(vi ) = p} . We set Valσ,τ (v) = L. Observe that, since σ is an admissible strategy, Valσ,τ (v) = ⊤ implies that Play(v, σ, τ ) is winning for Even. Next, we introduce the operator ⊑ which will be used to compare valuations. We define L ⊑ ⊤ for every L ∈ ValsG . When we compare two valuations, however, the procedure is more involved. Let L1 , L2 ∈ Valsg be two valuations. If L1 = L2 then L1 ⊑ L2 and L2 ⊑ L1 . Otherwise, we define Maxdiff(L1 , L2 ) to be the largest priority p such that L1 (p) 6= L2 (p). Then, we have that L1 ⊑ L2 if and only if one of the following is true: either p = Maxdiff(L1 , L2 ) is even and L1 (p) < L2 (p), or p = Maxdiff(L1 , L2 ) is odd and L1 (p) > L2 (p). Best responses. Given an admissible strategy σ ∈ ΣEven, a best response is a strategy τ ∈ ΣOdd that minimizes the valuation of each vertex. More formally, we define, br(σ) ∈ ΣOdd to be a strategy with the property that Valσ,br(σ) (v) ⊑ Valσ,τ (v) for every strategy τ ∈ ΣOdd and every vertex v. If there is more than one such strategy, then we pick one arbitrarily. Although it is not immediately clear, it can be shown that there is a single strategy τ ∈ ΣOdd that simultaneously minimises the valuation of all vertices. Strategy improvement only ever considers an admissible strategy σ played against its best response, so we define the shorthand Valσ = Valσ,br(σ) . The algorithm. We are now ready to describe the strategy improvement algorithm. It begins by selecting the following initial strategy for Even. We define σinit ∈ ΣEven so that σinit (v) = s for all v ∈ VEven . Note that there is no guarantee that σinit is admissible, because there may be a cycle with odd parity that contains only vertices belonging to player Odd. So, a preprocessing step must be performed to eliminate this possibility. One simple preprocessing procedure is to determine the set of vertices from which Odd can avoid visiting an Even vertex, and to insert enough dummy Even vertices into this subgame to prevent Odd from forming a cycle. As it happens, none of the games considered in our experimental study require preprocessing, so this is not a major issue in practice. In each iteration, strategy improvement has a strategy for the improver. The first step is to compute the set of switchable edges for this strategy. An edge (v, u) is switchable in strategy σ if u 6= σ(v) and Valσ (σ(v)) ⊏ Valσ (u). We define S σ to be the set of edges that are switchable in σ. The algorithm selects a non-empty subset of the switchable edges and switches them. We say that a set of edges S ⊆ E is a switchable set if, for every pair of edges (v, u), (v ′ , u′ ) ∈ S, we have has v 6= v ′ , that is, S does not contain two outgoing edges for a single vertex. If S is a switchable set and σ is a strategy, then we can switch S in σ to create the new strategy σ[S] where, for every vertex v: ( u (v, u) ∈ S, σ[S](v) = σ(v) otherwise. The key property of strategy improvement is that, if S ⊆ S σ is a switchable set that contains only switchable edges, then we have that σ[S] is better than σ in the ⊑ ordering. Formally, this means that Valσ (v) ⊑ Valσ[S] (v) for all vertices v, and there exists at least one vertex for which we have Valσ (v) ⊏ Valσ[S] (v). The strict improvement property mentioned above implies that the algorithm cannot visit the same strategy twice, so it must eventually terminate. The algorithm can only terminate once it has reached a strategy with no switchable edges. We can use this strategy to determine winning sets for both players. That is, if σ ∗ is a strategy with no switchable edges, then we∗can prove that: ∗ WEven = {v ∈ V : Valσ (v) = ⊤}, and WOdd = {v ∈ V : Valσ (v) 6= ⊤}. Luttenberger has given a direct proof that the algorithm is correct [20]. Actually, a simple proof of correctness can be obtained directly from the correctness of Björklund-Vorobyov (BV) algorithm. It is not difficult to show that if we turn the parity game into a mean-payoff game using the standard reduction, and then apply the BV algorithm to the resulting mean-payoff game, then the BV algorithm and this algorithm will pass through exactly the same sequence of strategies. Theorem 2. The following statements are true. – For every strategy σ ∈ ΣEven there is at least one best response τ ∈ ΣOdd . – Let σ be a strategy, and let S ⊆ S σ be a switchable set that contains only switchable edges. We have Valσ (v) ⊑ Valσ[S] (v) for all vertices v, and there exists at least one vertex for which we have Valσ (v) ⊏ Valσ[S] (v). – Let σ be a strategy that has no switchable edges. We have WEven = {v ∈ V : Valσ (v) = ⊤}, and WOdd = {v ∈ V : Valσ (v) 6= ⊤}. Switching rules. Strategy improvement always switches a subset of switchable edges, but we have not discussed which set should be chosen. This decision is delegated to a switching rule, which for each strategy picks a subset of the switchable edges. In this paper we will focus on the greedy all-switches rule, which always switches every vertex that has a switchable edge. If a vertex has more than one switchable edge, then it picks an edge (v, u) that maximizes Valσ (u) under the ⊑ ordering (arbitrarily if there is more than one such edge.) 4 Computing Best Responses To implement strategy improvement, we need a method for computing best responses. Since we only consider admissible strategies for Even, we know that Odd cannot create a cycle with odd parity, and so computing a best response simply requires us to find a shortest-path from each vertex to the sink, where path lengths are compared using the ⊑ ordering. Any vertex that has no path to the sink is winning for Even. The obvious way to do this is to apply a shortestpaths algorithm. Note that odd priorities correspond to negative edges weights, so a general algorithm, such as the Bellman-Ford algorithm, must be applied. One-player strategy improvement. In this paper, we propose an alternative: we will use one-player strategy improvement equipped with the greedy-all switches rule. We say that an edge (v, u) is Odd-switchable if v ∈ VOdd and Valσ,τ (σ(v)) ⊐ Valσ,τ (u). To find a best response against a fixed admissible strategy σ ∈ ΣEven , the algorithm starts with an arbitrary Odd strategy τ ∈ ΣOdd , and repeatedly switches Odd-switchable edges until it arrives at an Odd strategy in which there are no Odd-switchable edges. It is not difficult to see that if τ has no Odd-switchable edges when played against σ, then it is a best response against σ, because a strategy with no Oddswitchable edges satisfies the Bellman optimality equations for shortest paths. One-player strategy improvement algorithms for solving shortest paths problems were studied by Cochet-Terrasson and Gaubert [3]. In particular, they proved that the all-switches variant of the algorithm always terminates after at most O(|V ||E|) steps. Hence, we have the following lemma. Lemma 3. Let σ be an admissible strategy. One-player strategy improvement will find a best-response against σ after at most O(|V ||E|) iterations. The algorithm. We can now formally state the algorithm that we will study. Given a strategy σ ∈ ΣEven, let AllEven (σ) be the function that implements the greedy all-switches switching rule as described earlier. Moreover, given a pair of strategies σ ∈ ΣEven and τ ∈ ΣOdd , let AllOdd (σ, τ ) be a set S of Odd-switchable edges (v, u) such that there is no edge (v, w) ∈ E with Valσ,τ (u) ⊐ Valσ,τ (w), and such that each vertex has at most one outgoing edge in S. Algorithm 1 The strategy improvement algorithm Initialize σ := σinit and set τ to be an arbitrary strategy. repeat repeat Compute Valσ,τ (v) for every vertex v. Set τ := τ [SOdd ] where SOdd = AllOdd (σ, τ ). until SOdd = ∅ Set σ := σ[SEven ] where SEven = AllEven (σ). until SEven = ∅ The inner loop computes best responses using one-player strategy improvement, while the outer loop performs the two-player strategy improvement algorithm. Note, in particular, that after switching edges in σ, the first Odd strategy considered by the inner loop is the best response to the previous strategy. 5 Parallel Computation of Valuations Most operations used by strategy improvement can naturally be carried out in parallel. In particular, if we have already computed a valuation, then deciding whether an edge is switchable at a particular vertex v, and finding the switchable edge that has the highest valuation at v, are both local properties that only depend on the outgoing edges of v. So these operations can trivially be carried out in parallel. This leaves the task of computing a valuation as the only task that does not have an obvious parallel algorithm. In this section, we give an efficient parallel algorithm for computing a valuation. Given two strategies σ ∈ ΣEven and τ ∈ ΣOdd in a game G, we show how computing Valσ,τ (v) can be parallelized in a work efficient manner. There is an obvious sequential algorithm for this task that runs in time O(|V | · |DG |) which works backwards on the tree defined by σ and τ and counts how many times each priority appears on each path to s. Every vertex not found by this procedure must have valuation ⊤. List ranking. The idea of our algorithm is to convert the problem of computing a valuation, into the well-known problem of computing prefix-sums on a linked list, which is known as list ranking. We will then adapt the efficient parallel algorithms that have been developed for this problem. Given a sequence of integers x0 , x1 , x2 , . . . , xk , and a binary associative operator ⊕, the prefix-sum problem requires us to compute a sequence of integers y0 , y1 , y2 , . . . , yk such that yi = x1 ⊕ x2 ⊕ · · · ⊕ xi−1 . If the input sequence is given as an array, then efficient parallel algorithms have long been known [19]. If the input sequence is presented as a linked-list, then the problem is called the list ranking problem, and is more challenging. The first work optimal parallel algorithm for list ranking was given by Cole and Vishkin [4]. However, their algorithm is complex and difficult to implement in practice. Helman and Jájá give a simpler randomized algorithm that is work efficient with high probability [12]. Theorem 4 ([12]). There is a randomized algorithm for list ranking that, with high probability, runs in time O(n/p) whenever n > p2 ln n, where n denotes the length of the list, and p denotes the number of processors. We now give a brief overview of the algorithm, as we will later modify it slightly. A full and detailed description can be found in [12]. The algorithm works n randomly choosing s = p log n elements of the list to be splitters. Intuitively, each splitter defines a sublist that begins at the splitter, and ends at the next splitter that is encountered in the list (or the end of the list). These sublists are divided among the processors, and are ranked using the standard sequential algorithm. Once this has been completed, we can create a reduced list, in which each element is a splitter, and the value of each element is the prefix-sum of the corresponding sublist. The reduced list is ranked by a single processor, again using the standard sequential algorithm. Finally, we can complete the list ranking task as follows: if an element e of the list has rank xr in its sublist, and the splitter at the start of sublist has rank xs in the reduced list, then the rank of e is xs ⊕ xr . Pseudoforests and Euler tours. We now show how the problem of computing a valuation can be reduced to list ranking. Let G σ,τ = (V, VEven , VOdd , E σ,τ , pri) be the game G in which every edge not used by σ and τ is deleted. Since each vertex has exactly one outgoing edge in this game, the partition of V into VEven and VOdd are irrelevant, and we shall treat G σ,τ has a graph labelled by priorities. First, we observe that G σ,τ is a directed pseudoforest. The set of vertices whose valuation is not ⊤ form a directed tree rooted at s. For these vertices, our task is to count the number of times each priority occurs on each path to the sink, and hence compute a valuation. Each other vertex is part of a directed pseudotree, which is a directed tree in which the root also has exactly one outgoing edge that leads back into the tree. Since we deal only with admissible strategies, every vertex in a pseudotree has valuation ⊤. A standard technique for reducing problems on trees to list ranking is the Euler tour technique. We will describe this technique for the tree rooted at s, and show that it can be used to compute a valuation. We will also use the same technique for the other pseudo-trees in the graph, but since this portion of the algorithm is not standard, we defer the description until later. a c b d c, a a, b b, d b, e b, a e d, b e, b a, c Fig. 1. Converting a tree into a linked list using the Euler tour technique. Left: the original tree. Right: the corresponding linked list. In order to compute a valuation for every vertex v in the tree rooted at s, we need to count the number of times that a given priority p occurs on the path from v to the root. We create a linked list as follows. First we replace each directed edge (v, u) with two edges (v, u) and (u, v). Then we select an Euler tour of this modified graph that starts and ends at the root. We use this tour to create a linked list, in which each element of the list an edge of the original tree, and the successors of each element are determined by the Euler tour. The value associated with each element e is defined as follows: – If e = (u, v), then the value of e is 1 if pri(v) = p, and 0 otherwise. – If e = (v, u), then the value of e is −1 if pri(v) = p and 0 otherwise. If we then compute a list ranking on this list using + as the operator ⊕, then the ranking of (v, u) gives the number of times p appears on the path from v to the sink. Obviously, to compute a valuation we must do the above procedure in parallel for each priority in the game. Formal reduction to list ranking. We now give a formal definition of the technique that we just described. Recall that E σ,τ gives the edges chosen by σ and τ . We define ← − E σ,τ = {(u, v) : (v, u) ∈ E σ,τ }, to be the set of reversed edges. We call each edge in E σ,τ an up edge, since it ← − moves towards the root, and correspondingly we call each edge in E σ,τ a down ← − edge. The set of elements in our linked list will be L = E σ,τ ∪ E σ,τ . Next we define the successor function succ : L → L ∪ {ǫ}, which gives the structure of the list, and where ǫ is used to denote the end of the list. To do this, we take an arbitrary Euler tour of the tree, and define ≻ to be the function that follows this tour. Figure 1 gives an example of this construction. In our overview, we described how to use list ranking to compute the number of times a given priority p appears on the path to the sink. In our formal definition, we will in fact compute a full valuation with a single call to a list ranking algorithm. To achieve this, we define the weight function w : L → ValsG as follows. For each priority p ∈ DG , we first define two valuations Ap , A−p ∈ ValsG so that, for every q ∈ DG : ( 1 if q = p, Ap (q) = 0 otherwise. A−p (q) = ( −1 if q = p, 0 otherwise. Then, for every list element e = (u, v) ∈ L: if e is an up edge then we set w(e) = A− pri(u) , and if e is a down edge then we set w(e) = Apri(v) . Moreover, we define the binary operator ⊕ as follows. Given two valuations A1 , A2 , we define A1 ⊕ A2 = A3 where for every priority p ∈ DG we have A3 (p) = A1 (p) + A2 (p). Modifications to the Helman-Jájá algorithm. We must also handle the vertices that lie in pseudotrees. Our reduction turns every pseudotree into a pair of cycles. The Helman-Jájá algorithm can be adapted to deal with these, by ensuring that if a cycle is found in the reduced list, then all vertices on it are given a valuation of ⊤. Moreover, some vertices may not be part of a reduced list, because they may be part of a small pseudotree, and none of random splitters were in that pseudotree. Since the Helman-Jájá always picks the head of the list to be a splitter (in our case this would be an edge leaving the sink at the start of the Euler tour), every vertex in the tree rooted at s is in the reduced list. So any vertex not part of a reduced list can be assigned valuation ⊤. Constructing the list ranking instance in parallel. Since at least one of σ and τ will change between every iteration, we must construct a new list ranking instance in every iteration of our algorithm. Thus, in order to have a true parallel algorithm, we must be able to carry out the reduction in parallel as well. We start by describing a sequential algorithm for the task. Each vertex in the tree maintains two pointers startv and endv . Initially, startv points to the down edge of v, and endv points to the up edge of v. Then, in an arbitrary order, we process each vertex v, and do the following: 1. Determine the parent of v in the tree, and call it u. 2. Connect the list element pointed to by startu to the element pointed to by startv . 3. Set startu = endv . Once this has been completed, we then join the list element pointed to by startv to the list element pointed to by endv , for all vertices v. Intuitively, this algorithm builds the tour of each subtree incrementally. The second step adds the tour of the subtree starting at v to the linked list associated with u. The third step ensures that any further children of u will place their tours after the tour of the subtree of v. For example, let us consider the tree and corresponding Euler tour given in Figure 1, and let us focus on the vertex b. Initially, startv points to (a, b), while endv points to (b, a), which are the down and up edges of b, respectively. Let us suppose that d is processed before e. When d is processed, (a, b) is connected to (b, d) and startv is updated to point to (d, b). Subsequently, when e is processed (d, b) is connected to (b, e), and startv is updated to point to (e, b). Then, in the final step of the algorithm (b, d) is connected to (d, b) and (e, b) is connected to (b, a). So, the linked list corresponding to the subtree of b (shown on the right in Figure 1) is created. Note that if e was processed before d, then a different linked list would be created, which would correspond to a different Euler tour of the tree. From the point of view of the algorithm, it is not relevant which Euler tour is used to construct the linked list. In theory, this algorithm can be carried out in parallel in O(n/p) time and O(np) space by having each processor maintain its own copy of the pointers startv and endv , and then after the algorithm has been completed, merging the p different sublists that were created. In practice, the space blow up can be avoided by using atomic exchange operations, which are available on both CPU and GPU platforms. More precisely, we can use an atomic exchange instruction to set startu = endv , while copying the previous value of startu to a temporory variable, and then connect the list element that was pointed to by startu to startv . 6 Experimental Results Experimental setup. Our experimental study uses four implementations. – GPU-LR: a GPU implementation that uses the list-ranking algorithm to compute valuations. The GPU is responsible for ranking the sublists, while ranking the reduced list is carried sequentially on the CPU. – CPU-Seq: a single-threaded implementation that uses the natural sequential algorithm for computing valuations. – CPU-LR: a multi-threaded CPU implementation that uses the list-ranking algorithm to compute valuations. The sublists are ranked in parallel, while the reduced lists is ranked by a single thread. – Bellman-Ford: a single-threaded CPU implementation that uses the BellmanFord algorithm to compute best responses. All implementations are in C++, and the GPU portions are implemented using NVIDIA CUDA. The code is publicly available2 . We also compare our results to PGSolver’s recursive algorithm, with all of PGSolver’s heuristics disabled in order to deliver a fair comparison. We chose the recursive algorithm because it was found to be the most competitive in the previous experimental study of Friedmann and Lange [10]. For our benchmark games we utilise the suite that was recently developed by Keiren [18]. This provides a wide array of parity games that have been used throughout the literature for model-checking and equivalence checking. Since there are over 1000 games, we have selected a subset of those games to use here, and these are shown in Table 1. In particular, we have chosen a set of games that span a variety of sizes, and that cover a variety of tasks from verification. We found that strategy improvement solves many of the games in the suite in a 2 https://github.com/jfearnley/parallel-si Game Property CABP/Par 2 CABP/Par 1 ABP(BW)/CABP Elevator Election Lift (Incorrect) SWP/SWP 1 SWP CABP ABP/Onebit Hesselink/Hesselink SWP/SWP 2 ABP(BW)/Onebit SWP/SWP 3 branching-bisim weak-bisim weak-bisim fairness eventually-stable liveness strong-bisim io-read-write io-receive weak-bisim weak-bisim branching-bisim weak-bisim weak-bisim Vertices ΣEven ΣOdd Edges Pris 167k 147k 157k 862k 2.3m 2.0m 3.8m 6.8m 7.0m 8.3m 29.9m 37.6m 35.4m 32.9m 79k 122k 129k 503k 343k 999k 1.5m 4.2m 5.2m 7.2m 22.9m 20.1m 30.6m 29.0m 88k 25k 27k 359k 2.0m 999k 2.2m 2.6m 1.8m 1.1m 7.0m 17.6m 4.8m 3.9m 434k 501k 523k 1.4m 7.9m 9.8m 11.5m 15.8m 24.9m 31.3m 78.8m 120.8m 134.9m 167.5m 2 2 2 3 4 4 2 3 2 2 2 2 2 2 Table 1. The games that we consider in our experimental study. The table displays the number of vertices, player Even vertices, player Odd vertices, edges, and distinct priorities. very small number of iterations, so the results that we present here focus on the games upon which strategy improvement takes the largest number of iterations. The vast majority of the games in the suite have between 2 and 4 priorities, and the ones that do not are artificially constructed (eg. random games), so we believe that our sample is representative of real world verification tasks. The test machine has an Intel Core i7-4770K CPU, clocked at 3.50GHz (3.90GHz boost), with 4 physical cores, and 16GB of RAM. The GPU is an NVIDIA GeForce GTX 780, which has 2304 CUDA cores clocked at 1.05GHz and 3GB of RAM. At the time of purchase in 2013, the CPU cost £248.20 and the GPU cost £444.94. Since the CPU has 8 logical cores with hyper-threading enabled, we use 8 threads in our CPU multi-threaded implementations. When benchmarking for time, we ran each instance three times, and the reported results are the average of the three. We implemented a time limit of 10 minutes. We only report the amount of time needed to solve the game, discarding the time taken to parse the game. Best response algorithms. Our first experiment is to determine which method for computing best responses is faster in practice. In this experiment we compare the single-core sequential implementation of one-player strategy improvement (SI) against a single-core sequential implementation of the Bellman-Ford algorithm. As we have mentioned, our one-player strategy improvement starts with the optimal strategy against the previous strategy of the improver. To quantify the benefit of this, we have also include results for a version of the one-player strategy Game Maj. SI SI-Reset Bellman-Ford Edges Iter Time (s) Iter Time (s) Iter Time (s) Iter CABP/Par 2 CABP/Par 1 ABP(BW)/CABP Elevator Election Lift (Incorrect) SWP/SWP 1 SWP CABP ABP/Onebit 434k 501k 523k 1.4m 7.9m 9.8m 11.5m 15.8m 24.9m 31.3m 8 12 9 33 77 16 8 11 11 20 0.33 0.22 0.15 13.18 41.43 9.09 14.69 25.44 5.45 34.15 53 47 28 231 364 69 58 82 11 57 0.49 0.36 0.29 17.88 57.66 22.82 22.25 31.69 5.54 93.78 100 93 65 364 585 215 93 104 11 234 1.65 2.41 1.38 216.36 157.5 42.47 71.21 109.31 59.37 494.97 161 235 128 2238 842 242 152 148 108 604 Table 2. Experimental results comparing the algorithm used to compute a best response. The algorithms are (1) SI: one-player strategy improvement (2) SI (Reset): one-player strategy improvement starting from an arbitrary strategy (3) Bellman-Ford. For each algorithm we report the total time and the total number of iterations used by the best response algorithm. improvement algorithm that, at the start of each best response computation, resets to the initial arbitrarily chosen strategy. We refer to this as SI-Reset. The results are displayed in Table 2. We only report results for games that Bellman-Ford solved within the 10 minute time limit. We report the total number of major iterations, which are the iterations in which the improver’s strategy is switched. The number of major iterations does not depend on the algorithm used to compute best responses. For each algorithm we report the overall time and the total number of iterations used computing best responses. Before discussing the results in detail we should first note that these results paint a very positive picture for strategy improvement. All games were solved in at most 77 major iterations, with most being solved with significantly fewer major iterations. The number of iterations used on the Election instance was the most that we saw over any instance in our study, including those that we do not report here. This clearly shows that strategy improvement can scale to very large instances. Moving on to the choice of best response algorithm, the most striking feature is that Bellman-Ford is on average 8.43 times slower than one-player strategy improvement (min 3.80, max 16.42). Some of this difference can be explained by the fact that Bellman-Ford is on average 1.72 times slower per iteration than one-player strategy improvement (min 1.11, max 2.38), which may be due to implementation inefficiencies. But most of the difference is due to the fact that Bellman-Ford uses on average 5.30 times more iterations than one-player strategy improvement (min 1.80, max 10.60). The results with SI-Reset show that only some of this difference can be attributed to reusing the previous best response as SI-Reset uses on average 2.05 times more iterations than SI (min 1.00, max 4.11). Overall we found that SI used an average of 5.49 iterations to compute each best response (min 1.0 max 9.9), which again indicates that this method can scale to very large games. Game CABP/Par 2 CABP/Par 1 ABP(BW)/CABP Elevator Election Lift (Incorrect) SWP/SWP 1 SWP CABP ABP/Onebit Hesselink/Hesselink SWP/SWP 2 ABP(BW)/Onebit SWP/SWP 3 Iterations Time (s) Edges Maj. Tot. GPU-LR CPU-Seq CPU-LR PGSolver 434.0k 501.0k 523.0k 1.4m 7.9m 9.8m 11.5m 15.8m 24.9m 31.3m 78.8m 120.8m 134.9m 167.5m 8 53 12 47 9 28 33 231 77 364 16 69 8 58 11 82 11 11 20 57 28 142 10 99 20 57 10 71 0.05 0.04 0.03 0.87 4.37 0.79 1.06 2.71 0.39 2.28 —† —† —† —† 0.33 0.22 0.15 13.18 41.43 9.09 14.69 25.44 5.45 34.15 318.98 282.17 147.03 142.96 0.48 0.4 0.25 11.56 58.43 9.35 14.57 35.01 5.33 32.46 299.43 265.62 142.35 168.45 0.48 0.46 0.49 13.23 30.45 40.76 28.83 201.83 134.33 —† —† —† —† —† Table 3. Experimental results comparing the running time of (1) GPU-LR: list ranking on the GPU (2) CPU-Seq: a sequential CPU implementation (3) CPU-LR: list ranking on a 4-core CPU (4) PGSolver: the recursive algorithm from PGSolver. † indicates a failure due to lack of memory. Parallel implementations. Our second set of experimental results concerns our parallel implementation of strategy improvement when best responses are computed by one-player strategy improvement. The results are displayed in Table 3. The first thing to note is that the parallel algorithm does not deliver good performance when implemented on a CPU. On average the multi-threaded CPU list ranking algorithm was 1.25 times slower than the single-threaded sequential algorithm (min 0.88, max 1.77). This can be partially explained by the fact that the total amount of work done by the parallel algorithm is at least twice the amount of work performed by the sequential algorithm, since turning the strategy into a linked list doubles the number of vertices. On the other hand, the GPU implementation delivers a significant speedup. To give a fair comparison between the GPU implementation and the CPU implementations, we compute the ratio between the time taken by GPU-LR, and the minimum of the times taken by CPU-Seq and CPU-LR. Using this metric we find that the average speedup is 10.37 (min 5.54, max 14.21). The average speedup increases to 12.17 if we discard instances with fewer than 1 million edges, where setup overhead makes the GPU algorithm less competitive. The downside to the GPU implementation is that games with more than about 32 million edges are too large to fit within the 3GB of memory on our test GPU. Obviously, there is a cost trade off between the extra speed delivered by a GPU and the cost of purchasing a GPU with enough memory. At the time of writing, relatively cheap consumer graphics cards can be bought with up to 8GB of memory, while expensive dedicated compute cards are available with up to 24GB of memory. Finally, we compare our results to PGSolver’s recursive algorithm. Here, to have a fair comparison, we should compare with the sequential CPU algorithm, as both algorithms are single-threaded. Unfortunately PGSolver ran out of memory for the very large games in our test set, but for the smaller games it can be seen that CPU-Seq is always competitive, and in many cases significantly faster than PGSolver. References 1. R. M. K. A. J. Hoffman. On nonterminating stochastic games. Management Science, 12(5):359–370, 1966. 2. H. Björklund and S. G. Vorobyov. A combinatorial strongly subexponential strategy improvement algorithm for mean payoff games. Discrete Applied Mathematics, 155(2):210–229, 2007. 3. J. Cochet-Terrasson and S. Gaubert. Policy iteration algorithm for shortest path problems. Technical report, 2000. 4. R. Cole and U. Vishkin. Faster optimal parallel prefix sums and list ranking. Inf. Comput., 81(3):334–352, 1989. 5. A. Condon. On algorithms for simple stochastic games. In Advances In Computational Complexity Theory, Proceedings of a DIMACS Workshop, pages 51–72, 1990. 6. E. A. Emerson and C. S. Jutla. Tree automata, mu-calculus and determinacy. In Proc. of FOCS, pages 368–377, 1991. 7. E. A. Emerson, C. S. Jutla, and A. P. Sistla. On model-checking for fragments of µ-calculus. In Proc. of CAV, pages 385–396, 1993. 8. J. Fearnley and R. Savani. The complexity of all-switches strategy improvement. In Proc. of SODA, pages 130–139, 2016. 9. O. Friedmann. An exponential lower bound for the latest deterministic strategy iteration algorithms. Logical Methods in Computer Science, 7(3), 2011. 10. O. Friedmann and M. Lange. Solving parity games in practice. In Proc. of ATVA, pages 182–196, 2009. 11. E. Grädel, W. Thomas, and T. Wilke, editors. Automata, Logics, and Infinite Games. A Guide to Current Research, volume 2500 of LNCS. Springer, 2002. 12. D. R. Helman and J. JáJá. Designing Practical Efficient Algorithms for Symmetric Multiprocessors, pages 37–56. 1999. 13. P. Hoffmann and M. Luttenberger. Solving parity games on the GPU. In Proc. of ATVA, pages 455–459, 2013. 14. M. Huth, J. H. Kuo, and N. Piterman. Concurrent small progress measures. In Proc. of Haifa Verification Conference, pages 130–144, 2011. 15. M. Jurdziński. Deciding the winner in parity games is in UP ∩ co-UP. Information Processing Letters, 68(3):119–124, 1998. 16. M. Jurdzinski. Small progress measures for solving parity games. In Proc. of STACS, pages 290–301, 2000. 17. J. Kandziora. Playing parity games on the Playstation 3. In Twente Student Conference, 2009. 18. J. J. A. Keiren. Benchmarks for parity games. In Proc. of FSEN, pages 127–142, 2015. 19. R. E. Ladner and M. J. Fischer. Parallel prefix computation. J. ACM, 27(4):831– 838, 1980. 20. M. Luttenberger. Strategy iteration using non-deterministic strategies for solving parity games. CoRR, abs/0806.2923, 2008. 21. J. Matoušek, M. Sharir, and E. Welzl. A subexponential bound for linear programming. Algorithmica, 16(4–5):498–516, 1996. 22. P. J. Meyer and M. Luttenberger. Solving mean-payoff games on the GPU. In Proc. of ATVA, pages 262–267, 2016. 23. A. W. Mostowski. Games with forbidden positions. Technical Report 78, University of Gdańsk, 1991. 24. A. Puri. Theory of Hybrid Systems and Discrete Event Systems. PhD thesis, University of California, Berkeley, 1995. 25. M. L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons, Inc. New York, NY, USA, 2005. 26. S. Schewe. An optimal strategy improvement algorithm for solving parity and payoff games. In Proc. of CSL, 2008. 27. C. Stirling. Local model checking games (Extended abstract). In Proc. of CONCUR, 1995. 28. J. van de Pol and M. Weber. A multi-core solver for parity games. Electr. Notes Theor. Comput. Sci., 220(2):19–34, 2008. 29. F. van der Berg. Solving parity games on the Playstation 3. In Twente Student Conference, 2010. 30. J. Vöge and M. Jurdziński. A discrete strategy improvement algorithm for solving parity games. In Proc. of CAV, pages 202–215, 2000. 31. Z. Wei and J. JáJá. Optimization of linked list prefix computations on multithreaded gpus using CUDA. Parallel Processing Letters, 22(4), 2012. 32. W. Zielonka. Infinite games on finitely coloured graphs with applications to automata on infinite trees. Theoretical Computer Science, 200:135–183, 1998. 33. U. Zwick and M. S. Paterson. The complexity of mean payoff games on graphs. Theoretical Computer Science, 158(1–2):343–359, 1996.
8cs.DS
Better Runtime Guarantees Via Stochastic Domination arXiv:1801.04487v1 [cs.NE] 13 Jan 2018 Benjamin Doerr École Polytechnique Palaiseau France January 16, 2018 Abstract Apart from few exceptions, the mathematical runtime analysis of evolutionary algorithms is mostly concerned with expected runtimes. In this work, we argue that stochastic domination is a notion that should be used more frequently in this area. Stochastic domination allows to formulate much more informative performance guarantees than the expectation alone, it allows to decouple the algorithm analysis into the true algorithmic part of detecting a domination statement and probability theoretic part of deriving the desired probabilistic guarantees from this statement, and it allows simpler and more natural proofs. As particular results, we prove a fitness level theorem which shows that the runtime is dominated by a sum of independent geometric random variables, we prove tail bounds for several classic problems, and we give a short and natural proof for Witt’s result that the runtime of any (µ, p) mutation-based algorithm on any function with unique optimum is subdominated by the runtime of a variant of the (1+1) EA on the OneMax function. 1 Introduction The analysis of evolutionary algorithms via mathematical means is an established part of evolutionary computation research. The subarea of runtime 1 analysis aims at giving proven performance guarantees on the time an evolutionary algorithm takes to find optimal or near-optimal solutions. Traditionally, this area produces estimates for the expected runtime, which are occasionally augmented by tail bounds. A justification for this was that for already very simply evolutionary algorithms and optimization problems, the stochastic processes arising from running this algorithm on this problem are so complicated that any more detailed analysis is infeasible. See the analysis how the (1 + 1) evolutionary algorithm optimizes linear functions x 7→ a1 x1 + · · · + an xn in [DJW02] for an example for this complexity. In this work, we shall argue that the restriction to expectations is only partially justified and propose stochastic domination as an alternative. It is clear that the precise distribution of the runtime of an evolutionary algorithms in all cases apart from very trivial ones is out of reach. Finding the precise distribution is maybe not even an interesting target because most likely already the result will be too complicated to be useful. What would be very useful is a possibly not absolutely tight upper bound-type statement that concerns the whole distribution of the runtime. One way to formalize such statement is via the notion of stochastic domination. We say that a real-valued random variable Y stochastically dominates another one X if and only if for each λ ∈ R, we have Pr[X ≤ λ] ≥ Pr[Y ≤ λ]. If X and Y describe the runtimes of two algorithms A and B, then this domination statement is a very strong way of saying that algorithm A is at least as fast as B. See Section 2 for a more detailed discussion of the implication of such a domination statement. In this work, we shall give three main arguments for a more frequent use of domination arguments in runtime analysis. Stochastic domination is often easy to show. Surprisingly, despite being a much stronger type of assertion, stochastic domination statements are often easy to obtain. The reason is that many of the classic proofs implicitly contain all necessary information, they only fail to formulate the result as a domination statement. As an example, we prove a natural domination version of the classic fitness level method. In analogy to the classic result, which translates pessimistic improvement p1 , . . . , pm−1 into an Pm−1 probabilities 1 expected runtime estimate E[T ] ≤ i=1 pi , we show that under the same assumptions the runtime T is dominated by the sum of independent geometric random variables with success probabilities p1 , . . . , pm−1 . This statement implies the classic result, but also implies tail bound for the runtime via Chernoff bounds for geometric random variables. We note that, while our 2 extension is very natural, the proof is not totally obvious, which might explain why previous works were restricted to the expectation version. Stochastic domination allows to separate the core algorithm analysis and the probability theoretic derivation of probabilistic runtime statements. The reason why stochastic domination statements are often easy to obtain is that they are close to the actions of the algorithms. When we are waiting for the algorithm to succeed in performing a particular action, then it is a geometric distribution that describes this waiting time. To obtain such a statement, we need to understand how the algorithm reaches a particular goal. This requires some elementary probability theory and discrete mathematics, but usually no greater expertise in probability theory. We give several examples, mostly using the fitness level method, but also for the single-source shortest paths problem, where the fitness level method is not suitable to give the best known results. Once we have a domination statement formulated, e.g., that the runtime is dominated by a sum of independent geometric distributions, then deeper probability theoretic arguments like Chernoff-type tail bounds come into play. This part of the analysis is independent of the algorithm and only relies on the domination statement. Exemplarily, we derive tail bounds for the runtime of the (µ+1) EA on OneMax, the (1+1) EA for sorting, and the multi-criteria (1 + 1) EA for the single-source shortest path problem. That these two stages of the analysis are of a different nature is also visible in the history of runtime analysis. As discussed in the previous paragraph, the classic fitness level method essentially contains all ingredients to formulate a runtime domination statement. However, the mathematical tools to analyze sums of independent geometric random variables were developed much later (and this development is still ongoing). This historical note also shows that from the viewpoint of research organization, it would have been profitable if previous works would have been formulated in terms of domination statements. This might have spurred a faster development of suitable Chernoff bounds and, in any case, it would have made it easier to apply the recently found Chernoff bounds (see Theorems 7 to 9) to these algorithmic problems. Stochastic domination often leads to more natural and shorter proofs. To demonstrate this in an application substantially different from the previous ones, we regard the classic lower-bound result which, in simple words, states that OneMax is the easiest fitness function for many mutation-based algorithms. This statement, of course, should be 3 formulated via stochastic domination (and this has indeed been done in previous work). However, as we shall argue in Section 5, we also have the statement that when comparing the optimization of OneMax and some other function with unique optimum, then the distance of the current-best solution from the optimum for the general function dominates this distance for the OneMax function. This natural statement immediately implies the domination relation between the runtimes. We make this precise for the current-strongest OneMax-is-easiest result [Wit13]. This will shorten the previous, two-and-a-half pages long complicated proof to an intuitive proof of less than a page. Related work. The use of stochastic domination is not totally new in the theory of evolutionary computation, however, the results so far appear rather sporadic than systematic. In [DJWZ13], the precise analysis of the expected runtime of the (1 + 1) EA on the LeadingOnes function [BDN10] was transformed into a domination statement, which was then used to derive a tail bound, which again was necessary to obtain results in the fixed budget perspective [JZ14]. Before that, in [BE08], different evolutionary algorithms were compared by arguing that at all times the fitness in one algorithm dominates the fitness in the other algorithm. This was done, however, without explicitly appealing to the notion of stochastic domination. Consequently, the tools presented in this work were not available. Still, this might be the first work in the theory of evolutionary computation which uses stochastic domination to phrase and prove results. What comes closest to this work is the paper [ZLLH12], which also tries to establish runtime analysis beyond expectations. The notion proposed in [ZLLH12], called probable computational time L(δ), is the smallest time T such that the algorithm under investigation within the first T fitness evaluations finds an optimal solution with probability at least 1 − δ. In some sense, this notion can be seen as an inverse of the classic tail bound language, which makes statements of the type that the probability that the algorithm needs more than T iterations, is at most some function in T , which is often has an exponential tail. To prove results on the probable computational time, [ZLLH12] implicitly use (but do not prove) the result that the fitness level method gives a stochastic domination by a sum of independent geometric random variables (which we prove in Section 3). When using this result to obtain bounds on the probable computational time, [ZLLH12] suffer from the fact that at that time, good tail bounds for sums of geometric random variables with different success probabilities where not yet available (these appeared only in [Wit14,DD15]). For this reason, they had to prove an own tail bound, 4 which unfortunately gives a non-trivial tail probability only for values above twice the expectation. With this restriction, [ZLLH12] prove tail bounds for the runtimes of the algorithms RLS, (1 + 1) EA, (µ + 1) EA, MMAS∗ and binary PSO on the optimization problems OneMax and LeadingOnes. 2 Stochastic Domination In this section, recall the definition of stochastic domination and collect a few known properties of this notion. For an extensive treatment of various forms of stochastic orders, we refer to [MS02]. Definition 1 (Stochastic domination). Let X and Y be random variables not necessarily defined on the same probability space. We say that Y stochastically dominates X, written as X  Y , if for all λ ∈ R we have Pr[X ≤ λ] ≥ Pr[Y ≤ λ]. If Y dominates X, then the cumulative distribution function of Y is pointwise not larger than the one of X. The definition of domination is equivalent to “∀λ ∈ R : Pr[X ≥ λ] ≤ Pr[Y ≥ λ]”, which shows more clearly why we feel that Y is at least as large as X. Concerning nomenclature, we remark that some research communities in addition require that the inequality is strict for at least one value of λ. Hence, intuitively speaking, Y is strictly larger than X. From the mathematical perspective, this appears not very practical, and from the computer science perspective it is not clear what can be gained from this alternative definition. Consequently, our definition above is more common in computer science (though, e.g., [ZLLH12] also use the alternative definition). One advantage of comparing two distributions via the notion of domination is that this makes a statement over the whole domain of the distributions, including “rare events” on the tails. If the runtime TA of some algorithm A is dominated by the runtime TB of algorithm B, then not only A is better than B in average, but also exceptionally large runtimes occur less frequent when using A. A second advantage is that domination is invariant under monotonic rescaling. Imagine that running an algorithm for time t incurs some cost c(t). We may clearly assume that c is monotonically increasing, that is, that t1 ≤ t2 implies c(t1 ) ≤ c(t2 ). Then TA  TB implies c(TA )  c(TB ). Hence changing the cost measure does not change our feeling that algorithm A is better than B. Note that this is different for expectations. We may well have E[TA ] < E[TB ], but E[c(TA )] > E[c(TB )]. We collect a few useful properties of stochastic domination. 5 Lemma 2. If X  Y , then E[X] ≤ E[Y ]. Lemma 3. The following two conditions are equivalent. (i) X  Y . (ii) For all monotonically increasing functions f : R → R, we have E[f (X)] ≤ E[f (Y )]. The following non-trivial lemma will be needed in our proof of the extended fitness level theorem. It was proven in slightly different forms in [DHK12] and [Doe11] with the additional assumption that for all i ∈ [1..n], the variable Xi∗ is independent of X1 , . . . , Xi−1 , but a short reflection of the proof reveals that this can be assumed with out loss of generality, so it is not required in the statement of the result. Also, as a reviewer correctly remarked, the restriction to integral random variables can easily be relaxed to arbitrary discrete random variables. Lemma 4. Let X1 , . . . , Xn be arbitrary integral random variables. Let X1∗ , . . . , Xn∗ be random variables that are mutually independent. Assume that for all i ∈ [1..n] and all x1 , . . . , xi−1 ∈ Z with Pr[X1 = x1 , . . . , Xi−1 = xi−1 ] > 0, we have Pr[Xi ≥ k | X1 = x1 , . . . , Xi−1 = xi−1 ] ≤ Pr[Xi∗ ≥ k] for all k ∈ Z, that is, Xi∗ dominates (Xi | X1 = x1 , . . . , Xi−1 = xi−1 ). Then for all k ∈ Z, we have X  X  n n ∗ Pr Xi ≥ k ≤ Pr Xi ≥ k , i=1 that is, Pn ∗ i=1 Xi dominates i=1 Pn i=1 Xi . Stochastic domination is tightly connected to coupling. Coupling is an analysis technique that consists of defining two unrelated random variables over the same probability space to ease comparing them. Let X and Y be two random variables not necessarily defined over the same probability space. We say that (X̃, Ỹ ) is a coupling of (X, Y ) if X̃ and Ỹ are defined over a common probability space and if X and X ′ as well as Y and Y ′ are identically distributed. This definition itself is very weak. (X, Y ) have many couplings and most of them are not interesting. So the art of coupling as a proof and analysis technique is to find a coupling of (X, Y ) that allows to derive some useful information. This is often problem-specific, however, also the following general result in known. It in particular allows to couple dominating random variables. We shall use it for this purpose in Section 5. 6 Theorem 5. Let X and Y be random variables. Then the following two statements are equivalent. (i) X  Y . (ii) There is a coupling (X̃, Ỹ ) of (X, Y ) such that X̃ ≤ Ỹ . 3 Domination-based Fitness Level Method In this section, we prove a fitness level theorem that gives a domination statement and we apply it to two classic problems. The fitness level method, invented by Wegener [Weg01], is one of the most successful early analysis methods in the theory of evolutionary computation. If builds on the idea of partitioning the search space into levels Ai , i = 1, . . . , m, which contain search points of strictly increasing fitness. We then try to show a lower bound pi for the probability that, given that the current-best search point is in Ai , we generate in one iteration a search point in a higher level. this data, Pm−1From 1 the fitness level theorem gives an estimate of E[T ] ≤ i=1 pi for the time T to find a search point in the highest level (which traditionally is assumed to contain only optimal solutions, though this is not necessary). We shall now show that under the same assumptions, a much stronger Pm−1 statement is valid, namely that the runtime T is dominated by i=1 Geom(pi ), that is, a sum independent random variables following geometric distributions with success probabilities pi . This result appears to be very natural and was used without proof in [ZLLH12], yet its proof requires the non-trivial Lemma 4. Theorem 6 (Domination version of the fitness level method). Consider an elitist evolutionary algorithm A maximizing a function f : Ω → R. Let A1 , . . . , Am be a partition of Ω such that for all i, j ∈ [1..m] with i < j and all x ∈ Ai , y ∈ Aj , we have f (x) < f (y). Set A≥i := Ai ∪ · · · ∪ Am . Let p1 , . . . , pm−1 be such that for all i ∈ [1..m − 1] we have that if the best search point in the current parent population is contained in Ai , then independently of the past with probability at least pi the next parent population contains a search point in A≥i+1 . Denote by T the (random) number of iterations A takes to generate a search point in Am . Then T  m−1 X Geom(pi ), i=1 where this sum is to be understood as a sum of independent geometric distributions. 7 Proof. Consider a run of the algorithm A. For all i ∈ [1..m], let Ti be the first time (iteration) Pm−1 when A has generated a search point in A≥i . Then T = Tm = i=1 (Ti+1 − Ti ). By assumption, Ti+1 − Ti is dominated by a geometric random variable with parameter pi regardless what happened before time Ti . Consequently, Lemma 4 gives the claim. By Lemma 2, the expected runtime in Theorem 6 satisfies E[T ] ≤ Pm−1 1 i=1 pi , which is the common version of the fitness level theorem [Weg01]. However, by using tail bounds for sums of independent geometric random variables, we also obtain runtime bounds that hold with high probability. This was first proposed in [ZLLH12], but did not give very convincing results due to the lack of good tail bounds at that time. We briefly present the tail bounds known by now and then give a few examples how to use them together with the new fitness level theorem. Theorem 7. Let X1 , . . . , Xn be independent geometric random variables with success probabilities p1 , . . .P , pn . Let pmin := min{pi | i ∈ [1..n]}. Let X := Pn n 1 i=1 pi . i=1 Xi and µ = E[X] = (i) For all δ ≥ 0, 1 (1 − pmin)µ(δ−ln(1+δ)) 1+δ ≤ exp(−pmin µ(δ − ln(1 + δ))) n  δµpmin ≤ 1+ exp(−δµpmin ) n ! (δµpmin)2 . ≤ exp − 2n(1 + δµpnmin ) Pr[X ≥ (1 + δ)µ] ≤ (1) (2) (3) (4) (ii) For all 0 ≤ δ ≤ 1, Pr[X ≤ (1 − δ)µ] ≤ (1 − δ)pmin µ exp(−δpmin µ)  2  δ µpmin ≤ exp − 2 − 34 δ ≤ exp(− 12 δ 2 µpmin). (5) (6) (7) Estimates (1) and (2) are from [Jan17], bound (3) is from [Sch00], and (4) follows from the previous by standard estimates. The lower tail bound (5) is from [Jan17]. It implies (6) via standard estimates. Inequality (7) appeared in [Sch00]. 8 It is surprising that none of these useful bounds appeared in a reviewed journal. For the case that all geometric random variables have the same success probability p, the bound  2  δ n−1 Pr[X ≥ (1 + δ)µ] ≤ exp − (8) 2 1+δ appeared in [DHK11]. The bounds of Theorem 7 allow the geometric random variables to have different success probabilities, however, the tail probability depends only on the smallest of them. This is partially justified by the fact that the corresponding geometric random variable has the largest variance, and thus might be most detrimental to the desired strong concentration. If the success probabilities vary significantly, however, then this approach gives overly pessimistic tail bounds. Witt [Wit14] proves the following result, which can lead to stronger estimates. Theorem 8. Let X1 , . . . , Xn be independentP geometric random variables P with success probabilities p1 , . . . , pn . Let X = ni=1 Xi , s = ni=1 ( p1i )2 , and pmin := min{pi | i ∈ [1..n]}. Then for all λ ≥ 0,  2   λ 1 , λpmin , (9) Pr[X ≥ E[X] + λ] ≤ exp − min 4 s  2 λ . (10) Pr[X ≤ E[X] − λ] ≤ exp − 2s As we shall see, we often encounter sums of independent geometrically distributed random variables X1 , . . . , Xn with success probabilities pi proportional to i. For this case, the following result from [DD15] gives stronger tail bounds than the Pprevious result. Recall that the harmonic number Hn is defined by Hn = ni=1 1i . Theorem 9. Let X1 , . . . , Xn be independent geometric random variables with success probabilities p1 , . . . , pn . Assume P that there is a number C ≤ 1 such i that pi ≥ C n for all i ∈ [1..n]. Let X = ni=1 Xi . Then E[X] ≤ 1 nHn C ≤ 1 n(1 C + ln n), Pr[X ≥ (1 + δ) C1 n ln n] ≤ n−δ for all δ ≥ 0. (11) (12) Applications of the Fitness Level Theorem We now present a few examples where our fitness level theorem gives more details about the distribution of the runtime and where this, together with the just presented tail bounds, allows to obtain tail bounds for the runtime. 9 We note that so far only very few results exist that give detailed information about the runtime distribution. A well-known triviality is that the runtime of the randomized local search (RSH) heuristic on the OneMax function strongly related to the coupon collector process. InPparticular, its runtime is dominated by the coupon collecting time, which is ni=1 Geom( ni ). With arguments similar to those in [DD16], this can be sharpened slightly P⌈n/2⌉ Geom( ni ). to the result that the runtime is dominated by i=1 Apart from this, we are only aware of the result in [DJWZ13], which shows that Pn−1the runtime T of the (1 + 1) EA on the LeadingOnes function is i=0 Xi Ai , where the Xi are uniformly distributed on {0, 1}, Ai ∼ Geom( n1 (1 − n1 )i ), and all these random variables are mutually independent (in Lemma 5 of [DJWZ13], the range of the sum starts at 1, but this appears to be a typo). OneMax. How the (1 + 1) EA optimizes Pnthe OneMax test function n OneMax : {0, 1} → R; (x1 , . . . , xn ) 7→ i=1 xi is one of the first results in runtime analysis. Using the fitness level method with the levels Ai := {x ∈ {0, 1}n | OneMax(x) = i}, i = 0, 1, . . . , n, one easily obtains that the expectation of the runtime T is at most enHn . For this, it suffices (1 − n1 )n−1 ≥ n−i , see [DJW02] for the details. By to estimate pi ≥ n−i n en Theorems 6 and 9, we also obtain T  n X i=1 Geom   i , en Pr[T ≥ (1 + δ)en ln n] ≤ n−δ for all δ ≥ 0. The domination result, while not very deep, appears to be new, whereas the tail bound was proven before via multiplicative drift analysis [DG13]. Things become more interesting (and truly new) when regarding the (1 + λ) EA instead of the (1 + 1) EA. We denote by d(x) = n − OneMax(x) the distance of x to the optimum. Let t = ⌊ ln(λ)−1 ⌋. We partition the lowest 2 ln ln λ n L = ⌊n− ln λ ⌋ fitness levels (that is, the search points with OneMax(x) < L) into ⌈ Lt ⌉ sets each spanning at most t consecutive fitness levels. In [DK15], it was shown that the probability to leave such a set in one iteration is at least p0 ≥ (1 − 1e ). The remaining search points are partitioned into sets of points having equal fitness, that is, Ai = {x | OneMax(x) = i}, i = L, . . . , n. For these levels, the probability to leave a set in one iteration is at least pi ≥ 1 − !λ  n−1 λ  1 n−i n−i 1− 1− ≥1− 1− . n n en 10 For i ≤ n− en , this is at least pi ≥ 1− 1e by the well-known estimate 1+r ≤ er λ , we use an inverse version of Bernoulli’s valid for all r ∈ R. For i > n − en λ λ λ λ inequality to estimate pi ≥ 1 − (1 − en (n − i) + 12 ( en (n − i))2 ) ≥ 12 en (n − i). n en L Using the abbreviation T0 := ⌈ t ⌉ + ⌈ ln λ ⌉ − ⌈ λ ⌉ + 1, our fitness level theorem gives the following domination bound for the number T of iterations until the optimum is found. T  T0 X −1⌉ ⌈ en λ Geom(1 − 1 ) e + i=1 X λi Geom( 21 en ). i=1 To avoid uninteresting case distinctions, we now concentrate on the more interesting case that λ = ω(1) and λ = nO(1) . In this case, the above domination statement immediately gives   n ln(⌈ en ⌉) n ln(n) 2e n ln ln λ e λ , T0 + 2e = (1 + o(1)) + 2e E[T ] ≤ e−1 λ e − 1 ln λ λ which is the result of [DK15] with explicit constants. With Theorems 7 and 9 we also obtain the (new) tail bound Pr[T ≥ E[T ] + K] ≤ ((1 + e (e−1)K ) exp(− (e−1)K )) e−1 T0 2eT0 2eT0 λ Kλ/2en ln(en/λ) ) . + ( 2en We note that this expression is not very easy to parse. This is caused by its generality, that is, that is covers the two cases that each of the two parts of the expected runtime is the dominant one. When we have more information about the size of λ, both the term simplifies and a simpler estimate could be used in the first place. Sorting. One of the first combinatorial problems regarded in the theory of evolutionary computation is how a combinatorial (1 + 1) EA sorts an array of length n. One of several setups regarded in [STW04] is modelling the sorting problem as the minimization of the number of inversions in the array. We assume that the (1 + 1) EA mutates an array by first determining a number k according to a Poisson distribution with parameter λ = 1 and then performing k + 1 random exchanges (to ease the presentation, we do not use the jump operations also employed in [STW04], but it is easy to see that this does not significantly change things). It is easy to see that exchanging two elements that are in inverse order reduces the number of inversions by −1 at least one. Hence if there are i inversions, then with probability 1e i n2 , the (1 + 1) EA inverts one of the inversions and thus improves the fitness (the factor 1e stems from only regarding iterations with k = 0, that is, where 11 exactly one exchange is performed). By our fitness level theorem, the runtime P(n2 ) Geom( e in ). Hence T is dominated by the independent sum i=1 (2 )   e n H(n) ≤ n2 (1 + 2 ln n), E[T ] ≤ e 2 2 2  −δ n 2 Pr[T ≥ (1 + δ)en ln n] ≤ , 2 where again the statement on the expectation has appeared before in [STW04] (with slightly different constants stemming from the use of a slightly different algorithm) and the tail bound is new. 4 Beyond the Fitness Level Theorem Above we showed that in all situations where the classic fitness level method can be applied we immediately obtain that the runtime is dominated by a suitable sum of independent geometric distributions. We now show that the domination-by-distribution argument is not restricted to such situations. As an example, we use another combinatorial problem from [STW04], the single-source shortest path problem. In [STW04], the single-source shortest path problem in a connected undirected graph G = (V, E) with edge weights w : E → N and source vertex s ∈ V was solved via a (1 + 1) EA as follows. Individuals are arrays of pointers such that each vertex different from the source has a pointer to another vertex. If, for a vertex v, following the pointers gives a path from v to s, then the length (=sum of weights of its edges) of this path is the fitness of this vertex; otherwise the fitness of this vertex is infinite. The fitness of an individual is the vector of the fitnesses of all vertices different from the source. In the selection step, an offspring is accepted if and only if all vertices have an at least as good fitness as in the parent ([STW04] call this a multi-objective fitness function). Mutating an individual means choosing a number k from a Poisson distribution with parameter λ = 1 and then changing k + 1 pointers to random new targets. The main analysis argument in [STW04] is that, due to the use of the multi-objective fitness, a vertex that is connected to the source via a shortest path (let us call such a vertex optimized in the following) remains optimized for the remaining run of the algorithm. Hence we can perform a structural fitness level argument over the number of optimized vertices. The probability 1 to increase this number is at least p := e(n−1)(n−2) because there is at least one non-optimized vertex v for which the next vertex u on a shortest path 12 from v to s is already optimized. Hence with probability 1e we have k = 0, 1 1 we choose v, and with probability n−2 we rewire its with probability n−1 pointer to u. This gives an expected optimization time of at most E[T ] ≤ (n − 1)/p = e(n − 1)2 (n − 2). To obtain better bounds for certain graph classes, [STW04] define ni to be the number of vertices for which the shortest path with fewest edges consists of i edges. With a fitness level argument similar to the one above, they argue that it takes an expected time of at most en2 Hn1 to have all n1 -type vertices optimally connected to the source. After this, an expected number of at most en2 Hn2 iteration suffices to connect all n2 -vertices to the source. Iterating Pn−1 2 thisP argument, they obtain a runtime estimate of E[T ] ≤ en i=1 Hni ≤ n−1 (ln(ni ) + 1). This expression remains of order Θ(n3 ) in the worst en2 i=1 case, but becomes, e.g., O(n2 ℓ log( 2n )) when each vertex can be connected ℓ to the source via a shortest path having at most ℓ edges. With some technical effort, this result was improved to O(n2 max{log n, ℓ}) in [DHK11]. We now show that this improvement could have been obtained via domination arguments in a very natural way. Consider some vertex v different from the source. Fix some shortest path P from v to s having at most ℓ edges. Let Vv be the set of (at most ℓ) vertices on P different from s. As before, in each iteration we have a 1 probability of at least p = e(n−1)(n−2) that a non-optimized vertex of Vv becomes optimized. Consequently, the time Tv to connect v to s via a shortest path is dominated by a sum of ℓ independent Geom(p) random variables. We conclude that there are random variables Xij , i ∈ [1..ℓ], j ∈ [1..n − 1], such that (i) Xij ∼ Geom(p) for all i ∈ [1..ℓ] and j ∈ [1..n − 1], (ii) for all j ∈ [1..n−1] the variables X1j , . . . , Xℓj are independent, and (iii) the runtime P T is dominated by max{Yj | j ∈ [1..n − 1]}, where Yj := ℓi=1 Xij for all j ∈ [1..n − 1]. It remains to deduce q from this domination statement a runtime bound. 4 ln(n−1) Let δ = max{ ℓ−1 , 4 ln(n−1) } and j ∈ [1..n − 1]. Then, by (8), ℓ−1 2 δ Pr[Yj ≥ (1 + δ)E[Yj ]] ≤ exp(− 21 1+δ (ℓ − 1)) ≤ exp(− 41 min{δ 2 , δ}(ℓ − 1)) ≤ 1 (ℓ − 1)) = n−1 . For all ε > 0, again by (8), we compute exp(− 41 4 ln(n−1) ℓ−1  1 (δ + ε + δε)2 (ℓ − 1) Pr[Yj ≥ (1 + ε)(1 + δ)E[Yj ]] ≤ exp − 2 (1 + δ)(1 + ε)   1 δ 2 (1 + ε)2 (ℓ − 1) ≤ exp − 2 (1 + δ)(1 + ε)  1+ε 1 δ2 ≤ exp − (ℓ − 1) ≤ (n − 1)−(1+ε) . 21+δ  13 Recall that the runtime T is dominated by Y = max{Yj | j ∈ [1..n − 1]}, where we did not make any assumption on the correlation of the Yj . In particular, they do not need to be independent. Let T0 = (1 + δ)E[Y1 ] = Pn−1 ℓ (1 + δ) p . Then Pr[Y ≥ (1 + ε)T0 ] ≤ j=1 Pr[Yj ≥ (1 + ε)T0 ] ≤ (n − 1)−ε by the union bound. Transforming thistail boundinto an expectation via 1 standard arguments, we obtain E[Y ] ≤ 1 + ln(n−1) T0 . q 1 , 4 ln(n−1) }, p = e(n−1)(n−2) , and In summary, with δ = max{ 4 ln(n−1) ℓ−1 ℓ−1 T0 := (1 + δ) pℓ , we find that the EA proposed in [STW04] solves the singlesource shortest path problem in graphs where all vertices are connected to the source via a shortest path of at most ℓ edges, in a time T satisfying   1 E[T ] ≤ 1 + T0 , ln(n − 1) Pr[T ≥ (1 + ε)T0 ] ≤ (n − 1)−ε for all ε ≥ 0. Hence our domination argument proved the same result as the analysis in [DHK11]. In fact, our analysis gives a better leading constant. For ℓ ≫ log(n), for example, our T0 is (1 + o(1))eℓn2 , whereas the upper bound on the expected runtime in [DHK11] is (1 + o(1))8eℓn2 . 5 Structural Domination So far we have used stochastic domination to compare runtime distributions. We now show that stochastic domination can be a very useful tool also to express structural properties of the optimization process. As an example, we give a short and elegant proof for the result of Witt [Wit13] that compares the runtimes of mutation-based algorithms. The main reason why our proof is significantly shorter than the one of Witt is that we use the notion of stochastic domination also for the distance from the optimum. To state this result, we need the notion of a (µ, p) mutation-based algorithm introduced in [Sud13]. This class of algorithms is called only mutationbased in [Sud13], but since (i) it does not include all adaptive algorithms using mutation only, e.g., those regarded in [JW06, OLN09, BDN10, BLS14, DGWY17], (ii) it does not include all algorithms using a different mutation operator than standard-bit mutation, e.g., those in [DDY16a, DDY16b, LOW17, DLMN17], and (iii) this notion collides with the notion of unary unbiased black-box complexity algorithms (see [LW12]), which with some justification could also be called the class of mutation-based algorithms, we feel that a notion making these restrictions precise is more appropriate. 14 The class of (µ, p) mutation-based algorithms comprises all algorithms which first generate a set of µ search points uniformly and independently at random from {0, 1}n and then repeat generating new search points from any of the previous ones via standard-bit mutation with probability p (that is, by flipping bits independently with probability p). This class includes all (µ+λ) and (µ, λ) EAs which only use standard-bit mutation with static mutation rate p. Denote by (1 + 1) EAµ the following algorithm in this class. It first generates µ random search points. From these, it selects uniformly at random one with highest fitness and then continues from this search point as a (1 + 1) EA, that is, repeatedly generates a new search point from the current one via standard-bit mutation with rate p and replaces the previous one by the new one if the new one is not worse (in terms of the fitness). This algorithm was called (1 + 1) EA with BestOf(µ) initialization in [dPdLDD15]. For any algorithm A from the class of (µ, p) mutation-based algorithms and any fitness function f : {0, 1}n → R, let us denote by T (A, f ) the runtime of the algorithm A on the fitness function f , that is, the number of the first individual generated that is an optimal solution. Usually, this will be µ plus the number of the iteration in which the optimum was generated. To cover also the case that one of the random initial individuals is optimal, let us assume that these initial individuals are generated sequentially. In this language, Witt [Wit13] shows the following remarkable result. Theorem 10. For any (µ, p) mutation-based algorithm A and any f : {0, 1}n → R with unique global optimum, T ((1 + 1) EAµ , OneMax)  T (A, f ). This result significantly extends results of a similar flavor in [BE08, DJW12,Sud13]. The importance of such types of results is that they allow to prove lower bounds for the performance of many algorithm on essentially arbitrary fitness functions by just regarding the performance of the (1 + 1) EAµ on OneMax. Let us denote by |x|1 the number of ones in the bit string x ∈ {0, 1}n . Using similar arguments as in [DJW00, Section 5] and [DJW12, Lemma 13], Witt [Wit13] shows the following natural domination relation between offspring generated via standard-bit mutation. Lemma 11. Let x, y ∈ {0, 1}n . Let p ∈ [0, 12 ]. Let x′ , y ′ be obtained from x, y via standard-bit mutation with rate p. If |x|1 ≤ |y|1, then |x′ |1  |y ′|1 . We are now ready to give our alternate proof for Theorem 10. While it is clearly shorter that the original one in [Wit13], we also feel that it 15 is more natural. In very simple words, it shows that T (A, f ) dominates T ((1 + 1) EAµ , OneMax) because the search points generated in the run of the (1 + 1) EAµ on OneMax always are at least as close to the optimum (in the domination sense) as in the run of A on f , and this follows from the previous lemma and induction. Proof. As a first small technicality, let us assume that the (1 + 1) EAµ in iteration µ + 1 does not choose a random optimal search point, but the last optimal search point. Since all the first µ individuals are generated independently, this modification does not change anything. Since A treats bit-positions and bit-values in a symmetric fashion (it is unbiased in the sense of [LW12]), we may without loss of generality assume that the unique optimum of f is (1, . . . , 1). Let x(1) , x(2) , . . . be the sequence of search points generated in a run of A on the fitness function f . Hence x(1) , . . . , x(µ) are independently and uniformly distributed in {0, 1}n and all subsequent search points are generated from suitably chosen previous ones via standard-bit mutation with rate p. Let y (1) , y (2) , . . . be the sequence of search points generated in a run of the (1 + 1) EAµ on the fitness function OneMax. We show how to couple these random sequences of search points in a way that |x̃(t) |1 ≤ |ỹ (t) |1 for all t ∈ N. We take as common probability space Ω simply the space that (x(t) )t∈N is defined on and let x̃(t) = x(t) for all t ∈ N. We define the ỹ (t) inductively as follows. For t ∈ [1..µ], let ỹ (t) = x(t) . Note that this trivially implies |x̃(t) |1 ≤ |ỹ (t) |1 for these search points. Let t > µ ′ ′ and assume that |x̃(t ) |1 ≤ |ỹ (t ) |1 for all t′ < t. Let s ∈ [1..t − 1] be maximal such that |ỹ (s) |1 is maximal among |ỹ (1) |1 , . . . , |ỹ (t−1) |1 . Let r ∈ [1..t − 1] be such that x(t) was generated from x(r) in the run of A on f . By induction, we have |x(r) |1 ≤ |ỹ (r)|1 . By choice of s we have |ỹ (r) |1 ≤ |ỹ (s) |1 . Consequently, we have |x(r) |1 ≤ |ỹ (s) |1 . By Lemma 11 and Theorem 5, there is a random ỹ (t) (defined on Ω) such that ỹ (t) has the distribution of being obtained from ỹ (s) via standard-bit mutation with rate p and such that |x(t) |1 ≤ |ỹ (t) |1 . With this construction, the sequence (ỹ (t) )t∈N has the same distribution as (y (t) )t∈N . This is because the first µ elements are random and then each subsequent one is generated via standard-bit mutation from the current-best one, which is just the way the (1 + 1) EAµ is defined. At the same time, we have |x̃(t) |1 ≤ |ỹ (t) |1 for all t ∈ N. Consequently, we have min{t ∈ N | |ỹ (t) |1 = n} ≤ min{t ∈ N | |x(t) |1 = n}. Since T ((1 + 1) EAµ , OneMax) and min{t ∈ N | |ỹ (t) |1 = n} are identically distributed and also T (A, f ) and min{t ∈ N | |x(t) |1 = n} are identically distributed, we have T ((1 + 1) EAµ , OneMax)  T (A, f ). 16 6 Conclusion In this work, we argued that stochastic domination can be very useful in runtime analysis, both to formulate more informative results and to obtain simpler and more natural proofs. We also showed that in many situations, in particular, whenever the fitness level method is applicable, it is easily possible to describe the runtime via a domination statement. We note however that not all classic proofs easily reveal details on the distribution. For results obtained via random walk arguments, e.g., the optimization of the short path function SPCn [JW01], monotone polynomials [WW05], or vertex covers on paths-like graphs [OHY09], as well as for results proven via additive drift [HY01], the proofs often give little information about the runtime distribution (an exception is the analysis of the needle and the OneMax function in [GKS99]). For results obtained via the average weight decrease method [NW07] or multiplicative drift analysis [DG13], the proofs also do not give information on the runtime distribution. However, the probabilistic runtime bound of type Pr[T ≥ T0 + λ] ≤ (1 − δ)λ obtained from these methods implies that the runtime is dominated by T  T0 − 1 + Geom(1 − δ). Overall, both from regarding these results and the history of the field, we suggest to more frequently formulate results via domination statements. Even in those cases where the probabilistic tools at the moment are not be ready to exploit such a statement, there is a good chance future developments overcome this shortage and then it pays off if the result is readily available in a distribution form and not just as an expectation. References [BDN10] Süntje Böttcher, Benjamin Doerr, and Frank Neumann. Optimal fixed and adaptive mutation rates for the LeadingOnes problem. In 11th International Conference on Parallel Problem Solving from Nature, PPSN 2010, pages 1–10. Springer, 2010. [BE08] Pavel A. Borisovsky and Anton V. Eremeev. Comparing evolutionary algorithms to the (1+1)-EA. Theoretical Computer Science, 403:33–41, 2008. [BLS14] Golnaz Badkobeh, Per Kristian Lehre, and Dirk Sudholt. Unbiased black-box complexity of parallel search. In Parallel Problem Solving from Nature, PPSN 2014, pages 892–901. Springer, 2014. 17 [DD15] Benjamin Doerr and Carola Doerr. A tight runtime analysis of the (1+(λ, λ)) genetic algorithm on OneMax. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO 2015, pages 1423–1430. ACM, 2015. [DD16] Benjamin Doerr and Carola Doerr. The impact of random initialization on the runtime of randomized search heuristics. Algorithmica, 75:529–553, 2016. [DDY16a] Benjamin Doerr, Carola Doerr, and Jing Yang. k-bit mutation with self-adjusting k outperforms standard bit mutation. In 14th International Conference on Parallel Problem Solving from Nature, PPSN 2016, pages 824–834. Springer, 2016. [DDY16b] Benjamin Doerr, Carola Doerr, and Jing Yang. Optimal parameter choices via precise black-box analysis. In Genetic and Evolutionary Computation Conference, GECCO 2016, pages 1123–1130. ACM, 2016. [DG13] Benjamin Doerr and Leslie Ann Goldberg. analysis. Algorithmica, 65:224–250, 2013. [DGWY17] Benjamin Doerr, Christian Gießen, Carsten Witt, and Jing Yang. The (1+λ) evolutionary algorithm with self-adjusting mutation rate. In Genetic and Evolutionary Computation Conference, GECCO 2017. ACM, 2017. Full version available at http://arxiv.org/abs/1704.02191. [DHK11] Benjamin Doerr, Edda Happ, and Christian Klein. Tight analysis of the (1+1)-EA for the single source shortest path problem. Evolutionary Computation, 19:673–691, 2011. [DHK12] Benjamin Doerr, Edda Happ, and Christian Klein. Crossover can provably be useful in evolutionary computation. Theoretical Computer Science, 425:17–33, 2012. [DJW00] Stefan Droste, Thomas Jansen, and Ingo Wegener. A natural and simple function which is hard for all evolutionary algorithms. In IEEE International Conference on Industrial Electronics, Control, and Instrumentation, IECON 2000, pages 2704–2709. IEEE, 2000. 18 Adaptive drift [DJW02] Stefan Droste, Thomas Jansen, and Ingo Wegener. On the analysis of the (1+1) evolutionary algorithm. Theoretical Computer Science, 276:51–81, 2002. [DJW12] Benjamin Doerr, Daniel Johannsen, and Carola Winzen. Multiplicative drift analysis. Algorithmica, 64:673–697, 2012. [DJWZ13] Benjamin Doerr, Thomas Jansen, Carsten Witt, and Christine Zarges. A method to derive fixed budget results from expected optimisation times. In Genetic and Evolutionary Computation Conference, GECCO 2013, pages 1581–1588. ACM, 2013. [DK15] 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. [DLMN17] Benjamin Doerr, Huu Phuoc Le, Régis Makhmara, and Ta Duy Nguyen. Fast genetic algorithms. In Genetic and Evolutionary Computation Conference, GECCO 2017. ACM, 2017. Full version available at http://arxiv.org/abs/1703.03334. [Doe11] 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, 2011. [dPdLDD15] Axel de Perthuis de Laillevault, Benjamin Doerr, and Carola Doerr. Money for nothing: Speeding up evolutionary algorithms through better initialization. In Genetic and Evolutionary Computation Conference, GECCO 2015, pages 815–822. ACM, 2015. [GKS99] Josselin Garnier, Leila Kallel, and Marc Schoenauer. Rigorous hitting times for binary mutations. Evolutionary Computation, 7:173–203, 1999. [HY01] Jun He and Xin Yao. Drift analysis and average time complexity of evolutionary algorithms. Artificial Intelligence, 127:51– 81, 2001. [Jan17] Swante Janson. Tail bounds for sums of geometric and exponential variables. ArXiv e-prints, arXiv:1709.08157, 2017. 19 [JW01] Thomas Jansen and Ingo Wegener. Evolutionary algorithms how to cope with plateaus of constant fitness and when to reject strings of the same fitness. IEEE Transactions on Evolutionary Computation, 5:589–599, 2001. [JW06] Thomas Jansen and Ingo Wegener. On the analysis of a dynamic evolutionary algorithm. Journal of Discrete Algorithms, 4:181–199, 2006. [JZ14] Thomas Jansen and Christine Zarges. Performance analysis of randomised search heuristics operating with a fixed budget. Theoretical Computer Science, 545:39–58, 2014. [LOW17] Andrei Lissovoi, Pietro Simone Oliveto, and John Alasdair Warwicker. On the runtime analysis of generalised selection hyper-heuristics for pseudo-boolean optimisation. In Genetic and Evolutionary Computation Conference, GECCO 2017, pages 849–856. ACM, 2017. [LW12] Per Kristian Lehre and Carsten Witt. Black-box search by unbiased variation. Algorithmica, 64:623–642, 2012. [MS02] Alfred Müller and Dietrich Stoyan. Comparison Methods for Stochastic Models and Risks. Wiley, 2002. [NW07] Frank Neumann and Ingo Wegener. Randomized local search, evolutionary algorithms, and the minimum spanning tree problem. Theoretical Computer Science, 378:32–40, 2007. [OHY09] Pietro Simone Oliveto, Jun He, and Xin Yao. Analysis of the (1+1)-EA for finding approximate solutions to vertex cover problems. IEEE Transactions on Evolutionary Computation, 13:1006–1029, 2009. [OLN09] Pietro Simone Oliveto, Per Kristian Lehre, and Frank Neumann. Theoretical analysis of rank-based mutation - combining exploration and exploitation. In Congress on Evolutionary Computation, CEC 2009, pages 1455–1462. IEEE, 2009. [Sch00] Christian Scheideler. Probabilistic Methods for Coordination Problems. University of Paderborn, 2000. Habilitation thesis. Available at http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.70.1319. 20 [STW04] Jens Scharnow, Karsten Tinnefeld, and Ingo Wegener. The analysis of evolutionary algorithms on sorting and shortest paths problems. Journal of Mathematical Modelling and Algorithms, 3:349–366, 2004. [Sud13] Dirk Sudholt. A new method for lower bounds on the running time of evolutionary algorithms. IEEE Transactions on Evolutionary Computation, 17:418–435, 2013. [Weg01] Ingo Wegener. Theoretical aspects of evolutionary algorithms. In International Colloquium on Automata, Languages and Programming, ICALP 2001, pages 64–78. Springer, 2001. [Wit13] Carsten Witt. Tight bounds on the optimization time of a randomized search heuristic on linear functions. Combinatorics, Probability & Computing, 22:294–318, 2013. [Wit14] Carsten Witt. Fitness levels with tail bounds for the analysis of randomized search heuristics. Information Processing Letters, 114:38–41, 2014. [WW05] Ingo Wegener and Carsten Witt. On the optimization of monotone polynomials by simple randomized search heuristics. Combinatorics, Probability & Computing, 14:225–247, 2005. [ZLLH12] Dong Zhou, Dan Luo, Ruqian Lu, and Zhangang Han. The use of tail inequalities on the probable computational time of randomized search heuristics. Theoretical Computer Science, 436:106–117, 2012. 21
9cs.NE
A General Neural Network Hardware Architecture on FPGA Yufeng Hao Dept. of Electronic, Electrical and Systems Engineering University of Birmingham, Edgbaston, Birmingham, B152TE, UK Email: [email protected] Abstract—Field Programmable Gate Arrays (FPGAs) plays an increasingly important role in data sampling and processing industries due to its highly parallel architecture, low power consumption, and flexibility in custom algorithms. Especially, in the artificial intelligence field, for training and implement the neural networks and machine learning algorithms, high energy efficiency hardware implement and massively parallel computing capacity are heavily demanded. Therefore, many global companies have applied FPGAs into AI and Machine learning fields such as autonomous driving and Automatic Spoken Language Recognition (Baidu) [1] [2] and Bing search (Microsoft) [3]. Considering the FPGAs great potential in these fields, we tend to implement a general neural network hardware architecture on XILINX ZU9CG System On Chip (SOC) platform [4], which contains abundant hardware resource and powerful processing capacity. The general neural network architecture on the FPGA SOC platform can perform forward and backward algorithms in deep neural networks (DNN) with high performance and easily be adjusted according to the type and scale of the neural networks. Index Terms—General Neural Network (GNN), Field Programmable Gate Arrays (FPGAs), Systems On Chip (SOC). 1 Introduction The basic elements of FPGA are Configurable Logic Block (CLB) and interconnecting resources [5], which are flexible and convenient to implement interfaces such as I2C, SPI, and so on, and control circuits for specific requirements since FPGA was firstly introduced about 30 years ago. And with the development of integrated circuit (IC) technology, FPGA has held an outstanding performance in low-power and large-scale parallel computing domain. Compared to CPU or GPU which are based on Von Neumann or Harvard Architecture, FPGA has a more flexible framework to implement algorithms. The instructions and data in FPGA can be designed in a more efficient way without constraint of fixed architectures, which is suitable for designers to explore the high performance implement approaches in power or computing sensitive fields. Besides, though its clock frequency is slower than that of CPU or GPU, FPGA usually executes operations in a few clock periods, which makes FPGA to hold a competitive advantage in real-time data processing and low power consumption design, considering CPU and GPU need dozens of instructions to execute one operation and higher frequency leads to higher power consumption. Meanwhile, considering its inherent parallel architecture, FPGA shows a powerful processing capacity in massive convolution, multiply-accumulation, and other matrix operations which are essential in current neural network or machine learning algorithms. Therefore, it is indispensable to apply FPGA into the above fields to gain cost and real-time computing advantage. 2 Objective We will build a general neural network hardware architecture on FPGA, which has an outperformance in energy efficiency and real-time computation. Based on the architecture, different types and scales of neural networks can be implemented and the neural network training and deployment can be directly performed on FPGA. 3 Hardware Architecture Implement 3.1 Neural Networks Perspective Artificial Neural Network consists of neuron cells, which are connected to each other and arranged in layers [6]. Basically, one neural network has only one input layer and one output layer but can hold many hidden layers. Each layer is composed of neuron cells. Each neuron cell can be regarded as a nonlinear transformation unit which holds different weights as the multiplier for different input data from the previous layer. The basic unit of a neuron cell can be illustrated as following. X1 W1 X2 W2 f W3 f(Σ (Wi*Xi)+b) X3 b Figure 3-1 neuron cell unit The system diagram of General Neural Network is shown below as figure 3-2. (The picture is form http://neuralnetworksanddeeplearning.com/chap5.html ) Figure 3-2 general neural network system diagram According to the number of hidden layers, the neural network can be classified as Deep Neural Network (DNN) which usually has more than 2 layers and shallow neural network. In terms of the direction of data flow, there are Recurrent Neural Network (RNN) where there is a data flow between adjacent cells in the same layer and general Neural Network where there is not such connection. Judged from the operations executed by the neural network, there is a Convolutional Neural Network (CNN) which mainly perform its function through convolutional operation. The nonlinear transformation layers mentioned above are the core elements for all types of neural network such as CNN, DNN, RNN, and so on. Essentially, it is the nonlinear transformation that the neural network possesses the capacity of extracting high dimension features of original data set. Actually, Neural Network is a kind of data modeling algorithm with multi-layer and nonlinear transformation [7]. There are two main procedures in design neural networks: forward process and backward process [8]. In the forward process, we define the neural network architecture such as how many layers, how many cells in each layer, and which kinds of cells we choose, and then the input data can flow to the output. In the back process, we define the loss function to calculate the gap between the prediction value and the label values. Through calculating the gradient in the backward path, we upgrade the weights of the neural network. One forward and one backward process can be called as one epoch, and it is the training of neural network. Usually, a trained neural network model need hundreds of epochs to be available. 3.2 General Neural Network Architecture implement According to the general neural network structure which is shown in figure 3-2, we implement general framework of a general neural network on FPGA shown in Figure 3-3, which contains the forward propagation, backward propagation, and control modules to complete the training of the neural network. In the framework, we use the highly reusable modules to perform the neural network matrix operations, which makes it easy to adjust the types or the number of hidden layers of a neural network. External memory PS AXI AXI AXI buffer1 buffer0 Raddr Rdata Mult-add S1 RAM Raddr Rdata Hidden To output Weight buffer Tanh LUT Raddr Rdata Mult-add Tanh(S1) RAM Mult-add bank Mult-add bank Tanh bank Raddr Exp lut + Gain Control output softmax S2 accu mult (Ŷ-Y) RAM PL control Figure 3-3 general neural network hardware architecture on FPGA SOC Label buffer The general neural network hardware architecture framework is shown as the figure 33. The framework includes two processes: the forward process which generates the prediction values and the backward process which upgrades the weights according to the loss values. The mult-add bank, RAM, and Tanh bank modules can perform one layer forward propagation operations. They can be reused to adjust the neural network or increase the number of hidden layers. The accu and mult modules will perform the back propagation operations. We will give a more detail explanation about the hardware implement framework in the following paragraphs. For the forward process, there are 3 matrix operation stages: input layer to hidden layer, hidden layer to hidden layer, and hidden layer to output layer. In the first stage, the input vectors Xi (i = 1,2,...T) multiply the first hidden layer weights matrix WH1XT (H1 equals to the dimension of the first hidden layer, T equals to the length of input vectors), which are loaded form the buffer0 and buffer1. We use mult-add bank to accomplish the above matrix operation. The mult-add bank consists of many parallel multiplication and accumulation units, whose number can be adjusted according to the dimension of hidden layer and logic resources on FPGA. Then the result matrix is stored in the S1 RAM as the input of activation function. There are lots of activation functions which can be chose in practice such as sigmoid, Rectified Linear Unit (ReLU), Tanh, and so on. We implement the activation functions by Lookup Table (LUT) through which different initialization parameters can be loaded in order to perform different activation functions. The output matrix of the first hidden layer (M1) is stored in the Tanh(S1) RAM. In the second stage, the M1 multiplies the second hidden layer weights matrix WH1XH2 (H2 equals to the dimension of the second hidden layer), which still is implemented by mult-add bank. In figure 3-3, we only demonstrate a general neural network with one hidden layer. The multi-hidden layers neural network hardware implement can be carried out through the reuse of the mult-add bank, weights RAM, and tanh bank units. The final stage in the forward process is to perform the matrix mapping from last hidden layer to the output layer. According to the expression of softmax function: 𝜎(𝑧𝑗 ) = ∑𝑘 𝑧 𝑒 𝑗 𝑧 𝑘=1 𝑒 𝑘 , we can similarly implement the exponential function by LUT, then get the sum by addition units. According to experience value, we set a maximum limit about the sum (eg. 1024) and then adjust the output as the ratio of sum and the maximum limit. For the backward process, we use cross-entropy loss function [9] [10] to calculate error derivatives in back propagation algorithm. The detail of back propagation algorithm operation is described in [11]. The core step is to calculate the multiplication of the error and the derivative of the activation function. In implementation level, the back X propagation can be described as: 𝛾 ∑𝑚 𝑖=1 (ŷ𝑖 − 𝑦𝑖 ) S2 . The (ŷ𝑖 − 𝑦𝑖 ) is the disparity of the prediction value and the label. The S 2 is the input vectors to the layer where the residual signals generates in the back propagation path. The X symbol means exterior product operation, which can be performed by mult module in the framework. The control unit in the bottom of the diagram controls the neural network training processes, which provides the timing to read or write weights buffers, perform matrix operations, and store calculation results. 4 Conclusion The whole neural network algorithms is implemented on the XILINX ZU9CG FPGA SOC platform, which contains abundant computing memory resources (2520 DSPs and 32Mb on-chip memory) and remarkable programming ability (Dual-core ARM Cortex A53). In the hardware framework, different deep neural networks can be implemented by reusing the forward propagation modules and slightly modifying the backward propagation modules. For a larger scale deep neural network, a cluster of FPGA can be integrated into a whole platform to perform the algorithm. We can also deploy deep learning framework tools such as TensorFLow into this 64-bit FPGA SOC platform, calling the FPGA hardware resources directly. This will provide a real-time, high energy efficiency, and fast deployment embedded solution for deep learning and machine learning applications. REFERENCE [1] S. Liu et al. Implementing a Cloud Platform for Autonomous Driving. arXiv: 1704.02696, 2017. [2] J. Ouyang et al. SDA: Software-defined Accelerator for Large-scale DNN system. ser. Hot Chips 26, 2014. [3] L. Wirbel. “Xilinx SDAcel: A Unified Development Environment for Tomorrow’s Data Center”. [Online] Available: https://www.xilinx.com/publications/prod_mktg/sdx /sdaccel-wp.pdf [4] “Zynq UltraScale + MPSOC Data Sheet: Overview”. [Online] Available: https:// www.xilinx.com/support/documentation/data_sheets/ds891-zynq-ultrascale-plus-over view.pdf [5] U. Farooq et al. Tree Based Heterogeneous FPGA Architectures, Application Specific Exploration and Optimization. Springer, pp. 7-48, 2012. [6] K. Gurney. An Introduction to Neural Networks. 1 edition, CRC Press, pp. 29-30, 1997. [7] D. Svozil, et al. Introduction to Multi-layer Feed-forward Neural Networks. Chemometrics and Intelligent Laboratory Systems, 39 (1): 43-62, 1997. [8] M. Mazur. “A Step by Step Backpropagation Example”. [Online] Available: https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example [9] G.E. Nasr, et al. Cross Entropy Error Function in Neural Network: Forecasting Gasoline Demand. FLAIRS-02 Proceedings, American Association for Artificial Intelligence, pp. 381-384, 2002. [10] S. Renals. “Multi-layer Neural Network”. [Online] Available: https://www.inf.ed. ac.uk/teaching/courses/asr/2015-16/asrX1-nn.pdf [11] M. Nielsen. “Neural Network and Deep Learning”. [Online] Available: http:// neuralnetworksanddeeplearning.com/chap3.html
9cs.NE
arXiv:1511.06473v2 [math.AC] 29 Apr 2016 PERINORMALITY IN PULLBACKS NEIL EPSTEIN AND JAY SHAPIRO Abstract. We further develop the notion of perinormality from [ES16], showing that it is preserved by many pullback constructions. In doing so, we introduce the concepts of relative perinormality and fragility for ring extensions. 1. Introduction In [ES16], we introduced the notion of perinormality for integral domains. A domain R is perinormal if for local overrings L of R, going-down over R coincides with being a localization of R. Equivalently [ES16, Proposition 2.4], R is perinormal if for (arbitrary) overrings of R, flatness over R and going-down over R coincide. In this article, we show that perinormality is preserved (or at least retained) in a number of pullback constructions. We begin in §2 by introducing the concept of relative perinormality, and show that it lifts (see Proposition 2.3). We use this observation to show that certain rings of the form R + XS[X], R + XS[[X]], and D + M are perinormal (see Corollary 2.6 and Theorem 2.7) whenever the base ring is. In §3, which comprises the bulk of the paper, we introduce the concept of what it means for a subring inclusion to be fragile. We show, under mild assumptions, that the pullback of a factor ring of a generalized Krull domain along a fragile ring inclusion is perinormal (see Theorem 3.5). In Theorem 3.10, we show how to contract finite sets of minimal primes in many familiar classes of Noetherian normal domains in a fragile way. We give a partial converse in Proposition 3.13. In Example 3.16, we show how Theorem 3.5 may be used while showing that the converse to Proposition 2.3 fails. This background allows us to demonstrate that there is no canonical “perinormalization” of a domain akin to the integral closure operation (see Example 3.15). Finally in §4, we show that algebraically contracting a hypersurface to a point typically results in a perinormal (albeit non-Noetherian) domain (see Theorem 4.2). Date: December 29, 2017. 2010 Mathematics Subject Classification. 13B21, 13F05, 13F45. Key words and phrases. pullbacks, generalized Krull domain, going down, perinormal, fragile. 1 2 NEIL EPSTEIN AND JAY SHAPIRO 2. Relative perinormality Definition 2.1. Let A ⊆ B be an extension of rings. We say that A is perinormal in B, if given any prime ideal p of A, Ap is the only local ring between Ap and Bp that is centered on pAp and satisfies going-down over Ap . We note some basic facts. To say an integral domain is perinormal simply means that A is perinormal in frac(A), the field of quotients of A. Any ring is perinormal in itself. A field is never perinormal in a field extension unless the fields are equal. If A is perinormal in B, then AW is perinormal in BW for any multiplicatively closed subset W of A. Let A be a domain and A ⊆ K, where K is a field. If A is perinormal in K, then K is the fraction field of A (and so A is perinormal). To see why, let W = A \ {0}. Thus AW = Frac(A) is perinormal in KW = K. As noted previously, this implies the two fields are equal. Let R be a ring and I an ideal of R. Then VR (I), or simply V (I) if there is no chance for confusion, denotes the set {P ∈ Spec R : I ⊆ P }. We first present a lemma on pullbacks that collects some known results that will be used throughout the paper. Consider the following pullback diagram  R   A f α  g /S  β /B where g (and hence f ) is injective, while β (and hence α) is surjective. Viewing R as a subring of S, we see that ker β = ker α is an ideal of R. In this case, we say that R is the pullback of (the diagram) A → B ← S. Note that all of the pullbacks in this paper will satisfy these assumptions. Lemma 2.2. Given R, S, A and B as in the above diagram, let J = ker α. (1) There is a poset isomorphism between (Spec S)\VS (J) and (Spec R)\ VR (J) given by the contraction map. (2) For any P ∈ (Spec S) \ VS (J), the canonical map RP ∩R → SP is an isomorphism. (3) If W is any multiplicatively closed subset of R, then RW is the pullback of AW → BW ← SW , where W denotes the image of W in A. Proof. (1) and (3) are Corollary 1.5 (3) and Proposition 1.9 respectively of [Fon80], while (2) is [ES16, Lemma 4.4].  Proposition 2.3. Let A ⊆ B be a ring extension and let J be an ideal of B that is contained in A. If A/J is perinormal in B/J, then A is perinormal in B. Proof. Suppose that A/J is perinormal in B/J. Clearly Spec A is the union of the sets X and Y , where X consists of those primes that contain J and Y PERINORMALITY IN PULLBACKS 3 are the primes that do not contain J. Then the natural map Spec (A/J) → X is clearly a bijection, while the contraction map gives a bijection from (Spec B) \ VB (J) to Y (by Lemma 2.2 (1)). Furthermore, if p ∈ Y , then Ap = BA\p (by Lemma 2.2 (2)). Hence we only need check the extensions Ap ⊆ BA\p for p ∈ X. Let T be a local ring between Ap and BA\p centered on pAp , that also satisfies going-down over Ap . Clearly T contains JAp = JBA\p . Hence we have the chain of rings (A/J)p ⊆ T /JAp ⊆ (B/J)A\p Then T /JAp is a local ring which is centered on the unique maximal ideal of (A/J)p and which satisfies going-down over this ring. Since A/J is perinormal in B/J, we must have (A/J)p = T /JAp . Since (A/J)p = Ap /JAp we conclude that Ap = T , which finishes the proof.  The above proposition provides many ways to construct perinormal inclusions (and in some cases, new perinormal domains from old). We provide some cases below. Corollary 2.4. Let R ⊆ S be a perinormal ring inclusion. Let X be an analytic indeterminate. Then R + XS[X] is perinormal in S[X], and R + XS[[X]] is perinormal in S[[X]]. Next, we will use the above result to prove that certain classical pullback construction yields perinormal domains under reasonable assumptions. First, we recall said reasonable assumptions: Theorem 2.5. [ES16, Theorem 4.7] Let R be a universally catenary Noetherian domain with fraction field K and integral closure S. The following are equivalent (a) R is perinormal. (b) For each p ∈ Spec R, Rp is the only ring S between Rp and K such that the induced map Spec S → Spec Rp is an order-isomorphism. (c) R satisfies (R1 ), and for each p ∈ Spec R, Rp is the only ring S between Rp and Sp such that the induced map Spec S → Spec Rp is an order-isomorphism. Recall that by definition, a commutative ring R satisfies (R1 ) if for every height one prime p of R, Rp is a (not necessarily discrete) valuation domain. Corollary 2.6. Let R be a Noetherian, universally catenary, perinormal integral domain, whose integral closure S is finitely generated as an R-module. Let X be an analytic indeterminate. Then R + XS[X] and R + XS[[X]] are perinormal. Proof. First we show that the rings in question are themselves universally catenary. Let s1 = 1, s2 , . . . , sn be a generating set for S as an R-module. For A = R + XS[X], note that S[X] is generated as an A-module by the same set of generators that generates S as an R-module. Then since S[X] is finitely generated over R, the Artin-Tate lemma [AT51] shows that A 4 NEIL EPSTEIN AND JAY SHAPIRO must be finitely generated over R, and hence universally catenary and Noetherian. Next, let B = R + XS[[X]]. Observe that B ∼ = R[[T1 , . . . , Tn ]]/(T1 − s1 X, . . . , Tn −sn X). By [Sey70, Théorème 1.12], R[[T1 , . . . , Tn ]] is universally catenary; hence its quotient ring B must be as well. Let S ′ = S[X] (resp. S[[X]]) and T := R + P , where P = XS ′ . We claim that T is (R1 ). By Lemma 2.2(2), we need only check the height one primes of T that contain P . But P is itself a height one prime, so we need only check that TP is a valuation ring, which follows since TP = SP′ and P is a height one prime of the Krull domain S ′ , proving the claim. Since T is perinormal in its integral closure (by Corollary 2.4) and (R1 ), it satisfies condition (c) of Theorem 2.5. But then since T is universally catenary, said theorem implies that T is perinormal.  Theorem 2.7 (The classical D + M construction, and more). Let D be an integral domain, k = Frac D its fraction field, and V a valuation domain with residue field k. Then the pullback R of the diagram D → k ← V is perinormal if and only if D is perinormal. Proof. Let m = ker(V → k), the conductor of the pullback square. First suppose D is not perinormal. Let (T, n) be a local overring of D such that D ⊆ T is going-down and T is not a localization of D. Let S be the pullback of the diagram T → k ← V , thought of as a subring of V that contains R. Then S is an overring of R (since V is) which is local with unique maximal ideal the preimage of n. To see that the extension R ⊆ S satisfies going-down, let P1 ⊆ P2 be primes of R and Q2 a prime of S with Q2 ∩ R = P2 . If P1 + m, then by Lemma 2.2(1), P1 = Q1 ∩ R for some Q1 ∈ Spec V \ {m}. As V is local, we have Q1 ⊂ m, so in fact Q1 = P1 is an ideal of R and hence of S. In particular, P1 is a prime of S, solving the going-down problem. On the other hand, if P1 ⊇ m, let pj := Pj /m ∈ Spec D for j = 1, 2 and let q2 := Q2 /m ∈ Spec T . Since D ⊆ T satisfies going-down, there is some q1 ∈ Spec T with q1 ⊆ q2 and q1 ∩ D = p1 . But setting Q1 to be the preimage of q1 in S, we have Q1 ⊆ Q2 and Q1 ∩ R = P1 , completing the proof that S satisfies going-down over R. Hence to show that R is not perinormal, it suffices to show that S is not a localization of R. Suppose otherwise, say S = RW for some multiplicatively closed set W ⊂ R. Since m is a proper ideal of both R and S, it follows that m ∩ W = ∅. Thus if W ′ is the image of W in D = R/m, we would have T = DW ′ , contradicting our choice of T . Thus R is not perinormal. Conversely, suppose D is perinormal. Let (T, n) be a going-down local overring of R. If n ∩ R + m, then by Lemma 2.2 (1) and (2), Rn∩R is in fact a localization of V , and hence also a valuation ring. Thus the overring T must be a localization of Rn∩R and therefore of R. So we may assume that m ⊆ n. In this case, we claim that T ⊆ V . If not, then let a ∈ T \ V . Then since V is a valuation ring, b = a−1 ∈ V . But since a = b−1 ∈ / V, b is a nonunit of V , whence b ∈ m ⊆ n ⊆ T . Since also a = b−1 ∈ T , we have that b is a unit of T contained in its maximal ideal n, which is absurd. PERINORMALITY IN PULLBACKS 5 Hence, R ⊆ T ⊆ V and T is local and going-down over R. Then since R is perinormal in V (by Proposition 2.3, since D is perinormal in k), it follows that T is a localization of R.  Remark 2.8. The above subsumes the classical D + M construction (see for example [Gil68, Appendix 2]). There, one starts with a valuation domain V that contains a field k as an algebra retract, so that V = k + M ; then one takes a subring D ⊆ k and sets R = D + M . Recall that D + M is never Noetherian unless D is a field and k is finite dimensional over D. (cf. [Gil68, Theorem A(m), p. 562]). However, the above theorem covers additional cases. Recall the theorem of Hasse and Schmidt (cf. [Mat86, Theorem 29.1]) that says that for any prime characteristic field k, there is a characteristic zero rank one discrete valuation ring V (which necessarily contains no field at all) whose residue field is k. So using the two theorems together, one may start with one’s favorite prime characteristic domain D, let k be its fraction field, use HasseSchmidt to find a characteristic zero DVR V whose residue field is k, and form the pullback R. Then R is perinormal if and only if D is. 3. Pullbacks of fragile subrings Later, after we have one of our main results on pullbacks, we will construct an example to show that the converse to Proposition 2.3 is false (see Example 3.16). First we develop some basic results as prelude to our next theorem. Lemma 3.1. Let f : R → S and g : S → T be ring maps and let J be an ideal of S. Suppose that the induced map Spec S → Spec R is injective on Spec S \ V (J) and that the image of the induced map Spec T → Spec S is contained in Spec S \ V (J). If g ◦ f : R → T satisfies going-down, so does g : S → T. Proof. Let P1 ⊂ P2 be prime ideals of S and let Q2 be a prime ideal of T with g−1 (Q2 ) = P2 . Let pi = f −1 (Pi ) for i = 1, 2. By the going-down hypothesis on the map g ◦ f , there is a prime ideal Q1 of T with Q1 ⊆ Q2 and (g ◦ f )−1 (Q1 ) = p1 . Clearly g −1 (Q1 ), P1 , P2 ∈ Spec S \ V (J). But then we have f −1 (P1 ) = p1 = (g ◦ f )−1 (Q1 ) = f −1 (g−1 (Q1 )), so by injectivity of the map in question, we have P1 = g−1 (Q1 ), completing the proof.  We introduce the next definitions so as to simplify the statement of the main theorem of the current section. They may also be of independent interest. Definition 3.2. Let A ⊆ B be an integral extension of commutative rings. We say that the extension is • apparently fragile (or a.f.) if for any ring C with A ( C ⊆ B, there exists some minimal prime p of A and primes P, Q ∈ Spec C with P 6= Q and P ∩ A = Q ∩ A = p. 6 NEIL EPSTEIN AND JAY SHAPIRO • fragile if AP ⊆ BA\P is apparently fragile for any P ∈ Spec A. • globally fragile if AW ⊆ BW is apparently fragile for any multiplicative subset W of A. Note that in all the above definitions, one allows the vacuous case A = B. Next, recall the following definition from [Gil68, §35], where for a commutative ring R, we set Spec 1 (R) := {p ∈ Spec R | ht p = 1}: Definition 3.3. An integral domain R is a generalized Krull domain if T (1) R = p∈Spec 1 (R) Rp , (2) For any nonzero element r ∈ R, the set {p ∈ Spec 1 (R) | r ∈ p} is finite, and (3) R satisfies (R1 ). Lemma 3.4. Let S be a generalized Krull domain and let J be an ideal of S where J has finitely many minimal primes, all of height at least two. Let A be a subring of S/J over which S/J is integral. Let R be the pullback of A → S/J ← S. Then (1) The Spec map induces a bijection Spec 1 S → Spec 1 R where the corresponding localizations coincide. In particular R satisfies (R1 ). (2) If the extension A ⊆ S/J is apparently fragile, then no ring between R and S satisfies going-down over R, other than R itself. Proof. (1) By Lemma 2.2(1) the contraction map Spec S → Spec R gives an order preserving bijection between the prime ideals of S that do not contain J and the prime ideals of R that do not contain J. Since no height one prime of S contains J, every height one prime of S contracts to a height one prime of R. Moreover by integrality each height one prime of R is lain over by a prime of S (necessarily of height one by INC). Thus the Spec map induces a bijection Spec 1 S → Spec 1 R where, by Lemma 2.2 (2), the corresponding localizations coincide. The “in particular” statement now follows since S is a generalized Krull domain. (2) Let T be a ring with R ( T ⊆ S that satisfies going-down over R. Then J is an ideal of T and S is integral over T . By assumption, there is some minimal prime p of J in R such that there exist distinct primes P1 , P2 ∈ Spec T with P1 ∩ R = P2 ∩ R = p, i = 1, 2. By integrality there exists a prime ideal Q1 of S that contracts to P1 , which by INC must be a minimal prime over J. Similarly, note that each prime ideal of S that contracts to P2 must be minimal over J, whence the set of such primes is finite (by our assumption on J). Say Q2 , ..., Qr is a complete list of all primes of S contracting to P2 . We first claim that there exists a height one prime ideal of S that is contained in Q1 , but not in any of S the Qi , i = 2, 3, ..., r. To see this note that both SQ1 and SW , where W = S \ rj=2 Qj , are generalized Krull domains. Let X be the set of height one primes of S S contained in Q1 and let Y be the set of height one primes of S contained in rj=2 Qj . Hence T T SQ1 = Q∈X SQ and SW = P ∈Y SP . Therefore, if the claim is false, i.e., if PERINORMALITY IN PULLBACKS 7 S X ⊆ Y , it follows that SW ⊆ SQ1 . This in turn implies that Q1 ⊂ rj=2 Qj . By the prime avoidance theorem, we can conclude that Q1 ⊆ Qj for some j ≥ 2. But this contradicts our choice of the Qi ’s, whence the claim is proved. Let Q ∈ X \ Y . By (1), Q is the unique prime ideal of S that contracts to q = Q ∩ R ⊂ p. We next claim that Q ∩ T is not contained in P2 . If it were, then by going-up Q is contained in a prime ideal of S that contracts to P2 , a contradiction to our choice of Q. As J is an ideal of T , it follows from part (1) that the Spec map induces a bijection Spec 1 S → Spec 1 T , which means that we also have a bijection Spec 1 T → Spec 1 R. Thus there is no prime ideal of T that is contained in P2 which contracts to q. But this contradicts the going-down property of R ⊂ T , since P2 ∩ R = p. Thus T cannot exist.  We are ready for the main theorem of the current section. Theorem 3.5 (Pullbacks of fragile subrings). Let S be a generalized Krull domain and let J be an ideal of S where J has n minimal primes with n ≥ 2. Assume further that J has height at least two. Let A be an integral fragile subring of S/J. If R is the pullback A → S/J ← S, then R is perinormal. Proof. First observe that S is integral over R. To see this, let s ∈ S \ R and let t ∈ S/J be its homomorphic image. Then there is a monic polynomial F (X) ∈ A[X] such that F (t) = 0. Lift F (via its coefficients) to a monic polynomial f (X) ∈ R[X]. Then f (s) = j for some j ∈ J. Set g(X) := f (X) − j; this is a monic polynomial over R that vanishes when evaluated at s. Now let (T, n) be a local overring of R that satisfies going-down over R. We will show that T is a localization of R. Case 1: Suppose JT = T . Then we claim S ⊆ T . To see this, note that since J * n, we have n ∩ R = p + J. Then there is some P ∈ Spec S with P ∩ R = p (since S is integral over R), and P + J either, whence we have Rp = SP by Lemma 2.2 (2). Hence, S ⊆ SP = Rp ⊆ T . Also since JT = T , we have the image of the map Spec T → Spec S is contained in Spec S \ VS (J). By Lemma 2.2 (1), the contraction map Spec S → Spec R is injective on the set Spec S \V (J). Hence, by Lemma 3.1, S ⊆ T satisfies going-down. Therefore, since S is perinormal, T = SP for some P ∈ Spec S. Then JSP = SP by assumption, so that J * P . But then since J is a shared ideal of S and R, Lemma 2.2 (2) applies, showing that SP = RP ∩R , so that T is a localization of R. Case 2: On the other hand if JT 6= T , then by [ES16, Proposition 3.9], the map Spec T → Spec Rn∩R induces a bijection Spec 1 T → Spec 1 (Rn∩R ), and by [ES16, Lemma 3.7] the corresponding localizations are equal. Since we have a similar bijection between Spec 1 (SW ) and Spec 1 (Rn∩R ) (where 8 NEIL EPSTEIN AND JAY SHAPIRO W = R \ n) by Lemma 3.4 (1), we get \ Rn∩R ⊆ T ⊆ TP = P ∈Spec 1 T \ SQ = SW Q∈Spec 1 (SW ) where the last equality follows from S being a generalized Krull domain. Now let p be the homomorphic image of n ∩ R in A. By Lemma 2.2 (3), Rn∩R is the pullback of the diagram Ap → (S/J)p ← SW , and by hypothesis, the extension Ap ⊆ (S/J)p is integral and apparently fragile. But then since SW is the integral closure of Rn∩R , it follows from Lemma 3.4 (2) that T = Rn∩R .  At this point, the reader may wonder under what circumstances fragile extensions exist. The reader may also ask for conditions under which fragility, global fragility, and apparent fragility coincide. The next few results and examples are dedicated to these issues. First, note that in exploring any kind of fragility, one need only ask what happens with reduced rings. Lemma 3.6 (Reducing fragilities to the reduced case). Let A ⊆ B be an integra l extension. The extension is fragile (resp. apparently fragile, resp. globally fragile) if and only if A and B have the same nilradical J and the extension A/J ֒→ B/J is fragile (resp. apparently fragile, resp. globally fragile). Proof. First suppose A ⊆ B is apparently fragile, and let J be the nilradical of B. Note that the nilradical of A is J ∩ A. From this, it is easy to see that the map Spec (A + J) → Spec A is a poset isomorphism, so by apparent fragility, we have J ⊆ A, so that J ∩ A = J. Now let C be a ring with A/J ( C ⊆ B/J. Then C = D/J for some ring D with A ( D ⊆ B, so there is some p ∈ Min A and unequal P, Q ∈ Spec D with P ∩A = Q∩A = p. Quotienting out by J then shows that C has the same relationship with A/J, completing the proof that A/J is apparently fragile in B/J. Now assume A ⊆ B is globally fragile (resp. fragile). Note that every prime ideal of A contains J ∩ A, and every multiplicative set W in A for which AW 6= 0 satisfies W ∩ A = ∅. Hence, for any W (resp. for any W = A \ P , P ∈ Spec A), the fact that AW ⊆ BW is apparently fragile implies (by the above) that JBW ⊆ AW for any such W . Hence J ∩ B ⊆ A is the nilradical of A. Moreover, by the above, we have that AW /JW = (A/J)W ֒→ (B/J)W = BW /JW is apparently fragile for any such W . Hence A/J ֒→ B/J is globally fragile (resp. fragile). Conversely, suppose that J ∩ B ⊆ A and that A/J ֒→ B/J is apparently fragile. Let C be a ring with A ( C ⊆ B. Then J is an ideal of C and A/J ( C/J ⊆ B/J. Some minimal prime of A/J splits in C/J; hence the corresponding minimal prime of A splits in C, so that A ⊆ B is apparently fragile. Finally, suppose that J ∩ B ⊆ A and that A/J ֒→ B/J is globally fragile (resp. fragile). Then for any multiplicative set W in A with W ∩J = ∅ (resp. W = A \ P for some P ∈ Spec A), JW is the nilradical of both AW and BW , PERINORMALITY IN PULLBACKS 9 and (A/J)W = AW /JW ֒→ BW /JW = (B/J)W is apparently fragile. Then by the above, AW ⊆ BW is apparently fragile for any such W , so that A ⊆ B is globally fragile (resp. fragile).  Next, we observe that the three notions of fragility coincide in many dimension 0 cases. Proposition 3.7 (Fragilities coincide in dimension 0). Let A be a dimension 0 ring with finitely many minimal primes, and let B be an integral extension of A. Then A ⊆ B is fragile iff it is apparently fragile iff it is globally fragile. Proof. First, we may assume by Lemma 3.6 that A and B are reduced, so that A is a product of finitely many fields. Next, note that is enough to show that apparent fragility implies global fragility. So suppose the extension is apparently fragile. Setting some notation, we have A = K1 ×· · ·×Kn , where the Kj are fields, and the prime ideals of A are pj = K1 × · · · × Kj−1 × 0 × Kj+1 × · · ·Q× Kn , for 1 ≤ j ≤ n. By the Chinese Remainder Theorem, we n have B ∼ = i=1 B/pi B. Now let W be a saturated multiplicative subset of A. Without loss of generality, there is some 1 ≤ t ≤ n such that W = A \ (p1 ∪ · · · ∪ pt ). We Qt have AW = A/(p1 ∩ · · · ∩ pt ) = K1 × · · · × Kt and BW ∼ = i=1 B/pi B under the earlier identification of B as a product of Ki -vector spaces. Let D be a ring with AW ( D ⊆ BW . Then D = CW for some ring C with A ( C ⊆ B. Moreover, any element of CW has a numerator in C that can be represented in the form (b1 , · · · , bt , at+1 , · · · , an ), with the bi ∈ B/pi B and the ai ∈ Ki . In particular, for any i > t, there is only one prime ideal of C that contracts to pi . So by apparent fragility, there is some i ≤ t and some P, Q ∈ Spec C with P 6= Q and P ∩ A = Q ∩ A = pi . But then pi AW is a (minimal) prime of AW , and we have P CW , QCW ∈ Spec CW with P CW 6= QCW and P CW ∩ AW = QCW ∩ AW = pi AW . Since W was arbitrary, B is a globally fragile extension of A.  Next, we show that the three notions of fragility coincide when the base ring is an integral domain, and more generally. Proposition 3.8. Let A ⊆ B be an apparently fragile, integral extension. Assume that there is some p ∈ Min A such that (1) only finitely many primes in B lie over p, and (2) for any q ∈ Min A \ {p}, there is only one prime ideal of B that contracts to q. Then pB = p, and the extension A ⊆ B is globally fragile. Proof. Let P1 , . . .T, Pn be the primes of B (necessarily minimal) that contract to p. Set J := ni=1 Pj . Consider the ring C := A + J. It fits into the 10 NEIL EPSTEIN AND JAY SHAPIRO following pullback diagram: /B  C   / B/J  A/p  By Lemma 2.2(1), the contraction map Spec B → Spec C induces a poset isomorphism between Spec B \VB (J) and Spec C \VC (J). However, Spec B \ VB (J) consists of those primes of B that do not contain any of P1 , . . . , Pn , so that by hypothesis, the minimal elements of Spec B \ VB (J) are in bijection with the minimal elements of Spec A\{p} via the contraction map Spec B → Spec A. Moreover, VC (J) ∼ = VA (p) as posets. Put together, this means that the contraction map Spec C → Spec A induces a bijection between the minimal primes of C and those of A, so that by apparent fragility of the extension A ⊆ B, we have C = A. Thus, J ⊆ A, but p ⊆ J ∩A ⊆ P1 ∩A = p, so J = p, which since it is also an ideal of B satisfies pB = p. Now let W be a multiplicative subset of A. If W ∩ p 6= ∅, then AW = BW , since p ⊆ (A : B). Assuming then that W ∩ p = ∅, let R be a ring with AW ( R ⊆ BW . Then R = CW for some A ( C ⊆ B. Then by apparent fragility of A ⊆ B, without loss of generality we have Q1 6= Q2 , where Qi := Pi ∩ C for i = 1, . . . , n. Since W ∩ p = ∅, we have W ∩ Qj = ∅ as well, so that each (Qj )W ∈ Spec R and (Q1 )W 6= (Q2 )W . Moreover, (Q1 )W ∩ AW = (Q2 )W ∩ AW = pW . Thus, the extension A ⊆ B is globally fragile.  Example 3.9. Theorem 3.5 is sharp, in that the height condition can not be omitted. To see this, consider the classic example given by Cohen and Seidenberg [CS46, Section 3(A)], which they used to show that the integral closure of a domain may not satisfy going down over it. In particular, the authors there consider the ring R = k[X, Y, Z]/(Y 2 − X 2 − X 3 ) over a field k of characteristic 0 (familiar in geometry as the coordinate ring of a cylinder over a nodal curve), along with its integral closure S = k[t, Z]. The map from R to S is given by x 7→ t2 − 1, y 7→ t3 − t. (Here we are using the convention that lower case variables represent the residue classes of upper case variables.) Put in the context of Theorem 3.5, let J := (t2 −1)S = (x, y)R. Note that as an ideal of S, J has two minimal primes, namely (t − 1)S and (t + 1)S. Then the map R ֒→ S fits into the pullback diagram /S R  A = k[Z] g  / B = S/J where g is the obvious inclusion. That is, R = k[Z] + J. (In the notation of [DFF09], R = A ⊲⊳f J, where f : A → S is the inclusion map k[Z] ֒→ PERINORMALITY IN PULLBACKS 11 k[t, Z].) Moreover, we claim that g is a fragile inclusion. To see this, first note that by Proposition 3.8, we only need to show it is apparently fragile. Next, observe that as an A-module, B is free of rank two on the elements 1 and t; in particular, B is integral over A. Accordingly, choose a ring C with A ( C ⊆ B. Then C contains an element of the form e = t · h, where h ∈ A. Then (e + h)(e − h) = e2 − h2 = (t2 − 1)h2 = 0, but e + h 6= 0 and e − h 6= 0 are elements of C. Hence, C is not an integral domain. But it is reduced because B is. Thus, C has at least two minimal primes, even though A contains only one. Moreover, both must contract to 0, since both of the minimal primes of B contract to 0. This completes the proof that A is apparently (hence globally) fragile in B. Thus, all conditions of Theorem 3.5 are satisfied except for the height condition. However, R is not perinormal, as it is not (R1 ) (see [ES16, Proposition 3.2]). Indeed, J is a height one prime of R, and RJ ∼ = k(Z)[X, Y ](X,Y ) /(Y 2 − X 2 − X 3 ), which is not integrally closed because (y/x)2 = 1 + x ∈ RJ , even though y/x ∈ / RJ . Next we exhibit two broad classes of rings where such fragile subrings exist. Theorem 3.10 (How to squeeze minimal primes). Suppose that the commutative ring B satisfies one of the following two conditions: (a) B is finitely generated over a field k, or (b) B is a complete Noetherian local ring such that either • B is equicharacteristic (i.e. contains a field), or • the residual characteristic of B generates a height 1 ideal. Let P1 , . . . , Pn be the minimal primes of B, and choose an integer 1 ≤ t < n. Then there is a subring A of B such that B is integral over A, the extension A ⊆ B is globally fragile, all the Pj for j < t contract to distinct minimal primes of A, and Pi ∩ A = Pj ∩ A for all t ≤ i < j ≤ n. Moreover, A satisfies the same condition among (a), (b) that B satisfies. T Proof. Let J := ni=t Pi . Then there is some subring C of B/J where C is a (regular) domain and C ⊆ B/J is a module-finite extension. (In case (a), choose a Noether normalization of B/J with respect to k, cf. [Mat86, Lemma 33.2], which will then be a polynomial ring over k. In case (b), one may use [Coh46, Theorem 16], in which case C will be a complete regular local ring.) Now let D be the pullback of the diagram C ֒→ B/J և B. Then B is module-finite over D (lift the generators of B/J over C to B, and add the generator 1 if necessary). We claim that the extension D ⊆ B satisfies the properties desired for A ⊆ B with regard to behavior on minimal primes. To see the claim, recall the order preserving bijection between (Spec B) \ VB (J) and (Spec D) \ VD (J) given by the contraction map (Lemma 2.2 (1)). Thus for i = 1, . . . t − 1, pi := Pi ∩ D are distinct minimal prime ideals of A. Clearly they are also the only minimal primes of D, with the possible exception of J. We next show that J is a minimal prime of D. Since 12 NEIL EPSTEIN AND JAY SHAPIRO D/J ∼ = C we see that J is a prime ideal of D. Suppose that it is not minimal, then there exists q ⊂ J, q a minimal prime ideal of D. Since q 6∈ VD (J), we must have q = pi for some 1 ≤ i < t. Since D ⊂ B satisfies going-up, there must Tn be a prime ideal Q of B with Pi ⊂ Q, such that Q ∩ D = J. But then i=t Pi = J ⊆ Q, whence Pk ⊆ Q for some t ≤ k ≤ n. Which gives the contradiction that Pi ⊆ Pk . Hence J is a minimal prime of D distinct from all the pi , for i = 1, 2, . . . , t − 1. To construct A, we note that as the Noetherian ring B is module finite over D, D is also a Noetherian ring by the Eakin-Nagata theorem [Mat86, Theorem 3.7(i)]. Hence we have ACC on chains of rings between D and B. In particular we can pick one that is maximal with respect to having its minimal primes in bijective correspondence with those of D, under the Spec map. Call it A. Then the extension A ⊆ B is apparently fragile, hence globally fragile by Proposition 3.8. If B contains a field, then A contains a field too. To see this, first note that the characteristics of A, B, and the field that B contains must match. If that characteristic is a positive prime number p, then both A and B contain Fp . If char A = char B = 0, then A and B contain the rational integers, and every nonzero integer is invertible in B. But by integrality, every element of A that is invertible in B must also be invertible in A. Thus, Q ⊆ A. If B is finitely generated over a field, then by the Artin-Tate lemma [AT51], A is also. If B has mixed characteristic p and p generates a height one ideal of B, then integrality forces pA to be a height one ideal of A as well. Finally, we must show that if B is complete, Noetherian and local, then A is complete, Noetherian and local. First, A is Noetherian by the EakinNagata theorem [Mat86, Theorem 3.7(i)]. Let n be the maximal ideal of B. By Going-Up, m := n ∩ A is maximal. By the lying-over and incomparability properties of integral extensions, (A, m) is local. Next, since mB is n-primary, the n-adic topology on B is the same as the m-adic one. Hence, one has the diagram A ֒→  ֒→  ⊗A B ∼ = B̂ = B. In particular, since B is module-finite over A,  must be module-finite over A as well. Since A/m = Â/m̂ = Â/mÂ, we have  = A + mÂ, so that by Nakayama’s lemma,  = A.  In our next result, by an application of Zorn’s Lemma, we are able to show that even in non-Noetherian context, (apparently) fragile subrings can still exist. Proposition 3.11 (Expanding subrings to the point of apparent fragility). Let C ⊆ B be an integral extension of commutative rings. Then there exists an apparently fragile subring A of B containing C such that in the map Spec A → Spec C, every minimal element of Spec C has a singleton fiber. PERINORMALITY IN PULLBACKS 13 Proof. We use Zorn’s Lemma to show the existence of A. Let C ⊆ R 1 ⊆ R2 ⊆ . . . be a chain of rings in B, chosen in such a way that the maps Spec S Rj → Spec C, the elements of Min C have singleton fibers. Set T = Ri . It will suffice to show that the elements of Min C have singleton fibers in the map Spec T → Spec C. So let p ∈ Min C and choose P, Q ∈ Spec T with P ∩C = Q∩C = p. If P 6= Q, then there exists a ∈ P \Q and b ∈ Q\P . There exists Rj such that a, b ∈ Rj . Then setting P ′ := P ∩ Rj and Q′ := Q ∩ Rj , we have P ′ 6= Q′ , yet P ′ ∩ C = P ∩ C = p = Q ∩ C = Q′ ∩ C. Thus, p has a non-singleton fiber under the map Spec Rj → Spec C, contradicting our assumption. Hence P = Q, so only one prime of T contracts to p.  Corollary 3.12. Let C ⊆ B be an integral extension. Assume either that (1) C has only finitely many minimal primes and dim C = 0, or that (2) there is some minimal prime p of C that satisfies the conditions of Proposition 3.8 with respect to the extension C ⊆ B. Then there is a globally fragile subring A of B containing C such that in the map Spec A → Spec C, every minimal element of Spec C has a singleton fiber. Proof. Combine Proposition 3.11 with Proposition 3.7 or Proposition 3.8.  Continuing our theme that fragility is closely related to perinormality in pullbacks, we present a result that will later allow us to show that there is no minimal “perinormalization” of an integral domain, despite the fact that there is a canonical normalization, seminormalization, and weak normalization. Additionally this next result is a partial converse to Theorem 3.5 (obtained by adding extra assumptions). Proposition 3.13 (Necessity of fragility when pulling back from dim 0). Let S be a generalized Krull domain and J an ideal of height at least two, such that dim S/J = 0 and J has only finitely many minimal primes over it. Let A ⊆ S/J be an integral subring, and let R be the pullback of A ֒→ S/J և S. Then R is perinormal if and only if A is a fragile subring of S/J. Proof. The “if” direction follows from Theorem 3.5. Conversely, suppose A is not fragile in B = S/J. Then there is some P ∈ Spec R with P ⊇ J such that AP̄ ⊆ BP̄ is not apparently fragile, where P̄ = P/J. That is, there is a ring C with AP̄ ( C ⊆ BP̄ , such that the map Spec C → Spec AP̄ is 1:1 on Min A. But by the dimension assumption and integrality, it follows that Spec C and Spec AP̄ are order-isomorphic. Moreover, note that C = DA\P̄ for some ring D with A ⊂ D ⊆ B. Now, let T be the pullback of the diagram C ֒→ BP̄ և SP . By Lemma 2.2(1), Spec T is order isomorphic to the disjoint union of Spec SP \ VSP (JP ) with Spec C. But since Spec C is order-isomorphic to Spec AP , and since RP is the pullback of AP̄ ֒→ BP̄ և SP by Lemma 2.2(3), it follows that the map Spec T → Spec RP is an order-isomorphism, and hence the extension 14 NEIL EPSTEIN AND JAY SHAPIRO RP ⊆ T satisfies going-down. But T 6= RP , even though T is centered on the maximal ideal of RP , whence RP (and hence also R) is not perinormal.  For the next example, we will need the following result regarding when a certain type of diagonal embedding is apparently fragile. Lemma 3.14. Let R ⊆ S be an inclusion of integral domains. Then the diagonal map d : R → R × S given by d(r) = (r, r) induces an apparently fragile inclusion if and only if S is algebraic over R. Proof. First assume S is algebraic over R. Let T be a ring with d(R) ( T ⊆ R × S. Let (r, s) ∈ T \ R. By subtracting a diagonal element, we may assume r = 0 and s 6= 0, so that t = (0, s) ∈ T . If s ∈ R, then (s, 0) = (s, s) − (0, s) ∈ T , so that (s, 0) · (0, s) = 0 shows that T has zero-divisors. Otherwise, by algebraicity, there is some equation of the form n X ri sn−i = 0, i=0 where n ≥ 1, ri ∈ R for all 0 ≤ i ≤ n, r0 6= 0, and rn 6= 0 (with the last condition since S is a domain, P so that we may divide out extraneous n−1 d(ri )xn−i ∈ T . But then d(rn ) + powers of s). Hence, 0 6= (0, −rn ) = i=0 (0, −rn ) = (rn , 0) ∈ T as well, so that (rn , 0) · (0, −rn ) = 0. In either case, T is reduced (as it is a subring of the reduced ring R × S), but is not an integral domain. Thus, T has at least two minimal primes, completing the proof that d(R) is apparently fragile in R × S. On the other hand, suppose S is transcendental over R. Then there is some s ∈ S that is transcendental over R. Let X be an indeterminate, and define a map ϕ : R[X] → R × S by setting ϕ(r) = (r, r) for all r ∈ R and ϕ(X) = (0, s). If g ∈ ker ϕ, then 0 = g(0, s) = (g(0), g(s)), so that g(s) = 0, whence g must be the zero polynomial. Hence, ϕ induces an isomorphism between R[X] and d(R)[(0, s)], which is thus an integral domain that is a subring of R × S strictly containing d(R). Therefore, the inclusion d(R) ⊆ R × S is not apparently fragile.  Example 3.15. Unlike the case of normality [Mat86, Theorem 9.1(ii)], and also unlike the cases of seminormality and weak normality [Vit11], there is in general no minimal “perinormalization” of an integral domain. That is, there exist integral domains that are not perinormal, but are the intersection of (finitely many) perinormal √ domains with the same fraction field. field of t3 − 2 (as a To see this let K = Q( 3 2) and let F be the splitting √ 3 subfield of C). Define a map θ : K → F , that sends 2 to a different root of t3 − 2. Let S = Q[X, Y ], where X and Y are commuting indeterminates over Q. Then there exists polynomials f (X) and g(X) in S such that if m = (f, Y ) and n = (g, Y ), then S/m ∼ = K and S/n ∼ = F . Let J = m ∩ n. Then S and J satisfy the assumptions in Theorem 3.5. Moreover, since m and n are distinct maximal ideals, S/J ∼ = K × F by the Chinese Remainder Theorem. Notice that K×F contains two distinct (but isomorphic) subfields, namely K PERINORMALITY IN PULLBACKS 15 (as viewed via the diagonal map into K × F ), and the set H := {(k, θ(k)) : k ∈ K}. Also note K × F is integral over both K and H. Moreover, it follows from Lemma 3.14 that K and H are apparently fragile (hence globally fragile, by Proposition 3.7) subrings of K × F . Hence if R and T are the pullbacks of K → K × F ← S and H → K × F ← S respectively, both R and T are perinormal by Theorem 3.5. On the other hand, R ∩ T is the pullback of K ∩ H → K × F ← S. Since K ∩ H is clearly not fragile in K × F , it follows from Proposition 3.13 that R ∩ T is not perinormal. We now present an example of how Theorem 3.5 may be used, while also showing that the converse to Proposition 2.3 fails. Example 3.16. Let k be a field and let D := k[X, Y, Z] where X, Y and Z are commuting indeterminates over k. Let S := k[X, Y, Z](X,Y,Z) and let Q1 and Q2 be the ideals (of S) (X, Y ) and (Y, Z) respectively. Let J := Q1 ∩ Q2 = (XZ, Y ). The images of X, Z in S/J will be denoted x, z respectively (the image of Y is 0). Finally let A := k[x + z]. We claim that A is a maximal subdomain of S/J, hence (globally, by Proposition 3.8) fragile in S/J, since S/J is reduced. To see this, let f be an element of (S/J) \ A, and let C = A[f ]. We will show that C has zero-divisors. After subtracting off the constant term, we may assume f = g(x) + h(z), where g and h are polynomials over k with zero constant term. If g = h, then f = g(x) + g(z) = g(x + z) ∈ A already, so we can dispense with this case. Note that g(x + z) and h(x + z) are elements of k[x + z]. Accordingly, let u = f (x, z) − g(x + z) = (g(x) + h(z)) − (g(x) + g(z)) = h(z) − g(z), and v = f (x, z) − h(x + z) = (g(x) + h(z)) − (h(x) + h(z)) = g(x) − h(x). Since both g and h have constant term zero, it follows that u and v are multiples of z, x respectively. Furthermore neither u nor v is zero, since g, h as abstract polynomials are distinct and in S/J, x and z are each transcendental over k (albeit not jointly). But uv = 0, and both of them are in C, so this ring is not a domain. We next claim that S/J is integral over A. This can be seen by noting that x2 − (x + z)x = z 2 − (x + z)z = 0. Hence, by Theorem 3.5, if R is the pullback of A → S/J ← S, then R is perinormal. In particular, it is perinormal in S. On the other hand, since S/J is integral over A, dim A = 1, and both of the minimal primes of S/J contract to (0) in A, it follows that S/J satisfies going-down over A. As S/J is local and is not a localization of A (it is integral over A), we see that A is not perinormal in S/J, whence the converse to Proposition 2.3 fails. 4. Hypersurface contraction Next we examine another pullback construction where the resulting ring is perinormal. First a preparatory lemma. Let S be an integral domain and W ⊂ S a multiplicatively closed subset of S. The saturation of W is easily seen to be the set of all s ∈ S such that w/s ∈ W for some w ∈ W . Moreover, if W is saturated, and if s/w is a 16 NEIL EPSTEIN AND JAY SHAPIRO unit of SW , then s ∈ W . To see this let s/w, s ∈ S, w ∈ W , be a unit of SW . Hence there exists t/w′ ∈ SW with w′ ∈ W , such that st/ww′ = 1 or st = ww′ . As W is saturated, we have s (and t) in W . Lemma 4.1. Let S be an integral domain such that the set of units of S along with 0 form a field k. Let J be a prime ideal of S such that that all units of S/J are in the image of k (also denoted k). Let R be the pullback of k → S/J ← S (or R := k ×S/J S). Then W = R \ J is a saturated multiplicatively closed subset of S. Proof. First note that R = k + J. Moreover, W consists of those elements of R of the form v + j where 0 6= v ∈ k and j ∈ J. Let s ∈ S be in the saturation of W (within S). Then there exists s′ ∈ S such that ss′ ∈ W . Let π denote the canonical projection π : S → S/J. Since elements of W map to k× in S/J, it follows that π(s) is a unit of S/J. Hence π(s) ∈ k. Therefore s − π(s) = j ∈ J, so that s = π(s) + j ∈ W .  Theorem 4.2 (Hypersurface contraction). Let S be a generalized Krull domain, with dim S > 1, such that the set of units of S along with 0 forms a field k. Let J be a principal height one prime ideal of S that is not a maximal ideal of S. Suppose further that all units of S/J are in the image of k (also denoted k). If R is the pullback of k → S/J ← S (or R := k ×S/J S), then R is perinormal. Proof. As before we have a bijection between the prime ideals of S that do not contain J and the prime ideals of R that do not contain J (Lemma 2.2 (1)). Since J is clearly a maximal ideal of R, the bijection is between Spec S \ V (J) and Spec R \ {J}. Moreover if Q ∈ Spec S \ V (J) and P := Q ∩ R, then RP = SQ (Lemma 2.2 (2)). In particular, if P ∈ Spec R and P 6= J, then RP = SQ for some prime ideal Q of S, whence RP is perinormal (since it is a generalized Krull domain). Therefore to show that R is perinormal it suffices to show that if T is a local overring of R centered on J that satisfies going-down over R, then T = RJ . Clearly RJ ⊆ T . Let W = R \ J. Then JRW = JSW , and by Lemma 2.2 (3), RJ = RW is the pullback of k → SW /JSW ← SW . We next claim that htRW JRW = htR J > 1. The equality is clear. To see the inequality let J ⊂ M , where M is a maximal ideal of S (such an M exists, since we are assuming that J is not maximal in S). Now let P be any height one prime ideal of S that is contained in M , where P 6= J. Such primes exist since SM is the intersection of S localized at the height one primes contained in M . Then 0 6= P ∩ R ⊂ J, which proves the claim. It is clear that as before we have a bijection between Spec (SW ) \ V (JSW ) and Spec (RW ) \ {JRW }. Since htRW JRW 6= 1, this induces a bijection between Spec 1 (SW ) \ {JSW } and Spec 1 (RW ), with corresponding localizations equal. Since R ⊆ T satisfies going-down, each height one prime of R that is contained in J is lain over by a prime ideal of T . Say Q ∩ R = P ∈ Spec 1 R. Then RP ⊆ TQ . Since RP is a rank 1 valuation ring and TQ is not a field, PERINORMALITY IN PULLBACKS 17 we have equality. Thus if X = {Q ∈ Spec T : Q ∩ RW ∈ Spec 1 RW } and Y = {P ∈ Spec 1 (R) : P ⊂ J}, then \ \ T ⊆ TQ = RP . Q∈X P ∈Y As J is a principal ideal of S, we can write JSW = f SW for some f ∈ S. Thus f is contained in only one height one prime of SW (namely JSW ). The ring (SW )f (i.e., the ring SW localized at the powers of f ) is a generalized Krull domain, and so it is the intersection of all its localizations at height one prime ideals and each of these is equal to the localization of R at a height one prime contained in J. When combined with the previous containment we have \ T ⊆ RP = (SW )f . P ∈Y We will show that the only local ring between RW and (SW )f is RW . Suppose that this is false and let g ∈ T \ RW . We note that either g or g − 1 is a unit of T , and neither one is in RW . Without loss of generality, we can assume that g is a unit. Since T ⊆ (SW )f , g is a unit of (SW )f . Hence, g = uf n for some unit u of SW and n ∈ Z. By Lemma 4.1, u = w′ /w for some w, w′ ∈ W . If n ≥ 0, then since W ⊆ R, g = (w′ /w)f n ∈ RW , contradicting our assumption on g. Finally if n = −m < 0 (so that m > 0), then we have w′ = wgf m , with all displayed elements in T and w′ a unit, whence f is a unit of T , which remains a contradiction. Thus g cannot exist, whence T = RW . Therefore R is perinormal.  Acknowledgments We wish to thank Tiberiu Dumitrescu, who along with several smaller changes found an important error in the previous version of Theorem 3.5, leading to a rethinking of the notion of fragility. References [AT51] Emil Artin and John T. Tate, A note on finite ring extensions, J. Math. Soc. Japan 3 (1951), 74–77. [Coh46] Irvin S. Cohen, On the structure and ideal theory of complete local rings, Trans. Amer. Math. Soc. 59 (1946), 54–106. [CS46] Irvin S. Cohen and Abraham Seidenberg, Prime ideals and integral dependence, Bull. Amer. Math. Soc. 52 (1946), 252–261. [DFF09] Marco D’Anna, Carmelo Antonio Finocchiaro, and Marco Fontana, Amalgamated algebras along an ideal, Commutative algebra and its applications, Walter de Gruyter, Berlin, 2009, pp. 155–172. [ES16] Neil Epstein and Jay Shapiro, Perinormality – a generalization of Krull domains, J. Algebra 451 (2016), 65–84. [Fon80] Marco Fontana, Topologically defined classes of commutative rings, Ann. Mat. Pura Appl. (4) 123 (1980), 331–355. [Gil68] Robert W. Gilmer, Multiplicative ideal theory, Queen’s Papers in Pure and Applied Mathematics, no. 12, Queen’s University, Kingston, Ont., 1968. 18 NEIL EPSTEIN AND JAY SHAPIRO [Mat86] Hideyuki Matsumura, Commutative ring theory, Cambridge Studies in Advanced Mathematics, no. 8, Cambridge Univ. Press, Cambridge, 1986, Translated from the Japanese by M. Reid. [Sey70] Hamet Seydi, Anneaux henséliens et conditions de chaı̂nes, Bull. Soc. Math. France 98 (1970), 9–31. [Vit11] Marie A. Vitulli, Weak normality and seminormality, Commutative algebra: Noetherian and non-Noetherian perspectives, Springer-Verlag, 2011, pp. 441– 480. Department of Mathematical Sciences, George Mason University, Fairfax, VA 22030 E-mail address: [email protected] Department of Mathematical Sciences, George Mason University, Fairfax, VA 22030 E-mail address: [email protected]
0math.AC
arXiv:1302.5741v1 [math.CO] 22 Feb 2013 The smallest part of the generic partition of the nilpotent commutator of a nilpotent matrix Leila Khatami Abstract Let k be an infinite field. Fix a Jordan nilpotent n × n matrix B = JP with entries in k and associated Jordan type P . Let Q(P ) be the Jordan type of a generic nilpotent matrix commuting with B. In this paper, we use the combinatorics of a poset associated to the partition P , to give an explicit formula for the smallest part of Q(P ), which is independent of the characteristic of k. This, in particular, leads to a complete description of Q(P ) when it has at most three parts. Introduction Let k be an infinite field and Matn (k) be the set of all n × n matrices with entries in k. Suppose that B = JP ∈ {Matn (k)} is a Jordan matrix with associated Jordan type – Jordan block partition– P ` n. Recall that the centralizer and the nilpotent centralizer of MSC 2010: 05E40, 06A11, 14L30, 15A21 Keywords: Jordan type, nilpotent matrix, commutator, poset, antichain 1 B are defined as follows. CB = {A ∈ Matn (k) | AB = BA}, NB = {A ∈ CB | An = 0}. It is well known that NB is an irreducible algebraic variety (see [2, Lemma 1.5]). Therefore, there is a unique partition of n corresponding to the Jordan type of a generic element of NB . We denote this unique partition by Q(P ). The map P → Q(P ) has been studied by different authors (see [2], [3], [8], [9], [10], [11], [12]). The number of parts of the partition Q(P ) was completely determined by R. Basili ([1, Proposition 2.4] and [3, Theorem 2.17]). It is known that if chark = 0 (see [10]) or char k > n (see [2]), then the map P → Q(P ) is idempotent: Q(Q(P )) = Q(P ). In [11], P. Oblak gives a formula for the index– largest part – of the partition Q(P ) over the field of real numbers. Her result was extended to any infinite field, by A. Iarrobino and the author in [8]. This, in particular, gives rise to an explicit formula for the parts of Q(P ) when it has one or two parts. In this paper, we work with a poset DP determined by a given partition P . The poset was used in [10] and [11], and was defined in [3] in close connection with UB , a maximal nilpotent subalgebra of the centralizer CB . In Section 1, we review the preliminaries. We first define the poset DP and then recall the classic partition invariant λ(P ) = λ(DP ) of the poset DP , defined in terms of the lengths of unions of chains in DP , and also the partition λU (P ) associated to the poset DP , defined and studied in [8] and [9]. In Section 2 (Theorem 2.10) we define an invariant µ(P ) of the partition P and show that it is equal to the smallest part of the partition λU (P ). In Section 3, enumerating disjoint maximum antichains in DP , we prove that the smallest part of λ(P ) is also equal to µ(P ) (Theorem 3.19). 2 In section 4, using the main result of [8], we prove that the smallest part of Q(P ) is the same as the smallest part of λ(P ) (Theorem 4.1). As a consequence we obtain an explicit formula independent of characteristic of k for Q(P ) when it has at most three parts (Corollary 4.6). Acknowledgement. The author is grateful to A. Iarrobino for invaluable discussions on the topic, as well as for his comments and suggestions on the paper. The author is also thankful to Bart Van Steirteghem and Tomaž Košir for their thorough comments on an earlier version of this paper1 . Poset DP 1 Let n be a positive integer and P a partition of n. For a positive integer p, we denote by np ≥ 0 the number of parts of size p in P . Assume that B = JP , is the n×n Jordan matrix with Jordan type P , CB its centralizer and J , the Jacobson radical of CB . Write P = (pns s , · · · , pn1 1 ) with ps > · · · > p1 and ni > 0, for all i. Then CB /J is semisimple, and is here isomorphic to the matrix algebra Mns (k) × · · · × Mn1 (k): there is a projection π : CB → Mns (k) × · · · × Mn1 (k). (See [1, Lemma 2.3], [3, Theorem 2.3], [7, Theorem 6].) Note that NB = π −1 (Ns × · · · × N1 ), where Ni is the subvariety of nilpotent matrices in Mni (k). Let UB = π −1 (Us × · · · × U1 ), where Ui is the subalgebra of Mni (k) consisting of strictly upper triangular matrices. It is easy to see that UB is a maximal nilpotent subalgebra of CB and that for any element N ∈ NB , there exists a unit C ∈ CB such that 1 This paper is a much revised version of results and proofs outlined in the last two sections of a preprint circulated early in 2012. (See arXiv:1202.6089v1.) 3 CN C −1 ∈ UB (see [3, Lemma 2.2]). Thus to find the Jordan partition of a generic element of NB it is enough to study a generic element of UB . Recall that if v and v 0 are elements of a poset, we say v 0 covers v if v < v 0 and there is no element v 00 in the poset such that v < v 00 < v 0 . For a partition P of n, we define a poset DP through its covering edge diagram; a digraph with vertices corresponding to the elements of DP and an edge from v to v 0 in if and only if v 0 covers v in DP . This poset, originally defined in [3], is closely related to the algebra UB . In fact, the paths in the digraph of DP correspond to the non-zero entries of a generic element of UB . The study of combinatorial properties of this poset has led to results on the partition Q(P ) (see [11]2 , [3], [8] and [9]). n np Definition 1.1. Let P be a partition of n and write P = (ps ps , · · · , p1 1 ) such that ps > · · · > p1 and npi > 0 for 1 ≤ i ≤ s. The associated poset DP is defined as follows. As a set, the poset DP consists of n elements, each labeled by a triple (u, p, k) ∈ N3 such that p ∈ {p1 , · · · , ps }, 1 ≤ u ≤ p and 1 ≤ k ≤ np . The covering relations in DP are as follows: (v, pj , `) covers (u, pi , k) if and only if one of the following holds. (α) If j = i + 1, v = u + pi+1 − pi , ` = 1 and k = npi , (β) If j = i − 1, v = u, ` = 1 and k = npi , (e) If j = i, v = u and ` = k + 1, or (ω) If j = i, pi+1 − pi > 1, pi − pi−1 > 1, v = u + 1, ` = 1 and k = npi . 2 Although the poset DP was formally introduced later in [3], P. Oblak implicitly worked with it using a slightly different setting in [11]. 4 We associate to this poset its covering edge digraph, which we also denote by DP and we visualize it as follows. • Vertices of DP For each 1 ≤ i ≤ t, there are npi rows, each consisting of pi vertices labeled by triples (u, pi , k) such that the first and last components of the triple are increasing when we go from left to right and from bottom to top, respectively. For each 1 ≤ i ≤ s, we refer to the set of all vertices (u, pi , k) as level pi (or the i-th level from bottom) of DP . (See Figure 1.) • Covering edges of DP Each edge of the digraph, corresponding to a covering relation in the poset, is one of the following. (α) For 1 ≤ i < s, and each 1 ≤ u ≤ pi , the directed edge αi,i+1 (u) from the top vertex (u, pi , npi ) of the u-th column of level pi to the bottom vertex (u + pi+1 − pi , pi+1 , 1) of the (u + pi+1 − pi )-th column in level pi+1 . (β) For 1 < i ≤ s, the directed edge βpi ,pi−1 (u) from the top vertex (u, pi , npi ) of the u-th column of level pi to the bottom vertex (u, pi−1 , 1) in the u-th column of level pi−1 . (e) For 1 ≤ i ≤ s, 1 ≤ u ≤ pi and 1 ≤ k < npi , the upward directed edge epi ,k(u) from (u, pi , k) to (u, pi , k + 1) . (ω) For any isolated pi (i.e. pi+1 − pi > 1 and pi − pi−1 > 1) and any 1 ≤ u < pi , the directed edge ωpi (u) from (u, pi , npi ) to (u + 1, pi , 1). (See Figure 2.) 5 (1, 6, 2) (2, 6, 2) (3, 6, 2) (4, 6, 2) (5, 6, 2) (6, 6, 2) (1, 6, 1) (2, 6, 1) (3, 6, 1) (4, 6, 1) (5, 6, 1) (6, 6, 1) (1, 4, 1) (2, 4, 1) (3, 4, 1) (4, 4, 1) (1, 3, 1) (2, 3, 1) (3, 3, 1) (1, 2, 3) (2, 2, 3) (1, 2, 2) (2, 2, 2) (1, 2, 1) (2, 2, 1) (1, 1, 1) Figure 1: Labeled vertices of the poset DP for P = (62 , 4, 3, 23 , 1) Remark 1.2. Let (x, p, k) and (y, q, `) be two elements of the poset DP . Then (x, p, k) ≤ (y, q, `) if and only if there exists a directed path in the diagram of DP that goes from vertex (x, p, k) to vertex (y, q, `). Thus, by Definition 1.1 we have (x, p, k) ≤ (y, q, `) ⇔ p < q and q − p + x ≤ y, or p ≥ q and x ≤ y, or p = q, x = y and k ≤ `. Recall that for a partition P , the partition Q(P ) is defined as the Jordan type of a generic nilpotent matrix commuting with B = JP . We associate two other partitions to P in terms of its poset DP . 6 α:     β:     e:     ω:     Figure 2: Covering edges in the poset DP for P = (62 , 4, 3, 23 , 1) First, the partition λ(P ), the classical partition associated to DP . Recall that a chain in a poset is defined as a totally ordered subset, whose length is its cardinality. In a finite poset, a chain is called maximum if there is no chain in the poset with a strictly larger cardinality. Definition 1.3. Let P be a partition and DP the associated poset. The partition λ(P ) = (λ1 , λ2 · · · ) is defined such that λk = ck − ck−1 , where ck is the maximum cardinality of a union of k chains in DP , for k = 0, 1 · · · . Next, we recall the definition and properties of the partition λU (P ), associated to DP with a similar process as in the definition of λ(P ), but only considering certain types of chains closely related to almost rectangular subpartitions of P (see [9]). Recall that an almost rectangular partition is a partition whose largest and smallest parts differ by at 7 most 1. Definition 1.4. Let P be a partition of n. For a positive integer r and a set A = {a1 , a1 + 1, · · · , ar , ar + 1} ⊂ N such that a1 < a1 + 1 < · · · < ar < ar + 1, we define the r-U -chain UA as follows: UA = ∪ri=1 SA;i , where SA;i = {(u, p, k) ∈ DP | p ∈ {ai , ai + 1} and i ≤ u ≤ p − i + 1} ∪{(u, p, k) ∈ DP | p > ai + 1 and u ∈ {i, p − i + 1}}. Note that each SA,i is a chain in DP and that SA,i ∩ SA,j = ∅ if i 6= j. A 1-U -chain is called a simple U -chain. A maximum simple U -chain is a simple U -chain with the maximum cardinality among all simple U -chains in DP . Figure 3: U{2,3} and U{1,2,3,4} in the poset DP for P = (62 , 4, 3, 23 , 1) By the definition above, if A = {a, a + 1}, then the length of the corresponding simple U -chain UA is | UA |= a na + (a + 1) na+1 + 2 X np . p>a+1 Now we are ready to define λU (P ), the third partition associated to P . 8 (1.1) Definition 1.5. Let P be a partition and DP the associated poset. The partition λU (P ) = (λU,1 , λU,2 , · · · ) is defined such that λU,k = uk −uk−1 , where uk is the maximum cardinality of a k-U -chain in DP , for k = 0, 1, · · · . Example 1.6. Let P = (62 , 4, 3, 23 , 1). Then u1 = 15 = |U{1,2} | = |U{2,3} |, u2 = 23 = |U{1,2,5,6} | = |U{2,3,5,6} |, and u3 = 26 = |U{1,2,3,4,5,6} | = |DP |. So we have λU (P ) = (15, 8, 3). Definition 1.7. (Dominance partial order) Let P and Q be partitions of n. Here we write P = (p1 , p2 , · · · ) and Q = (q1 , q2 , · · · ) with p1 ≥ p2 ≥ · · · and q1 ≥ q2 ≥ · · · . Then k k X X P ≤ Q if and only if for any k ∈ N, we have pi ≤ qi . i=1 i=1 It is obvious from the definitions that for any partition P , λU (P ) ≤ λ(P ). In [8, Theorem 3.9], we prove that the inequality λU (P ) ≤ Q(P ) also holds. 2 Smallest part of λU (P ) In this section we define a numerical invariant, µ(P ), associated to a partition P , and show that it is the smallest part of the partition λU (P ). In the next two sections we prove that the smallest part of the partition λ(P ) and also the smallest part of Q(P ) are equal to µ(P ) as well. Definition 2.1. Let s be a positive integer. A partition P = (pns s , · · · , pn1 1 ) of n such that p1 > 0, pi+1 = pi + 1, for 1 ≤ i < s and ni > 0 for 1 ≤ i ≤ s, is called an s-spread of n, or 9 simply a spread. If s ≤ 2 then P is called an almost rectangular partition. In other words, P is almost rectangular if its biggest and smallest part differ by at most 1. Notation 2.2. For a rational number a ∈ Q, dae denotes the smallest integer greater than or equal to a. Definition 2.3. For an arbitrary partition P , let r(P ) denote the minimum number of almost rectangular subpartitions of P appearing in a decomposition of P as a union of almost rectangular subpartition. Note that if P is an s-spread then r(P ) = d 2s e. By [1, Proposition 2.4] and [3, Theorem 2.17], for any partition P , the partition Q(P ) has exactly r(P ) parts. By Definitions 1.4 and 1.5, it is also clear that λU (P ) has r(P ) parts. In Section 3, we will show that λ(P ) has r(P ) parts as well. For a partition P , we write λU (P ) = (λU,1 (P ), · · · , λU,r(P ) (P )) as in Definition 1.5. In particular, min(λU (P )) = λU,r(P ) (P ). The following proposition gives a relation between the smallest part of a partition and the smallest parts of its subpartitions. We will use this in Definition 2.6 and in the proof of Theorem 2.10. Notation 2.4. Let P be a partition and ` a positive integer smaller than the smallest part of P . We write P − ` to denote the partition obtained from P by subtracting ` from each part of it. Proposition 2.5. Let P and Q be two partitions. Let P = (pns s , · · · , pn1 1 ) such that ps > · · · > p1 and ni > 0 for all 1 ≤ i ≤ s, and Q = (qtmt , · · · , q1m1 ) such that qt > · · · > q1 and mi > 0 for all 1 ≤ i ≤ t. If q1 ≥ ps + 2 and R = (Q, P ) then min(λU (R)) = min{min(λU (P )), min(λU (Q − 2r(P )))}. 10 Proof. Let Q̄ = Q − 2r(P ). Throughout the proof, we identify elements of DQ̄ with elements of DR via the relabeling map ι : DQ̄ → DR defined by ι((u, p, k)) = (u + r(P ), p + 2r(P ), k). First note that since q1 ≥ ps + 2, we have r(R) = r(P ) + r(Q) and q1 − 2r(P ) ≥ ps + 2 − 2r(P ) ≥ p1 + s + 1 − 2r(P ) ≥ p1 > 0. Thus r(Q) = r(Q̄) and therefore r(R) = r(P ) + r(Q̄). Assume that 1 ≤ k ≤ r(Q) and let UĀ be a k-U -chain in DQ̄ . Let B = {a + 2r(P ) | a ∈ Ā} ∪ {p1 , · · · , p2r(P ) }. Then UB is an (r(P ) + k)-U -chain in DR that contains DP . We also have DR \ UB = DQ̄ \ UĀ . So if UĀ has maximum cardinality among all k-U -chains in DQ̄ , then by Definition 1.5 we get r(P )+r(Q) X i=r(P )+k+1 r(Q) λU,i (R) ≤ | DR \ UB |=| DQ̄ \ UĀ | = X λU,i (Q̄). (2.1) i=k+1 In particular, setting k = r(Q) − 1, we get min(λU (R)) ≤ min(λU (Q)). On the other hand, any `-U -chain U in DP can be extended to an `-U -chain Ū in DR by adding the first and the last r(P ) vertices of each row of DQ . So if Q = {q1 , · · · , q2r(Q) } then Ū ∪ UQ is an (` + r(Q))-U -chain in DR that contains DQ , and we also have DR \ (Ū ∪ UQ ) = DP \ U. Thus, if U has maximum cardinality among all `-U -chains in DP then we get r(P )+r(Q) X i=`+r(Q)+1 r(P ) λU,i (R) ≤| DR \ (Ū ∪ UQ ) |=| DP \ U |= X λU,i (P ). i=`+1 In particular, setting ` = r(P ) − 1, we get min(λU (R)) ≤ min(λU (P )). 11 (2.2) Thus min(λU (R)) ≤ min{min(λU (P )), min(λU (Q̄))}. (2.3) Conversely, suppose that UA is an (r(R)−1)-U -chain in DR with maximum cardinality. Since r(R) = r(P ) + r(Q), either DP ⊆ UA or DQ ⊆ UA . If DP ⊆ UA , then (DQ̄ ∩ UA ) is an (r(Q) − 1)-U -chain in DQ̄ . So, by Definition 1.5 and the choice of UA , we have min(λU (Q̄)) ≤ |DQ̄ \ UA | = |DR \ UA | = min(λU (R)). If DQ ⊆ UA , then (DP ∩ UA ) is an (r(P ) − 1)-U -chain in DP . So min(λU (P )) ≤ |DP \ UA | = |DR \ UA | = min(λU (R)). This completes the proof of the proposition.  We now define our key invariant µ(P ) that we will show is equal to the smallest part of all three partitions λU (P ), λ(P ), and Q(P ). Definition 2.6. Let P be an s-spread with the smallest part p, so we can write P = ((p + s − 1)ns , · · · , pn1 ), such that ni > 0 for 1 ≤ i ≤ s. Setting ns+1 = 0, we define µ(P ) = min{p n2i−1 + (p + 1)n2j | 1 ≤ i ≤ j ≤ r(P )}. Note that if s is an odd number, then r(P ) = s+1 2 (2.4) and therefore n2r(P ) = 0. Thus µ(P ) = p · min{ n2i−1 | 1 ≤ i ≤ r(P )}. (2.5) Now let P be an arbitrary partition. We can write P = P` ∪ · · · ∪ P1 such that each Pk is a spread and the biggest part of Pk and is less than or equal to the smallest part of k−1 X Pk+1 minus two. For k = 1, · · · , `, let r̄k = r(Pi ). We define i=1 µ(P ) = min{µ(Pk − 2r̄k ) | 1 ≤ k ≤ `}. 12 (2.6) The following lemma is an immediate consequence of Definition 2.6. Lemma 2.7. Let P and P 0 be two partitions such that the largest part of P is smaller than the smallest part of P 0 minus 1. Then µ(P 0 ∪ P ) = min{µ(P ), µ(P 0 − 2r(P ))}. Remark 2.8. Note that in general µ(P ) − r 6= µ(P − r). For example, let P = (4, 32 ) and r = 2. Then µ(P ) = 10 and µ(P − r) = µ((2, 12 )) = 4. Example 2.9. Let P = (11, 10, 92 , 8, 6, 5, 3, 2, 12 ). Then P = (P3 , P2 , P1 ), where P1 = (3, 2, 12 ), P2 = (6, 5), and P3 = (11, 10, 92 , 8). We have r(P1 ) = 2, r(P2 ) = 1 and r(P3 ) = 2 and therefore r̄1 = 0, r̄2 = 2 and r̄3 = 3. Thus µ(P ) = min{µ(P1 ), µ(P2 − 4), µ(P3 − 6)}. By definition µ(P1 ) = µ((3, 2, 12 )) µ(P2 − 4) = µ((2, 1)) = (1) · min{2, 1} = 1, = min{(1)(1) + (2)(1)} = 3, and µ(P3 − 6) = µ((5, 4, 32 , 2)) = min{(2)(1) + (3)(2), (2)(1) + (3)(1), (2)(1) + (3)(1)} = 5. Therefore µ(P ) = 1. Theorem 2.10. For any partition P of n, min(λU (P )) = µ(P ). Proof. Write P = P` ∪ · · · ∪ P1 such that for each k, 1 ≤ k ≤ `, Pk is a spread and the biggest part of Pk is less than or equal to the smallest part of Pk+1 minus two for k = 1, · · · , `. By Definition 2.6 of the invariant µ and Proposition 2.5, it is enough to prove the equality for a spread. For the rest of the proof we assume that P = (pns s , · · · , pn1 1 ) with ni > 0 for i = 1, · · · , s is an s-spread. So we have pi = p1 + i − 1 and r = r(P ) = ds/2e. 13 Let UA be an (r −1)-U -chain in DP with maximum cardinality. By definition of λU (P ), min(λU (P )) = n − |UA | = |DP \ A|. Assume that A = {a1 , a1 + 1, · · · , ar−1 , ar−1 + 1} such that p1 ≤ a1 < a1 + 1 < · · · < ar−1 ≤ ps . Let B = {p1 , · · · , ps } \ A. Case 1. s is odd. In this case r = s+1 2 and |A| = 2(r − 1) = s − 1. Thus |B| = 1. If B = {p` } then, by definition of UA (see Definition 1.4), ` = 2i − 1, for some 1 ≤ i ≤ r. Thus DP \ UA = {(u, p2i−1 , k) | i ≤ u ≤ p2i−1 − i + 1 and 1 ≤ k ≤ n2i−1 }. Since P is a spread, p2i−1 = p1 + 2i − 1, and therefore by maximality of the size of UA , we get min(λU (P )) = |DP \ UA | = p1 min{n2i−1 | 1 ≤ i ≤ m} = µ(P ). So the proof is complete in this case. Case 2. s is even. In this case |B| = 2. Suppose that B = {p` , p`0 } such that ` < `0 . By definition of UA , ` must be odd and `0 must be even. If ` = 2i − 1 and `0 = 2j for i, j such that 1 ≤ i ≤ j ≤ r, then DP \ UA = {(u, p2i−1 , k) | i ≤ u ≤ p2i−1 − i + 1 and 1 ≤ k ≤ n2i−1 } ∪{(v, p2j , k 0 ) | j ≤ u ≤ p2j − j + 1 and 1 ≤ k 0 ≤ n2j }. Once again, we use the fact that P is a spread and that UA is an (r − 1)-U -chain with 14 maximum cardinality to get min(λU (P )) = |DP \ UA | = min{p1 n2i−1 + (p1 + 1)n2j | 1 ≤ i ≤ j ≤ r} = µ(P ). This completes the proof. 3  Smallest part of λ(P ) In this section we study the partition λ(P ) (see Definition 1.3) and determine its number of parts as well as its smallest part. Let D be a poset of cardinality n. Recall that an antichain in D is a subset in which no two elements are comparable. For k ∈ {0, 1, · · · , n}, let ak denote the maximum cardinality of a union of k antichains in D. Let λ̃k = ak − ak−1 for all k ≥ 1 and define λ̃(D) = (λ̃1 , λ˜2 , · · · ). In [6], C. Greene proves the following theorem. Theorem 3.1. ([6], see[4, Theorem 2.1]) Let D be a finite poset of cardinality n. Then λ(D) and λ̃(D) are conjugate partitions of n. This implies that λ̃1 is the number of parts of λ(D). It also shows that the smallest part of λ(D) is equal to the multiplicity of part λ˜1 in λ̃. In other words, min(λ(D)) is equal to the number of disjoint maximum antichains in D. It is this number that we will determine for the poset DP (Theorem 3.19). Lemma 3.2. Let P = (pns s , · · · , pn1 1 ) be a partition of n, such that ps > · · · > p1 and ni > 0 for 1 ≤ i ≤ s. 15 (a) Let p1 ≤ p < q ≤ ps and assume that (x, p, k) and (y, q, `) are two elements in DP . Then { (x, p, k), (y, q, `) } is an antichain if and only if x < y < q − p + x. (b) Assume that A and B are antichains in DP . Let p = max{pi | (xi , pi , ki ) ∈ A}, and q = min{qi | (yi , qi , `i ) ∈ B}. If p < q, (x, p, k) ∈ A and (y, q, `) ∈ B, then A ∪ B is an antichain if and only if {(x, p, k), (y, q, `)} is an antichain. Proof. Part (a) This is a consequence of Remark 1.2. Part (b) If A ∪ B is an antichain then {(x, p, k), (y, q, `)} ⊆ A ∪ B is obviously an antichain. Now assume that {(x, p, k), (y, q, `)} is an antichain. By Part (a), we have x < y < q − p + x. (3.1) If (x0 , p0 , k 0 ) ∈ A is such that (x0 , p0 , k 0 ) 6= (x, p, k), then by choice of p, p0 < p and, by Part (a), we must have x0 < x < p − p0 + x0 . (3.2) Similarly, if (y 0 , q 0 , `0 ) ∈ B is such that (y 0 , q 0 , `0 ) 6= (y, q, `), then q 0 > q and y < y 0 < q 0 − q + y. (3.3) Using Part (a) once again, we can conclude that each element of A is incomparable to each element of B, as desired.  16 Definition 3.3. Suppose that P = (pns s , · · · , pn1 1 ) is an s-spread. Let r = r(P ) and 0 ≤ t ≤ r. For 1 ≤ x ≤ p1 and k = (k1 , · · · , kt ) such that 1 ≤ ki ≤ n2i−1 , we define Ot (x, k) = {(x + i − 1, p2i−1 , ki ) | 1 ≤ i ≤ t }. 0 , · · · , k 0 ) with 1 ≤ ` ≤ n , we define Also, for 1 ≤ y ≤ p2 and k0 = (kt+1 j 2j r E t (y, k0 ) = {(y + j − 1, p2j , kj0 ) | t + 1 ≤ j ≤ r }. Note that Ot (x, k) contains only vertices from odd levels 1, 3, · · · , 2t − 1 and E t (y, k0 ) contains only vertices from even levels 2(t + 1), 2(t + 2) · · · , 2r. Lemma 3.4. Let P = (pns s , · · · , pn1 1 ) be an s-spread and r = r(P ). If A is a maximum antichain in DP , then A has r elements. Furthermore the following hold. (a) If s is odd then there exist x ∈ {1, 2, · · · , p1 } and k = (k1 , · · · , kr ) with 1 ≤ ki ≤ n2i−1 such that A = Or (x, k). (b) If s is even then there exist t ∈ {0, 1, · · · r}, x ∈ {1, 2, · · · , p1 },  ∈ {0, 1}, k = 0 , · · · , k 0 ) with 1 ≤ k 0 ≤ n , such (k1 , · · · , kt ) with 1 ≤ ki ≤ n2i−1 , and k0 = (kt+1 2j r j that A = Ot (x, k) ∪ E t (x + , k0 ). Proof. First note that since P is a spread, if 1 ≤ i ≤ s then pi = p1 + i − 1. Thus, by Lemma 3.2, Ot (x, k) ∪ E t (x + , k0 ) is an antichain, for all t ∈ {0, 1, · · · r}, all x ∈ {1, 2, · · · , p1 }, all  ∈ {0, 1}, all k = (k1 , · · · , kt ) with 1 ≤ ki ≤ n2i−1 , and all k0 = 0 , · · · , k0 0 r (kt+1 r(P ) ) with 1 ≤ kj ≤ n2j . This in particular implies that O (x, k) is an antichain in DP . Since the length of Or (x, k) is r = r(P ), we get |A| ≥ r. 17 We write A = {(xi , qi , ki ) | 1 ≤ i ≤ |A|} such that q1 ≤ · · · ≤ q|A| . By Lemma 3.2, we must have qi+1 ≥ qi + 2, for 1 ≤ i < |A|. Thus |A| ≤ ds/2e = r. Therefore, the length of the maximum antichain A must be exactly r. Part (a) Let s be odd. Then A has length r if and only if qi = p2i−1 for all i. By Lemma 3.2 we have xi < xi+1 < qi+1 − qi−1 + xi . Since P is a spread, qi+1 − qi = p2i+1 − p2i−1 = 2. Thus xi+1 = xi + 1. Obviously, 1 ≤ x1 ≤ p1 and A = Or (x1 , k) for k = (k1 , · · · , kr ). Part (b) Let s be even. Then A has length r if and only if there exists t ∈ {0, · · · , r} such that qi = p2i−1 for i ≤ t and qi = p2i for t < i. Also by Lemma 3.2 xi < xi+1 < qi+1 − qi + xi for all i. For i < t and i ≥ t + 1, we have qi+1 − qi = 2 and qt+1 − qt = 3. So xi = x1 + i − 1 if i ≤ t. As for xt+1 , it is either equal to xt + 1 or equal to xt + 2. Finally if i > t + 1 then xi = xt+1 + i − t − 1. Therefore A = Ot (x1 , k)∪E t (x1 +, k0 ), where k = (k1 , · · · , kt ) and k0 = (kt+1 , · · · , kr ) and  = xt+1 − xt − 1.  Proposition 3.5. Let P be a partition. All three associated partitions λ(P ), Q(P ) and λU (P ) have r(P ) parts (see Definition 2.3). Proof. As mentioned earlier, from [1, Proposition 2.4] and [3, Theorem 2.17], we know that Q(P ) has r(P ) parts. On the other hand, from the definition of a U -chain (Definition 1.4) it is clear that λU (P ) must have r(P ) parts. So it is enough to show that λ(P ) has r(P ) parts as well. 18 By Theorem 3.1, the number of parts of λ(P ) is equal to the maximum cardinality of an antichain in DP . Write the partition P as P` ∪· · ·∪ P1 such that each Pi is an si -spread and the biggest part of Pi is less than or equal to the smallest part of Pi+1 minus two. One obviously has rP = r(P` ) + · · · + r(P1 ). Let A be an antichain in DP and 1 ≤ i ≤ `. Then Ai = A ∩ DPi is an antichain in DPi . So by Lemma 3.4 |Ai | ≤ r(Pi ). Thus | A |=| A` | + · · · + | A1 |≤ r(P` ) + · · · + r(P1 ) = r(P ). On the other hand, we can take an appropriate union of maximum antichains in DPi to get a maximum antichain in DP . For example consider Or1 (1, k1 ) ∪ Or2 (1 + r1 , k2 ) ∪ · · · ∪ Or` (1 + r1 + · · · + r`−1 , k` ) ⊂ DP . By Lemma 3.2 this is an antichain in DP and has the desired cardinality r(P ).  Next we prove that min(λ(P )) = µ(P ). We will prove this by enumerating disjoint maximum antichains in DP . So our goal is to find a set A consisting of disjoint maximum antichains in DP such that A has the maximum cardinality possible. The following example shows that even if A is maximal, i.e. it is not strictly contained in any other set of disjoint maximum antichains of DP , its cardinality may be strictly smaller than the cardinality of another set of disjoint maximum antichains in DP . Example 3.6. Let P = (42 , 2, 12 ). The following sets A and B of disjoint maximum antichains are both maximal. A = {{(1, 1, 1), (2, 4, 1)}, {(1, 1, 2), (2, 4, 2)}, {(2, 2, 1), (3, 4, 1)}}. B= {{(1, 1, 1), (2, 4, 1)}, {(1, 1, 2), (3, 4, 1)}, {(1, 2, 1), (2, 4, 2)}, {(2, 2, 1), (3, 4, 2)}. 19 The following method gives an algorithm to find the maximum possible number of disjoint maximum antichains in DP . Definition 3.7. Let P = (pns s , · · · , pn1 1 ) be a partition and A be a subset of DP . For p1 ≤ p ≤ ps and 1 ≤ x ≤ p, define mA (x, p) = |{k ∈ N | (x, p, k) ∈ A, for some A ∈ A}|. In the example above, let A0 = {(1, 1, 1), (2, 4, 1), (1, 1, 2), (2, 4, 2)} be the union of the first two antichain in A and similarly, let B 0 = {(1, 1, 1), (2, 4, 1), (1, 1, 2), (3, 4, 1)}, be the union of the first two antichains in B. We have mA0 (2, 4) = 2, and mA (3, 4) = 0, but mB0 (2, 4) = 1, and mA0 (3, 4) = 1. Note that the antichains in B 0 are chosen “more uniformly” than the ones in A0 , and this affects the cardinality when they are extended to maximal sets of disjoint antichains, namely B and A. In fact, in Proposition 3.14 and Theorem 3.19, we give an algorithm for finding the maximum number of disjoint maximum antichains as “uniformly” as possible. In each step of our algorithm, we chose maximum antichain so that for each level pi , there exist non-negative integers m, d and d0 and d00 such that the sequence of non0 00 zero multiplicities mA (x, pi ) has either the form ((m + 1)d , md , (m + 1)d ) or the form 0 00 (md , (m + 1)d , md ). The following lemmas are key to our method. They are somewhat technical, so the reader not interested in these details could go directly to the proof of Proposition 3.14 and see how they are applied. Examples 3.9 and 3.11 also illustrate the Lemmas. 20 Lemma 3.8. Let P = ((p + g + 2)N , pM ) such that g ≥ 1. Suppose that η, θ, δ and d are integers such that 0 ≤ η < M , 1 ≤ θ ≤ N , 0 ≤ δ < p, and 0 ≤ d ≤ p − δ. Assume that (p + g)θ ≤ pη + δ. Consider the following subposet of DP : D = {(x, p, k) | 1 ≤ x ≤ d, 1 ≤ k ≤ η} ∪ {(x, p, k) | d + 1 ≤ x ≤ d + δ, 1 ≤ k ≤ η + 1} ∪ {(x, p, k) | d + δ + 1 ≤ x ≤ p, 1 ≤ k ≤ η} ∪ {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}. (3.4) Write g θ = pa + b, for a ≥ 0 and 0 ≤ b < p. (a) If 0 ≤ b ≤ δ and Y = {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}, and X = {(x, p, k) | x ∈ {1, · · · , d + δ − b, d + δ + 1, · · · , p} and k ∈ {1, · · · , θ + a}} ∪{(x, p, k) | x ∈ {d + δ − b + 1, · · · , d + δ} and k ∈ {1, · · · , θ + a + 1}}, then X ∪ Y is union of (p + g)θ disjoint antichains in DP , each of length 2. (b) If δ < b ≤ δ + d and Y = {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}, and X = {(x, p, k) | x ∈ {1, · · · , b − δ, d + 1, · · · , d + δ} and k ∈ {1, · · · , θ + a + 1}} ∪{(x, p, k) | x ∈ {b − δ + 1, · · · , d, d + δ + 1, · · · , p} and k ∈ {1, · · · , θ + a}}, then X ∪ Y is the union of (p + g)θ disjoint antichains in DP , each of length 2. (c) If δ + d < b and Y = {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}, and X = {(x, p, k) | x ∈ {1, · · · , d + δ, p − b + d + δ + 1, · · · , p} and k ∈ {1, · · · , θ + a + 1}} ∪{(x, p, k) | x ∈ {d + δ + 1, · · · , p − b + d + δ} and k ∈ {1, · · · , θ + a}}, 21 then X ∪ Y is the union of (p + g)θ disjoint antichains in DP , each of length 2. Proof. By the definition of DP , in each part of the Lemma the sets X and Y are each totally ordered. So we can write X = {X1 , · · · , X(p+g)θ } and Y = {Y1 , · · · , Y(p+g)θ }, such that X1 < · · · < X(p+g)θ and Y1 < · · · < Y(p+g)θ . We prove that Ac = {Xc , Yc } is an antichain for 1 ≤ c ≤ (p + g)θ. For c ∈ {1, · · · , (p + g)θ}, we have Yc = (yc + 1, p + g + 2, c − θ(yc − 1)) with y = d θc e, and we write Xc = (xc , p, kc ). By Lemma 3.2, to prove that Ac is an antichain, we need to show that xc ≤ yc ≤ xc + g. (3.5) Part (a) First note that since pη+δ ≥ (p+g)θ = pθ+pa+b, we get p(η−θ−a) ≥ b−δ ≥ −δ. Since δ < p and p(η − θ − a) is divisible by p, we must have η ≥ θ + a. So X ∪ Y ⊆ D. By definition of X the following equatities hold for c ∈ {1, · · · , (p + g)θ}:    (xc − 1)(θ + a) + kc    c= (xc − 1)(θ + a + 1) − d − δ + b + kc      (x − 1)(θ + a) + b + k c c if 1 ≤ xc ≤ d + δ − b, if d + δ − b + 1 ≤ xc ≤ d + δ, if d + δ + 1 ≤ xc ≤ p. Also kc ∈ {1, · · · , θ + a + 1} if d + δ − b + 1 ≤ xc ≤ d + δ and kc ∈ {1, · · · , θ + a}, otherwise. Thus we have (xc − 1)θ ≤ (xc − 1)(θ + a) < c ≤ xc (θ + a) + b ≤ xc θ + gθ. So we get xc − 1 < c θ ≤ xc + g, which implies the desired inequalities (3.5) and completes the proof of Part (a). Part (b) Since pη + δ ≥ (p + g)θ and b − δ > 0, we get p(η − θ − a) > 0. So η ≥ θ + a + 1 and therefore X ∪ Y ⊆ D. 22 By the definition of X , the following equalities hold    (xc − 1)(θ + a + 1) + kc        (xc − 1)(θ + a) + b − δ + kc c=   (xc − 1)(θ + a + 1) − d − δ + b + kc        (xc − 1)(θ + a) + b + kc for c ∈ {1, · · · , (p + 1)θ}: if 1 ≤ xc ≤ b − δ, if b − δ + 1 ≤ xc ≤ d, if d + 1 ≤ xc ≤ d + δ, if d + δ + 1 ≤ xc ≤ p. Also kc ∈ {1, · · · , θ + a + 1} if 1 ≤ xc ≤ b − δ or d + 1 ≤ xc ≤ d + δ, and kc ∈ {1, · · · , θ + a}, otherwise. Thus (xc − 1)θ ≤ (xc − 1)(θ + a) < c ≤ xc (θ + a) + b ≤ xc θ + gθ, and we have the desired inequalities (3.5). Part (c) Since δ ≤ d + δ < b, a similar argument to Part (b) shows that η ≥ θ + a + 1 and thus X ∪ Y ⊆ D. The proof is also similar to the proofs of the previous two parts. Here, for c ∈ {1, · · · , (p + g)θ} we have the following equalities:    (xc − 1)(θ + a + 1) + kc    c= (xc − 1)(θ + a) + d + δ + kc      (x − 1)(θ + a + 1) − p + b + k c c if 1 ≤ xc ≤ d + δ, if d + δ + 1 ≤ xc ≤ p − b + d + δ, if p − b + d + δ + 1 ≤ xc ≤ p. Also kc ∈ {1, · · · , θ + a} if d + δ + 1 ≤ xc ≤ p − b + d + δ, and kc ∈ {1, · · · , θ + a + 1} otherwise.  The following example illustrates the application of Lemma 3.8. 23 Example 3.9. Let p = 6, η = 4, d = 2, δ = 2, θ = 1, and let D be defined by Formula (3.4) of Lemma 3.8. So D = {(x, 6, k) | 1 ≤ x ≤ 2, 1 ≤ k ≤ 4} ∪ {(x, 6, k) | 3 ≤ x ≤ 4, 1 ≤ k ≤ 5} ∪ {(x, 6, k) | 5 ≤ x ≤ 6, 1 ≤ k ≤ 4} ∪ {(y + 1, 8 + g, 1) | 1 ≤ y ≤ 6 + g}. So pη + δ = 26 and if 1 ≤ g ≤ 20 then we will have (p + g)θ ≤ pη + δ and we can use Lemma 3.8 to find (p + g)θ = 6 + g disjoint antichains each of length 2. We write g = 6a + b such that 0 ≤ a and 0 ≤ b < 6. In Figure 4 we illustrate the vertices of X as a subset of level p = 6 of D for three different values of g. In the figures, vertices in level 6 of D are represented by dots arranged as in Definition 1.1. The hollowed vertices (◦) in each figure represent the vertices of D that are in X for the given value of g. (a) Let g = 7. Then a = 1 and b = 1, and we use the method in part (a) of the Lemma 3.8 to get X . So for all x 6= 4, there are exactly two vertices of the form (x, 6, k) in X , and there are exactly three vertices of the form (3, 6, k) in X . Note that in Lemma 3.8 the vertices of X are chosen from the bottom of each column, but in Figure 4 we are choosing them from the top of each column in D. This makes the similarity of the pattern of remaining vertices to the original pattern in D clearer without affecting the validity of the statement of the lemma. (b) Let g = 9. Then a = 1 and b = 3, and we use the method in part (b) of the Lemma 3.8 to get X . 24 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ • ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ • • • • • • ◦ • • • • • ◦ ◦ • • • ◦ • • • • • • • • • • • • • • • • • • g=7 g=9 g = 11 Figure 4: Vertices of X , labeled by ◦, as a subset of level 6 of D for different values of g. (c) Let g = 11. Then a = 1 and b = 5, and we use the method in part (c) of the Lemma 3.8 to get X . Lemma 3.10. Let P = ((p + g + 2)N , pM ) such that g ≥ 1. Suppose that η, θ,  and d are integers such that 1 ≤ η ≤ M , 1 ≤ θ ≤ N , 0 ≤  < p + g and 0 ≤ d ≤ p + g − . Assume that pη ≤ (p + g)θ − . Consider the following subposet of DP : D0 = {(x, p, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ η} ∪ {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ d, 1 ≤ k 0 ≤ θ} 2, k 0 ) | d + 1 ≤ y ≤ d + , 1 ≤ (3.6) k0 ∪ {(y + 1, p + g + ≤ θ − 1} ∪ {(y + 1, p + g + 2, k 0 ) | d +  + 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}. Write pη = (p + g)a − b such that a ≥ 1 and 0 ≤ b < p + g. (a) If 0 ≤ b <  and X = {(x, p, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ η}, and Y = {(y + 1, p + g + 2, k 0 ) | y ∈ {1, · · · , d +  − b, d +  + 1, · · · , p + g} and k 0 ∈ {1, · · · , a}} ∪{(y + 1, p + g + 2, k 0 ) | y ∈ {d +  − b + 1, · · · , d + } and k 0 ∈ {1, · · · , a − 1}}, 25 then X ∪ Y is union of pη disjoint antichains in DP , each of length 2. (b) If  ≤ b < d +  and X = {(x, p, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ η}, and Y = {(y + 1, p + g + 2, k 0 ) | y ∈ {1, · · · , b − , d + 1, · · · , d + } and k 0 ∈ {1, · · · , a − 1}} ∪{(y + 1, p + g + 2, k 0 ) | y ∈ {b −  + 1, · · · , d, d +  + 1, · · · , p + g} and k 0 ∈ {1, · · · , a}}, then X ∪ Y is union of pη disjoint antichains in DP , each of length 2. (c) If d +  ≤ b and X = {(x, p, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ η}, and Y = {(y + 1, p + g + 2, k 0 ) | y ∈ {1, · · · , d + , b0 + d +  + 1, · · · , p + g} and k 0 ∈ {1, · · · , a − 1}} ∪{(y + 1, p + g + 2, k 0 ) | y ∈ {d +  + 1, · · · , b0 + d + } and k 0 ∈ {1, · · · , a}}, such that b0 = p + g − b. Then X ∪ Y is union of pη disjoint antichains in DP , each of length 2. Proof. Since by assumption a ≥ 1 and b < p + g, we must have ga − b > −p. On the other hand, ga − b = p(η − a) is divisible by p. Thus ga − b ≥ 0 and therefore 0≤ b ≤ a ≤ η. g (3.7) We also have a p b g b = + =1− (1 − ). η p + g η(p + g) p+g gη (3.8) To prove the lemma, in each case we write X = {X1 , · · · , Xpη } and Y = {Y1 , · · · , Ypη }, such that X1 < · · · < Xpη and Y1 < · · · < Ypη , and prove that Ac = {Xc , Yc } is an antichain in DP for 1 ≤ c ≤ pη. 26 For c ∈ {1, · · · , pη}. We can write Xc = (xc , p, c − η(xc − 1)) with xc = d ηc e. We also write Yc = (yc + 1, p + g + 2, kc ). By Lemma 3.2, to prove that Ac is an antichain, we need to show that yc − g ≤ xc ≤ yc . (3.9) Part (a). We know that (p + g)θ −  ≥ pη = (p + g)a − b. So (p + g)(θ − a) ≥  − b ≥ −b. Since b < p + g, this implies that θ ≥ a and therefore X ∪ Y ⊆ D0 . By the definition of Y, the following equalities hold for c ∈ {1, · · · , pη}:    (yc − 1)a + kc    c= (yc − 1)(a − 1) + d +  − b + kc      (yc − 1)a − b + kc if 1 ≤ yc ≤ d +  − b, if d +  − b + 1 ≤ yc ≤ d + , if d +  + 1 ≤ yc ≤ p + g. Also kc ∈ {1, · · · , a − 1} if d +  − b + 1 ≤ yc ≤ d +  and kc ∈ {1, · · · , a}, otherwise. So for all c, we have a(yc − 1) − b < c ≤ a yc . Thus c a(yc − 1) − b < ≤ η η By inequalities 3.7,   a η   a η   a yc η yc ≤ yc . On the other hand, c −1 (yc − 1) = (yc − 1) − g( yp+g )(1 − ≥ (yc − 1) − g(1 − b gη ) b gη ) ( By Equation 3.8) ( Since 0 ≤ yc − 1 < p + g and b ≤ gη) = yc − g − 1 + ηb . Therefore yc − g − 1 < c η ≤ yc and the desired inequalities 3.9 follow. Part (b). Since (p + g)a − b = pη ≤ (p + g)θ −  and b < p + g, we get −(p + g) < −b ≤  − b ≤ (p + g)(θ − a). 27 So θ ≥ a and therefore X ∪ Y ⊆ D0 . By the definition of Y in this case, the following    (yc − 1)(a − 1) + kc        (yc − 1)a − b +  + kc c=   (yc − 1)(a − 1) + d − b +  + kc        (yc − 1)a − b + kc equalities hold for c ∈ {1, · · · , pη}: if 1 ≤ yc ≤ b − , if b −  + 1 ≤ yc ≤ d, if d + 1 ≤ yc ≤ d + , if d +  + 1 ≤ yc ≤ p + g. Also kc ∈ {1, · · · , a − 1} if 1 ≤ yc ≤ b −  or d + 1 ≤ yc ≤ d +  and kc ∈ {1, · · · , a}, otherwise. Now as in the proof of Part (a) above, it is enough to note that we have the inequalities a(yc − 1) − b < c ≤ a yc in this case as well. Part (c). The proof is similar to the proof of the previous two parts. First we note that (p + g)(θ − a) ≥ b −  > −(p + g). Therefore θ ≥ a and X ∪ Y ⊆ D0 . Then we use the definition of Y in this case to get    (yc − 1)(a − 1) + kc if 1 ≤ yc ≤ d + ,    c= (yc − 1)a − d −  + kc if d +  + 1 ≤ yc ≤ d +  + b0 ,      (y − 1)(a − 1) + b0 + k if d +  + b0 + 1 ≤ yc ≤ p + g. c We also have kc ∈ {1, · · · , a} if d++1 ≤ yc ≤ d++b0 and kc ∈ {1, · · · , a−1}, otherwise. It is then easy to see that the inequalities a(yc − 1) − b < c ≤ a yc hold in this case too.  Example 3.11. Let p = 2, g = 6, d = 2,  = 3 and θ = 2. Assume that D0 is the set defined by Formula 3.6. 28 ◦ ◦ ◦ ◦ ◦ • ◦ ◦ ◦ ◦ • • ◦ ◦ • • • ◦ • • • • • • • • • • • • • • • • • • • • • η=3 η=2 η=1 Figure 5: Vertices of Y, labeled by ◦, as a subset of level 8 of D0 for different values of η. Using the same notations as in Lemma 3.10, in Figure 5 we show the vertices of Y as a subset of level 8 of D0 , for a few different values of η. In Figure 5, each dot represents a vertex in level 8 of D0 , and for each value of η the vertices of Y are hollowed (◦) to distinguish them from other vertices of D0 (•). (a) If η = 3. Then 2η = 6 = 8(1) − 2 and a = 1 and b = 2. So we use the method in part (a) of Lemma 3.10 to obtain Y. (b) If η = 2. Then 2η = 4 = 8(1) − 4 and a = 1 and b = 4. Then we use the method in part (b) of Lemma 3.10 to obtain Y. (c) If η = 1. Then 2η = 2 = 8(1) − 6 and a = 1 and b = 6. Then we use the method in part (c) of Lemma 3.10 to obtain Y. Lemma 3.12. Let P = ((p + g + 2)N , pM ) such that g ≥ 1. Suppose that η, θ, δ and d are integers such that 0 ≤ η < M , 1 ≤ θ ≤ N , 0 ≤ δ < p, and 0 ≤ d ≤ p − δ. Consider the 29 following subposet of DP : D = {(x, p, k) | 1 ≤ x ≤ d, 1 ≤ k ≤ η} ∪ {(x, p, k) | d + 1 ≤ x ≤ d + δ, 1 ≤ k ≤ η + 1} ∪ {(x, p, k) | d + δ + 1 ≤ x ≤ p, 1 ≤ k ≤ η} ∪ {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}. (3.10) Let µ = min{pη + δ, (p + g)θ}. Then there exists a set A of disjoint antichains of length 2 in D such that the following hold for Ā = D \ A: (a) If (p + g)θ ≤ pη + δ then (i) For all 1 ≤ y ≤ p + g, mĀ (y + 1, p + 3) = 0; and (ii) There exist integers η 0 , δ 0 and d0 , satisfying 0 ≤ η 0 , 0 ≤ δ 0 < p and 0 ≤ d0 ≤ p − δ 0 , such that mĀ (x, p) = (b) If pη + δ ≤ (p + g)θ then    η0 + 1   η0 if d0 + 1 ≤ x ≤ d0 + δ 0 , otherwise. (i) For all 1 ≤ x ≤ p, mĀ (x, p) = 0; and (ii) There exist integers θ0 , 0 and d0 , satisfying 0 < θ0 , 0 ≤ 0 < p + g and 0 ≤ d0 ≤ p + q − 0 , such that mĀ (y, p + 3) =    θ0 − 1   θ0 30 if d0 + 1 ≤ y ≤ d0 + 0 , otherwise. Proof. Part (a) This is a consequence of Lemma 3.8 which also gives the following values for η 0 , d0 and δ 0 . 0≤b≤δ δ <b≤δ+d η0 δ+d<b η−θ−a η−θ−a−1 η−θ−a−1 d0 d b−δ d δ0 δ−b p−b+δ p−b+δ Here gθ = pa + b such that a ≥ 0 and 0 ≤ b < p. Part (b) For d + 1 ≤ c ≤ d + δ, let Ac = {(c, p, 1), (c + 1, p + g + 2, 1)}. Then {Ac | d + 1 ≤ c ≤ d + δ} is a set of δ disjoint antichains of length 2 in D. Let D0 = D \ {v | v ∈ Ac , for some d + 1 ≤ c ≤ d + δ}. So the desired statement is a consequence Lemma 3.10 with  = δ and the same d. We also get the following values for θ0 , d0 and 0 . 0≤b<δ δ ≤b<δ+d δ+d≤b θ0 θ−a θ−a+1 θ−a+1 d0 d b−δ d 0 δ−b p+g−b+δ p+g−b+δ Here pη = (p + g)a − b such that a ≥ 1 and 0 ≤ b < p + g.  Lemma 3.13. Let P = ((p + g + 2)N , pM ) such that g ≥ 1. Suppose that η, θ,  and d are integers such that 1 ≤ η ≤ M , 1 ≤ θ ≤ N , 0 ≤  < p + g and 0 ≤ d ≤ p + g − . Consider 31 the following subposet of DP : D0 = {(x, p, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ η} ∪ {(y + 1, p + g + 2, k 0 ) | 1 ≤ y ≤ d, 1 ≤ k 0 ≤ θ} ∪ {(y + 1, p + g + 2, k 0 ) | d + 1 ≤ y ≤ d + , 1 ≤ k 0 ≤ θ − 1} ∪ {(y + 1, p + 3, k 0 ) | d +  + 1 ≤ y ≤ p + g, 1 ≤ k 0 ≤ θ}. (3.11) Let µ = min{pη, (p + g)θ − }. Then there exists a set A of disjoint antichains of length 2 in D0 such that the following hold for Ā = D0 \ A: (a) If pη ≤ (p + g)θ −  then (i) For all 1 ≤ x ≤ p, mĀ (x, p) = 0; and (ii) There exist integers θ0 0 and d0 , satisfying 0 < θ0 , 0 ≤ 0 < p + g and 0 ≤ d0 ≤ p + g − 0 such that mĀ (y + 1, p + g + 2) = (b) If (p + g)θ −  ≤ pη then    θ0 − 1   θ0 if d0 + 1 ≤ y ≤ d0 + 0 , otherwise. (i) For all 1 ≤ y ≤ p + g, mĀ (y + 1, p + g + 2) = 0; and (ii) There exist integers η 0 , δ 0 and d0 , satisfying 0 ≤ η 0 , 0 ≤ δ 0 < p, and 0 ≤ d0 ≤ p − δ 0 , such that mĀ (x, p) =    η0 + 1   η0 32 if d0 + 1 ≤ x ≤ d0 + δ 0 , otherwise. Proof. Part (a) This is a consequence of Lemma 3.10 which also gives the following values for θ0 , d0 and 0 . 0≤b< ≤b<+d +d≤b θ0 θ−a θ−a+1 θ−a+1 d0 d b− d 0 −b p+g−b+ p+g−b+ Here pη = (p + g)a − b such that a ≥ 1 and 0 ≤ b < p + g. Part (b) Case 1.  ≥ g. Then for c ∈ {1, · · · , d}, let Ac = {(c − 1, p, 1), (c, p + g + 2, 1)} and for c ∈ {d +  + 1, · · · , p + g}, let Ac = {(c − g − 1, p, 1), (c, p + g + 2, 1)}. Then {Ac | c ∈ {1, · · · , d,  + d + 1, · · · , p + g}} is a set of (p + g − ) disjoint antichains of length 2 in D0 . Let D = D0 \ {v | v ∈ Ac , for some c ∈ {1, · · · , d,  + d + 1, · · · , p + g}}. So the desired statement of Part (b) is a consequence of Lemma 3.8 with δ =  − g and the same d. We also get the following values for η 0 , d0 and δ 0 . 0≤b+g ≤ <b+g ≤+d +d<b+g η0 η−θ−a η−θ−a−1 η−θ−a−1 d0 d b−−g d δ0 −g−b p−b+−g p−b+−g Here gθ = pa + b such that a ≥ 0 and 0 ≤ b < p. Case 2.  < g. • If d > g − , then |{d +  + 1, · · · , p + g}| < p, and for any c ∈ {d +  + 1, · · · , p + g}, Ac = {(c−g, p, 1), (c+1, p+g +2, 1)} is an antichain. Since  < g, for c ∈ {g −+1, · · · , d}, Ac = {(c+−g, p, 1), (c+1, p+g+2, 1)} is a antichain, as well. Finally, for c ∈ {1, · · · , g−}, 33 we match the vertices (c + 1, p + g + 2, 1) with vertices in level p, from left to right. To do this, we write c = pkc + `c such that kc ≥ 0 and 1 ≤ `c ≤ p. Then `c ≤ c ≤ g −  ≤ `c + g. (3.12) Ac = {(`c , p, kc + 1), (c + 1, p + g + 2, 1)} (3.13) So is an antichain for any c ∈ {1, · · · , g − }. Now if we set D = D0 \ {v | v ∈ Ac for some c ∈ {1, · · · , d, d +  + 1, · · · , p + g}}, then the desired statement of Part (b) is a consequence of Part (a) of Lemma 3.12 above applied to D. Here η is η − k − 1, d = ` and δ = p − `, where g −  = pk + ` such that k ≥ 0 and 1 ≤ ` ≤ p. • If d ≤ g − , then for all c ∈ {1, · · · , d}, we match the vertices (c + 1, p + g + 2, 1) with vertices in level p, from left to right as we showed in Equation 3.13 above. Suppose that d = pk + `, such that k ≥ 0 and 1 ≤ ` ≤ p. Then Ad = {(`, p, k + 1), (c + 1, p + g + 2, 1)}. Since ` ≤ d ≤ g − , we have ` ≤ d ≤ d +  ≤ g ≤ ` + g. So for each c ∈ {d +  + 1, · · · , d +  + p − `}, the set Ac = {(` + c − d − , p, k + 1), (c + 1, p + g + 2, 1)} is an antichain. Finally, we will match vertices (c + 1, p + g + 2, 1) for all c ∈ {d +  + p − ` + 1, · · · , p + g} with vertices in the level p, from right to left. Note that there are g − d −  + ` ≤ g such c’s, and starting from right the matching will be similar (dual) to the one explained in Equation 3.13 above. Let {Ac | c ∈ {d +  + p − b + 1, · · · , p + g}} be the set of such antichains and define D = D0 \ {v | v ∈ Ac for some c ∈ {1, · · · , d, d +  + 1, · · · , p + g}}. 34 The proof is then complete once Part (a) of Lemma 3.12 above is applied to D with η equal to η − k 0 − 2, d = 0 and δ = `0 − 1, where g −  = pk 0 + `0 such that k 0 ≥ 0 and 1 ≤ `0 ≤ p.  Now we have the necessary tools to prove the following proposition. Proposition 3.14. Let the partition P of n be a spread. Then min(λ(P )) = µ(P ). Proof. Since λ(P ) ≥ λU (P ), and λ(P ) and λU (P ) have the same number of parts (by Proposition 3.5), we get min(λ(P )) ≤ min(λU (P )). So by Theorem 2.10, min(λ(P )) ≤ µ(P ). (3.14) Using Theorem 3.1, we prove the reverse inequality by finding µ(P ) disjoint maximum antichains in DP . Assume that P is an s-spread and write P = (pns s , · · · , pn1 1 ), with pi = p1 + i − 1 and ni > 0, for 1 ≤ i ≤ s. Let r = r(P ). Case 1. s is odd. s+1 Then r = and µ(P ) = p1 · min{n2i−1 | i = 1, · · · , r}. 2 For a positive integer j, satisfying 1 ≤ j ≤ min{n2i−1 | i = 1, · · · , r}, let j = (j, · · · , j). Recall from Definition 3.3 that for 1 ≤ x ≤ p1 , Or (x, j) = {(x + i − 1, p2i−1 , j) | 1 ≤ i ≤ r }. Note that Or (x, j) ∩ Or (y, k) = ∅ if x 6= y or j 6= k. Varying x and j, we get µ(P ) disjoint maximum antichains (each of length r) in DP , as desired. 35 Case 2. s is even. s Then r = and µ(P ) = min{p1 n2i−1 + (p1 + 1)n2j | 1 ≤ i ≤ j ≤ r}. Let p = p1 . First 2 note that by Lemma 3.4, a vertex (x, p2i−1 , k) can belong to a maximum antichain only if i ≤ x ≤ p + i − 1, and a vertex (y, p2j , k) can belong to a maximum antichain only if j ≤ y ≤ p + j. So we are going to restrict our study to the subposet D of DP that only  includes such vertices. So D = (x, pi , k) ∈ DP | d 2i e ≤ x ≤ p + b 2i c . To complete the proof, we give an algorithm to construct a set A of disjoint maximum antichains satisfying the following two properties for some integers 1 ≤ b ≤ t ≤ r. (i) If Ā = D \ A then mĀ (x, p2b−1 ) = 0 for all x ∈ {b, · · · , p + b − 1}, and mĀ (y, p2t ) = 0 for all y ∈ {t, · · · , p + t}, i.e. every element of D in level 2b − 1 or 2t belongs to an antichain in A; and (ii) For all A ∈ A if mA (x, p2b−1 ) > 0 for some x ∈ {b, · · · , p+b−1} then mA (y, p2t ) = 0 for all y ∈ {t, · · · , p + t}, i.e. no antichain in A contains vertices from both levels 2b − 1 and 2t. Set o := min{n2i−1 | 1 ≤ i ≤ r}, e := min{n2j | 1 ≤ j ≤ r}, and A := {Or (x, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ o and k = (k, · · · , k)} ∪ {E 0 (y, k) | 1 ≤ y ≤ p + 1, 1 ≤ k ≤ e and k = (k, · · · , k)}. Then A satisfies the two conditions (i) and (ii) above if and only if there exists b and t such that b ≤ t, n2b−1 = o and n2t = e. So the proof is complete if this is the case. Otherwise, set D := D \ A and t := max{j | 1 ≤ j ≤ r, mD (y, p2j ) = 0, for all y}. 36 In other words, we choose t so that the level 2t is the highest even level which is empty in D. By assumption mD1 (x, p2i−1 ) > 0 for all i ∈ {1, · · · , t}. By the choice of t we have mD (y, p2j ) > 0 for all j ∈ {t + 1, · · · , r}. Note that, by the definition of A, for each ` ∈ {1, · · · , s}, mD (x, p` ) is the same for all x. We are now going to extend A by adding antichains of the form Ot (x, k) ∪ E t (y, k0 ). Set o := min{mD (x, p2i−1 ) | 1 ≤ i ≤ t}, and e := min{mD (y, p2j ) | t + 1 ≤ j ≤ r}. By Lemma 3.2, the problem of finding antichains of form Ot (x, k) ∪ E t (y, k0 ) in D can be reduced to the problem of finding antichains of length 2 in DQ1 for Q1 = ((p + 3)e , po ). Case 2-1. po ≤ (p + 1)e. Then we use Lemma 3.13 to find po disjoint antichains of the form Ot (x, k)∪E t (y, k0 ) in D and extend A by adding these antichains. Let b ∈ {1, · · · , t} be such that mD (x, p2b−1 ) = o. Then A satisfies Conditions (i) and (ii) above the proof is complete in this case. Case 2-2. po > (p + 1)e. Then we use Lemma 3.12, to find (p + 1)e disjoint antichains of the form Ot (x, k) ∪ E t (y, k0 ) in D and extend A by adding these antichains. Now we set D = D \ A. By Lemma 3.12, for each i ∈ {1, ·  · · , t}, there exist integers η(i) ≥ 0 and such that   η(i) + 1 if i ≤ x ≤ i + δ − 1 0 ≤ δ < p such that mD2 (x, p2i−1 ) = . Also for   η(i) if i + δ ≤ x ≤ i + p − 1. all j ∈ {t + 1, · · · , r}, each mD (y, p2j ) decreases by e. Now we replace t by a strictly larger value as follows. t := max{j | 1 ≤ j ≤ r, mD (y, p2j ) = 0, for all y}, o := min{η(i) | 1 ≤ i ≤ t}, and e := min{mD (y, p2j ) | t + 1 ≤ j ≤ r}. 37 Case 2-2-1. po + δ ≤ (p + 1)e. Then we use Lemma 3.13 to extend A by adding (po + δ) disjoint antichains of type Ot (x, k) ∪ E t (y, k0 ) in D. Let b is an integer in {1, · · · , t} such that η(i) = o. Then A satisfies both conditions (i) and (ii) and the proof is complete in this case. Case 2-2-2. po + δ > (p + 1)e. Then we use Lemma 3.13 to extend A by adding (p + 1)e disjoint antichains of type Ot (x, k) ∪ E t (y, k0 ) in D. We then set D := D \ A and repeat as in Case 2-2. Since the value of t is strictly increasing by repeating the process, it will eventually terminate by producing the desired set A.  We summarize the proof of Proposition 3.14 in the following algorithm. Algorithm 3.15. Let P = (pns s , · · · , pn1 1 ) be a spread with pi = p1 + i − 1 and ni > 0 for 1 ≤ i ≤ s. Set r= r(P ) = d 2s e; p = p1 ; D = {(x, pi , k) | 1 ≤ i ≤ s, 1 ≤ k ≤ ni , d 2i e ≤ x ≤ p + b 2i c}; o= min{n2i−1 | 1 ≤ i ≤ r}; e0 = min{n2j | 1 ≤ j ≤ r}; and A = {Or (x, k) | 1 ≤ x ≤ p, 1 ≤ k ≤ o and k = (k, · · · , k)}∪ {E 0 (y, k) | 1 ≤ y ≤ p + 1, 1 ≤ k ≤ e0 and k = (k, · · · , k)}. Input: An s-spread P = (pns s , · · · , pn1 1 ). 38 Output: A set A consisting of µ(P ) disjoint maximum antichains in DP . • D := D \ A. • t := max{j | 1 ≤ j ≤ r and mD (y, p2j ) = 0 for all y}. • For 1 ≤ i ≤ t, let η(i) ≥ 0 and 0 ≤ δ < p be such that    η(i) + 1 if i ≤ x ≤ i + δ − 1, mD (x, p2i−1 ) =   η(i) if i + δ ≤ x ≤ i + p − 1. • o := min{η(i) | 1 ≤ i ≤ t}. • e := min{mD (y, p2j ) | t + 1 ≤ j ≤ r}. • If po + δ = 0 then End. • If 0 < po + δ ≤ (p + 1)e then A := A ∪ {all Ot (x, k) ∪ E t (y, k0 ) obtained by Lemma 3.13.}. End. • If po + δ > (p + 1)e then repeat with A := A ∪ {all Ot (x, k) ∪ E t (y, k0 ) obtained by Lemma 3.12.}. Remark 3.16. Note that there are alternative algorithms to the one discussed in the proof above. In the proof we used Lemmas 3.13 and 3.12 with d = 0, for simplicity. We can also follow an alternative algorithm taking antichains of type t − 1, where t is the lowest odd level that becomes empty after each step. The following corollary summarizes some of the nice properties of the set of antichains constructed in the proof of Proposition 3.14. Recall from Equation (2.4) in Definition 2.6, for a spread P with smallest part p, µ(P ) = min{pn2i−1 + (p + 1)n2j | 1 ≤ i ≤ j ≤ r(P )}. Corollary 3.17. Let P be a spread with smallest part p and biggest part q and r = r(P ). Suppose that µ(P ) = pm1 +(p+1)m2 . Then we can find a set A of µ(P ) disjoint maximum 39 antichains such that (a) There exist non-negative integers a and δ such that δ < p, and    a if 1 ≤ x ≤ δ, mA (x, p) =   a+1 if δ + 1 ≤ x ≤ p. (b) There exists a non-negative integer b such that mA (y, p + 1) = b, for 1 ≤ y ∈≤ p + 1. (c) There exists a non-negative integer c such that mA (x, q − 1) = c, for all d q−p 2 e ≤ x ≤ r + p − 1. (d) There exist non-negative integers d and  such that  ≤ p, and    d+1 if r ≤ y < r + , mA (y, q) =   d if r +  ≤ y ≤ d q−p 2 e + p. By symmetry of DP , we also have the following corollary. Corollary 3.18. Let P be a spread with smallest part p and biggest part q and r = r(P ). Suppose that µ(P ) = pm1 +(p+1)m2 . Then we can find a set A of µ(P ) disjoint maximum antichains such that (a) There exist non-negative integers a and δ such that δ < p, and    a+1 if 1 ≤ x ≤ δ, mA (x, p) =   a if δ + 1 ≤ x ≤ p. (b) There exists a non-negative integer b such that mA (y, p + 1) = b, for 1 ≤ y ∈≤ p + 1. (c) There exists a non-negative integer c such that mA (x, q − 1) = c, for all d q−p 2 e ≤ x ≤ r + p − 1. 40 (d) There exist non-negative integers d and  such that  ≤ p, and    d if r ≤ y < r + , mA (y, q) =   d+1 if r +  ≤ y ≤ d q−p 2 e + p. We now generalize Proposition 3.14 to an arbitrary partition P . Theorem 3.19. For any partition P of n, min(λ(P )) = µ(P ). Proof. As mentioned in the proof of Proposition 3.14 above, to prove the theorem it is enough to find µ(P ) disjoint maximum antichains in DP . Write P = P` ∪ · · · ∪ P1 such that each Pk is a spread and the biggest part of Pk is less than or equal to the smallest part of Pk+1 minus two, for all 1 ≤ k < `. We prove the claim by induction on `. If ` = 1, then P is a spread and the equality is proved in Proposition 3.14 above. Now suppose that ` > 1 and assume that the desired equality holds for any union of ` − 1 or fewer spreads. Consider the partition Q̄ = (P` , · · · , P2 ) and let DQ be the subposet of DQ̄ obtained by removing r = r(P1 ) vertices from each end of each row of DQ̄ (so the corresponding partition Q = Q̄−2r(P1 )). By the inductive hypothesis, there are µ(P1 ) disjoint antichains, each of length r, in DP1 . There are also µ(Q) disjoint antichains, each of length r(Q) = r(Q̄), in DQ . By Definition 2.6, µ(P ) = min{µ(P1 ), µ(Q)}. Every maximum antichain in DP is a union of a maximum antichain in DP1 and an antichain corresponding to a maximum antichain in DQ . By Lemma 3.2 and Corollaries 3.17 and 3.18, to complete the proof, it is enough to prove the following claim: 41 Claim. Let P = ((q + 3)D , (q + 2)C , pB , (p − 1)A ) with q ≥ p. Assume that a, b, c, d,  and δ are non-negative integers such that a ≤ A, b ≤ B, c ≤ C, d ≤ D, δ < q, and  < p. We define the subposet E of DP as follows: E = A ∪ B ∪ C ∪ D, such that A = {(x, p − 1, k) | 1 ≤ x ≤ p − 1, 1 ≤ k ≤ a} B = {(x, p, k) | 1 ≤ x ≤ , 1 ≤ k ≤ b + 1} ∪ {(x, p, k) |  < x ≤ p, 1 ≤ k ≤ b} C = {(y + 1, q, k) | 1 ≤ y ≤ δ, 1 ≤ k ≤ c + 1} ∪ {(y + 1, q, k) | δ < y ≤ q, 1 ≤ k ≤ c} D = {(y + 1, q + 1, k) | 1 ≤ y ≤ q + 1, 1 ≤ k ≤ d}. Then there are µ(P ) disjoint antichains of length 2 in E. We begin by matching vertices {(x, p, 1) | 1 ≤ x ≤ } from B with vertices {(y + 1, q, k) | 1 ≤ y ≤ δ} from C, and removing those antichains. There will be min{, δ} such antichains. Then we remove all of the vertices of such antichains to obtain subposets B1 ⊆ B and C1 ⊆ C. Next we match vertices from B1 and C1 to obtain more antichains of length 2. If q = p, then there is only a trivial matching of these vertices. If q > p, then we can apply the matching methods of Lemma 3.12 (if  ≤ δ) or Lemma 3.13 (if  ≥ δ) to obtain disjoint length 2 antichains in B1 ∪ C1 . Now remove all the vertices belonging to any of such antichains to get subposets B2 ⊆ B1 and C2 ⊆ C1 . Then B2 = ∅ or C2 = ∅. If B2 = ∅, apply Lemma 3.12 or Lemma 3.13 to C2 ∪A to obtain more disjoint antichains of length 2. If this uses up all vertices in A, then the proof is complete. Otherwise, to complete the proof, we apply the Lemmas one more time, this time to the remaining vertices A1 ∪ D. 42 Ti: Ei: Oi: Figure 6: Disjoint maximum antichains in DP1 for P1 = (62 , 5, 4, 32 ). If C2 = ∅, we apply Lemma 3.12 or Lemma 3.13 to B2 ∪ D. If this uses up all vertices in D, then the proof is complete. Otherwise, we will need to apply the Lemmas one more time, this time to the remaining vertices A ∪ D1 to complete the proof.  Example 3.20. Let P1 = (62 , 5, 4, 32 ). Then µ(P1 ) = min{3(2) + 4(1), 3(2) + 4(2), 3(1) + 4(2)} = 10. Using a method similar to the one discussed in the proof of Proposition 3.14, we can get the following 10 disjoint maximum antichains (length-2) in DP1 (see Figure 6). O1 = {(1, 3, 1), (2, 5, 1)}, O2 = {(2, 3, 1), (3, 5, 1)}, O3 = {(3, 3, 1), (4, 5, 1)}, E1 = {(1, 4, 1), (2, 6, 1)}, E1 = {(2, 4, 1), (3, 6, 1)}, E3 = {(3, 4, 1), (4, 6, 1)}, E4 = {(4, 4, 1), (5, 6, 1)}, T1 = {(1, 3, 2), (2, 6, 2)}, T2 = {(2, 3, 2), (3, 6, 2)}, T3 = {(3, 3, 2), (4, 6, 2)}. Now suppose that P2 = (10, 9) and P = (P2 , P1 ). Then µ(P ) = min{10, 9 − 2r(P1 ) + 10 − 2r(P1 ))} = 10. 43 As discussed in the proof of Theorem 3.19, to get 10 maximum antichains in DP , we will match the top vertex of a maximum antichain of DP1 , with a vertex in level 9 or 10. Applying Lemma 3.8(a), with p = 4, g = 1, η = 1, d = 0, δ = 3 and θ = 1, we get the following matching of vertices in levels 6 and 9. (see Figure 7).    {(4, 6, 2), (6, 9, 1)} A6,9 =   {(2, 6, 1), (3, 9, 1)}, {(3, 6, 1), (4, 9, 1)}, {(4, 6, 1), (5, 9, 1)}, {(5, 6, 1), (7, 9, 1)} We then need to match the remaining vertices in level 6 with vertices in level 10. We do      . this using Lemma 3.12(b) with p = 4, g = 2, η = 0, d = 0, δ = 2 and θ = 1 (see the dashed grouping in Figure 7). We get A6,10 =   {(2, 6, 2), (3, 10, 1)}, {(3, 6, 2), (4, 10, 1)} Finally, we match the vertices in level 5, with vertices left in level 10, using Lemma 3.10(c), with p = 3, g = 3, η = 1, d = 0,  = 2 and θ = 1. (See Figure 7.) We get   A5,10 = {(2, 5, 1), (5, 10, 1)}, {(3, 5, 1), (6, 10, 1)}, {(4, 5, 1), (7, 10, 1)} . Thus we obtain the following 10 disjoint antichains, each of length 3, in DP : {(1, 3, 1), (2, 5, 1), (5, 10, 1)}, {(2, 3, 1), (3, 5, 1), (6, 10, 1)}, {(3, 3, 1), (4, 5, 1), (7, 10, 1)}, {(1, 4, 1), (2, 6, 1), (3, 9, 1)}, {(2, 4, 1), (3, 6, 1), (4, 9, 1)}, {(3, 4, 1), (4, 6, 1), (5, 9, 1)}, {(4, 4, 1), (5, 6, 1), (7, 9, 1)}, {(1, 3, 2), (2, 6, 2), (3, 10, 1)}, {(2, 3, 2), (3, 6, 2), (4, 10, 1)}, {(3, 3, 2), (4, 6, 2), (6, 9, 1)}. Corollary 3.21. For any partition P , min(λ(P )) = min(λU (P )) = µ(P ). Proof. Combine Theorem 2.10 and Theorem 3.19. 44  . A6,9 =    {(4, 6, 2), (6, 9, 1)}      {(2, 6, 1), (3, 9, 1)}, {(3, 6, 1), (4, 9, 1)}, {(4, 6, 1), (5, 9, 1)}, {(5, 6, 1), (7, 9, 1)}   . We then need to match the remaining vertices in level 6 with vertices in level 10. We do this using Lemma 3.12(b) with p = 4, g = 2, η = 0, d = 0, δ = 2 and θ = 1 (see the dashed grouping in Figure 7). We get A6,10 = � � {(2, 6, 2), (3, 10, 1)}, {(3, 6, 2), (4, 10, 1)} . A6,9 A6,10 A5,10 Finally, we match the vertices in level 5, with vertices left in level 10, using Lemma Figure 7: Matching antichains in DP1 with antichains in DP2 . 44 4 Jordan partition of the generic commuting nilpotent matrix Let D be a finite poset with cardinality n. Recall that the incidence algebra I(D) of D is defined as the subalgebra of Matn (k) consisting of all matrices M with Mij 6= 0 if and only if i ≤ j in D. If D has no loops, a nilpotent element M of I(D) is called generic if for all i < j the entries Mij are independent transcendentals over the field k (see [4]). In [13] and [5], M. Saks and E. Gansner independently proved that if chark = 0 then λ(D) is the Jordan partition of a generic matrix in the incidence algebra I(D). The same proofs (also see [4, Theorem 6.1]) in fact show that over an infinite field k, the Jordan partition of any nilpotent matrix M ∈ I(D) is dominated by λ(P ) (see [8, Theorem B Equation (1.7)]). Now if we fix a nilpotent matrix B ∈ Matn (k) in Jordan canonical form with Jordan partition P , then a generic element of UP , is a nilpotent matrix in the incidence algebra I(DP ) of the poset DP (see [3, Equation 2.18]). Thus Q(P ) ≤ λ(P ). 45 (4.1) Theorem 4.1. Let k be an infinite field and B ∈ Matn (k) a nilpotent matrix with Jordan partition P . Then min(Q(P )) = min(λU (P )) = min(λ(P )) = µ(P ). Proof. First note that by Equation 4.1 above and [8, Theorem 3.9], we have λU (P ) ≤ Q(P ) ≤ λ(P ). (4.2) Therefore, since by Proposition 3.5, the number of parts of λU (P ), Q(P ) and λ(P ) are the same, we get min(λ(P )) ≤ min(Q(P )) ≤ min λU (P ) (see Definition 1.7). So the proof is complete by the equality min(λ(P )) = min λU (P ) of Corollary 3.21.  Remark 4.2. Theorem 4.1 and Definition 2.6 of µ give an algorithm to find the smallest part of Q(P ) for any partition P . Corollary 4.3. Let P and P 0 be two partitions such that the largest part of P is smaller than the smallest part of P 0 minus 1. Then min(Q(P 0 ∪ P )) = min{µ(P ), µ(P 0 − 2r(P ))}. Proof. This is a consequence of Theorem 4.1 and Lemma 2.7.  Remark 4.4. The equality in Corollary 4.3 does not hold if the largest part of P is not smaller than the smallest part of P 0 minus 1. For example, let P = (2, 1) and P 0 = (32 ). Then µ(P 0 ∪ P ) = 1 while µ(P ) = 3 and µ(P 0 − 2r(P )) = µ((12 )) = 2. Next we give an explicit formula for Q(P ), when it has at most three parts. We first recall the following result of P. Oblak proved over real numbers and then extended to an arbitrary infinite field by A. Iarrobino and the author. 46 Proposition 4.5. (See [11, Theorem 13] and [8, Corollary 3.10]) Let P = (. . . , pnp , . . .) be a partition of P . The largest part–the index– of Q(P ), i(Q(P )) is i(Q(P )) = max{ana + (a + 1)na+1 + 2 X p>a+1 np | a ∈ N}. Note that i(Q(P )) is the length of the longest simple U -chain in DP (see Equation (1.1)). So if r(P ) = 1, i.e. P is an almost rectangular partition, thenQ(P ) = λ(P ) = Ob(P ) = (n). If r(P ) = 2, then by Proposition 4.5 we have Q(P ) = λ(P ) = (i(Q(P )), n − i(Q(P ))). Corollary 4.6. Let P be a partition of n. If r(P ) = 3, then Q(P ) = (i(Q(P )), n − i(Q(P )) − µ(P ), µ(P )). Proof. Recall that µ(P ) defined by Definition 2.6 is, by Theorem 4.1, the smallest part of Q(P ). So the proof is clear by Proposition 4.5.  Example 4.7. Let P = (82 , 7, 6, 52 , 3, 24 ). Then r(P ) = 3 and Q(P ) has 3 parts. By Proposition 4.5, i(Q(P )) = |U{2,3} | = |U{7,8}| = 23. We can also write P = P2 ∪ P1 where P2 = (82 , 7, 6, 52 ) and P1 = (3, 24 ) are both spreads. By Definition 2.6, we have µ(P1 ) = 11, µ(P2 − 2) = 10, (See Example 3.20), and µ(P ) = min{µ(P2 − 2), µ(P1 )} = 10. Therefore Q(P ) = (23, 17, 10). The enumeration of antichains in DP and their comparison to parts of λU (P ) can also lead to explicit formulas for Q(P ) when it has more than three parts. The following statement gives one such formula for special families of partitions P with r(P ) = 4. 47 Proposition 4.8. Let P 0 be a partition such that Q(P 0 ) has three parts, and let P 00 be an almost rectangular partition. Suppose that the largest part of P 00 is smaller than the smallest part of P 0 minus 1. If µ(P 00 ) ≤ µ(P 0 − 2) then Q(P 0 ∪ P 00 ) = Q(P 0 ) ∪ Q(P 00 ). Proof. Suppose that P 0 is a partition of n and P 00 is a partition of m. Let i = i(Q(P 0 )) and µ = µ(P 0 ). Then by Corollary 4.6 we have λ(P 0 ) = Q(P 0 ) = λU (P 0 ) = (i, n − i − µ, µ). Also, since P 00 is an almost rectangular partition, we have Q(P 00 ) = (m). By Lemma 2.7, we have µ(P 0 ∪ P 00 ) = m. By Definition 1.5 of λU , in this case we have λU (P 0 ∪ P 00 ) = (i, n − i − µ, µ, m). We also have λU (P 0 ∪ P 00 ) ≤ λ(P 0 ∪ P 00 ). On the other hand by Theorem 3.19, DP 0 contains µ disjoint antichains of length 3, and DP 0 ∪P 00 contains m disjoint antichains of length 4. Thus if we remove elements of all those length-4 antichains from DP 0 ∪P 00 we can still find µ − m disjoint antichains of length 3 in DP 0 ∪P 00 . Let λ(P 0 ∪ P 00 ) = (i, a, b, m). By Theorem 3.1, we must have b ≥ µ. Thus i + a = n − b ≤ n − µ = i + (n − i − µ). Since λU (P 0 ∪ P 00 ) is dominated by λU (P 0 ∪ P 00 ), this implies λU (P 0 ∪ P 00 ) = λ(P 0 ∪ P 00 ). Thus the proof of this part is complete by Equation (4.2).  Example 4.9. Let P = (102 , 9, 8, 72 , 5, 44 , 23 , 14 ). Then r(P ) = 4 and Q(P ) has 4 parts. Let P 0 = (102 , 9, 8, 72 , 5, 44 ) and P 00 = (23 , 14 ). Note that P = P 0 ∪ P 00 . We have µ(P 00 ) = 10 and µ(P 0 − 2) = µ( (82 , 7, 6, 52 , 3, 24 ) ) = 10 by Example 4.7. Thus, by Proposition 4.8 we have Q(P ) = (Q(P 0 ), Q(P 00 )). By Corollary 4.6, Q(P 0 ) = (29, 22, 13). Thus Q(P ) = (29, 22, 13, 10). 48 References [1] R. Basili. On the irreducibility of commuting varieties of nilpotent matrices. J. Algebra, 268(1):58–80, 2003. [2] R. Basili and A. Iarrobino. Pairs of commuting nilpotent matrices, and Hilbert function. J. Algebra, 320(3):1235–1254, 2008. [3] R. Basili, A. Iarrobino, and L. Khatami. Commuting nilpotent matrices and Artinian algebras. J. Commut. Algebra, 2(3):295–325, 2010. [4] T. Britz and S. Fomin. Finite posets and Ferrers shapes. Adv. Math., 158(1):86–127, 2001. [5] E. R. Gansner. Acyclic digraphs, Young tableaux and nilpotent matrices. SIAM J. Algebraic Discrete Methods, 2(4):429–440, 1981. [6] C. Greene. Some partitions associated with a partially ordered set. J. Combinatorial Theory Ser. A, 20(1):69–79, 1976. [7] T. Harima and J. Watanabe. The commutator algebra of a nilpotent matrix and an application to the theory of commutative Artinian algebras. J. Algebra, 319(6):2545– 2570, 2008. [8] A. Iarrobino and L. Khatami. Bound on the Jordan type of a generic nilpotent matrix commuting with a given matrix. To appear in Journal of Algebraic Combinatorics, 2013. [9] L. Khatami. The poset of the nilpotent commutator of a nilpotent matrix. arXiv:1202.6089, 2012. 49 [10] T. Košir and P. Oblak. On pairs of commuting nilpotent matrices. Transform. Groups, 14(1):175–182, 2009. [11] P. Oblak. The upper bound for the index of nilpotency for a matrix commuting with a given nilpotent matrix. Linear Multilinear Algebra, 56(6):701–711, 2008. [12] D. I. Panyushev. Two results on centralisers of nilpotent elements. J. Pure Appl. Algebra, 212(4):774–779, 2008. [13] M. Saks. Dilworth numbers, incidence maps and product partial orders. SIAM J. Algebraic Discrete Methods, 1(2):211–215, 1980. Department of Mathematics, Union College, Schenectady, NY 12308 E-mail Address: [email protected] 50
0math.AC
arXiv:1304.7332v1 [math.AC] 27 Apr 2013 More properties of almost Cohen-Macaulay rings Cristodor Ionescu Institute of Mathematics Simion Stoilow of the Romanian Academy P.O. Box 1-764 RO 014700 Bucharest Romania email: [email protected] Abstract Some interesting properties of almost Cohen-Macaulay rings are investigated and a Serre type property connected with this class of rings is studied. 1 Introduction A flaw in the chapter dedicated to Cohen-Macaulay rings in the first edition of [5] was corrected in the second edition. This led to the study of the so-called almost Cohen Macaulay rings, first by Y. Han [1] and later by M.-C. Kang [2], [3]. Since the first of these papers is written in Chinese, the others two are the main reference for the subject. Remark 1.1 Let A be a commutative noetherian ring, P ∈ Spec(A) and M 6= 0 a finitely generated A-module. Then depthP (M ) ≤ depthP AP MP . Definition 1.2 (cf. [1], [2]) Let A be a commutative noetherian ring. A finitely generated A-module M 6= 0 is called almost Cohen-Macaulay if depthP M = depthP AP MP , for any P ∈ Supp(M ). A is called an almost Cohen-Macaulay ring if it is an almost Cohen-Macaulay A-module, that is if for any P ∈ Spec(A), depthP A = depthP AP AP . Several properties of almost Cohen-Macaulay rings are proved in [2] and several interesting examples are given in [3]. In the following we are trying to complete the results in [2] and to introduce a Serre-type condition, that we call (Ck ), for any k ∈ N, condition that is to be to almost Cohen-Macaulay rings what the classical Serre condition (Sk ) is to Cohen-Macaulay rings. 1 2 Properties of almost Cohen-Macaulay rings All rings considered will be commutative and with unit. We start by reminding some basic properties of almost Cohen-Macaulay rings. Remark 2.1 Let A be a noetherian ring. Then: a) A is almost Cohen-Macaulay iff ht(P ) ≤ 1 + depthP A, ∀ P ∈ Spec(A) ([2], 1.5); b) A is almost Cohen-Macaulay iff AP is almost Cohen-Macaulay for any P ∈ Spec(A) iff AQ is almost Cohen-Macaulay for any Q ∈ Max(A) iff ht(Q) ≤ 1 + depthAQ for any Q ∈ Max(A) ([2], 2.6); c) If A is local, it follows from b) that A is almost Cohen-Macaulay if and only if dim(A) ≤ 1 + depth(A). Our first result is a stronger formulation of [2], 2.10 and deals with the behaviour of almost Cohen-Macaulay rings with respect to flat morphisms. Proposition 2.2 Let u : (A, m) → (B, n) be a local flat morphism of noetherian local rings. a) If B is almost Cohen-Macaulay, then A and B/mB are almost CohenMacaulay. b)If A and B/mB are almost Cohen-Macaulay and one of them is CohenMacaulay, then B is almost Cohen-Macaulay. Proof: a) We have dim(A) = dim(B) − dim(B/mB) ≤ 1 + depthB − dim(B/mB) ≤ ≤ 1 + depthB − depth(B/mB) = 1 + depthA. We have also dim(B/mB) − depth(B/mB) = (dim(B) − depthB) − (dim(A) − depthA) ≤ ≤ 1 − (dim(A) − depthA) ≤ 1. b) Since u is flat we have dim(B) = dim(A) + dim(B/mB) ≤ 1 + depth(A) + depth(B/mB) = = 1 + depth(B). Question 2.3 We don’t know of any example of a local flat morphism of noetherian local rings u : (A, m) → (B, n) such that A and B/mB are almost CohenMacaulay and B is not almost Cohen-Macaulay. Corollary 2.4 Let A be a noetherian local ring, I 6= A be an ideal contained in the Jacobson radical of A and  the completion of A in the I-adic topology. Then A is almost Cohen-Macaulay if and only if  is almost Cohen-Macaulay. 2 Proof: Since I is contained in the Jacobson radical of A, the canonical morphism A →  is faithfully flat and Max(A) ∼ = Max(Â). Moreover, if m ∈ Max(A) and m̂ is the corresponding maximal ideal of Â, the closed fiber of the morphism Am → Âm̂ is a field. Now apply 2.2. Corollary 2.5 (see [2], 1.6) Let A be a noetherian ring and n ∈ N. Then A is almost Cohen-Macaulay if and only if A[[X1 , . . . , Xn ]] is almost Cohen-Maculay. Proof: Suppose that A is almost Cohen-Macaulay. We may clearly assume that A is local and n = 1. By [2], 1.3 we get that A[X](X) is almost Cohen-Macaulay. Now apply 2.4. The converse is clear. For the next corollary we need some notations. Notation 2.6 If P is a property of noetherian local rings, we denote by P(A) := {Q ∈ Spec(A) | AQ has the property P} and by NP(A) := {Q ∈ Spec(A) | AQ has not the property P} = Spec(A) \ P(A). Definition 2.7 Let A be a noetherian ring. According to 2.6, the set aCM(A) := {P ∈ Spec(A) | AP is almost Cohen-Macaulay} is called the almost Cohen-Macaulay locus of A. Corollary 2.8 Let u : A → B be a morphism of noetherian local rings and ϕ : Spec(B) → Spec(A) the induced morphism on the spectra. If the fibers of u are Cohen-Macaulay, then ϕ−1 (aCM(A)) = aCM(B). Proof: Obvious from 2.2. In Cohen-Macaulay rings chains of prime ideals behave very well, in the sense that Cohen-Macaulay rings are universally catenary(see [5]). This is no more the case for almost Cohen-Macaulay rings. Example 2.9 There exists a local almost Cohen-Macaulay ring which is not catenary. Proof: Indeed, by [2], Ex. 2, any noetherian normal integral domain of dimension 3 is almost Cohen-Macaulay. In [6] such a ring which is not catenary is constructed. The next result shows that some of the formal fibres of almost CohenMacaulay rings are almost Cohen-Macaulay. A stronger fact will be proved in 2.13. Proposition 2.10 Let A be a noetherian local almost Cohen-Macaulay ring, P ∈ Spec(A), Q ∈ Ass(Â/P Â). Then ÂQ /P ÂQ is almost Cohen-Macaulay. Proof: We have dim(ÂQ /P ÂQ ) = dim ÂQ − dim AP ≤ depthÂQ + 1 − dim AP ≤ ≤ depthÂP + 1 − dim AP = depth(ÂQ /P ÂQ ) + 1. The following result shows that the almost Cohen-Macaulay property is preserved by tensor products and finite field extensions. 3 Proposition 2.11 Let k be a field, A and B be two k−algebras such that A⊗k B is a noetherian ring. If A and B are almost Cohen-Macaulay, then A ⊗k B is almost Cohen-Macaulay. Proof: Let P ∈ Spec(A). We have a flat morphism B → B ⊗k k(P ) and let Q ∈ Spec(B). Set T := A/P ⊗k B/Q = A ⊗k B/(P ⊗k B + A ⊗k Q). Then k(P ) ⊗k k(Q) is a ring of fractions of T, hence noetherian by assumption. By [7], 1.5, it follows that k(P ) ⊗k k(Q) is locally a complete intersection. Let now Q ∈ Spec(B) and P = Q ∩ A. By the above the flat local morphism AP → (B ⊗k k(P ))Q has a complete intersection closed fiber, hence the ring (B⊗k k(P ))Q is almost Cohen-Macaulay by 2.2. Now consider the flat morphism A → A⊗k B, let Q ∈ Spec(A⊗k B) and P = Q∩A. Then the flat local morphism AP → (A ⊗k B)Q has a complete intersection closed fiber, whence (A ⊗k B)Q is almost Cohen-Macaulay. Corollary 2.12 Let k be a field, A a noetherian k−algebra which is almost Cohen-Macaulay and L a finite field extension of k. Then A ⊗k L is almost Cohen-Macaulay. As for the Cohen-Macaulay property, the formal fibres of factorizations of almost Cohen-Macaulay rings are almost Cohen-Macaulay. Proposition 2.13 Let B be a local almost Cohen-Macaulay ring, I an ideal of B and A = B/I. Then the formal fibers of A are almost Cohen-Macaulay. Proof: We have  = B̂ ⊗B A = B̂/I B̂, hence the formal fibers of A are exactly the formal fibers of B in the prime ideals of B containing I. Let P be such a prime ideal, let S = B \ P and let C := S −1 (B̂/I B̂). Let also Q ∈ Spec(C). There exists Q′ ∈ Spec(B̂) such that Q = Q′ C and Q′ ∩ B = P. Thus we have a local flat morphism BQ → B̂Q′ . But B is almost Cohen-Macaulay, hence B̂Q′ and consequently CQ ∼ = B̂Q′ /P B̂Q′ are almost Cohen-Macaulay, by 2.2. 3 The property (Cn) Recall that given a natural number n, a noetherian ring A is said to have Serre property (Sn ) if depth(AP ) ≥ min(htP, n) for any prime ideal P ∈ Spec(A). Moreover, A is Cohen-Macaulay if and only if A has the property (Sn ) for any n ∈ N (see [5], (17.I)). We will try to characterize almost Cohen-Macaulay rings in a similar way. Definition 3.1 Let n ∈ N be a natural number. We say that a noetherian ring A has the property (Cn ) if depth(AP ) ≥ min(htP, n) − 1, ∀ P ∈ Spec(A). Remark 3.2 a) It is clear that (Cn ) ⇒ (Cn−1 ) and that (Sn ) ⇒ (Cn ), ∀n ∈ N. b) It is also clear that if A has (Cn ), then AP has (Cn ), ∀P ∈ Spec(A). Theorem 3.3 A noetherian ring A is almost Cohen-Macaulay if and only if A has the property (Cn ) for every n ∈ N. 4 Proof: Assume that A is almost Cohen-Macaulay and let P ∈ Spec(A). Then AP is almost Cohen-Macaulay, hence depth(AP ) ≥ ht(P )−1. If n ≥ ht(P ), then min(ht(P ), n) = ht(P ), hence depth(AP ) ≥ min(n, ht(P ))−1. If n < ht(P ), then min(n, ht(P )) = n, so that depth(AP ) ≥ ht(P ) − 1 > n − 1 = min(ht(P ), n) − 1. For the converse, let P ∈ Spec(A), ht(P ) = l. Then depth(AP ) ≥ min(l, ht(P )) − 1 = ht(P ) − 1. Proposition 3.4 Let k ∈ N. A noetherian ring A has the property (Ck ) if and only if AP is almost Cohen-Macaulay for any P ∈ Spec(A) with depth(AP ) ≤ k − 2. Proof: Let P ∈ Spec(A) such that min(k, ht(P )) − 1 ≤ depth(AP ) ≤ k − 2. If ht(P ) ≤ k, then depth(AP ) ≥ ht(P ) − 1. And if ht(P ) > k, then it follows that k − 2 > depth(AP ) ≥ k − 1. Contradiction! Conversely, let P ∈ Spec(A). If depth(AP ) ≤ k − 2, then AP is almost CohenMacaulay, hence ht(P ) − 1 ≤ depth(AP ) ≤ k − 2. Thus min(ht(P ), k) = ht(P ), whence depth(AP ) ≥ min(k, ht(P ). If k − 2 < depth(AP ), then ht(P ) > k − 2, hence depth(AP ) ≥ min(k, ht(P )) − 1. Proposition 3.5 Let A be a noetherian ring, k ∈ N and x ∈ A a non zero divisor. If A/xA has the property (Ck ), then A has the property (Ck ). Proof: Let Q ∈ Spec(A) such that depth(AQ ) = n ≤ k − 2. If x ∈ Q, then depth(A/xA)Q = n − 1 ≤ k − 3. Then ht(Q/xA) ≤ n − 1 + 1 = n, hence ht(Q) ≤ n+ 1 = depthAQ + 1. If x ∈ / Q, let P ∈ Min(Q + xA). Then (P + xA)AQ is QAQ primary and depth(AP ) ≤ depth(AQ )+ 1 = n+ 1. Then depth(A/xA)Q = n− 1, hence ht(P/xA) ≤ n. It follows that ht(P ) ≤ n + 1 = depth(AP ) + 1. Definition 3.6 We say that a property P of noetherian local rings satisfies Nagata’s Criterion (NC) if the following holds: if A is a noetherian ring such for every P ∈ P(A), the set P(A/P ) contains a non-empty open set of Spec(A/P ), then P(A) is open in Spec(A). An interesting study of Nagata Criterion is performed in [4]. Theorem 3.7 Let k ∈ N. The property (Ck ) satisfies (NC). Proof: Let Q ∈ Ck (A). Then depth(AQ ) ≥ min(k, ht(Q)) − 1. Case a): ht(Q) ≤ k. Then min(k, ht(Q)) = ht(Q), hence depth(AQ ) + 1 ≥ ht(Q) and AQ is almost Cohen-Macaulay. Let f ∈ A \ Q such that dim(AP ) = dim(AQ ) + dim(AP /QAP ) and depth(AP ) = depth(AQ ) + depth(AP /QAP ) for any P ∈ D(f ) ∩ V (Q) ∩ N Tk (A). Then depth(AP )  min(k, ht(P )) − 1. 5 Case a1): ht(P ) ≤ k. Then min(k, ht(P )) = ht(P ), hence depth(AP ) + 1 < ht(P ). Then depth(AP /QAP ) + 1 = depth(AP ) − depth(AQ ) + 1 < < ht(P ) − depth(AQ ) ≤ ht(P ) − ht(Q) + 1. Then depth(AP /QAP ) < dim(AP /QAP ) = dim(AP ) − dim(AQ ) and it follows that AP /QAP is not (Ck ). Case a2): ht(P ) > k. Then min(k, ht(P )) = k, hence depth(AP ) < k − 1. It follows that depth(AP /QAP ) = depth(AP ) − depth(AQ ) < < k − 1 + 1 − ht(Q) = k − ht(Q). This implies that AP /QAP is not (Ck ). Case b): ht(Q) > k. Then min(k, ht(Q)) = k and depth(AQ ) + 1 ≥ k. Since ht(P ) > k, it follows that min(k, ht(P )) = k and depth(AP ) + 1 < k. Let x1 , . . . , xr be an AQ -regular sequence. Then there exists f ∈ A \ Q such that x1 , . . . , xr is Af -regular. If P ∈ D(f ) ∩ V (Q), it follows that AP is (Ck ). Corollary 3.8 The property almost Cohen-Macaulay satisfies (NC). Theorem 3.9 Let A be a quasi-excellent ring and k ∈ N. Then Ck (A) and aCM(A) are open in the Zariski topology of Spec(A). Proof: Let P ∈ Spec(A). Then aCM(A/P ) and Ck (A/P ) contain the nonempty open set Reg(A/P ) = {P ∈ Spec(A) | AP is regular }. Now apply 3.7 and 3.8. Corollary 3.10 Let A be a complete semilocal ring and k ∈ N. Then Ck (A) and aCM (A) are open in the Zariski topology of Spec(A). Corollary 3.11 Let A be a noetherian local ring with Cohen-Macaulay formal fibers. Then aCM(A) is open. Proof: Follows from 3.10 and 2.8. Proposition 3.12 Let u : A → B be a flat morphism of noetherian rings and k ∈ N. If B has (Ck ), then A has (Ck ). Proof: We may assume that A and B are local rings and that u is local. Let P ∈ Spec(A) and Q ∈ Min(P B). Then dim(BQ /P BQ ) = 0, hence depth(AP ) = depth(BQ ) ≥ min(k, dim(BQ )) − 1 = = min(k, dim(AP )) − 1. 6 Proposition 3.13 Let u : A → B be a flat morphism of noetherian rings and k ∈ N. a) If A has (Ck ) and all the fibers of u have (Sk ), then B has (Ck ). b) If A has (Sk ) and all the fibers of u have (Ck ), then B has (Ck ). Proof: a) Let Q ∈ Spec(B), P = Q ∩ A. Then by flatness we have dim(BQ ) = dim(AP ) + dim(BQ /P BQ ), depth(BQ ) = depth(AP ) + depth(BQ /P BQ ). By assumption we have depth(AP ) ≥ min(k, ht(P )) − 1, depth(BQ /P BQ ) ≥ min(k, dim(BQ /P BQ ). Hence we have depth(BQ ) = depth(AP ) + depth(BQ /P BQ ) ≥ ≥ min(k, ht(P )) − 1 + min(k, dim(BQ /P BQ )) = min(k, ht(BQ )) − 1. b) The proof is the same. As a corollary we get a new proof of a previous result. Corollary 3.14 Let u : A → B be a flat morphism of noetherian rings. a) If B is almost Cohen-Macaulay, then A is almost Cohen-Macaulay. b) If A is almost Cohen-Macaulay and the fibers of u are Cohen-Macaulay, then B is almost Cohen-Macaulay. Example 3.15 Let k be a field and let X0 , X1 , X2 , Y1 , Y2 be indeterminates. Set B = k[[X0 , X1 , X2 ]]/(X0 ) ∩ (X0 , X1 )2 ∩ (X0 , X1 , X2 )3 and A := B[[Y1 , Y2 ]]. It is easy to see that A is a noetherian local ring with dim(A) = 5, depth(A) = 2. It is also not difficult to see that A has the property (C3 ) and not the property (C4 ). Similar other examples can easily be constructed. Example 3.16 Let k be a field, X, Y indeterminates and consider the ring A = k[[X, Y ]]/(X 2 , XY ). Then A has (C2 ) and not (S2 ). References [1] Han, Y.(1998), D-rings. Acta Math. Sinica 4:1047–1052. [2] Kang, M.C.(2001), Almost Cohen-Macaulay modules. Comm. Algebra 29:781–787. 7 [3] Kang, M.C.(2002), Addendum to ”Almost Cohen-Macaulay modules”. Comm. Algebra 30:1049–1052. [4] Massaza, C.(1981), Su alcuni aspetti assiomatici del criterio di Nagata. Rend. Circ. Mat. Palermo XXX:365-377. [5] Matsumura, H.(1980), Commutative Algebra, 2nd Edition, Benjamin Cummings, 1980. [6] Ogoma, T.(1980), Non-catenary pseudo-geometric normal rings. Japan J. Math. 6:147–163. [7] Tousi M. and Yassemi S.(2003), Tensor products of some special rings. J. Algebra 268:672–675. 8
0math.AC
New Algorithms for Maximum Disjoint Paths Based on Tree-Likeness arXiv:1603.01740v2 [cs.DS] 20 May 2016 Krzysztof Fleszar∗ Matthias Mnich† Joachim Spoerhase‡ Abstract We study the classical NP-hard problems of finding maximum-size subsets from given sets of k terminal pairs that can be routed via edge-disjoint paths (MaxEDP) or node-disjoint paths (MaxNDP) in a given graph. The approximability of MaxEDP/NDP is currently not well understood; the best known lower bound is Ω(log1/2−ε n), assuming NP 6⊆ ZPTIME(npoly log n ). This constitutes a significant gap to √ the best known approximation upper bound of O( n) due to Chekuri et al. (2006) and closing this gap is currently one of the big open problems in approximation algorithms. In their seminal paper, Raghavan and Thompson (Combinatorica, 1987) introduce the technique of randomized rounding for   LPs; their technique gives an O(1)-approximation when edges (or nodes) may be used by O logloglogn n paths. In this paper, we strengthen the above fundamental results. We provide new bounds formulated in terms of the feedback vertex set number r of a graph, which measures its vertex deletion distance to a forest. In particular, we obtain the following. √ • For MaxEDP, we give an O( r · log1.5 kr)-approximation algorithm. As r ≤ n, up to logarithmic √ factors, our result strengthens the best known ratio O( n) due to Chekuri et al.   • Further, we show how to route Ω(OPT) pairs with congestion O logloglogkrkr , strengthening the bound obtained by the classic approach of Raghavan and Thompson. • For MaxNDP, we give an algorithm that gives the optimal answer in time (k + r)O(r) · n. If r is at most triple-exponential in k, this improves the best known algorithm for MaxNDP with parameter k, by Kawarabayashi and Wollan (STOC 2010). We complement these positive results by proving that MaxEDP is NP-hard even for r = 1, and MaxNDP is W[1]-hard for parameter r. This shows that neither problem is fixed-parameter tractable in r unless FPT = W[1] and that our approximability results are relevant even for very small constant values of r. 1 Introduction In this paper, we study disjoint paths routing problems. In this setting, we are given an undirected graph G and a collection of source-destination pairs M = {(s1 , t1 ), . . . , (sk , tk )}. The goal is to select a maximum-sized subset M0 ⊆ M of the pairs that can be routed, where a routing of M0 is a collection P of paths such that, for each pair (si , ti ) ∈ M0 , there is a path in P connecting si to ti . In the Maximum Edge Disjoint Paths (MaxEDP) problem, a routing P is feasible if its paths are pairwise edge-disjoint, and in the Maximum Node Disjoint Paths (MaxNDP) problem the paths in P must be pairwise vertex-disjoint. Disjoint paths problems are fundamental problems with a long history and significant connections to optimization and structural graph theory. The decision version of MaxEDP/MaxNPD asks whether all of the pairs can be routed. Karp [27] showed that, when the number of pairs is part of the input, the decision problem is NP-complete. In undirected graphs, MaxEDP and MaxNDP are solvable in polynomial time ∗ Universität Würzburg, Würzburg, Germany. [email protected] Bonn, Bonn, Germany. [email protected]. Supported by ERC Starting Grant 306465 (BeyondWorstCase). ‡ Universität Würzburg, Würzburg, Germany. [email protected] † Universität 1 when the number of pairs is a fixed constant; this is a very deep result of Robertson and Seymour [40] that builds on several fundamental results in structural graph theory from their graph minors project. In this paper, we consider the optimization problems MaxEDP and MaxNDP when the number of pairs √ are part of the input. In this setting, the best approximation ratio for MaxEDP is achieved by an O( n)-approximation algorithm [12, 33], where n is the number of nodes, whereas the best hardness for undirected graphs is only Ω(log1/2−ε n) [3]. Bridging this gap is a fundamental open problem that seems quite challenging at the moment. Most of the results for routing on disjoint paths use a natural multi-commodity flow relaxation as a starting point. A well-known integrality gap instance due to Garg et al. [24] shows√that this relaxation has √ an integrality gap of Ω( n), and this is the main obstacle for improving the O( √ n)-approximation ratio in general graphs. The integrality instance on an n × n grid (of treewidth Θ( n)) exploits a topological obstruction in the plane that prevents a large integral routing; see Fig. 1. This led Chekuri et al. [15] to studying the approximability of MaxEDP with respect to the tree-width of the underlying graph. In particular, they pose the following conjecture: Conjecture 1 ([13]). The integrality gap of the standard multi-commodity flow relaxation for MaxEDP is Θ(w), where w is the treewidth of the graph. Recently, Ene et al. [21] showed that MaxEDP admits an O(w3 )-approximation algorithm on graphs of treewidth at most w. Theirs is the best known approximation ratio in terms of w, improving on an earlier O(w · 3w )-approximation algorithm due to Chekuri et al. This shows that the problem seems more amenable on “tree-like” graphs. √ However, for w = ω(n1/6 ), the bound is weaker than the bound of O( n). In fact, EDP remains NP-hard even for graphs of constant treewidth, namely treewidth w = 2 [37]. This further rules out the existence of a fixed-parameter algorithm for MaxEDP parameterized by w, assuming P 6= NP. Therefore, to obtain fixedparameter tractability results as well as better approximation guarantees, one needs to resort to parameters stronger than treewidth. Another route to bridge the large gap between approximation lower and upper bounds for MaxEDP is to allow the paths to have low congestion c: that is, instead of requiring the routed paths to be pairwise disjoint, at most c paths can use an edge. In their groundbreaking work, Raghavan and Thompson [38] introduced the technique of randomized rounding of LPs to obtain polynomial-time approximation algorithms for   combinatorial problems. Their approach allows to route Ω(OPT) pairs of paths with congestion O logloglogn n . This extensive line of research [2, 18, 29] has culminated in a logO(1) k-approximation algorithm with congestion 2 for MaxEDP [20]. A slightly weaker result also holds for MaxNDP [11]. 1.1 Motivation and Contribution The goal of this work is to study disjoint paths problems under another natural measure for how “far” a graph is from being a tree. In particular, we propose to examine MaxEDP and MaxNDP under the feedback vertex set number, which for a graph G denotes the smallest size r of a set R of G for which G − R is a forest. Note that the treewidth of G is at most r + 1. Therefore, given the NP-hardness of EDP for w = 2 and the current gap between the best known upper bound O(w3 ) and the linear upper bound suggested by Conjecture 1, it is interesting to study the stronger restriction of bounding the feedback vertex set number r of the input graph. Our approach is further motivated by the fact that MaxEDP is efficiently solvable on trees by means of the algorithm of Garg, Vazirani and Yannakakis [24]. Similarly, MaxNDP is easy on trees (see Theorem 3). Our main insight is that one can in fact obtain bounds in terms of r that either strengthen the best known bounds or are almost tight (see Table 1). It therefore seems that parameter r correlates quite well with the “difficulty” of disjoint paths problems. Our first result allows the paths to have small congestion: in this setting, we strengthen the result, obtained by the classic randomized LP-rounding approach  of Raghavan and Thompson [38], that one can always route Ω(OPT) pairs with congestion O log n log log n with constant probability. 2 Theorem 1. For any instance (G, M) of MaxEDP, one can efficiently find a routing of Ω(OPT) pairs with  log kr congestion O log log kr with constant probability; in other words, there is an efficient O(1)-approximation   algorithm for MaxEDP with congestion O logloglogkrkr . Our second main result builds upon Theorem 1 and uses it as a subroutine. We show how to use a routing for MaxEDP with low congestion to obtain a polynomial-time approximation algorithm for MaxEDP without congestion that performs well in terms of r. Theorem √ 2. The integrality gap of the multi-commodity flow relaxation for MaxEDP with k terminal pairs is O( r · log1.5 rk) for graphs with feedback vertex set number r. Moreover, there is a polynomial time algorithm that, √ given a fractional solution to the relaxation of value opt, it constructs an integral routing of size opt/O( r · log1.5 rk). In particular, our algorithm strengthens the best known approximation algorithm for MaxEDP on general graphs [12] as always r ≤ n, and indeed it matches that algorithm’s performance up to polylogarithmic factors. Substantially improving upon our bounds would also improve the current state of the art of MaxEDP. Conversely, the result implies that it suffices to study graphs √ with close to linear feedback vertex set number in order to improve the currently best upper bound of O( n) on the approximation ratio [12]. Our algorithmic approaches harness the forest structure of G − R for any feedback vertex set R. However, the technical challenge comes from the fact that the edge set running between G − R and R is unrestricted. Therefore, the “interaction” between R and G − R is non-trivial, and flow paths may run between the two parts in an arbitrary manner and multiple times. In fact, we show that MaxEDP is already NP-hard if R consists of a single node (Theorem 5); this contrasts the efficient solvability on forests [24]. In order to overcome the technical hurdles we propose several new concepts, which we believe could be of interest in future studies of disjoint paths or routing problems. In the randomized rounding approach of Raghavan and Thompson [38], it is shown that the probability that the congestion on any fixed edge is larger than c logloglogn n for some constant c is at most 1/nO(1) . Combining this with the fact that there are at most n2 edges, yields that every edge has bounded congestion w.h.p. The number of edges in the graph may, however, be unbounded in terms of r and k. Hence, in order to to prove Theorem 1, we propose a non-trivial pre-processing step of the optimum LP solution that is applied prior to the randomized rounding. In this step, we aggregate the flow paths by a careful rerouting so that the flow “concentrates” in O(kr2 ) nodes (so-called hot spots) in the sense that if all edges incident on hot spots have low congestion then so have all edges in the graph. Unfortunately, for any such hot spot the number of incident edges carrying flow may still be unbounded in terms of k and r. We are, however, able to give a refined probabilistic analysis that suitably relates the probability that the congestion bound is exceeded to the amount of flow on that edge. Since the total amount of flow on each hot spot is bounded in terms of k, the probability that all edges incident on the same hot spot have bounded congestion is inverse polynomial in r and k. √ The known O( n)-approximation algorithm for MaxEDP by Chekuri et al. [12] employs a clever LProunding approach. If there are many long paths then there must be a single node carrying a significant fraction of the total flow and a good fraction of this flow can be realized by integral paths by solving a single-source flow problem. If the LP solution contains many short flow paths then greedily routing these short paths yields the bound since each such path blocks a bounded amount of flow. In order to prove Theorem 2, it is natural to consider the case where there are many paths visiting a large number of nodes in R. In this case, we reduce to a single-source flow problem, similarly to the approach of Chekuri et al. The case where a majority of the flow paths visit only a few nodes in R turns out more challenging, since any such path may still visit an unbounded number of edges in terms of k and r. We use two main ingredients to overcome these difficulties. First, we apply our Theorem 1 as a building block to obtain a solution with logarithmic congestion while losing only a constant factor in the approximation ratio. Second, we introduce the concept of irreducible routings with low congestion which allows us exploit the structural properties of the graph and the congestion property to identify a sufficiently large number of flow paths blocking only a small amount of flow. 3 √ Note that the natural greedy approach of always routing the shortest conflict-free path gives only O( m) for MaxEDP. We believe that it is non-trivial to obtain our bounds via a more direct or purely combinatorial approach. Our third result is a fixed-parameter algorithm for MaxNDP in k + r. Theorem 3. MaxNDP can be solved in time (8k + 8r)2r+2 · O(n) on graphs with feedback vertex set number r and k terminal pairs. This run time is polynomial for constant r. We also note that for small r, our algorithm is asymptotically significantly faster than the fastest known algorithm for NDP, by Kawarabayashi and Wollan [28], which requires time at least quadruple-exponential in k [1]. Namely, if r is at most triple-exponential in k, our algorithm is asymptotically faster than theirs. We achieve this result by the idea of so-called essential pairs and realizations, which characterizes the “interaction” between the feedback vertex set R and the paths in an optimum solution. Note that in our algorithm of Theorem 3, parameter k does not appear in the exponent of the run time at all. Hence, for small values of r our algorithm is also faster than reducing MaxNDP to NDP by guessing the subset of pairs to be routed (at an expense of 2k in the run time) and using Scheffler’s [41] algorithm for NDP with run time 2O(r log r) · O(n). Once a fixed-parameter algorithm for a problem has been obtained, the existence of a polynomial-size kernel comes up. Here we note that MaxNDP does not admit a polynomial kernel for parameter k + r, unless NP ⊆ coNP/poly [8]. Another natural question is whether the run time f (k, r) · n in Theorem 3 can be improved to f (r) · nO(1) . We answer this question in the negative, ruling out the existence of a fixed-parameter algorithm for MaxNDP parameterized by r (assuming FPT 6= W[1]): Theorem 4. MaxNDP in unit-capacity graphs is W[1]-hard parameterized by r. This contrasts the known result that NDP is fixed-parameter tractable in r [41]—which further stresses the relevance of understanding this parameter. For MaxEDP, we prove that the situation is, in a sense, even worse: Theorem 5. MaxEDP is NP-hard for unit-capacity graphs with r = 1 and EDP is NP-hard for unit-capacity graphs with r = 2. This theorem also shows that our algorithms are relevant for small values of r, and they nicely complement the NP-hardness for MaxEDP in capacitated trees [24]. Our results are summarized in Table 1. const. param. r=0 r=1 r≥2 r EDP MaxEDP NDP MaxNDP poly [24] open NP-hard (Thm. 5) poly [24] NP-hard (Thm. 5) NP-hard (Thm. 5) poly [41] poly [41] poly [41] poly (Thm. 3) poly (Thm. 3) poly (Thm. 3) para-NP-hard (Thm. 5) FPT [41] W[1]-hard (Thm. 4) √ O( r · log1.5 kr)-approx (Thm. 2) exact (k + r)O(r) (Thm. 3)   O(1)-approx. w.cg. O logloglogkrkr (Thm. 1) Table 1: Summary of results obtained in this paper. Related Work. Our study of the feedback vertex set number is in line with the general attempt to obtain bounds for MaxEDP (or related problems) that are independent of the input size. Besides the above-mentioned works that provide bounds in terms of the tree-width of the input graph, Günlük [25] and Chekuri et al. [17] give bounds on the flow-cut gap for the closely related integer multicommodity flow problem that are logarithmic with respect to the vertex cover number of a graph. This improved upon earlier bounds of O(log n) [34] 4 and O(log k) [5, 35]. As every feedback vertex set is in particular a vertex cover of a graph, our results generalize earlier work for disjoint path problems on graphs with bounded vertex cover number. Bodlaender et al. [8] showed that NDP does not admit a polynomial kernel parameterized by vertex cover number and the number k of terminal pairs, unless NP ⊆ coNP/poly ; therefore, NDP is unlikely to admit a polynomial kernel in r + k either. Ene et al. [21] showed that MaxNDP is W[1]-hard parameterized by treedepth, which is another restriction of treewidth that is incomparable to the feedback vertex set number. The basic gap in understanding the approximability of MaxEDP has led to several improved results for special graph classes, and also our results can be seen in this light. For example, polylogarithmic approximation algorithms are known for graphs whose global minimum cut value is Ω(log5 n) [39], for bounded-degree expanders [9, 10, 23, 30, 34], and for Eulerian planar or 4-connected planar graphs [29]. Constant factor approximation algorithms are known for capacitated trees [14, 24], grids and grid-like graphs [4, 6, 31, 32]. For planar graphs, there is a constant-factor approximation algorithm with congestion 2 [42]. Very recently, 9/19 Chuzhoy et al. [19] )-approximation algorithm for MaxNDP on planar graphs. However, √ gave a Õ(n improving the O( n)-approximation algorithm for MaxEDP remains elusive even for planar graphs. 2 Preliminaries We use standard graph theoretic notation. For a graph G, let V (G) denote its vertex set and E(G) its edge set. Let G be a graph. A feedback vertex set of G is a set R ⊆ V (G) such that G − R is a forest. A minor of G is a graph H that is obtained by successively contracting edges from a subgraph of G (and deleting any occurring loops). A class G of graphs is minor-closed if for any graph in G also all its minors belong to G. For an instance (G, M) of MaxEDP/MaxNPD, we refer to the vertices participating in the pairs M as terminals. It is convenient to assume that M forms a matching on the terminals; this can be ensured by making several copies of a terminal and attaching them as leaves. Multi-commodity flow relaxation. We use the following standard multi-commodity flow relaxation for MaxEDP (there is an analogous relaxation for MaxNDP). We use P(u, v) to denote the set of all paths in G from u to v, for each pair (u, v) of nodes. Since the pairs M form a matching, the sets P(si , ti ) are Sk pairwise disjoint. Let P = i=1 P(si , ti ). The LP has a variable f (P ) for each path P ∈ P representing the amount of flow on P . For each pair (si , ti ) ∈ M, the LP has a variable xi denoting the total amount of flow routed for the pair (in the corresponding IP, xi denotes whether the pair is routed or not). The LP imposes the constraint that there is a flow from si to ti of value xi . Additionally, the LP has constraints that ensure that the total amount of flow on paths using a given edge (resp. node for MaxNDP) is at most 1. max (MaxEDP LP) s1 k X s2 xi i=1 s.t. X f (P ) = xi ≤ 1 i = 1, . . . , k, P ∈P(si ,ti ) X f (P ) ≤ 1 e ∈ E(G) sk P : e∈P f (P ) ≥ 0 P ∈P t1 t2 tk √ Figure 1: Multi-commodity flow relaxation for MaxEDP. Right: Ω( n) integrality gap for MaxEDP [24]: any integral routing routes at most one pair, whereas a multi-commodity flow can send 1/2 unit of flow for each pair (si , ti ) along the canonical path from si to ti in the grid. It is well-known that the relaxation MaxEDP LP can be solved in polynomial time, since there is an 5 efficient separation oracle for the dual LP (alternatively, one can write a compact relaxation). We use (f, x) to denote a feasible solution to MaxEDP LP for an instance (G, M) of MaxEDP. For each terminal v, let x(v) denote the total amount of flow routed for v and we refer to x(v) as the marginal value of v in the multi-commodity flow f . We will use the following result by Chekuri et al. [12, Sect. 3.1]; see also Proposition 3.3 of Chekuri et al. [16]. Proposition 1. Let (f, x) be a fractional solution to the LP relaxation of a MaxEDP instance (G, M). P If 1 some node v is contained in all flow paths of f , then we can find an integral routing of size at least 12 i xi in polynomial time. 3 Bi-Criteria Approximation for MaxEDP with Low Congestion We present a randomized rounding algorithm that will lead to the proof of Theorem 1. 3.1 Algorithm Consider an instance (G, M) of MaxEDP. Let R be a 2-approximate minimum feedback vertex set of G and let r = |R|; note that such a set R can be obtained in polynomial time [7]. For the sake of easier presentation, we will assume in this section that the feedback vertex set R contains all terminal nodes from M. This can be achieved by temporarily adding the set of terminals to the feedback vertex set R. Also note that this assumption increases the bound of Theorem 1 by at most a constant factor. First, solve the corresponding MaxEDP LP. We obtain an optimal solution (f, x). For each (si , ti ) ∈ M we further obtain a set P 0 (si , ti ) = {P ∈ P(si , ti ) | f (P ) > 0} of positive weighted paths that satisfy the LP Sk constraints. Note that the total set P 0 = i=1 P 0 (si , ti ) is of size polynomially bounded in the input size. In what follows, we will modify P 0 and then select an (unweighted) subset S of P 0 that will form our integral solution. Each P ∈ P 0 has the form (r1 , . . . , r2 , . . . , r` ) where r1 , . . . , r` are the nodes in R that are traversed by P in this order. The paths (rj , . . . , rj+1 ) with j = 1, . . . , ` − 1 are called subpaths of P . For every subpath P 0 of P , we set f (P 0 ) = f (P ). Let J be the multi-set of all subpaths of all paths in P 0 . Let F = G − R be the forest obtained by removing R. We now modify some paths in P 0 , one by one, and at the same time construct a subset H of nodes that we will call “hot spots”. At the end, every subpath in J will contain at least one hot spot. Initially, let H = ∅. Consider any tree T in F and fix any of its nodes as a root. Then let JT be the multi-set of all subpaths in J that, excluding the endpoints, are contained in T . For each subpath P ∈ JT , define its highest node h(P ) as the node on P closest to the root. Note that P ∩ T = P ∩ F is a path. Now, pick a subpath P ∈ JT that does not contain any node in H and whose highest node h(P ) is farthest away from the root. Consider the multi-set J [P ] of all subpaths in JT that P are identical to P (but may be subpaths of different flow paths in P 0 ). Note that the weight f (J [P ]) := P ∈J [P ] f (P ) of J [P ] is at most 1 by the constraints of the LP. Let u, v ∈ R be the endpoints of P . We define Juv as the set of all subpaths in J \ J [P ] that have u and v as their endpoints and that do not contain any node in H. Intuitively speaking, we now aggregate flow on P by rerouting as much flow as possible from Juv to P . To this end, we repeatedly perform the following operation as long as f (J [P ]) < 1 and Juv 6= ∅. We pick a path P 0 in J that contains a subpath in Juv . We reroute flow from P 0 by creating a new path P 00 that arises from P 0 by replacing its subpath between u and v with P , and assign it the weight f (P 00 ) = min{f (P 0 ), 1 − f (J [P ])}. Then we set the weight of (the original path) P 0 to max{0, f (P 0 ) + f (J [P ]) − 1}. We update the sets P 0 , P 0 (si , ti ), J , JT , J [P ] and Juv accordingly. As soon as f (J [P ]) = 1 or Juv = ∅, we add h(P ) to H. Then, we proceed with the next P ∈ JT not containing a hot spot and whose highest node h(P ) is farthest away from the root. If no such P is left we consider the next tree T in F . 6 At the end, we create our solution S by randomized rounding: We route every terminal pair (si , ti ) with probability xi . In case (si , ti ) is routed, we randomly select a path from P 0 (si , ti ) and add it to S where the probability that path P is taken is f (P )/xi . 3.2 Analysis First, observe that x did not change during our modifications of the paths, as the total flow Pk between any terminal pair did not change. Thus, the expected number of pairs routed in our solution is i=1 xi ≥ OPT. Using the Chernoff bound, the probability that we route less than OPT /2 pairs is at most e−1/8 OPT < 1/2, assuming that OPT > 8. Secondly, we bound the congestion of our solution—our second criterion. Lemma 1. The congestion of flow f is at most 2. Proof. In our algorithm, we increase the flow only along flow subpaths that are pairwise edge-disjoint. To see this, consider two distinct flow subpaths P and P 0 on which we increase the flow. Assume, without loss of generality, that P was considered before P 0 by the algorithm. If there was an edge e lying on P and P 0 , then both subpaths traverse the same tree in forest F . Hence, the path from e to h(P 0 ) would visit h(P ), and h(P ) would be an internal node of P 0 . This yields a contradiction, as h(P ) was already marked as a hot spot when P 0 was considered. This shows that we increased the flow along any edge by at most one unit, and, hence, f has congestion at most 2. We now bound the congestion of the integral solution obtained by randomized rounding. In the algorithm, we constructed a set H of hot spots. As a part of the analysis, we will now extend this set as follows. We build a sub-forest F 0 of F consisting of all edges of F that lie on a path connecting two hot spots. Then we add to H all nodes that have degree at least 3 in F 0 . Since the number of nodes of degree 3 in any forest is at most its number of leaves and since every leaf of F 0 is a hot spot, it follows that this can at most double the size of H. Finally, we add the set R of all feedback vertex nodes to H. Lemma 2. The number |H| of hot spots is O(kr2 ). Proof. It suffices to show that the number of hot spots added to H by the algorithm is O(kr2 ). To this end, fix two nodes u, v ∈ R and consider the set of flow subpaths P with end nodes u and v for which we added h(P ) to H. Due to the aggregation of flows in our algorithm, all except possibly one of the subpaths are saturated, that is, they carry precisely one unit of flow. Since no two of these subpaths are contained in a same flow path of f and since the flow value of f is bounded from above by k, we added only O(k) hot spots for the pair u, v. Since there are at most r2 pairs in R, the claim follows. Definition 1. A hot spot u ∈ H is good if the congestion on any edge incident on u is bounded by c · logloglogkrkr , where c is a sufficiently large constant; otherwise, u is bad. Lemma 3. Let u ∈ H be a hot spot. Then the probability that u is bad is at most 1/(k 2 r3 ). Proof. Let e1 = uv1 , . . . , e` = uv` be the edges incident on u and let fi be the total flow on edge uvi for i = 1, . . . , `. By Lemma 1, we have that fi ≤ 2. Since any flow path visits at most two of the edges incident P` on u, the total flow i=1 fi on the edges incident on u is at most 2k. P For any i = 1, . . . , `, we have that fi = P : P 3eP f (P ), where P runs over the set of all paths connecting i some terminal pair and containing ei . Let fij = P ∈P(sj ,tj ) : P 3ei f (P ) be the total amount of flow sent across ei by terminal pair (sj , tj ). Recall that xj is the total flow sent for terminal pair (sj , tj ). The probability that the randomized rounding procedure picks path P with P ∈ P(sj , tj ) is precisely xj · fx(p) = f (p). j Given the disjointness of the respective events, the probability that pair (sj , tj ) routes a path across ei is precisely fij . Let Xij be the binary P random variable indicating whether pair (sj , tj ) routes a path across ei . Then Pr [Xij = 1] = fij . Let Xi = j Xij be the P number ofPpaths routed across ei by the algorithm. By linearity of expectation, we have that E [Xi ] = j E [Xij ] = j fij = fi . 7 Fix any edge ei . Set δ = c · logloglogkrkr and δ 0 = 2 fδi − 1. Note that for fixed i, the variables Xij are independent. Hence, by the Chernoff bound, we have that  Pr Xi ≥ c · !fi  0 log kr eδ 0 ≤ Pr [Xi ≥ (1 + δ )fi ] < log log kr (1 + δ 0 )1+δ0  2δ  −2δ log kr 0 δ fi fi · ≤ fi e−c log log kr· log log kr ≤ 3 3 . ≤ 2 e 2k r Here, we use that fi ≤ 2 for the second last inequality and for the last inequality we pick c0 sufficiently large by making c and k sufficiently large. (Note that MaxEDP can be solved efficiently for constant k.) Now, using the union bound, P we can infer that the probability that any of the edges incident on u carries more than δ paths is at most i fi /(2k 3 r3 ) ≤ (2k)/(2k 3 r3 ) = 1/(k 2 r3 ). Lemma 4. Assume that every hot spot is good. Then the congestion on any edge is bounded by 2c logloglogkrkr . Proof. Consider an arbitrary edge e = uv that is not incident on any hot spot. In particular, this means that e lies in the forest F = G − R. A hot spot z in F is called direct to u (or v) if the path in F from z to u (or v) neither contains e nor any hot spot other than z. Now observe that there can be only one hot spot z direct to u and only one hot spot z 0 direct to v. If there was a second hot spot z 00 = 6 z direct to u then there would have to be yet another hot spot at the node where the path Pz from z to u joins the path from z 00 to u contradicting the choice of z. Let Pz0 be the path from z 0 to v in F . Moreover, let ez be the edge incident on z on path Pz and let ez0 be the edge incident on z 0 on path Pz0 . Now let P be an arbitrary path that is routed by our algorithm and that traverses e. It must visit a hot spot. If P visited neither z nor z 0 , then P would contain a hot spot direct to u or to v that is distinct from z and z 0 —a contradiction. Therefore, P contains ez or e0z . The claim now follows from the fact that this holds for any path traversing e, that z and z 0 are good, and that therefore at most 2c logloglogkrkr paths visit ez or e0z . Theorem 6. The algorithm from Sect. 3.1  produces—with constant probability—a routing with Ω(OPT)  log kr paths, such that the congestion is O log log kr . Proof. As argued above, we route less than OPT /2 paths with probability at most 1/2. By Lemma 2, there are O(kr2 ) hotspots. The probability that at least one of these hot spots is bad is O(kr2 /(k 2 r3 )) = O(1/(kr)), by Lemma 3. Hence, with constant probability, we route at least OPT /2 pairs with congestion at most 2c logloglogkrkr , by Lemma 4. 4 Refined Approximation Bound for MaxEDP In this section, we provide an improved approximation guarantee for MaxEDP without congestion, thereby proving Theorem 2. (In contrast to the previous section, we do not assume here that all terminals are contained in the feedback vertex set.) 4.1 Irreducible Routings with Low Congestion We first develop the concept of irreducible routings with low congestion, which is (besides Theorem 1) a key ingredient of our strengthened bound on the approximability of MaxEDP based on the feedback vertex number. Consider any multigraph G and any set P of (not necessarily simple) paths in G with congestion c. We say that an edge e is redundant in P if there is an edge e0 6= e such that the set of paths in P covering (containing) e is a subset of the set of paths in P covering e0 . 8 Definition 2. Set P is called an irreducible routing with congestion c if each edge belongs to at most c paths of P and there is no edge redundant in P. In contrast to a feasible routing of an MaxEDP instance, we do not require an irreducible routing to connect a set of terminal pairs. If there is an edge e redundant in P, we can apply the following reduction rule: We contract e in G and we contract e in every path of P that covers e. By this, we obtain a minor G0 of G and a set P 0 of paths that consists of all the contracted paths and of all paths in P that were not contracted. Thus, there is a one-to-one correspondence between the paths in P and P 0 . We make the following observation about P and P 0 . Observation 1. Any subset of paths in P 0 is edge-disjoint in G0 if and only if the corresponding subset of paths in P is edge-disjoint in G. Since the application of the reduction rule strictly decreases the number of redundant edges, an iterative application of this rule yields an irreducible routing on a minor of the original graph. Theorem 7. Let G be a minor-closed class of multigraphs and let pG > 0. If for each graph G ∈ G and every non-empty irreducible routing S of G with congestion c there exists a path in S of length at most pG , then the average length of the paths in S is at most c · pG . Proof. Take a path P0 of length at most pG . Contract all edges of P0 in G and obtain a minor G0 ∈ G of G. For each path in S contract all edges shared with P0 to obtain a set S 0 of paths. Remove P0 along with all degenerated paths from S 0 , thus |S 0 | < |S|. Note that S 0 is an irreducible routing of G0 with congestion c. We repeat this reduction procedure recursively on G0 and S 0 until S 0 is empty which happens after at most |S| steps. At each step we decrease the total path length by at most c · pG . Hence, the total length of paths in S is at most |S| · c · pG . As a consequence of Theorem 7, we get the following result for forests. Lemma 5. Let F be a forest and let S be a non-empty irreducible routing of F with congestion c. Then the average path length in S is at most 2c. Proof. We show that S contains a path of length as most 2. The lemma follows immediately by applying Theorem 7. Take any tree in F , root it with any node and consider a leaf v of maximum depth. Let e1 and e2 be the first two edges on the path from v to the root. By definition of irreducible routing, the set of all paths covering e1 is not a subset of the paths covering e2 , hence, e1 is covered by a path which does not cover e2 . Since all other edges incident to e1 end in a leaf, this path has length at most 2. Note that the bound provided in Lemma 5 is actually tight up to a constant. Let c ≥ 1 be an arbitary integer. Consider a graph that is a path of length c − 1 with a star of c − 1 leafs attached to one of its end points. The c − 1 many paths of length c together with the 2c − 2 many paths of length 1 form an irreducible routing with congestion c. The average path length is ((c − 1)c + (2c − 2))/(3c − 3) = (c + 2)/3. 4.2 Approximation Algorithm Consider an instance (G, M) of MaxEDP, and let r be the size of a feedback vertex set  R in G. Using our log kr result of Sect. 3, we can efficiently compute a routing P with congestion c := O log log kr containing Ω(OPT) paths. √  Below we argue how to use the routing P to obtain a feasible routing of cardinality Ω |P|/(c1.5 r) ,  √ which yields an overall approximation ratio of O r · log1.5 rk ; that will prove Theorem 2. p Let r0 = r/c. We distinguish the following cases. Case 1: At least half of the paths in P visit at most r0 nodes of the feedback vertex set R. Let P be the subset of these paths. As long as there is an edge e not adjacent to R that is redundant in P 0 , we iteratively 9 apply the reduction rule from Sect. 4.1 on e. Let G0 be the obtained minor of G with forest F 0 = G0 − R, and let P 0 be the obtained set of (not necessarily simple) paths corresponding to P. By Observation 1, it suffices to show that there is a subset P00 ⊆ P 0 of pairwise edge-disjoint paths of size |P0 | = Ω (|P|/(cr0 )) in order to obtain a feasible routing for (G, M) of size Ω (|P|/(cr0 )). To obtain P00 , we first bound the total path length in P 0 . Removing R from G0 “decomposes” the set P 0 into a set S := {S is a connected component of P ∩ F | P ∈ P 0 } of subpaths lying in F 0 . Observe that S is an irreducible set of F 0 with congestion c, as the reduction rule is not applicable anymore. (Note that a single path in P 0 may lead to many paths in the cover S which are considered distinct.) Thus, by Lemma 5, the average path length in S is at most 2c. Let P be an arbitrary path in P 0 . Each edge on P that is not in a subpath in S is incident on a node in R, and each node in R is incident on at most two edges in P . Together with the fact that P visits at most r0 nodes in R and P that the average length of the subpaths in S is at most 2c, we can upper bound the total path length P ∈P 0 |P | by |P 0 |r0 (2c + 2). Let P 00 be the set of the |P 0 |/2 shortest paths in P 0 . Hence, each path in P 00 has length at most 4r0 (c + 1). We greedily construct a feasible solution P00 by iteratively picking an arbitrary path P from P 00 adding it to P00 and removing all paths from P 00 that share some edge with P (including P itself). We stop when P 00 is empty. As P 00 has congestion c, √ weremove at most 4r0 c(c + 1) paths from P 00 per iteration. 0 00 0 1.5 Thus, |P0 | ≥ |P |/(4r c(c + 1)) = Ω |P|/(c r . Case 2: At least half of the paths in P visit at least r0 nodes of the feedback vertex set R. Let P 0 be the subset of these paths. Consider each path in P 0 as a flow of value 1/c and let f be the sum of all these flows. Note that f provides a feasible solution to the MaxEDP LP relaxation for (G, M ) of value at least |P|/(2c). Note that each such flow path contributes 1/c unit of flow to each of the r0 nodes in R it visits. Since every flow path in f has length at least r0 , the total inflow of the nodes in R is at least |f |r0 . By averaging, there must be a node v ∈ R of inflow at least r0 |f |/r = |f |/r0 . Let f 0 be the subflow of f consisting of all flow paths visiting v. This subflow corresponds to a feasible solution (f 0 , x0 ) of the LP relaxation of value at P least |f |/r0 ≥ |P|/(2cr0 ). Using Proposition 1, we can recover an integral feasible routing of size at √  1 least 12 i x0i ≥ |P|/(24cr0 ) = Ω |P|/(c1.5 r . This completes the proof of Theorem 2. 5 Fixed-Parameter Algorithm for MaxNDP We give a fixed-parameter algorithm for MaxNDP with run time (k + r)O(r) · n, where r is the size of a minimum feedback vertex set in the given instance (G, M). A feedback vertex set R of size r can be computed in time 2O(r) · O(n) [36]. By the matching assumption, each terminal in M is a leaf. We can thus assume that none of the terminals is contained in R. Consider an optimal routing P of the given MaxNDP instance. Let MR ⊆ M be the set of terminal pairs that are connected via P by a path that visits at least one node in R. Let P ∈ P be a path connecting a terminal pair (si , ti ) ∈ MR . This path has the form (si , . . . , r1 , . . . , r2 , . . . , r` , . . . , ti ), where r1 , . . . , r` are the nodes in R that are traversed by P in this order. The pairs (si , r1 ), (r` , ti ) and (rj , rj+1 ) with j = 1, . . . , ` − 1 are called essential pairs for P . A node pair is called essential if it is essential for some path in P. Let Me be the set of essential pairs. Let F be the forest that arises when deleting R from the input graph G. Let (u, v) be an essential pair. A u-v path P in G is said to realize (u, v) if all internal nodes of P lie in F . A set P 0 of paths is said to realize Me if every pair in Me is realized by some path in P 0 and if two paths in P 0 can only intersect at their end nodes. Note that the optimal routing P induces a natural realization of Me , by considering all maximal subpaths of paths in P whose internal nodes all lie in F . Conversely, for any realization P 0 of Me , we can concatenate paths in P 0 to obtain a feasible routing that connects all terminal pairs in MR . Therefore, we consider P 0 (slightly abusing notation) also as a feasible routing for MR . In our algorithm, we first guess the set Me (and thus MR ). Then, by a dynamic program, we construct two sets of paths, Pe and PF where Pe realizes Me and PF connects in F a subset of MR := M \ MR . In 10 our algorithm, the set Pe ∪ PF forms a feasible routing that maximizes |PF | and routes all pairs in MR . (Recall that we consider the realization Pe of Me as a feasible routing for MR .) Now assume that we know set Me . We will describe below a dynamic program that computes an optimum routing in time 2O(r) (k + r)O(1) n. For the sake of easier presentation, we only describe how to compute the cardinality of such a routing. We make several technical assumptions that help to simplify the presentation. First, we modify the input instance as follows. We subdivide every edge incident on a node in R by introducing a single new node on this edge. Note that this yields an instance equivalent to the input instance. As a result, every neighbor of a node in R that lies in F , that is, every node in NG (R), is a leaf in F . Moreover, the set R is an independent set in G. Also recall that we assumed that every terminal is a leaf. Therefore, we may assume that R does not contain any terminal. We also assume that forest F is a rooted tree, by introducing a dummy node (which plays the role of the root) and arbitrarily connecting this node to every connected component of F by an edge. In our dynamic program, we will take care that no path visits this root node. We also assume that F is an ordered tree by introducing an arbitrary order among the children of each node. For any node v, let Fv be the subtree of F rooted at v. Let cv := degF (v) − 1 be the number of children of v and let v1 , . . . vcv be the (ordered) children of v. Then, for i = 1, . . . , cv , let Fvi denote the subtree of Fv induced by the union of v with the subtrees Fv1 , . . . , Fvi . For leaves v, we define Fv0 as Fv = v. We introduce a dynamic programming table T . It contains an entry for every Fvi and every subset M0e of Me . Roughly speaking, the value of such an entry is the solution to the subproblem, where we restrict the forest to Fvi , and the set of essential pairs to M0e . More precisely, table T contains five parameters. Parameters v and i describing Fvi , parameter M0e , and two more parameters u and b. Parameter u is either a terminal, or a node in R, and b is in one of the three states: free, to-be-used , or blocked . The value T [v, i, M0e , u, b] is the maximum cardinality of a set PF of paths with the following properties: 1. PF is a feasible routing of some subset of MR . 2. PF is completely contained in Fvi . 3. There is an additional set Pe of paths with the following properties: (a) Pe is completely contained in Fvi ∪ R and node-disjoint from the paths in PF . (b) Pe is a realization of M0e ∪ {(u, v)} if b = to-be-used . Else, it is a realization of M0e . (c) There is no path in Pe ∪ PF visiting v if b = free. If no such set PF exists then T [v, i, M0e , u, b] is −∞. Note that the parameter u is only relevant when b = to-be-used (otherwise, it can just be ignored). Observe that T [v, i, M0e , u, blocked ] ≥ T [v, i, M0e , u, free] ≥ T [v, i, M0e , u, to-be-used ]. Below, we describe how to compute the entries of T in a bottom-up manner. In the base case v is a leaf. We set T [v, 0, ∅, u, free] = 0. Then we set T [v, 0, M0e , u, blocked ] = 0 if M0e is either empty, consists of a single pair of nodes in R ∩ NG (v), or consists of a single pair where one node is v and the other one is in R ∩ NG (v). Finally, we set T [v, 0, ∅, u, to-be-used ] = 0 if u = v or u is in R ∩ NG (v). For all other cases where v is a leaf, we set T [v, i, M0e , u, b] = −∞. For the inductive step, we consider the two cases i = 1 and i > 1. Let i = 1. It holds that T [v, 1, M0e , u, to-be-used ] = T [v1 , cv , M0e , u, to-be-used ] since the path in Pe realizing (u, v) has to start at a leaf node of Fv1 . It also holds that T [v, 1, M0e , u, blocked ] and T [v, 1, M0e , u, free] are equal to T [v1 , cv , M0e , u, blocked ]. Now, let i > 1. In a high level view, we guess which part of M0e is realized in Fvi−1 ∪ R and which part is realized in Fvi ∪ R. For this, we consider every tuple (M0e1 , M0e2 ) such that M0e1 ] M0e2 is a partition of M0e . By our dynamic programming table, we find a tuple that maximizes our objective. In the following, we assume that we guessed (M0e1 , M0e2 ) correctly. Let us consider the different cases of b in more detail. For b = free, node v is not allowed to be visited by any path, especially by any path in Fvi−1 ∪ R. Hence, T [v, i, M0e , u, free] is equal to T [v, i − 1, M0e1 , u, free] + T [vi , cvi , M0e2 , u, blocked ] . 11 In the case of b = to-be-used , we have to realize (u, v) in Fvi ∪ R. For this, there are two possibilities: Either (u, v) is realized by a path in Fvi−1 ∪ R, or there is a realizing path that first goes through Fvi ∪ R and then reaches v via the edge (vi , v). Hence, for the first case, we consider T [v, i − 1, M0e1 , u, to-be-used ] + T [vi , cvi , M0e2 , u, blocked ], for the second case, we consider T [v, i − 1, M0e1 , u, free] + T [vi , cvi , M0e2 , u, to-be-used ] . Maximizing over both, we obtain T [v, i, M0e , u, to-be-used ]. For the case of b = blocked , we will consider two subcases. In the first subcase, there is no path in Pe ∪ PF going through edge (vi , v), hence, we get T [v, i − 1, M0e1 , u, blocked ] + T [vi , cvi , M0e2 , u, blocked ] . In the second subcase, there is a path P in Pe ∪ PF going through edge (vi , v). Since P is connecting two leafs in Fvi , a part of P is in Fvi−1 ∪ R and the other part is in Fvi ∪ R. If P ∈ Pe , then it is realizing a pair of M0e . Hence, for every pair (u1 , u2 ) ∈ M0e , we have to consider the term T [v, i − 1, M0e1 − (u1 , u2 ), u1 , to-be-used ] + T [vi , cvi , M0e2 − (u1 , u2 ), u2 , to-be-used ] and the symmetric term where we swap u1 and u2 . If P ∈ PF , then it is realizing a terminal pair of MR . Hence, for every pair (u1 , u2 ) ∈ MR we get the term 1 + T [v, i − 1, M0e1 , u1 , to-be-used ] + T [vi , cvi , M0e2 , u2 , to-be-used ] and the symmetric term where we swap u1 and u2 . Note that we count the path realizing (u1 , u2 ) in our objective. Maximizing over all the terms of the two subcases, we obtain T [v, i, M0e , u, to-be-used ]. Let us analyze the run time of algorithm described in Sect. 5. In order to guess Me , we enumerate all potential sets of essential pairs. There are at most (2k + r + 1)2r candidate sets to consider, since each pair contains a node in R, and each node in R is paired with at most two other nodes each of which is either a terminal or another node in R. For each particular guess Me , we run the above dynamic program. 0 The number P of entries in T —as2rspecified by the five parameters v, i, Me , u and b—for each fixed Me is at most ( v∈V (F ) degF (v)) × 2 × (2k + r) × 3. For the computation of each such entry, we consider all combinations of at most 22r partitions of M0e with either at most r essential pairs in M0e , or with at most k terminal pairs in MR . Altogether, this gives a run time of (8k + 8r)2r+2 · O(n). This finishes the proof of Theorem 3. 6 Parameterized Intractability of MaxNDP for Parameter r In this section we show that MaxNDP is W[1]-hard parameterized by the size r of a feedback vertex set. This reduction was originally devised for parameter treedepth, by Ene et al. [21]; here we notice that the same reduction also works for parameter r. (Both treedepth and feedback vertex set number are restrictions of treewidth, but they are incomparable to each other.) For sake of completeness, we include the reduction here, and argue about the feedback vertex set number of the reduced graph. The reduction is from the W [1]-hard Multicolored Clique problem [22], where given a graph G, an integer k, and a partition V = V 1 ] V 2 ] . . . ] V k , we are to check if there exists k-clique in G with exactly one vertex in every set V i . By adding dummy vertices, we can assume that |V i | = n for every i = 1, . . . , k, and that n, k ≥ 2. Construction. Given an instance (G, k, (V i )ki=1 ) of Multicolored Clique, we aim at constructing an equivalent instance (H, M, `) of MaxNDP. 12 We start with a construction, for every set V i , a gadget W i as follows. First, for every v ∈ V i we construct a (k − 1)-vertex path Xvi on vertices xiv,1 , xiv,2 , . . . , xiv,i−1 , xiv,i+1 , . . . , xiv,k . Second, we select an arbitrary vertex ui ∈ Vi . Third, for every v ∈ V i \ {ui }, we add a vertex siv adjacent to the first vertex of Xvi (i.e., xiv,1 and xiui ,1 if i > 1 or xiv,2 and xiu1 ,2 if i = 1), a vertex tiv adjacent to the last vertex of Xvi (i.e., xiv,k and xiui ,k if i < k or xiv,k−1 and xiui ,k−1 if i = k), and make (siv , tiv ) a terminal pair. This concludes the description of the gadget W i . By Mst we denote the set of terminal pairs constructed in this step. To encode adjacencies in G, we proceed as follows. For every pair 1 ≤ i < j ≤ k, we add a vertex pi,j , adjacent to all vertices xiv,j for v ∈ Vi and all vertices xju,i for u ∈ Vj . For every edge vu ∈ E(G) with v ∈ Vi and u ∈ Vj , we add a terminal pair (xiv,j , xju,i ). Let Mx be the set of terminal pairs constructed in this step; we have M = Mst ∪ Mx .  Finally, we set the required number of paths ` := k(n − 1) + k2 . This concludes the description of the instance (H, M, `). From a clique to disjoint paths. Assume that the input Multicolored Clique instance is a “yes”instance, and let {v i | i = 1, . . . , k} be a clique in G with v i ∈ V i for i = 1, . . . , k. We construct a family of ` vertex-disjoint paths as follows. First, for i = 1, . . . , k and every v ∈ V i \ {ui }, we route a path from siv to tiv through the path Xvi if v 6= v i , and through the path Xui i if v = v i . Note that in this step we have i created k(n − 1) vertex-disjoint paths connecting terminal pairs, and  in every gadget W the only unused k i vertices are vertices on the path Xvi . To construct the remaining 2 paths, for every pair 1 ≤ i < j ≤ k we take the 3-vertex path from xivi ,j to xjvj ,i through pi,j ; note that the assumption that v i v j ∈ E(G) ensures that (xivi ,j , xjvj ,i ) is indeed a terminal pair in M. From disjoint paths to a clique. In the other direction, let P be a family of ` vertex-disjoint paths connecting terminal pairs in H. Let Pst ⊆ P be the set of paths connecting terminal pairs from Mst , and similarly define Px . First, observe that the set P = {pi,j | 1 ≤ i < j ≤ k} separates every terminal pair   from Mx . Hence, every path from Px contains at least one vertex from P . Since |P | = k2 , we have |Mx | ≤ k2 ,  and, consequently, |Pst | ≥ ` − k2 = k(n − 1) = |Mst |. We infer that Pst routes all terminal pairs in Mst  without using any vertex of P , while Px routes k2 pairs from Px , and every path from Px contains exactly one vertex from P . Since the paths in Pst cannot use any vertex in P , every such path needs to be contained inside one gadget W i . Furthermore, observe that a shortest path between terminals siv,a and tiv,a inside W i is either Xui i or Xvi , prolonged with the terminals at endpoints, and thus contains k + 1 vertices. Furthermore, a shortest path between two terminals in Mx contains three vertices. We infer that the total number of vertices on paths in P is at least   k |Pst | · (k + 1) + |Px | · 3 = k(n − 1)(k + 1) + 3 2   k = k (n(k − 1) + 2(n − 1)) + = |V (H)| . 2 We infer that every path in Pst consists of k + 1 vertices, and every path in Px consists of three vertices. In particular, for i = 1, . . . , k and v ∈ V i \ {ui }, the path in Pst that connects siv and tiv goes either through Xvi or Xui i . Consequently, for i = 1, . . . , k there exists a vertex v i ∈ V i such that the vertices of W i that do not lie on any path from Pst are exactly the vertices on the path Xvi i .  We claim that {v i | i = 1, . . . , k} is a clique in G. To this end, consider a pair 1 ≤ i < j ≤ k. Since |Px | = k2 , there exists a path in Px that goes through pi,j . Moreover, this path has exactly three vertices. Since the only neighbours of pi,j that are not used by paths from Pst are xivi ,j and xjvj ,i , we infer that (xivi ,j , xjvj ,i ) ∈ M and, consequently, v i v j ∈ E(G). This concludes the proof of the correctness of the construction. Bounding the feedback vertex set number. We are left with a proof that H has bounded feedback vertex set number. 13 To this end, first observe that H − P contains k connected components, being the gadgets W i . Second, observe that the deletion of the endpoints of the path Xui i from the gadget W i breaks W i into connected components being paths on at most k + 1 vertices. Consequently, H has a feedback vertex set R consisting of P and {xiui ,1 , xiui ,k ∈ V (W i ) | i = 1, . . . , k}, of size |R| = O(k 2 ). This finishes the proof of Theorem 4. 7 Hardness of Edge-Disjoint Paths in Almost-Forests In this section we show that EDP (and hence MaxEDP) is NP-hard already in graphs that are almost forests, namely, in graphs that are forests after deleting two nodes. That is, we prove Theorem 5. Proof of Theorem 5. We first show NP-hardness of EDP for r = 2. We reduce from the problem Edge 3-Coloring in cubic graphs, which is NP-hard [26]. Given a cubic graph H, we construct a complete bipartite graph G, where one of the two partite classes of V (G) consists of three nodes {v1 , v2 , v3 }, and the other partite class consists of V (H). As terminal pairs, we create the set M = {(s, t) | {s, t} ∈ E(H)}; in words, we want to connect a pair of nodes by a path in G if and only if they are connected by an edge in H. This completes the construction of the instance (G, M) of MaxEDP. Notice that G has a feedback vertex set of size r = 2, since removing any size-2 subset of {v1 , v2 , v3 } from G yields a forest. Regarding correctness of the reduction, we show that H is 3-edge-colorable if and only if all pairs in M can be routed in G. In the forward direction, suppose that H is 3-edge-colorable. Let ϕ : E(H) → {1, 2, 3} be a proper 3-edgecoloring of H. For c = 1, 2, 3, let Ec ⊆ E(H) be the set of edges that receive color c under ϕ. Then there is a routing in G that routes all terminal pairs {(s, t) ∈ M | {s, t} ∈ Ec } exclusively via the node vc (and thus via paths of length 2). Notice that this routing indeed yields edge-disjoint paths, for if there are distinct vertices s, t1 , t2 ∈ V (H) and edges e1 = {s, t1 }, e2 = {s, t2 } ∈ E(H), then e1 , e2 receive distinct colors under ϕ (as ϕ is proper), and so the two terminal pairs {s, t1 }, {s, t2 } are routed via distinct nodes c1 , c2 ∈ {v1 , v2 , v3 }, and thus also via edge-disjoint paths. In the backward direction, suppose that all terminal pairs in M can be routed in G. Since H is cubic, any node s ∈ V (H) is contained in three terminal pairs. Therefore, no path of the routing can have a node in V (H) as an internal node and thus all paths in the routing have length 2. Then this routing naturally corresponds to a proper 3-edge-coloring ϕ of H, where any terminal pair {s, t} routed via c means that we color the edge {s, t} ∈ E(H) with color c under ϕ. In order two show NP-hardness of MaxEDP for r = 1, we also reduce from Edge 3-Coloring in cubic graphs and perform a similar construction as described above: This time, we construct a bipartite graph G with one subset of the partition being {v1 , v2 }, the other being V (H), and the set M of terminal pairs being again specified by the edges of H. This completes the reduction. The resulting graph G has a feedback vertex set of size r = 1. We claim that H is 3-colorable if and only if we can route n = |V (H)| pairs in G. In the forward direction, suppose that H is 3-edge-colorable. Let ϕ : E(H) → {1, 2, 3} be a proper 3-edgecoloring of H. For c = 1, 2, 3, let Ec ⊆ E(H) be the set of edges that receive color c under ϕ. Then there is a routing in G that routes all f {(s, t) ∈ M | {s, t} ∈ Ec } exclusively via the node vc (and thus via paths of length 2) for the colors c = 1, 2. (The terminals corresponding to edges receiving color 3 remain unrouted.) The reasoning that the resulting routing is feasible is analogous to the case of r = 2. Since for each of the n terminals exactly two of the three terminal pairs are routed, this means that precisely n terminal pairs are routed overall. In the backward direction, suppose that n terminal pairs in M can be routed in G. Since any terminal v in G is a node in V (H) has therefore has degree two in G, this means that at most two paths can be routed for v. As n terminal pairs are realized, this also means that exactly two paths are routed for each terminal. Hence, none of the paths in the routing has length more than two. Otherwise, it would contain an internal node in V (H), which then could not be part of two other paths in the routing. Then this routing naturally corresponds to a partial edge-coloring of H, where any terminal pair {s, t} routed via c means that we color the edge {s, t} ∈ E(H) with color c. Since each terminal v in V (H) is involved in exactly two paths 14 in the routing, exactly one terminal pair for v remains unrouted. Hence, exactly one edge incident on v in H remains uncolored in the partial coloring. We color all uncolored edges in H by color 3 to obtain a proper 3-coloring. Thus, we almost close the complexity gap for EDP with respect to the size of a minimum feedback vertex set, only leaving the complexity of the case r = 1 open. We conjecture that this case can be solved in polynomial time. References [1] I. Adler, S. G. Kolliopoulos, P. K. Krause, D. Lokshtanov, S. Saurabh, and D. Thilikos. Tight bounds for linkages in planar graphs. In Proc. ICALP 2011, volume 6755 of Lecture Notes Comput. Sci., pages 110–121, 2011. [2] M. Andrews. Approximation algorithms for the edge-disjoint paths problem via Räcke decompositions. In Proc. FOCS 2010, pages 277–286, 2010. [3] M. Andrews, J. Chuzhoy, V. Guruswami, S. Khanna, K. Talwar, and L. Zhang. Inapproximability of edge-disjoint paths and low congestion routing on undirected graphs. Combinatorica, 30(5):485–520, 2010. [4] Y. Aumann and Y. Rabani. Improved bounds for all optical routing. In Proc. SODA 1995, pages 567–576, 1995. [5] Y. Aumann and Y. Rabani. An O(log k ) approximate min-cut max-flow theorem and approximation algorithm. SIAM J. Comput., 27(1):291–301, 1998. [6] B. Awerbuch, R. Gawlick, T. Leighton, and Y. Rabani. On-line admission control and circuit routing for high performance computing and communication. In Proc. FOCS 1994, pages 412–423, 1994. [7] V. Bafna, P. Berman, and T. Fujito. A 2-approximation algorithm for the undirected feedback vertex set problem. SIAM J. Discrete Math., 12(3):289–297 (electronic), 1999. [8] H. L. Bodlaender, S. Thomassé, and A. Yeo. Kernel bounds for disjoint cycles and disjoint paths. Theoret. Comput. Sci., 412(35):4570–4578, 2011. [9] A. Z. Broder, A. M. Frieze, S. Suen, and E. Upfal. Optimal construction of edge-disjoint paths in random graphs. SIAM J. Comput., 28(2):541–573 (electronic), 1999. [10] A. Z. Broder, A. M. Frieze, and E. Upfal. Existence and construction of edge-disjoint paths on expander graphs. SIAM J. Comput., 23(5):976–989, 1994. [11] C. Chekuri and A. Ene. Poly-logarithmic approximation for maximum node disjoint paths with constant congestion. In Proc. SODA 2013, pages 326–341, 2013. √ [12] C. Chekuri, S. Khanna, and F. B. Shepherd. An O( n) approximation and integrality gap for disjoint paths and unsplittable flow. Theory Comput., 2:137–146, 2006. [13] C. Chekuri, S. Khanna, and F. B. Shepherd. A note on multiflows and treewidth. Algorithmica, 54(3):400–412, 2009. [14] C. Chekuri, M. Mydlarz, and F. B. Shepherd. Multicommodity demand flow in a tree and packing integer programs. ACM Trans. Algorithms, 3(3):Art. 27, 23, 2007. [15] C. Chekuri, G. Naves, and F. B. Shepherd. Maximum edge-disjoint paths in k-sums of graphs. In Proc. ICALP 2013, volume 7965 of Lecture Notes Comput. Sci., pages 328–339, 2013. 15 [16] C. Chekuri, G. Naves, and F. B. Shepherd. Maximum edge-disjoint paths in k-sums of graphs. CoRR, abs/1303.4897, 2013. [17] C. Chekuri, F. B. Shepherd, and C. Weibel. Flow-cut gaps for integer and fractional multiflows. J. Comb. Theory, Ser. B, 103(2):248–273, 2013. [18] J. Chuzhoy. Routing in undirected graphs with constant congestion. In Proc. STOC 2012, pages 855–874, 2012. [19] J. Chuzhoy, D. H. K. Kim, and S. Li. Improved approximation for node-disjoint paths in planar graphs. In Proc. STOC 2016, 2016. to appear. [20] J. Chuzhoy and S. Li. A polylogarithmic approximation algorithm for edge-disjoint paths with congestion 2. In Proc. FOCS 2012, pages 233–242, 2012. [21] A. Ene, M. Mnich, M. Pilipczuk, and A. Risteski. On routing disjoint paths in bounded treewidth graphs. In Proc. SWAT 2016, LIPIcs, 2016. to appear. [22] M. R. Fellows, D. Hermelin, F. Rosamond, and S. Vialette. On the parameterized complexity of multiple-interval graph problems. Theoret. Comput. Sci., 410(1):53–61, 2009. [23] A. M. Frieze. Edge-disjoint paths in expander graphs. SIAM J. Comput., 30(6):1790–1801 (electronic), 2001. [24] N. Garg, V. V. Vazirani, and M. Yannakakis. Primal-dual approximation algorithms for integral flow and multicut in trees. Algorithmica, 18(1):3–20, 1997. [25] O. Günlük. A new min-cut max-flow ratio for multicommodity flows. SIAM J. Discrete Math., 21(1):1–15, 2007. [26] I. Holyer. The NP-completeness of edge-coloring. SIAM J. Comput., 10(4):718–720, 1981. [27] R. Karp. On the computational complexity of combinatorial problems. Networks, 5:45–68, 1975. [28] K. Kawarabayashi and P. Wollan. A shorter proof of the graph minor algorithm: the unique linkage theorem. In Proc. STOC 2010, pages 687–694, 2010. [29] K.-i. Kawarabayashi and Y. Kobayashi. Breaking O(n1/2 )-approximation algorithms for the edge-disjoint paths problem with congestion two. In Proc. STOC 2011, pages 81–88, 2011. [30] J. Kleinberg and R. Rubinfeld. Short paths in expander graphs. In Proc. FOCS 1996, pages 86–95, 1996. [31] J. Kleinberg and É. Tardos. Disjoint paths in densely embedded graphs. In Proc. FOCS 1995, pages 52–61, Oct 1995. [32] J. Kleinberg and É. Tardos. Approximations for the disjoint paths problem in high-diameter planar networks. J. Comput. System Sci., 57(1):61–73, 1998. [33] S. Kolliopoulos and C. Stein. Approximating disjoint-path problems using packing integer programs. Math. Prog., 99(1):63–87, 2004. [34] T. Leighton and S. Rao. Multicommodity max-flow min-cut theorems and their use in designing approximation algorithms. J. ACM, 46(6):787–832, 1999. [35] N. Linial, E. London, and Y. Rabinovich. The geometry of graphs and some of its algorithmic applications. Combinatorica, 15(2):215–245, 1995. [36] D. Lokshtanov, M. S. Ramanujan, and S. Saurabh. Linear time parameterized algorithms for subset feedback vertex set. In Proc. ICALP 2015, pages 935–946, 2015. 16 [37] T. Nishizeki, J. Vygen, and X. Zhou. The edge-disjoint paths problem is NP-complete for series-parallel graphs. Discrete Appl. Math., 115(1-3):177–186, 2001. [38] P. Raghavan and C. D. Tompson. Randomized rounding: A technique for provably good algorithms and algorithmic proofs. Combinatorica, 7(4):365–374, 1987. [39] S. Rao and S. Zhou. Edge disjoint paths in moderately connected graphs. SIAM J. Comput., 39(5):1856– 1887, 2010. [40] N. Robertson and P. D. Seymour. Graph minors. XIII. The disjoint paths problem. J. Combin. Theory Ser. B, 63(1):65–110, 1995. [41] P. Scheffler. A practical linear time algorithm for disjoint paths in graphs with bounded tree-width. Technical Report TR 396/1994, FU Berlin, Fachbereich 3 Mathematik, 1994. [42] L. Séguin-Charbonneau and F. B. Shepherd. Maximum edge-disjoint paths in planar graphs with congestion 2. In Proc. FOCS 2011, pages 200–209, 2011. 17
8cs.DS
DRAFT arXiv:1608.01036v1 [cs.DS] 3 Aug 2016 Fast and Lean Immutable Multi-Maps on the JVM based on Heterogeneous Hash-Array Mapped Tries Michael J. Steindorfer Jurgen J. Vinju Centrum Wiskunde & Informatica, The Netherlands [email protected] Centrum Wiskunde & Informatica, The Netherlands TU Eindhoven, The Netherlands INRIA Lille, France [email protected] Abstract which acts as an associative array storing possibly multiple values with a specific key. Typically multi-maps are used to store graphs or many-to-many relations. Many-to-many relations or graphs in general occur naturally in application areas such as static analysis of objectoriented software. In some applications it is the case that the initial raw data is many-to-one, and further processing or exploration incrementally leads to a many-to-many mapping for some of the entries. In other applications the distribution of sizes of the range sets in the raw data is highly skewed, such as when representing scale-free networks, like academic citations, the web, online social networks, and program dependence graphs. The number of values associated with a specific key is then practically always very low, yet there are possibly numerous exceptions to cater for nevertheless, where many values end up being associated with the same key. A key insight in the current paper is that we can exploit these highly common skewed distributions to save memory for the most frequent cases. On the JVM relations are not natively language-supported; rather the standard libraries of Java, Scala and Clojure either provide implementations of multi-maps, or the map and set Application Program Interfaces (APIs) allow programmers to construct multi-maps easily in a type-safe manner (i.e., using sets as the values of a normal polymorphic map). The goal of this paper is to overcome the limitations of these existing implementations of multi-maps, improving drastically on the memory footprint without loss of storage, lookup and iteration efficiency. Typically state-of-the-art multi-maps come with a mode of 65 B overhead per stored key/value item, while the most compressed new encoding in this paper reaches an optimum of 30 B. In general the encoding has 2 x smaller footprints (modal) when storing reference objects, and 4 x smaller footprints when storing Java primitive values. On the JVM, immutable collections are used mostly by functional/object-oriented programmers from the Scala and Clojure communities. However, since Java 8 the functional and streaming APIs [4] are becoming mature, making immutable collections become more relevant in the Java context. An immutable multi-map is a many-to-many thread-friendly map data structure with expected fast insert and lookup operations. This data structure is used for applications processing graphs or many-to-many relations as applied in static analysis of object-oriented systems. When processing such big data sets the memory overhead of the data structure encoding itself is a memory usage bottleneck. Motivated by reuse and type-safety, libraries for Java, Scala and Clojure typically implement immutable multi-maps by nesting sets as the values with the keys of a trie map. Like this, based on our measurements the expected byte overhead for a sparse multi-map per stored entry adds up to around 65 B, which renders it unfeasible to compute with effectively on the JVM. In this paper we propose a general framework for HashArray Mapped Tries on the JVM which can store typeheterogeneous keys and values: a Heterogeneous Hash-Array Mapped Trie (HHAMT). Among other applications, this allows for a highly efficient multi-map encoding by (a) not reserving space for empty value sets and (b) inlining the values of singleton sets while maintaining a (c) type-safe API. We detail the necessary encoding and optimizations to mitigate the overhead of storing and retrieving heterogeneous data in a hash-trie. Furthermore, we evaluate HHAMT specifically for the application to multi-maps, comparing them to state-of-the-art encodings of multi-maps in Java, Scala and Clojure. We isolate key differences using microbenchmarks and validate the resulting conclusions on a real world case in static analysis. The new encoding brings the per key-value storage overhead down to 30 B: a 2 x improvement. With additional inlining of primitive values it reaches a 4 x improvement. 1. Introduction This paper is about the challenges of optimizing immutable multi-maps on the Java Virtual Machine (JVM) and how they can be solved using a general method of coding heterogenous hash-array mapped tries. A multi-map is a data structure Fast and Lean Immutable Multi-Maps 1 2016/8/4 Immutability for collections implies referential transparency (without giving up on sharing data) and it satisfies safety requirements for having co-variant sub-types [12]. Because of these properties, immutable collections are also safely shared in presence of concurrency. Our point of departure is the Hash-Array Mapped Trie (HAMT) data structure [2], which has proven to be an efficient immutable alternative to array-based implementations. In contrast to arrays, HAMTs enable fine-grained memory layout optimizations [17]. There exists an optimized encoding [18] of HAMTs tailored the JVM, named Compressed Hash-Array Mapped Prefix-tree (CHAMP). The CHAMP data structure allows for time and memory efficient immutable maps and sets. To efficiently encode multi-maps we propose a generalisation of the CHAMP data structure to allow for heterogeneous data shapes. The new resulting data structure, called Heterogeneous Hash-Array Mapped Trie (HHAMT), unifies design elements from both HAMT and CHAMP. A HHAMT allows for a type-safe API in which keys and values can be represented using different types of data within the same map. This allows for all kinds of optimized data structures, but we focus on multi-maps in this paper as the key purpose. A basic dichotomous HHAMT multi-map is used to either store an inlined single value, or a full nested set data structure. We propose an efficient encoding of HHAMT to mitigate the incurred overhead. 1.1 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 // n-bits (consecutive) class HeterogeneousHamtNode { BitVector bitmap = new BitVector(n * 32); Object[] contentArray; } 22 23 24 25 26 27 } Listing 1. Skeletons of a various HAMTs. internal nodes encode prefix sharing, and the accept nodes may point to values associated with the strings. In a HAMT, the strings are the bits of the hash codes of the elements stored in the trie. A HAMT is memory efficient not only because prefixes are shared, but also because child nodes are only allocated if the prefixes of two or more elements overlap. The first class in Listing 1 (lines 1–8) depicts a typical encoding of a HAMT in Java. A single 32-bit integer bitmap is used to encode which of the 32 trie-branches —and correspondingly which slots in the untyped array— are used, together with a mapping function that calculates offsets in the array by counting bits in the bitmap. In general, a HAMT must be able to distinguish between three possible states for each trie-branch: absence of data, and otherwise distinguishing the data category (either payload, or a subnode). Because a single bit cannot differentiate three different states, additional dynamic checks —such as instanceof— are used for discriminating the data category. Note that data payload and sub-nodes occur in arbitrary order in the array. The second class in Listing 1 (lines 9–18) depicts the skeleton of the CHAMP encoding [18], which operates like a HAMT but uses an explicit encoding to eliminate dynamic instanceof checks. With two bitmaps CHAMP improves the mapping function to regroup the array slots into two separate homogeneously-typed sequences: a sequence of data payload, followed by a sequence of sub-node references. Because each homogeneous sequence uses its own bitmap, CHAMP kept the bitmap processing identical to HAMTs. • Section 2 describes the foundations of HHAMT and identi- fies the main sources of overhead that need to be mitigated. • Section 3 outlines scalable encoding of source code spe- cializations (and their necessary runtime support) to yield memory savings between 2 x and 4 x. • Section 4 compares HHAMT against CHAMP (baseline) to understand the cost of turning a (homogeneous) map into a (heterogeneous) multi-map. • Section 5 compares a specialized HHAMT multi-map against idiomatic solutions from Clojure and Scala. • Section 6 compares the memory footprint of a specialized HHAMT multi-map against state-of-the-art primitive collec- tion libraries (Goldman Sachs, FastUtil, Trove, Mahout). • Section 7 compares the performance of multi-maps in Clojure, and Scala on a realistic case. Section 8 discusses related work and Section 9 enumerates further use cases for heterogeneity, before we conclude in Section 10. Heterogeneous Hash-Trie Data Layout A general trie [8, 9] is a lookup structure for finite strings that acts like a Deterministic Finite Automaton (DFA) without any loops: the transitions are the characters of the strings, the Fast and Lean Immutable Multi-Maps } abstract class HeterogeneousHamtCollection { HeterogeneousHamtNode root; int size; 21 We address the design and evaluation of HHAMT as follows: 2. // 2-bits (distributed) class ChampNode { int datamap; int nodemap; Object[] contentArray; } 12 Contributions and Roadmap HHAMT, abstract class HamtCollection { HamtNode root; int size; // 1-bit + runtime checks (e.g., instanceof) class HamtNode { int bitmap; Object[] contentArray; } } abstract class ChampCollection { ChampNode root; int size; 2 2016/8/4 Summary. In a HAMT, each trie node contains an arbitrary mix of data elements and sub-nodes, therefore array slots require type checks individually. In contrast, CHAMP splits HAMT’s mixed data sequence into two homogeneous sequences, enabling optimizations that were not possible before. A key to performance —when iterating over or batchprocessing elements of homogeneous or heterogeneous data structures— is that individual elements do not need to be checked for its specific type [6]. This is also one of the reasons why the CHAMP performs better than the HAMT. In short: the homogeneous CHAMP data structure provides a good starting point for heterogeneous collections. 2.1 a typed callback interface. Examples can be found in the Appendix. Note that the internals of the HHAMT can always decide upon the type a value with 100 % certainty. 2.3 The heterogeneous skeleton in Listing 1 (lines 19–27) does not exhibit an optimal encoding. We specialize the BitVector code for obtaining better memory performance. Assuming k = 2, we use a single long field as bitmap, for a larger k we would use several consecutive int or long fields. The way we index into the trie node array (for lookup, insertion or deletion) is a key design element. This indexing is different between the original CHAMP encoding and the new HHAMT encoding because there are k-cases to distinguish. Listing 2 shows how CHAMP’s original per-node-bitmap indexing would work if generalized to multiple entry types. By default CHAMP already distinguishes between payload data and nested nodes with separate bitmaps. This baseline (naive) design for heterogeneous hash tries carries on similarly to distinguish more types of references. The masking function (lines 1–3) selects the prefix bits based on the node level in the tree (shift = 5 * level). The index function (line 4–6) requires a bitpos variable with a single non-zero bit, designating one of the 32 possible branches. It then maps from the bitmap/bitpos tuple to a sparse-array index by counting the non-zero bits in bitmap on the right of bitpos. On line 9 a method template for lookup, insertion, and deletion is shown. Because for each of the three data categories a separate bitmap is used the processing happens in a linearscanning manner until the right category for a hash-prefix is matched, or the default case applies (line 31). Although lines 12, 18, and 24 suggest the use of separate bitmaps for each distinct type, two bitmaps are sufficient to distinguish between three cases: Generalizing Towards a Heterogeneous HAMT The third class in Listing 1 (lines 19–27) illustrates the proposed HHAMT skeleton. HHAMT uses a multi-bit encoding like CHAMP but reverts to a sequential representation: one larger bitmap that stores a sequence of 32 n-bit tuples consecutively, instead of at maximum k individual bitmaps. k denotes the maximum number of supported heterogeneous types while n denotes the number of bits needed in our encoding. For any k, a HHAMT requires n = dlog2 (k + 2)e bits at minimum per trie-branch to encode all of its possible states. The two additional states are needed for encoding the absence of a trie branch, and encoding sub-trees in case of hash-prefix collisions. For the sake of clarity we mainly focus on the k = 2 case in the evaluation (Sections 4, 5, 6 and 7), where the required number of bits n = 2. This case covers the scenario of distinguishing between a singleton value, and an arbitrarily sized nested set for multi-map implementations. However in the current section we detail the general design and code for arbitrary k. Note that fixing k does influence efficiency trade-offs: experimental results for k = 2 do not generalize directly to other values of k. 2.2 HHAMT API 1 2 Although this is not a core contribution, since we model data structures beyond the power of Java’s type system, we should detail how to circumvent it. Java does not support union types, and a polymorphic wrapper (such as Scala’s Either) would introduce overhead. To solve this we can either write or generate specialized code for fixed combinations of types, or use Java’s method type polymorphism and judicious use of class literals (a.k.a. type tokens like Integer.class). For multi-maps, which are heterogeneous only internally, a simple generic API will suffice. For other applications, such as when the keys or values of a map are type heterogeneous or primitive values are inlined, code generation for the wrapping API is possible. If we use Java’s method polymorpism (cf. Effective Java, Item 29 [5]) instead we may avoid code generation at a certain cost. We use type tokens and their cast method to encode type heterogeneity. Up to Java 8 it is not possible to bind primitive types to type variables though, and care must be taken to avoid dynamic type errors. Casts can be avoided using either-typed (temporary) wrappers or Fast and Lean Immutable Multi-Maps Bitmap Encoding and Indexing 3 int xxxxMap = rawMap1 & rawMap2; int dataMap = rawMap2 ^ xxxxMap; int nodeMap = rawMap1 ^ xxxxMap; The above listing depicts how to retrofit three logical bitmaps onto two physical bitmaps. The fields for datamap and nodemap are renamed to rawMap1 and rawMap2. Subsequently, the data structure infers three logical views from the two raw bitmaps. We further will refer to this retrofitted heterogeneous variant as Heterogeneous Compressed HashArray Mapped Prefix-tree (HCHAMP). Listing 3 illustrates operations on the bitmap in the generalized data structure that is specialized to k = 2. The mask function can be reused, and the index function is scaled to using a long. The new template method retrieves the 2-bit wide pattern (line 12) and translates it to an enum value to switch on. Instead of having to search linearly, as in Listing 2, we now jump directly to the relevant case handler. Using a fast switch is even more beneficial with an increasing number of heterogeneous types (k > 2), and while iterating which is when type dispatch will be hot. 3 2016/8/4 1 2 3 4 5 6 static final int mask(int hash, int shift) { return (hash >>> shift) & 0b11111; } static final int index(int bitmap, int bitpos) { return Integer.bitCount(bitmap & (bitpos - 1)); } 1 2 3 7 8 9 10 11 4 // processing in (Heterogeneous) CHAMP void processAtNode(int keyHash, int shift) { int mask = mask(keyHash, shift); int bitpos = bitpos(mask); 5 6 7 // processing in a Heterogeneous HAMT void processAtNode(int keyHash, int shift) { long bitmap = bitmap(); 8 12 int mask = mask(keyHash, shift) << 1; long bitpos = 1L << mask; 9 int nodeMap = nodeMap(); if ((nodeMap & bitpos) != 0) { // process node int index = index(nodeMap, bitpos); ...code for lookup, insert or delete ... } else { int dataMap = dataMap(); if ((dataMap & bitpos) != 0) { // process payload category 1 int index = index(dataMap, bitpos); ...code for lookup, insert or delete ... } else { int xxxxMap = xxxxMap(); if ((xxxxMap & bitpos) != 0) { // process payload category X int index = index(xxxxMap, bitpos); ...code for lookup, insert or delete ... } else { // process empty slot ...code for lookup, insert or delete ... } } 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 static final int index(long bitmap, long bitpos) { return Long.bitCount(bitmap & (bitpos - 1)); } 10 11 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Listing 2. Processing of multiple bitmaps with 1-bit entries. } Listing 3. Processing of one bitmaps with 2-bit entries. Optimizing Bit-Counting such a filter reduces a matching 2-bit wide pattern to a single bit set to 1, while resetting all other bits to 0. Extra bitwise operations are in the overhead of HHAMT which we need to mitigate. We explain three techniques to do so. Distribution of Heterogeneous Elements. While lookup, insertion, and deletion only require indexing into a single data category, on the other hand iteration and streaming require information about the types of all elements in a trie node: their frequency per node. Studies on homogeneous data structures [6] have shown avoiding checks on a per elements basis is indeed relevant for performance. To also avoid such checks in HHAMT we introduce the use of histograms, on a per node basis, that are calculated in constant time (for a given branch factor). The computation is independent of the number of heterogenous types: Relative Indexing into a Single Data Category. The purpose of the index function in Listing 3 is to calculate the relative index of a data element within its data category. Given a type enum and a trie-branch descriptor (bitpos), the index function calculates how often the given type pattern occurs in the bitmap before the bitpos position. The Java standard library contains bit count operations for the types int and long that count the number of bits set to 1. These functions do not support n-bit patterns with n > 1. However, we want to reuse the aforementioned functions, because on the widespread X86/X86_64 architectures they map directly to hardware instructions. We introduce some bitmap pre-processing with filters to get to that point where we can use the native bit counters. Listing 4 illustrates how Fast and Lean Immutable Multi-Maps switch (type) { case EMPTY: ...code for lookup, insert or delete ... break; case NODE: int index = index(filter(bitmap, type), bitpos); ...code for lookup, insert or delete ... break; case PAYLOAD_CATEGORY_1: int index = index(filter(bitmap, type), bitpos); ...code for lookup, insert or delete ... break; case PAYLOAD_CATEGORY_2: int index = index(filter(bitmap, type), bitpos); ...code for lookup, insert or delete ... break; } 15 } 2.4 int pattern = (int) ((bitmap >>> mask) & 0b11); Type type = toEnum(pattern); 12 1 n int[] histogram = new int[2 ]; 2 3 4 5 6 4 for (int branch = 0; branch < 32; branch++) { histogram[(int) bitmap & mask]++; bitmap = bitmap >>> n; } 2016/8/4 1 2 of the deletion operation. We devised a recovery function for bitmaps with n-bit tuples, based on Java’s standard library functions: Long.numberOfTrailingZeros(bitmap)/n*n. By first counting the number of trailing zeros, we approximate the region within the bitmap that contains bit-pattern information. We subsequently adjust the non-zero count to our n-bit pattern alignment with an integer division followed by an multiplication. As a result, we recovered the mask that allows retrieving the type of the remaining element (cf. Listing 3, lines 10–13). static final long filter(long bitmap, Type type) { long mask = 0x5555555555555555L; 3 long masked0 = mask & bitmap; long masked1 = mask & (bitmap >> 1); 4 5 6 switch (type) { case EMPTY: return (masked0 ^ mask) & (masked1 ^ mask); case NODE: return masked0 & (masked1 ^ mask); case PAYLOAD_CATEGORY_1: return masked1 & (masked0 ^ mask); case PAYLOAD_CATEGORY_2: return masked0 & masked1; } 7 8 9 10 11 12 13 14 15 16 17 Outlook. We have now discussed all techniques to mitigate Central Processing Unit (CPU) overhead caused by a more complex indexing. The remaining challenge is saving memory, which is discussed next. } 3. Listing 4. Filtering of multi-bit patterns (for k = 2). Specialization for a fixed number of heterogeneous types will prove essential for both memory efficiency and CPU performance. In this section we take the perspective of the general k-heterogeneous HHAMT. The effect of these techniques will be evaluated in Sections 4, 5, 6 and 7 in different contexts. For a HHAMT with k different types, there exist aritynodes × Qk variants in theory, with i=1 arityi possible strongly-typed Pk the constraint that aritynodes + i=1 arityi <= 32. We can reduce this complexity by grouping different heterogeneous types together into a section that is represented by their least upper bound type. Ultimately, we can group together all reference types and sub-nodes into one section, and all primitive types into another section [20], to achieve a quadratic upper bound that overcomes the dichotomy of reference and primitive types. Therefore, in the remainder of this section we will focus on the most common case of k = 2 that also satisfies our use case of multi-maps. Note that due to the bitmap encoding we always know the precise type of an object, using more general types for internal storage is solely used to reduce the total number of specializations. There exist empirical evidence [17] for k = 1 that specializing up to arities of 8 or 12 balances impact on memory performance best with the necessary amount of generated code. However with heterogeneity k > 1 this may not hold, and to exploit inlining primitive types for saving more memory we should support specializing the full bandwidth up to 32. We now present an improved approach for code generation that allows fully specialized collections (i.e., "array-less" data structures) with very low memory footprints. It aims to overcome the following issues that typically compromise performance of specialized code: The former listing abstracts over the number of heterogeneous elements and executes in 32 iterations. n and mask are constants, where mask has the lowest n bits set to 1. In its generic form, the code profits from default compiler-level optimizations —such as scalar replacement [15] to avoid allocating the array on the heap, and loop unrolling. We assigned the bit-pattern EMPTY = 0 and NODE = 2n−1 , the various remaining heterogenous types are assigned consecutively in the middle. For iteration, streaming, or batchprocessing data, histograms avoid expensive repetition of indexing individual categories: k bit-count operations, where each one requires applying a filter to the bitmap. For example, the total number of elements, regardless of their types, can be calculated with 32 - histogram[EMPTY] - histogram[NODE]. The otherwise complex code for trie-node iteration reduces to looping through the two-dimensional histogram using two integer indices. The added benefit is that inlined values although stored out of order, will be iterated over in concert, avoiding spurious recursive traversal and its associated cache misses [18]. Finally, iteration can exit early when the running counter reaches the maximum branching factor of 32 to avoid iterating over empty positions in the tail. Note that for fixed k the code can be partially evaluated (i.e., by a code generator) to avoid the intermediate histogram completely. Reversing the Bitmap Encoding: Extracting Index and Type. For enabling fast structural equality comparisons [18] maintaining a canonical form of the hash-trie is essential, also after the delete operation. For HHAMT and especially for HHAMT multi-maps this takes an extra effort: the deletion operation does know the index and type of the removed element, however it does not know the index and type of the remaining elements. Upon deletion, canonicalization triggers inlining of sub-tree structures with only a single remaining payload tuple. Efficiently recovering the index an type of the only remaining tuple is important for the overall efficiency Fast and Lean Immutable Multi-Maps Lean Specializations Additional Polymorphism: Turning a generic data type into a set of distinct specializations compromises trace-based inlining strategies of a Just-in-time (JIT) compiler. By introducing specializations, previous monomorphic call5 2016/8/4 1 2 number of reference fields (u). This lookup table solves the interdependency problem of specialization: when adding a key-value tuple of reference type the next specialization can be be determined with specializations[t][u + 2], or respectively with specializations[t - 2][u] when a tuple of primitive type is deleted. Once a specialization is selected, it can be initialized by invoking its default constructor: Object instance = specialization[t][u].newInstance(). Since the array is often used and relatively small, we found it runs faster than distributing code over the specialized classes. This also allows for more generic code in base classes which is therefore used more often and more likely to be optimized by the JIT compiler. abstract class Set1 implements Set { final Object slot0; 3 Set add(Object value) { if (slot0.equals(value)) { return this; } else { return new Set2(slot0, value); } } 4 5 6 7 8 9 10 11 } Listing 5. Interlinking of specializations prohibits generic methods: Set1 contains a static reference to Set2. 3.2 sites are turned into polymorphic call-sites. Thus a JIT compiler has to fallback to dynamic dispatch for method method calls that were previously resolved to direct calls. For the generic representation that operates on arrays, we would use System.arraycopy initializing a new trie node, which is really fast. Now we want to try and approach similar efficiency for initializing the fields of our specialized classes. Our solution is to introduce a arraycopy-like operation that is capable of copying consecutive fields between object instances: an ArrayView on an object layout is an abstraction which logically maps an arbitrary region within objects to an array. To ensure safety we check whether the JVM indeed maps the fields in a consecutive region at class loading time. Using a primitive ArrayView.copy we achieve similar performance to System.arraycopy. We measured the effect using a micro-experiment: the new primitive is about 20–30 % faster than field-by-field copying. Since eventually copying trie nodes is the primary bottleneck we may expect around similar speedups for insertion- and deletion-intensive code of HHAMT and less for lookup intensive code. Listing 6 shows how we can model an array view of a range of fields within a heap object. Once we have obtained a reference to an ArrayView, we can invoke corresponding (getFrom|setIn)HeapRegionArrayView methods that either retrieve or a set a value of a ArrayView. To mimic System.arraycopy on an ArrayView, we use sun.misc.Unsafe. copyMemory. For our experiments, we extended the copyMemory function to support copying from/to objects while catering for card marking, i.e., signaling the Garbage Collector (GC) that references changed. Code Bloat: Substituting a dynamic structure with specialiations often demands the specialization of operations as well. In the case of hash-tries, we specialize for constant array sizes [17]: instead of referencing a heap structure, we inline the array-fields into a trie-node. Unfortunately the resulting memory saving come at a price: suddenly array operations (i.e., allocation, copy, get, set, length) must be specialized as well. Interdependency of Specializations: In general, each specialized data type contains static references to other specializations that represent possible next states. Listing 5 exemplary lists the add method of set data structure specialized for one element that might return a set specialized for two elements. The switching between specialized representations, puts strain on the JIT compiler at run-time due to incremental class loading and the constant need to compile methods of specializations during a data structure builds up, further, it is one source of code bloat. In the remainder of this section we detail our approach of specialization that remedies the aforementioned overheads. In our design, a specialization represents purely a heterogeneous trie-node, specialized for a certain content size. It contains pre-evaluated content stored in static fields and instance fields (storing the bitmap, and the inlined array content), however does not override methods. 3.1 Relationship to VarHandle API of the Upcoming JDK 9. The Java Development Kit (JDK) 9 will introduce an API for uniformly referencing, accessing and modifying fields. Thus, independently of the realization of a variable —static field, instance field, or array— a handle to the field reference can be obtained. In earlier versions of Java, the granularity of references was restricted to objects; a VarHandle in contrast enables addressing fields or arrays (at a finer granularity) inside an object. The VarHandle API furthermore contains abstractions to view and process off-heap memory regions as arrays. However, it does not provide likewise abstractions for obtaining array views on on-heap regions. Indexing and Selecting Specializations We replace the use of arrays, which can be allocated using an arbitrary length parameter, with fields inlined in specialized classes. Commonly, for each specilization a unique constructor must be called (cf. Listing 5, specialization interlinking). Which constructor must be called depends on the current state of a trie node and the operation applied to the data structure. To enable class selection at run-time, we introduce a global and static two-dimensional Class[][] specializations array, indexed by the number of primitive data fields (t) and the Fast and Lean Immutable Multi-Maps Initializing Instances of Specialized Classes 6 2016/8/4 class TrieNode_T4_U3 implements Node { long bitmap; 1 2 Hypotheses. We expect HHAMT’s runtime performance of lookup, deletion, and insertion to be similar comparable to CHAMP’s runtime performance, but never better. Running times should not degrade below a certain threshold —we feel that 25 % for median values and 50 % for maximum values would about be acceptable as a trade-off— (Hypothesis 1). Iteration over a multi-map is more complex than iterating over a map. Iteration (Key) has to distinguish between heterogeneous categories, whereas Iteration (Key) has to distinguish heterogeneous categories, Iteration (Entry) additionally has to flatten nested sets to obtain a tuple view on multi-maps. Consequently, we assume costs of about 25 % for median values and 50 % for maximum values as well (Hypothesis 2). Based on related work in the domain of specializing HAMTs [17], we expect that specializing may introduce runtime overhead. However, we expect lower overhead (than the reported 20–40 % degradations for lookup) due to our mitigation strategies outlined in Section 3 (Hypothesis 3). Furthermore, memory footprints of HCHAMP and HHAMT should in practice match CHAMP’s footprints, because all variants use in total 64-bits for bitmaps (Hypothesis 4). 3 int key0; int val0; int key1; int val1; 4 5 6 Object slot0; Object slot1; Object slot2; 7 8 9 10 static ArrayView getArrayView_T4() { return createHeapRegionArrayView( TrieNode_T4_U3.class, "key0", "val1"); } 11 12 13 14 15 static ArrayView getArrayView_U3() { return createHeapRegionArrayView( TrieNode_T4_U3.class, "slot0", "slot2"); } 16 17 18 19 } 20 Listing 6. ArrayView on regions of specialized trie node. 4.1 The aforementioned ArrayView implementation we used provides a proof-of-concept implementation on how to extend the VarHandle API to support array views for on-heap regions. 3.3 We use a machine with Apple OS X (10.11.3) and 16 GB RAM. It has an Intel Core i7-3720QM CPU, with 2.60 GHz, and an 6 MB Last-Level Cache (LLC). Frequency scaling was disabled. For testing, we used an OpenJDK (JDK 8u65) JVM configured with a fixed heap size of 8 GB. We measure the exact memory footprints of data structures with Google’s memory-measurer library.1 Running times of operations are measured with the Java Microbenchmarking Harness (JMH), a framework to overcome the pitfalls of microbenchmarking.2 For all experiments we configured JMH to perform 20 measurement iterations of one second each, after a warmup period of 10 equally long iterations. For each iteration we report the median runtime, and measurement error as Median Absolute Deviation (MAD), a robust statistical measure of variability that is resilient to small numbers of outliers. Furthermore, we configured JMH to run the GC between measurement iterations to reduce a possible confounding effect of the GC on time measurements. In our evaluation we use collections of sizes 2x for x ∈ [1, 23]. Our selected size range was previously used to measure the performance of HAMTs [2, 18]. For every size, we fill the collections with numbers from a random number generator and measure the resulting memory footprints. Subsequently we perform the following operations and measure their running times: Summary In the context of collections, we eliminated issues that typically compromise the performance of specialized code. We will evaluate the effects of these techniques in Section 4. 4. Assessing the Cost of Multi-Maps In this section we evaluate the performance characteristics of the various implementations of multi-maps on top of the HCHAMP, HHAMT, and specialized HHAMT encodings, comparing them against the basic homogeneous CHAMP map data structure as state-of-the-art baseline [18]. We are interested in isolating the effects that are incurred by adding the heterogeneity feature: • HCHAMP is close to CHAMP (same logic, but derives three bitmap views from two physical bitmaps); • HHAMT generalizes the heterogeneous bitmap encoding; • and specialized HHAMT improves memory footprints by dynamically selecting statically known specializations. In the case of multi-maps, heterogeneity lies in the internal distinction between 1 : 1 and 1 : n mappings. Lookup, Insert and Delete: Each operation is measured with a sequence of 8 random parameters to exercise different trie paths. For Lookup and Delete we randomly selected from the elements that were present in the data Assumptions. We evaluate the pure overhead of operations on the data structures, without considering cost functions for hashCode and equals methods. This performance assessment should reveal the overhead of adding heterogeneity to CHAMP, the effect of the specialization approach and the effect of accessing the heterogeneous data elements. Fast and Lean Immutable Multi-Maps Experiment Setup 1 https://github.com/DimitrisAndreou/memory-measurer 2 http://openjdk.java.net/projects/code-tools/jmh/ 7 2016/8/4 structures.3 For Insert we ensured that the random sequence of values was not yet present. Regression or Improvement (Factor) 1.50x Lookup (Fail), Insert (Fail) and Delete (Fail): Measuring unsuccessful operations. The setup equals the aforementioned setting, however with the difference that we swap the sequences of present/not present parameters. Iteration (Key): Iterating over the elements of a set or the keys of a map respectively. 1.25x ● neutral ● ● ● 1.25x ● ● ● ● 1.50x Lookup Iteration (Entry): Iterating over a multi-map, flattening and yielding tuples of type Map.Entry. Delete Delete (Fail) Iteration (Key) Iteration (Entry) Regression or Improvement (Factor) 1.25x neutral ● ● 1.25x ● ● ● ● 1.50x Lookup Lookup (Fail) Insert Insert (Fail) Delete Delete (Fail) Iteration (Key) Iteration (Entry) (b) HHAMT multi-map versus CHAMP map (baseline). Figure 1. Visualizing the overhead of various multi-map implementations over a CHAMP map implementation. We first report the precision of the individual data points. For 99 % of the data points, the relative measurement error amounts to less than 1 % of the microbenchmark runtimes, with an overall range of 0–4.8 % and a median error of 0 %. We summarize the data points of the runs with the five different trees with their medians. Then Figure 1a, and 1b report for each benchmark the ranges of runtime improvements or degradations. For brevity, the effects on memory footprints and of specialization are not contained in the boxplots, but are discussed in text. Each boxplot visualizes the measurements for the whole range of input size parameters. For improvements we report speedup factors above the neutral line (measurementCHAMP / measurementHHAMT-Variant ), and degradations as slowdown factors below the neutral line , i.e., the inverse of the speedup equation. From this data we learn the following: a median slowdown of 20 %, 5 %, and 10 % respectively, and Lookup (Fail), Insert (Fail) and Delete (Fail) added 22 %, 0 % and 13 % respectively. With exception to single outliers produced Delete (Fail), the maximum slowdown are lower than 29 % at most. (Partial) Confirmation of Hypothesis 2: Compared to our baseline, and counter to our intuition, HCHAMP improved Iteration (Key) by a median 35 % and Iteration (Entry) by 37 %. The more general HHAMT improved Iteration (Key) by a median 16 % and Iteration (Entry) by 13 %. However, according to Figure 1, the value spread appears large and the maximum bounds are violated for Iteration (Key). (Partial) Confirmation of Hypothesis 3: On average, we observed an overhead of 3 % for Lookup and 6 % for Lookup (Fail) when comparing a specialized HHAMT against its regular HHAMT counterpart. These numbers confirm our intuition and are lower then the 20–40 % overhead reported by Steindorfer and Vinju [17]. The median costs for Insert (24 %) and Delete (31 %) however match their results. Concerning memory consumption, specializations improved memory consumption by at least 38 % for data structures with 32 or more entries. Confirmation of Hypothesis 1: The cost of converting a map to a multi-map stayed within the specified bounds for both HCHAMP and HHAMT. For HCHAMP, Lookup, Insert and Delete added a median slowdown of 9 %, 0 %, and 7 % respectively, and Lookup (Fail), Insert (Fail) and Delete (Fail) added 12 %, 2 % and 7 % respectively. With exception to single outliers produced Delete (Fail), the maximum slowdown are lower than 18 % at most. For the generalized HHAMT, the costs for multi-maps over maps are higher. Lookup, Insert and Delete added Confirmation of Hypothesis 4: Memory footprints of HCHAMP and HHAMT (omitted in Figure 1) match exactly the footprint of CHAMP, when using multi-maps as maps. < 8 elements, we duplicated the elements until we reached 8 samples. Fast and Lean Immutable Multi-Maps Insert (Fail) 1.50x Experiment Results 3 For Insert (a) HCHAMP multi-map versus CHAMP map (baseline). We repeat the list of operations for each size with five different trees, starting from different seeds. This counters possible biases introduced by the accidental shape of the tries, and accidental bad locations in main memory. Evaluating HAMT data structures containing simply random integers accurately simulates any application for which the elements have good uniformly distributed hash codes. A worse-thanuniform distribution would —regardless of the HAMT-like implementation— overall reduce the memory overhead per element and increase the cost of updates (both due to clustering of elements). We consider a uniform distribution the most representative choice for our comparison. 4.2 Lookup (Fail) 8 2016/8/4 Regression or Improvement (Factor) Discussion. A more detailed investigation revealed that for Iteration (Key) measurements at sizes 21 and 25 showed significant deviation from the remaining measurements. These two measurements were not statistically identified as outliers due to the small sample size of 23 (sizes 2x for x ∈ [1, 23]). When removing these two measurements, the upper bound of slowdowns is 6 % for HHAMT and 36 % for HCHAMP. While not impacting lookup performance, specializing trades the runtime performance of insertion and deletion for gaining savings of approximately 1.4 x.4 Because only operations that allocate new tree nodes are affected, we attribute slowdowns to the lookup table we introduced (adding two memory indirection). Nevertheless, specializing is of key importance when optimizations for primitive data types; we evaluate that effect separately in Section 6. 4x ● 3x ● ● ● ● 2x neutral 2x Lookup Lookup (Fail) Insert Delete Footprint (32−bit) Footprint (64−bit) Regression or Improvement (Factor) (a) Specialized HHAMT multi-map versus Clojure’s multi-map (baseline). Summary. Despite its more complex and heterogeneous encoding, HHAMTs achieves excellent runtimes across all tested operations. Converting a map into a multi-map with the means of a heterogeneous encoding had usually less costs associated than we expected beforehand. Our specialization approach could successfully mitigate overhead for lookups while reducing memory footprints. However, using a lookup table for our specializations still impacts insertion and deletion, when compared to regular array allocations that do not require a lookup table. 5. 5x 5x 4x 3x 2x ● ● ● ● ● ● Footprint (32−bit) Footprint (64−bit) neutral 2x Lookup Lookup (Fail) Insert Delete (b) Specialized HHAMT multi-map versus Scala’s multi-map (baseline). Figure 2. Performance comparison of a specialized HHAMT multi-map against implementations in Clojure and Scala. Comparing Immutable Multi-Maps We further evaluate the performance characteristics of our specialized HHAMT multi-map against implementations from Clojure and Scala. Both languages do not provide native immutable multi-maps in their standard libraries, however suggest idiomatic solutions to transform maps with nested sets into multi-maps. VanderHart [21, p. 100–103] proposes a solution for Clojure based on “protocols”. Values are stored untyped as either a singleton, or a nested set. Consequently, the protocol extension handles the possible case distinctions —not found, singleton, or nested set— for lookup, insertion, and deletion. Scala programmers would idiomatically use a trait for hoisting a regular map to a multi-map. However, the Scala standard library only contains a trait for mutable maps; we therefore ported the standard library program logic of the trait to the immutable case, nesting typed sets into maps. 5). However, for negative lookups we expected that specialized HHAMT performs worse than Scala (Hypothesis 6). This hypothesis is based on related work [18] that explains the inherent differences between CHAMP and Scala when it comes to memoizing hash codes. Our hypothesis expects memory improvements by at least 50 % on average due to omitting nested collections for singletons (Hypothesis 7). 5.1 Data generation is derived from the experimental setup outlined in Section 4.1. We keep the number of unique keys equal —2x for x ∈ [1, 23]— but instead of using distinct data in each tuple, we now use 50 % of 1 : 1 mappings, and 50 % of 1 : 2 mappings. Fixing the maximal size of right-hand side of the mapping to 2 may seem artificial, but it allows us to precisely observe the singleton case, the case for introducing the wrapper and the overhead per additionally stored element. The effect of larger value sets on memory usage and time can be inferred from that without the need for additional experiments. Hypotheses. We expect specialized HHAMT’s runtime performance of lookup, deletion, and insertion to equal the competitors performance, because we tried hard to mitigate the incurred overhead, and the idiomatic solutions require some overhead as well. Runtimes should not degrade below a certain threshold —say 10 % for median values and 20 % for maximum values would just be acceptable— (Hypothesis Insert: We call insertion in three bursts, each time with 8 random parameters to exercise different trie paths. Firstly we provoke full matches (key and value present), secondly partial matches (only key present), and thirdly no matches (neither key nor value present). Next to insertion of a new 4 Note that only the outer multi-map structure was specialized and not the nested sets. A further specialization of the nested sets would yield even more substantial memory savings. Fast and Lean Immutable Multi-Maps Experiment Setup 9 2016/8/4 key, this mixed workload also triggers promotions from singletons to full collections. Delete: We call deletion in two bursts, each time with 8 random parameters. Provoking again, full matches and partial matches. Next to deletion of a key, this mixed workload also triggers demotions from full collections to singletons, and canonicalization where applicable. Lookup: Similar to Delete we call lookup in two bursts to exercise full and partial matches. Lookup (Fail): In a single burst with 8 random parameters we test negative lookups (neither key nor value present). We assume this test equivalent to Delete with no match. 5.2 Experiment Results Figure 3. Comparing memory footprint of HHAMT specialized for int against state-of-the-art primitive Map<int, int> structures. Figures 2a and 2b show the relative differences of specialized HHAMT multi-map compared to the implementations in Clojure and Scala. From the data we can evaluate our hypotheses: Confirmation of Hypothesis 5: Runtimes unexpectedly improve over the competition. Lookup, Insert, and Delete perform similar to Scala (by a median 12 %, 9 %, and 16 % faster), and clearly better than Clojure (by a median speedup of 2.51 x, 1.75 x, and 2.05 x). Compared to Scala we observed individual data points that exhibited minimal slowdowns of less than 9 % at larger input sizes. runtimes of lookup, insertion, and deletion —with the notable exception of negative lookups when compared to Scala— and most importantly memory improvements of 1.9–2.14 x. 6. A type-safe heterogeneous HAMT encoding shines most with bounded numerical data: it allows to exploit the difference between primitive (value-based) data types and reference types. More specifically, a Multimap<int, int> can leverage storing unboxed inlined singletons. Any non-heterogeneous immutable collection structure would have to store boxed integer objects instead, if not singleton sets of boxed integers. So, instead, as a fair point-of-reference we will compare to the state-of-the-art hand-optimized specialized immutable data structures for primitive values. We are not aware of any comparable persistent or immutable primitive collection library which is optimized for primitive data types on the JVM. While there are many specialized primitive collection libraries for the JVM, only some contain (slower) copy-on-write immutable data structures implemented as facades over their mutable counterparts. With respect to primitive multi-maps, we did not find any implementation, neither mutable nor mutable. So, we concentrate on comparing the memory footprint of Map<int, int>, implemented in specialized HHAMT (with 1 : 1 mappings) compared to the most efficient primitive mutable collections we are aware of, namely: Goldman Sachs Collections, FastUtil, Trove, and Mahout. As a point of reference we also include Guava’s RegularImmutableMap because it is a well-known library (but commonly known to be non-optimal in terms of memory consumption). Confirmation of Hypothesis 6: HHAMT performs worse than Scala for negative lookups. Runtimes increased by a median 39 % and roughly doubled at maximum with a 106 % increase. In contrast, when compared to Clojure we do not see a negative impact. Confirmation of Hypothesis 7: Memory footprints improve by a median factor of 1.92 x (32-bit) and 1.93 x (64-bit) over the implementation in Scala, and over in Clojure by a median factor of 1.9 x (32-bit) and 2.14 x (64-bit). Discussion. We were surprised that the memory footprint consumptions of Clojure’s and Scala’s multi-map implementations are essentially equal. From related work [18] we knew the typical trade-offs of both libraries: Scala mainly optimizes for runtime performance, while Clojure optimizes for memory consumption. Code inspection revealed the cause of Scala’s improved memory performance: their immutable hash-sets contains a specialization for singleton sets. All three libraries libraries follow different paradigms for avoiding code duplication in their collection libraries. While Scala and Clojure use extension mechanisms (i.e., traits and protocols respectively), HHAMT avoids duplication by supporting internal heterogeneity. Summary. With microbenchmarks we were able to measure the performance of individual operation, and further to measure the footprint of synthetically generated structures of different sizes. In this setting the heterogeneous design of specialized HHAMT proved to be better in general: improved Fast and Lean Immutable Multi-Maps Case Study: Primitive Collection Footprint 6.1 Experiment Results Figure 3 illustrates observed memory footprints for maps for sizes 2x for x ∈ [1, 23]. At each size, measurements are 10 2016/8/4 normalized with respect to the minimum memory footprint (retained size of heap graph). Consequently, the minimum value 1 depicts the smallest data structure, whereas all other data points are displayed in their relative distance (factor of how much more memory they consume). The results show that HHAMT consistently consumes the least amount of memory (median 1.00 x, range 1.00–1.10 x), followed by Goldman Sachs (median 1.04 x, range 1.00– 2.18 x) and FastUtil (median 1.07 x, range 1.00–4.18 x). Trove exhibits constant results within a small bandwidth (median 1.23 x, range 1.15–2.15 x). In contrast to Trove’s constant results, Mahout delivered surprisingly inconsistent results (median 1.94 x, range 1.22–29.64 x) —we capped the plot in Figure 3 to display maximal deviations up to 5 x. With overheads of 29.64 x, 25.08 x, 19.18 x, 11.24 x and 4.72 x for the data points 21 –25 , Mahout exceeds the footprints of our generic reference data structure from Guava (median 4.00 x, range 2.27–4.72 x). Table 1. Runtimes of HHAMT for the CFG dominators experiment per CFG count, and statistics over preds relation about shape of data (unique keys, tuples, 1 : 1 mappings). Discussion. Compared to all other primitive collections, excelled especially at small collections up to 32 elements. Given that in practice most collections are small [14] these improvements look promising. Primitive collections in general have the problem how to mark which slots are in use (there is no null equivalent in value types). Several encodings —e.g., sentinel values, or bitmaps— exist to circumvent this limitation. HHAMT performs well with respect to primitive collections, because HHAMT inherently encodes information about the presence and type of (primitive) values on a per node basis an therefore obsoletes special encodings for sentinel values. Further applications and benefits of heterogeneous data structures are discussed in Section 9. HHAMT #Keys #Tuples %1:1 4096 173 s 174 s 315 009 331 218 91 % 2048 84 s 85 s 162 418 170 635 91 % 1024 64 s 62 s 88 952 93 232 92 % 512 28 s 28 s 43 666 45 743 92 % 256 19 s 18 s 21 946 22 997 92 % 128 14 s 14 s 13 025 13 583 93 % Dom(n0 ) = {n0 }  Dom(n) =   \ Dom(p) ∪ {n} p∈preds(n) Our code uses set union and intersection in a fixed-point loop: Dom and preds are implemented as multi-maps. The big intersection is not implemented directly, but staged by first producing a set of sets for the predecessors and intersecting the respective sets with each other. Hypotheses. On the one hand, since Dom is expected to be many-to-many with large value sets it should not generate any space savings but at least it should not degenerate the runtime performance either compared to CHAMP (Hypothesis 8). On the other hand we expect preds to be mostly oneto-one and we should get good benefit from the inlining of singletons (Hypothesis 9). Since CHAMP was reported to outperform existing state-of-the-art implementations in Scala and Clojure on the same case, there is no need to further include these [18]. Summary. In our measurements, HHAMT multi-maps that are specialized for int consume (with 1 : 1 data) a median 4 x less memory than generic map data structures. HHAMT further achieves the same small footprints as class-leading primitive Map<int, int> data structures, while providing the additional functionality of allowing 1 : n mappings. Case Study: Static Program Analysis The above experiments isolate important factors, but they do not show the support for the expected improvements on an algorithm “in the wild”. To add this perspective, we selected computing control flow dominators using fixed point computation over sets [1]. The nodes in the graphs are complex recursive ASTs with arbitrarily complex (but linear) complexity for hashCode and equals. More importantly, the effect of the heterogenous encoding does depend on the accidental shape of the data, as it is initially produced from the raw control flow graphs, and as it is dynamically generated by the incremental progression of the algorithm. Data. For our experiment, we used ±5000 control flow graphs for all units of code (function, method and script) of Wordpress,5 by using the PHP AiR framework [11]. Like before, we used JMH to measure CPU time. We ran the dominator calculations on a random selection of the aforementioned graphs. The set of selected graphs range between a size of from 128 to 4096 in exponential steps. Since smaller graphs occur much more frequently, we selected samples with exponentially increasing sizes from 128 to 4096. We furthermore measured the number of many-to-one and many-to-many entries in the preds relation. Code. Although we do not claim the algorithm in this section to be representative of all applications of multi-maps, it is a basic implementation of a well known and fundamental Fast and Lean Immutable Multi-Maps CHAMP algorithm in program analysis. It has been used before to evaluate the efficiency of hash-array mapped tried [18]. We implemented the following two equations directly on top of the multi-maps: HHAMT 7. #CFG 5 https://wordpress.com 11 2016/8/4 Results. The results were obtained with a Linux machine running Fedora 20 (kernel 3.17). It featured 16 GB RAM and an Intel Core i7-2600 CPU with 3.40 GHz (8 MB LLC with 64-byte cache lines). Frequency scaling was disabled. Table 1 shows the mean runtimes of the experiment for CHAMP and HHAMT. Both perform almost identically, with at most ±2 s difference. Due to equal runtimes, HHAMT retains the same magnitude of speedups that CHAMP yielded over Clojure and Scala [18], from minimal 9.9 x to 28.1 x. We also observed that the shape of data in the preds relation contains a high number of 1 : 1 mappings (median 92 %) and that the average ratio of unique keys to tuples is 1.05 x. In the case of Wordpress, the CFG algorithm turns out to profit over CHAMP in terms of memory savings from the heterogeneous opimizations for 1 : 1 mappings. We conclude both Hypothesis 8 and 9 to be confirmed. 8. suggest that even in the absence of strict typing, collections are often used homogeneously. Heterogeneous data structures are orthogonal to homogeneous storage strategies. On one hand, heterogeneous data structures could diversify current strategy approaches, e.g., when homogeneous strategies are not applicable, or when many conversion occur. On the other hand, they have the potential to replace homogeneous strategies when flexibility in mixing data is required upfront. Furthermore, HHAMT optimizes internal heterogeneity that occurs in general purpose data structures such as multi-maps. Specializations and Generics for Primitives Reducing Code-Bloat. Specializing for primitives can lead to a combinatorial explosion of variants amplifying code-bloat. Due to the object vs. primitive dichotomy, Java does not offer solutions countering a combinatorial explosion of code duplication when specializing for primitives. Java 10 or later will solve this issue by supporting generics of primitive types.6 Ureche et al. [20] presented a compiler-based specialization transformation technique called miniboxing. Miniboxing adds automatic specializations for primitive JVM data types to the Scala compiler while reducing the generated bytecode. Combinatorial code-bloat is tackled by specializing for the largest primitive type long, together with automatic coercion for smaller-sized primitives. While not always memoryoptimal due to always utilizing long variables, miniboxing is a practical approach to tackle combinatorial code explosion. HHAMT’s contribution is orthogonal to both previously discussed techniques, because it generalizes the encoding of heterogeneous data stored together in a collection. HHAMT’s specializations currently do duplicate code for different (primitive) type combinations. Using primitive generics in later versions of Java —or miniboxing in Scala— could bring this down to a single generic specialization per trie node arity. Related Work Reducing the Memory Footprint of Collections is a goal of other people as well. Gil et al. [10] identified sources of memory inefficiencies in Java’s mutable collections and proposed memory compaction techniques to counter them. They improved the memory efficiency of Java’s Hash{Map,Set} and Tree{Map,Set} data structures by 20–77 %. We observed that even with added heterogeneity, HHAMT multimaps achieve lower memory footprints than the class-leading primitive collection libraries, and in the generic case on average 4 x improvements over Guava’s maps. Steindorfer and Vinju [17] specialized internal trie nodes to gain memory savings of 55 % for maps and 78 % for sets at median while adding 20–40 % runtime overhead for lookup. Their approach minimized the amount of specializations to mitigate effects on code bloat and run-time performance. In contrast, we targeted the root causes of inefficiency one-byone allowing full specialization at all arities. (Partial) Escape Analysis. Escape analysis enables compilers to improve the run-time performance of programs: it determines whether an object is accessible outside its allocating method or thread. Subsequently this information is used to apply optimizations such as stack allocation (in contrast to heap allocation), scalar replacements, lock elision, or regionbased memory management [16]. Current JVMs use partial escape analysis [15], which is a control-flow sensitive and practical variant tailored toward JIT compilers. Our scalable encoding of specializing is a memory layout optimization for value-type based data types: trie nodes are specialized for arrays of constant sizes that do not escape. We use code generation to conceptually apply object inlining [22] of these statically sized (non-escaping) arrays into the memory layout of their corresponding trie nodes. Memory layout sensitive inlining as we perform could be applied in Virtual Machine (VM) based on information obtained from escape analysis. We hope that future compilers and language runtimes are capable of doing so out-of-the-box. Optimizing Collections in Dynamically-Typed Languages. Runtimes of dynamically typed languages often introduce a significant run-time and memory overhead [19] due to generic collection data structures that could at run-time hold a heterogeneous mix of data. Bolz et al. [6] introduced a technique dubbed storage strategies that enables dynamic conversion of data representations. A set of interlinked strategies form a fine-grained type lattice that is based on known optimizations. Strategies mostly include support for collections of a homogeneous (primitive) type. An exemplary lattices for a Set data structure could be EmptySetStrategy <-> (Integer|Float|...)SetStrategy <-> ObjectSetStrategy. Resulting performance improvements mainly stem from object layouts that specialize for a homogeneous primitive types and corresponding optimized operations (e.g., direct value comparisons instead of calling equals methods). Bolz [6] showed that with Python on average 10% of collections dehomogenize, mostly at small sizes. These results Fast and Lean Immutable Multi-Maps 6 http://openjdk.java.net/projects/valhalla/ 12 2016/8/4 9. Further Applications of HHAMT contain decimal numbers or even empty cells, depending on the original manual and unvalidated input of the user. A CSV parser could output a HHAMT, inferring the most accurate value for each cell from the used notation, and allowing for further processing the data downstream in a manner both type-safe and efficient. In general, homogeneous collections storing numeric data struggle with representing empty cells. Sentinel values (e.g., integer constant −1) are a viable solution if and only if the data does not use the data type’s full value range. Cases where the data range is used exhaustively require additional auxiliary data structure (e.g., an array of booleans) to encode if a value is initialized. In contrast to homogeneous collections, HHAMTs by design supports mixing sentinel values of a different type (e.g., static final EMPTY_CELL = new Object()) with the full value range of primitives. We extrapolate some client applications which would benefit from HHAMT. Libraries or Languages Supporting Data or Code Analysis on the JVM would benefit from more efficient in-memory multi-maps. Typical examples are frameworks such as KNIME [3] for general purpose data analysis or Rascal for program analysis [13], and MoDisCo [7] for software reengineering and reverse engineering, especially when their algorithms require frequent lookup and thus will benefit from an efficiently indexed relation such as a multi-map. Unifying Primitive and Generic Collections. Looking at specialized collections for primitives from the programming language designer’s perspective, they are a necessary evil implied by the dichotomy between objects and primitive values. Primitive values give programmers access to low level and memory-efficient data representations, but the impact of having them leaks through in the type systems and the design of standard libraries of programming languages supporting them. The current paper describes a heterogeneous framework that can be used for implementing data structure which allow storing either primitive data values or their boxed counterparts next to each other, while the client code remains practically oblivious. For statically-typed languages this implies we can have a generically typed library for both primitive and object values. For dynamically-typed languages it implies a much lower overhead for the builtin dictionaries. 10. We proposed HHAMT, a new design for hash-array mapped tries which allows storage, retrieval and iteration over maps which store heterogeneously typed data. In particular we motivate this data structure by applying it to efficiently implement multi-maps, and it also shines when used to cater for inlining unboxed primitive values. The evaluation compared to the state-of-the-art: comparing to other hash-trie data structures with and without the many-to-many feature, comparing against state-of-the-art encodings of multi-maps in Scala and Clojure and comparing to hand-optimized maps for primitive values. Even when compared unfairly to implementations which do not feature heterogeneity, HHAMT compares well. We safe a lot of memory (2–4 x) at relatively low costs in runtime overhead. We hope multi-maps based on these results will be available in the future in the standard libraries for collections on the JVM, since that would make the JVM even more attractive for safely computing with large immutable datasets. Big Integers for Big Data. Most programming languages feature a library for representing arbitrary-sized integers. We use these to avoid overflow, especially in the context of scientific computing applications. The drawback of using these libraries for data science is that large homogeneous collections immediately blow up, even if the big numbers are exceptional. We want to use smaller Fixed-Width Numerics (FIXNUMs) were possible, and Big Object-Represented Numerics (BIGNUMs) only when necessary. This application is where HHAMT could potentially have a rather big impact. Sets and maps filled with mostly inlined FIXNUM’s and an occasional BIGNUM without having to a priori allocate space for BIGNUMs, and without having to migrate at run-time. Even if the entire collection accidentally ends up filled with BIGNUMs, HHAMT still yields more memory efficient representations than common array-based hash-maps. References [1] A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986. [2] P. Bagwell. Ideal Hash Trees. Technical report, Ecole polytechnique fédérale de Lausanne, Oct. 2001. [3] M. R. Berthold, N. Cebron, F. Dill, T. R. Gabriel, T. Kötter, T. Meinl, P. Ohl, K. Thiel, and B. Wiswedel. Knime - the konstanz information miner: Version 2.0 and beyond. SIGKDD Explor. Newsl., 11(1):26–31, Nov. 2009. ISSN 1931-0145. . Cleaning Raw Data in a Type-Safe Manner. The HHAMT data structure enables efficient storage and retrieval of objects of incomparable types without memory overhead (no need to wrap the objects) and without dynamic type checks. In Java there exist no “union” types like in C, but using HHAMT we can approach this in the context of collections. A typical use case would be reading in raw data from Comma-Separated Values (CSV) files (or spreadsheets) in Java where the data is not cleansed and some cells contain integers while the other Fast and Lean Immutable Multi-Maps Conclusion [4] A. Biboudis, N. Palladinos, G. Fourtounis, and Y. Smaragdakis. Streams a la carte: Extensible Pipelines with Object Algebras. In ECOOP ’15: Proceedings of the 29th European conference on Object-Oriented Programming. Schloss Dagstuhl, 2015. [5] J. Bloch. Effective Java, Second Edition. Boston, MA, 2008. [6] C. F. Bolz, L. Diekmann, L. Tratt, C. F. Bolz, and L. Diekmann. Storage strategies for collections in dynamically typed languages, volume 48. ACM, Nov. 2013. 13 2016/8/4 [7] H. Bruneliere, J. Cabot, F. Jouault, and F. Madiot. Modisco: A generic and extensible framework for model driven reverse engineering. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, ASE ’10, pages 173–174, New York, NY, USA, 2010. ACM. ISBN 978-1-4503-0116-9. . [15] L. Stadler. Partial Escape Analysis and Scalar Replacement for Java. PhD thesis, Johannes Kepler University Linz, May 2014. [16] C. Stancu, C. Wimmer, S. Brunthaler, P. Larsen, and M. Franz. Safe and efficient hybrid memory management for java. In Proceedings of the 2015 International Symposium on Memory Management, ISMM ’15, pages 81–92, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3589-8. . [8] R. De La Briandais. File Searching Using Variable Length Keys. In Papers presented at the the March 3-5, 1959, western joint computer conference, pages 295–298, New York, New York, USA, 1959. ACM Press. [17] M. J. Steindorfer and J. J. Vinju. Code specialization for memory efficient hash tries (short paper). In Proceedings of Generative Programming Concepts & Experiences (GPCE). ACM, Sept. 2014. [9] E. Fredkin. Trie Memory. Commun. ACM, 3(9):490–499, Sept. 1960. [10] J. Gil and Y. Shimron. Smaller Footprint for Java Collections. In ECOOP ’12: Proceedings of the 26th European conference on Object-Oriented Programming. Springer-Verlag, 2012. [18] M. J. Steindorfer and J. J. Vinju. Optimizing Hash-array Mapped Tries for Fast and Lean Immutable JVM Collections. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015. ACM, 2015. [11] M. Hills and P. Klint. PHP AiR: Analyzing PHP systems with Rascal. In Proceedings of IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering. IEEE, 2014. [19] L. Tratt. Dynamically Typed Languages. In Advances in Computers, pages 149–184. Elsevier, 2009. [12] A. Igarashi and M. Viroli. On Variance-Based Subtyping for Parametric Types. In ECOOP ’02: Proceedings of the 16th European conference on Object-Oriented Programming. Springer-Verlag, 2002. [20] V. Ureche, C. Talau, and M. Odersky. Miniboxing: improving the speed to code size tradeoff in parametric polymorphism translations, volume 48 of improving the speed to code size tradeoff in parametric polymorphism translations. ACM, Nov. 2013. [21] L. VanderHart and R. Neufeld. Clojure Cookbook: Recipes for Functional Programming. O’Reilly Media, 2014. ISBN 9781449366414. URL https://books.google.nl/books? id=xX38AgAAQBAJ. [13] P. Klint, T. van der Storm, and J. Vinju. Rascal: A Domain Specific Language for Source Code Analysis and Manipulation. In Proceedings of Ninth IEEE International Working Conference on Source Code Analysis and Manipulation. IEEE, 2009. [14] N. Mitchell and G. Sevitsky. The causes of bloat, the limits of health. In OOPSLA ’07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems and applications. ACM, 2007. Fast and Lean Immutable Multi-Maps [22] C. Wimmer. Automatic Object Inlining in a Java Virtual Machine. PhD thesis, Johannes Kepler University Linz, February 2008. 14 2016/8/4 1 2 3 4 5 interface HeterogeneousMap { // pull-based dispatch on type <K, V> TypedObject<?> put (Class<K> keyType, K key, Class<V> valueType, V value); <K, V> TypedObject<?> remove (Class<K> keyType, K key); <K, V> TypedObject<?> get (Class<K> keyType, K key); 6 // push-based dispatch on type <K, V> void put (Class<K> keyType, K key, Class<V> valueType, V value, CallbackMap callbacks); <K, V> void remove (Class<K> keyType, K key, Class<V> valueType, V value, CallbackMap callbacks); <K, V> void get (Class<K> keyType, K key, Class<V> valueType, V value, CallbackMap callbacks); 7 8 9 10 11 } 12 13 14 15 16 interface TypedObject<T> { Class<T> getType(); T get(); } 17 18 19 20 21 interface CallbackMap { <E> Consumer<E> put (Class<E> elementType, Consumer<E> consumer); <E> Consumer<E> get (Class<E> elementType); } Figure 4. Generic HHAMT interface, based on Item 29: Consider typesafe heterogeneous containers of Effective Java [5]. 1 2 3 public void heterogeneousInterfaceTest() { put(String.class, "abc", int.class, 5); put(String.class, "abc", Integer.class, 5); // accepted by guard condition // accepted by guard condition put(String.class, "abc", long.class, 5L); put(String.class, "abc", Long.class, 5L); // rejected by guard condition // rejected by guard condition 4 5 6 7 } 8 9 10 11 12 13 14 15 16 17 18 19 20 static <T, U> void put(Class<T> keyType, T keyInstance, Class<U> valueType, U valueInstance) { switch(keyType.getName()) { case "java.lang.String": switch(valueType.getName()) { case "int": put((String) keyType.cast(keyInstance), (int) valueInstance); return; case "java.lang.Integer": put((String) keyType.cast(keyInstance), (Integer) valueInstance); return; } } 21 System.out.println("Unsupported Type"); 22 23 } 24 25 26 27 static void put(String keyInstance, Integer valueInstance) { System.out.println("put(String keyInstance, Integer valueInstance)"); } 28 29 30 31 static void put(String keyInstance, int valueInstance) { System.out.println("put(String keyInstance, int valueInstance)"); } Figure 5. The method heterogeneousInterfaceTest illustrates a possible way to map a generalized HHAMT interface to specialized functions with type guards (cf. switch statement). Fast and Lean Immutable Multi-Maps 15 2016/8/4
6cs.PL
Coherent-Classical Estimation for Linear Quantum Systems ⋆ Shibdas Roya , Ian R. Petersenb , Elanor H. Huntingtonb,c arXiv:1502.03729v3 [math.OC] 5 Apr 2017 a b c Department of Physics, University of Warwick, Coventry, United Kingdom Research School of Engineering, Australian National University, Canberra, Australia Australian Research Council Centre of Excellence for Quantum Computation and Communication Technology, Australia Abstract We study a coherent-classical estimation scheme for a class of linear quantum systems, where the estimator is a mixed quantumclassical system that may or may not involve coherent feedback. We show that when the quantum plant or the quantum part of the estimator (coherent controller) is an annihilation operator only system, coherent-classical estimation without coherent feedback can provide no improvement over purely-classical estimation. Otherwise, coherent-classical estimation without feedback can be better than classical-only estimation for certain homodyne detector angles, although the former is inferior to the latter for the best choice of homodyne detector angle. Moreover, we show that coherent-classical estimation with coherent feedback is no better than classical-only estimation, when both the plant and the coherent controller are annihilation operator only systems. Otherwise, coherent-classical estimation with coherent feedback can be superior to purely-classical estimation, and in this case, the former is better than the latter for the optimal choice of homodyne detector angle. Key words: annihilation-operator, coherent-classical, estimation, Kalman filter, quantum plant. 1 Introduction Estimation and control problems for quantum systems are of significant interest [3–5, 7, 8, 11, 12, 22–25]. An important class are linear quantum systems [2–5, 10, 11, 14, 15, 20, 22, 23], that describe quantum optical devices such as optical cavities [1, 19], linear quantum amplifiers [2], and finite bandwidth squeezers [2]. Coherent feedback control for linear quantum systems has been studied, where the feedback controller is also a quantum system [5–8, 11, 21]. A related coherent-classical estimation scheme was introduced by the authors in Refs. [13, 16], where the estimator has a classical part, which yields the desired final estimate, and a quantum part, which may involve coherent feedback. This is different from the quantum observer studied in Ref. [9]. A quantum observer is a purely quantum system, that gives a quantum estimate of a variable for a quantum plant. ⋆ Preliminary versions of some of the results of this paper were presented at the 3rd Australian Control Conference (AUCC), November 2013, Perth, Australia, and the 53rd IEEE Conference on Decision and Control (CDC), December 2014, Los Angeles, CA, USA. Corresponding author: Shibdas Roy. Tel. +44 (0) 24761 50635. Email addresses: roy [email protected] (Shibdas Roy), [email protected] (Ian R. Petersen), [email protected] (Elanor H. Huntington). Preprint submitted to Automatica By contrast, a coherent-classical estimator is a mixed quantum-classical system, that yields a classical estimate of a variable for a quantum plant. In this paper, we elaborate and build on the results of the conference papers Refs. [13, 16] to present two key theorems, propose three relevant conjectures, and illustrate our findings with several examples. We show that a coherent-classical estimator without feedback, where either of the plant and the coherent controller is a physically realizable annihilation operator only system, it is not possible to get better estimates than the corresponding purely-classical estimator. Otherwise it is possible to get better estimates in certain cases. But we observe in examples that for the optimal choice of the homodyne angle, classical-only estimation is always superior. Moreover, we demonstrate that a coherent-classical estimator with coherent feedback can provide with higher estimation precision than classical-only estimation. This is possible only if either of the plant and the controller can not be defined purely using annihilation operators. Furthermore, if there is any improvement with the coherentclassical estimator (with feedback) over purely-classical estimation, we see in examples that the latter is always inferior for the optimal choice of the homodyne angle. The paper is structured as follows. Section 2 introduces the class of linear quantum systems considered here and 6 April 2017 discusses physical realizability for such systems. Section 3 formulates the problem of optimal purely-classical estimation. In Section 4, we formulate the optimal coherentclassical estimation problem without coherent feedback, and present our first theorem and two conjectures supported by examples. Section 5 discusses the coherentclassical estimation scheme involving coherent feedback and lays down our second theorem and another conjecture with pertinent examples. Finally, Section 6 concludes the paper with relevant summarizing remarks. 2.1 2 Theorem 2.2 (See [7, 14]) An annihilation operator only linear quantum system of the form (5) is physically realizable, if and only if there exists a complex commutation matrix Θ = Θ† > 0, satisfying Annihilation operator only linear quantum systems are a special case of the above class of linear quantum systems, where the QSDEs (1) can be described purely in terms of the vector of annihilation operators [7, 8]: da(t) = F1 a(t)dt + G1 dA(t); dAout (t) = H1 a(t)dt + K1 dA(t). Linear Quantum Systems The class of linear quantum systems we consider here are described by the quantum stochastic differential equations (QSDEs) [4, 5, 12, 13, 18]:  da(t)   a(t)   da(t)# where =F a(t)# F = ∆(F1 , F2 ), H = ∆(H1 , H2 ),  dt + G  h i Θ = a, a† ,  dA(t) ; dA(t)#       dAout (t) a(t) dA(t)  =H  dt + K  , dAout (t)# a(t)# dA(t)#  G = ∆(G1 , G2 ), K = ∆(K1 , K2 ). such that (2) Θ =    a such that where J = " I 0 0 −I (8) where κ1 , κ2 > 0, χ ∈ C, and a is a single annihilation operator of the cavity mode [1, 2]. This leads to a linear quantum system of the form (1) as follows:  da(t)   = − γ2 −χ  a(t)    dt −χ∗ − γ2 a(t)∗     dA1 (t) dA2 (t) √ √  − κ2  ; − κ1  dA1 (t)∗ dA2 (t)∗       (9) a(t) dA1 (t) dAout √ 1 (t)  dt +  ;   = κ1  ∗ a(t)∗ dA1 (t)∗ dAout 1 (t)       a(t) dA2 (t) dAout √ 2 (t)  dt +  .   = κ2  ∗ a(t)∗ dA2 (t)∗ dAout 2 (t)  (3) F Θ + ΘF † + GJG† = 0, G = −ΘH † J, K = I, Linear Quantum System from Quantum Optics √ √ γ da = − adt − χa∗ dt − κ1 dA1 − κ2 dA2 ; 2 √ dAout = κ1 adt + dA1 ; 1 √ dAout = κ2 adt + dA2 , 2 †  ,   a# a#   †  #  T T a a a a =  #   #  −  #   #   , a a a a (7) An example of a linear quantum system is a linearized dynamic optical squeezer. This is an optical cavity with a non-linear optical element inside as shown in Fig. 1. Such a dynamic squeezer can be described by the quantum stochastic differential equations [13]: Theorem 2.1 (See [14, 18]) A complex linear quantum system of the form (1), (2) is physically realizable, if and only if there exists a complex commutation matrix Θ = Θ† satisfying the following commutation relation a (6) G1 = −ΘH1† , K1 = I. 2.2 (5) F1 Θ + ΘF1† + G1 G†1 = 0, (1) Here, a(t) = [a1 (t) . . . an (t)]T is a vector of annihilation operators. The adjoint a∗i of the operator ai is called a creation operator. The notation ∆(F1 , F2 ) denotes the # " F1 F2 . Also, F1 , F2 ∈ Cn×n , G1 , G2 ∈ matrix F2# F1# Cn×m , H1 , H2 ∈ Cm×n , and K1 , K2 ∈ Cm×m . Moreover, # denotes the adjoint of a vector of operators or the complex conjugate of a complex matrix. Furthermore, † denotes the adjoint transpose of a vector of operators or the complex conjugate transpose of a complex matrix. In addition, A(t) = [A1 (t) . . . Am (t)]T is a vector of external independent quantum field operators and Aout (t) is the corresponding vector of output field operators.  Annihilation Operator Only Systems da(t)∗ The above quantum system requires γ = κ1 +κ2 in order for the system to be physically realizable. (4) Also, the above quantum optical system can be described purely in terms of the annihilation operator, if and only if χ = 0, i.e. there is no squeezing, in which case it # . 2 √ Here, ι = −1, and the angles θ1 , . . . , θm determine the quadrature measured by each homodyne detector. The vector of real classical signals y = [y1 . . . ym ]T is then used as the input to a classical estimator defined as: dxe = Fe xe dt + Ge dy; ẑ = He xe . Here ẑ is a scalar classical estimate of the quantity z. The estimation error corresponding to this estimate is Fig. 1. Schematic diagram of a dynamic optical squeezer. reduces to a passive optical cavity. This leads to a linear quantum system of the form (5) as follows: √ √ γ da = − adt − κ1 dA1 − κ2 dA2 ; 2 √ dAout = κ1 adt + dA1 ; 1 √ dAout = κ2 adt + dA2 , 2 e = z − ẑ. J¯c = lim he∗ (t)e(t)i , (10) t→∞ The optimal classical estimator is given by the standard (complex) Kalman filter defined for the system (11), (12). This optimal classical estimator is obtained from the solution to the algebraic Riccati equation: The schematic diagram of a purely-classical estimation scheme is provided in Fig. 2. We consider a quantum plant of the form (1), (2), defined as follows: da   =F a    dt + G  dA da# a# Fa P̄e + P̄e Fa† + Ga G†a − (Ga Ka† + P̄e Ha† )L† × (LKa Ka† L† )−1 L(Ga Ka† + P̄e Ha† )† = 0,  ; dA#       dY a dA  =H  dt + K  ; dY # a# dA#   a z = C  # . a  where (11)    L1 =         L2 =     In purely-classical estimation, a quadrature of each component of the vector Y is measured using homodyne detection to produce a corresponding classical signal yi : dym (16) Ga = G, h i L = L1 L2 ,  1 −ιθ1 e 0 . . . 0 2   1 −ιθ2 e ... 0 0  2 ,  ..  . 0 0 0  1 −ιθm 0 ... 0 2e  1 ιθ1 e 0 ... 0 2  0  0 21 eιθ2 . . .  .  .. . 0  0 0  0 . . . 0 12 eιθm Ka = K, (17) Here we have assumed that the quantum noise A is purely canonical, i.e. dAdA† = Idt and hence K = I. 1 1 −ιθ1 e dY1 + eιθ1 dY1∗ ; 2 2 .. . Fa = F, Ha = H,  Here, z denotes a scalar operator on the underlying Hilbert space and represents the quantity to be estimated. Also, Y is the vector of output fields of the plant, and A is a vector of quantum noises acting on the plant. dy1 = (15) which is the mean-square error of the estimate. Here, h·i denotes the quantum expectation over the joint quantum-classical system defined by (11), (12), (13). Purely-Classical Estimation  (14) Then, the optimal classical estimator is defined as the system (13) that minimizes the quantity where again the system is physically realizable when we have γ = κ1 + κ2 . 3 (13) Equation (16) thus becomes: (12) F P̄e + P̄e F † + GG† − (G + P̄e H † )L† 1 1 ∗ = e−ιθm dYm + eιθm dYm . 2 2 × (LL† )−1 L(G + P̄e H † )† = 0. (18) Then, the corresponding optimal classical estimator (13) is defined by the equations: Fe = F − Ge LH; Ge = (G + P̄e H † )L† (LL† )−1 ; He = C. (19) The value of the cost (15) is given by Fig. 2. Schematic diagram of purely-classical estimation. J¯c = C P̄e C † . 3 (20) linear system defined by the following QSDEs:     a          da#  0  G dA a#    F      ; =   dt +   dac   Gc H Fc  Gc K dA#    ac  da  da# c a# c  Fig. 3. Schematic diagram of coherent-classical estimation. 4      i  a#  dA     = Kc H Hc  .  dt + Kc K   ac  dỸ # dA#   a# c Coherent-Classical Estimation In coherent-classical estimation scheme of Fig. 3, the plant output Y(t) does not directly drive a bank of homodyne detectors as in (12). Rather, this is fed into another quantum system called a coherent controller, defined as  dac   ac   dY da# c  = Fc  a# c  dt + Gc   (21) Fa =  Gc H Fc  , 0  (22) dỹm̃ = 0 F  Ga =  G Gc K h i Ha = Kc H Hc , Ka = Kc K,  1 −ιθ̃1 e 0 ... 0 2  0 1 −ιθ̃2 e ... 0  2 L̃1 =   ..  0 . 0 0  1 1 −ιθ̃1 e dỸ1 + eιθ̃1 dỸ1∗ ; 2 2 .. . h The optimal classical estimator is given by the standard (complex) Kalman filter defined for the system (24), (22). This optimal classical estimator is obtained from the solution P̃e to an algebraic Riccati equation of the form (16), where A quadrature of each component of Ỹ is homodyne detected to yield a corresponding classical signal ỹi : dỹ1 = dỸ (24)  ; dY #       dY dỸ ac   dt + Kc  .  = Hc  a# dY # dỸ # c    a    L̃2 =     1 1 −ιθ̃m̃ ∗ e dỸm̃ + eιθ̃m̃ dỸm̃ . 2 2 0 ... 1 −ιθ̃m̃ e 2 0 ... 0 0 1 ιθ̃2 e 2 0 1 ιθ̃m̃ e 2 0 0 0 ... 0 , h i L = L̃1 L̃2 ,     ,    (25)  1 ιθ̃1 e 2 ... .. .  0    ,    where since the quantum noise A is assumed to be purely canonical, i.e. dAdA† = Idt, we have Ka = Kc K = I, which requires Kc = I too, as K = I. Here, the angles θ̃1 , . . . , θ̃m̃ determine the quadrature measured by each homodyne detector. The vector of real classical signals ỹ = [ỹ1 . . . ỹm̃ ]T is then used as the input to a classical estimator defined as follows: Then, the corresponding optimal classical estimator (23) is defined by the equations: dx̃e = F̃e x̃e dt + G̃e dỹ; ẑ = H̃e x̃e . F̃e = Fa − G̃e LHa ; (23) We write: Here ẑ is a scalar classical estimate of the quantity z. Corresponding to this estimate is the estimation error (14). Then, the optimal coherent-classical estimator is defined as the systems (21), (23) which together minimize the quantity (15). Note that the coherent controller does not directly produce an estimate of a plant variable as in the quantum observer of Ref. [9]. Instead, it only works in combination with the classical estimator to yield a classical estimate of the quantity z. G̃e = (Ga Ka† + P̃e Ha† )L† (LL† )−1 ; h i H̃e = C 0 .   P1 P2 , P̃e =  † P2 P3 (26) (27) where P1 is of the same dimension as P̄e . Then, the corresponding cost of the form (15) is h i  J˜c = C 0 P̃e  C† 0   = CP1 C † . (28) Thus, the optimal coherent-classical estimation problem can be solved by first choosing the coherent controller (21) to minimize the cost (28). Then, the classical estimator (23) is constructed according to (26). We can now combine the quantum plant (11) and the coherent controller (21) to yield an augmented quantum 4 " # Remark 1 Note that the combined plant-controller system being measured here is a fully quantum system, such that the controller preserves the quantum coherence of the quantum plant output (that is not measured directly) and yet can be chosen suitably, as mentioned above, to assist in improving the precision of the classical estimate of a plant variable. On the other hand, with purely-classical estimation, we have no control over the variables of the quantum system (just the plant itself ) being measured. > 0. Clearly, P̄e = Θ satisfies # " 0 Θ# 1 Θ 0 satisfies (16), (18) owing to (35). Also, P̃e = 0 P3 (25) for the coherent-classical estimation case. Here, P3 > 0 is the error-covariance of the purely-classical estimation of the coherent controller alone. Thus, we get J¯c = J˜c = CΘC † . Theorem 4.1 Consider a coherent-classical estimation scheme defined by (5) (Aout being Y), (21), (22) and (23), such that the plant is physically realizable, with the cost J˜c defined in (28). Also, consider the corresponding purely-classical estimation scheme defined by (5), (12) and (13), such that the plant is physically realizable, with the cost J¯c defined in (20). Then, Remark 2 Note that the Kalman gain of the purelyclassical estimator is 0 when P̄e = Θ, i.e. the Kalman state estimate is independent of the measurement. This is consistent with Cor. 1 of Ref. [14], which states that for a physically realizable annihilation operator quantum system with only quantum noise inputs, any output contains no information about the system’s internal variables. J˜c = J¯c . where Θ = (29) Remark 3 Theorem 4.1 implies that coherent-classical estimation of a physically realizable annihilation operator quantum plant performs identical to, and no better than, purely-classical estimation of the plant. This is so because the output field of the plant contains no information about the plant’s internal variables and, thus, simply serves as a quantum white noise input for the controller. Proof We first consider the form of the system (11) with the assumption that the plant is an annihilation operator only system. A quantum system (1), (2) is characterized by annihilation operators only when F2 , G2 , H2 , K2 = 0. Then, the equations for the annihilation operators in (11) take the form da = F1 adt + G1 dA; dY = H1 adt + K1 dA. Now, we present an example to illustrate Theorem 4.1. Let the quantum plant be a dynamic squeezer (See (9)): (30)  The corresponding equations for creation operators are # da# = F1# a# dt + G# 1 dA ; Hence, the plant by (11), where  is described    H= F1 0 0 F1# ,G =  H1 0 0 H1#  G1  ,K =  0 0 G# 1 , K1 0  0 K1# (32) Next, we use the assumption that the plant is physically realizable. Then, by applying Theorem 2.2 to (30), there exists a matrix Θ1 > 0, such that F1 Θ1 + Θ1 F1† + G1 G†1 = 0, Hence, (33)  = − γ2 −χ  a  da∗ da   = − γ2 −χ  a     dt − a∗ −χ∗ − γ2       √ a dY dỸ .   = κ   dt +  a∗ dY ∗ dỸ ∗  (34) K1# = I. Combining (33) and (34), we get F Θ + ΘF † + GG† = 0, G = −ΘH † , K = I,  √  κ dA dA∗  ; (36) We next consider coherent-classical estimation, where the coherent controller (21) is also a dynamic squeezer: # T # T F1# Θ# 1 + Θ1 F1 + G1 G1 = 0, # T G# 1 = −Θ1 H1 ,  Here, we choose γ = 4, κ = 4 and χ = 0. Note that this system is physically realizable, since γ = κ, and is annihilation operator only, since χ = 0. In fact, this system corresponds to a passive optical cavity. We then calculate the optimal classical-only state estimator and the error J¯c of (20) for this system using the standard Kalman filter equations corresponding to homodyne detector angles varying from θ = 0◦ to θ = 180◦ . . G1 = −Θ1 H1† , K1 = I. da    dt − a∗ −χ∗ − γ2       √ a dA dY ;   = κ   dt +  a∗ dA∗ dY ∗   h i a z = 0.2 −0.2  ∗  . a  (31) dY # = H1# a# dt + K1# dA# , F = Θ1 0 da∗ √  κ dY dY ∗  ; (37) Here, we choose γ = 16, κ = 16 and χ = 2, so that the system is physically realizable. Then, the classical estimator for this case is calculated according to (24), (25), (35) 5 0.18 0.08 Mean-square error Mean-square error 0.1 0.06 J¯c J˜c 0.04 0.02 0 0 20 40 60 80 100 θ (degrees) 120 140 160 0.16 J¯c J˜c X: 10 Y: 0.1491 0.14 X: 10 Y: 0.1392 0.12 0.1 0 180 20 40 60 80 100 θ (degrees) 120 140 160 180 Fig. 4. Estimation error vs. homodyne angle θ in the case of an annihilation operator only plant. Fig. 6. Estimation error vs. homodyne angle θ in the case of a squeezer plant and a squeezer controller. (16), (26) for the homodyne detector angle varying from θ = 0◦ to θ = 180◦. The resulting cost J˜c in (28) alongwith the cost for the purely-classical estimator is shown in Fig. 4. Clearly, both the classical-only and coherentclassical estimators have the same estimation error cost for all homodyne angles. This illustrates Theorem 4.1. ically realizable, with the cost J¯c defined in (20). Then, J˜c ≥ J¯c . (38) Furthermore, we see an example where both the plant and the controller are physically realizable quantum systems with χ 6= 0. In (36), we choose γ = 4, κ = 4, χ = 1, and in (37), γ = 16, κ = 16, χ = 4. Fig. 6 then shows that the coherent-classical estimator can perform better than the purely-classical estimator, e.g. for a homodyne angle of θ = 10◦ . It however appears that for the best choice of homodyne angle, the classical-only estimator always outperforms the coherent-classical estimator. Next, we consider a case where the controller is a physically realizable annihilation operator only system. But, the plant is physically realizable and has χ 6= 0. In (36), we choose γ = 4, κ = 4, χ = 0.5, and in (37), γ = 16, κ = 16, χ = 0. Fig. 5 then shows that the coherentclassical error is greater than or equal to the purelyclassical error for all homodyne angles. In fact, we observe that the coherent-classical estimator can be no better than the purely-classical estimator, when the coherent controller is an annihilation operator only system. We present this here as a conjecture, which is a consequence of the quantum data processing inequality from Ref. [17]. Indeed, the coherent information in the plant cannot be increased by additional dynamics of a coherent controller, that does not have any squeezing and provides no feedback to the plant. Thus, such a controller cannot improve the estimation accuracy. Conjecture 4.2 Consider a coherent-classical estimation scheme defined by (11), (21), (22) and (23) with a cost J˜c defined in (28). Also, consider the corresponding purely-classical estimation scheme defined by (11), (12) and (13) with a cost J¯c defined in (20). Then, for the optimal choice of the homodyne angle θopt , Conjecture 4.1 Consider a coherent-classical estimation scheme defined by (11), (21), (22) and (23), where the plant is physically realizable and the coherent controller is a physically realizable annihilation operator only system, with the cost J˜c defined in (28). Also, consider the corresponding purely-classical estimation scheme defined by (11), (12) and (13), such that the plant is phys- 5 J˜c (θopt ) ≥ J¯c (θopt ).  Mean-square error 0.1 J¯c J˜c 20 40 60 80 100 θ (degrees) 120 140 160     dA    i  dA#     =F  dt + G1 G2  ;  dU  da# a#   dU #   dA       h i  dA#  dY a   =H  dt + K 0   ;  dU  dY # a#   dU #   a z = C  # . a 0.105 0.09 0 Coherent-Classical Estimation with Feedback Here, we consider the case where there is quantum feedback from the coherent controller to the quantum plant [13]. For this purpose, the plant is assumed to have a control input U as in Fig. 7. Then, (11) becomes 0.11 0.095 (39) 180 Fig. 5. Estimation error vs. homodyne angle θ in the case of an annihilation operator only controller. 6 da a h (40) The optimal purely-classical estimator is obtained from the solution of a Riccati equation of the form (18): F P̄e + P̄e F † + G1 G†1 + G2 G†2 − (G1 + P̄e H † ) × L† (LL† )−1 L(G1 + P̄e H † )† = 0, (41) where we have assumed K = I as before. The estimation error cost is then given by (20). Fig. 8. Schematic diagram of coherent-classical estimation with coherent feedback. The coherent controller here would have an additional output that is fed back to the control input of the quantum plant, as depicted in Fig. 8. The coherent controller in this case is defined as follows [13]:      dà braic Riccati equation of the form (16), where   Fa =    h i  dÃ#    dt + Gc1 Gc2  ;   dY  a# da# c c   dY #     dỸ dà           #   dỸ #  K̃c1 K̃c2    H̃c   ac    dà    dt + = .     dU  Hc a# Kc1 Kc2  c    dY  # # dU dY (42) dac   = Fc  ac  Ga =  da   a Gc2 H Fc  , G1 + G2 Kc2 K G2 Kc1 Gc2 K i Ha = K̃c2 H H̃c , h Gc1  , (44) h i Ka = K̃c2 K K̃c1 , and L̃1 , L̃2 and L as in (25). Here, for the coherent controller to be physically realizable, we would have:  The plant (40) and the controller (42) can be combined to yield an augmented system [13]:  F + G2 Kc2 H G2 Hc   K̃c1 K̃c2 Kc1 Kc2   = I, which implies K̃c1 = Kc2 = I and Kc1 = K̃c2 = 0. The estimation error is then given by the cost (28).       #  da#    F + G2 Kc2 H G2 Hc   a    dt =    ac   dac  Gc2 H Fc     Remark 4 Note that the combined plant-controller system being measured here is again a fully quantum system. The coherent controller not only preserves the quantum coherence of the quantum plant output, but also allows for coherent feedback control of the quantum plant by means of a suitable choice of the controller parameters that minimizes (28). This further assists in improving the precision of the classical estimate of a plant variable, when compared to the cases of purely-classical estimation and coherent-classical estimation without coherent feedback. a# c      dA  G1 + G2 Kc2 K G2 Kc1  dA#    + ;   dà  Gc2 K Gc1   dÃ#     dA a       h h i  dA#  i  a#  dỸ      = K̃c2 H H̃c   dt + K̃c2 K K̃c1  .  #     dỸ  dà   ac  # # ac dà (43) da# c Theorem 5.1 Consider a coherent-classical estimation scheme defined by (40), (42), (22) and (23), such that both the plant and the controller are physically realizable annihilation operator only systems, with the cost J˜c as in (28). Also, consider the corresponding purely-classical estimation scheme defined by (40), (12) and (13), such that the plant is a physically realizable annihilation operator only system, with the cost J¯c as in (20). Then, The optimal coherent-classical estimator is then obtained from the solution P̃e (given by (27)) to an alge- J˜c = J¯c . (45) Proof The plant (40) may be augmented to account for an unused output Ȳ to recast the QSDE’s in the desired form, that lends itself appropriately to the physical re- Fig. 7. Modified schematic of purely-classical estimation. 7 alizability treatment, as follows: 1.5  dA    i da a dA#    =F  dt + G1 G2  ;  # #   da a  dU  dU #     dY     dA       dY #  K 0  dA#   H  a      dt + =  ;  #  dȲ   dU  H̄ a 0 K̄     dȲ # dU #   a z = C  # . a     Mean-square error  h (46) 40 60 80 100 θ (degrees) 120 140 160 180 the quantum plant (36) takes the form:  da   = − γ2 −χ  a     dt −χ∗ − γ2 a∗     dA dU √ √  − κ2  ; − κ1  dA∗ dU ∗       √ a dA dY ;   = κ   dt +  a∗ dA∗ dY ∗   i a h z = √1 − √1  ∗  . 2 2 a  (47) G2 = −ΘH̄ † , for the annihilation operator only plant to be physically realizable with the commutation matrix Θ > 0. Similarly, if the coherent controller (42) is an annihilation operator only system, we must have the following for it to be physically realizable: da∗ (49) Here, we choose γ = 4, κ1 = κ2 = 2 and χ = 0. Note that this system is physically realizable, since γ = κ1 + κ2 , and is annihilation operator only, since χ = 0. We then calculate the optimal classical-only state estimator and the error J¯c in (20) for this system using the standard Kalman filter equations corresponding to homodyne detector angles varying from θ = 0◦ to θ = 180◦ . Fc Θc + Θc Fc† + Gc1 G†c1 + Gc2 G†c2 = 0, Gc1 = −Θc H̃c† , 20 Fig. 9. Feedback: Estimation error vs. homodyne angle θ in the case of annihilation operator only plant and controller. F Θ + ΘF † + G1 G†1 + G2 G†2 = 0, G1 = −ΘH , J¯c J˜c 0.5 0 0 Here, K̄ = I for the plant to be physically realizable. Additionally, using the same arguments as in the proof for Theorem 4.1, we must have: † 1 (48) Gc2 = −Θc Hc† , The coherent controller (37) in this case takes the form: where Θc > 0 is the controller’s commutation matrix.  da   = − γ2 −χ  a     dt −χ∗ − γ2 a∗     dà dY √ √  − κ2  ; − κ1  dÃ∗ dY ∗       a dà dỸ √ ;   = κ1   dt +  a∗ dÃ∗ dỸ ∗       dU a dY √   = κ2   dt +  . dU ∗ a∗ dY ∗ Clearly, P̄e = Θ satisfies the Riccati equation (41), owing to (47), for the purely-classical estimation case. More# " Θ 0 over, it follows from (47) and (48), that P̃e = 0 Θc ¯ ˜ satisfies (16), (44). Thus, we get Jc = Jc = CΘC † .  Remark 5 Theorem 5.1 implies that coherent-classical estimation with coherent feedback, where both the plant and the controller are physically realizable annihilation operator quantum systems, performs identical to, and no better than, purely-classical estimation of the plant. Note that in addition to P2 = 0, we need to have both P1 = Θ and P3 = Θc for the coherent-classical scheme to be equivalent to the classical-only scheme. da∗ (50) Here, we choose γ = 16, κ1 = κ2 = 8 and χ = 0, so that it is a physically realizable annihilation operator only system. Then, the classical estimator for this case is calculated according to (43), (44), (16), (26) for the homodyne detector angle varying from θ = 0◦ to θ = 180◦. The resulting value of the cost J˜c in (28) alongwith the cost for the purely-classical estimator case is shown Now, we present examples involving dynamic squeezers for the case of coherent-classical estimation with feedback. First, we give one to illustrate Theorem 5.1. Here, 8 in Fig. 9. Clearly both the classical-only and coherentclassical estimators have the same estimation error cost for all homodyne angles. This illustrates Theorem 5.1. 1.06 Mean-square error We now show in examples that when either the plant or the controller is not an annihilation operator quantum system, the coherent-classical estimator with coherent feedback can provide improvement over the purelyclassical estimator. We first consider an example where the controller is a physically realizable annihilation operator only system. But, the plant is physically realizable with χ 6= 0. In (49), we choose γ = 4, κ1 = κ2 = 2, χ = 0.5, and in (50), γ = 16, κ1 = κ2 = 8, χ = 0. Fig. 10 then shows that the coherent-classical error is less than the purely-classical error for all homodyne angles. 1 0.98 0.94 0 20 40 60 80 100 θ (degrees) 120 Mean-square error 1.8 1.6 20 40 60 80 100 θ (degrees) 120 J˜c (θopt ) ≤ J¯c (θopt ). 6 (51) Conclusion In this paper, we studied two flavours of coherentclassical estimator, one with coherent feedback and the 1.38 Mean-square error 1.3 J¯c J˜c J¯c J˜c 140 160 1.34 1.32 1.3 1.28 1.26 0 1.1 120 180 All of the above results in this section suggest that either or both of the plant and the controller need to have non-zero squeezing to produce better estimates than in classical-only case. This is because the coherent information (in the spirit of Ref. [17]) at the output of the combined plant-controller quantum system here can be no more than at the output of the quantum plant, when both the plant and the controller are passive systems. 1.4 80 100 θ (degrees) 160 the best choice θopt of homodyne angle, 1.36 60 140 Fig. 12. Feedback: Estimation error vs. homodyne angle θ in the case of a squeezer plant and a squeezer controller. 1.5 40 180 J¯c J˜c 2 1.4 0 Conjecture 5.1 Consider a coherent-classical estimation scheme defined by (40), (42), (22) and (23) with a cost J˜c defined in (28). Also, consider the corresponding purely-classical estimation scheme defined by (40), (12) and (13) with a cost J¯c defined in (20). Then, if there exists a homodyne angle θi for which J˜c (θi ) ≤ J¯c (θi ), for 20 160 2.2 We observe that if there is any improvement with the coherent-classical estimation (with feedback) over purely-classical estimation, the former is always superior to the latter for the best choice of the homodyne angle. This we propose as a conjecture here. This is just the opposite of Conjecture 4.2 for the no feedback case. 1.2 140 Fig. 11. Feedback: Estimation error vs. homodyne angle θ in the case of an annihilation operator only plant. We also show the case where both the plant and the controller have χ 6= 0. With γ = 4, κ1 = κ2 = 2, χ = 1 in (49), and γ = 16, κ1 = κ2 = 8, χ = −0.5 in (50), Fig. 12 shows that coherent-classical error is less than purely-classical error for all homodyne angles. However, with both plant and controller having χ 6= 0, coherentclassical estimates can be better than purely-classical estimates for only certain homodyne angles, as in Fig. 13, where we used γ = 4, κ1 = κ2 = 2, χ = 0.5 in (49) and γ = 16, κ1 = κ2 = 8, χ = 0.5 in (50). Mean-square error 1.02 0.96 Then, we consider the case where the plant is an annihilation operator only system, but the coherent controller is not. In (49), we choose γ = 4, κ1 = κ2 = 2, χ = 0, and in (50), we take γ = 16, κ1 = κ2 = 8, χ = −0.5. Fig. 11 then shows that the coherent-classical error is again less than the purely-classical error for all homodyne angles. 1 0 J¯c J˜c 1.04 180 20 40 60 80 100 θ (degrees) 120 140 160 180 Fig. 13. Feedback: Estimation error vs. homodyne angle θ in the case of a squeezer plant and a squeezer controller, where it is possible to get better coherent-classical estimates than purely-classical estimates only for certain homodyne angles. Fig. 10. Feedback: Estimation error vs. homodyne angle θ in the case of an annihilation operator only controller. 9 [9] Miao, Z. and James, M.R. (2012). Quantum observer for linear quantum stochastic systems. In Proceedings of the 51st IEEE Conference on Decision and Control. Maui, Hawaii. [10] Nurdin, H.I., James, M.R., and Doherty, A.C. (2009). Network synthesis of linear dynamical quantum stochastic systems. SIAM Journal on Control and Optimization, 48(4), 2686–2718. [11] Nurdin, H.I., James, M.R., and Petersen, I.R. (2009). Coherent quantum LQG control. Automatica, 45(8), 1837–1846. [12] Petersen, I.R. (2010). Quantum linear systems theory. In Proceedings of the 19th International Symposium on Mathematical Theory of Networks and Systems. Budapest, Hungary. [13] Petersen, I.R. (2013). Coherent-classical estimation for quantum linear systems. In Proceedings of Australian Control Conference. Perth, Australia. [14] Petersen, I.R. (2013). Notes on coherent feedback control for linear quantum systems. In Proceedings of Australian Control Conference. Perth, Australia. [15] Roy, S. and Petersen, I.R. (2016). Robust H∞ estimation of uncertain linear quantum systems. International Journal of Robust and Nonlinear Control, 26(17), 3723–3736. [16] Roy, S., Petersen, I.R., and Huntington, E.H. (2014). Coherent-classical estimation versus purely-classical estimation for linear quantum systems. In Proceedings of the Conference on Decision and Control. Los Angeles CA, USA. [17] Schumacher, B. and Nielsen, M.A. (1996). Quantum data processing and error correction. Phys. Rev. A, 54(4), 2629. [18] Shaiju, A.J. and Petersen, I.R. (2012). A frequency domain condition for the physical realizability of linear quantum systems. IEEE Transactions on Automatic Control, 57(8), 2033–2044. [19] Walls, D.F. and Milburn, G.J. (1994). Quantum Optics. Springer-Verlag, Berlin; New York. [20] Wiseman, H.M. and Doherty, A.C. (2005). Optimal unravellings for feedback control in linear quantum systems. Phys. Rev. Lett., 94, 070405. [21] Wiseman, H.M. and Milburn, G.J. (1994). Alloptical versus electro-optical quantum-limited feedback. Phys. Rev. A, 49(5), 4110–4125. [22] Wiseman, H.M. and Milburn, G.J. (2010). Quantum Measurement and Control. Cambridge University Press. [23] Yamamoto, N. (2006). Robust observer for uncertain linear quantum systems. Phys. Rev. A, 74, 032107. [24] Yanagisawa, M. and Kimura, H. (2003). Transfer function approach to quantum control-part I: Dynamics of quantum feedback systems. IEEE Transactions on Automatic Control, 48(12), 2107–2120. [25] Yanagisawa, M. and Kimura, H. (2003). Transfer function approach to quantum control-part II: Control concepts and applications. IEEE Transactions on Automatic Control, 48(12), 2121–2132. other without, for a class of linear quantum systems. We did a comparison study of these with the corresponding purely-classical estimators. Indeed, the class of linear quantum systems considered here can be rewritten in terms of linear classical stochastic systems and the results explained in the classical world. However, any classical model for the plant or the controller is inherently physical, whereas the corresponding models depicting a quantum plant or controller need to satisfy the physical realizability constraints to be actual physical systems. Moreover, our results imply physically that the combined plant-controller quantum system under measurement should have increased coherent information at its output compared with the output of the plant alone being measured, to be able to produce more accurate classical estimates of a plant variable. Intuitively, these results should also hold for non-linear quantum systems. Acknowledgements This work was supported by the Australian Research Council (ARC) under grants CE110001027 (EHH) and FL110100020 (IRP), and by the US Air Force Office of Scientific Research (AFOSR) under agreement number FA2386-16-1-4065 (IRP). SR was funded by the Singapore National Research Foundation Grant No. NRFNRFF2011-07 and the Singapore Ministry of Education Academic Research Fund Tier 1 Project R-263-000C06-112, and is currently funded by the UK National Quantum Technologies Programme (EP/M01326X/1, EP/M013243/1). Moreover, SR thanks Mohamed Mabrok for useful discussions related to this work. References [1] Bachor, H. and Ralph, T. (2004). A Guide to Experiments in Quantum Optics. Wiley-VCH, Weinheim, Germany, 2 edition. [2] Gardiner, C. and Zoller, P. (2000). Quantum Noise. Springer, Berlin. [3] Gough, J., Gohm, R., and Yanagisawa, M. (2008). Linear quantum feedback networks. Phys. Rev. A, 78, 062104. [4] Gough, J.E., James, M.R., and Nurdin, H.I. (2010). Squeezing components in linear quantum feedback networks. Phys. Rev. A, 81, 023804. [5] James, M.R., Nurdin, H.I., and Petersen, I.R. (2008). H ∞ control of linear quantum stochastic systems. IEEE Transactions on Automatic Control, 53(8), 1787–1803. [6] Lloyd, S. (2000). Coherent quantum feedback. Phys. Rev. A, 62, 022108. [7] Maalouf, A.I. and Petersen, I.R. (2011). Bounded real properties for a class of linear complex quantum systems. IEEE Transactions on Automatic Control, 56(4), 786–801. [8] Maalouf, A.I. and Petersen, I.R. (2011). Coherent H ∞ control for a class of linear complex quantum systems. IEEE Transactions on Automatic Control, 56(2), 309–319. 10
3cs.SY
arXiv:1710.04486v1 [cs.HC] 12 Oct 2017 Multimodal Observation and Interpretation of Subjects Engaged in Problem Solving Thomas Guntz Raffaella Balzarini Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP* , LIG, F-38000 Grenoble, France [email protected] Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP* , LIG, F-38000 Grenoble, France [email protected] Dominique Vaufreydaz James Crowley Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP* , LIG, F-38000 Grenoble, France [email protected] Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP* , LIG, F-38000 Grenoble, France [email protected] ABSTRACT In this paper we present the first results of a pilot experiment in the capture and interpretation of multimodal signals of human experts engaged in solving challenging chess problems. Our goal is to investigate the extent to which observations of eye-gaze, posture, emotion and other physiological signals can be used to model the cognitive state of subjects, and to explore the integration of multiple sensor modalities to improve the reliability of detection of human displays of awareness and emotion. We observed chess players engaged in problems of increasing difficulty while recording their behavior. Such recordings can be used to estimate a participant’s awareness of the current situation and to predict ability to respond effectively to challenging situations. Results show that a multimodal approach is more accurate than a unimodal one. By combining body posture, visual attention and emotion, the multimodal approach can reach up to 93% of accuracy when determining player’s chess expertise while unimodal approach reaches 86%. Finally this experiment validates the use of our equipment as a general and reproducible tool for the study of participants engaged in screen-based interaction and/or problem solving. KEYWORDS Chess Problem Solving, Eye Tracking, Multimodal Perception, Affective Computing 1 INTRODUCTION Commercially available sensing technologies are increasingly able to capture and interpret human displays of emotion and awareness through non-verbal channels. However, such sensing technologies tend to be sensitive to environmental conditions (e.g. noise, light exposure or occlusion), producing intermittent and unreliable information. Techniques for combining multiple modalities to improve the precision and reliability of modeling of awareness and emotion are an open research problem. Only few researches have been conducted so far on how such signals can be used to inform a system about cognitive processes such as situation awareness, understanding or engagement. For instance, some researches showed that mental states can be inferred from facial expressions and gestures (from head and body) [1, 2]. * Institute of Engineering Univ. Grenoble Alpes Willing to increase focus on this area of research, we have constructed an instrument for the capture and interpretation of multimodal signals of humans engaged in solving challenging problems. Our instrument, shown in figure 2, captures eye gaze, fixations, body postures and facial expressions signals from humans engaged in interactive tasks on a touch screen. As a pilot study, we have observed these signals for players engaged in solving chess problems. Recordings are used to estimate subjects’ understanding of the current situation and their ability to respond effectively to challenging tasks. Our initial research question for this experiment was: • Can our experimental set up be used to capture reliable recordings for such study? If successful, this should allow us to a second research question: • Can we detect when chess players are challenged beyond their abilities from such measurements? In this article, section 2 discusses current methods for capture and interpretation of physiological signs of emotion and awareness. This lays the ground for the design of our experimental setup presented in section 3. Section 4 presents the results from our pilot experiment that was undertaken to validate our installation and evaluate the effectiveness of our approach. We conclude with a discussion on limitations and further directions to be explored in section 5. 2 STATE OF THE ART Humans display awareness and emotions through a variety of nonverbal channels. It is increasingly possible to record and interpret information from such channels. Thank to progress in related research, notably recently using Deep Learning approaches [3–6], publicly available efficient software can be used to detect and track face orientation using commonly available web cameras. Concentration can be inferred from changes in pupil size [7]. Measurement of physiological signs of emotion can be done by detection of Facial Action Units [8] from both sustained and instantaneous displays (micro-expressions). Heart rate can be measured from the Blood Volume Pulse as observed from facial skin color [9]. Body posture and gesture can be obtained from low-cost RGB sensors with depth information (RGB+D) [10]. Awareness and attention can be inferred from eye-gaze (scan path) and fixation using eye-tracking glasses as well as remote eye tracking devices [11]. This can be directly used to reveal cognitive processes indicative of expertise [12] or situation awareness in human-computer interaction (HCI) systems Figure 1: Multimodal view of gathered data. Left to right: RGB (with body joints) and depth view from Kinect 2 sensors, screen record of chess task (red point is current position of gaze, green point is position of last mouse click), plot of current level of positive emotion expression (valence) and frontal view of face from webcam sensor. [13]. However, the information provided by each of these modalities tends to be intermittent, and thus unreliable. Most investigators seek to combine multiple modalities to improve both reliability and stability [14, 15]. Chess analysis has long been used in Cognitive Science to understand attention and to develop models for task solving. In their study [12, 16], Charness et al showed that when engaging in competitive game, chess players display engagement and awareness of the game situation with eye-gaze and fixation. This suggests that the mental models used by players can be at least partially determined from eye gaze, fixation and physiological response. The ability to detect and observe such models during game play can provide new understanding of the cognitive processes that underlay human interaction. Experiments described in this article are the preamble to more advanced research on this topic. 3 EXPERIMENTS As a pilot study, chess players were asked to solve chess tasks within a fixed, but unknown, time frame. We recorded eye gaze, facial expressions, body postures and physiological reactions of the players as they solved problems of increasing difficulty. The main purpose is to observe changes in their reactions when presented tasks are beyond their level. 3.1 Materials and Participants 3.1.1 Experimental setup. Figure 2 presents the recording setup for our experiment. This setup is a derivative version of the one we use to record children during storytelling sessions [17]. As seen, it is composed of several hardware elements: a 23.8” Touch-Screen computer, a Kinect 2.0 mounted 35cm above the screen focusing on the chess player, a 1080p Webcam for a frontal view, a Tobii Eye-Tracking bar (Pro X260 screen-based) and two adjustable USB-LED for lighting condition control. The use of the Touch-Screen during the entire experiment was chosen to provide a gesture-based play resembling play with a physical board. A wooden super-structure is used to rigidly mount the measuring equipment with respect to the screen in order to assure identical sensor placement and orientation for all recordings. This structure have been made using a laser cutter. Figure 2: The experimentation equipment used for data collection. On top, a Kinect2 device looking down at the player. In the middle, a webcam to capture the face. At bottom, the touch screen equipped with an eye-tracker presenting the chess game. These views are respectively at left, right and center of figure 1. The wooden structure is rigid to fix position and orientation of all sensors. The lighting conditions are controlled by 2 USB LED lamps on the sides. Several software systems were used for recording and/or analyzing data. The Lichess Web Platform1 serves for playing and recording games. Two commercial software provide both online and offline information: Tobii Studio 3.4.7 for acquisition and analyze of eye-gaze; Noldus FaceReader 7.0 for emotion detection. Body postures information were given by two different means: by the Kinect 2.0 SDK and by using our enhanced version of the Realtime Multi-Person Pose Estimation software [4]. Considering the 1 https://en.lichess.org/ (last seen 09/2017) state-of-the-art results of the second software, we decided to keep only this one for this experiment. During the study, data were recorded from all sensors (Kinect 2, Webcam, Screen capture, user clicks, Tobii-Bar) using the RGBD Sync SDK2 from the MobilRGBD project [18]. This framework permits to read recorded and further computed data (gaze fixation, emotion detection, body skeleton position, etc.) for synchronous analysis by associating a timestamp with a millisecond precision to each recorded frame. The same framework can read, analyze and display the same way all gathered or computed data. An example is presented on figure 1 where most of the data are depicted. 3.1.2 Participants. An announcement for our experiment with an invitation to participate was communicated to chess clubs, on the local university campus and within the greater metropolitan area. We received a positive response from the president of one of the top metropolitan area chess clubs, and 21 members volunteered to participate in our pilot experiment. Unfortunately, of these initial 21 participants, 7 recordings were not usable due to poor eye-tracking results and have not been included in our analysis. Indeed, these participants, while reflecting about the game, held their hand above the eyetracker and disrupted its processing. The 14 remaining chess players in our study were 7 experts and 7 intermediates level players (20-45 years, 1 female, age: M = 31.71; SD = 7.57). Expert players were all active players and with Elo ratings3 ranged from 1759 to 2150 (M = 1950; SD = 130). For the intermediate players, the Elo ratings ranged from 1399 to 1513 (M = 1415; SD = 43) and 6 among them were casual players who were not currently playing in club. We can also give some statistics on the recorded session: the average recording time per participant is 14:58 minutes (MI N = 4:54, MAX = 23:40, SD = 5:26) and the average compressed size of gathered data is 56.12 GiB per session. 3.2 Methods 3.2.1 Chess Tasks. The goal of this experiment was to engage participants into a cognitive process while observing their physiological reactions. Thirteen chess tasks were elaborated by our team in coordination with the president of the chess club. Two kinds of task were selected: chess openings tasks, where only 3 to 5 moves were played from the original state; and N-Check-Mate tasks, where 1 to 6 moves were required to check-mate the opponent (and finish the game). Openings. Skilled players are familiar with most of the chess openings and play them intuitively. Intuitive play does not generally require cognitive engagement for reasoning. An important challenge is to detect when a player passes from intuitive reaction to a known opening, to challenging situations. Thus, two uncommon openings were selected to this end: a King’s Gambit (3 moves from the initial state) and a Custom Advanced Variation of the Caro-Kann Defense (6 moves from initial state). The goal here is to pull participants out from their comfort zone as much as possible to evoke emotions and physiological reactions. Openings correspond to task number 1 and 2. N-Check-Mate. Eleven end game tasks were defined. These are similar to the daily chess puzzles that can be found in magazines or on chess websites. Each of these tasks was designed to check-mate the opponent in a number of predefined moves ranging from 1 to 6. Tasks requesting 1 to 3 moves are viewed as easy task whereas 4 to 6 moves tasks require more chess reasoning abilities, etc. Distribution among the 11 tasks differs according to their number of required move and thus to their difficulty: 4 tasks with one move, 4 tasks with two and three moves (2 of each) and 3 tasks with four, five and six moves (1 of each). End games were presented to participants in this order of increasing difficulty while alternating the played color (white/black) between each task. 3.2.2 Procedure. Participants were tested individually in sessions lasting approximately 45 minutes. Each participant was asked to solve the 13 chess tasks and their behaviors were observed and recorded. To avoid biased behavior, no information was given about the recording equipment. Nevertheless, it was necessary to reveal the presence of the eye-tracker bar to participants in order perform a calibration step. After providing informed consent, the Lichess web platform was presented and participants could play a chess game against a weak opponent (Stockfish4 algorithm level 1: lowest level) to gain familiarity with the computer interface. No recording was made during this first game. Once familiar and comfortable with the platform, the eye-tracking calibration was performed using Tobii Studio software, in which subjects were instructed to sit between 60 and 80cm from the computer screen and to follow a 9-point calibration grid. Participants were requested to avoid large head movement in order to assure good eye-tracking quality. Aside from this distance, no other constraints were instructed to participants. Each task to solve was individually presented, starting with the openings, followed by the N-Check-Mate tasks. Participants were instructed to solve the task by either playing a few moves from the opening or to check mate the opponent (played by Stockfish algorithm level 8: the highest level) in the required number of moves. The number of moves needed for the N-Check-Mate tasks was communicated to the subject. A time frame was imposed for each task. The exact time frame was not announced to the participant, they only knew that they have a couple of minutes to solve the task. This time constraint ranges from 2 minutes for the openings and the easiest N-Check-Mate tasks (1-2 moves) to 5 minutes for the hardest ones (4-5-6 moves). An announcement was made when only one minute was remaining to solve the task. If the participant could not solve the task within the time frame, the task was considered as failed and the participant proceeded to the next task. The experiment is considered finished once all tasks were presented to the participant. 2 https://github.com/Vaufreyd/RGBDSyncSDK (last seen 09/2017) The Elo system is a method to calculate rating for players based on tournament performance. Ratings vary between 0 and approximately 2850. https://en.wikipedia. org/wiki/Elo rating system (last seen 09/2017) 3 4 Stockfish is an open-source game engine used in many chess software, including Lichess. https://en.wikipedia.org/wiki/Stockfish (chess) (last seen 09/2017). 3.3 Analysis 3.3.1 Eye-Gaze. Eye movement is highly correlated with focus of attention and engaged cognitive processes [19] in problem solving and humancomputer interaction [20]. Other studies [12, 16] show that expertise estimation for chess players can be performed using several eye-tracking metrics such as fixation duration or visit count. In this case, gaze information can be useful to determine information such as: the 1197 images from Radboud Face Database [25] and 89% of the Karolinska Dataset (4900 images) [22]. 3.3.3 Body Posture. Body posture is a rich communication channel for human to human interaction with important potential for human computer interaction [26]. Studies have shown that self-touching behavior is correlated with negative affect as well as frustration in problem solving [27]. Thus, we have investigated a number of indicators for stress from body posture: (1) What pieces received the most focus of attention from participants? (2) Do participants who succeed to complete a task share the same scan path? (3) Is there significant difference in gaze movements between novices and experts? • Body Agitation: how many joints are varying along x, y and z axis; • Body Volume: space occupied by the 3D bounding box built around joints (see [28]); • Self-Touching: collisions between wrist-elbow segments and the head (see [29]). To reach these aims, Areas Of Interests (AOIs) were manually defined for every task. An AOI can be a key piece for the current task (e.g. a piece used to check-mate the opponent), the opponent king, destinations cases where pieces have to be moved, etc. Afterward, we compute statistics for every AOI of each task. Among possible metrics, results depicted in this article are based on Fixation Duration, Fixation Count and Visit Count. Interpretation for these metrics differs according to the task domain. For example, in the domain of web usability, Ehmke et al [21] would interpret long fixation duration on AOI as a difficulty to extract or interpret information from an element. In the field of chess, Reingold and Charness [12, 16] found significant differences in fixation duration between experts and novices. These signals are computed from the RGBD streams recorded by the Kinect 2 where a list of body joints is extracted by means of our variant of a body pose detection algorithm [4]. These joints are computed on the RGB streams and projected back to Depth data. Thus, a 3D skeleton of the chess player is reconstructed and can be used as input to compute previous metrics. As one can see on figures 1 at left, from the point of view of the Kinect 2 in our setup (see figure 2), the skeleton information is limited to the upper part of the body, from hips to head. 3.3.2 Facial emotions. Micro-expressions, as defined by Ekman and Fiesen [8] in 1969, are quick facial expressions of emotions that could last up to half a second. These involuntary expressions can provide information about cognitive state of chess players. In our pilot study, the Noldus FaceReader software [22] has been used to classify players’ emotions in the form of six universal states proposed by Ekman: happiness, sadness, anger, fear, disgust and surprise (plus one neutral state). These emotional states are commonly defined as regions in a two-dimensional space whose axes are valence and arousal. Valence is commonly taken as an indication of pleasure, whereas arousal describes the degree to which the subject is calm or excited. In practice, the FaceReader software analyses video by first applying a face detector to identify a unique face followed by a detection of 20 Facial Action Units [8]. Each action unit is assigned a score between 0 and 1 and these are used to determine the state label for emotion. Valance and arousal can be then computed as: • Valence: intensity of positive emotions (Happy) minus intensity of negatives emotions (sadness, anger, fear and disgust); • Arousal: computed accordingly to activation intensities of the 20 Action Units. FaceReader was tested on two different datasets: the Radboud Faces Database [23] containing 59 different models and the Karolinska Directed Emotional Faces [24] which regroups 70 individuals. Both dataset display 7 different emotional expressions (plus neutral) on different angles. FaceReader algorithm correclty classified 90% of 4 RESULTS Synchronous data for every feature have been extracted from all sensors. Several tasks, like regression over Elo ratings or over the time needed to perform a task, could be addressed using these data. Among them, we chose to analyze a classification problem that can be interpreted by a human: • Is it possible, by the use of gaze, body and/or facial emotion features, to detect if a chess player is an expert or not? This problem is used as example to obtain a first validation of our data relevancy. It is correlated with whether a chess player is challenging beyond his abilities. This section presents unimodal and multimodal analysis of extracted features to determine chess expertise of players. 4.1 Unimodal analysis 4.1.1 Eye-Gaze. Two AOIs were defined for each task: one AOI is centered on the very first piece to move in the optimal sequence to successfully achieve the check-mate; and the second one on the destination square where this piece has to be moved. Fixations and visits information of every task are gathered for all participants and results are presented in Figure 3. As can be clearly seen in this figure, experts have longer and more fixations than intermediates on relevant pieces. Same result is observed for visit count. Similar results can be found in literature [12]. These results are explained by the expert’s skill encoding capacity that enables them to quickly focus their attention on relevant piece by a better pattern matching ability. 11.62 15 Intermediates 19.51 10 15 14.09 12.33 6.45 10.08 10 5 5 0 0 Fixation Time Fixation Count Visit Count Average count of main emotion change Experts experts intermediates 10 5 0 1 2 3 4 5 Figure 3: Eye-gaze histograms. Left: Percentage of fixation (in time). Right: number of fixations and number of visits. 4.1.2 Emotions. The increasing difficulty in the non-interrupting tasks has caused our participants to express more observable emotions across the experiment. Emotions in a long-task experiment are expressed as peaks in the two-dimensional space (valence, arousal). Thus, standard statistics tend to shrink toward zero as the record becomes longer. Other approaches should be considered to visualize emotion expressions. One possibility is to consider the number of changes of emotions having the highest intensity (i.e. the current detected facial emotion). As emotion intensities are based on facial unit detection, changes in the main emotion denote underlying changes in facial expression. The result metric is shown on the graph presented in figure 4. It clearly appears that expression of emotions increase with the difficulty of the problem to solve. For both player classes, there is a peak for the second task (i.e. our uncommon custom advanced variation of the Caro-Kann defense). This opening was surprising for all participants, more than the King’s Gambit one (task 1). No participant was familiar with this kind of opening. Moreover, intermediates players present an emotional peak at task number 9, which is the first task to require more than 2 moves to check-mate the opponent, whereas expert’s plot shape looks more like the beginning of an exponential curve. An interesting aspect of that plot is the final decrease of intermediate players after task 10, this could be interpreted as a sort of resignation, when players knew that tasks beyond of their skills and could not be resolved. These primary results suggest that situation understanding and expertise knowledge can be inferred from variation of facial emotions. Although, more detailed analysis, such as activation of Action Units, derivative of emotions or detection if a micro expression occurs right after a move being played should be performed. 10 11 12 13 Figure 4: Average count of variation of main detected facial emotion in regard to the task (1-13). Tasks are ranging in an increasing difficulty order. 2.5 experts intermediates 2 Average count of self-touching More work has to be done on eye-gaze such as analyzing and comparing the scan path order of participants, measuring how fast are participants to identify relevant pieces or analyzing fixation on empty squares. 6 7 8 9 Task Number 1.5 1 0.5 0 1 2 3 4 5 6 7 8 9 Task Number 10 11 12 13 Figure 5: Average count of self-touching in regard to the task (1-13). Tasks are ranging in an increasing difficulty order. 4.1.3 Body Posture. The increasing difficulty of the N-Check-Mate tasks is a stress factor that can be observable according to [27]. Using technique presented in [29] to detect self-touching, we can observe how participants’ body reacts to the increasing difficulty of tasks. The figure 5 presents statistics about self-touching. Shapes of lines are very similar of what is observed for emotions (Figure 4). The same conclusion can be drawn: the number of self-touches increases as tasks get harder and it reveals that this is a relevant feature to consider. However, analysis of volume and agitation features did not reveal interesting information yet. This can be explained either by the nature of the task or by the number of Task Dependent (N = 154) All Tasks (N = 14) G 62% 71% B 58% 79% E 78% 86% G+B 58% 71% G+E 79% 86% B+E 79% 93% G+B+E 78% 93% Table 1: Best accuracy scores from cross-validation for SVMs. First line is Task Dependent approach, the number of sample N is the number of participants (14) times the number of N-Check-Mate tasks (11). Second approach uses only average data of all task for every participant (N =14). Columns are the modality subset chosen to train the SVM (G: Gaze, B: Body, E: Emotions). analyzed participants. More discussion of this experiment can be found in section 5. 4.2 Multimodal versus unimodal classification To demonstrate the potential benefit of a multimodal approach, a supervised machine learning algorithm has been used to quantify accuracy of different modalities for classification. Only the data recorded for the 11 N-Check-Mate tasks are considered here. Support Vector Machines (SVM) have been built for each modality and for each possible combination of modalities. After computing statistical analysis (mean, variance, standard deviation) over our features, two approaches are compared: a task dependent approach on one hand and a skill-only dependent (All Task) on the other hand. First approach considers statistical results for every participant and for every task. That way, one input sample would be the instantiation of one participant for one particular task, given a total number of 14 ∗ 11 = 154 input samples. Second approach takes the average over all tasks for each participant. Input sample is reduced to participant with average statistics over tasks as features. Stratified cross-validation procedure has been used on every SVM and for both approaches to compute their accuracy. Results are shown in table 1. First observations of these results show that the task dependent approach presents a far less accuracy score than the second approach. This could be explained by the variation in the length of recordings. Indeed, some participants managed to give an answer in less than 10 seconds. The second hypothesis shows good performance and validates one of our expectation that multimodal system could outperform unimodal ones. Even if these scores are promising, further experiments with more involved participants have to be performed to confirm these primary results. 5 DISCUSSION This research and primary results (see section 4) show consistency results on unimodal features used to distinguish expert and intermediate chess players. When used together, body posture, visual attention and emotion provide better accuracy using a binary SVM classifier. Although these results appear promising, they are only preliminary: the number of participants (14); the variation of recording duration (from seconds to a couple of minutes depending on the task and playerfi expertise); and the tasks must all be expanded and developed. Due to the size of our dataset, generalizing this preliminary results is not possible for the moment. Further experiments must be conducted to validate them. The conditions of the chess tasks should also draw attention. In the experimental configuration, chess players were facing a chess algorithm engine in tasks where they knew the existence of a winning sequence of moves. Moreover, players are seating (see figure 1), some clues like body agitation may provide less information than expected. Participants may not be as engaged as they would have been in a real chess tournament facing a human opponent using an actual chess board. In these particular situations, involving stakes for players, the physiological reactions and emotional expressions are more interesting to observe. Nevertheless, these experiments reveal that valuable information can be observed from human attention and emotions to determine understanding, awareness and affective response to chess solving problems. Another underlying result is the validation of our setup in monitoring chess players. The problems encountered with the eye-tracker for 7 participants (see section 3.1.2) show that we must change its position to increase eye-tracking accuracy. 6 CONCLUSION This paper presents results from initial experiments with the capture and interpretation of multi-modal signals of 14 chess players engaged in solving 13 challenging chess tasks. Results show that eye-gaze, body posture and emotions are good features to consider. Support Vector Machine classifiers trained with cross-fold validation revealed that combining several modalities could give better performances (93% of accuracy) than using a unimodal approach (86%). These results encourage us to perform further experiments by increasing the number of participants and integrating more modalities (audio procedural speech, heart rate etc.). Our equipment is based on off-the-shelf commercially available components as well as open source programs and thus can be easily replicated. In addition to providing a tool for studies of participants engaged in problem solving, this equipment can provide a general tool that can be used to study the effectiveness of affective agents in engaging users and evoking emotions. ACKNOWLEDGMENTS This research has been be funded by the French ANR project CEEGE (ANR-15-CE23-0005), and was made possible by the use of equipment provided by ANR Equipement for Excellence Amiqual4Home (ANR-11-EQPX-0002). Access to the facility of the MSH-Alpes SCREEN platform for conducting the research is gratefully acknowledged. We are grateful to all of the volunteers who generously gave their time to participate in this study and to Lichess webmasters for their help and approval to use their platform for this scientific experience. We would like to thank Isabelle Billard, current chairman of the chess club of Grenoble ”L’Échiquier Grenoblois“ and all members who participated actively in our experiments. REFERENCES [1] R. El Kaliouby and P. Robinson, “Real-time inference of complex mental states from facial expressions and head gestures,” in Real-time vision for humancomputer interaction. Springer, 2005, pp. 181–200. [2] T. Baltrušaitis, D. McDuff, N. Banda, M. Mahmoud, R. El Kaliouby, P. Robinson, and R. Picard, “Real-time inference of mental states from facial expressions and upper body gestures,” in Automatic Face & Gesture Recognition and Workshops (FG 2011), 2011 IEEE International Conference on. IEEE, 2011, pp. 909–914. [3] T. Baltruaitis, P. Robinson, and L. P. Morency, “Openface: An open source facial behavior analysis toolkit,” in 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), March 2016, pp. 1–10. [4] Z. Cao, T. Simon, S.-E. Wei, and Y. Sheikh, “Realtime multi-person 2d pose estimation using part affinity fields,” in CVPR, 2017. [5] T. Simon, H. Joo, I. Matthews, and Y. Sheikh, “Hand keypoint detection in single images using multiview bootstrapping,” in CVPR, 2017. [6] S.-E. Wei, V. Ramakrishna, T. Kanade, and Y. Sheikh, “Convolutional pose machines,” in CVPR, 2016. [7] D. Kahneman, Thinking, fast and slow. Macmillan, 2011. [8] P. Ekman and W. V. Friesen, “Nonverbal leakage and clues to deception,” Psychiatry, vol. 32, no. 1, pp. 88–106, 1969. [9] M.-Z. Poh, D. J. McDuff, and R. W. Picard, “Advancements in noncontact, multiparameter physiological measurements using a webcam,” IEEE transactions on biomedical engineering, vol. 58, no. 1, pp. 7–11, 2011. [10] J. Shotton, T. Sharp, A. Kipman, A. Fitzgibbon, M. Finocchio, A. Blake, M. Cook, and R. Moore, “Real-time human pose recognition in parts from single depth images,” Communications of the ACM, vol. 56, no. 1, pp. 116–124, 2013. [11] R. Stiefelhagen, J. Yang, and A. Waibel, “A model-based gaze tracking system,” International Journal on Artificial Intelligence Tools, vol. 6, no. 02, pp. 193–209, 1997. [12] N. Charness, E. M. Reingold, M. Pomplun, and D. M. Stampe, “The perceptual aspect of skilled performance in chess: Evidence from eye movements,” Memory & cognition, vol. 29, no. 8, pp. 1146–1152, 2001. [13] L. Paletta, A. Dini, C. Murko, S. Yahyanejad, M. Schwarz, G. Lodron, S. Ladstätter, G. Paar, and R. Velik, “Towards real-time probabilistic evaluation of situation awareness from human gaze in human-robot interaction,” in Proceedings of the Companion of the 2017 ACM/IEEE International Conference on Human-Robot Interaction, ser. HRI ’17. New York, NY, USA: ACM, 2017, pp. 247–248. [Online]. Available: http://doi.acm.org/10.1145/3029798.3038322 [14] T. Giraud, M. Soury, J. Hua, A. Delaborde, M. Tahon, D. A. G. Jauregui, V. Eyharabide, E. Filaire, C. Le Scanff, L. Devillers et al., “Multimodal expressions of stress during a public speaking task: Collection, annotation and global analyses,” in Affective Computing and Intelligent Interaction (ACII), 2013 Humaine Association Conference on. IEEE, 2013, pp. 417–422. [15] M. K. Abadi, J. Staiano, A. Cappelletti, M. Zancanaro, and N. Sebe, “Multimodal engagement classification for affective cinema,” in Affective Computing and [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] Intelligent Interaction (ACII), 2013 Humaine Association Conference on. IEEE, 2013, pp. 411–416. E. M. Reingold and N. Charness, “Perception in chess: Evidence from eye movements,” Cognitive processes in eye guidance, pp. 325–354, 2005. M. Portaz, M. Garcia, A. Barbulescu, A. Begault, L. Boissieux, M.-P. Cani, R. Ronfard, and D. Vaufreydaz, “Figurines, a multimodal framework for tangible storytelling,” in WOCCI 2017 - 6th Workshop on Child Computer Interaction at ICMI 2017 - 19th ACM International Conference on Multi-modal Interaction, Glasgow, United Kingdom, Nov. 2017, author version. [Online]. Available: https://hal.inria.fr/hal-01595775 D. Vaufreydaz and A. Nègre, “MobileRGBD, An Open Benchmark Corpus for mobile RGB-D Related Algorithms,” in 13th International Conference on Control, Automation, Robotics and Vision, Singapour, Singapore, Dec. 2014. [Online]. Available: https://hal.inria.fr/hal-01095667 K. Holmqvist, M. Nyström, R. Andersson, R. Dewhurst, H. Jarodzka, and J. Van de Weijer, Eye tracking: A comprehensive guide to methods and measures. OUP Oxford, 2011. A. Poole and L. J. Ball, “Eye tracking in hci and usability research,” Encyclopedia of human computer interaction, vol. 1, pp. 211–219, 2006. C. Ehmke and S. Wilson, “Identifying web usability problems from eye-tracking data,” in Proceedings of the 21st British HCI Group Annual Conference on People and Computers: HCI… but not as we know it-Volume 1. British Computer Society, 2007, pp. 119–128. M. Den Uyl and H. Van Kuilenburg, “The facereader: Online facial expression recognition,” in Proceedings of measuring behavior, vol. 30, 2005, pp. 589–590. O. Langner, R. Dotsch, G. Bijlstra, D. H. Wigboldus, S. T. Hawk, and A. Van Knippenberg, “Presentation and validation of the radboud faces database,” Cognition and emotion, vol. 24, no. 8, pp. 1377–1388, 2010. E. Goeleven, R. De Raedt, L. Leyman, and B. Verschuere, “The karolinska directed emotional faces: a validation study,” Cognition and emotion, vol. 22, no. 6, pp. 1094–1118, 2008. G. Bijlstra and R. Dotsch, “Facereader 4 emotion classification performance on images from the radboud faces database,” 2015. S. M. Anzalone, S. Boucenna, S. Ivaldi, and M. Chetouani, “Evaluating the engagement with social robots,” International Journal of Social Robotics, vol. 7, no. 4, pp. 465–478, 2015. J. A. Harrigan, “Self-touching as an indicator of underlying affect and language processes,” Social Science & Medicine, vol. 20, no. 11, pp. 1161–1168, 1985. W. Johal, D. Pellier, C. Adam, H. Fiorino, and S. Pesty, “A cognitive and affective architecture for social human-robot interaction,” in Proceedings of the Tenth Annual ACM/IEEE International Conference on Human-Robot Interaction Extended Abstracts. ACM, 2015, pp. 71–72. J. Aigrain, M. Spodenkiewicz, S. Dubuisson, M. Detyniecki, D. Cohen, and M. Chetouani, “Multimodal stress detection from multiple assessments,” IEEE Transactions on Affective Computing, 2016.
1cs.CV
An adaptive thresholding approach for automatic optic disk segmentation F. Ghadiri1 , R. Bergevin1 and M. Shafiee 2 1 Department of Electrical Engineering, Laval University, Quebec, Canada Research Center,Khatam-al-Anbia Hospital, Mashhad University of Medical Sciences {farnoosh.ghadiri.1, robert.bergevin}@ulaval.ca, [email protected] arXiv:1710.05104v1 [cs.CV] 14 Oct 2017 2 Ophthalmic Keywords: Optic disk segmentation, Adaptive threshold, Vessel segmentation. Abstract: Optic disk segmentation is a prerequisite step in automatic retinal screening systems. In this paper, we propose an algorithm for optic disk segmentation based on a local adaptive thresholding method. Location of the optic disk is validated by intensity and average vessel width of retinal images. Then an adaptive thresholding is applied on the temporal and nasal part of the optic disc separately. Adaptive thresholding, makes our algorithm robust to illumination variations and various image acquisition conditions. Moreover, experimental results on the DRIVE and KHATAM databases show promising results compared to the recent literature. In the DRIVE database, the optic disk in all images is correctly located and the mean overlap reached to 43.21%. The optic disk is correctly detected in 98% of the images with the mean overlap of 36.32% in the KHATAM database. 1 INTRODUCTION Optic disk segmentation is one of the major steps in an automated retinal image analysis system. It is used as a prerequisite stage in the blood vessel tracking approaches to localize seed points and also optic disk segmentation improve the lesion diagnosis performance by qualifying lesion like exudate lesions. Moreover, optic disk segmentation helps ophthalmologists collect the information from optic disk such as color, size and shape in order to detect anomalies. There are some characteristics which can be used to extract the optic disk. Sometimes, the optic disk area is brighter than its surrounding and it can be seen as a disk and in other images it appears as a hollow ring. Moreover, the optic disk part located on the temporal side is often more visible and brighter than the nasal part. Despite these features, optic disk segmentation is not an easy task because in some images the optic disk boundary is not well defined and it is obscured by the crossing blood vessels. In addition, the optic disk diameter can vary from 70 to 200 pixel in the DRIVE database. Therefore, proposing an algorithm which addresses these problems is essential. In this paper, we present an algorithm for optic disk segmentation based on a thresholding approach. Initial candidates of the optic disk are chosen based on the average size of the retinal image. Then, the optic disk location is verified by choosing the region with high average vessel width. Finally, the optic disk is segmented by applying different thresholds on different sides of it. This paper is organized as follows: In the first section, we review some state of art optic disk segmentation algorithms and give an overview of problems in this area. Section 2 introduces our algorithm in three parts: optic disk localization, vessel width computation, and optic disk segmentation. Section 3 presents our experimental results. Finally, further results are discussed in the conclusion section. 2 RELATED WORK There have been several approaches for optic disk segmentation. The major efforts in this domain can be divided in two techniques; template-based methods (methods for obtaining optic disk boundary approximations) (Aquino et al., 2010) and methods based on deformable models of snakes for extracting the optic disk boundary as exactly as possible. (Esmaeili et al., 2009) proposed an algorithm based on curvelet transform and deformable vibrational level set model. In this algorithm probable optic disk areas are obtained by applying curvelet transform and selecting the brightest area on the enhanced images. Then the region with the high value coefficients in the modified reconstructed image is choosen as the optic disk location. Finally, blood vessels are removed by morphological operation and the optic disk boundary extracted using level set deformable model. This algorithm has two problems: first, applying curvelet transform and morphological operation to the entire image is time consuming. Also, using Starck et al. (Starck et al., 2003) algorithm to modify the curvelet coefficient following by the constant threshold fails to detect reliable blood vessels, because of vessel-like patterns such as hemorrages and micro aneurysms. Therefore, making decision based on these results affect the final result. (Osareh et al., 2002) proposed a method based on template matching. They used template matching to estimate the position of the optic disk. This position is also used to initialize points for the active contour. Then, they used morphological operation to remove vessels and improve the boundary around the optic disk. Finally, the optic disk boundary is extracted by applying Snake to the derived region. (Malek et al., 2012) used an iterative thresholding algorithm to approximate the center of the optic disk. Then they applied the PCA (Principal Component Analysis) to the candidate regions obtained from the previous stage to find the final location of the optic disk. Finally, like (Osareh et al., 2002) a morphological method is used to eliminate blood vessels followed by applying an active contour to extract optic disk boundary. Active contour methods work on a gradient of the image and lock onto homogenous region enclosed by strong gradient information. Since the gradient along the optic disk boundary is not homogeneous, active contour methods should be modified or combined with other methods. (Osareh et al., 2002) and (Malek et al., 2012) used morphological operation to address this problem. However, using morphological operations can also blur and change the location of the optic disk boundary. Therefore, the result of optic disk boundary segmentation is not reliable. (Xu et al., 2007) introduced a modified active contour model based on estimating the optic disk boundary. All pixels are listed in descending order of graylevel; the top 13% pixels are selected as the candidate region of the optic disk. Then, the final optic disk center and its boundary are estimated by distance transform based on edge map. Finally the Snake technique is applied based on the information obtained from the previous stage. The first estimation of the optic disk center tends to fall in the optic disk temporal part and this area is surrounded by blood vessel. Therefore, the obtained radius usually is an approximate radius of the optic disk temporal part. (Hsiao et al., 2012) localized the optic disk center by illumination correction algorithm. Then, the radius of the optic disk is estimated by Canny edge detection followed by Hough transform. Finally, supervised gradient vector flow snake (SGVF snake) is used to extract the optic disk boundary. Although the SGVF snake can be more powerful to reduce the influence of blood vessel occlusion, finding the imprecise estimation of optic disk boundary in the first stage is the problem that still remains in this method. The reason is that the divergence pattern of retinal blood vessels starting from optic disk can be modeled as a semi-circular shape (Hoover and Goldbaum, 2003). Therefore, the circle drawn by circular Hough transform tends to fit with these vessels. (Cheng et al., 2013) propose an algorithm based on superpixel classification. They first divide each image into superpixels. Then each pixel is classified as a disk or non-disk by computing center surround statistic from superpixels and unifying them with histograms. In this paper we propose a new algorithm for optic disk segmentation based on adaptive thresholding. We use grey level information of the nasal and temporal parts of the optic disk to address the optic disk nonhomogeneity problem. Moreover, we improve the accuracy of optic disk localization by adding the vessel width information as well as the overall intensity of the region. Applying a fast vessel segmentation algorithm on the small part of the optic disk followed by thresholding approach reduces the time complexity of our algorithm considerably. 3 Proposed Method The main idea of our algorithm is based on the fact that the optic disk part located on the temporal side is more visible and brighter than the nasal part. Therefore, we consider the optic disk region as composed of two homogenous parts. The first step in our algorithm is to localize the optic disk using the intensity information and vessel width average. Then, the optic disk is divided in two regions based on the directional information of major vessels which are originating from the optic disk. Finally, the optic disk is segmented by applying an adaptive threshold on its different sides. 3.1 Optic Disk Localization In the retinal images, the average optic disk area varies from 13% to 20% of the whole image. We choose 13% of the highest intensity pixels as the first estimation of the optic disk area. To reduce the number of candidate regions, we apply circular criterion (a) (b) in the window around the optic disk area is larger than in other parts of the retinal image. Therefore, we use this feature to validate the optic disk location among the obtained candidates. To analyse blood vessel width in the candidate regions, we use (Ghadiri et al., 2011) vessel segmentation algorithm. In this algorithm, each region is divided into overlapping windows both horizontally and vertically. Then the direction of the linear structure in each window is computed by Radon transform. Afterwards the Sobel operator is applied along the obtained direction. The gradient information obtained from Sobel operator combined with the Fuzzy inference engine is used to decide whether the obtained gradient is related to the blood vessel edge or not. When of vessel edges are validated, blood vessel width is computed using the average distance between pairs of edges. Finally, validated vessels are reconstructed using morphological operations. 3.3 Optic disk Segmentation To segment the optic disk we need to find the window that covers the whole optic disk area (circumscribed rectangle). To accomplish this task, we propose an algorithm composed of the four following steps. (c) Figure 1: (a) A retinal image form KHATAM database. (b) Initial candidates of optic disk after one iteration. (c) Initial candidates of optic disk after three iterations and the final optic disk location (red dot). to the obtained connected components from the previous stage to remove bright linear structure. This also reduces the time complexity. In the next step, the average blood vessel width is computed in the window at the center of each connected component, as further describe in section 3.2. Then, the window with the highest average blood vessel width is selected as optic disk location. This value should be more than a fixed threshold, because in some cases, the optic disk area is not the brightest area of the retinal image. If no connected component has an average vessel width more than the defined threshold, we increase the threshold value of the first step and repeat the previous stages until circularity and average blood vessel width criterion are satisfied. Fig.1 shows how the optic disk area appears after increasing the threshold value. 3.2 Vessel width computation The optic disk is considered as a bright area where blood vessels converge. Average blood vessel width • Finding the optic disk center. • Detecting points on the optic disc boundary to estimate the circumscribed window around the optic disk. • Dividing the optic disk in two regions based on the its vessels structure. • Applying two different thresholds on these regions. In the first step, we need to define a window with the center of the optic disk. To accomplish this task, the center of the obtained region from the optic disk localization step is modified. The obtained region from the optic disk localization step is located at the temporal part of the optic disk. The reason is that this part is brighter than the other parts of the optic disk (superior, inferior and nasal parts. Fig 2), so the center of this area can approximate the center of optic disk height. But, this point can be the center of optic disk width if only the brightest part of the temporal side is close to the optic disk vessels. Therefore, by the information obtained from the vessel segmentation step, we adjust this point so that it gets close to the vessel. This point is used as the first estimation of optic disk center. In the second step, we assume a line which passes through the center of the optic disk. We apply Sobel operator in the perpendicular direction of this line. Center of the Sobel mask is chosen from the points close to the lines end-points. From each side of the optic disk center the points whose gradient values are above a fixed threshold are selected. Among these point those which are labeled as vessel from the vessel segmentation step are removd. Finally, there should remain one point on each side of the center point with gradient signs opposite to each other. If the optic disk area is inscribed in the pre-defined window, we will have two points of optic disk boundary on each side of optic disk center. If the points are not found, the size of the window is slightly increased and the previous steps are repeated. Then, we repeat the first step to find the new points. When the points are found, the center of the optic disk is re-calculated based on the middle of these points. New center point is considered as the center of the circumscribing rectangle of the optic disk. The width of the rectangle is equal to the distance between the two points and its height is computed based on min to max disk diameter ratio in normal eyes (Jonas et al., 1999). In the third step, we divide optic disk area in two regions based on the major vertical vessels in the circumscribing rectangle. Our goal is to divide optic disk region into temporal and nasal parts. We use information obtained from the vessel width computing step described in 3.2 to detect major vertical vessels. In the last step Then we divide the optic disk in two regions and apply an Otsus thresholding method threshold on each region. Figure 2: Annotations describe the four different zones of the optic disk (Lu et al., 2012). 4 Experimental Results Our algorithm is basically defined by three main steps: optic disk localization, blood vessel segmentation and optic disk segmentation. In the first step, optic disk candidates are detected by a thresholding algorithm. Average vessel width is computed in a window size of 70*70 at the center of each candidate location. The window size is chosen based on the normal size of the optic disk. The candidate with the highest average vessel width is an input for the optic disk segmentation step. In the final step, optic disk is divided in two regions and Otsus thresholding method is applied on each region. We applied our algorithm on 40 images of DRIVE dataset1 and 50 images of Khatam database2 . In both datasets the optic disk boundary is hand labeled by an ophthalmologist as ground truth. Fig. 3 and Fig. 4 show our results on the DRIVE and Khatam databases respectively. The results show that our algorithm is robust to changing illumination and also to abnormal retinal images. The result on the second image of Khatam dataset (Fig. 3) shows that our algorithm can distinguish between parapapillary atrophy boundary and optic disk boundary. For the quantitative evaluation of our approach, we use sensitivity, specificity and overlap as follows: TP , (T P + FN) TN , speci f icity = (T N + FP) area(A ∩ B) overlap = . area(B ∪ B) sensitivity = (1) TP, FN, TN and FP indicate true positive, false negative, true negative and false positive pixels respectively. Moreover, A and B are the ground truth region and optic disk region extracted from our algorithm, respectively. Table 1 shows the results of these qualitative evaluation on the DRIVE database and Khatam database. We compare our algorithm to our implementation of (Malek et al., 2012) and(Xu et al., 2007), we only consider those set of images in both datasets which their optic disk is detected in these three approaches. Table 2 shows the success rate of our algorithm in optic disk localization campare to the (Malek et al., 2012) and(Xu et al., 2007). The results show that our method outperform the result presented in (Malek et al., 2012) and (Xu et al., 2007). 5 Conclusion In this paper, we propose an algorithm for optic disk segmentation based on the intensity information of the optic disk and major vessels information. Experimental results show that our algorithm is superior to 1 http://www.isi.uu.nl/Research/Databases/DRIVE/ 2 Images of this database are gathered by Khatam-AlAnbia eye hospital, Mashhad, Iran Table 1: Comparative average sensitivity, specificity, overlap, and computation time on DRIVE and KHATAM dataset. Methods Average Average Average Average time sensitivity (%) specificity (%) overlap (%) per image (s) DRIVE database (Malek et al., 2012) 69.99 (Xu et al., 2007) 73.68 Our proposed method 80.46 98.88 99.20 99.72 33.66 37.42 43.21 22.78 16.04 8.38 Khatam database (Malek et al., 2012) 73.45 (Xu et al., 2007) 77.12 Our proposed method 82.46 99.86 99.80 99.81 29.45 30.18 36.32 23.65 20.34 16.58 Table 2: Success rates of our algorithm versus (Malek et al., 2012) and (Xu et al., 2007) on optic disk localization. Database (Malek et al., 2012) (Xu et al., 2007) Our proposed method DRIVE Khatam 100 94 Figure 3: Optic disk segmentation results on three images of the Khatam database. Left column: Optic disk boundary detected by the proposed algorithm; parapapillary atrophy region is also shown in the second image of the left column with white dots. Right column: Optic disk boundary hand labeled by an ophtalmologist. state of the art optic disk segmentation algorithms in terms of computation time and accuracy. Using an iterative thresholding algorithm to find the initial candidates of the optic disk and adaptive thresholding for optic disk segmentation make our algorithm more robust to changing illumination. Moreover, vessel width information is used to reduce false positive detection of optic disk. Furthermore, compu- 100 92 100 98 Figure 4: Optic disk boundary detection results on the three images of the DRIVE database. Left column: Optic disk boundary detected by the proposed algorithm. Right column: Optic disk boundary hand labeled by an ophtalmologist. tation time is reduced by using a simple thresholding algorithm and applying costly parts of the algorithm on a small area rather than the whole image. REFERENCES Aquino, A., Gegundez-Arias, M., and Marin, D. (2010). Detecting the optic disc boundary in digital fundus images using morphological, edge detection, and feature extraction techniques. Medical Imaging, IEEE Transactions on, 29(11):1860–1869. Cheng, J., Liu, J., Xu, Y., Yin, F., Wong, D., Tan, N.-M., Tao, D., Cheng, C.-Y., Aung, T., and Wong, T. Y. (2013). Superpixel classification based optic disc and optic cup segmentation for glaucoma screening. Medical Imaging, IEEE Transactions on, 32(6):1019– 1032. Esmaeili, M., Rabbani, H., Dehnavi, A., and Dehghani, A. (2009). Automatic optic disk detection by the use of curvelet transform. pages 1–4. Ghadiri, F., Akbarzadeh-T, M., and Haddadan, S. (2011). Vessel segmentation based on sobel operator and fuzzy reasoning. In Computer and Knowledge Engineering (ICCKE), 2011 1st International eConference on, pages 189–194. Hoover, A. and Goldbaum, M. (2003). Locating the optic nerve in a retinal image using the fuzzy convergence of the blood vessels. Medical Imaging, IEEE Transactions on, 22(8):951–958. Hsiao, H.-K., Liu, C.-C., Yu, C.-Y., Kuo, S.-W., and Yu, S.-S. (2012). A novel optic disc detection scheme on retinal images. Expert Systems with Applications, 39(12):10600 – 10606. Jonas, J. B., Budde, W. M., and Panda-Jonas, S. (1999). Ophthalmoscopic evaluation of the optic nerve head. Survey of Ophthalmology, 43(4):293 – 320. Lu, C., Tang, TB. Laude, A. D. B., and Murray, A. (2012). Parapapillary atrophy and optic disc region assessment (pandora): retinal imaging tool for assessment of the optic disc and parapapillary atrophy. Journal of biomedical optics. Malek, J., Ben Abdallah, M., Mansour, A., and Tourki, R. (2012). Automated optic disc detection in retinal images by applying region-based active aontour model in a variational level set formulation. In Computer Vision in Remote Sensing (CVRS), 2012 International Conference on, pages 39–44. Osareh, A., Mirmehdi, M., Thomas, B., and Markham, R. (2002). Comparison of colour spaces for optic disc localisation in retinal images. In Pattern Recognition, 2002. Proceedings. 16th International Conference on, volume 1, pages 743–746 vol.1. Starck, J.-L., Murtagh, F., Candes, E., and Donoho, D. (2003). Gray and color image contrast enhancement by the curvelet transform. Image Processing, IEEE Transactions on, 12(6):706–717. Xu, J., Chutatape, O., and Chew, P. (2007). Automated optic disk boundary detection by modified active contour model. Biomedical Engineering, IEEE Transactions on, 54(3):473–482.
1cs.CV
Deriving Escape Analysis by Abstract Interpretation: Proofs of results Patricia M. Hill ([email protected]) University of Leeds, United Kingdom arXiv:cs/0607101v2 [cs.PL] 28 Jul 2006 Fausto Spoto ([email protected]) Università di Verona, Italy Abstract. Escape analysis of object-oriented languages approximates the set of objects which do not escape from a given context. If we take a method as context, the non-escaping objects can be allocated on its activation stack; if we take a thread, Java synchronisation locks on such objects are not needed. In this paper, we formalise a basic escape domain E as an abstract interpretation of concrete states, which we then refine into an abstract domain E R which is more concrete than E and, hence, leads to a more precise escape analysis than E . We provide optimality results for both E and E R, in the form of Galois insertions from the concrete to the abstract domains and of optimal abstract operations. The Galois insertion property is obtained by restricting the abstract domains to those elements which do not contain garbage, by using an abstract garbage collector. Our implementation of E R is hence an implementation of a formally correct escape analyser, able to detect the stack allocatable creation points of Java (bytecode) applications. This report contains the proofs of results of a paper with the same title and authors and to be published in the Journal Higher-Order Symbolic Computation. Keywords: Abstract Interpretation, Denotational Semantics, Garbage Collection 1. Introduction Escape analysis identifies, at compile-time, some run-time data structures which do not escape from a given context, in the sense that they are not reachable anymore from that context. It has been studied for functional [24, 13, 4] as well as for object-oriented languages [27, 1, 6, 36, 14, 26, 32, 25, 28, 34, 5, 8, 35]. It allows one to stack allocate dynamically created data structures which would normally be heap allocated. This is possible if these data structures do not escape from the method which created them. Stack allocation reduces garbage collection overhead at run-time w.r.t. heap allocation, since stack allocated data structures are automatically deallocated when methods terminate. If, moreover, such data structures do not occur in a loop and their size is statically determined, they can be preallocated on the activation stack, which further improves the efficiency of the code. In the case of Java, which uses a mutual exclusion lock for each object in order to synchronise accesses from different threads of execution, escape analysis allows c 2017 Kluwer Academic Publishers. Printed in the Netherlands. main.tex; 27/12/2017; 15:18; p.1 2 one also to remove unnecessary synchronisations, thereby making runtime accesses faster. By removing the space for the mutual exclusion lock associated with some of the objects, escape analysis can also help with space constraints. To this purpose, the analysis must prove that an object is accessed by at most one thread. This is possible if the object does not escape its creating thread. 1.1. Contributions of Our Work This paper presents two escape analyses for Java programs. The goal of both analyses is to detect objects that do not escape (i.e., are unreachable from outside) a certain scope. This information can later be used to stack-allocate captured (i.e., non-escaping) objects. Both analyses use the object allocation site model: all objects allocated at a given program point (possibly in a loop) are modelled by the same creation point. The first analysis, based on the abstract domain E, expresses the information we need for our stack allocation. Namely, for each program point, it provides an over-approximation of the set of creation points that escape because they are transitively reachable from a set of escapability roots (i.e., variables including parameters, static fields, method result). The domain E does not keep track of other information such as the creation points pointed to by each individual variable or field. Although E is the property neede for stack allocation, a static analysis based on E is not sufficiently precise as it does not relate the creation points with the variables and fields that point to them. We therefore consider a refinement ER of E that preserves this information and also includes E so that ER contains just the minimum information needed for stack allocation. Both analyses are developed in the abstract interpretation framework [10, 11], and we present proofs that the associated transfer functions are optimal with respect to the abstractions that are used by each analysis i.e., they make the best possible use of the abstract information expressed by the abstract domains. To increase the precision of the two analyses and to get a Galois insertion, rather than a Galois connection, both analyses use local variable scoping and type information. Hence, the abstract domains contain no spurious element. We achieve this goal through abstract garbage collectors which remove some elements from the abstract domains whenever they reflect unreachable (and hence, for our analysis, irrelevant) portions of the run-time heap, as also [8] does, although [8] does not relate this to the Galois insertion property. Namely, the abstract domains main.tex; 27/12/2017; 15:18; p.2 3 are exactly the set of fixpoints of their respective abstract garbage collectors and, hence, do not contain spurious elements. The contribution of this paper is a clean construction of an escape analysis through abstract interpretation thus obtaining formal and detailed proofs of correctness as well as optimality. Optimality states that the abstract domains are related to the concrete domain by a Galois insertion, rather than just a connection and in the use of optimal abstract operations. Precision and efficiency of the analysis are not the main issues here, although we are pleased to see that our implementation scales to relatively large applications and compares well with some already existing and more precise escape analyses (Section 6). 1.2. The Basic Domain E Our work starts by defining a basic abstract domain E for escape analysis. Its definition is guided by the observation that a creation point π occurring in a method m can be stack allocated if the objects it creates are not reachable at the end of m from a set of variables E which includes m’s return value, the fields of the objects bound to its formal parameters at call-time (including the implicit this parameter) and any exceptions thrown by m. Note that we consider the fields of the objects bound to the formal parameters at call-time since they are aliases of the actual arguments, and hence still reachable when the method returns. For a language, such as Java, which allows static fields, E also includes the static fields. Variables with integer type are not included in E since no object can be reached from an integer. Moreover, local variables are also not included in E since local variables accessible inside a method m will disappear once m terminates. The basic abstract domain E is hence defined as the collection of all sets of creation points. Each method is decorated with an element of E, which contains precisely the creation points of the objects reachable from the variables in E at the end of the method. Example 1 See journal version of this paper. We still have to specify how this decoration is computed for each method. We use abstract interpretation to propagate an input set of creation points through the statements of each method, until its end is reached. This is accomplished by defining a transfer function for every statement of the program which, in terms of abstract interpretation, is called an abstract operation (see Section 4 and Figure 9). The element of E resulting at the end of each method is then restricted to the appropriate set E for that method through an abstract operation called restrict. By applying the theory of abstract interpretation, we main.tex; 27/12/2017; 15:18; p.3 4 know that this restriction is a conservative approximation of the actual decoration we need at the end of each method. Example 2 See journal version of this paper. The problem here is that although the abstract domain E expresses the kind of decoration we need for stack allocation, E has very poor computational properties. In terms of abstract interpretation, it induces very imprecise abstract operations and, just as in the case of the basic domain G for groundness analysis of logic programs [20], it needs refining [15, 29]. We formalise the fact that the approximation in E can shrink, by means of an abstract garbage collector (Definition 25) i.e., a garbage collector that works over sets of creation points instead of concrete objects. When a variable’s scope is closed, the abstract garbage collector removes from the approximation of the next statement all creation points which can only be reached from that variable. The name of abstract garbage collector is justified by the fact that this conservatively maintains in the approximation the creation points of the objects which might be reachable in the concrete state, thus modeling in the abstract domain a behaviour similar to that of a concrete garbage collector. It must be noted, however, that our abstract garbage collector only considers reachability from the variables in scope in the current method, while a concrete garbage collector would consider reachability from all variables in the current activation stack. 1.3. The Refinement ER The abstract domain E represents the information we need for stack allocation, but it does not include any other related information that may improve the precision of the abstract operations, such as explicit information about the creation points of the objects bound to a given variable or field. However, the ability to reason on a per variable basis is essential for the precision of a static analysis of imperative languages, where assignment to a given variable or field is the basic computational mechanism. So we refine E into a new abstract domain ER which splits the sets of creation points in E into subsets, one for each variable or field. We show that ER strictly contains E, justifying the name of refinement. We perform a static analysis based on ER exactly as for E but using the abstract operations for the domain ER given in Section 5 (see Figure 10). Example 3 See journal version of this paper. main.tex; 27/12/2017; 15:18; p.4 5 The domain ER can hence be seen as the specification of a new escape analysis, which includes E as its foundational kernel. Example 3 shows that the abstract domain ER is actually more precise than E. Our implementation of ER (Section 6) shows that it can actually be used to obtain non-trivial escape analysis information for Java bytecode. 1.4. Structure of the Paper After a brief summary of our notation and terminology in Section 2, we pass in Section 3 to recall the framework of [31] on which the analysis is based. Then, in Section 4, we formalise our basic domain E and provide suitable abstract operations for its analysis. We show that the analysis induced by E is very imprecise. Hence, in Section 5 we refine the domain E into the more precise domain ER for escape analysis. In Section 6, we discuss our prototype implementation and experimental results. Section 7 discusses related work. Section 8 concludes the main part of the paper. Preliminary, partial versions of this paper appeared in [17] and [18]. The current paper is a seamless fusion of these papers, with the proofs of the theoretical results and with a description and evaluation of the implementation of the escape analysis over the domain ER. 2. Preliminaries A total (partial) function f is denoted by 7→ (→). The domain (range) of f is dom(f ) (rng(f )). We denote by [v1 7→ t1 , . . . , vn 7→ tn ] the function f where dom(f ) = {v1 , . . . , vn } and f (vi ) = ti for i = 1, . . . , n. Its update is f [w1 7→ d1 , . . . , wm 7→ dm ], where the domain may be enlarged. By f |s (f |−s ) we denote the restriction of f to s ⊆ dom(f ) (to dom(f ) \ s). If f and g are functions, we denote by f g the composition of f and g, such that f g(x) = f (g(x)). If f (x) = x then x is a fixpoint of f . The set of fixpoints of f is denoted by fp(f ). A pair of elements is written a ⋆ b. A definition of a pair S such as S = a ⋆ b, with a and b meta-variables, silently defines the pair selectors s.a and s.b for s ∈ S. The cardinality of a set S is denoted by #S. The disjoint union of two sets S, T is denoted by S + T . To simplify expressions, particulary when the set is used as a subscript, we sometimes write a singleton set {x} as x. If S is a set and ≤ is a partial relation over S, we say that S is a partial ordering if it is reflexive (s ≤ s for every s ∈ S), transitive (s1 ≤ s2 and s2 ≤ s3 entail s1 ≤ s2 for every s1 , s2 , s3 ∈ S) and anti-symmetric (s1 ≤ s2 and s2 ≤ s1 entail s1 = s2 for every s1 , s2 ∈ S). If S is a set and ≤ a partial ordering on S, then the pair S ⋆ ≤ is a poset. main.tex; 27/12/2017; 15:18; p.5 6 A complete lattice is a poset C ⋆ ≤ where least upper bounds (lub) and greatest lower bounds (glb) always exist. Let C ⋆ ≤ and A ⋆  be posets and f : C 7→ A. We say that f is monotonic if c1 ≤ c2 entails f (c1 )  f (c2 ). It is (co-)additive if it preserves lub’s (glb’s). Let f : A 7→ A. The map f is reductive (respectively, extensive) if f (a)  a (respectively, a  f (a)) for any a ∈ A. It is idempotent if f (f (a)) = f (a) for any a ∈ A. It is a lower closure operator (lco) if it is monotonic, reductive and idempotent. We recall now the basics of abstract interpretation [10, 11]. Let C ⋆ ≤ and A ⋆  be two posets (the concrete and the abstract domain). A Galois connection is a pair of monotonic maps α : C 7→ A and γ : A 7→ C such that γα is extensive and αγ is reductive. It is a Galois insertion when αγ is the identity map i.e., when the abstract domain does not contain useless elements. If C and A are complete lattices and α is strict and additive, then α is the abstraction map of a Galois connection. If, moreover, α is onto or γ is one-to-one, then α is the abstraction map of a Galois insertion. In a Galois connection, γ can be defined in terms of α as γ(a) = ∪{c | α(c)  a}, where ∪ is the least upper bound operation over the concrete domain C. Hence, it is enough to provide α to define a Galois connection. An abstract operator fˆ : An 7→ A is correct w.r.t. f : C n → C if αf γ  fˆ. For each operator f , there exists an optimal (most precise) correct abstract operator fˆ defined as fˆ = αf γ. This means that fˆ does the best it can with the information expressed by the abstract domain. The composition of correct operators is correct. The composition of optimal operators is not necessarily optimal. The semantics of a program is the fixpoint of a map f : C 7→ C , where C is the computational domain. Its collecting version [10, 11] works over properties of C i.e., over ℘(C ) and is the fixpoint of the powerset extension of f . If f is defined through suboperations, their powerset extensions and ∪ (which merges the semantics of the branches of a conditional) induce the extension of f . 3. The Framework of Analysis The framework presented here is for a simple typed object-oriented language where the concrete states and operations are based on [31]. It allows us to derive a compositional, denotational semantics, which can be seen as an analyser, from a specification of a domain of abstract states and operations which work over them (hence called state transformers). Then problems such as scoping, recursion and name clash can be ignored, since these are already solved by the semantics. Moreover, this framework relates the precision of the analysis to that main.tex; 27/12/2017; 15:18; p.6 7 of its abstract domain so that traditional techniques for comparing the precision of abstract domains can be applied [9, 10, 11]. The definition of a denotational semantics, in the style of [37], by using the state transformers of this section can be found in [31]. Here we only want to make clear some points: − We allow expressions to have side-effects, such as method call expressions, which is not the case in [37]. As a consequence, the evaluation of an expression from an initial state yields both a final state and the value of the expression. We use a special variable res of the final state to hold this value; − The evaluation from an initial state σ1 of a binary operation such as e1 + e2 , where e1 and e2 are expressions, first evaluates e1 from σ1 , yielding an intermediate state σ2 , and then evaluates e2 from σ2 , yielding a state σ3 . The value v1 of res in σ2 is that of e1 , and the value v2 of res in σ3 is that of e2 . We then modify σ3 by storing in res the sum v1 + v2 . This yields the final state. Note that the single variable res is enough for this purpose. The complexity of this mechanism w.r.t. a more standard approach [37] is, again, a consequence of the use of expressions with side-effects; − Our denotational semantics deals with method calls through interpretations: an interpretation is the input/output behaviour of a method, and is used as its denotation whenever that method is called. As a nice consequence, our states contain only a single frame, rather than an activation stack of frames. This is standard in denotational semantics and has been used for years in logic programming [7]. − The computation of the semantics of a program starts from a bottom interpretation which maps every input state to an undefined final state and then updates this interpretation with the denotations of the methods body. This process is iterated until a fixpoint is reached as is done for logic programs [7]. The same technique can be applied to compute the abstract semantics of a program, but the computation is performed over the abstract domain. It is also possible to generate constraints which relate the abstract approximations at different program points, and then solve such constraints with a fixpoint engine. The latter is the technique that we use in Section 6. 3.1. Programs and Creation Points We recall here the semantical framework of [31]. main.tex; 27/12/2017; 15:18; p.7 8 Definition 4 (Type Environment) Each program in the language has a finite set of identifiers Id such that out, this ∈ Id and a finite set of classes K ordered by a subclass relation ≤ such that K ⋆ ≤ is a poset. Let Type = {int} ⊎ K and ≤ be extended to Type by defining int ≤ int. Let Vars ⊆ Id be a set of variables such that {out, this} ⊆ Vars. A type environment for a program is any element of the set  TypEnv = τ : Vars → Type if this ∈ dom(τ ) then τ (this) ∈ K . In the following, τ will implicitly stand for a type environment. A class contains local variables (fields) and functions (methods). A method has a set of input/output variables called parameters, including out, which holds the result of the method, and this, which is the object over which the method has been called (the receiver of the call). Methods returning void are represented as methods returning an int of constant value 0, implicitly ignored by the caller of the method. Example 5 See journal version of this paper. Fields is a set of maps which bind each class to the type environment of its fields. The variable this cannot be a field. Methods is a set of maps which bind each class to a map from identifiers to methods. Pars is a set of maps which bind each method to the type environment of its parameters (its signature). Definition 6 (Field, Method, Parameter) Let M be a finite set of methods. We define Fields = {F : K 7→ TypEnv | this 6∈ dom(F (κ)) for every κ ∈ K} Methods = K 7→ (Id → M) Pars = {P : M 7→ TypEnv | {out, this} ⊆ dom(P (ν)) for ν ∈ M}. The static information of a program is used by the static analyser. Definition 7 (Static Information) The static information of a program consists of a poset K ⋆ ≤, a set of methods M and maps F ∈ Fields, M ∈ Methods and P ∈ Pars. Fields in different classes but with the same name can be disambiguated by using their fully qualified name such as in the Java Virtual Machine [21]. For instance, we write Circle.x for the field x of the class Circle. Example 8 See journal version of this paper. main.tex; 27/12/2017; 15:18; p.8 9 The only points in the program where new objects can be created are the new statements. We require that each of these statements is identified by a unique label called its creation point. Definition 9 (Creation Point) Let Π be a finite set of labels called creation points. A map k : Π 7→ K relates every creation point π ∈ Π with the class k(π) of the objects it creates. Example 10 See journal version of this paper. 3.2. Concrete States To represent the concrete state of a computation at a particular program point we need to refer to the concrete values that may be assigned to the variables. Apart from the integers and null , these values need to include locations which are the addresses of the memory cells used at that point. Then the concrete state of the computation consists of a map that assigns type consistent values to variables (frame) and a map from locations to objects (memory) where an object is characterised by its creation point and the frame of its fields. Hence the notion of object that we use here is more concrete than that in [31], which relates a class rather than a creation point to each object. A memory can be updated by assigning new (type consistent) values to the variables in its frames. Definition 11 (Location, Frame, Object, Memory) Let Loc be an infinite set of locations and Value = Z + Loc + {null }. We define frames, objects and memories as   for every v ∈ dom(τ )   Frame τ = φ ∈ dom(τ ) 7→ Value τ (v) = int ⇒ φ(v) ∈ Z   τ (v) ∈ K ⇒ φ(v) ∈ {null } ∪ Loc Obj = {π ⋆ φ | π ∈ Π, φ ∈ Frame F (k(π)) } Memory = {µ ∈ Loc → Obj | dom(µ) is finite}. Let µ1 , µ2 ∈ Memory and L ⊆ dom(µ1 ). We say that µ2 is an L-update of µ1 , written µ1 =L µ2 , if L ⊆ dom(µ2 ) and for every l ∈ L we have µ1 (l).π = µ2 (l).π. The initial value for a variable of a given type is used when we add a variable in scope. It is defined as ℑ(int) = 0, ℑ(κ) = null for κ ∈ K. This function is extended to type environments (Definition 4) as ℑ(τ )(v) = ℑ(τ (v)) for every v ∈ dom(τ ). main.tex; 27/12/2017; 15:18; p.9 10 Example 12 See journal version of this paper. Type correctness and conservative garbage collection guarantee that there are no dangling pointers and that variables may only be bound to locations which contain objects allowed by the type environment. This is a sensible constraint for the memory allocated by strongly-typed languages such as Java [2]. Definition 13 (Weak Correctness) Let φ ∈ Frame τ and µ ∈ Memory. We say that φ is weakly τ -correct w.r.t. µ if for every v ∈ dom(φ) such that φ(v) ∈ Loc we have φ(v) ∈ dom(µ) and k((µφ(v)).π) ≤ τ (v). We strengthen the correctness notion of Definition 13 by requiring that it also holds for the fields of the objects in memory. Definition 14 (τ -Correctness) Let φ ∈ Frame τ and µ ∈ Memory. We say that φ is τ -correct w.r.t. µ and write φ ⋆ µ : τ , if 1. φ is weakly τ -correct w.r.t. µ and, 2. for every o ∈ rng(µ), o.φ is weakly F (k(o.π))-correct w.r.t. µ. Example 15 See journal version of this paper. Definition 16 defines the state of the computation as a pair consisting of a frame and a memory. The variable this in the domain of the frame must be bound to an object. In particular, it cannot be null. This condition could be relaxed in Definition 16. This would lead to simplifications in the following sections (such as in Definition 25). However, our condition is consistent with the specification of the Java programming language [2]. Note, however, that there is no such hypothesis about the local variable number 0 of the Java Virtual Machine, which stores the this object [21]. Definition 16 (State) If τ is a type environment associated with a program point, the set of possible states of a computation at that point is any subset of   φ ∈ Frame τ , µ ∈ Memory, φ ⋆ µ : τ, Στ = φ ⋆ µ . if this ∈ dom(τ ) then φ(this) 6= null Example 17 See journal version of this paper. The frame of an object o in memory is itself a state for the instance variables of o. main.tex; 27/12/2017; 15:18; p.10 11 Proposition 18 Let φ ⋆ µ ∈ Στ and o ∈ rng(µ). Then (o.φ) ⋆ µ ∈ ΣF (k(o.π)) . Proof. Since φ ⋆ µ ∈ Στ , from Definition 16 we have φ ⋆ µ : τ . From Definition 14 we know that o.φ is weakly F (k(o.π))-correct w.r.t. µ so that (o.φ) ⋆ µ : F (k(o.π)). Since this 6∈ dom(F (k(o.π))) (Definition 6) we conclude that (o.φ) ⋆ µ ∈ ΣF (k(o.π)) . ✷ 3.3. The Operations over the Concrete States Figures 7 and 8 show the signatures and the definitions, respectively, of a set of operations over the concrete states for a type environment τ . The variable res holds intermediate results, as we said at the beginning of this section. We briefly introduce these operations. − The nop operation does nothing. − A get operation loads into res a constant, the value of another variable or the value of the field of an object. In the last case (get field), that object is assumed to be stored in res before the get operation. Then (µφ′ (res)) is the object whose field f must be read, (µφ′ (res)).φ are its fields and (µφ′ (res)).φ(f ) is the value of the field named f . − A put operation stores in v the value of res or of a field of an object pointed to by res. Note that, in the second case, put field is a binary operation since the evaluation of e1 .f = e2 from an initial state σ1 works by first evaluating e1 from σ1 , yielding an intermediate state σ2 , and then evaluating e2 from σ2 , yielding a state σ3 . The final state is then put field(σ2 )(σ3 ) [31], where the variable res of σ2 holds the value of e1 and the variable res of σ3 holds the value of e2 . The object whose field is modified must still exist in the memory of σ3 . This is expressed by the update relation (Definition 11). As there is no result, res is removed. Providing two states i.e., two frames and two heaps for put field and, more generally, for binary operations, may look like an overkill and it might be expected that a single state and a single frame would be enough. However, our decision to have two states has been dictated by the intended use of this semantics i.e., abstract interpretation. By only using operations over states, we have exactly one concrete domain, which can be abstracted into just one abstract domain. Hybrid operations, working on states and frames, would only complicate the abstraction. main.tex; 27/12/2017; 15:18; p.11 12 nopτ get intiτ get nullκτ get varvτ get fieldfτ Operation : Στ 7→ Στ : Στ 7→ Στ [res7→int ] : Στ 7→ Στ [res7→κ] : Στ 7→ Στ [res7→τ (v)] : Στ → Στ [res7→i(f )] put varvτ : Στ 7→ Στ |−res put fieldfτ,τ ′ : Στ 7→ Στ ′ → Στ |−res =τ , +τ : Στ 7→ Στ 7→ Στ is nullτ : Στ 7→ Στ [res7→int ] callτν,v1 ,...,vn : Στ 7→ ΣP (ν)|−out returnντ : Στ 7→ Σp|out→ Στ [res7→p(out)] restrictvs : Στ 7→ Στ |−vs τ expandv:t : Στ 7→ Στ [v7→t] τ π newτ : Στ 7→ Στ [res7→k(π)] lookupm,ν : Στ → Στ [res7→P (ν)(this)] τ is trueτ : Στ → Στ |−res is falseτ : Στ → Στ |−res Constraint (this ∈ dom(τ ) always) res 6∈ dom(τ ), i ∈ Z res 6∈ dom(τ ), κ ∈ K res 6∈ dom(τ ), v ∈ dom(τ ) res ∈ dom(τ ), τ (res) ∈ K, i = F τ (res), f ∈ dom(i) res ∈ dom(τ ), v ∈ dom(τ ), v 6= res, τ (res) ≤ τ (v) res ∈ dom(τ ), τ (res) ∈ K f ∈ dom(F τ (res)) τ ′ = τ [res 7→ t] with t ≤ (F τ (res))(f ) res ∈ dom(τ ), τ (res) = int res ∈ dom(τ ), τ (res) ∈ K res ∈ dom(τ ), τ (res) ∈ K, {v1 , . . . , vn } ⊆ dom(τ ), ν ∈ M dom(P (ν))\{out,this} = {ι1 , . . . , ιn} (alphabetically ordered) τ (res) ≤ P (ν)(this) τ (vi ) ≤ P (ν)(ιi ) for i = 1, . . . , n res ∈ dom(τ ), ν ∈ M, p = P (ν) vs ⊆ dom(τ ) v ∈ Vars, v 6∈ dom(τ ), t ∈ Type res 6∈ dom(τ ), π ∈ Π res ∈ dom(τ ), τ (res) ∈ K, m ∈ dom(M τ (res)), ν ∈ M for every suitable m, σ and τ , there is at most one ν such that lookupm,ν (σ) is defined τ res ∈ dom(τ ), τ (res) = int, dom(is trueτ ) ∩ dom(is falseτ ) = ∅ dom(is trueτ ) ∪ dom(is falseτ ) = Στ Figure 7. The signature of the operations over the states. − For every binary operation such as = and + over values, there is an operation on states. Note that (in the case of =) Booleans are implemented by means of integers (every non-negative integer means true). We have already explained why we use two states for binary operations. − The operation is null checks that res points to null. − The operation call is used before, and the operation return is used after, a call to a method ν. While callν creates a new state in main.tex; 27/12/2017; 15:18; p.12 13 nopτ (φ ⋆ µ) = φ ⋆ µ get intiτ (φ ⋆ µ) = φ[res 7→ i] ⋆ µ get nullκ τ (φ ⋆ µ) = φ[res 7→ null ] ⋆ µ get varvτ (φ ⋆ µ) = φ[res 7→ φ(v)] ⋆ µ restrictvs τ (φ ⋆ µ) = φ|−vs ⋆ µ expandv:t τ (φ ⋆ µ) = φ[v 7→ ℑ(t)] ⋆ µ put varvτ (φ ⋆ µ) = φ[v 7→ φ(res)]|−res ⋆ µ ( φ′ [res 7→ ((µφ′ (res)).φ)(f )] ⋆ µ if φ′ (res) 6= null f ′ get fieldτ (φ ⋆ µ) = undefined otherwise    φ2 |−res ⋆ µ2 [l 7→ µ2 (l).π ⋆ µ2 (l).φ[f 7→ φ2 (res)]] put fieldfτ,τ ′ = if l = φ1 (res), l 6= null and µ1 =l µ2  (φ1 ⋆ µ1 )(φ2 ⋆ µ2 )  undefined otherwise ( φ2 [res 7→ 1] ⋆ µ2 if φ1 (res) = φ2 (res) =τ (φ1 ⋆ µ1 )(φ2 ⋆ µ2 ) = φ2 [res 7→ −1] ⋆ µ2 if φ1 (res) 6= φ2 (res) +τ (φ1 ⋆ µ1 )(φ2 ⋆ µ2 ) = φ2 [res 7→ φ1 (res) + φ2 (res)] ⋆ µ2 ( φ[res 7→ 1] ⋆ µ if φ(res) = null is nullτ (φ ⋆ µ) = φ[res 7→ −1] ⋆ µ otherwise callτν,v1 ,...,vn (φ ⋆ µ) = [ι1 7→ φ(v1 ), . . . , ιn 7→ φ(vn ), this 7→ φ(res)] ⋆ µ where {ι1 , . . . , ιn } = P (ν) \ {out, this} (alphabetically ordered)  φ1 [res 7→ φ2 (out)] ⋆ µ2     if L = rng(φ )| returnντ 1 −res ∩ Loc and µ1 =L µ2 = (φ1 ⋆ µ1 )(φ2 ⋆ µ2 )     undefined otherwise newπ τ (φ ⋆ µ) = φ[res 7→ l] ⋆ µ[l 7→ π ⋆ ℑ(F (k(π)))], l ∈ Loc \ dom(µ)  φ⋆µ     if φ(res) 6= null and M (k((µφ(res )).π))(m) = ν lookupm,ν (φ ⋆ µ) = τ     undefined otherwise ( φ|−res ⋆ µ if φ(res) ≥ 0 is trueτ (φ ⋆ µ) = undefined otherwise ( φ|−res ⋆ µ if φ(res ) < 0 is falseτ (φ ⋆ µ) = undefined otherwise. Figure 8. The operations over concrete states. which ν can execute, the operation returnν restores the state σ which was current before the call to ν, and stores in res the result of the call. As said in (the beginning of) Section 3, the denotation of the method is taken from an interpretation, in a denotational fashion [7]. Hence the execution from an initial state σ1 of a method call denoted, in the current interpretation, by d : Σ → Σ, yields main.tex; 27/12/2017; 15:18; p.13 14 the final state return(σ1 )(d(call(σ1 ))). Note that return is a binary operation whose first argument is the state of the caller at call-time and whose second argument is the state of the callee at return-time. Its definition in Figure 8 restores the state of the caller but stores in res the return value of the callee. By using a binary operation we can define our semantics in terms of states rather than in terms of activation stacks. This is a useful simplification when passing to abstraction, since states must be abstracted rather than stacks. Note that the update relation (Definition 11) requires that the variables of the caller have not been changed during the execution of the method (although the fields of the objects bound to those variables may be changed). − The operation expand (restrict) adds (removes) variables. − The operation newπ creates a new object o of creation point π. A pointer to o is put in res. Its fields are initialised to default values. − The operation lookupm,ν checks if, by calling the method identified by m of the object o pointed to by res, the method ν is run. This depends on the class k(o.π) of o = µφ(res). − The operation is true (is false) checks if res contains true (false). Example 19 See journal version of this paper. 3.4. The Collecting Semantics The operations of Figure 8 can be used to define the transition function from states to states, or denotation, of a piece of code c, as shown in Example 19. By use of call and return, there is a denotation for each method called in c; thus, by adding call and return, we can plug the method’s denotation in the calling points inside c (as shown in Subsection 3.3 and in Example 19). A function I binding each method m in a program P to its denotation I(m) is called an interpretation of P . Given an interpretation I, we are hence able to define the denotation TP (I)(m) of the body of a method m, so that we are able to transform I into a new interpretation TP (I). This leads to the definition of the denotational semantics of P as the minimal (i.e., less defined) interpretation which is a fixpoint of TP . This way of defining the concrete semantics in a denotational way through interpretations, is useful for a subsequent abstraction [11]. The technique, which has been extensively used in the logic programming tradition [7], has been adapted in [31] for object-oriented imperative programs by adding the mechanism for main.tex; 27/12/2017; 15:18; p.14 15 dynamic dispatch through the lookup operation in Figure 8. Note that the fixpoint of TP is not finitely computable in general, but it does exist as a consequence of Tarski’s theorem and it is the limit of the ascending chain of interpretations I0 , TP (I0 ), TP (TP (I0 )), . . . , where, for every method m, the denotation I0 (m) is always undefined [33]. The concrete semantics described above denotes each method with a map on states i.e., a function from Σ to Σ. However, abstract interpretation is interested in properties of states; so that each property of interest, is identified with the set of all the states satisfying that property. This leads to the definition of a collecting semantics [10, 11] i.e., a concrete semantics working over the powerset ℘(Σ). The operations of this collecting semantics are the powerset extension of the operations in Figure 8. For instance, get intiτ is extended into get intiτ (S) = {get intiτ (σ) | σ ∈ S} for every S ∈ ℘(Στ ). Note that dealing with powersets means that the semantics becomes non-deterministic. For instance, in Example 19 more than one target of the f.def() virtual call could be selected at the same time and more than one of the blocks of code could be executed. Hence we need a ∪ operation over sets of states which merges different threads of execution at the end of a virtual call (or, for similar motivations, at the end of a conditional). The notion of denotation now becomes a map over ℘(Στ ). Interpretations and the transformer on interpretations are defined exactly as above. We will assume the result, proved in [31], that every abstraction of ℘(Στ ), ∪ and of the powerset extension of the operations in Figure 8 induces an abstraction of the concrete collecting semantics. This is an application to object-oriented imperative programs of the fixpoint transfer Proposition 27 in [11]. Two such abstractions will be described in Sections 4 and 5. 4. The Basic Domain E We define here a basic abstract domain E as a property of the concrete states of Definition 16. Its definition is guided by our goal to over approximate, for every program point p, the set of creation points of objects reachable at p from some variable or field in scope. Thus an element of the abstract domain E which decorates a program point p is simply a set of creation points of objects that may be reached at p. The choice of an over approximation follows from the typical use of the information provided by an escape analysis. For instance, an object can be stack allocated if it does not escape the method which creates it i.e., if it does not belong to a superset of the objects reachable at main.tex; 27/12/2017; 15:18; p.15 16 its end. Moreover, our goal is to stack allocate specific creation points. Hence, we are not interested in the identity of the objects but in their creation points. Although, at the end of this section, we will see that E induces rather imprecise abstract operations, its definition is important since E comprises exactly the information needed to implement our escape analysis. Even though its abstract operations lose precision, we still need E as a basis for comparison and as a minimum requirement for new, improved domains for escape analysis. Namely, in Section 5 we will define a more precise abstract domain ER for escape analysis, and we will prove (Proposition 56) that it strictly contains E. This situation is similar to that of the abstract domain G for groundness analysis of logic programs [30] which, although imprecise, expresses the property looked for by the analysis, and is the basis of all the other abstract domains for groundness analysis, derived as refinements of G [29]. The definition of more precise abstract domains as refinements of simpler ones is actually standard methodology in abstract interpretation nowadays [15]. Another example is strictness analysis of functional programs, where a first simple domain is subsequently enriched to express more precise information [19]. A similar idea has also been applied to model-checking, through a sequence of refinements of a simple abstract domain [12]. A refinement, in this context, is just an operation that transforms a simpler domain into a richer one i.e., one containing more abstract elements. There are many standard refinements operations. One of this is reduced product, which allows one to compose two abstract domains in order to express the composition of the properties expressed by the two domains, and disjunctive completion, which enriches an abstract domain with the ability to express disjunctive information about the properties expressed by the domain [22]. Another example is the linear refinement of a domain w.r.t. another, which expresses the dependencies of the abstract properties expressed by the two domains [16]. In Section 5 we use a refinement which is significant for imperative programs, where assignments to program variables are the pervasive operation. Hence, a variable-based approximation often yields improved precision w.r.t. a global approximation of the state, such as expressed by E. This same refinement is used, for instance, when passing from rapid type analysis to a variable-based class analysis of object-oriented imperative programs in [31]. We show an example now that clarifies the idea of reachability for objects at a program point. Example 20 See journal version of this paper. main.tex; 27/12/2017; 15:18; p.16 17 The reasoning in Example 20 leads to the notion of reachability in Definition 21 where we use the actual fields of the objects instead of those of the declared class of the variables. Definition 21 (Reachability) Let σ = φ ⋆ µ ∈ Στ and S ⊆ Στ . The set of the objects reachable in σ is Oτ (σ) = ∪{Oτi (σ) | i ≥ 0} where Oτ0 (S) = ∅  [ φ ⋆ µ ∈ S, v ∈ dom(τ ) i+1 i Oτ (S) = {o} ∪ OF (k(o.π)) (o.φ ⋆ µ) . φ(v) ∈ Loc, o = µφ(v) The maps Oτi are extended to ℘(Στ ) as Oτi (S) = ∪{Oτi (σ) | σ ∈ S}. Proposition 18 provides a guarantee that Definition 21 is well-defined. Observe that variables and fields of type int do not contribute to Oτ . We can now define the abstraction map for E. It selects the creation points of the reachable objects. Definition 22 (Abstraction Map for E) Let S ⊆ Στ . The abstraction map for E is αEτ (S) = {o.π | σ ∈ S and o ∈ Oτ (σ)} ⊆ Π. Example 23 See journal version of this paper. 4.1. The Domain E in the Presence of Type Information Definition 22 seems to suggest that rng(αEτ ) = ℘(Π) i.e., that every set of creation points is a legal approximation in each given program point. However, this is not true if type information is taken into account. Example 24 See journal version of this paper. Example 24 shows that static type information provides escape information by indicating which subsets of creation points are not the abstraction of any concrete states. We should therefore characterise which are the good or meaningful elements of ℘(Π). This is important because it reduces the size of the abstract domain and removes useless creation points during the analysis through the use of an abstract garbage collector δτ (Definition 25). Let e ∈ ℘(Π). Then δτ (e) is defined as the largest subset of e which contains only those creation points deemed useful by the type environment τ . This set is computed first by collecting the creation points that main.tex; 27/12/2017; 15:18; p.17 18 create objects compatible with the types in τ . For each of these points, this check is reiterated for each of the fields of the object it creates until a fixpoint is reached. Note that if there are no possible creation points for this, all creation points are useless. Definition 25 (Abstract Garbage Collector δ) Let e ⊆ Π. We define δτ (e) = ∪{δτi (e) | i ≥ 0} with δτ0 (e) = ∅   ∅       if this ∈ dom(τ ) and no π ∈ e is s.t. k(π) ≤ τ (this) i+1 δτ (e) =     ∪ {π} ∪ δFi (π) (e) κ ∈ rng(τ ) ∩ K, π ∈ e, k(π) ≤ κ     otherwise. It follows from Definition 25 that δτi ⊆ δτi+1 and hence δτ = δτ#Π . Note that in Definition 25 we consider all subclasses of κ (Example 20). Example 26 See journal version of this paper. Proposition 27 states that the abstract garbage collector δτ is a lower closure operator so that it possesses the properties of monotonicity, reductivity and idempotence that would be expected in a garbage collector. Proposition 27 Let i ∈ N. The abstract garbage collectors δτi and δτ are lco’s. The following result proves that δτ can be used to define rng(αEτ ). Namely, the useful elements of ℘(Π) are those that do not contain any garbage. The proof of Proposition 28 relies on the explicit construction, for every e ⊆ Π, of a set of concrete states X such that ατ (X) = δτ (e), which is a fixpoint of δτ by a well-known property of lco’s. Proposition 28 Let δ(τ ) be an abstract garbage collector. We have that fp(δτ ) = rng(αEτ ) and ∅ ∈ fp(δτ ). Moreover, if this ∈ dom(τ ), then for every X ⊆ Στ we have αEτ (X) = ∅ if and only if X = ∅. Proposition 28 lets us assume that αEτ : ℘(Στ ) 7→ fp(δτ ). Moreover, it justifies the following definition of our domain E for escape analysis. Proposition 28 can be used to compute the possible approximations from E at a given program point. However, it does not specify which of these is best. This is the goal of an escape analysis (Subsection 4.2). main.tex; 27/12/2017; 15:18; p.18 19 Definition 29 (Abstract Domain E) Our basic domain for escape analysis is Eτ = fp(δτ ), ordered by set inclusion. Example 30 See journal version of this paper. By Definition 22, we know that αEτ is strict and additive and, by Proposition 28, onto Eτ . Thus, by a general result of abstract interpretation [10, 11] (Section 2), we have the following proposition. Proposition 31 The map αEτ (Definition 22) is the abstraction map of a Galois insertion from ℘(Στ ) to Eτ . Note that if, in Definition 29, we had defined Eτ as ℘(Π), the map αEτ would induce just a Galois connection instead of a Galois insertion, as a consequence of Proposition 28. The domain E induces optimal abstract operations which can be used for an actual escape analysis. We discuss this in the next subsection. 4.2. Static Analysis over E Figure 9 defines the abstract counterparts of the concrete operations in Figure 8. Proposition 32 states that they are correct and optimal, in the sense of abstract interpretation (Section 2). Optimality is proved by showing that each operation in Figure 9 coincides with the optimal operation αE ◦op ◦γ E , where op is the corresponding concrete operation in Figure 8, as required by the abstract interpretation framework. Note that the map γ E is induced by αE (Section 2). Proposition 32 The operations in Figure 9 are the optimal counterparts induced by αE of the operations in Figure 8 and of ∪. They are implicitly strict on ∅, except for return, which is strict in its first argument only, and for ∪. Many operations in Figure 9 coincide with the identity map. This is a sign of the computational imprecision conveyed by the domain E. Other operations call the δ garbage collector quite often to remove creation points of objects which might become unreachable since some variable has disappeared from the scope. For instance, as the concrete put var operation removes variable v from the scope (Figure 8), its abstract counterpart in Figure 9 calls the garbage collector. The same happens for restrict which, however, removes a set of variables from the scope. There are also some operations (is null, put field, lookup) that use res as a temporary variable and one operation (get field) that changes the type of res. Hence these abstract operations also need to call the garbage main.tex; 27/12/2017; 15:18; p.19 20 nopτ (e) = e get nullκτ (e) = e get intiτ (e) = e get varvτ (e) = e is trueτ (e) = e is falseτ (e) = e put varvτ (e) newπτ (e) expandv:t τ (e) callτν,v1 ,...,vn (e) = δτ |−v (e) = e ∪ {π} is nullτ (e) = δτ |−res (e) =τ (e1 )(e2 ) = +τ (e1 )(e2 ) = e2 =e restrictvs τ (e) = δτ−vs (e) = δτ |{v1 ,...vn ,res} (e) ∪τ (e1 )(e2 ) = e1 ∪ e2 ( ∅ if {π ∈ e | k(π) ≤ τ (res)} = ∅ f get fieldτ (e) = δτ [res7→F (τ (res))(f )] (e) otherwise ( ∅ if {π ∈ e1 | k(π) ≤ τ (res)} = ∅ put fieldfτ,τ ′ (e1 )(e2 ) = δτ |−res (e2 ) otherwise   κ ∈ rng(τ |−res ) ∩ K returnντ (e1 )(e2 ) = ∪ {π} ∪ δF (k(π)) (Π) ∪ e2 π ∈ e1 , k(π) ≤ κ ) (   k(π) ≤ τ (res) ∅ ′ =∅ if e = π ∈ e lookupm,ν (e) = M (k(π))(m) = ν τ   S  {{π} ∪ δF (k(π)) (e) | π ∈ e′ } otherwise. δτ |−res (e) ∪ Figure 9. The optimal abstract operations over E . collector. Note that the definitions of the get field, put field and lookup operations also consider, separately, the unusual situation when we read a field, respectively, write a field or call a method and the receiver is always null . In this case, the concrete computation always stops so that the best approximation of the (empty) set of subsequent states is ∅. The garbage collector is also called by call since it creates a scope for the callee where only some of the variables of the caller (namely, the parameters of the callee) are addressable. The new operation adds its creation point to the approximation, since its concrete counterpart creates an object and binds it to the temporary variable res. The ∪ operation computes the union of the creation points reachable from at least one of the two branches of a conditional. The return operation states that all fields of the objects bound to the variables in scope before the call might have been modified by the call. This is reflected by the use of δF (k(π)) (Π) in return, which plays the role of a worst-case assumption on the content of the fields. After Example 33 we discuss how to cope with the possible imprecision of this definition. The lookup operation computes first the set e′ of the creation points of objects that may be receivers of the virtual call. If this set is not empty, the variable main.tex; 27/12/2017; 15:18; p.20 21 res (which holds the receiver of the call) is required to be bound to an object created at some creation point in e′ . This further constrains the creation points reachable from res and this is why we call the garbage collector δF (k(π)) for each π ∈ e′ . The definitions of return and lookup are quite complex; this is a consequence of our quest for optimal abstract operations. It is possible to replace their definitions in Figure 9 by the less precise but simpler definitions: returnντ (e1 )(e2 ) = δτ (Π) ∪ e2 lookupm,ν τ (e) = e. Note though that, in practice, the results with the simpler definitions will often be the same. Example 33 See journal version of this paper. There is, however, another problem related with the domain E. It is exemplified below. Example 34 See journal version of this paper. 5. The Refined Domain ER We define here a refinement ER of the domain E of Section 4, in the sense that ER is a concretisation of E (Proposition 56). The idea underlying the definition of ER is that the precision of E can be improved if we can speak about the creation points of the objects bound to a given variable or field (see the problem highlighted in Example 34). The construction of ER is very similar to that of E. 5.1. The Domain Definition 11 defines concrete values. The domain ER we are going to define approximates every concrete value with an abstract value. An abstract value is either ∗, which approximates the integers, or a set e ⊆ Π, which approximates null and all locations containing an object created in some creation point in e. An abstract frame maps variables to abstract values consistent with their type. Definition 35 (Abstract Values and Frames) Let the abstract values be Value ER = {∗} ∪ ℘(Π). We define   for every v ∈ dom(τ )       if τ (v) = int then φ(v) = ∗ ER ER . Frame τ = φ ∈ dom(τ ) 7→ Value if τ (v) ∈ K and π ∈ φ(v)       then k(π) ≤ τ (v) main.tex; 27/12/2017; 15:18; p.21 22 The set Frame ER is ordered by pointwise set-inclusion. τ Example 36 See journal version of this paper. The map ε extracts the creation points of the objects bound to the variables. Definition 37 (Extraction Map) The map ετ : ℘(Στ ) 7→ Frame ER τ is such that, for every S ⊆ Στ and v ∈ dom(τ ), ( ∗ if τ (v) = int ετ (S)(v) = {(µφ(v)).π | φ ⋆ µ ∈ S and φ(v) ∈ Loc} if τ (v) ∈ K. Example 38 See journal version of this paper. Since it is assumed that all the fields are uniquely identified by their fully qualified name, the type environment τe of all the fields introduced by the program is well-defined. Definition 39 (Type Environment of All Fields)We define the type environment of all fields as τe = ∪{F (κ) | κ ∈ K}. Let τ ∈ TypEnv be such that dom(τ ) ⊆ dom(e τ ) and φ ∈ F rameτ . Its extension φe ∈ Frame τe is such that, for every v ∈ dom(e τ ), ( φ(v) if v ∈ dom(τ ) e φ(v) = ℑ(e τ (v)) otherwise (Definition 11). Example 40 See journal version of this paper. ✷ An abstract memory is an abstract frame for τe. The abstraction map computes the abstract memory by extracting the creation points of the fields of the reachable objects of the concrete memory (Definition 21). Definition 41 (Abstract Map for ER) Let the set of abstract memories be Memory ER = Frame ER τe . We define the map ER ) : ℘(Στ ) 7→ {⊥} ∪ (Frame ER αER τ × Memory τ such that, for S ⊆ Στ , ( ⊥ ER ατ (S) = f ⋆ σ.µ | σ ∈ S and o ∈ Oτ (σ)}) ετ (S) ⋆ ετe ({o.φ if S = ∅ otherwise. Example 42 See journal version of this paper. main.tex; 27/12/2017; 15:18; p.22 23 Compare Examples 42 and 23. You can see that ER distributes over the variables and fields the same creation points observed by E. As a notational simplification, we often assume that each field not reported in the approximation of the memory is implicitly bound to ∅, if it has class type, and bound to ∗, if it has int type. Just as for αEτ (Example 24), the following example shows that the map αER is not necessarily onto. τ Example 43 See journal version of this paper. Hence, we define a map ξ which forces to ∅ the fields of type class of the objects which have no reachable creation points. Just as for the garbage collector δ for E, the map ξ can be seen as an abstract garbage collector for ER. This ξ uses an auxiliary map ρ to compute the set of creation points r reachable from the variables in scope. The approximations of the fields of the objects created at r are not garbage collected by ξ. The approximations of the other fields are garbage collected instead. Definition 44 (Abstract Garbage Collector ξ) We define ρτ : ER ER Frame ER 7→ ℘(Π) and ξτ : {⊥}∪(Frame ER ) τ ×Memory τ ×Memory ER 7→ {⊥} ∪ (Frame ER ) as ρτ (s) = ∪{ρiτ (s) | i ≥ 0}, where τ × Memory ρ0τ (φ ⋆ µ) = ∅  [ v ∈ dom(τ ) i+1 i ρτ (φ ⋆ µ) = {π} ∪ ρF (k(π)) (µ|dom(F (k(π))) ⋆ µ) π ∈ φ(v) and ξτ (⊥) = ⊥ ( ⊥ if this ∈ dom(τ ) and φ(this) = ∅  ξτ (φ ⋆ µ) = φ ⋆ ∪{µ|dom(F (k(π))) | π ∈ ρτ (φ ⋆ µ)} otherwise. Example 45 See journal version of this paper. The following property is expected to hold for a garbage collector. Compare Propositions 27 and 46. Proposition 46 The abstract garbage collector ξτ is an lco. The garbage collector ξτ can be used to define rng(αER τ ). Namely, the ER useful elements of Frame ER × Memory are exactly those that do not τ contain any garbage. Compare Propositions 28 and 47. Proposition 47 Let ξτ be the abstract garbage collector of Definition 44. Then fp(ξτ ) = rng(αER τ ). main.tex; 27/12/2017; 15:18; p.23 24 Proposition 47 allows us to assume that αER : ℘(Στ ) 7→ fp(ξτ ) and τ justifies the following definition. Definition 48 (Abstract Domain ER) We define ERτ = fp(ξτ ), ordered by pointwise set-inclusion (with the assumption that ∗ ⊆ ∗ and ⊥ ⊆ s for every s ∈ ERτ ). By Definitions 37 and 41 we know that the map αER is strict and τ additive. By Proposition 47 we know that it is onto. Thus we have the following result corresponding to Proposition 31 for the domain E. is the abstraction map of a Galois Proposition 49 The map αER τ insertion from ℘(Στ ) to ERτ . 5.2. Static Analysis over ER In order to use the domain ER for an escape analysis, we need to provide the abstract counterparts over ER of the concrete operations in Figure 8. Since ER approximates every variable and field with an abstract value, those abstract operations are similar to those of the Palsberg and Schwartzbach’s domain for class analysis in [23] as formulated in [31]. However, ER observes the fields of just the reachable objects (Definition 41), while Palsberg and Schwartzbach’s domain observes the fields of all objects in memory. Figure 10 reports the abstract counterparts on ER of the concrete operations in Figure 8. These operations are implicitly strict on ⊥ except for ∪. In this case, we define ⊥ ∪ (φ ⋆ µ) = (φ ⋆ µ) ∪ ⊥ = φ ⋆ µ. Their optimality is proved by showing that each operation in Figure 10 coincides with the optimal operation αER ◦ op ◦ γ ER , where op is the corresponding concrete operation in Figure 8, as required by the abstract interpretation framework. Note that the map γ ER is induced by αER (Section 2). Proposition 50 The operations in Figure 10 are the optimal counterparts induced by αER of the operations in Figure 8 and of ∪. Let us consider each of the abstract operations. The operation nop leaves the state unchanged. The same happens for the operations working with integer values only, such as is true, is false, = and +, since the domain ER ignores variables with integer values. The concrete operation get int loads an integer into res. Hence, its abstract counterpart loads ∗ into res, since ∗ is the approximation for integer values (Definition 35). The concrete operation get null loads null into res and main.tex; 27/12/2017; 15:18; p.24 25 nopτ (φ ⋆ µ) = φ ⋆ µ 7 ∗] ⋆ µ get intiτ (φ ⋆ µ) = φ[res → κ get nullτ (φ ⋆ µ) = φ[res → 7 ∅] ⋆ µ get varvτ (φ ⋆ µ) = φ[res 7→ φ(v)] ⋆ µ is trueτ (φ ⋆ µ) = φ ⋆ µ is falseτ (φ ⋆ µ) = φ ⋆ µ ∪τ (φ1 ⋆ µ1 )(φ2 ⋆ µ2 ) = (φ1 ∪ φ2 ) ⋆(µ1 ∪ µ2 ) is nullτ (φ ⋆ µ) = ξτ [res7→int ] (φ[res 7→ ∗] ⋆ µ) newπτ (φ ⋆ µ) = φ[res 7→ {π}] ⋆ µ put varvτ (φ ⋆ µ) = ξτ |−res (φ[v 7→ φ(res)]|−res ⋆ µ) restrictvs τ (φ ⋆ µ) = ξτ |−vs (φ|−vs ⋆ µ) ( φ[v 7→ ∗] ⋆ µ if t = int v:t expandτ (φ ⋆ µ) = φ[v 7→ ∅] ⋆ µ otherwise =τ (φ1 ⋆ µ1 )(φ2 ⋆ µ2 ) = +τ (φ1 ⋆ µ1 )(φ2 ⋆ µ2 ) = φ2 ⋆ µ2 ( ⊥ if φ(res) = ∅ f get fieldτ (φ ⋆ µ) = ξτ [res7→F (τ (res))(f )] (φ[res 7→ µ(f )] ⋆ µ) else   ⊥ if φ1 (res) = ∅      ξτ |−res (φ2 |−res ⋆ µ2 ) put fieldfτ,τ ′ = else, if no π ∈ φ1 (res) occurs in φ2 |−res ⋆ µ2  (φ1 ⋆ µ1 )(φ2 ⋆ µ2 )   ξ  τ |−res (φ2 |−res ⋆ µ2 [f 7→ µ2 (f ) ∪ φ2 (res)])    otherwise    ι1 7→ φ(v1 ), . . . , ιn 7→ φ(vn ) ν,v1 ,...,vn callτ ⋆µ (φ ⋆ µ) = ξP (ν)|−out this 7→ φ(res) returnντ = ξτ |−res (φ1 |−res ⋆ µ⊤ ) ∪ ([res 7→ φ2 (out)] ⋆ µ2 ) (φ1 ⋆ µ1 )(φ2 ⋆ µ2 ) where µ⊤ is the top of Memory ER ( ⊥ if e = {π ∈ φ(res) | M (π)(m) = ν} = ∅ m,ν lookupτ (φ ⋆ µ) = ξτ (φ[res 7→ e] ⋆ µ) otherwise. Figure 10. The abstract operations over E R. hence its abstract counterpart approximates res with ∅. The operation get varv copies the creation points of v into those of res. The ∪ operation merges the creation points of the objects bound to each given variable or field in one of the two branches of a conditional. The concrete is null operation checks if res contains null or not, and main.tex; 27/12/2017; 15:18; p.25 26 loads 1 or −1 in res accordingly. Hence its abstract counterpart loads ∗ into res. Since the old value of res may no longer be reachable, we apply the abstract garbage collector ξ. The newπ operation binds res to an object created at π. The put varv operation copies the value of res into v, and removes res. Since the old value of v may be lost, we apply the abstract garbage collector ξ. The restrict operation removes some variables from the scope and, hence, calls ξ. The expandv operation adds the variable v in scope. Its initial value is approximated with ∗, if it is 0, and with ∅, if it is null. The get fieldf operation returns ⊥ if it is always applied to states where the receiver res is null. This is because ⊥ is the best approximation of the empty set of final states. If, instead, the receiver is not necessarily null , the creation points of the field f are copied from the approximation µ(f ) into the approximation of res. Since this operation changes the value of res, possibly making some object unreachable, it needs to call ξ. For the put fieldf operation, we first check if the receiver is always null, in which case the abstract operation returns ⊥. Then we consider the case in which the evaluation of what is going to be put inside the field makes the receiver unreachable. This (pathological) case happens in a situation such as a.g.f = m(a) where the method call m(a) sets to null the field g of the object bound to a. Since we assume that the lefthand side is evaluated before the right-hand side, the receiver is not necessarily null , but the field updates might not be observable if a.g.f is only reachable from a. In the third and final case for put field we consider the standard situation when we write into a reachable field of a non-null receiver. The creation points of the right-hand side are added to those already approximating the objects stored in f . The call operation restricts the scope to the parameters passed to a method and hence ξ is used. The return operation copies into res the return value of the method which is held in out. The local variables of the caller are put back into scope, but the approximation of their fields is provided through a worst-case assumption µ⊤ since they may be modified by the call. This loss of precision can be overcome by means of shadow copies of the variables, just as for E (see Example 52). The lookupm operation first computes the subset e of the approximation of the receiver of the call only containing the creation points whose class leads to a call to the method m. If e = ∅, a call to m is impossible and the result of the operation is ⊥. Otherwise, e becomes the approximation of the receiver res, so that some creation points can disappear and we need to call ξ. Example 51 See journal version of this paper. The abstract state s′′6 shows that the imprecision problem of E, related to the return operation, is still present in ER. By comparing main.tex; 27/12/2017; 15:18; p.26 27 s2 with s′′6 , it can be seen that the return operation makes a very pessimistic assumption about the possible creation points for the next and rotation fields. In particular, from s′′6 it seems that creation points π3 and π4 are reachable (they belong to µ⊤ ), which is not the case in the concrete state (compare this with σ6′′ in Example 19). As for the domain E, this problem can be solved by including, in the state of the callee, shadow copies of the parameters of the caller. This is implemented through a preprocessing of the bodies of the methods which prepend statements of the form v ′ :=v for each parameter v, where v ′ is the shadow copy of v. Since shadow copies are fresh new variables, not already occurring in the method’s body, their value is never changed. In this way, at the end of the method we know which creation points are reachable from the fields of the objects bound to such parameters. Example 52 See journal version of this paper. As previously noted in Subsection 1.2, shadow copies of the parameters are also useful for dealing with methods that modify their formal parameters. There was another problem with E, related to the fact that E does not distinguish between different variables (see end of Section 4). It is not surprising that ER solves that problem, as shown below. Example 53 See journal version of this paper. 5.3. ER is a Refinement of E We have called ER a refinement of E. In order to give this word a formal justification, we show here that ER actually includes the elements of E. Namely, we show how every element e ∈ E can be embedded into an element θ(e) of ER, such that e and θ(e) have the same concretisation i.e., they represent the same property of concrete states. The idea, formalised in Definition 54, is that every variable or field must be bound in ER to all those creation points in e compatible with its type. Definition 54 (Embedding of E into ER) Let s ⊆ Π. We define such that, for every v ∈ dom(τ ), ϑτ (s) ∈ Frame ER τ ( ∗ if τ (v) = int ϑτ (s)(v) = {π ∈ s | k(π) ≤ τ (v)} if τ (v) ∈ K. The embedding θτ (e) ∈ ERτ of e ∈ Eτ is θτ (e) = ξτ (ϑτ (e) ⋆ ϑτe (e)). Example 55 See journal version of this paper. main.tex; 27/12/2017; 15:18; p.27 28 Proposition 56 states that the embedding of Definition 54 is correct. The proof proceeds by showing that θτ (e) is an element of ERτ and approximates exactly the same concrete states as e, that is, for every element of E there is an element of ER which represents exactly the same set of concrete states. Proposition 56 Let γτE and γτER be the concretisation maps induced by the abstraction maps of Definitions 22 and 41, respectively. Then γτE (Eτ ) ⊆ γτER (ERτ ). The following example shows that the inclusion relation in Proposition 56 must be strict. Example 57 See journal version of this paper. 6. Implementation See journal version of this paper. 7. Discussion 8. Conclusion We have presented a formal development of an escape analysis by abstract interpretation, providing optimality results in the form of a Galois insertion from the concrete to the abstract domain and of the definition of optimal abstract operations. This escape analysis has been implemented and applied to full Java (bytecode). This results in an escape analyser which is probably less precise than others already developed, but still performs well in practice from the points of view of its cost and precision . A first, basic escape domain E is defined as a property of concrete states (Definition 29). This domain is simple but non-trivial since − The set of the creation points of the objects reachable from the current state can both grow (new) and shrink (δ); i.e., static type information contains escape information (Examples 24 and 33); − That set is useful, sometimes, to restrict the possible targets of a virtual call i.e., escape information contains class information (Example 33). main.tex; 27/12/2017; 15:18; p.28 29 However, the escape analysis induced by our domain E is not precise enough from a computational point of view, since it induces rather imprecise abstract operations. We have therefore defined a refinement ER of E, on the basis of the information that E lacks, in order to attain better precision. The relation between ER and E is similar to that between Palsberg and Schwartzbach’s class analysis [23, 31] and rapid type analysis [3] although, while all objects stored in memory are considered in [3, 31, 23], only those actually reachable from the variables in scope are considered by the domains E and ER (Definitions 22 and 41). The ability to describe only the reachable objects, through the use of an abstract garbage collector (δ in Figure 9 and ξ in Figure 10), improves the precision of the analysis, since it becomes focused on only those objects that can actually affect the concrete execution of the program. It is interesting to consider if this notion of reachability and the use of an abstract garbage collector can be applied to other static analyses of the run-time heap as well. Namely, class, shape, sharing and cyclicity analyses might benefit from them. Acknowledgements This work has been funded by the Italian MURST grant Abstract Interpretation, Type Systems and Control-Flow Analysis and by the British EPSRC grant GR/R53401. References 1. 2. 3. 4. 5. 6. G. Agrawal. Simultaneous Demand-Driven Data-flow and Call Graph Analysis. In Proc. of the International Conference on Software Maintenance (ICSM’99), pages 453–462, Oxford, UK, September 1999. IEEE Computer Society. K. Arnold, J. Gosling, and D. Holmes. The JavaT M Programming Language. Addison-Wesley, third edition, 2000. D. F. Bacon and P. F. Sweeney. Fast Static Analysis of C++ Virtual Function Calls. In Proc. of OOPSLA’96, volume 31(10) of ACM SIGPLAN Notices, pages 324–341, New York, 1996. ACM Press. B. Blanchet. Escape Analysis: Correctness Proof, Implementation and Experimental Results. In 25th ACM SIGPLAN-SIGACT Symposium of Principles of Programming Languages (POPL’98), pages 25–37, San Diego, CA, USA, January 1998. ACM Press. B. Blanchet. Escape Analysis for Java: Theory and Practice. ACM TOPLAS, 25(6):713–775, November 2003. J. Bogda and U. Hölzle. Removing Unnecessary Synchronization in Java. In Proc. of OOPSLA’99, volume 34(10) of SIGPLAN Notices, pages 35–46, Denver, Colorado, USA, November 1999. main.tex; 27/12/2017; 15:18; p.29 30 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. A. Bossi, M. Gabbrielli, G. Levi, and M. Martelli. The s-Semantics Approach: Theory and Applications. Journal of Logic Programming, 19/20:149–197, 1994. J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Stack Allocation and Synchronization Optimizations for Java Using Escape Analysis. ACM TOPLAS, 25(6):876–910, November 2003. A. Cortesi, G. Filé, and W. Winsborough. The Quotient of an Abstract Interpretation. Theoretical Computer Science, 202(1-2):163–192, 1998. P. Cousot and R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Proc. of POPL’77, pages 238–252, 1977. P. Cousot and R. Cousot. Abstract Interpretation and Applications to Logic Programs. Journal of Logic Programming, 13(2 & 3):103–179, 1992. D. R. Dams. Abstract Interpretation and Partition Refinement for Model Checking. PhD thesis, Eindhoven University of Technology, The Netherlands, July 1996. A. Deutsch. On the Complexity of Escape Analysis. In 24th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages (POPL’97), pages 358–371, Paris, France, January 1997. ACM Press. D. Gay and B. Steensgaard. Fast Escape Analysis and Stack Allocation for Object-Based Programs. In D. A. Watt, editor, Compiler Construction, 9th International Conference (CC’00), volume 1781 of Lecture Notes in Computer Science, pages 82–93. Springer-Verlag, Berlin, March 2000. R. Giacobazzi and F. Ranzato. Refining and Compressing Abstract Domains. In Proc. of the 24th International Colloquium on Automata, Languages and Programming (ICALP’97), volume 1256 of LNCS, pages 771–781. SpringerVerlag, 1997. R. Giacobazzi and F. Scozzari. A Logical Model for Relational Abstract Domains. ACM Transactions on Programming Languages and Systems, 20(5):1067–1109, 1998. P. M. Hill and F. Spoto. A Foundation of Escape Analysis. In H. Kirchner and C. Ringeissen, editors, Proc. of AMAST’02, volume 2422 of LNCS, pages 380– 395, St. Gilles les Bains, La Réunion island, France, September 2002. SpringerVerlag. P. M. Hill and F. Spoto. A Refinement of the Escape Property. In A. Cortesi, editor, Proc. of the VMCAI’02 workshop on Verification, Model-Checking and Abstract Interpretation, volume 2294 of Lecture Notes in Computer Science, pages 154–166, Venice, Italy, January 2002. Springer-Verlag. T. Jensen. Disjunctive Program Analysis for Algebraic Data Types. ACM Transactions on Programming Languages and Systems, 19(5):752–804, 1997. N. D. Jones and H. Søndergaard. A Semantics-based Framework for the Abstract Interpretation of Prolog. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages, pages 123–142. Ellis Horwood Ltd, 1987. T. Lindholm and F. Yellin. The JavaTM Virtual Machine Specification. Addison-Wesley, second edition, 1999. Cousot. P. and R. Cousot. Systematic Design of Program Analysis Frameworks. In Proc. of the Sixth Annual ACM Symposium on Principles of Programming Languages (POPL’79), pages 269–282, San Antonio, Texas, 1979. ACM. J. Palsberg and M. I. Schwartzbach. Object-Oriented Type Inference. In Proc. of OOPSLA’91, volume 26(11) of ACM SIGPLAN Notices, pages 146–161. ACM Press, November 1991. main.tex; 27/12/2017; 15:18; p.30 31 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. Y. G. Park and B. Goldberg. Escape Analysis on Lists. In ACM SIGPLAN’92 Conference on Programming Language Design and Implementation (PLDI’92), volume 27(7) of SIGPLAN Notices, pages 116–127, San Francisco, California, USA, June 1992. A. Rountev, A. Milanova, and B. G. Ryder. Points-to Analysis for Java Using Annotated Constraints. In Proc. of ACM SIGPLAN Conference on ObjectOriented Programming Systems, Languages and Applications (OOPSLA’01), volume 36(11) of ACM SIGPLAN, pages 43–55, Tampa, Florida, USA, October 2001. E. Ruf. Effective Synchronization Removal for Java. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’00), volume 35(5) of SIGPLAN Notices, pages 208–218, Vancouver, British Columbia, Canada, June 2000. C. Ruggieri and T. P. Murtagh. Lifetime Analysis of Dynamically Allocated Objects. In 15th ACM Symposium on Principles of Programming Languages (POPL’88), pages 285–293, San Diego, California, USA, January 1988. A. Salcianu and M. Rinard. Pointer and Escape Analysis for Multithreaded Programs. In Proc. of ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP’01), volume 36(7) of SIGPLAN Notices, pages 12–23, Snowbird, Utah, USA, July 2001. F. Scozzari. Logical Optimality of Groundness Analysis. Theoretical Computer Science, 277(1-2):149–184, 2002. H. Søndergaard. An Application of Abstract Interpretation of Logic Programs: Occur Check Reduction. In B. Robinet and R. Wilhelm, editors, Proc. of the European Symposium on Programming (ESOP), volume 213 of Lecture Notes in Computer Science, pages 327–338, Saarbrücken, Federal Republic of Germany, March 1986. Springer. F. Spoto and T. Jensen. Class Analyses as Abstract Interpretations of Trace Semantics. ACM Transactions on Programming Languages and Systems (TOPLAS), 25(5):578–630, September 2003. M. Streckenbach and G. Snelting. Points-to for Java: A General Framework and an Empirical Comparison. Technical report, Universität Passau, Germany, November 2000. A. Tarski. A Lattice-theoretical Fixpoint Theorem and its Applications. Pacific J. Math., 5:285–309, 1955. F. Vivien and M. Rinard. Incrementalized Pointer and Escape Analysis. In Proc. of ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’01), volume 36(5) of SIGPLAN Notices, pages 35–46, Snowbird, Utah, USA, June 2001. J. Whaley and M. S. Lam. Cloning-Based Context-Sensitive Pointer Alias Analysis Using Binary Decision Diagrams. In W. Pugh and C. Chambers, editors, Proc. of ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation (PLDI’04), pages 131–144, Washington, DC, USA, June 2004. ACM. J. Whaley and M. C. Rinard. Compositional Pointer and Escape Analysis for Java Programs. In 1999 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA’99), volume 34(1) of SIGPLAN Notices, pages 187–206, Denver, Colorado, USA, November 1999. G. Winskel. The Formal Semantics of Programming Languages. The MIT Press, 1993. main.tex; 27/12/2017; 15:18; p.31 32 Appendix A. Proofs of Propositions 27, 28 and 32 in Section 4. Proposition 27. Let i ∈ N. The abstract garbage collectors δτi and δτ are lco’s. Proof. Since δτ = δτ#Π , it is enough to prove the result for δτi only. By Definition 25, the maps δτi for i ∈ N are reductive and monotonic. We prove idempotency by induction over i ∈ N. Let e ⊆ Π. We have δτ0 δτ0 (e) = δτ0 (∅) = ∅ = δτ0 (e). Assume that the result holds for a given i ∈ N. If this ∈ dom(τ ) and there is no π ∈ e such that k(π) ≤ τ (this), then δτi δτi (e) = δτi (∅) = ∅ = δτi (e). Suppose now that, if this ∈ dom(τ ), then there exists π ∈ e such that k(π) ≤ τ (this). By reductivity, δτi+1 δτi+1 (e) ⊆ δτi+1 (e). We prove that the converse inclusion holds. We have   κ ∈ rng(τ ) ∩ K i+1 i+1 i i+1 δτ δτ (e) = ∪ {π} ∪ δF (k(π)) δτ (e) . π ∈ δτi+1 (e), k(π) ≤ κ (1) Let κ ∈ rng(τ ) ∩ K and π ∈ Π be such that k(π) ≤ κ. If π ∈ δτi+1 (e) then, by reductivity, we have π ∈ e. Conversely, if π ∈ e then, by Definition 25, π ∈ δτi+1 (e). We conclude from (1) that   κ ∈ rng(τ ) ∩ K i+1 i+1 i i+1 δτ δτ (e) = ∪ {π} ∪ δF (k(π)) δτ (e) π ∈ e, k(π) ≤ κ   κ ∈ rng(τ ) ∩ K (monotonicity) ⊇ ∪ {π} ∪ δFi (k(π)) δFi (π) (e) π ∈ e, k(π) ≤ κ   κ ∈ rng(τ ) ∩ K i (ind. hypothesis) = ∪ {π} ∪ δF (k(π)) (e) π ∈ e, k(π) ≤ κ = δτi+1 (e). ✷ To prove Proposition 28, we need some preliminary definitions and results. We start by defining, for every i ∈ N, a map αiτ which, for sufficiently large i, coincides with αEτ (Definition 22). Definition 58 Let i ∈ N. We define the map αiτ : ℘(Στ ) 7→ Π as αiτ (S) = {o.π | σ ∈ S and o ∈ Oτi (σ)} (see Definition 21 for Oτi ). Corollary 59 Let S ⊆ Στ and i ≥ 0. We have  [ φ ⋆ µ ∈ Στ , v ∈ dom(τ ) i αi+1 (S) = {o.π} ∪ α (o.φ ⋆ µ) . τ F (k(o.π)) φ(v) ∈ Loc, o = µφ(v) main.tex; 27/12/2017; 15:18; p.32 33 Proof. By Definitions 58 and 21. ✷ Lemma 60 states that αiτ (and hence also αEτ itself) yields sets of creation points that do not contain garbage. Lemma 60 Let σ ∈ Στ and i ∈ N. Then αiτ (σ) = δτi αiτ (σ). Proof. By reductivity (Proposition 27), we have αiτ (σ) ⊇ δτi αiτ (σ). It remains to prove αiτ (σ) ⊆ δτi αiτ (σ). Let σ = φ ⋆ µ. We proceed by induction on i. We have α0τ (σ) = ∅ = δτ0 α0τ (σ). Assume that the property holds for a given i ∈ N. Let τ ′ = F (k(o.π)) and X = {µφ(v) | v ∈ dom(φ) and φ(v) ∈ Loc}. By Corollary 59, i αi+1 τ (σ) = ∪{{o.π} ∪ ατ ′ (o.φ ⋆ µ) | o ∈ X} (inductive hypothesis) = ∪{{o.π} ∪ δτi ′ αiτ ′ (o.φ ⋆ µ) | o ∈ X} . (2) By Corollary 59, we have αiτ ′ (o.φ ⋆ µ) ⊆ αi+1 τ (σ) and, by Proposition 27, (2) is contained in ∪{{o.π} ∪ δτi ′ αi+1 τ (σ) | o ∈ X} . (3) Note that, given o ∈ X, we can always find κ ∈ rng(τ ) ∩ K such that k(o.π) ≤ κ. Indeed, for the definition of X, there exists v ∈ dom(φ) = dom(τ ) such that φ(v) ∈ Loc and o = µφ(v). By Definition 11, we have τ (v) ∈ K. By Definition 14, we have k(o.π) = k((µφ(v)).π) ≤ τ (v). Hence letting κ = τ (v), (3) is   o ∈ X, κ ∈ rng(τ ) ∩ K i i+1 ∪ {o.π} ∪ δτ ′ ατ (σ) k(o.π) ≤ κ   π ∈ αi+1 (σ), κ ∈ rng(τ ) ∩ K i i+1 τ (Corollary 59) ⊆ ∪ {π} ∪ δτ ′ ατ (σ) k(π) ≤ κ (Definition 25) = δτi+1 αi+1 τ (σ) . Note that the last step is correct since if this ∈ dom(τ ) we have φ(this) 6= null (Definition 16). Hence (µφ(this)).π ∈ αi+1 τ (σ) and k((µφ(this)).π) ≤ τ (this) (Definition 13). We conclude that, if this ∈ ✷ dom(τ ), then there exists π ∈ αi+1 τ (σ) such that k(π) ≤ τ (this). Let e be a set of creation points. We now define frames and memories which use all possible creation points in e allowed by the type environment of the variables. In this sense, they are the richest frames and memories containing creation points from e only. main.tex; 27/12/2017; 15:18; p.33 34 Definition 61 Let {π1 , . . . , πn } be an enumeration without repetitions of Π. Let l1 , . . . , ln be distinct locations. Let e ⊆ Π and w ∈ dom(τ ) such that τ (w) ∈ K. We define Lτ (e, w) = {li | 1 ≤ i ≤ n,     φτ (e) = φ ∈ Frame τ     µ(e) = µ ∈ Memory πi ∈ e and k(πi ) ≤ τ (w)} , for every v ∈ dom(τ ) τ (v) = int ⇒ φ(v) = 0 τ (v) ∈ K, Lτ (e, v) = ∅ ⇒ φ(v) = null τ (v) ∈ K, Lτ (e, v) 6= ∅ ⇒ φ(v) ∈ Lτ (e, v)  µ = [l1 7→ π1 ⋆ φ1 , . . . , ln 7→ πn ⋆ φn ] . and φi ∈ φF (k(πi )) (e) for i = 1, . . . , n        We prove now some properties of the frames and memories of Definition 61. Lemma 62 Let e1 , e2 ⊆ Π, φ ∈ φτ (e1 ) and µ ∈ µ(e2 ). Then i) φ ⋆ µ : τ ; ii) φ ⋆ µ ∈ Στ iff this 6∈ dom(τ ) or there exists π ∈ e1 s.t. k(π) ≤ τ (this); iii) If φ ⋆ µ ∈ Στ then ατ (φ ⋆ µ) ⊆ e1 ∪ e2 . Proof. i) Condition 1 of Definition 14 is satisfied since we have that rng(φ) ∩ Loc ⊆ {l1 , . . . , ln } = dom(µ). Moreover, if v ∈ dom(φ) and φ(v) ∈ Loc then φ(v) ∈ Lτ (e1 , v). Thus there exists 1 ≤ i ≤ n such that φ(v) = li , (µφ(v)).π = πi and k((µφ(v)).π) = k(πi ) ≤ τ (v). Condition 2 of Definition 14 holds because if o ∈ rng(µ) then o.φ = φi for some 1 ≤ i ≤ n. Since φi ∈ φF (k(πi )) (e), reasoning as above we conclude that φi is F (k(πi ))-correct w.r.t. µ. Then φ ⋆ µ : τ . ii) By point i, we know that φ ⋆ µ : τ . From Definition 16, we have φ ⋆ µ ∈ Στ if and only if this 6∈ dom(τ ) or φ(this) 6= null . By Definition 61, the latter case holds if and only if Lτ (e1 , this) 6= ∅ i.e., if and only if there exists π ∈ e1 such that k(π) ≤ τ (this). iii) Since φ ⋆ µ ∈ Στ , the ατ map is defined (Definition 22). Let L = (rng(φ) ∪ (∪{rng(o.φ) | o ∈ rng(µ)})) ∩ Loc . Since φ ∈ φτ (e1 ) and o.φ ∈ φF (k(o.π)) (e2 ) for every o ∈ rng(µ), by Definition 61, we have {µ(l).π | l ∈ L} ⊆ e1 ∪ e2 . main.tex; 27/12/2017; 15:18; p.34 , 35 By Definition 22, we conclude that ατ (φ ⋆ µ) ⊆ {µ(l).π | l ∈ L} ⊆ e1 ∪ e2 . ✷ Lemma 63 gives an explicit definition of the abstraction of the set of states constructed from the frames and memories of Definition 61. Lemma 63 Let e1 , e2 ⊆ Π, j ∈ N and Aj = αj+1 τ ({φ ⋆ µ ∈ Στ | φ ∈ φτ (e1 ) and µ ∈ µ(e2 )}) . Then Aj =  ∅     if this ∈ dom(τ ) and there is no π ∈ e1 s.t. k(π) ≤ τ (this) ) (  v ∈ dom(τ ), τ (v) ∈ K j   ∪ {π} ∪ δF (k(π)) (e2 ) π ∈ e1 , k(π) ≤ τ (v) otherwise. Proof. We proceed by induction over j. By Lemma 62.ii, if j = 0 we have  ∅ if this ∈ dom(τ ) and there is no π ∈ e1 s.t. k(π) ≤ τ (this)     ) A0 = (  φ ∈ φ (e ), µ ∈ µ(e ), v ∈ dom(φ) 2  τ 1  otherwise.  o.π φ(v) ∈ Loc, o = µφ(v) By Definition 61, the latter case is equal to    v ∈ dom(τ )   v ∈ dom(τ ), τ (v) ∈ K    τ (v) ∈ K π 1 ≤ i ≤ n, πi ∈ e1 = ∪ {π} ∪ δF0 (k(π)) (e2 ) π ∈ e1   i   k(πi ) ≤ τ (v)  k(π) ≤ τ (v)        Assume now that the result holds for a given j ∈ N. If this ∈ dom(τ ) and there is no π ∈ e1 such that k(π) ≤ τ (this), by Lemma 62.ii, we have Aj+1 = ∅. Otherwise, by Corollary 59 we have   φ ∈ φτ (e1 ), µ ∈ µ(e2 )   Aj+1 = ∪ {o.π}∪αj+1 . (4) F (k(o.π)) (o.φ ⋆ µ) v ∈ dom(φ)   φ(v) ∈ Loc, o = µφ(v) main.tex; 27/12/2017; 15:18; p.35 . 36 As for the base case, we know that o.π ranges over {π ∈ e1 | v ∈ dom(τ ), τ (v) ∈ K, k(π) ≤ τ (v)}. Since o.φ ∈ φF (k(o.π)) (e2 ) is arbitrary (Definition 61), by the inductive hypothesis, (4) becomes   v ∈ dom(τ )         φ ∈ φF (k(π)) (e2 ) τ (v) ∈ K j+1 ∪ {π} ∪ αF (k(π)) φ⋆µ π ∈ e1  µ ∈ µ(e2 )      k(π) ≤ τ (v) = ∪ {{π} ∪ δFj+1 (k(π)) (e2 ) | v ∈ dom(τ ), τ (v) ∈ K, π ∈ e1 , k(π) ≤ τ (v)}. ✷ Corollary 64 Let e1 , e2 ⊆ Π. Let Aτ (e1 , e2 ) = ατ ({φ ⋆ µ ∈ Στ | φ ∈ φτ (e1 ) and µ ∈ µ(e2 )}) . Then i) Aτ (e1 , e2 ) =  ∅          if this ∈ dom(τ ) and no π ∈ e1 is s.t. k(π) ≤ τ (this) ) (  v ∈ dom(φ), τ (v) ∈ K   ∪ {π} ∪ δF (k(π)) (e2 )    π ∈ e1 , k(π) ≤ τ (v)    otherwise, ii) Aτ (e1 , e1 ) = δτ (e1 ). Proof. Point i follows by Lemma 63 since j is arbitrary. Point ii follows from point i and Definition 25. ✷ Corollary 65 Let κ ∈ K, τ = [res 7→ κ], p be a predicate over Π and e ⊆ Π be such that there exists π ∈ e such that k(π) ≤ τ (res) and p(π) holds. Then ατ ({φ ⋆ µ ∈ Στ | φ ∈ φτ (e), µ ∈ µ(e), p(µφ(res).π)}) = ∪{{π} ∪ δF (k(π)) (e) | π ∈ e, k(π) ≤ τ (res), p(π)} . Proof. Let j ∈ N. By the hypothesis on e and Corollary 59 we have αj+1 τ ({φ ⋆ µ ∈ Στ | φ ∈ φτ (e), µ ∈ µ(e), p(µφ(res).π)})   φ ∈ φτ (e), µ ∈ µ(e) j = ∪ {o.π} ∪ αF (k(o.π)) (o.φ ⋆ µ) o = µφ(res), p(o.π)   π ∈ e, k(π) ≤ τ (res), p(π) j ′ . = ∪ {π} ∪ αF (k(π)) (φ ⋆ µ) ′ φ ∈ φF (k(π)) (e), µ ∈ µ(e) main.tex; 27/12/2017; 15:18; p.36 37 Since j is arbitrary we have ατ ({φ ⋆ µ ∈ Στ | φ ∈ φτ (e), µ ∈ µ(e), p(µφ(res).π)})     φ′ ∈ φF (k(π)) (e) π ∈ e, p(π) ′ = ∪ {π} ∪ αF (k(π)) φ ⋆µ , k(π) ≤ τ (res) µ ∈ µ(e) and the thesis follows by Corollary 64.ii. ✷ Proposition 28. Let δ(τ ) be an abstract garbage collector. Then we have fp(δτ ) = rng(αEτ ) and ∅ ∈ fp(δτ ). Moreover, if this ∈ dom(τ ), then for every X ⊆ Στ we have αEτ (X) = ∅ if and only if X = ∅. Proof. We first prove that fp(δτ ) = rng(ατ ). Let X ⊆ Στ and i ∈ N. By Lemma 60 and monotonicity (Proposition 27) we have αiτ (X) = ∪{αiτ (σ) | σ ∈ X} = ∪{δτi αiτ (σ) | σ ∈ X} ⊆ δτi αiτ (X) ⊆ δτ αiτ (X) . The converse inclusion αiτ (X) ⊆ δτ αiτ (X) holds because δτ is reductive (Proposition 27). Then αiτ (X) ∈ fp(δτ ). Since i is arbitrary we have ατ (X) ∈ fp(δτ ). Conversely, let e ∈ fp(δτ ). Consider the set of states constructed from the frames and memories in Definition 61 and let X = {φ ⋆ µ ∈ Στ | φ ∈ φτ (e), µ ∈ µ(e)} . By Corollary 64.ii and since e ∈ fp(δτ ), we have ατ (X) = δτ (e) = e. Since δτ is reductive (Proposition 27), we have ∅ = δτ (∅) i.e., ∅ ∈ fp(δτ ). If this ∈ dom(τ ), every σ ∈ Στ is such that ατ (σ) 6= ∅, since this cannot be unbound (Definition 16). Then ατ (X) = ∅ if and only if X = ∅. The proof of Proposition 32 requires some preliminary results. Corollary 66 states that if we know that the approximation of a set of concrete states S is some e ⊆ Π, then we can conclude that a better approximation of S is δ(e). In other words, garbage is never used in the approximation. Corollary 66 Let S ⊆ Στ and e ⊆ Π. Then ατ (S) ⊆ δτ (e) if and only if ατ (S) ⊆ e. Proof. Assume that ατ (S) ⊆ δτ (e). By reductivity (Proposition 27) we have ατ (S) ⊆ e. Conversely, assume that ατ (S) ⊆ e. By Proposition 28 and monotonicity (Proposition 27) we have ατ (S) = δτ ατ (S) ⊆ δτ (e). ✷ main.tex; 27/12/2017; 15:18; p.37 38 Lemma 67 states that integer values, null and the name of the variables are not relevant to the definition of α (Definition 22). Lemma 67 Let φ′ ⋆ µ ∈ Στ ′ and φ′′ ⋆ µ ∈ Στ ′′ such that rng(φ′ ) ∩ Loc = rng(φ′′ ) ∩ Loc. Then ατ ′ (φ′ ⋆ µ) = ατ ′′ (φ′′ ⋆ µ). Proof. From Definition 22. ✷ Lemma 68 says that if we consider all the concrete states approximated by some e ⊆ Π and we restrict their frames, then the resulting set of states is approximated by δ(e). In other words, the operation δ garbage collects all objects that, because of the restriction, are not longer reachable. Lemma 68 Let vs ⊆ dom(τ ). Then ατ |−vs ({φ|−vs ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) = δτ |−vs (e) . Proof. We have ατ |−vs ({φ|−vs ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) = ατ |−vs ({φ|−vs ⋆ µ ∈ Στ |−vs | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) , (5) since if φ ⋆ µ ∈ Στ then φ|−vs ⋆ µ ∈ Στ |−vs . We have that if ατ (φ ⋆ µ) ⊆ e then ατ |−vs (φ|−vs ⋆ µ) ⊆ e. Hence (5) is contained in e. By Corollary 66, (5) is also contained in δτ |−vs (e). But also the converse inclusion holds, since in (5) we can restrict the choice of φ ⋆ µ ∈ Στ , so that (5) contains   φ ⋆ µ ∈ Στ , ατ (φ ⋆ µ) ⊆ e . (6) ατ |−vs φ|−vs ⋆ µ ∈ Στ |−vs φ ∈ φτ (e), µ ∈ µ(e) By points ii and iii of Lemma 62, (6) is equal to ατ |−vs ({φ|−vs ⋆ µ ∈ Στ |−vs | φ ∈ φτ (e), µ ∈ µ(e)}) (Definition 61) = ατ |−vs ({φ ⋆ µ ∈ Στ |−vs | φ ∈ φτ |−vs (e) and µ ∈ µ(e)}) (Corollary 64.ii) = δτ |−vs (e) . ✷ We are now ready to prove the correctness and optimality of the abstract operations in Figure 9. Proposition 31. The map αEτ (Definition 22) is the abstraction map of a Galois insertion from ℘(Στ ) to Eτ . main.tex; 27/12/2017; 15:18; p.38 39 Proof. By the theory of abstract interpretation [10], given e ∈ Eτ , the concretisation map induced by the abstraction map of Definition 22 is γτ (e) = {σ ∈ Στ | ατ (σ) ⊆ e} . Moreover, the optimal abstract counterpart of a concrete operation op is αopγ. We consider every operation in Figure 8 and we compute the induced optimal abstract operation, which will always coincide with that reported in Figure 9. Note that all the operations in Figure 8 use states in Στ with this ∈ dom(τ ) (Figure 7). By Proposition 28 we have γτ (∅) = ∅. Then the powerset extension of the operations in Figure 8 are strict on ∅. The only exception is the second argument of return, which is a state whose frame is not required to contain this (Figure 7). The operation ∪ is not the powerset extension of an operation in Figure 8. Then it is not strict in general. Hence, in the following, we will consider just the cases when the arguments of the abstract counterparts of the operations in Figure 8 are not ∅ (except for the second argument of return and for ∪). In this proof, we will use the following properties. P1 If e ∈ Eτ , e 6= ∅ and this ∈ dom(τ ) then there exists π ∈ e such that k(π) ≤ τ (this). P2 If e ∈ Eτ , e 6= ∅ and this ∈ dom(τ ) then there exists σ ∈ Στ such that ατ (σ) ⊆ e. P3 ατ γτ is the identity map. P1 holds since e = δτ (e) (Definition 29) so that by Definition 25, we can conclude that there exists such a π. To see that P2 is a consequence of P1, let π be as defined in P1; then, letting σ = [this 7→ l] ⋆[l 7→ π ⋆ ℑ(F (k(π)))] for some l ∈ Loc, we have σ ∈ Στ . Moreover, by Definition 22, ατ (σ) = {π} ⊆ e so that P2 holds. By Proposition 31, ατ is a Galois insertion and hence, P3 holds. nop By P3 we have ατ (nopτ (γτ (e))) = ατ γτ (e) = e . main.tex; 27/12/2017; 15:18; p.39 40 get int, get null, get var ατ [res7→int] (get intiτ (γτ (e))) = ατ [res7→int] ({φ[res 7→ i] ⋆ µ | φ ⋆ µ ∈ γτ (e)}) (∗) = ατ ({φ ⋆ µ ∈ Στ | φ ⋆ µ ∈ γτ (e)}) = ατ γτ (e) = e , where ∗ follows by Lemma 67 since res 6∈ dom(τ ). For the same reason, point ∗ follows if res is bound to null or to some φ(v) with v ∈ dom(τ ). Thus the proof above is also a proof of the optimality of get null and of get var. expand ατ [v7→t] (expandv:t τ (γτ (e))) = ατ [v7→t] ({φ[v 7→ ℑ(t)] ⋆ µ | φ ⋆ µ ∈ γτ (e)}) (∗) = ατ ({φ ⋆ µ ∈ Στ | φ ⋆ µ ∈ γτ (e)}) = ατ γτ (e) = e , where point ∗ follows by Lemma 67, since ℑ(t) ∈ {0, null } and v 6∈ dom(τ ). restrict ατ |−vs (restrictvs τ (γτ (e))) = ατ |−vs (restrictvs τ ({σ ∈ Στ | ατ (σ) ⊆ e})) = ατ |−vs ({φ|−vs ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) (Lemma 68) = δτ |−vs (e) . is null ατ [res7→int] (is nullτ (γτ (e))) = ατ [res7→int] (is nullτ ({σ ∈ Στ | ατ (σ) ⊆ e}))   φ ⋆ µ ∈ Στ = ατ [res7→int] φ[res 7→ 1] ⋆ µ ατ (φ ⋆ µ) ⊆ e (Lemma 67) = ατ |−res ({φ|−res ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) (Lemma 68) = δτ |−res (e) (Definition 25) = δτ [res7→int] (e) . main.tex; 27/12/2017; 15:18; p.40 41 put var ατ |−res (put varτ (γτ (e))) = ατ |−res (put varτ ({σ ∈ Στ | ατ (σ) ⊆ e})) = ατ |−res ({φ[v 7→ φ(res)]|−res ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) . (7) Observe that rng(φ[v 7→ φ(res)]|−res ) = rng(φ|−v ) so that, by Lemmas 67 and 68, (7) is equal to ατ |−v ({φ|−v ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ e}) = δτ |−v (e) . call 1 ,...,vn (γτ (e))) αP (ν)|−out (callν,v τ 1 ,...,vn ({σ ∈ Στ | ατ (σ) ⊆ e})) = αP (ν)|−out (callν,v τ     ι1 7→ φ(v1 ),          .. φ ⋆ µ ∈ Σ and     τ . = αP (ν)|−out    ⋆µ α (φ ⋆ µ) ⊆ e    ιn 7→ φ(vn ),   τ      this 7→ φ(res)  (∗) = ατ |{v 1 ,...,vn ,res} (∗∗) = δτ |{v 1 ,...,vn ,res} ({φ|{v1 ,...,vn ,res} ⋆ µ | φ ⋆ µ ∈ Στ , ατ (φ ⋆ µ) ⊆ e}) (e) , where point ∗ follows by Lemma 67 and point ∗∗ follows by Lemma 68. is true, is false ατ (is trueτ (γτ (e))) = ατ ({φ ⋆ µ ∈ γτ (e) | φ(res) ≥ 0}) (Lemma 67) = ατ γτ (e) = e . The optimality of is false follows by a similar proof. new main.tex; 27/12/2017; 15:18; p.41 42 Let κ = k(π). Since res 6∈ dom(τ ) we have ατ [res7→κ] (newπτ (γτ (e))) = ατ [res7→κ] (newπτ ({σ ∈ Στ | ατ (σ) ⊆ e}))   φ[res 7→ l] ⋆ φ ⋆ µ ∈ Στ , ατ (φ ⋆ µ) ⊆ e = ατ [res7→κ] ⋆ µ[l 7→ π ⋆ ℑ(F (κ))] l ∈ Loc \ dom(µ) = ατ ({φ ⋆ µ ∈ Στ | ατ (φ ⋆ µ) ⊆ e})∪ (8)   [res 7→ l] ⋆ φ ⋆ µ ∈ Στ , ατ (φ ⋆ µ) ⊆ e ∪ α[res7→κ] . ⋆[l 7→ π ⋆ ℑ(F (κ))] l ∈ Loc \ dom(µ) (9) We have that (8) is equal to e. By P2 and Definition 22, (9) is equal to {π}. =, + ατ (=τ (γτ (e1 ))(γτ (e2 ))) = ατ ({=τ (σ1 )(σ2 ) | σ1 ∈ γτ (e1 ), σ2 ∈ γτ (e2 )}) (P2) = ατ ({σ2 | σ2 ∈ γτ (e2 )}) = ατ γτ (e2 ) = e2 . The optimality of + follows by a similar proof. return Let τ ′ = τ [res 7→ P (ν)(out)], τ ′′ = P (ν)|out and L = rng(φ1 |−res )∩Loc. ατ ′ (returnντ (γτ (e1 ))(γτ ′′ (e2 ))) = ατ ′ (returnντ ({σ1 ∈ Στ | ατ (σ1 ) ⊆ e1 })({σ2 ∈ Στ ′′ | ατ ′′ (σ2 ) ⊆ e2 }))            φ ⋆ µ ∈ Σ   1 1 τ        φ2 ⋆ µ2 ∈ Στ ′′      = ατ ′  φ1 |−res [res 7→ φ2 (out)] ⋆ µ2 ατ (φ1 ⋆ µ1 ) ⊆ e1     ατ ′′ (φ2 ⋆ µ2 ) ⊆ e2            µ1 = L µ2     {z } | Cond (∗) = ατ |−res ({φ1 |−res ⋆ µ2 | Cond})∪ ∪ ατ ′′ ({φ2 ⋆ µ2 | Cond}) (10) (11) where point ∗ follows by Lemma 67. Since ατ ′′ (φ2 ⋆ µ2 ) ⊆ e2 , an upper bound of (11) is e2 . But e2 is also a lower bound of (11) since, by main.tex; 27/12/2017; 15:18; p.42 43 Lemma 62.iii, a lower bound of (11) is ατ ′′   φ ∈ φτ (e1 ), µ1 ∈ µ(e1 ) φ2 ⋆ µ2 1 φ2 ∈ φτ ′′ (e2 ), µ2 ∈ µ(e2 ) which by Corollary 64.ii is equal to e2 . Note that the condition µ1 =L µ2 is satisfied by Definition 61. Instead (10) is    v ∈ dom(φ1 |−res )  ∪ {o.π} ∪ αF (k(o.π)) (o.φ ⋆ µ2 ) φ1 |−res (v) ∈ Loc   o = µ2 φ1 |−res (v), Cond which, since µ1 =L µ2 , is equal to    v ∈ dom(φ1 |−res )  ∪ {o.π}∪αF (k(o.π)) (o.φ ⋆ µ2 ) φ1 |−res (v) ∈ Loc   o = µ1 φ1 |−res (v), Cond   v ∈ dom(φ1 |−res ), φ1 |−res (v) ∈ Loc (∗) ⊆ ∪ {o.π} ∪ δF (k(o.π)) (Π) o = µ1 φ1 |−res (v), Cond   κ ∈ rng(τ |−res ) ∩ K (∗∗) ⊆ ∪ {π} ∪ δF (k(π)) (Π) π ∈ e1 , k(π) ≤ κ, Cond   κ ∈ rng(τ |−res ) ∩ K ⊆ ∪ {π} ∪ δF (k(π)) (Π) , (12) π ∈ e1 , k(π) ≤ κ where point ∗ follows by Lemma 60 and point ∗∗ holds since Cond requires that ατ (φ1 ⋆ µ1 ) ⊆ e1 . But (12) is also a lower bound of (10), since (10) contains   φ1 ∈ φτ (e1 ), µ1 ∈ µ(e1 ), ατ |−res φ1 |−res ⋆ µ2 ∈ Στ |−res φ2 = ℑ(P (ν)|out ), µ2 ∈ µ(Π) = ατ |−res ({φ ⋆ µ ∈ Στ |−res | φ ∈ φτ |−res (e1 ), µ ∈ µ(Π)}) , which by Corollary 64.i is equal to (12). get field Let τ ′ = τ [res 7→ F (τ (res))(f )] and τ ′′ = [res 7→ F (τ (res))(f )]. We main.tex; 27/12/2017; 15:18; p.43 44 have ατ ′ (get fieldfτ (γτ (e))) = ατ ′ (get fieldfτ ({φ ⋆ µ ∈ Στ | ατ (φ ⋆ µ) ⊆ e}))   φ ⋆ µ ∈ Στ   = ατ ′  φ|−res [res 7→ (µφ(res)).φ(f )] ⋆ µ φ(res) 6= null,    ατ (φ ⋆ µ) ⊆ e = ατ |−res ({φ|−res ⋆ µ | φ ⋆ µ ∈ Στ , φ(res) 6= null , ατ (φ ⋆ µ) ⊆ e})∪   φ ⋆ µ ∈ Στ   ∪ ατ ′′  [res 7→ (µφ(res)).φ(f )] ⋆ µ φ(res) 6= null ,  . (13)   ατ (φ ⋆ µ) ⊆ e (13) is equal to ∅ if {π ∈ e | k(π) ≤ τ (res)} = ∅, since in such a case the condition φ(res) 6= null cannot be satisfied. Since ατ (φ ⋆ µ) ⊆ e, an upper bound of (13) is e. By Corollary 66, also δτ ′ (e) is an upper bound of (13). But it is also a lower bound of (13), since, from the hypothesis on e and from points ii and iii of Lemma 62, (13) contains ατ |−res ({φ|−res ⋆ µ ∈ Στ |−res | φ ∈ φτ (e), µ ∈ µ(e)})∪ ∪ ατ ′′ ({[res 7→ (µφ(res)).φ(f )] ⋆ µ ∈ Στ ′′ | φ ∈ φτ (e), µ ∈ µ(e)}) (∗) = ατ |−res ({φ ⋆ µ ∈ Στ |−res | φ ∈ φτ |−res (e), µ ∈ µ(e)})∪ ∪ ατ ′′ ({φ ⋆ µ ∈ Στ ′′ | φ ∈ φτ ′′ (e), µ ∈ µ(e)}) (∗∗) = δτ |−res (e) ∪ δτ ′′ (e) = δτ ′ (e) , where point ∗ follows by Definition 61 and point ∗∗ follows by Corollary 64.ii. lookup ατ (lookupm,ν τ (γτ (e))) = ατ (lookupm,ν τ ({φ ⋆ µ ∈ Στ | ατ (φ ⋆ µ) ⊆ e}))           ατ (φ ⋆ µ) ⊆ e, φ(res) 6= null   = ατ  φ ⋆ µ ∈ Στ . M (k((µφ(res)).π))(m) = ν        | {z }   (14) Cond Equation (14) is equal to ∅ if there is no π ∈ e such that k(π) ≤ τ (res) and M (π)(m) = ν, because in such a case it is not possible to satisfy the condition M (k((µφ(res )).π))(m) = ν. Otherwise, it is equal to ατ |−res ({φ|−res ⋆ µ | φ ⋆ µ ∈ Στ , Cond})∪ (15) ∪ ατ |res ({φ|res ⋆ µ | φ ⋆ µ ∈ Στ , Cond}) . (16) main.tex; 27/12/2017; 15:18; p.44 45 Since Cond requires that ατ (φ ⋆ µ) ⊆ e, by Corollary 66 an upper bound of (15) is δτ |−res (e). But it is also a lower bound of (15), since a lower bound of (15) is   φ ∈ φτ (e), µ ∈ µ(e)     ατ |−res φ| ⋆ µ ∈ Στ |−res φ(res) 6= null  −res  M (k((µφ(res )).π))(m) = ν (∗) = ατ |−res ({φ ⋆ µ ∈ Στ |−res | φ ∈ φτ |−res (e), µ ∈ µ(e)}) (∗∗) = δτ |−res (e) . Point ∗ follows from the hypothesis on e. Point ∗∗ follows by Corollary 64.ii. Instead, (16) is contained in   φ ∈ φτ (e), µ ∈ µ(e) ατ |res φ|res ⋆ µ ∈ Στ |res M (k((µφ(res )).π))(m) = ν   φ ∈ φτ |res (e), µ ∈ µ(e) = ατ |res φ ⋆ µ ∈ Στ |res , M (k((µφ(res)).π))(m) = ν which, by Corollary 65, is ∪{{π} ∪ δF (k(π)) (e) | π ∈ e, k(π) ≤ τ (res), M (k(π))(m) = ν} . put field ατ |−res (put fieldτ,τ ′ (γτ (e1 ))(γτ (e2 ))) = ατ |−res (put fieldτ,τ ′ ({σ1 ∈ Στ | ατ (σ1 ) ⊆ e1 }) ({σ2 ∈ Στ ′ | ατ ′ (σ2 ) ⊆ e2 }))  φ1 ⋆ µ1 ∈ Στ     φ  2 ⋆ µ2 ∈ Σ τ ′   φ2 |−res ⋆ µ2 [l 7→ µ2(l).π ⋆ ατ (φ1 ⋆ µ1 ) ⊆ e1 = ατ |−res  ⋆ µ2 (l).φ[f 7→ φ2 (res)]] ατ ′ (φ2 ⋆ µ2 ) ⊆ e2    (l = φ1 (res)) 6= null    µ1 = l µ2            (17)           which is ∅ if there is no π ∈ e1 such that k(π) ≤ τ (res), since in such a case the condition φ1 (res) 6= null cannot be satisfied. Otherwise, note that the operation put field copies the value of φ2 (res), which is obviously reachable from φ2 , inside a field. Since ατ ′ (φ2 ⋆ µ2 ) ⊆ e2 , we conclude that an upper bound of (17) is e2 . Then δτ |−res (e2 ) is also an upper bound of (17) (Corollary 66). We show that it is also a lower bound. Let π1 ∈ e1 be such that k(π1 ) ≤ τ (this) (possible for P1) and main.tex; 27/12/2017; 15:18; p.45 46 π2 ∈ e1 be such that k(π2 ) ≤ τ (res) (possible for the hypothesis on e1 ). Let o1 = π1 ⋆ ℑ(F (k(π1 ))) and o2 = π2 ⋆ ℑ(F (k(π2 ))). We obtain the following lower bound of (17) by choosing special cases for φ1 , µ1 , φ2 and µ2 :   φ = ℑ(τ )[this → 7 l , res → 7 l ]   1 1 2    ′ ∈ µ(e )    (e ), µ φ φ ∈   ′ 2 2 2 τ 2  φ2 |−res ⋆µ2 [l2 7→ µ2 (l2 ).π ⋆  ′ . ατ |−res  ⋆ µ2 (l2 ).φ[f 7→ φ2 (res)]] φ2 ⋆ µ2 ∈ Στ ′′     µ = µ = µ [l → 7 o , l → 7 o ]   1 2 1 2 2  2 1    l1 , l2 ∈ Loc \ dom(µ′2 ), l1 6= l2 (18) Since l2 is not used in φ2 nor in µ′2 , (18) becomes   φ2 ∈ φτ ′ (e2 ) ατ |−res φ2 |−res ⋆ µ2 ∈ Στ |−res µ2 ∈ µ(e2 ) (Definition 61) = ατ |−res ({φ ⋆ µ ∈ Στ |−res | φ ∈ φτ |−res (e2 ), µ ∈ µ(e2 )}) (Lemma 63) = δτ |−res (e2 ) . ∪ By additivity (Proposition 31), the best approximation of ∪ over ℘(Στ ) is ∪ over ℘(Π). B. Proofs of Propositions 46, 47, 50 and 56 in Section 5. Proposition 46. The abstract garbage collector ξτ is an lco. Proof. By Definition 44, the map ξτ is reductive and monotonic. For idempotency, we have ξτ ξτ (⊥) = ⊥ = ξτ (⊥). Let s ∈ Frame ER τ × ER Memory . If this ∈ dom(τ ) and φ(this) = ∅ then ξτ ξτ (s) = ⊥ = ξτ (⊥). Otherwise, we prove that ρτ ξτ (s) = ρτ (s), which entails the thesis by Definition 44. We have ρτ ξτ (φ ⋆ µ) = ρτ (φ ⋆ ∪{µ|dom(F (k(π′ ))) | π ′ ∈ ρτ (φ ⋆ µ)}) = {π ∈ φ(v) | v ∈ dom(τ ), τ (v) ∈ K} ∪   π ′ ∈ ρτ (φ ⋆ µ), f ∈ dom(F (k(π ′ ))) ∪ π ∈ µ(f ) F (k(π ′ ))(f ) ∈ K = ρτ (φ ⋆ µ). ✷ main.tex; 27/12/2017; 15:18; p.46 47 To prove Proposition 47, we need some preliminary definitions and results. Let s ∈ Frame ER × Memory ER . We define frames and memories τ which use all possible creation points allowed by s. ER Definition 69 Let φ ∈ Frame ER and l : Π 7→ Loc be τ , µ ∈ Memory one-to-one. We define   for every v ∈ dom(τ )       ♭ (v) = 0 if τ (v) = int then φ ♭ , φτ = φ ∈ Frame τ if τ (v) ∈ K and φ(v) = ∅ then φ♭ (v) = null       if τ (v) ∈ K and φ(v) 6= ∅ then φ♭ (v) ∈ lφ(v)   dom(µ♭ ) = rng(l), µ♭ (l(π)) = π ⋆ φ♭π µ = µ♭ ∈ Memory . with φ♭π ∈ µF (π) for every π ∈ Π Lemma 70 is needed in the proof of Lemma 71. ER Lemma 70 Let φ ∈ Frame ER , φ♭ ∈ φτ and µ♭ ∈ µ. τ , µ ∈ Memory ♭ ♭ Then ετ (φ ⋆ µ ) ⊆ φ. Proof. For every v ∈ dom(τ ) we have   if τ (v) = int ∗ ♭ ♭ ♭ ♭ ετ (φ ⋆ µ )(v) = {(µ φ (v)).π} if τ (v) ∈ K and φ♭ (v) ∈ Loc   ∅ otherwise   if τ (v) = int ∗ (Definition 69) = {µ♭ (l(π ′ )).π} if τ (v) ∈ K, φ♭ (v) ∈ Loc, π ′ ∈ φ(v)   ∅ otherwise   if τ (v) = int ∗ ′ = {π } if τ (v) ∈ K, φ♭ (v) ∈ Loc, π ′ ∈ φ(v)   ∅ otherwise ⊆ φ(v) . ✷ We prove now some properties of the frames and memories of Definition 69. ER Lemma 71 Let φ ∈ Frame ER , φ♭ ∈ φτ and µ♭ ∈ µ. τ , µ ∈ Memory Then i) φ♭ ⋆ µ♭ : τ ; main.tex; 27/12/2017; 15:18; p.47 48 ii) φ♭ ⋆ µ♭ ∈ Στ if and only if this 6∈ dom(τ ) or φ(this) 6= ∅; iii) If φ♭ ⋆ µ♭ ∈ Στ then ατ (φ♭ ⋆ µ♭ ) ⊆ φ ⋆ µ. Proof. i) Condition 1 of Definition 14 holds since rng(φ♭ ) ∩ Loc ⊆ rng(l) = dom(µ♭ ). Moreover, if v ∈ dom(φ♭ ) and φ♭ (v) ∈ Loc then φ♭ (v) ∈ lφ(v). Thus there exists π ∈ φ(v) with (µ♭ φ♭ (v)).π = π and such that k((µ♭ φ♭ (v)).π) = k(π) ≤ τ (v). Condition 2 holds since if o ∈ rng(µ♭ ) then o.φ = φ♭π for some π ∈ Π. Since φ♭π ∈ µF (k(π)) , reasoning as above we have that φ♭π is weakly F (k(π))-correct w.r.t. µ♭ . Then φ♭ ⋆ µ♭ : τ . ii) By point i, we know that φ♭ ⋆ µ♭ : τ . From Definition 16, we have φ♭ ⋆ µ♭ ∈ Στ if and only if this 6∈ dom(τ ) or φ♭ (this) 6= null . By Definition 69, the latter case holds if and only if φ(this) 6= ∅. iii) By Definition 41 we have ατ (φ♭ ⋆ µ♭ ) = ετ (φ♭ ⋆ µ♭ ) ⋆ ετ ({o.φ ⋆ µ♭ | o ∈ Oτ (φ♭ ⋆ µ♭ )}) (Lemma 70) ⊆ φ ⋆ ετ ({o.φ ⋆ µ♭ | o ∈ Oτ (φ♭ ⋆ µ♭ )}) . By Definition 69, for every o ∈ Oτ (φ♭ ⋆ µ♭ ) we have o.φ ∈ µF (k(π)) and hence o.φ ⊆ φ′ with φ′ ∈ µτ . Then we have ετ (o.φ ⋆ µ♭ ) ⊆ ετ (φ′ ⋆ µ♭ ), which by Lemma 70 is contained in µ. ✷ Lemma 72 states that, given an abstract state s, if a creation point π belongs to ρi (s) then there is a concrete state σ from those in Definition 69 and an object in O i (σ) created in π, and vice versa. In other words, ρi (s) collects all and only the creation points of the objects which can ever be reached in a concrete state approximated by s. Lemma 72 Let φ ∈ Frame ER be such that if this ∈ dom(τ ) then τ φ(this) 6= ∅, µ ∈ Memory ER and i ∈ N. Then π ∈ ρiτ (φ ⋆ µ) if and only if there exist φ♭ ∈ φτ and µ♭ ∈ µ such that π = o.π for a suitable o ∈ Oτi (φ♭ ⋆ µ♭ ). Proof. We proceed by induction on i. If i = 0 the result holds since ρ0τ (φ ⋆ µ) = ∅ and for every φ♭ ∈ φτ and µ ∈ µ we have Oτ0 (φ♭ ⋆ µ♭ ) = ∅. Assume that it holds for a given i ∈ N. We have π ∈ ρi+1 τ (φ ⋆ µ) if and only if π ∈ φ(v) with v ∈ dom(τ ) (and hence τ (v) ∈ K) or main.tex; 27/12/2017; 15:18; p.48 49 π ∈ ρiF (k(π)) (φ|dom(F (k(π′ ))) ⋆ µ) with v ∈ dom(τ ) and π ′ ∈ φ(v) (and hence τ (v) ∈ K). The first case holds if and only if o.π = π with o = µ♭ φ♭ (v), v ∈ dom(τ ) and φ♭ (v) ∈ Loc for suitable φ♭ ∈ φτ and µ♭ ∈ µ (Definition 69). By inductive hypothesis, the second case holds if and only if there exist φ♭1 ∈ φF (k(π′ )) and µ♭ ∈ µ such that π = o.π for a suitable o ∈ OFi (k(π′ )) (φ♭1 ⋆ µ♭ ), if and only if (Definition 69) there exist φ♭ ∈ φτ and µ♭ ∈ µ such that π = o.π, v ∈ dom(τ ), φ♭ (v) ∈ Loc, o′ = µ♭ φ♭ (v) and o ∈ OFi (k(o′ .π)) (o′ .φ ⋆ µ♭ ). Together, the first or the second case hold if and only if there exist φ♭ ∈ φτ and µ ∈ µ such that ✷ o ∈ Oτi+1 (φ♭ ⋆ µ♭ ) and o.π = π (Definition 21). Lemma 73 says that the concrete states constructed through the frames and memories of Definition 69 represent a worst-case w.r.t. the set of creation points of the objects reachable in every concrete state. Lemma 73 Let φ ⋆ µ ∈ Στ , i ∈ N and φ# ⋆ µ# = αER τ (φ ⋆ µ). If o ∈ ♭ i ♭ # # Oτ (φ ⋆ µ) then there exist φ ∈ φ τ and µ ∈ µ such that o′ ∈ Oτi (φ♭ ⋆ µ♭ ) and o′ .π = o.π. Proof. We proceed by induction on i. We have Oτ0 (φ ⋆ µ) = ∅ and the result holds for i = 0. Assume that it holds for a given i ∈ N. Let o ∈ Oτi+1 (φ ⋆ µ). We have o = µφ(v) with v ∈ dom(τ ) and φ(v) ∈ Loc or o ∈ OFi (k(o′ .π)) (o′ .φ ⋆ µ) with v ∈ dom(τ ), φ(v) ∈ Loc and o′ = µφ(v). In the first case, we have o.π ∈ φ# (v) and there exist φ♭ ∈ φ# τ and µ♭ ∈ µ# such that µ♭ φ♭ (v).π = π and the thesis follows by letting o′ = µ♭ φ♭ (v). In the second case, by inductive hypothesis we know that there exist φ♭1 ∈ φ# F (k(o′ .π)) and µ♭ ∈ µ# such that o′′ ∈ OFi (k(o′ .π)) (φ♭1 ⋆ µ♭ ), o′′ .π = o.π, v ∈ dom(τ ), φ(v) ∈ Loc and o′ = µφ(v) if and only if (Definitions 69 and 21) there exist φ♭ ∈ φ# τ and µ♭ ∈ µ# such that o′′ ∈ Oτi+1 (φ♭ ⋆ µ♭ ) and o′′ .π = o.π. ✷ Lemma 74 gives an explicit definition of the abstraction of the set of states constructed from the frames and memories of Definition 69. Lemma 74 Let φ ∈ Frame ER and µ ∈ Memory ER . Then τ ♭ ♭ ♭ ♭ αER τ ({φ ⋆ µ ∈ Στ | φ ∈ φτ and µ ∈ µ}) = ξτ (φ ⋆ µ) . ♭ ♭ ♭ ♭ Proof. Let Aτ = αER τ ({φ ⋆ µ ∈ Στ | φ ∈ φτ and µ ∈ µ}). If this ∈ dom(τ ) and φ(this) = ∅, then Aτ = ⊥ because of Lemma 71.ii. main.tex; 27/12/2017; 15:18; p.49 50 Moreover, ξτ (φ ⋆ µ) = ⊥ (Definition 44). Otherwise, by Definition 69 we have     φ♭ ∈ φτ , µ♭ ∈ µ, φ♭ ∈ φτ Aτ = ǫτ φ♭ ⋆ µ♭ ♭ ⋆ ǫτ o.φ ⋆ µ♭ o ∈ Oτ (φ♭ ⋆ µ♭ ) µ ∈µ = φ ⋆ ǫτ ({φ′ ⋆ µ♭ | φ′ ∈ µF (k(o.π)) , φ♭ ∈ φτ , µ♭ ∈ µ, o ∈ Oτ (φ♭ ⋆ µ♭ )}) = φ ⋆ ǫτ ({φ′ ⋆ µ′ | φ′ ∈ µF (k(o.π)) , φ♭ ∈ φτ , µ′ , µ♭ ∈ µ, o ∈ Oτ (φ♭ ⋆ µ♭ )}) (19) since ǫτ does not depend on the frames of the objects in memory (Definition 37). By Lemma 72, (19) is equal to φ ⋆ ǫτ ({φ′ ⋆ µ′ | φ′ ∈ µF (k(π)) , µ′ ∈ µ, π ∈ ρτ (φ ⋆ µ)})i = φ ⋆ ∪{µ|dom(F (k(π))) | π ∈ ρτ (φ ⋆ µ)} ∪ ℑ(τ ) = ξτ (φ ⋆ µ) . ✷ We now prove Proposition 47. To do this, we will use the set of states constructed from the frames and memories in Definition 69 to show that αER is onto. Proposition 47. Let ξτ be the abstract garbage collector of Definition 44. Then fp(ξτ ) = rng(αER τ ). Proof. Let X ⊆ Στ . By Proposition 46, Lemmas 73 and 74 and Definition 41, we have ER αER τ (X) = ∪{ατ (σ) | σ ∈ X}   φ♭ ∈ αER  τ (σ).φτ   φ♭ ⋆ µ♭ ∈ Στ µ♭ ∈ αER (σ).µ  ⊆ ∪ αER τ τ   σ∈X ER = ∪{ξτ αER τ (σ) | σ ∈ X} ⊆ ξτ ατ (X) . The converse inclusion holds since ξτ is reductive (Proposition 46) and, ♭ ♭ hence αER τ (X) ∈ fp(ξτ ). Conversely, let s ∈ fp(ξτ ) and X = {φ ⋆ µ ∈ Στ | φ♭ ∈ φτ , µ♭ ∈ µ}. By Lemma 74 and since s ∈ fp(ξτ ), we have αER τ (X) = ξτ (s) = s. The proof of Proposition 50 requires some preliminary results. Corollary 75 states that if we know that the approximation of a set of concrete states S is some φ ⋆ µ, then we can conclude that a better approximation of S is ξ(φ ⋆ µ). In other words, garbage is not used in the approximation. main.tex; 27/12/2017; 15:18; p.50 51 Corollary 75 Let S ⊆ Στ , φ ∈ Frame ER and µ ∈ Memory ER . Then τ ατ (S) ⊆ ξτ (φ ⋆ µ) if and only if ατ (S) ⊆ φ ⋆ µ. Proof. Assume that ατ (S) ⊆ ξτ (φ ⋆ µ). By reductivity (Proposition 46) we have ατ (S) ⊆ φ ⋆ µ. Conversely, assume that ατ (S) ⊆ φ ⋆ µ. By Proposition 47 and monotonicity (Proposition 46) we have ατ (S) = ξτ ατ (S) ⊆ ξτ (φ ⋆ µ). ✷ The following lemma will be used in the proof of Proposition 50. It states that the approximation of a variable depends from the concrete value of that variable only, and that the approximation of a memory is the same if the locations in the frame do not change (although they may be bound to different variables). Lemma 76 Let φ′ ⋆ µ ∈ Στ ′ and φ′′ ⋆ µ ∈ Στ ′′ . Then i) if φ′ (v) = φ′′ (v) for each v ∈ dom(τ ′ ) ∩ dom(τ ′′ ), then we have (ατ ′ (φ′ ⋆ µ)).φ(v) = (ατ ′′ (φ′′ ⋆ µ)).φ(v); ii) if rng(φ′ ) ∩ Loc = rng(φ′′ ) ∩ Loc, then we have (ατ ′ (φ′ ⋆ µ)).µ = (ατ ′′ (φ′′ ⋆ µ)).µ. Proof. From Definition 41. ✷ Lemma 77 says that if we consider all the concrete states approximated by some φ# ⋆ µ# and we restrict their frames, the resulting set of states is approximated by ξ(φ# ⋆ µ# ). In other words, the operation ξ garbage collects all objects that, because of the restriction, are no longer reachable. Lemma 77 Let vs ⊆ dom(τ ) and φ# ⋆ µ# ∈ ERτ . Then   φ ⋆ µ ∈ Στ ατ |−vs φ|−vs ⋆ µ = ξτ |−vs (φ# |−vs ⋆ µ# ) . ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# Proof. We have ατ |−vs ({φ|−vs ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }) = ατ |−vs ({φ|−vs ⋆ µ ∈ Στ |−vs | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }) , (20) since if φ ⋆ µ ∈ Στ then φ|−vs ⋆ µ ∈ Στ |−vs . We have that, if ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# , then ατ |−vs (φ|−vs ⋆ µ) ⊆ φ# |−vs ⋆ µ# . Hence (20) is contained in φ# |−vs ⋆ µ# . By Corollary 75, the set (20) is also contained in the main.tex; 27/12/2017; 15:18; p.51 52 set ξτ |−vs (φ# |−vs ⋆ µ# ). But also the converse inclusion holds, since in (20) we can restrict the choice of φ ⋆ µ ∈ Στ , so that (20) contains   φ ⋆ µ ∈ Στ , ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# ατ |−vs . φ|−vs ⋆ µ ∈ Στ |−vs φ ∈ φ# τ , µ ∈ µ# (21) By points ii and iii of Lemma 62, (21) is equal to ατ |−vs ({φ|−vs ⋆ µ ∈ Στ |−vs | φ ∈ φ# τ , µ ∈ µ# }) ( )! φ ∈ (φ# |−vs )τ |−vs φ ⋆ µ ∈ Στ |−vs (Definition 69) = ατ |−vs µ ∈ µ# (Lemma 74) = ξτ |−vs (φ# |−vs ⋆ µ# ) . ✷ We are now ready to prove the correctness and optimality of the abstract operations in Figure 10. Proposition 50. The operations in Figure 10 are the optimal counterparts induced by αER of the operations in Figure 8 and of ∪. Proof. The strictness of the abstract operations (except ∪) follows by reasoning as for the proof of strictness in Proposition 32. Note that γτ (⊥) = ∅ for all τ ∈ TypEnv since, by Definition 41, γτ (⊥) = {σ ∈ Στ | ατ (σ) ⊆ ⊥} = {σ ∈ Στ | ατ (σ) = ⊥} = ∅. Hence return is also strict on both arguments. We will use the corresponding versions of the properties P2 and P3 already used in the proof of Proposition 32. They are P2 If φ ⋆ µ ∈ ERτ then there exists σ ∈ Στ such that ατ (σ) ⊆ φ ⋆ µ. P3 ατ γτ is the identity map. P2 holds since φ(this) 6= ∅ so that there exists π ∈ φ(this) and hence, letting σ = [this 7→ l] ⋆[l 7→ π ⋆ ℑ(F (k(π)))] for some l ∈ Loc, we have σ ∈ Στ . Moreover, ατ (σ) = φ⊥ [this 7→ {π}] ⋆ µ⊥ ⊆ φ ⋆ µ, where φ⊥ and µ⊥ are the least elements of Frame ER and Memory ER , τ respectively. By Proposition 49, ατ is a Galois insertion and hence, P3 holds. Most cases of the proof are similar to the corresponding cases in the proof of Proposition 32, provided we use Lemma 76 instead of Lemma 67, Lemma 77 instead of Lemma 68, Definition 44 instead of main.tex; 27/12/2017; 15:18; p.52 53 Definition 25, and we modify the syntax of the abstract elements. As an example, consider get int, get null, get var ατ [res7→int] (get intiτ (γτ (φ# ⋆ µ# ))) = ατ [res7→int] ({φ′ [res 7→ i] ⋆ µ′ | φ′ ⋆ µ′ ∈ γτ (φ# ⋆ µ# )}) (∗) = ατ ({φ′ ⋆ µ′ | φ′ ⋆ µ′ ∈ γτ (φ# ⋆ µ# )}).φ[res 7→ ∗] ⋆ ⋆ ατ ({φ′ ⋆ µ′ | φ′ ⋆ µ′ ∈ γτ (φ# ⋆ µ# )}).µ (P3) = φ# [res 7→ ∗] ⋆ µ# . where point ∗ follows by Lemma 76 since res 6∈ dom(τ ) and τ [res 7→ int](res) = int. The proof is similar for get null and get var. Therefore, we only show the cases which differ significantly from the corresponding case in Proposition 32. is null Let A = ατ [res7→int] (is nullτ (γτ (φ# ⋆ µ# ))). We have A = ατ [res7→int] (is nullτ ({σ ∈ Στ | ατ (σ) ⊆ φ# ⋆ µ# })) = ατ [res7→int] ({φ[res 7→ 1] ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }) . By Lemma 76.i we have A.φ = φ# [res 7→ ∗] (Definition 44) = ξτ [res7→int] (φ# [res 7→ ∗] ⋆ µ# ) . Moreover, by Lemma 76.ii we have   φ ⋆ µ ∈ Στ A.µ = ατ |−res φ|−res ⋆ µ .µ ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# (Lemma 77) = ξτ |−res (φ# |−res ⋆ µ# ).µ (Definition 44) = ξτ [res7→int] (φ# [res 7→ ∗] ⋆ µ# ).µ . put var Let A = ατ |−res (put varτ (γτ (φ# ⋆ µ# ))). We have A = ατ |−res (put varτ ({σ ∈ Στ | ατ (σ) ⊆ φ# ⋆ µ# }))   φ ⋆ µ ∈ Στ = ατ |−res . φ[v 7→ φ(res)]|−res ⋆ µ ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# main.tex; 27/12/2017; 15:18; p.53 54 By Lemma 76.i we have A.φ = φ# [v 7→ φ# (res)]|−res (Definition 44) = ξτ |−res (φ# [v 7→ φ# (res)]|−res ⋆ µ# ).φ . Moreover, since rng(φ[v 7→ φ(res)]|−res ) = rng(φ|−v ), by Lemma 76.ii we have   φ ⋆ µ ∈ Στ A.µ = ατ |−v .µ φ|−v ⋆ µ ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# (Lemma 77) = ξτ |−v (φ# |−v ⋆ µ# ).µ (Definition 44) = ξτ |−res (φ# [v 7→ φ# (res)]|−res ⋆ µ# ).µ . call Let p = P (ν)|−out . Recall that dom(p) = {ι1 , . . . , ιn , this}. Let τ′ = τ [v1 7→ ι1 , . . . , vn 7→ ιn , res 7→ this] and φ# = φ# [v1 7→ ι1 , . . . , vn 7→ ′ ιn , res 7→ this]. We have 1 ,...,vn (γτ (φ# ⋆ µ# ))) αp (callν,v τ 1 ,...,vn ({σ ∈ Στ | ατ (σ) ⊆ φ# ⋆ µ# })) = αp (callν,v τ    ι1 7→ φ(v1 ),      .. φ ⋆ µ ∈ Στ and    . = αp   ⋆µ ατ (φ ⋆ µ) ⊆ φ# ⋆ µ#   ιn 7→ φ(vn ),     this 7→ φ(res) # (Lemma 76) = αp ({φ|p ⋆ µ | φ ⋆ µ ∈ Στ′ and ατ′ (φ ⋆ µ) ⊆ φ# ′ ⋆ µ }) # (Lemma 77) = ξp (φ# ′ |p ⋆ µ )    ι1 7→ φ# (v1 ),    ..  #  ⋆µ  . = ξp  .     ιn 7→ φ# (vn ), # this 7→ φ (res)             new Let κ = k(π) and A = ατ [res7→κ] (newπτ (γτ (φ# ⋆ µ# ))). Since res 6∈ dom(τ ) we have A = ατ [res7→κ] (newπτ ({σ ∈ Στ | ατ (σ) ⊆ φ# ⋆ µ# }))   φ ⋆ µ ∈ Στ   φ[res 7→ l] ⋆ = ατ [res7→κ]  ατ (φ ⋆ µ) ⊆ φ# ⋆ µ#  .  ⋆ µ[l 7→ π ⋆ ℑ(F (κ))]  l ∈ Loc \ dom(µ) main.tex; 27/12/2017; 15:18; p.54 55 By Lemma 76.i we have A.φ = ατ ({φ ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }).φ[res 7→ {π}] = ατ γτ (φ# ⋆ µ# ).φ[res 7→ {π}] (P3) = φ# [res 7→ {π}] . The newly created object o = π ⋆ ℑ(F (κ)) has its fields bound to null: o.φ(f ) = ℑ(F (κ))(f ) ∈ {0, null } for every f ∈ dom(o.φ). Hence it does not contribute to the memory component A.µ and by Lemma 76.ii we have A.µ = ατ ({φ ⋆ µ | φ ⋆ µ ∈ Στ and ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }).µ = ατ γτ (φ# ⋆ µ# ).µ (P3) = µ# . return Let τ ′ = τ [res 7→ P (ν)(out)], τ ′′ = P (ν)|out and L = rng(φ1 |−res )∩Loc. # # # ατ ′ (returnντ (γτ (φ# 1 ⋆ µ1 ))(γτ ′′ (φ2 ⋆ µ2 ))) # = ατ ′ (returnντ ({σ1 ∈ Στ | ατ (σ1 ) ⊆ φ# 1 ⋆ µ1 }) # ({σ2 ∈ Στ ′′ | ατ ′′ (σ2 ) ⊆ φ# 2 ⋆ µ2 }))              φ ⋆ µ ∈ Σ 1 1 τ          φ2 ⋆ µ2 ∈ Στ ′′      # # = ατ ′  φ1 |−res [res 7→ φ2 (out)] ⋆ µ2 ατ (φ1 ⋆ µ1 ) ⊆ φ1 ⋆ µ1     # #      ατ ′′ (φ2 ⋆ µ2 ) ⊆ φ2 ⋆ µ2           µ = µ 1 L 2     | {z }  Cond (∗) = ατ |−res ({φ1 |−res ⋆ µ2 | Cond}) ∪ ατ ′′ ({φ2 ⋆ µ2 | Cond})[out 7→ res] {z } | {z } | A B # where point ∗ follows by Definition 41. Since ατ ′′ (φ2 ⋆ µ2 ) ⊆ φ# 2 ⋆ µ2 , # # we have B ⊆ φ2 [out 7→ res] ⋆ µ2 . But the converse inclusion holds also, since by Lemma 71.iii we have )! ( # , µ ∈ µ φ1 ∈ φ# 1 1 τ 1 [out 7→ res] B ⊇ ατ ′′ φ2 ⋆ µ2 # φ2 ∈ φ# , µ ∈ µ 2 2 τ ′′ 2 main.tex; 27/12/2017; 15:18; p.55 56 # which by Lemma 74 is equal to φ# 2 [out 7→ res] ⋆ µ2 . Note that the condition µ1 =L µ2 is satisfied by Definition 69. Since dom(τ ′′ ) = # {out}, we conclude that B = [res 7→ φ# 2 (out)] ⋆ µ2 . With regard to A, we have A ⊇ ατ |−res ( # Cond, φ1 ∈ φ# 1 τ , µ1 ∈ µ1 φ2 = ℑ(τ ′′ ), µ2 ∈ µ⊤ φ1 |−res ⋆ µ2 ) ⊤ (Lemma 71) = ατ |−res {φ1 |−res ⋆ µ2 | φ1 ∈ φ# 1 τ , µ2 ∈ µ } ⊤ (Lemma 74) = ξτ |−res (φ# 1 |−res ⋆ µ ) . (22) Moreover, for every v ∈ dom(τ |−res ) such that τ (v) ∈ K, we have A.φ(v) = {o.π | φ1 |−res (v) ∈ Loc, o = µ2 φ1 |−res (v), Cond} (since µ1 =L µ2 ) = {o.π | φ1 |−res (v) ∈ Loc, o = µ1 φ1 |−res (v), Cond}   φ1 (v) ∈ Loc, φ1 ⋆ µ1 ∈ Στ ⊆ (µ1 φ1 (v)).π # ατ (φ1 ⋆ µ1 ) ⊆ φ# 1 ⋆ µ1 # = (ατ γτ (φ# 1 ⋆ µ1 )).φ(v) (P1) = φ# 1 (v) . ⊤ We conclude that A.φ ⊆ φ# 1 |−res . Moreover, we have A.µ ⊆ µ . Hence # ⊤ ⊤ A ⊆ φ# 1 |−res ⋆ µ and, by Corollary 75, A ⊆ ξτ |−res (φ1 |−res ⋆ µ ). To⊤ gether with (22), this proves that A = ξτ |−res (φ# 1 |−res ⋆ µ ). get field Let τ ′ = τ [res 7→ (F τ (res))(f )] and A = ατ ′ (get fieldfτ (γτ (φ# ⋆ µ# ))). We have A = ατ ′ (get fieldfτ ({φ ⋆ µ ∈ Στ | ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }))   φ ⋆ µ ∈ Στ    = ατ ′  φ[res 7→ (µφ(res)).φ(f )] ⋆ µ φ(res) 6= null   # # ατ (φ ⋆ µ) ⊆ φ ⋆ µ which is ⊥ when φ# (res) = ∅, since in such a case the condition φ(res) 6= null cannot be satisfied. Assume then that we have φ# (res) 6= main.tex; 27/12/2017; 15:18; p.56 57 ∅ and let f ′ = (µφ(res)).φ(f ). We conclude that  φ ⋆ µ ∈ Στ    φ(res) 6= null ′ A ⊇ ατ ′  φ[res 7→ f ] ⋆ µ ατ (φ ⋆ µ) ⊆ φ# ⋆ µ#   φ ∈ φ# τ , µ ∈ µ#  φ ⋆ µ ∈ Στ  (Definition 69) = ατ ′  φ[res 7→ f ′ ] ⋆ µ ατ (φ ⋆ µ) ⊆ φ# ⋆ µ#  φ ∈ φ# τ , µ ∈ µ# (Lemma 71) = ατ ′ ({φ[res 7→ f ′ ] ⋆ µ | φ ∈ φ# τ , µ ∈ µ# })              (Definition 69) = ατ ′ ({φ ⋆ µ | φ ∈ φ# [res 7→ µ(f )]τ ′ , µ ∈ µ# }) (Lemma 74) = φ# [res 7→ µ(f )] ⋆ µ# . We prove that the converse inclusion also holds. Let x = (µφ(res)).φ(f ). If x ∈ Loc, the object µ(x) is reachable by construction from φ(res). Hence we have A.µ ⊆ ατ ({φ ⋆ µ | φ ⋆ µ ∈ Στ , φ(res) 6= null, ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }).µ ⊆ ατ ({φ ⋆ µ | φ ⋆ µ ∈ Στ , ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# }).µ = ατ γτ (φ# ⋆ µ# ).µ (P3) = µ# . If φ(res) 6= null then o = µφ(res) ∈ Oτ (φ ⋆ µ) and ετ (o.φ ⋆ µ) ⊆ µ# (Definition 41). Hence, if (µφ(res)).φ(f ) 6= null then we have that ((µφ(res)).φ(f )).π ∈ µ# (f ). By Lemma 76 we conclude that A.φ ⊆ φ# [res 7→ µ# (f )] . lookup # # Let A = ατ (lookupm,ν τ (γτ (φ ⋆ µ ))). We have # # A = ατ (lookupm,ν τ ({φ ⋆ µ ∈ Στ | ατ (φ ⋆ µ) ⊆ φ ⋆ µ }))   ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# = ατ φ ⋆ µ ∈ Στ . φ(res) 6= null, M ((µφ(res)).π)(m) = ν We have A = ⊥ if there is no π ∈ φ# (res) such that M (π)(m) = ν, because in such a case the condition M ((µφ(res)).π)(m) = ν cannot main.tex; 27/12/2017; 15:18; p.57 58 be satisfied. Otherwise we have      A ⊇ ατ  φ ⋆ µ ∈ Στ       (Definition 44) = ατ φ ⋆ µ ∈ Στ   (Lemma 71.iii) = ατ φ ⋆ µ ∈ Στ  (Definition 69) = ατ φ ⋆ µ ∈ Στ            ατ (φ ⋆ µ) ⊆ φ# ⋆ µ#  M (k((µφ(res )).π))(m) = ν   φ ∈ φ# τ , µ ∈ µ#  M (k((µφ(res )).π))(m) = ν φ ∈ φ# τ , µ ∈ µ#  (µφ(res)).π ∈ S, φ ∈ φ# τ , µ ∈ µ# ατ (φ ⋆ µ) ⊆ φ# ⋆ µ# φ(res) 6= null M (k((µφ(res )).π))(m) = ν φ ∈ φ# τ , µ ∈ µ# where S = {π ∈ φ# (res) | M (k(π))(m) = ν}. By Definition 69 we have A ⊇ ατ ({φ ⋆ µ ∈ Στ | φ ∈ φ# [res 7→ S]τ , µ ∈ µ# }) (Lemma 74) = ξτ (φ# [res 7→ S] ⋆ µ# ) . We prove that also the converse inclusion holds. Note that if ατ (φ ⋆ µ) ⊆ φ# [res 7→ S] ⋆ µ# and φ(res) 6= null then M (k((µφ(res )).π))(m) = ν. Hence we have   ατ (φ ⋆ µ) ⊆ φ# [res 7→ S] ⋆ µ# , φ ⋆ µ ∈ Στ A ⊆ ατ φ(res) 6= null (Definition 41) = ατ ({φ ⋆ µ ∈ Στ | ατ (φ ⋆ µ) ⊆ φ# [res 7→ S] ⋆ µ# }) = ατ γτ (φ# [res 7→ S] ⋆ µ# ) (P3) = φ# [res 7→ S] ⋆ µ# . put field # # # Let τ ′′ = τ |−res and A = ατ ′′ (put fieldτ,τ ′ (γτ (φ# 1 ⋆ µ1 ))(γτ ′ (φ2 ⋆ µ2 ))). We have # A = ατ ′′ (put fieldτ,τ ′ ({σ1 ∈ Στ | ατ (σ1 ) ⊆ φ# 1 ⋆ µ1 }) # ({σ2 ∈ Στ ′ | ατ ′ (σ2 ) ⊆ φ# 2 ⋆ µ2 }))  φ1 ⋆ µ1 ∈ Στ ,     φ 2 ⋆ µ2 ∈ Σ τ ′    φ2 |−res ⋆ µ2 [l 7→ µ2 (l).π ⋆ ατ (φ1 ⋆ µ1 ) ⊆ φ# ⋆ µ# 1 1 = ατ ′′   ⋆ µ2 (l).φ[f 7→ φ2 (res)]] ⋆ µ# ατ ′ (φ2 ⋆ µ2 ) ⊆ φ#  2 2    (l = φ1 (res)) 6= null,   µ1 = l µ2                      main.tex; 27/12/2017; 15:18; p.58 59 which is ⊥ if φ# 1 (res) = ∅, since in such a case the condition φ1 (res) 6= null cannot be satisfied. Assume then that φ# 1 (res) 6= ∅. If no creation # # # point in φ1 (res) occurs in φ2 |−res ⋆ µ2 then µ2 (l) 6∈ Oτ ′′ (φ2 |−res ⋆ µ2 ). Hence the update of the content of l does not contribute to ατ ′′ (Definition 41) and we have   φ1 ⋆ µ1 ∈ Στ , φ2 ⋆ µ2 ∈ Στ ′      # #  α (φ ⋆ µ ) ⊆ φ ⋆ µ τ 1 1 1 1  .  A = ατ ′′  φ2 |−res ⋆ µ2 # #    ′ (φ ⋆ µ ) ⊆ φ ⋆ µ α 2 2 τ   2 2   (l = φ1 (res)) 6= null, µ1 =l µ2 # Let φ2 ⋆ µ2 ∈ Στ ′ be such that ατ ′ (φ2 ⋆ µ2 ) ⊆ φ# 2 ⋆ µ2 . By P2, we # can always find φ1 ⋆ µ1 ∈ Στ such that ατ (φ1 ⋆ µ1 ) ⊆ φ# 1 ⋆ µ1 . By the hypothesis φ# 1 (res) 6= ∅ we can assume that (l = φ1 (res)) 6= null. If µ1 =l µ2 does not hold, we can assume that l 6∈ dom(µ2 ) (up to renaming). Let o = µ1 (l). We define µ′2 = µ2 [l 7→ o.π ⋆ ℑ(k(o.π))]. We have φ2 ⋆ µ′2 ∈ Στ ′ and, since the extra location l does not contribute to ατ ′ , we have ατ ′ (φ2 ⋆ µ2 ) = ατ ′ (φ2 ⋆ µ′2 ) and ατ ′′ (φ2 |−res ⋆ µ2 ) = ατ ′′ (φ2 |−res ⋆ µ′2 ). Moreover, µ1 =l µ2 holds by construction. We conclude that the constraints on φ1 ⋆ µ1 and the constraint µ1 =l µ2 do not contribute to A, and we have   φ2 ⋆ µ2 ∈ Στ ′ , A = ατ ′′ φ2 |−res ⋆ µ2 # ατ ′ (φ2 ⋆ µ2 ) ⊆ φ# 2 ⋆ µ2 # (Corollary 75) = ξτ ′′ (φ# 2 |−res ⋆ µ2 ) . Otherwise, since the objects reachable from φ2 (res) belong to the set Oτ ′ (φ2 ⋆ µ2 ), by Lemma 76 we have   φ2 ⋆ µ2 ∈ Στ ′ ,      φ2 |−res ⋆ µ2 [l 7→ µ2 (l).π ⋆ ατ ′ (φ2 ⋆ µ2 ) ⊆ φ# ⋆ µ#   2 2 A ⊆ ατ ′′   ⋆ µ2 (l).φ[f 7→ φ2 (res)]]   l ∈ dom(µ2 ),     f ∈ dom(F (k(µ2 (l).π))) # # # ⊆ φ# 2 |−res ⋆ µ2 [f 7→ µ2 (f ) ∪ φ2 (res)] . # # By Corollary 75 we conclude that A ⊆ ξτ ′′ (φ# 2 |−res ⋆ µ2 [f 7→ µ2 (f ) ∪ φ# 2 (res)]). We prove the converse inclusion now. Since we assume that there is # # a π ∈ φ# 1 (res) which occurs in φ2 |−res ⋆ µ2 , then we can find φ1 ⋆ µ1 ∈ # Στ with ατ (φ1 ⋆ µ1 ) ⊆ φ# 1 ⋆ µ1 and φ2 ⋆ µ2 ∈ Στ ′ with ατ ′ (φ2 ⋆ µ2 ) ⊆ # φ# 2 ⋆ µ2 such that φ1 (res) = l, µ1 (l).π = π and µ1 =l µ2 . Note that # φ2 (res) is only constrained by ατ ′ (φ2 ⋆ µ2 ) ⊆ φ# 2 ⋆ µ2 that is, φ2 (res) main.tex; 27/12/2017; 15:18; p.59 60 can range over all φ# 2 (res). Moreover, by the existence of π we can assume that l is reachable in φ2 ⋆ µ2 that is µ2 (l) ∈ Oτ ′′ (φ2 |−res ⋆ µ2 ). We conclude that A.µ(f ) ⊇ φ# (23) 2 (res). # Moreover, given again φ1 ⋆ µ1 ∈ Στ with ατ (φ1 ⋆ µ1 ) ⊆ φ# 1 ⋆ µ1 and # φ2 ⋆ µ2 ∈ Στ ′ with ατ ′ (φ2 ⋆ µ2 ) ⊆ φ# 2 ⋆ µ2 and (l = φ1 (res)) 6= null, the condition µ1 =l µ2 can be made true by renaming l into l′ in φ2 ⋆ µ2 (if l occurs there) and extending µ2 with an unreachable l bound to µ1 (l). We conclude that we can always find φ1 ⋆ µ1 and φ2 ⋆ µ2 such that # # # ατ (φ1 ⋆ µ1 ) ⊆ φ# 1 ⋆ µ1 , ατ ′ (φ2 ⋆ µ2 ) ⊆ φ2 ⋆ µ2 , (l = φ1 (res)) 6= null, µ1 =l µ2 and l is not reachable from φ2 ⋆ µ2 : µ2 (l) 6∈ Oτ ′′ (φ2 |−res ⋆ µ2 ). As a consequence and by using P2, we have   φ2 ⋆ µ2 ∈ Στ ′ , A ⊇ ατ ′′ φ2 |−res ⋆ µ2 # ατ ′ (φ2 ⋆ µ2 ) ⊆ φ# 2 ⋆ µ2 # (Corollary 75) = ξτ ′′ (φ# 2 |−res ⋆ µ2 ) . (24) By merging (23) and (24) we conclude that # # A ⊇ ξτ ′′ (φ# 2 |−res ⋆ µ2 ) ∪ (φ⊥ ⋆ µ⊥ [f 7→ φ2 (res)]) (25) where φ⊥ maps all variables to ∅ and µ⊥ maps all fields to ∅. We still have to prove that in the equation above we can move φ# 2 (res) inside the garbage collector ξτ ′′ . But this is true since by Figure 7 we know that f is a field of F (τ (res)) so that f is a field of the objects created at the creation point π ∈ φ# 1 (res) which we assume to occur in # # φ2 |−res ⋆ µ2 . Hence ξτ ′′ cannot garbage collect the set φ# 2 (res) bound to f . In conclusion, (25) becomes # # # A ⊇ ξτ ′′ (φ# 2 |−res ⋆ µ2 [f 7→ µ2 (f ) ∪ φ2 (res)]). ∪ By additivity (Proposition 49), the best approximation of ∪ over ℘(Στ ) is (pointwise) ∪ over ER. The proof of Proposition 56 needs the following result that θτ (e) is an element of ERτ and approximates exactly the same concrete states as e. Lemma 78 Let σ ∈ Στ and e ∈ Eτ . Then θτ (e) ∈ ERτ . Moreover, αEτ (σ) ⊆ e if and only if αER τ (σ) ⊆ θτ (e). main.tex; 27/12/2017; 15:18; p.60 61 Proof. We have θτ (e) ∈ ERτ by idempotency of ξτ (Proposition 46) and Definition 48. Let αEτ (σ) ⊆ e and v ∈ dom(τ ). If τ (v) = int, then ετ (σ)(v) = ∗ = ϑτ (e)(v). If τ (v) ∈ K, then every π ∈ ετ (σ)(v) is such that k(π) ≤ τ (v) (Definitions 37 and 14). Moreover, π = µ(l).π for some l ∈ rng(φ) ∩ Loc (Definition 37). Hence π ∈ αEτ (σ) (Definition 22), and π ∈ e. By Definition 54 we conclude that π ∈ ϑτ (e)(v). Hence τ ). If τe(f ) = int, then αER τ (σ).φ = ετ (σ) ⊆ ϑτ (e). Let now f ∈ dom(e f ετe ({o.φ ⋆ µ | o ∈ Oτ (σ)})(f ) = ∗ = ϑτe (e)(f ). If τe(f ) ∈ K, then every f ⋆ µ | o ∈ Oτ (σ)})(f ) is such that k(π) ≤ τe(f ) (Definiπ ∈ ετe ({o.φ tions 37 and 14). Moreover, π = µ(l).π for some l ∈ rng(o.φ) ∩ Loc with o ∈ Oτ (σ) (Definition 37). Hence π ∈ αEτ (σ) (Definition 22), and π ∈ e. By Definition 54 we conclude that π ∈ ϑτe (e)(f ). Hence f αER τe (σ).µ = ετe ({o.φ ⋆ µ | o ∈ Oτ (σ)}) ⊆ ϑτe (e). In conclusion, we have ER ατ (σ) ⊆ ϑτ (e) ⋆ ϑτe (e). Since ξτ is monotonic (Proposition 46) and by Proposition 47, we have αER τ (σ) ⊆ ξτ (ϑτ (e) ⋆ ϑτe (e)) = θτ (e). (σ) ⊆ θτ (e). Let π ∈ αEτ (σ). By Definition 22 Conversely, let αER τ we have π = o.π with o ∈ Oτ (σ). By Definition 41 we have π ∈ ER αER τ (σ).φ(v) for some v ∈ dom(τ ) or π ∈ ατ (σ).µ(f ) for some f ∈ dom(e τ ), and hence π ∈ θτ (e).φ(v), in the first case, or π ∈ θτ (e).µ(f ), in the second case. In both cases, by Definition 54 we have π ∈ e. Thus αEτ (σ) ⊆ e. ✷ We can now prove that every element of E represents the same set of concrete states as an element of ER. Proposition 56. Let γτE and γτER be the concretisation maps induced by the abstraction maps of Definitions 22 and 41, respectively. Then γτE (Eτ ) ⊆ γτER (ERτ ). Proof. By Lemma 78, for any e ∈ Eτ , we have γτE (e) = {σ ∈ Στ | αEτ (σ) ⊆ e} ER = {σ ∈ Στ | αER τ (σ) ⊆ θτ (e)} = γτ (θτ (e)). Since this holds for all e ∈ Eτ , we have the thesis. ✷ main.tex; 27/12/2017; 15:18; p.61 main.tex; 27/12/2017; 15:18; p.62
2cs.AI
Improved Regularization of Convolutional Neural Networks with Cutout Terrance DeVries1 and Graham W. Taylor1,2 1 arXiv:1708.04552v2 [cs.CV] 29 Nov 2017 2 University of Guelph Canadian Institute for Advanced Research and Vector Institute Abstract Convolutional neural networks are capable of learning powerful representational spaces, which are necessary for tackling complex learning tasks. However, due to the model capacity required to capture such representations, they are often susceptible to overfitting and therefore require proper regularization in order to generalize well. In this paper, we show that the simple regularization technique of randomly masking out square regions of input during training, which we call cutout, can be used to improve the robustness and overall performance of convolutional neural networks. Not only is this method extremely easy to implement, but we also demonstrate that it can be used in conjunction with existing forms of data augmentation and other regularizers to further improve model performance. We evaluate this method by applying it to current state-of-the-art architectures on the CIFAR10, CIFAR-100, and SVHN datasets, yielding new state-ofthe-art results of 2.56%, 15.20%, and 1.30% test error respectively. Code available at https://github.com/ uoguelph-mlrg/Cutout. Figure 1: Cutout applied to images from the CIFAR-10 dataset. the increased representational power also comes increased probability of overfitting, leading to poor generalization. In order to combat the potential for overfitting, several different regularization techniques can be applied, such as data augmentation or the judicious addition of noise to activations, parameters, or data. In the domain of computer vision, data augmentation is almost ubiquitous due to its ease of implementation and effectiveness. Simple image transforms such as mirroring or cropping can be applied to create new training data which can be used to improve model robustness and increase accuracy [9]. Large models can also be regularized by adding noise during the training process, whether it be added to the input, weights, or gradients. One of the most common uses of noise for improving model accuracy is dropout [6], which stochastically drops neuron activations during training and as a result discourages the co-adaptation of feature detectors. In this work we consider applying noise in a similar fashion to dropout, but with two important distinctions. The first difference is that units are dropped out only at the input layer of a CNN, rather than in the intermediate feature layers. The second difference is that we drop out contiguous sections of inputs rather than individual pixels, as demon- 1. Introduction In recent years deep learning has contributed to considerable advances in the field of computer vision, resulting in state-of-the-art performance in many challenging vision tasks such as object recognition [8], semantic segmentation [11], image captioning [19], and human pose estimation [17]. Much of these improvements can be attributed to the use of convolutional neural networks (CNNs) [9], which are capable of learning complex hierarchical feature representations of images. As the complexity of the task to be solved increases, the resource utilization of such models increases as well: memory footprint, parameters, operations count, inference time and power consumption [2]. Modern networks commonly contain on the order of tens to hundreds of millions of learned parameters which provide the necessary representational power for such tasks, but with 1 strated in Figure 1. In this fashion, dropped out regions are propagated through all subsequent feature maps, producing a final representation of the image which contains no trace of the removed input, other than what can be recovered by its context. This technique encourages the network to better utilize the full context of the image, rather than relying on the presence of a small set of specific visual features. This method, which we call cutout, can be interpreted as applying a spatial prior to dropout in input space, much in the same way that convolutional neural networks leverage information about spatial structure in order to improve performance over that of feed-forward networks. In the remainder of this paper, we introduce cutout and demonstrate that masking out contiguous sections of the input to convolutional neural networks can improve model robustness and ultimately yield better model performance. We show that this simple method works in conjunction with other current state-of-the-art techniques such as residual networks and batch normalization, and can also be combined with most regularization techniques, including standard dropout and data augmentation. Additionally, cutout can be applied during data loading in parallel with the main training task, making it effectively computationally free. To evaluate this technique we conduct tests on several popular image recognition datasets, achieving state-of-the-art results on CIFAR-10, CIFAR-100, and SVHN. We also achieve competitive results on STL-10, demonstrating the usefulness of cutout for low data and higher resolution problems. 2. Related Work Our work is most closely related to two common regularization techniques: data augmentation and dropout. Here we examine the use of both methods in the setting of training convolutional neural networks. We also discuss denoising auto-encoders and context encoders, which share some similarities with our work. 2.1. Data Augmentation for Images Data augmentation has long been used in practice when training convolutional neural networks. When training LeNet5 [9] for optical character recognition, LeCun et al. apply various affine transforms, including horizontal and vertical translation, scaling, squeezing, and horizontal shearing to improve their model’s accuracy and robustness. In [1], Bengio et al. demonstrate that deep architectures benefit much more from data augmentation than shallow architectures. They apply a large variety of transformations to their handwritten character dataset, including local elastic deformation, motion blur, Gaussian smoothing, Gaussian noise, salt and pepper noise, pixel permutation, and adding fake scratches and other occlusions to the images, in addition to affine transformations. To improve the performance of AlexNet [8] for the 2012 ImageNet Large Scale Visual Recognition Competition, Krizhevsky et al. apply image mirroring, cropping, as well as randomly adjusting colour and intensity values based on ranges determined using principal component analysis on the dataset. Wu et al. take a more aggressive approach with image augmentation when training Deep Image [21] on the ImageNet dataset. In addition to flipping and cropping they apply a wide range of colour casting, vignetting, rotation, and lens distortion (pin cushion and barrel distortion), as well as horizontal and vertical stretching. Lemley et al. tackle the issue of data augmentation with a learned end-to-end approach called Smart Augmentation [10] instead of relying on hard-coded transformations. In this method, a neural network is trained to intelligently combine existing samples in order to generate additional data that is useful for the training process. Of these techniques ours is closest to the occlusions applied in [1], however their occlusions generally take the form of scratches, dots, or scribbles that overlay the target character, while we use zero-masking to completely obstruct an entire region. 2.2. Dropout in Convolutional Neural Networks Another common regularization technique is dropout [6, 15], which was first introduced by Hinton et al. Dropout is implemented by setting hidden unit activations to zero with some fixed probability during training. All activations are kept when evaluating the network, but the resulting output is scaled according to the dropout probability. This technique has the effect of approximately averaging over an exponential number of smaller sub-networks, and works well as a robust type of bagging, which discourages the co-adaptation of feature detectors within the network. While dropout was found to be very effective at regularizing fully-connected layers, it appears to be less powerful when used with convolutional layers [16]. This reduction in potency can largely be attributed to two factors. The first is that convolutional layers already have much fewer parameters than fully-connected layers, and therefore require less regularization. The second factor is that neighbouring pixels in images share much of the same information. If any of them are dropped out then the information they contain will likely still be passed on from the neighbouring pixels that are still active. For these reasons, dropout in convolutional layers simply acts to increase robustness to noisy inputs, rather than having the same model averaging effect that is observed in fully-connected layers. In an attempt to increase the effectiveness of dropout in convolutional layers, several variations on the original dropout formula have been proposed. Tompson et al. introduce SpatialDropout [16], which randomly discards en- tire feature maps rather than individual pixels, effectively bypassing the issue of neighbouring pixels passing similar information. Wu and Gu propose probabilistic weighted pooling [20], wherein activations in each pooling region are dropped with some probability. This approach is similar to applying dropout before each pooling layer, except that instead of scaling the output with respect to the dropout probability at test time, the output of each pooling function is selected to be the sum of the activations weighted by the dropout probability. The authors claim that this approach approximates averaging over an exponential number of sub-networks as dropout does. In a more targeted approach, Park and Kwak introduce max-drop [13], which drops the maximal activation across feature maps or channels with some probability. While this regularization method performed better than conventional dropout on convolutional layers in some cases, they found that when used in CNNs that utilized batch normalization, both max-drop and SpatialDropout performed worse than standard dropout. 2.3. Denoising Auto-encoders & Context Encoders Denosing auto-encoders [18] and context encoders [14] both rely on self-supervised learning to elicit useful feature representations of images. These models work by corrupting input images and requiring the network to reconstruct them using the remaining pixels as context to determine how best to fill in the blanks. Specifically, denoising autoencoders that apply Bernoulli noise randomly erase individual pixels in the input image, while context encoders erase larger spatial regions. In order to properly fill in the missing information, the auto-encoders are forced to learn how to extract useful features from the images, rather than simply learning an identity function. As context encoders are required to fill in a larger region of the image they are required to have a better understanding of the global content of the image, and therefore they learn higher-level features compared to denoising auto-encoders [14]. These feature representations have been demonstrated to be useful for pre-training classification, detection, and semantic segmentation models. While removing contiguous sections of the input has previously been used as an image corruption technique, like in context encoders, to our knowledge it has not previously been applied directly to the training of supervised models. 3. Cutout Cutout is a simple regularization technique for convolutional neural networks that involves removing contiguous sections of input images, effectively augmenting the dataset with partially occluded versions of existing samples. This technique can be interpreted as an extension of dropout in input space, but with a spatial prior applied, much in the same way that CNNs apply a spatial prior to achieve improved performance over feed-forward networks on image data. From the comparison between dropout and cutout, we can also draw parallels to denoising autoencoders and context encoders. While both models have the same goal, context encoders are more effective at representation learning, as they force the model to understand the content of the image in a global sense, rather than a local sense as denoising auto-encoders do. In the same way, cutout forces models to take more of the full image context into consideration, rather than focusing on a few key visual features, which may not always be present. One of the major differences between cutout and other dropout variants is that units are dropped at the input stage of the network rather than in the intermediate layers. This approach has the effect that visual features, including objects that are removed from the input image, are correspondingly removed from all subsequent feature maps. Other dropout variants generally consider each feature map individually, and as a result, features that are randomly removed from one feature map may still be present in others. These inconsistencies produce a noisy representation of the input image, thereby forcing the network to become more robust to noisy inputs. In this sense, cutout is much closer to data augmentation than dropout, as it is not creating noise, but instead generating images that appear novel to the network. 3.1. Motivation The main motivation for cutout comes from the problem of object occlusion, which is commonly encountered in many computer vision tasks, such as object recognition, tracking, or human pose estimation. By generating new images which simulate occluded examples, we not only better prepare the model for encounters with occlusions in the real world, but the model also learns to take more of the image context into consideration when making decisions. We initially developed cutout as a targeted approach that specifically removed important visual features from the input of the image. This approach was similar to maxdrop [13], in that we aimed to remove maximally activated features in order to encourage the network to consider less prominent features. To accomplish this goal, we extracted and stored the maximally activated feature map for each image in the dataset at each epoch. During the next epoch we then upsampled the saved feature maps back to the input resolution, and thresholded them at the mean feature map value to obtain a binary mask, which was finally overlaid on the original image before being passed through the CNN. Figure 2 demonstrates this early version of cutout. While this targeted cutout method performed well, we found that randomly removing regions of a fixed size per- 4. Experiments To evaluate the performance of cutout, we apply it to a variety of natural image recognition datasets: CIFAR-10, CIFAR-100, SVHN, and STL-10. 4.1. CIFAR-10 and CIFAR-100 Figure 2: An early version of cutout applied to images from the CIFAR-10 dataset. This targeted approach often occludes part-level features of the image, such as heads, legs, or wheels. formed just as well as the targeted approach, without requiring any manipulation of the feature maps. Due to the inherent simplicity of this alternative approach, we focus on removing fixed-size regions for all of our experiments. 3.2. Implementation Details To implement cutout, we simply apply a fixed-size zeromask to a random location of each input image during each epoch of training, as shown in Figure 1. Unlike dropout and its variants, we do not apply any rescaling of weights at test time. For best performance, the dataset should be normalized about zero so that modified images will not have a large effect on the expected batch statistics. In general, we found that the size of the cutout region is a more important hyperparameter than the shape, so for simplicity, we conduct all of our experiments using a square patch as the cutout region. When cutout is applied to an image, we randomly select a pixel coordinate within the image as a center point and then place the cutout mask around that location. This method allows for the possibility that not all parts of the cutout mask are contained within the image. Interestingly, we found that allowing portions of the patches to lay outside the borders of the image (rather than constraining the entire patch to be within the image) was critical to achieving good performance. Our explanation for this phenomenon is that it is important for the model to receive some examples where a large portion of the image is visible during training. An alternative approach that achieves similar performance is to randomly apply cutout constrained within the image region, but with 50% probability so that the network sometimes receives unmodified images. The cutout operation can easily be applied on the CPU along with any other data augmentation steps during data loading. By implementing this operation on the CPU in parallel with the main GPU training task, we can hide the computation and obtain performance improvements for virtually free. Both of the CIFAR datasets [7] consist of 60,000 colour images of size 32 × 32 pixels. CIFAR-10 has 10 distinct classes, such as cat, dog, car, and boat. CIFAR-100 contains 100 classes, but requires much more fine-grained recognition compared to CIFAR-10 as some classes are very visually similar. For example, it contains five different classes of trees: maple, oak, palm, pine, and willow. Each dataset is split into a training set with 50,000 images and a test set with 10,000 images. Both datasets were normalized using per-channel mean and standard deviation. When required, we apply the standard data augmentation scheme for these datasets [5]. Images are first zero-padded with 4 pixels on each side to obtain a 40 × 40 pixel image, then a 32 × 32 crop is randomly extracted. Images are also randomly mirrored horizontally with 50% probability. To evaluate cutout on the CIFAR datasets, we train models using two modern architectures: a deep residual network [5] with a depth of 18 (ResNet18), and a wide residual network [22] with a depth of 28, a widening factor of 10, and dropout with a drop probability of p = 0.3 in the convolutional layers (WRN-28-10). For both of these experiments, we use the same training procedure as specified in [22]. That is, we train for 200 epochs with batches of 128 images using SGD, Nesterov momentum of 0.9, and weight decay of 5e-4. The learning rate is initially set to 0.1, but is scheduled to decrease by a factor of 5x after each of the 60th, 120th, and 160th epochs. We also apply cutout to shake-shake regularization models [4] that currently achieve state-of-the-art performance on the CIFAR datasets, specifically a 26 2 × 96d “Shake-Shake-Image” ResNet for CIFAR-10 and a 29 2 × 4 × 64d “Shake-EvenImage” ResNeXt for CIFAR-100. For our tests, we use the original code and training settings provided by the author of [4], with the only change being the addition of cutout. To find the best parameters for cutout we isolate 10% of the training set to use as a validation set and train on the remaining images. As our cutout shape is square, we perform a grid search over the side length parameter to find the optimal size. We find that model accuracy follows a parabolic trend, increasing proportionally to the cutout size until an optimal point, after which accuracy again decreases and eventually drops below that of the baseline model. This behaviour can be observed in Figure 3a and 3b, which depict the grid searches conducted on CIFAR-10 and CIFAR100 respectively. Based on these validation results we select a cutout size of 16 × 16 pixels to use on CIFAR-10 and a 97.2 81.5 Cutout Baseline 97.0 81.0 Validation Accuracy (%) 96.8 Validation Accuracy (%) Cutout Baseline 96.6 96.4 96.2 96.0 80.5 80.0 79.5 95.8 95.6 4 8 12 16 Patch Length (pixels) 20 24 79.0 4 8 (a) CIFAR-10 12 Patch Length (pixels) 16 20 (b) CIFAR-100 Figure 3: Cutout patch length with respect to validation accuracy with 95% confidence intervals (average of five runs). Tests run on CIFAR-10 and CIFAR-100 datasets using WRN-28-10 and standard data augmentation. Baseline indicates a model trained with no cutout. Method ResNet18 [5] ResNet18 + cutout WideResNet [22] WideResNet + cutout Shake-shake regularization [4] Shake-shake regularization + cutout C10 10.63 ± 0.26 9.31 ± 0.18 6.97 ± 0.22 5.54 ± 0.08 - C10+ 4.72 ± 0.21 3.99 ± 0.13 3.87 ± 0.08 3.08 ± 0.16 2.86 2.56 ± 0.07 C100 36.68 ± 0.57 34.98 ± 0.29 26.06 ± 0.22 23.94 ± 0.15 - C100+ 22.46 ± 0.31 21.96 ± 0.24 18.8 ± 0.08 18.41 ± 0.27 15.85 15.20 ± 0.21 SVHN 1.60 ± 0.05 1.30 ± 0.03 - Table 1: Test error rates (%) on CIFAR (C10, C100) and SVHN datasets. “+” indicates standard data augmentation (mirror + crop). Results averaged over five runs, with the exception of shake-shake regularization which only had three runs each. Baseline shake-shake regularization results taken from [4]. cutout size of 8 × 8 pixels for CIFAR-100 when training on the full datasets. Interestingly, it appears that as the number of classes increases, the optimal cutout size decreases. This makes sense, as when more fine-grained detection is required then the context of the image will be less useful for identifying the category. Instead, smaller and more nuanced details are important. As shown in Table 1, the addition of cutout to the ResNet18 and WRN-28-10 models increased their accuracy on CIFAR-10 and CIFAR-100 by between 0.4 to 2.0 percentage points. We draw attention to the fact that cutout yields these performance improvements even when applied to complex models that already utilize batch normalization, dropout, and data augmentation. Adding cutout to the current state-of-the-art shake-shake regularization models improves performance by 0.3 and 0.6 percentage points on CIFAR-10 and CIFAR-100 respectively, yielding new stateof-the-art results of 2.56% and 15.20% test error. 4.2. SVHN The Street View House Numbers (SVHN) dataset [12] contains a total of 630,420 colour images with a resolution of 32 × 32 pixels. Each image is centered about a number from one to ten, which needs to be identified. The official dataset split contains 73,257 training images and 26,032 test images, but there are also 531,131 additional training images available. Following standard procedure for this dataset [22], we use both available training sets when training our models, and do not apply any data augmentation. All images are normalized using per-channel mean and standard deviation. To evalute cutout on the SVHN dataset we apply it to a WideResNet with a depth of 16, a widening factor of 8, and dropout on the convolutional layers with a dropout rate of p = 0.4 (WRN-16-8). This particular configuration currently holds state-of-the-art performance on the SVHN dataset with a test error of 1.54% [22]. We repeat the same training procedure as specified in [22] by training for 160 epochs with batches of 128 images. The network is optimized using SGD with Nesterov momentum of 0.9 and weight decay of 5e-4. The learning rate is initially set to 0.01, but is reduced by a factor of 10x after the 80th and 120th epochs. The one change we do make to the original training procedure (for both baseline and cutout) is to normalize the data so that it is compatible with cutout (see § 3.2). The original implementation scales data to lie between 0 and 1. To find the optimal size for the cutout region we conduct a grid search using 10% of the training set for validation and ultimately select a cutout size of 20 × 20 pixels. While this may seem like a large portion of the image to remove, it is important to remember that the cutout patches are not constrained to lie fully within the bounds of the image. Using these settings we train the WRN-16-8 and observe an average reduction in test error of 0.3 percentage points, resulting in a new state-of-the-art performance of 1.30% test error, as shown in Table 1. 4.3. STL-10 The STL-10 dataset [3] consists of a total of 113,000 colour images with a resolution of 96 × 96 pixels. The training set only contains 5,000 images while the test set consists of 8,000 images. All training and test set images belong to one of ten classes, such as airplane, bird, or horse. The remainder of the dataset is composed of 100,000 unlabeled images belonging to the target ten classes, plus additional but visually similar classes. While the main purpose of the STL-10 dataset is to test semi-supervised learning algorithms, we use it to observe how cutout performs when applied to higher resolution images in a low data setting. For this reason, we discard the unlabeled portion of the dataset and only use the labeled training set. The dataset was normalized by subtracting the perchannel mean and dividing by the per-channel standard deviation. Simple data augmentation was also applied in a similar fashion to the CIFAR datasets. Specifically, images were zero-padded with 12 pixels on each side and then a 96 × 96 crop was randomly extracted. Mirroring horizontally was also applied with 50% probability. To evaluate the performance of cutout on the STL-10 dataset we use a WideResNet with a depth of 16, a widening factor of 8, and dropout with a drop rate of p = 0.3 in the convolutional layers. We train the model for 1000 epochs with batches of 128 images using SGD with Nesterov momentum of 0.9 and weight decay of 5e-4. The learning rate is initially set to 0.1 but is reduced by a factor of 5x after the 300th, 400th, 600th, and 800th epochs. We perform a grid search over the cutout size parameter using 10% of the training images as a validation set and select a square size of 24 × 24 pixels for the no dataaugmentation case and 32 × 32 pixels for training STL-10 with data augmentation. Training the model using these values yields a reduction in test error of 2.7 percentage points in the no data augmentation case, and 1.5 percentage points when also using data augmentation, as shown in Table 2. Model WideResNet WideResNet + cutout STL10 23.48 ± 0.68 20.77 ± 0.38 STL10+ 14.21 ± 0.29 12.74 ± 0.23 Table 2: Test error rates on STL-10 dataset. “+” indicates standard data augmentation (mirror + crop). Results averaged over five runs on full training set. 4.4. Analysis of Cutout’s Effect on Activations In order to better understand the effect of cutout, we compare the average magnitude of feature activations in a ResNet18 when trained with and without cutout on CIFAR10. The models were trained with data augmentation using the same settings as defined in Section 4.1, achieving scores of 3.89% and 4.94% test error respectively. In Figure 4, we sort the activations within each layer by ascending magnitude, averaged over all samples in the test set. We observe that the shallow layers of the network experience a general increase in activation strength, while in deeper layers, we see more activations in the tail end of the distribution. The latter observation illustrates that cutout is indeed encouraging the network to take into account a wider variety of features when making predictions, rather than relying on the presence of a smaller number of features. Figure 5 demonstrates similar observations for individual samples, where the effects of cutout are more pronounced. 5. Conclusion Cutout was originally conceived as a targeted method for removing visual features with high activations in later layers of a CNN. Our motivation was to encourage the network to focus more on complimentary and less prominent features, in order to generalize to situations like occlusion. However, we discovered that the conceptually and computationally simpler approach of randomly masking square sections of the image performed equivalently in the experiments we conducted. Importantly, this simple regularizer proved to be complementary to existing forms of data augmentation and regularization. Applied to modern architectures, such as wide residual networks or shake-shake regularization models, it achieves state-of-the-art performance on the CIFAR10, CIFAR-100, and SVHN vision benchmarks. So why hasn’t it been reported or analyzed to date? One reason could be the fact that using a combination of corrupted and clean images appears to be important for its success. Future work will return to our original investigation of visual feature removal informed by activations. Cutout Baseline 1.50 1.25 1.00 0.75 0.50 1.2 1.0 0.8 0.6 0.4 Cutout Baseline 2.0 1.5 1.0 0.5 0.2 0.25 0.00 Cutout Baseline 1.4 Magnitude of activation Magnitude of activation 1.75 Magnitude of activation 2.00 0 20 40 60 80 100 Feature activations (sorted by magnitude) (a) 2nd Residual Block 120 0.0 0 50 100 150 200 Feature activations (sorted by magnitude) (b) 3rd Residual Block 250 0.0 0 100 200 300 400 Feature activations (sorted by magnitude) 500 (c) 4th Residual Block Figure 4: Magnitude of feature activations, sorted by descending value, and averaged over all test samples. A standard ResNet18 is compared with a ResNet18 trained with cutout at three different depths. Acknowledgements The authors thank Daniel Jiwoong Im for feedback on the paper and for suggesting the analysis in § 4.4. The authors also thank NVIDIA for the donation of a Titan X GPU. References [1] Y. Bengio, A. Bergeron, N. Boulanger-Lewandowski, T. Breuel, Y. Chherawala, et al. Deep learners benefit more from out-of-distribution examples. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pages 164–172, 2011. [2] A. Canziani, A. Paszke, and E. Culurciello. An analysis of deep neural network models for practical applications. In IEEE International Symposium on Circuits & Systems, 2016. [3] A. Coates, A. Ng, and H. Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pages 215–223, 2011. [4] X. Gastaldi. Shake-shake regularization. arXiv preprint arXiv:1705.07485, 2017. [5] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016. [6] G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R. R. Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. [7] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. [8] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012. [9] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradientbased learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [10] J. Lemley, S. Bazrafkan, and P. Corcoran. Smart augmentation-learning an optimal data augmentation strategy. IEEE Access, 2017. [11] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, pages 3431– 3440, 2015. [12] Y. Netzer, T. Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, volume 2011, page 5, 2011. [13] S. Park and N. Kwak. Analysis on the dropout effect in convolutional neural networks. In Asian Conference on Computer Vision, pages 189–204. Springer, 2016. [14] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. Context encoders: Feature learning by inpainting. In CVPR, pages 2536–2544, 2016. [15] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014. [16] J. Tompson, R. Goroshin, A. Jain, Y. LeCun, and C. Bregler. Efficient object localization using convolutional networks. In CVPR, pages 648–656, 2015. [17] A. Toshev and C. Szegedy. Deeppose: Human pose estimation via deep neural networks. In CVPR, pages 1653–1660, 2014. [18] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.A. Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 11(Dec):3371–3408, 2010. [19] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, pages 3156–3164, 2015. [20] H. Wu and X. Gu. Towards dropout training for convolutional neural networks. Neural Networks, 71:1–10, 2015. [21] R. Wu, S. Yan, Y. Shan, Q. Dang, and G. Sun. Deep image: Scaling up image recognition. arXiv preprint arXiv:1501.02876, 7(8), 2015. [22] S. Zagoruyko and N. Komodakis. Wide residual networks. British Machine Vision Conference (BMVC), 2016. A. Supplementary Materials 2.00 Cutout Baseline 1.00 0.75 0.50 Magnitude of activation 1.25 1.0 0.8 0.6 0.4 0 20 40 60 80 100 Feature activations (sorted by magnitude) 0.0 120 0 50 Cutout Baseline 40 60 80 100 Feature activations (sorted by magnitude) 0.4 0.2 0 50 150 200 0.6 0.4 300 400 500 Cutout Baseline 1.5 1.0 0.5 0.0 250 0 100 200 300 400 Feature activations (sorted by magnitude) 500 (f) 4th Residual Block 0.6 0.5 0.4 0.3 0.2 Cutout Baseline 2.0 Magnitude of activation 0.8 200 Feature activations (sorted by magnitude) 2.0 Cutout Baseline 0.7 Magnitude of activation Magnitude of activation 100 Feature activations (sorted by magnitude) 0.8 Cutout Baseline 0.2 1.5 1.0 0.5 0.1 0 20 40 60 80 100 Feature activations (sorted by magnitude) 0.0 120 0 50 200 1.25 1.00 0.75 0.50 1.2 1.0 0.8 0.6 0.4 0.2 0.25 20 40 60 80 100 Feature activations (sorted by magnitude) (j) 2nd Residual Block 0 100 120 0.0 200 300 400 Feature activations (sorted by magnitude) 500 (i) 4th Residual Block 2.00 Cutout Baseline 1.4 Magnitude of activation 1.50 0 0.0 250 (h) 3rd Residual Block Cutout Baseline 1.75 150 Cutout Baseline 1.75 Magnitude of activation 2.00 100 Feature activations (sorted by magnitude) (g) 2nd Residual Block Magnitude of activation 100 (e) 3rd Residual Block 1.0 0.00 0 (c) 4th Residual Block 0.6 0.0 120 1.2 0.0 1.0 0.0 250 Cutout Baseline (d) 2nd Residual Block 1.4 200 Magnitude of activation 0.5 20 150 0.8 Magnitude of activation Magnitude of activation 1.0 0 1.5 (b) 3rd Residual Block 1.5 0.0 100 Feature activations (sorted by magnitude) (a) 2nd Residual Block 2.0 2.0 0.5 0.2 0.25 Cutout Baseline 2.5 1.2 1.50 0.00 Cutout Baseline 1.4 Magnitude of activation Magnitude of activation 1.75 1.50 1.25 1.00 0.75 0.50 0.25 0 50 100 150 200 Feature activations (sorted by magnitude) (k) 3rd Residual Block 250 0.00 0 100 200 300 400 Feature activations (sorted by magnitude) 500 (l) 4th Residual Block Figure 5: Magnitude of feature activations, sorted by descending value. Each row represents a different test sample. A standard ResNet18 is compared with a ResNet18 trained with cutout at three different depths.
1cs.CV
Subtree Isomorphism Revisited Amir Abboud Stanford University [email protected] Arturs Backurs MIT arXiv:1510.04622v1 [cs.CC] 15 Oct 2015 Thomas Dueholm Hansen Aarhus University [email protected] Virginia Vassilevska Williams Stanford University [email protected][email protected] Or Zamir Tel Aviv University [email protected] Abstract The Subtree Isomorphism problem asks whether a given tree is contained in another given tree. The problem is of fundamental importance and has been studied since the 1960s. For some variants, e.g., ordered trees, near-linear time algorithms are known, but for the general case truly subquadratic algorithms remain elusive. Our first result is a reduction from the Orthogonal Vectors problem to Subtree Isomorphism, showing that a truly subquadratic algorithm for the latter refutes the Strong Exponential Time Hypothesis (SETH). In light of this conditional lower bound, we focus on natural special cases for which no truly subquadratic algorithms are known. We classify these cases against the quadratic barrier, showing in particular that: • Even for binary, rooted trees, a truly subquadratic algorithm refutes SETH. • Even for rooted trees of depth O(log log n), where n is the total number of vertices, a truly subquadratic algorithm refutes SETH. • For every constant d, there is a constant εd > 0 and a randomized, truly subquadratic algorithm for degree-d rooted trees of depth at most (1 + εd ) logd n. In particular, there is an O(min{2.85h , n2 }) algorithm for binary trees of depth h. Our reductions utilize new “tree gadgets” that are likely useful for future SETH-based lower bounds for problems on trees. Our upper bounds apply a folklore result from randomized decision tree complexity. 1 Introduction Trees are among the most frequently used and commonly studied objects in computer science. One of the most basic and fundamental computational problems on trees is whether one tree is contained in another, that is, can an isomorphic copy of H be obtained by deleting nodes and edges ∗ A.A. and V.V.W. were supported by NSF Grants CCF-1417238 and CCF-1514339, and BSF Grant BSF:2012338. A.B. was supported by the NSF and the Simons Foundation; part of the work was done while the author was at the Thomas J. Watson Research Center. T.D.H. was supported by the Carlsberg Foundation, grant no. CF14-0617. O.Z. was supported by BSF grant no. 2012338 and by The Israeli Centers of Research Excellence (I-CORE) program (Center No. 4/11). 1 of G. This problem is known under three names: Subtree Isomorphism, Tree Pattern Matching and Subgraph Isomorphism on Trees. There are a few variants of the problem, mainly determined by (1) whether the trees are rooted or unrooted, (2) whether their degrees are bounded, and (3) whether the trees are ordered, i.e. whether the order of the children of each node must be preserved by the isomorphism. In this paper we focus on the case of rooted, unordered trees with degrees bounded by a constant d. Because of its fundamental importance, the time complexity of Subtree Isomorphism has been studied since the 1960s, e.g. by Matula [44] and Edmonds (see [45]). The problem is an interesting special case of the Subgraph Isomorphism problem, studied extensively in theoretical computer science. Subgraph Isomorphism is well known to be NP-hard since it generalizes hard problems such as Clique [34]. It is notoriously difficult: unlike most natural NP-complete problems, it requires 2ω(n) time (under the exponential time hypothesis (ETH)) [18]. Special cases of subgraph isomorphism, especially ones that are in P, have received extensive attention. A recent 85-page paper by Marx and Pilipczuk [42] covers the case in which H is of fixed constant size. Besides fixing the size of H, there are other non-trivial ways to make the problem polynomial time solvable; Subtree Isomorphism is the earliest and arguably the most natural one. Polynomial time algorithms were also obtained for biconnected outerplanar graphs [39], two-connected series-parallel graphs [41], and more [43, 19], while it is known that further generalizations quickly become NP-hard, e.g., when G is a forest and H is a binary tree [24]. The problem is also of practical relevance, since it can model important applications in a wide variety of areas. Subtree Isomorphism is at the core of many more expressive problems, such as Largest Common Subtree [35, 6, 7], which generally ask: how “similar” are two trees? Application areas include computational biology [58], structured text databases [36], and compiler optimization [52]. Several definitions of tree-similarity have been proposed, and the search for fast algorithms for computing them, both in theory and in practice, has been ongoing for a few decades - see [10, 23, 27, 53] for surveys and textbooks. We focus on Subtree Isomorphism, and then briefly discuss how the techniques introduced in this paper can be adapted to prove new results for the Largest Common Subtree problem as well. Previous results. According to Matula [45], the first algorithms for Subtree Isomorphism were proposed in 1968 independently by Edmonds and Matula himself [44]. 10 years later, Reyner [48] and Matula [45] showed that these algorithms run in polynomial time and the runtime is O(n2.5 ). The algorithm executes many calls to a subroutine that solves maximum matching in bipartite graphs. These result were for rooted trees, and later Chung [14] showed that the same bounds can be achieved for unrooted trees. In 1983, Lingas [38] shaved a log factor, and the most recent development was in 1999 by Shamir and Tsur [51] who used the more recent randomized algorithms for bipartite matching [13] to reduce the runtime to O(nω ) where ω < 2.373 is the matrix multiplication exponent [56, 22]. Interestingly, in the most basic case of rooted and constant degree trees, even the early algorithms run in O(n2 ) time, and the fastest known runtime is O(n2 / log n) [38, 51]. For comparison, when the trees are ordered, a long line of STOC/FOCS papers [37, 21, 15, 32, 33, 16] brought down the complexity of the problem from quadratic [28] to O(n log n) time [17]. It is natural to wonder whether the same improvements can be achieved in the case of unordered trees. 2 Main results. Our main result is a conditional lower bound for Subtree Isomorphism. We show that a truly subquadratic algorithm is unlikely, even on very restricted cases such as those of binary, rooted trees or rooted trees of depth O(log log n). A matching upper bound, up to no(1) factors, has been known since the 1960s (we briefly discuss this algorithm in Section 3). Our lower bounds are conditioned on the well-known Strong Exponential Time Hypothesis (SETH) of Impagliazzo, Paturi and Zane [30, 31] which roughly states that as k grows, k-SAT on n variables requires 2(1−ε)n poly(n) time for all ε > 0. Our result for Subtree Isomorphism is the first “SETH-hard” problem on trees, which is an exciting addition to the diverse list1 which already includes problems on vectors [55], (general) graphs [47, 49, 3, 2], sequences [5, 9, 1, 12], and curves [11]. Our ideas and constructions of “tree gadgets” are useful for proving conditional lower bounds for other problems on trees. We demonstrate this with a lower bound for the Largest Common Subtree problem, discussed below. Theorem 1. For all d ≥ 2, Subtree Isomorphism on two rooted, unordered trees of size O(n), degree d, and height h ≤ 2 logd n + O(log log n) cannot be solved in truly subquadratic O(n2−ε ) time under SETH. More generally, if the size of the smaller tree is n and the bigger tree is m, then our lower bound says that O(nm1−ε ) time refutes SETH. We remark that since SETH is believed to hold even for randomized algorithms, our lower bound is also a barrier for truly subquadratic randomized algorithms. To complement our lower bound, we proceed to tackle natural restrictions of the problem algorithmically. The most natural way to restrict tree inputs is to bound the degree or height. Our lower bound leaves little room for improvement: Even on binary trees of height (2 + o(1)) log n any algorithm must take quadratic time under SETH (note that the minimum height of a binary tree is log n). An intriguing case is when the trees are binary and almost complete, i.e., d = 2 and h = (1 + o(1)) log n. We are unable to show a super-linear lower bound in this case, nor are we able to obtain a deterministic algorithm that runs in truly subquadratic time. Nevertheless, we present a randomized, Las Vegas, algorithm that solves this case in truly subquadratic O(n1.507 ) time. Our algorithm solves more general cases: Theorem 2. There is a randomized algorithm for rooted Subtree Isomorphism with expected running time O(min{2.8431h , n2 }) for trees H and G of size O(n) and height at most h. In particular, the algorithm runs in time O(n1.507 ) for trees of depth (1 + o(1)) · log2 n and is truly subquadratic for trees of depth h ≤ 1.3267 · log2 n. Our algorithm is simple, natural, and easy to implement. Perhaps more interesting than the upper bound itself is that the technique we use to obtain it uses a technique from randomized decision tree complexity. We also consider the case of ternary trees, providing a fast Las Vegas algorithm for it. Our approach is similar to that of the binary tree case. However, here we use a computer program to analyze the expected running time of the algorithm. Theorem 3. There is a randomized algorithm that can solve Subtree on two rooted  Isomorphism  ternary trees of size O(n) and height at most h in expected O min 6.107h , n2 time. 1 These are problems with O(nc ) upper bounds for some c > 1 and an O(nc−ε ) algorithm, for some ε > 0, is known to refute SETH. 3 Finally, we generalize our algorithms to obtain truly subquadratic algorithms for rooted Subtree Isomorphism on trees with small height and constant degree d, for any d ≥ 2. Theorem 4. There is a randomized algorithm that solves Subtree Isomorphism on two rooted trees of size O(n), constant degree d, and height at most h in expected time ( )! h 1 2 O min d2 − d + , n2 . 3 3 In particular, the algorithm is strongly subquadratic for trees of height ! log(d2 ) h ≤ −  · logd n , log(d2 − 13 d + 23 ) for any constant  > 0. The bound in the above theorem is not tight for small d, as our algorithms for d = 2 and d = 3 show. For example, it is not subquadratic (on small depth trees) unless d > 3. To obtain the upper bound, we prove a new randomized query complexity upper bound for bipartite perfect matching, which could be of independent interest (Lemma 4). This work is another example of a fine-grained study of the complexity of fundamental problems in P under natural parameterizations. This approach was formalized in two recent works [4, 25]. Techniques and other results. To prove our SETH hardness results we show reductions from Orthogonal Vectors to Subtree Isomorphism in Section 2. The reductions follow all previous SETHhardness results in spirit, but require careful constructions of “tree gadgets” that represent vectors, as well as techniques for combining the gadgets into two big trees H and G for which the existence of an orthogonal pair of vectors determines whether H is contained in G. Our reduction is clean and simple, but it gets more tricky when restricted to trees of constant degree. Our reduction is easily modified to obtain similar lower bounds for related problems such as Largest Common Subtree on two trees (LCST). This problem is NP-hard when the number of trees is a parameter or when the two trees are labelled (and unrooted) [59, 57], while some approximation and parameterized algorithms are known [35, 7, 6]. When the two trees are binary and unlabeled, the problem can be solved in quadratic time, and an adaptation of Theorem 1 shows that even when the height is (1 + o(1)) log n, a truly subquadratic algorithm refutes SETH. Theorem 5. For all d ≥ 2, The Largest Common Subtree problem on two rooted trees of size O(n), degree d and height h ≤ logd n + O(log log n) cannot be solved in truly subquadratic O(n2−ε ) time under SETH. Theorem 5 is surprising when contrasted with our other results. On the one hand, for arbitrary rooted trees with constant degrees, both Subtree Isomorphism and the harder-looking LCST have tight quadratic upper and (conditional) lower bounds. On the other hand, we show that under the further restriction that the trees have small depth (as in Theorem 2), Subtree Isomorphism can be solved in truly subquadratic time, while by Theorem 5 the LCST problem cannot, under SETH. We attribute our new algorithmic results to two ingredients. The first important ingredient comes from our lower bounds. In particular we noticed that when the trees are binary and the 4 depth is (1 + ε) log n, it is difficult to implement our reductions. This turned our attention to finding upper bounds. Knowing the hard cases thus allowed us to focus on the solvable cases. This is an important byproduct of the recent research on conditional lower bounds in P. The second ingredient was making a connection between this problem and a seminal result from randomized decision tree complexity [50]. Our algorithm for binary (and ternary) trees is inspired by the following well-known result from complexity theory: Given a formula represented by a complete AND-OR tree on n leaves that represent the variables, can you evaluate the formula without looking at all the inputs? The surprising fact is that this is possible with randomization: to evaluate a gate, we guess which child to check first at random, and if we see a 1 input to an OR gate, or a 0 input to an AND gate, we do not have to check the other child. Therefore it is possible to evaluate the formula by only looking at n1−ε inputs. This result has found many applications in various areas of complexity theory, learning theory, and quantum query complexity [8]. Other related work. In the late 1980s, Subtree Isomorphism was considered from the viewpoint of efficient parallel algorithms. Lingas and Karpinski [40] placed the problem in randomized N C 1 . Gibbons, Miller, Karp, and Soroker [26] independently obtained the same result and also showed an N C 1 reduction from bipartite matching to Subtree Isomorphism. Their reduction takes a matching instance on n nodes and produces trees on Ω(n3 ) nodes, and therefore does not imply a lower bound on the time complexity of Subtree Isomorphism even assuming that current matching algorithms are optimal. Note that any many-to-one reduction from matching (where the input is of size Ω(n2 )) will generate trees of size Ω(n2 ). To get our quadratic lower bound we reduce from a different problem, namely Orthogonal Vectors. Many related cases of the problem can be solved in near-linear time. For example, when both trees have exactly the same size, we get the Tree Isomorphism problem which was solved in O(n) time by Hopcroft and Tarjan [29], and later other linear time algorithms were suggested (see [20] and the references therein). Another example is the case of ordered trees, meaning that there is an order among the children of a node that cannot be modified in the isomorphism. Also, when a “subtree” is defined to be a node and all its descendants, “subtree” isomorphism can be solved in linear time [54]. 2 SETH Lower Bounds The Strong Exponential Time Hypothesis (SETH) states that for every ε > 0 there exists a k such that k-SAT on n variables cannot be solved in O(2(1−ε)n polyn) time. Williams [55] related SETH to a polynomial time problem called Orthogonal Vectors (OV). The inputs to OV are two lists of N vectors in {0, 1}D and the output is “yes” if and only if there is a pair of vectors α, β, one from each list, that are orthogonal, i.e. for all i ∈ [D] either α[i] or β[i] is equal to 0. Williams reduced CNF-SAT to OV so that if OV can be solved in O(N 2−ε ) time when D = ω(log N ), for some ε > 0, 0 then CNF-SAT on n variables and poly n clauses can be solved in O(2(1−ε )n poly n) time for some ε0 > 0, and SETH is false. In this section we reduce CNF-SAT, via the Orthogonal Vectors (OV) problem, to different variants of the Subtree Isomorphism problem to prove our SETH-based lower bounds. 5 2.1 Hardness for Subtree Isomorphism A simpler reduction. We start with a “warm-up” reduction that presents the high-level idea of our proofs. In Theorem 6 below we reduce OV to Subtree isomorphism on trees with n = O(N D) vertices, unbounded degree, and height h = O(D). We later show how to change the construction to get trees with small constant degree and small height. Theorem 6. Orthogonal Vectors on two lists of N vectors in {0, 1}D can be reduced to Subtree Isomorphism on two trees of size O(N D) and depth O(d). Proof. Let us denote the vectors of the first list by A = {α1 , . . . , αN } and of the second list by B = {β1 , . . . , βN } and recall that our goal is to find a pair of vectors α ∈ A, β ∈ B such that for every coordinate i ∈ [D] either α[i] = 0 or β[i] = 0. The first ingredient in the reduction is to construct vector gadgets. For every vector in the first list α ∈ A we create a vector gadget: a tree Hα of size O(D) as follows. First, add a path u0 → u1 → u2 → · · · → uD+2 and let u0 be the root of Hα . Then, for each coordinate i ∈ [D] we consider α[i] and if it is a 1 we add a node ui,1 to the tree Hα as the child of the node ui , i.e. we add the edge ui → ui,1 . Otherwise, if α[i] = 0, the only child of ui will be ui+1 . We now define the vector gadgets for the vectors in the second list. For every β ∈ B we create a vector gadget: a tree Gβ of size O(D) as follows. The first step is similar, we add a path v0 → v1 → v2 → · · · → vD+2 and let v0 be the root. The difference is in the second step. For each coordinate i ∈ [D], we consider β[i] and if it is a 0 we add a node vi,0 to Gβ as the child of the node vi , i.e. we add the edge vi → vi,0 . The following simple claim is the key to our reduction and explains our gadget constructions. Claim 1. Hα is isomorphic to Gβ iff α, β are orthogonal. Proof. For the first direction, assume that α, β are orthogonal and therefore for every i ∈ [D] we know that either α[i] = 0 or β[i] = 0. We will define a mapping f from Hα to a subgraph of Gβ such that if {u, v} is an edge in Hα then {f (u), f (v)} is an edge in Gβ . First, we map the roots and paths to each other, by setting f (ui ) = vi for all i ∈ {0, . . . , D + 2}. Then, we consider every i ∈ [D] for which α[i] = 1 and map ui,1 to the node vi,0 in Gβ . We are guaranteed that vi,0 exists because if α[i] = 1 then β[i] must be 0, by the orthogonality of the vectors. It is easy to check that two neighbours in Hα are mapped to two neighbours in Gβ . For the other direction, assume Hα is isomorphic to a subgraph of Gβ , and let f be the mapping. First, note that u0 must be mapped to v0 since these are the roots of the two trees. Then we observe that uD+2 must be mapped to vD+2 and the path u0 → · · · → uD+2 must be mapped to the path v0 → · · · → vD+2 since these are the only paths of length at least (D + 2) in the trees. Now, let i ∈ [D] be such that α[i] = 1 and note that ui must have degree 3 in this case, which implies that f (ui ) = vi must also have degree at least 3 in Gβ , which implies that the node vi,0 must exist, and β[i] = 0. Thus, whenever α[i] = 1 it must be the case that β[i] = 0, and the vectors are orthogonal. The final step is to combine the vector gadgets into two trees H, G in a way such that H is isomorphic to a subtree of G if and only if there is a pair of orthogonal vectors within our two lists. To this end, we define a special vector γ = ~0 to be the all-zero vector in D dimensions. By Claim 1, for any vector β ∈ {0, 1}D , we have that Hβ is isomorphic to a subtree of Gγ . 6 We are now ready to define the trees H and G of size O(N D). G will be composed of a root node g of degree (2N − 1) that has Gβj as a child for every βj ∈ B, in addition to (N − 1) distinct Gγ gadgets. That is, first, for each j ∈ [N ] add the vector gadget Gβj to G and add the edge g → v0 where v0 is the root of Gβj . And then, we add (N − 1) trees (1) (n−1) (j) Gγ , . . . , Gγ to G and for each j ∈ [N − 1] we add the edge g → v0 where v0 is the root of Gγ . H will be constructed in a similar way, except we do not add the γ vector gadgets. Create a root node h of degree N that has Hαj as a child for every αj ∈ A. As in the definition of G, we add edges h → u0 where u0 is the root of Hαj , for every j ∈ [N ]. Before proving the correctness of the reduction, note that the size of each tree is indeed O(N D) since each gadget has size O(D) and we are combining O(N ) gadgets into our trees H, G. To conclude the proof, we claim that H is isomorphic to a subgraph of G iff there is a pair of orthogonal vectors. Claim 2. In the above reduction, H is isomorphic to a subtree of G iff there is a pair α ∈ A, β ∈ B of orthogonal vectors. Proof. For the first direction, assume that there is a pair of orthogonal vectors α ∈ A, β ∈ B and we will show that H is isomorphic to a subtree of G. Consider the mapping which maps Hα to Gβ as in Claim 1, and then for each of the (N − 1) Hα0 subtrees, for α0 6= α, we map it to a different Gγ subtree of G. Finally, the root h is mapped to g. It is easy to check that neighbours in H are mapped to neighbours in G. For the other direction, assume that H is isomorphic to a subgraph of G and let f be the corresponding mapping. We know that f (h) = g and for each vector gadget Hαj in H, its image using our mapping f must be entirely contained in exactly one vector gadget Gx in G, where x ∈ B ∪ {γ}. Moreover, two gadgets Hα , Hα0 cannot be mapped to the same gadget Gx . There are N Hα gadgets but only (N − 1) Gγ gadgets, thus, by the pigeonhole principle, there must be at least one α ∈ A for which Hα is mapped to a gadget Gx for x 6= γ, i.e., x = β for some β ∈ B. We conclude that there is a mapping from Hα to Gβ in which every two neighbours are mapped to neighbours, that is, that Hα is isomorphic to a subgraph of Gβ , which, by Claim 1, implies that α ∈ A, β ∈ B are orthogonal. Shorter Vector Gadgets. Next, we show how our reductions can be implemented with trees of smaller depth, by introducing a new construction of vector gadgets. We will use these gadgets in our final reductions that prove Theorems 1 and 5. Lemma 1. Given two vectors α, β ∈ {0, 1}D we can construct two binary rooted trees Hα , Gβ of depth 3 log2 (D) + O(1) in linear time, such that Hα is isomorphic to a subtree of Gβ if and only if α, β are orthogonal. Proof. Our constructions will involve careful combinations of “index gadgets”, which are defined as follows. For a sequence of ` binary values b1 , b2 , . . . , bl , we define a tree “index gadget” Qb1 ,b2 ,...,bl (think of ` as being dlog2 (D + 1)e and think of b1 , b2 , . . . , bl as bits representing an index in [D]) to be composed of a path z1 → z2 → ... → zl of length l, in which z1 is the root, and for all i ∈ [l] we attach a child zi,1 to zi if and only if bi = 1. That is, our index gadget Qb1 ,b2 ,...,bl is representing the index in the natural way: the edge zi → zi,1 will exist if and only if bi = 1. 7 Our first “vector gadget” Hα is constructed as follows. First, we build a complete binary tree with D leaves u1 , u2 , . . . , uD where the subtree at each leaf ui will encode the entry α[i] using our “index gadgets”. We assume that every index i ∈ [D] can be represented by l = dlog2 (D + 1)e bits and we let ī denote this representation and let īS denote the binary sequence obtained by flipping each bit of ī. For each node ui we will attach three gadgets, one after the other: first we will attach the Qī index gadget, then we follow it by the QīS index gadget, and finally we append a path of length either 2 or 3 – depending on α[i]. The necessity of this complicated encoding will become clear in the proof of correctness below. More formally, we first attach ui → Qī , then we let zl0 denote the node of Qī corresponding to zl in the above construction (i.e. the last node on the path), and attach zl0 → QīS . Then, similarly, we let zl00 be the node of QīS which corresponds to zl in the above construction (i.e. the last node on the path), and we either attach three nodes zl00 → ai → bi → ci if α[i] = 1, or we attach only two nodes zl00 → ai → bi . The second “vector gadget” Gβ is constructed in the same way except that we attach a path of length 3 if β[i] = 0 (as opposed to 1) and attach a path of length 2 if β[i] = 1. By construction, the depth of both trees is 3 log2 (D) + O(1) as claimed. To complete the proof we show that Hα is isomorphic to a subtree of Gβ iff α · β = 0. The first direction is easy: if the vectors are orthogonal then the natural mapping from Hα to Gβ that follows from our construction shows the isomorphism: map the binary trees on top to each other so that the ui ’s are mapped to each other, then map the attached Qī → QīS subtrees to each other, and finally, we can map the paths ai → bi → ci (if α[i] = 1) or ai → bi (if it is 0) to each other since in the first case β[i] must be zero and ci will also exist in Gβ . It remains to show that if Hα is isomorphic to a subtree of Gβ , then α · β = 0. Our index gadgets Qī and QīS will play a crucial role in this part, as they will show that in any mapping between the leaves of the complete tree we must map ui in Hα to ui in Gβ or else the index gadgets will not map into each other properly. We claim that for any two indices i, j ∈ [D] we have that i = j if and only if both Qī is contained in Qj̄ and QīS is contained in Qj̄ S . This is true because of the following observation: Qx̄ is isomorphic to a subtree of Qȳ iff the set of positions in x̄ with 1 is a subset of the set of positions of ȳ with 1. Therefore, any mapping from Hα to a subtree of Gβ must map the path representing α[i] to the path representing β[i], for all i ∈ [D]. By construction, this can only happen if α · β = 0. Constant Degree Trees. Perhaps the most challenging element towards the proof of Theorem 1 is the combination of all the vector gadgets into two big trees, without using large degrees. To see the difficulty, recall the reduction in the proof of Theorem 6: in both trees, we added all X vector gadgets as children of a root of degree X. By doing so we have essentially allowed the isomorphism to pick any matching between the gadgets. Combined with the auxiliary gadgets that we added, this allowed us to show that the final two trees are a “yes” instance of Subtree Isomorphism if and only if the original vectors contained an orthogonal pair. However, when the trees have constant degree (say, binary) it is much harder to combine the vector gadgets into two trees such that any matching between the gadgets can be chosen by the isomorphism. A natural approach would be to add the gadgets at the leaves of a complete binary tree. One reason this does not work is that any isomorphism must map the first and second gadgets to adjacent gadgets in the second tree – that is, only special kinds of matchings can be “implemented”. We overcome this difficulty with a two-level construction that allows the isomorphism to pick exactly one gadget from each of the two trees and “match” them, while all the other gadgets do 8 not affect the outcome. Theorem 7. Given sets of vectors A, B, we can construct two rooted trees H = H(A) and G = G(B) such that the following properties hold. 1. The number of nodes in both trees and the construction time is upper bounded by O(N D). 2. The degree of both trees is upper bounded by d. 3. The depth of both trees is upper bounded by 2 logd (N ) + O(log D). 4. H is isomorphic to a subtree of G iff there are α ∈ A and β ∈ B with α · β = 0. Proof. Let {Hα }α∈A = {Hαi }i∈[N ] and {Gβ }β∈B = {Gβi }i∈[N ] be the two sets of vector gadgets corresponding to the vectors of A and B that are obtained by the construction in Lemma 1. We will now combine these vector gadgets into two big trees H and G, which will be constructed quite differently from each other. Assume that logd (N ) is an integer, otherwise add dummy vectors to increase N . The first tree H will be composed of a complete d-ary tree with N leaves u1 , u2 , . . . uN , followed by a path of length logd (N ) + 1, followed by the vector gadgets Hαi . More formally, for every i ∈ [N ] we add: ui → hi,1 → hi,2 → . . . → hi,logd (N )+1 → Hαi . To construct the second tree G we need to construct vector gadgets Gγ corresponding to the all-zero vector γ = ~0 of length D. As before, we start with a complete d-ary tree with N leaves v1 , v2 , . . . vN and attach a path of length logd (N ) + 1 to each leaf, except for vN which will be treated differently. Then, we attach a copy of Gγ at the end of each one of these paths, that is N − 1 copies in total. Formally, for every i = 1, . . . , N − 1 we add: vi → hi,1 → hi,2 → . . . → hi,logd (N )+1 → Gγ . Note that none of the vectors in the second list are encoded in this part of G and they will appear now in the subtree rooted at vN which we construct next. Rooted at vN , we add another complete 0 , and then attach the vector gadgets right after these leaves. d-ary tree with N leaves v10 , v20 , . . . vN That is, for every i ∈ [N ] we add: vi0 → Gβi . This finishes the construction of H and G and the first two properties are immediate. The third property follows from Lemma 1, and we now turn to proving the fourth property which is the correctness of our construction. Claim 3. There is a pair of vectors α ∈ A and β ∈ B with α · β = 0 if and only if H is isomorphic to a subtree of G. Proof. For the first direction, let αi and βj be a pair of orthogonal vectors and we will show that H is contained in G. First, consider the rearrangement of H so that the rightmost leaf of the complete d-ary tree (where uN used to be) is ui , the node to which the vector gadget Hαi is attached. We claim that all vector gadgets in H can now be properly mapped to subtrees of G, without rearranging the vi nodes in G. To see this, first note that all vector gadgets Hαx for x 6= i will be paired up with the Gγ vector gadgets, and by Lemma 1 and the fact that γ is orthogonal to any vector, we know that there is a proper mapping. Then, it remains to show that the subtree 9 of H rooted at ui is contained in the subtree of G rooted at vN , which follows because we can map the vector gadget Hαi to the vector gadget Gβj since αi · βj = 0. For the second direction, assume that there is a mapping from H to a subtree of G and we will show that there must exist a pair of orthogonal vectors. First, note that under this mapping, there is some i ∈ [N ] such that ui is mapped to vN . By construction of the subtree rooted at vN , this means that the vector gadget Hαi must be mapped into one of the vector gadgets Gβj for some j ∈ [N ], and not into Gγ . By Lemma 1, this can only happen if αi · βj = 0. Theorem 7 and the connection between SETH and OV of Williams [55] imply Theorem 1 from the introduction. 2.2 Hardness for Largest Common Subtree Next, we prove a lower bound for the Largest Common Subtree (LCST) problem, which is a generalization of Subtree Isomorphism. Although the reductions above already imply a quadratic lower bound for LCST, we will now optimize these reductions and prove a stronger hardness result: we will show that even on binary trees of depth (1 + o(1)) log n the LCST cannot be computed in truly subquadratic time. This will show an interesting gap between LCST and Subtree Isomorphism, since the latter can be solved in truly subquadratic time on such trees - we present such upper bounds in Section 3. Our strengthened hardness result gives an explanation for why we are not able to extend our upper bounds to LCST: such extensions would refute SETH. The next theorem implies Theorem 5 from the introduction. Theorem 8. If for some ε > 0, the Largest Common Subtree problem on two trees size n can be solved in O(n2−ε ) time, then Orthogonal Vectors on N vectors in {0, 1}D can be solved in O(N 2−ε · DO(1) ) time. The trees produced in the reduction from the Orthogonal Vectors problem have degree d and height at most logd (N ) + O(log D) for arbitrary d ≥ 2. Proof. We note that the construction provided in Theorem 7 is not sufficient for our purposes because the height of the produced trees is 2 logd (N ) + O(log D), which is larger than what we want. We will use the more expressive nature of LCST to implement our reduction with smaller height. To achieve smaller height, we will try to implement vector gadgets such that the largest common subtree of two gadgets would be of a certain fixed size E if the vectors are not orthogonal, while it will be of a larger size E 0 > E if the vectors are orthogonal. This trick was introduced by Backurs and Indyk in their reduction to Edit-Distance [9] and later used in the reductions to LCS [1]. Here, we carefully implement such gadgets with degree d trees of small height instead of sequences. WLOG, we can assume that all vectors in A start with 1 and all vectors in B start with 0. If it is not so, we can add an extra coordinate at the beginning of every vector and set the entry accordingly. This does not change the answer to the problem (whether there are two orthogonal vectors). Also, we assume that all vectors in A have the same number of entries equal to 1. If it is not so, we can subdivide the set A into smaller sets so that every set contain vectors with the same number of entries equal to 1. Then we run the reduction on every subset of A and B. This increase the runtime to solve the Orthogonal Vectors problem by a factor of D + 1 but we are fine with that. 10 For each vector in the first list, α ∈ A, we construct a vector gadget Hα as follows. Let Hα0 be the vector gadget constructed in Lemma 1 corresponding to vector α ∈ A. Then Hα is equal to r → root(Hα0 ) for some vertex r, which is the root of Hα . For each vector in the second list, β ∈ B, we construct a vector gadget Gβ as follows. Let δ be a vector with D coordinates. The first entry is equal to 1 and the rest of entries are equal to 0. Let G0β be the vector gadget constructed in Lemma 1 corresponding to vector β ∈ B. Then we obtain Gβ by choosing a vertex r to be its root and adding r → G0δ and r → G0β . The main idea behind this construction is that, when matching Hα and Gβ , one has a choice: either match Hα0 to G0δ (giving a fixed score, independent of α), or match it to G0β (and the score then depends on the orthogonality of α and β.) We make this argument formal in the next lemma. Let E 0 denote the size of Hα for α ∈ A, which is independent of α since all vectors in A contain the same number of 1’s. Let E = E 0 − 1. Lemma 2. The largest common subtree of Hα and Gβ is of size E 0 = |Hα | if α, β are orthogonal and it is of size E = E 0 − 1 otherwise. We have that the size of Hα and Hα0 are equal |Hα | = |Hα0 | for all α, α0 ∈ A. Proof. First, if α, β are orthogonal, then by Lemma 1 we have that Hα is isomorphic to a subgraph of Gβ and the LCST has size E 0 . For the second case, assume that α, β are not orthogonal. We first remark that there is a common subtree of size E 0 − 1: Let α0 denote α where we set the first coordinate of α (which is equal to 1) to 0, then Hα0 0 is a subtree of Hα0 of size |Hα0 0 | = E 0 − 1, and by Lemma 1, it is also a subtree of G0δ because α0 · δ = 0. It remains to show that we cannot map the entire tree Hα to a subtree of Gβ , which follows because Hα0 is neither isomorphic to a subtree of G0δ (since α · δ = 1) nor to a subtree of G0β (since α · β 6= 0). We are now ready to present the final trees H, G. We construct H as follows. First, we build a complete d-ary tree with N leaves h1 , . . . , hN at the lowest level. For every j ∈ [N ], we add hj → Hαj , where A = {α1 , . . . , αN }. Similarly we construct G. Take a complete d-ary tree with leaves g1 , . . . , gN at the lower level. For every j ∈ [N ], we add gj → Gβj , where B = {β1 , . . . , βN }. Theorem 9. The Largest Common Subtree of H and G is of size at most (2N − 1) + (N · E) if there is no pair of orthogonal vectors, and is at least (2N − 1) + (N · E + 1) otherwise. Proof. We must map the nodes hi for every i ∈ [N ] to nodes gπ(i) , for some permutation π : [N ] → [N ]. Notice, however, that π cannot be an arbitrary permutation since, e.g. π(1) = π(2) ± 1 (the permutation must be implemented by swapping children in a complete binary tree.) On the one hand, the total size of the common subtree can be upper bounded by the size of P a complete binary tree with N leaves, plus N LCST (Hαi , Gβπ(i) ), for an arbitrary permutation i=1 π. If there is no pair of orthogonal vectors, then by Lemma 2, the latter sum is exactly N · E, and the total size is bounded by (2N − 1) + N · E. On the other hand, if there is an orthogonal pair αi , βj , we can take any mapping in which hi is mapped to gj while the other hx ’s are mapped arbitrarily to different gy ’s. This induces some permutation π : [N ] → [N ] so that hx is mapped to gπ(x) . Since αi · βj = 0, Lemma 2 implies that this mapping can be completed to a mapping of score (2N − 1) + N X LCST (Hαv , Gβπ(v) ) ≥ (2N − 1) + (N − 1) · E + (E + 1) = (2N − 1) + (N · E + 1) . v=1 11 3 Algorithms In this section we present new algorithms for Subtree Isomorphism on rooted trees with vertices of bounded degree. Edmonds and Matula independently described a procedure for reducing the rooted Subtree Isomorphism problem to a polynomially bounded collection of recursively smaller Subtree Isomorphism problems, and how to combine the answers by solving a maximum bipartite matching problem (see [45]). We follow the same approach but focus on the case where the degrees are bounded by a constant. Given two rooted trees H and G, we want to decide whether H is isomorphic to a subtree of G where the root of H maps to the root of G. Let H1 , H2 , . . . , Hk and G1 , G2 , . . . , G` be the subtrees of H and G, respectively, with roots that are children of the root of H and the root of G. Let G be a bipartite graph with vertex set V = {u1 , . . . , uk } ∪ {v1 , . . . , v` }, and let (ui , vj ) be an edge of G if and only if Hi is isomorphic to a subtree of Gj . Then H is isomorphic to a subtree of G if and only if G contains a matching of size k. The Edmonds-Matula procedure constructs the graph G by recursion and then solves the maximum bipartite matching problem on G. Designing similar algorithms for rooted Subtree Isomorphism thus involves two challenges: constructing G and solving the maximum bipartite matching problem on G. The currently fastest randomized algorithm for the maximum bipartite matching problem is due to Mucha and Sankowski [46] and runs in expected time O((k + `)ω ), where ω < 2.373 is the matrix multiplication exponent. Improving this algorithm is itself a challenging open problem. For constructing the graph G, it is not hard to see that any deterministic algorithm needs to know all edges of G. For randomized algorithms, however, it is not always necessary to know for every pair ui , vj whether the edge (ui , vj ) is in the graph. The expected number of node pair queries (“is the pair an edge in the graph?”) that a randomized algorithm needs to make in order to be able to determine whether a perfect matching exists, is known as the randomized query complexity (or decision tree complexity) of bipartite perfect matching. It is an easy exercise to check that the randomized query complexity of the problem is Ω(k`). Estimating the exact number of queries is, however, not straightforward. It is not even clear whether k` queries are necessary in expectation, or whether (1 − ε)k` queries might be sufficient for some ε > 0. Factoring this into the analysis of the maximum bipartite matching algorithm complicates things further. To simplify things, we restrict our attention to the case where the degrees of the trees are bounded by a constant. In this case we can check in constant time whether G contains the desired perfect matching, once a sufficient number of edge queries have been made. We can thus focus solely on the randomized query complexity of the bipartite matching problem and its use in recursive algorithms for the Subtree Isomorphism problem. It is easy to show that in this case the algorithm of Edmonds and Matula runs in time O(mn), where |H| = m and |G| = n. The same algorithm is also able to handle labelled vertices, i.e., each vertex has a label and the labels of H are required to match the labels of the subtree of G. Moreover, the algorithm can solve the largest common subtree problem in O(mn) time as well. This is done by recursively assigning a weight to every edge (ui , vj ) of G equal to the size of the largest common subtree of Hi and Gi , and then asking for the matching of largest weight. (We 12 refer to the appendix for a short complexity analysis and further description of these algorithms.) Our lower bounds from theorems 1 and 5 are thus tight for trees of constant degree. For the remainder of the section we restrict our attention to trees of constant degree d and height h. We first introduce a randomized algorithm that solves the binary problem in expected time O(min{2.8431h , mn}). For comparison, the corresponding upper bound by Edmonds and Matula [45] is O(min{4h , mn}), i.e., their algorithm makes four recursive calls at each level of the tree. In particular our algorithm is truly subquadratic when h < 1.3267 log2 n. For d = 3 we give a similar, but more complicated case analysis showing that the problem can be solved in expected time O(min{6.107h , mn}), improving the straightforward O(min{9h , mn}) bound by Edmonds and Matula. For d > 3 we introduce a randomized algorithm with expected running time upper bounded by O(min{(d2 − 31 d + 23 )h , mn}). 3.1 A faster algorithm for binary trees For trees with degree at most two, the Edmonds-Matula procedure can be interpreted as follows. Let HL and HR be the left and right subtrees of H, and let GL and GR be the left and right subtrees of G. H is isomorphic to a subtree of G if and only if one of the following two conditions are true: 1. HL is isomorphic to a subtree of GL , and HR is isomorphic to a subtree of GR . 2. HL is isomorphic to a subtree of GR , and HR is isomorphic to a subtree of GL . Each case can be checked with two recursive calls, and checking whether H is isomorphic to a subtree of G can thus be done with at most four recursive calls, giving an O(4h ) upper bound. Observe that if HL is not isomorphic to a subtree of GL , then there is no reason to check whether HR is isomorphic to a subtree of GR . Similarly, if the algorithm concludes that the first condition is met, then there is no reason to check the second condition since we already know that H is isomorphic to a subtree of G. Based on these observations, we introduce a simple randomized variant of the algorithm that achieves a significantly better running time by saving recursive calls: Swap HL and HR with probability 1/2, and swap GL and GR with probability 1/2. Then run the Edmonds-Matula algorithm, but do not perform unnecessary recursive calls. We give a formal description of the algorithm in Figure 1. We refer to the algorithm as RandBinarySubIso. Theorem 10. The RandBinarySubIso algorithm runs in expected time O(min{2.8431h , n2 }) for trees H and G of size O(n) and height at most h. In particular, it runs in time O(n1.507 ) for trees of height (1 + o(1)) · log2 n, and is strongly subquadratic for trees of height h < 1.3267 log2 n. Before proving Theorem 10 we first prove a useful lemma. Let T (h) be the maximum expected number of times RandBinarySubIso(H, G) makes a recursive call with an empty tree when H and G are arbitrary rooted trees with height at most h. Let Tyes (h) and Tno (h) be defined similarly, but under the assumption that the algorithm returns true and false, respectively. Note that T (0) = Tyes (0) = Tno (0) = 1. Also note that T (h) = max{Tyes (h), Tno (h)}. Lemma 3. For all h ≥ 0, Tyes (h) ≤ 2.25 · Tyes (h − 1) + 0.5 · Tno (h − 1) , Tno (h) ≤ Tyes (h − 1) + 2 · Tno (h − 1) . 13 Algorithm RandBinarySubIso(H, G) 1. If |H| = 0, return true; 2. If |G| = 0, return false; 3. With probability 1/2 swap HL and HR in H; 4. With probability 1/2 swap GL and GR in G; 5. If RandBinarySubIso(HL , GL ) = false, then go to step 7; 6. If RandBinarySubIso(HR , GR ) = true, then return true; 7. If RandBinarySubIso(HL , GR ) = false, then return false; 8. If RandBinarySubIso(HR , GL ) = true, then return true. Otherwise return false; Figure 1: A randomized, recursive algorithm for rooted Subtree Isomorphism on binary trees. Proof. To simplify notation we write H ⊆ G when H is isomorphic to a subtree of G, and H 6⊆ G otherwise. We first show that Tyes (h) ≤ 2.25 · Tyes (h − 1) + 0.5 · Tno (h − 1). Assume therefore that H ⊆ G. With probability 1/2 we then have HL ⊆ GL and HR ⊆ GR , such that the algorithm returns true in line 6 after spending 2 · Tyes (h − 1) time in expectation. On the other hand, with probability 1/2 the outcomes of lines 5 and 6 depend on the trees in question, and the recursive calls in lines 7 and 8 both return true if reached. More precisely, we get three cases that depend on the trees: (i) HL ⊆ GL and HR ⊆ GR : The recursive calls in lines 5 and 6 both return true, and the algorithm spends 2 · Tyes (h − 1) time in expectation. (ii) HL 6⊆ GL and HR 6⊆ GR : The recursive call in line 5 returns false, and the recursive calls in lines 7 and 8 both return true. The algorithm spends Tno (h − 1) + 2 · Tyes (h − 1) time in expectation. (iii) HL ⊆ GL and HR 6⊆ GR , or HL 6⊆ GL and HR ⊆ GR : The recursive call in line 5 returns false with probability 1/2 and true with probability 1/2. In the second case the recursive call in line 6 returns false. The recursive calls in lines 7 and 8 both return true. The algorithm spends Tno (h − 1) + 2.5 · Tyes (h − 1) time in expectation. The third case thus dominates the two others, and we conclude that Tyes (h) ≤ 2.25 · Tyes (h − 1) + 0.5 · Tno (h − 1). We next show that Tno (h) ≤ Tyes (h − 1) + 2 · Tno (h − 1). Assume therefore that H 6⊆ G. We get the contribution 2·Tno (h−1) as follows. In either line 5 or 6 we get the answer false from a recursive call, and in either line 7 or 8 we also get the answer false from a recursive call. This amounts to two “no” answers which cost 2·Tno (h−1) in expectation. We get the contribution Tyes (h−1) as follows. With probability at most 1/2 we get the answer true in line 5 (which means that we get false in 14 line 6). Similarly, with probability at most 1/2 we get the answer true in line 7 (which means that we get false in line 8). In total, we get that Tno (h) ≤ 2 · Tno (h − 1) + 12 Tyes (h − 1) + 21 Tyes (h − 1). Proof of Theorem 10. Lemma 3 gives us that      Tyes (h) 2.25 0.5 Tyes (h − 1) ≤ Tno (h) 1 2 Tno (h − 1)  h   2.25 0.5 1 ≤ . 1 2 1 A diagonalization of the matrix yields   2.25 0.5 = Q−1 JQ , 1 2 where −1 Q = J = Q = and therefore  Tyes (h) Tno (h)   ≤ √ 1− 33 8 √ 1− 33 8 1 1 √ 17− 33 8 0 − √433 √4 33 0√ ! 17+ 33 8 1 √1 2 + 2 33 1 √1 2 − 2 33 ! ! , 0.065 · 1.407h + 0.94 · 2.8431h −0.109 · 1.407h + 1.109 · 2.8431h  . Thus, T (h) = O(2.8431h ), which proves the theorem. 3.2 A Faster Algorithm for Ternary Trees Here we discuss the subtree isomorphism problem for rooted ternary trees. We prove Theorem 3 by showing that Subtree isomorphism for rooted ternary trees of height h can be solved in expected time O(6.107h ). Just as with the binary case, this running time is lower than the runtime given by our generic algorithm for constant degree trees in Section 3.3. Similarly to the binary case, the proof of the theorem proceeds by a recursive approach. In each recursive call, we consider a randomized decision tree for 3 × 3 bipartite perfect matching, where each query corresponds to a recursive call on height one less. We then analyze the runtime similar to the binary tree case: we distinguish between the “yes” and “no” case of the query answer, and write the running time as two recurrences, one for Tyes , when the algorithm said the trees are isomorphic, and one for Tno when they were not. We analyze the randomized decision tree in terms of the expected number of “yes” and “no” query answers in the worst case. The randomized query protocol is as follows. Let U and V be the two partitions of the bipartite matching instance (respectively, U are the subtrees of the root of one tree and V are the subtrees of the root of the other). First we pick U or V at random w.p. 1/2. If we pick V , then the names of U and V are swapped. Now, with probability 1/6 we pick a permutation of the vertices in U , 15 c, x yes no c, y a, y b, z YES b, y a, z T3 a, x NO YES c, y YES YES NO b, x T4 b, y YES NO a, z a, x YES c, z YES NO a, y T2 b, x NO b, z NO b, z T1 a, x YES b, x YES YES b, x c, z YES b, y c, z a, x a, z b, y a, x NO YES NO b, y NO YES NO NO NO Figure 2: The decision tree used for bipartite matching in the degree 3 case. and with probability 1/6 we pick a permutation of V . After these two permutations are fixed, the protocol is deterministic. Let a, b, c be the nodes of U and x, y, z be the nodes of V , in the order of the chosen permutations. The deterministic decision tree we use is depicted in Figures 2 and 3. For each of the 29 choices for the answers to the 9 edge queries in the 3 × 3 matching instance, we consider each of the 72 randomized choices as described above (swap U and V , permute U and V ) and consider the decision tree, computing the expected number of “yes” and “no” calls. Using a computer program, we establish that when the instance has no perfect matching, the expected number of “yes” calls is always at most 26/9, and the expected number of “no” calls is always at most 37/9; this happens when the complement of the graph consists of a 4-cycle, disjoint from a single edge. On the other hand, if the instance has a perfect matching there are two cases that dominate all others: when the expected number of “yes” calls is 131/36, and the expected number of “no” calls is 61/36, or when the expected number of “yes” calls is 133/36, and the expected number of “no” calls is 5/3. There are thus two options for the recurrence relation, and one of them dominates the other. We present the recurrence that achieves the maximum, and hence gives the worst-case expected runtime for the ternary case.  Tyes (h) Tno (h)   ≤ 133/36 5/3 26/9 37/9  Tyes (h − 1) Tno (h − 1) 16   ≤ 133/36 5/3 26/9 37/9 h  1 1  T1 T2 c, z YES c, y YES a, z NO NO b, x c, z c, y c, z a, y NO YES YES NO c, z NO YES b, z b, z T4 b, x a, x b, y T3 a, z YES NO YES NO b, x YES c, y NO b, y NO a, y NO YES NO NO NO NO Figure 3: The missing subtrees of the decision tree used for bipartite matching in the degree 3 case. The diagonalization yields  133/36 5/3 26/9 37/9  = Q−1 JQ, where √ 281− 25185 72 J = 0 1 2 Q = √ 25185 + 3358 104 − √25185 0 √ 281+ 25185 72 √ 25185 1 2 − 3358 √ 104 25185 ! ! , which gives that  Tyes (h) Tno (h)   ≤ 0.17 · 1.7h + 0.831 · 6.107h −0.2 · 1.69h + 1.21 · 6.107h  . Thus, the running time overall is O(6.107h ). 3.3 An algorithm for any constant degree In this section we describe a way to use randomization to save subtree comparisons in the EdmondsMatula algorithm [45] for all degrees d > 2. Recall that the algorithm works as follows. Given two trees H and G of constant degree d, the goal is to decides whether H is isomorphic to a subtree of G by using recursion. If the roots of either H or G have less than d children, we simply view the missing subtrees as being a special empty subtree. 17 1. Let H1 , . . . , Hd be the d subtrees of H, and let G1 , . . . , Gd be the d subtrees of G; 2. Build a bipartite graph G with d vertices U = {u1 , . . . , ud } on the left and d vertices W = {v1 , . . . , vd } on the right. For all i, j ∈ [d], connect ui and vj if and only if Hi is isomorphic to a subtree of Gj . We decide which edges appear in the graph recursively. 3. Output that H is isomorphic to a subtree of G if and only if there is a perfect matching in the bipartite graph G. The runtime of the algorithm is O(min{d2h , n2 }), where h is the height. Intuitively, we can improve the runtime of the algorithm as follows. Perform recursive calls corresponding to edges (ui , vj ) in a random order, and stop as soon as we either detect a perfect matching or rule out the existence of a perfect matching. It is not difficult to show that this randomized version of the algorithm performs d2 − Ω(1) recursive calls in expectation out of the d2 possible calls. That is, in expectation, we save at least a constant number of recursive calls. This implies that the algorithm runs in O((d2 −Ω(1))h ) expected time, which is faster than the deterministic algorithm. However, we prove below that we can save Ω(d) recursive calls in expectation using a slightly different variant of the randomized algorithm. Lemma 4. Let G be a bipartite graph with d vertices U = {u1 , . . . , ud } on the left and d vertices W = {v1 , . . . , vd } on the right, and suppose we are given query access to the adjacency matrix of G. There is a randomized query algorithm that decides whether G contains a perfect matching by making d2 − 31 d + 23 queries in expectation, with probability 0 of making an error. We use the following two claims to prove the lemma. Claim 4. Assume that G has a perfect matching. Then the following algorithm finds a perfect matching after making d2 − d + 2 expected queries: Query edges (ui , vj ) in a random order, and stop when finding a perfect matching. Proof. Fix a perfect matching present in G and call its d edges “marked”. We stop when all marked edges have been queried. There are d2 − d unmarked edges. The probability that a given 1 unmarked edge is not queried is d+1 . Therefore, the expected number of unqueried, unmarked edges is d2 −d d+1 ≥ d − 2. Claim 5. Assume that G does not have a perfect matching. Then the following algorithm makes at most d2 − 12 d + 1 queries in expectation before determining that G does not contain a perfect matching. 1. With probability 1/2 swap U and W; 2. Randomly permute the vertices of U = {u1 , u2 , . . . , ud }; 3. Query all edges adjacent to ui for i going from 1 to d, but stop when ruling out the existence of a perfect matching, i.e., stop when the set of processed vertices S = {u1 , . . . , ui } contains a subset S 0 with a neighbourhood N (S 0 ) that is smaller than the size of S 0 . Proof. Consider the sets U and W prior to running the algorithm. By Hall’s theorem, the set U contains a set S 0 such that |N (S 0 )| < |S 0 |. We can assume that |S 0 | = |N (S 0 )| + 1, since otherwise we can iteratively remove a vertex from S 0 until this condition is satisfied. Consider two cases. 18 • d is even: If |S 0 | ≥ d2 +1, we define T 0 = W \N (S 0 ). Because N (S 0 ) ≥ d/2, we get that |T 0 | ≤ d2 . By our construction of T 0 , we have that N (T 0 ) ⊆ U \ S 0 and, as a result, |N (T 0 )| < |T 0 |. Given the first step of the algorithm, with probability at least 1/2 the set U therefore contains a set S 0 such that |N (S 0 )| < |S 0 | ≤ d2 . • d is odd: It follows from as similar argument that, with probability at least 1/2, the set U contains a set S 0 such that |N (S 0 )| < |S 0 | ≤ d+1 2 . 0 0 We now condition on the set U containing S 0 with |S 0 | ≤ d+1 2 and |N (S )| < |S |. The algorithm stops once it queries all vertices from S 0 , since a perfect matching is then ruled out by Hall’s theorem. The probability that we do not process a given vertex before processing all vertices in S 0 is 1/(|S 0 | + 1). Therefore the expected number of unprocessed vertices when the algorithm stops is at least (d − |S 0 |) · 1 d−1 ≥ · +1 2 |S 0 | d−1 1 = . d+3 +1 d+1 2   d−1 edges, and overall the number of queried Hence, with probability 1/2, we query d d − d+3 edges is !    1 1 − 1 d−1 1 2 1 d d d− + d = d2 1 − ≤ d2 − d + 1 . 2 d+3 2 2(d + 3) 2 In the last inequality we use that d ≥ 3. Proof of Lemma 4. We prove the lemma by using claims 4 and 5. With probability 1/3 we run the algorithm from Claim 4 and with probability 2/3 we run the algorithm from Claim 5. Consider the case when G has a perfect matching. Then the expected number of edges queried is upper bounded by 1 2 2 1 2 (d − d + 2) + d2 = d2 − d + . 3 3 3 3 On the other hand, for the case when G does not contain a perfect matching, the expected number of edges queried is upper bounded by   1 2 2 1 1 2 2 d + d − d+1 = d2 − d + . 3 3 2 3 3 Overall, regardless of G, we therefore query at most d2 − 31 d + 2 3 edges in expectation. Theorem 11. There is a randomized algorithm that solves Subtree Isomorphism  on two rooted h  trees of size O(n), constant degree d, and height at most h in expected time O d2 − 13 d + 32 . In particular, the algorithm is strongly subquadratic for trees of height ! 2 log d h ≤ −  · logd n , log(d2 − 13 d + 23 ) for any constant  > 0. 19 Proof. We run the following randomized, recursive algorithm that decides whether H is isomorphic to a subtree of G. 1. Let H1 , . . . , Hd be the d subtrees of H, and let G1 , . . . , Gd be the d subtrees of G; 2. Let G be a bipartite graph with d vertices U = {u1 , . . . , ud } on the left and d vertices W = {v1 , . . . , vd } on the right. For all i, j ∈ [d], let ui and vj be connected if and only if Hi is isomorphic to a subtree of Gj . 3. Decide whether the graph G has a perfect matching by running the algorithm from Lemma 4. Whenever we need to decide whether an edge (ui , vj ) is present in G, do it recursively. By the proof of Lemma 4, it suffices to query d2 − 31 d + 23 edges for every level. Given that the height of the trees is upper bounded by h, we get the desired running time. Acknowledgements. We would like to thank Shiri Chechik, Piotr Indyk, Haim Kaplan, Michael Kapralov, Huacheng Yu, and Uri Zwick for many helpful discussions. References [1] A. Abboud, A. Backurs, and V. Vassilevska Williams. Tight Hardness Results for LCS and other Sequence Similarity Measures. In Proc. of the 56th FOCS, 2015. [2] A. Abboud, F. Grandoni, and V. V. Williams. Subcubic equivalences between graph centrality problems, APSP and diameter. In Proc. of the 26th SODA, pages 1681–1697, 2015. [3] A. Abboud and V. Vassilevska Williams. Popular conjectures imply strong lower bounds for dynamic problems. Proc. of the 55th FOCS, pages 434–443, 2014. [4] A. Abboud, V. V. Williams, and J. R. Wang. Approximation and fixed parameter subquadratic algorithms for radius and diameter. In Proc. of the 27th SODA, 2016. To appear. [5] A. Abboud, V. V. Williams, and O. Weimann. Consequences of faster alignment of sequences. In Automata, Languages, and Programming, pages 39–51. Springer, 2014. [6] T. Akutsu and M. M. Halldórsson. On the approximation of largest common subtrees and largest common point sets. Theoretical Computer Science, 233(1):33–50, 2000. [7] T. Akutsu, T. Tamura, A. A. Melkman, and A. Takasu. On the complexity of finding a largest common subtree of bounded degree. Theoretical Computer Science, 590:2–16, 2014. [8] A. Ambainis, A. M. Childs, B. Reichardt, R. Spalek, and S. Zhang. Any AND-OR formula of size N can be evaluated in time N1/2+o(1) on a quantum computer. SIAM J. Comput., 39(6):2513–2530, 2010. [9] A. Backurs and P. Indyk. Edit Distance Cannot Be Computed in Strongly Subquadratic Time (unless SETH is false). In Proc. of the 47th STOC, pages 51–58, 2015. 20 [10] P. Bille. A survey on tree edit distance and related problems. Theoretical Computer Science, 337(1–3):217–239, 2005. [11] K. Bringmann. Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless seth fails. In Proc. of the 55th FOCS, pages 661–670, 2014. [12] K. Bringmann and M. Kunnemann. Quadratic Conditional Lower Bounds for String Problems and Dynamic Time Warping. In Proc. of the 56th FOCS, 2015. [13] J. Cheriyan. Randomized O(M(|V|)) algorithms for problems in matching theory. SIAM Journal on Computing, 26(6):1635–1655, 1997. [14] M. J. Chung. O(n2.5 ) time algorithms for the subgraph homeomorphism problem on trees. Journal of Algorithms, 8(1):106–112, 1987. [15] R. Cole and R. Hariharan. Tree pattern matching and subset matching in randomized O(n log3 m) time. In Proc. of the 29th STOC, pages 66–75, 1997. [16] R. Cole and R. Hariharan. Verifying candidate matches in sparse and wildcard matching. In Proc. of the 34th STOC, pages 592–601, 2002. [17] R. Cole and R. Hariharan. Tree pattern matching to subset matching in linear time. SIAM Journal on Computing, 32(4):1056–1066, 2003. [18] M. Cygan, J. Pachocki, and A. Socala. The hardness of subgraph isomorphism. CoRR, abs/1504.02876, 2015. [19] A. Dessmark, A. Lingas, and A. Proskurowski. Faster algorithms for subgraph isomorphism of k-connected partial k-trees. Algorithmica, 27(3-4):337–347, 2000. [20] Y. Dinitz, A. Itai, and M. Rodeh. On an algorithm of zemlyachenko for subtree isomorphism. Information Processing Letters, 70(3):141–146, 1999. [21] M. Dubiner, Z. Galil, and E. Magen. Faster tree pattern matching. Journal of the ACM (JACM), 41(2):205–213, 1994. [22] F. L. Gall. Powers of tensors and fast matrix multiplication. In Proc. of the 39th ISSAC, pages 296–303, 2014. [23] B. Gallagher. Matching structure and semantics: A survey on graph-based pattern matching. AAAI FS, 6:45–53, 2006. [24] M. R. Garey and D. S. Johnson. Computers and intractability, volume 29. W. H. Freeman, 2002. [25] A. C. Giannopoulou, G. B. Mertzios, and R. Niedermeier. Polynomial fixed-parameter algorithms: A case study for longest path on interval graphs. In Proc. of IPEC, 2015. To appear. [26] P. B. Gibbons, R. M. Karp, G. L. Miller, and D. Soroker. Subtree isomorphism is in random NC. Discrete Applied Mathematics, 29(1):35–62, 1990. 21 [27] D. Gusfield. Algorithms on strings, trees and sequences: Computer Science and Computational Biology. Cambridge University Press, 1997. [28] C. M. Hoffmann and M. J. O’Donnell. Pattern matching in trees. Journal of the ACM (JACM), 29(1):68–95, 1982. [29] J. E. Hopcroft and R. E. Tarjan. Isomorphism of planar graphs. In Proc. of Complexity of Computer Computations, pages 131–152. 1972. [30] R. Impagliazzo and R. Paturi. On the complexity of k-SAT. Journal of Computer and System Sciences, 62(2):367–375, 2001. [31] R. Impagliazzo, R. Paturi, and F. Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63:512–530, 2001. [32] P. Indyk. Deterministic superimposed coding with applications to pattern matching. In Proc. of the 38th FOCS, pages 127–136, 1997. [33] P. Indyk. Faster algorithms for string matching problems: Matching the convolution bound. In Proc. of the 39th FOCS, pages 166–173, 1998. [34] R. M. Karp. Reducibility among combinatorial problems. In Complexity of Computer Computations, The IBM Research Symposia Series, pages 85–103. Springer US, 1972. [35] S. Khanna, R. Motwani, and F. F. Yao. Approximation algorithms for the largest common subtree problem. Technical report, Stanford University, 1995. [36] P. Kilpeläinen and H. Mannila. Ordered and unordered tree inclusion. SIAM Journal on Computing, 24(2):340–356, 1995. [37] S. R. Kosaraju. Efficient tree pattern matching (preliminary version). In Proc. of the 30th FOCS, pages 178–183, 1989. [38] A. Lingas. An application of maximum bipartite c-matching to subtree isomorphism. In Proc. of the 8th CAAP, pages 284–299, 1983. [39] A. Lingas. Subgraph isomorphism for biconnected outerplanar graphs in cubic time. Theoretical Computer Science, 63(3):295–302, 1989. [40] A. Lingas and M. Karpinski. Subtree isomorphism is NC reducible to bipartite perfect matching. Information Processing Letters, 30(1):27–32, 1989. [41] L. Lovász and M. D. Plummer. Matching theory, volume 367. American Mathematical Soc., 2009. [42] D. Marx and M. Pilipczuk. Everything you always wanted to know about the parameterized complexity of subgraph isomorphism (but were afraid to ask). In Proc. of the 31st STACS, pages 542–553, 2014. [43] J. Matoušek and R. Thomas. On the complexity of finding iso-and other morphisms for partial k-trees. Discrete Mathematics, 108(1):343–364, 1992. 22 [44] D. W. Matula. An algorithm for subtree identification. SIAM Review, 10:273–274, 1968. [45] D. W. Matula. Subtree isomorphism in O(n5/2 ). In Algorithmic Aspects of Combinatorics, volume 2 of Annals of Discrete Mathematics, pages 91–106. Elsevier, 1978. [46] M. Mucha and P. Sankowski. Maximum matchings via gaussian elimination. In Proc. of the 45th FOCS, pages 248–255, 2004. [47] M. Patrascu and R. Williams. On the possibility of faster SAT algorithms. In Proc. of the 21st SODA, volume 10, pages 1065–1075, 2010. [48] S. W. Reyner. An analysis of a good algorithm for the subtree problem. SIAM Journal on Computing, 6(4):730–732, 1977. [49] L. Roditty and V. Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparse graphs. In Proc. of the 45th STOC, pages 515–524, 2013. [50] M. Saks and A. Wigderson. Probabilistic boolean decision trees and the complexity of evaluating game trees. In Proc. of the 27th FOCS, pages 29–38, 1986. [51] R. Shamir and D. Tsur. Faster subtree isomorphism. Journal of Algorithms, 33(2):267–280, 1999. [52] K.-C. Tai. The tree-to-tree correction problem. Journal of the ACM (JACM), 26(3):422–433, 1979. [53] G. Valiente. Algorithms on trees and graphs. Springer Science & Business Media, 2013. [54] R. M. Verma. Strings, trees, and patterns. Information Processing Letters, 41(3):157–161, 1992. [55] R. Williams. A new algorithm for optimal 2-constraint satisfaction and its implications. Theoretical Computer Science, 348(2):357–365, 2005. [56] V. V. Williams. Multiplying matrices faster than coppersmith-winograd. In Proc. of the 44th STOC, pages 887–898, 2012. [57] K. Zhang and T. Jiang. Some max snp-hard results concerning unordered labeled trees. Information Processing Letters, 49(5):249–254, 1994. [58] K. Zhang and D. Shasha. Simple fast algorithms for the editing distance between trees and related problems. SIAM journal on computing, 18(6):1245–1262, 1989. [59] K. Zhang, R. Statman, and D. Shasha. On the editing distance between unordered labeled trees. Information processing letters, 42(3):133–139, 1992. 23 A Analysis of the Edmonds-Matula algorithm and its variants Lemma 5. On binary trees, the Edmonds-Matula algorithm takes O(mn) time, where m = |H|, n = |G|. Proof. Denote by mL , mR , nL , nR the sizes of HL , HR , GL , GR , the left and right subtrees of H and G, notice that mL + mR = m − 1, nL + nR = n − 1. The runtime of the algorithm is described by the recurrence T (0, n) = T (m, 0) = 1 , T (m, n) = 1 + T (mL , nL ) + T (mR , nR ) + T (mL , nR ) + T (mR , nL ) . Then, by induction, we prove T (m, n) ≤ mn, T (m, n) = 1 + T (mL , nL ) + T (mR , nR )+ T (mL , nR ) + T (mR , nL ) ≤ 1 + mL · nL + mR · nR + mL · nR + mR · nL = 1 + (mL + mR ) · (nL + nR ) = 1 + (m − 1)(n − 1) ≤ mn . As mentioned in section 3, this algorithm is easily extended to solve the labelled version of the problem or the Largest Common Subtree problem for any constant bounded degree d = O(1). For completeness, we include pseudo-code of a variant that solves the Labelled Largest Common Subtree problem, generalizing both. Algorithm 1: LLCS(H, G, d) if Size(F ) = 0 or Size(G) = 0 then return 0 end if for i = 1 to d do for j = 1 to d do if Label(H.Children[i]) = Label(G.Children[j]) then Sub[i, j] ← LLCS(Subtree(H.Children[i]), Subtree(G.Children[j]), d) else Sub[i, j] ← 0 end if end for end for w ← the weight of a maximum weight bipartite matching in the bipartite graph with edges defined by Sub[i, j]. return w + 1 24 Lemma 6. Algorithm 1 solves the Labelled Largest Common Subtree problem in time O(mn) for rooted trees H,G of bounded degree d = O(1), where m, n are the sizes of H, G respectively. Proof. Correctness is straightforward, it is also clear that as d = O(1), Algorithm 1 makes a constant number of operations excluding the recursive calls. Denote by m1 , m2 , ..., mr the sizes of the (maximal) subtrees rooted at the r ≤ d children of the root of H, and Prby n1 , n2 , ..., ns the sizes of those rooted at the s ≤ d children of the root of G. It holds that i=1 mi = m − 1 and Ps j=1 nj = n − 1. The runtime of the algorithm is described by the recurrence T (0, n) = T (m, 0) = 1 , r,s X T (m, n) = 1 + T (mi , nj ) . i=1,j=1 Then, by induction, we prove T (m, n) ≤ mn, r,s X T (m, n) = 1 + ≤ 1+ i=1,j=1 r,s X T (mi , nj ) mi · nj i=1,j=1 r X s X mi ) · ( nj ) = 1+( i=1 j=1 = 1 + (m − 1)(n − 1) ≤ mn . 25
8cs.DS
Online Continuous Submodular Maximization Lin Chen1,2 , Hamed Hassani3 , and Amin Karbasi1,2 1 Yale Institute for Network Science Department of Electrical Engineering, Yale University 3 Department of Electrical and Systems Engineering, University of Pennsylvania arXiv:1802.06052v1 [stat.ML] 16 Feb 2018 2 {lin.chen, amin.karbasi}@yale.edu, [email protected] Abstract In this paper, we consider an online optimization process, where the objective functions are not convex (nor concave) but instead belong to a broad class of continuous submodular functions. We first propose a variant of the Frank-Wolfe algorithm that √ has access to the full gradient of the objective functions. We show that it achieves a regret bound of O( T ) (where T is the horizon of the online optimization problem) against a (1 − 1/e)-approximation to the best feasible solution in hindsight. However, in many scenarios, only an unbiased estimate of the gradients are available. For such settings, we √ then propose an online stochastic gradient ascent algorithm that also achieves a regret bound of O( T ) regret, albeit against a weaker 1/2-approximation to the best feasible solution in hindsight. We also generalize our results to γ-weakly submodular functions and prove the same sublinear regret bounds. Finally, we demonstrate the efficiency of our algorithms on a few problem instances, including non-convex/non-concave quadratic programs, multilinear extensions of submodular set functions, and D-optimal design. 1 Introduction In the past few years, the era of big data has necessitated scalable machine learning techniques that can process an unprecedentedly growing amount of data, including data generated by users (e.g., pictures, videos, and tweets), wearable devices (e.g., statistics of steps, walking and running distance) and monitoring sensors (e.g., satellite and traffic images). At the same time, it is practically impossible to lay out an exact mathematical model for such data generating processes. Thus, any optimization techniques applied to the data should be robust against imperfect and even fundamentally unavailable knowledge. A robust approach to optimization (in the face of uncertainty) in many fields, including artificial intelligence, statistics, and machine learning, is to look at the optimization itself as a process (Hazan, 2016) that learns from experience as more aspects of the problem are observed. This framework is formally known as online optimization and is performed in a sequence of consecutive rounds. In each round, the learner/algorithm has to choose an action (from the set of feasible actions) and then the environment/adversary reveals a reward function. The goal is then to minimize regret, a metric borrowed from game theory, that measures the difference between the accumulated reward received by the algorithm and that of the best fixed action in hindsight. When the objective functions are concave and the feasible set forms a convex body, the problem has been extensively studied in the machine learning community under √ the name of online convex optimization (OCO). It is well known that any algorithm for OCO incurs Ω( T ) regret in the worst case (Hazan, 2016). There are also several algorithms that match this lower bound such as online gradient descent (OGD) (Zinkevich, 2003) and regularized-follow-the-leader (RFTL) (Abernethy et al., 2008b; Shalev-Shwartz and Singer, 2007; Shalev-Shwartz, 2007). Even though optimizing convex/concave functions can be done efficiently, most problems in statistics and artificial intelligence are non-convex. Examples include training deep neural networks, learning latent variables, non-negative matrix factorization, Bayesian inference, and clustering, among many others. As a result, there has been a burst of recent research to directly optimize such functions. Due to the fact that in general it is NP-hard to compute the global optimum of a non-convex function, most non-convex 1 optimization algorithms focus on finding a local optimum. Naturally, for online non-convex optimization (ONCO) one needs to define an appropriate notion of regret related to convergence to an (approximate) local optimum (Hazan et al., 2017). In this work, we consider a rich subclass of non-convex/non-concave reward functions called continuous submodular functions (Wolsey, 1982; Bach, 2015; Vondrák, 2007). It has been very recently established that in the offline setting, first order methods provide tight approximation guarantees (Chekuri et al., 2015; Bian et al., 2017; Hassani et al., 2017). To the best of our knowledge, our work is the first that systematically studies the online continuous submodular maximization problem and provides no-regret guarantees along with developing efficient algorithms. Our contributions In summary, for monotone and continuous (weakly) DR-submodular reward functions1 , and subject to a general convex body (not necessarily down-closed), we propose two algorithms, both with sublinear regret bounds, depending on what side information is available regarding the gradients. • When the gradients are available, we propose Meta-Frank-Wolfe, a variant of a Frank-Wolfe algorithm, that √ achieves a (1 − 1/e) approximation factor of the best fixed offline solution in hindsight up to an O( T ) regret term, where T is the horizon of the online maximization problem. • When only unbiased estimates of the gradients are available, we propose Online Gradient Ascent, √ that achieves a 1/2 approximation factor of the best fixed offline solution in hindsight up to an O( T ) regret term. • More generally, for γ-weakly DR-submodular functions, we show that Online Gradient Ascent yields a √ γ2 γ 2 +1 approximation guarantee to the best fixed offline solution in hindsight up to an O( T ) regret term (γ = 1 corresponds to a DR-submodular function). 2 Preliminaries In this section, we precisely define the concepts that we will use throughout the paper. 2.1 Notation Projection As we will discuss the projected (stochastic) gradient ascent later in Section 3.2, we introduce the notation of projection operator here, which is denoted by ΠP (x) , arg minkx − vk. v∈P Intuitively, the projection of point x onto a convex set P is a point in P that is closest to x. Radius and Diameter For any set of points S, its radius ρ(S) is defined to be supx∈S kxk while its diameter diam(S) is defined to be supx,y∈S kx−yk. By the triangle equality, we immediately have diam(S) ≤ 2ρ(S). Smoothness To derive guarantees for the proposed algorithm, we will make the assumption that the gradients of the objective functions satisfy the Lipschitz condition. A differentiable function f : X ⊆ Rn → R is said to be β-smooth if for any x, y ∈ X , we have k∇f (x) − ∇f (y)k ≤ βkx − yk. 1 A DR-submodular function is a function that is defined on a continuous domain and exhibits the diminishing returns property. We present its formal definition in Section 2.2. 2 2.2 Submodularity Submodular Functions on Lattices Suppose that (L, ∨, ∧) is a lattice2 . A function f : L → R is said to be submodular (Topkis, 1978) if ∀x, y ∈ L, we have f (x) + f (y) ≥ f (x ∨ y) + f (x ∧ y). Furthermore, a function f : L → R is monotone if ∀x, y ∈ L such that x ≤L y, we have f (x) ≤ f (y), where ≤L is the partial order defined by lattice L3 . For any set E, its power set 2E equipped with set union ∪ and intersection ∩ is an instance of lattice. In fact, submodular functions on the lattice (2E , ∪, ∩) are precisely the submodular set functions that have been extensively studied in the past (Nemhauser et al., 1978; Fujishige, 2005). If we let [C] denote {1, 2, 3, . . . , C}, then [C]n and Zn are bounded and unbounded integer lattices equipped with entrywise maximum (∨) and minimum (∧). This construction corresponds to submodular functions on integer lattices (Gottschalk and Peis, 2015; Soma and Yoshida, 2016). Continuous Submodularity Qn In contrast to the above discrete scenarios, we focus on continuous domains in this paper. The set X , i=1 Xi ⊆ Rn+ , where Xi ’s are closed intervals of R+ , is also equipped with a natural lattice structure where ∨ and ∧ are entrywise maximum and entrywise minimum, respectively, i.e., for any x, y ∈ X ⊆ Rn , theQi-th component of x ∨ y is max{xi , yi } and the i-th component of x ∧ y is n min{xi , yi }. A function f : i=1 Xi → R+ is called continuous submodular if it is submodular under this lattice. When the function f is twice differentiable, it is continuous submodular if and only if all off-diagonal entries of its Hessian are non-positive, i.e., ∀i 6= j, ∀x ∈ X , ∂ 2 f (x) ≤ 0. ∂xi ∂xj Without lossQof generality, we assume that Xi = [0, bi ], ∀1 ≤ i ≤ n. If Xi = [ci , di ] and f is continuous subQn n modular on i=1 [ci , di ], we can consider another continuous submodular function f˜ defined on i=1 [0, di −ci ] such that f˜(x) = f (x + c). DR-Submodularity In this paper, we are mainly interested in a subclass of differentiable continuous submodular functions that exhibit diminishing returns (Bian et al., 2017), i.e., for every x, y ∈ X , x ≤ y elementwise implies ∇f (x) ≥ ∇f (y) elementwise, which indicates that the gradient is an antitone mapping (Bian et al., 2017; Eghbali and Fazel, 2016). When the function f is twice differentiable, DR-submodularity is equivalent to ∀i, j, ∀x ∈ X , ∂ 2 f (x) ≤ 0. ∂xi ∂xj Twice differentiable DR-submodular functions are also called smooth submodular functions (Vondrák, 2007). We say that a function f is weakly DR-submodular with parameter γ (Hassani et al., 2017) if γ= [∇f (x)]i , x,y∈X ,x≤y i∈[n] [∇f (y)]i inf inf where [∇f (x)]i = ∂f∂x(x) is the i-th component of the gradient. If the function is monotone, we have γ ≥ 0. i Note that a differentiable DR-submodular function is weakly submodular with parameter γ = 1. In this work, we focus on monotone continuous (weakly) DR-submodular functions. 2 A lattice is a set L equipped with two commutative and associative binary operations ∨ and ∧ connected by the absorption law, i.e., a ∨ (a ∧ b) = a and a ∧ (a ∨ b) = a, ∀a, b ∈ L (Sankappanavar and Burris, 1981). 3 In a lattice, we define a ≤ b if a = a ∧ b (Sankappanavar and Burris, 1981) L 3 Multilinear Extension An important example of continuous DR-submodular functions is the multilinear extension of a submodular set function. Given a monotone submodular set function W : 2Ω → R+ defined on a ground set Ω, its multilinear extension f¯ : [0, 1]|Ω| → R is defined as Y Y X W (S) xi f¯(x) = (1 − xj ), i∈S S⊆Ω j ∈S / is monotone DR-submodular (Calinescu et al., 2011). In general, it is computationally intractable to compute the multilinear extensions. However, for the weighted coverage functions (Karimi et al., 2017), they have U an interesting connection to concavity. P Suppose that U is a finite set and let G : 2 → R be a nonnegative modular function such that G(S) , u∈U w(u), where w(u) ≥ 0 for all u ∈ U . We have a finite collection Ω = {Bi : 1 ≤ i ≤ n} of subsets of U . The weighted coverage function W : 2Ω → R≥0 is defined as [ W (S) , G( Bi ), ∀S ⊆ Ω. Bi ∈S Karimi et al. (2017) showed that the multilinear extension f : [0, 1]n → R is ! X Y f¯(x) = w(u) 1 − (1 − xi ) . Bi ∈Ω:u∈Bi u∈U They showed that the multilinear extension has a concave upper bound. In fact, in light of the Fenchel concave biconjugate, they consider a concave function ( ) X X f˜(x) , w(u) min 1, xi Bi ∈Ω:u∈Bi u∈U and showed a key squeeze relation (1 − 1/e)f˜(x) ≤ f¯(x) ≤ f˜(x), 2.3 ∀x ∈ [0, 1]n . Online Continuous Submodular Maximization Input: convex set P, horizon T Output: {xt : 1 ≤ t ≤ T } 1: Determine x1 ∈ P 2: for t ← 1, 2, 3, . . . , T do 3: Play xt , observe reward ft (xt ) 4: Observe ft and determine xt+1 ∈ P 5: end for . to be designed . to be designed The general protocol of online continuous submodular maximization is given as follows. At iteration t (going from 1 to T ), the online algorithm chooses xt ∈ P. After committing to this choice, a monotone DR-submodular function ft is revealed and the algorithm receives the reward ft (xt ). The goal is to minimize regret which is typically defined as the difference between the total award that the algorithm accumulated and that of the best fixed decision in hindsight. Note that even in the offline setting, maximizing a monotone DR-submodular function subject to a convex constraint can only be done approximately in polynomial time unless RP = NP (Bian et al., 2017). Thus, we instead define the α-regret of an algorithm A as follows (Streeter and Golovin, 2009; Kakade et al., 2009): Rα (A, T ) , α max x∈P T X t=1 4 ft (x) − T X t=1 ft (xt ), where α is the approximation ratio. In the deterministic setting when full access to the gradients of ft ’s is possible, the best polynomial-time approximation guarantee in the offline setting is α = 1 − 1/e, using a variant of the Frank-Wolfe algorithm, unless RP = NP (Bian et al., 2017). In contrast, for the stochastic situations where only unbiased estimates of gradients are given, the best known approximation guarantee (in the offline setting) is α = 1/2 (Hassani et al., 2017), using stochastic gradient ascent. It is also known that stochastic gradient ascent cannot achieve a better approximation guarantee in general (Hassani et al., 2017; Vondrák et al., 2011). 3 Algorithms and Main Results In this section, we describe our online algorithms Meta-Frank-Wolfe and Online Gradient Ascent for a sequence of monotone DR-submodular functions, in the no-regret setting. 3.1 (1 − 1/e) Guarantee via Meta-Frank-Wolfe We begin by proposing √ the Meta-Frank-Wolfe algorithm that achieves (1−1/e) fraction of the global maximum in hindsight up to O( T ) regret. Our algorithm is based on the Frank-Wolfe variant proposed in (Bian et al., 2017) for maximizing monotone and continuous DR-submodular functions and the idea of meta-actions proposed in (Streeter and Golovin, 2009). Unlike (Bian et al., 2017), we consider a general convex body P as the constraint set and do not assume that it is down-closed. We use meta-actions to convert offline algorithms into online algorithms. To be precise, let us consider the first iteration and the first objective function f1 of our online optimization setting. Note that f1 remains unknown until the algorithm commits to a choice. If we were in the offline setting, we could have used the Frank-Wolfe variant proposed in (Bian et al., 2017), say ran it for k iterations, in order to maximize f1 . In each iteration, we would have found a vector vk ∈ P that maximizes hvk , ∇f1 (xk )i and performed the update xk+1 ← xk + 1 vk . K The idea of meta-actions is to mimic this process in an online setting as follows. We run K instances {E k : 1 ≤ k ≤ K} of an off-the-shelf online linear maximization algorithm, such as Regularized-Follow-TheLeader (RFTL) (Hazan, 2016). Here K denotes the number of iterations of the offline Frank-Wolfe algorithm that we intend to mimic. Thus, to maximize h·, ∇f1 (xk )i, where ∇f1 (xk ) is the unknown linear objective function of the online linear maximization problem, we simply use E k . Once the function f1 is revealed to the algorithm, it knows each linear objective function ∇f1 (xk ) and its corresponding inner product hvk , ∇f1 (xk )i. Now, we simply feed each online algorithm Ek with the reward hvk , ∇f1 (xk )i. For any subsequent function √ ft (t ≥ 2), we repeat the above process. Note that for an RFTL algorithm the regret is bounded by O( T ) (in fact, this is true for many choices of no-regret algorithms). This idea combined with the fact that the Frank-Wolfe algorithm can be used to maximize a monotone and continuous DR-submodular function and attain (1 − 1/e) fraction √ of the optimum solution suffices to prove that (1 − 1/e)-regret of Meta-Frank-Wolfe is also bounded by O( T ). The precise description of Meta-Frank-Wolfe is outlined in Algorithm 1. Recall that the positive orthant of the Euclidean space Rn is {x ∈ Rn : xi ≥ 0, ∀1 ≤ i ≤ n}. In the following theorem, we bound the (1 − 1/e)-regret of Meta-Frank-Wolfe. Theorem 1. (Proof in Appendix A) Assume that ft is monotone DR-submodular and β-smooth for every t. By using Algorithm 1, we obtain (1 − 1/e) T X ∗ ft (x ) − t=1 ≤ − e−1 T X ft (xt ) t=1 T X √ βR2 T ft (0) + 2DG T + , 2K t=1 where D = diam(P), R = ρ(P), and G = sup1≤t≤T,x∈P k∇ft (x)k are assumed to be finite. 5 Algorithm 1 Meta-Frank-Wolfe Input: P is a convex set in the positive orthant, and T is the horizon. Output: {xt : 1 ≤ t ≤ T } 1: Initialize K Regularized-Follow-The-Leader (RFTL) algorithm instances {E k : 0 ≤ k < K} for maximizing linear cost functions over P 2: for t ← 1, 2, 3, . . . , T do 3: for k ← 0, 1, 2, . . . , K − 1 do 4: Let vtk be the vector selected by E k 5: end for P K−1 k 1 6: xt ← K k=0 vt 7: Play xt , receive reward ft (xt ) and observe ft Pk−1 s 1 8: ∀0 ≤ k ≤ K, xt (k) ← 1{k>0} K s=0 vt 9: for k ← 0, 1, 2, . . . , K − 1 do 10: Feed back hvtk , ∇ft (xt (k))i as the payoff to be received by E k 11: end for 12: end for If we assume that the functions ft are non-negative, then we have ft (0) ≥ 0 for all t, which implies that PT the first term −e−1 t=1 ft (0) √ in the regret bound of Theorem 1 is non-positive (thus reduces the entire sum). The second term is O( T ). Finally, If we let the number of RFTL algorithm instances K be equal √ √ 2 T βR2 to T , the final term βR T. 2K will become 2 3.2 1/2 Guarantee via Online Gradient Ascent We saw that when the gradient can be efficiently evaluated, Meta-Frank-Wolfe presented in Algorithm 1 yields a sublinear regret bound. However, efficient evaluation of the gradient could be impossible in many scenarios. For example, exact evaluation of the gradients of the multilinear extension of a submodular set function requires summation over exponentially many terms. Furthermore, one may consider a class of stochastic continuous DR-submodular functions f (x) = Eθ∼D [fθ (x)], where every fθ is continuous DRsubmodular and the parameter θ is sampled from a (potentially unknown) distribution D (Hassani et al., 2017; Karimi et al., 2017). Again, in such cases it is generally intractable to compute the gradient of f (x), namely, ∇f (x) = Eθ∼D [∇fθ (x)]4 . Instead, the stochastic terms ∇fθ (x) provide unbiased √ estimates for the gradients. Another disadvantage of the Meta-Frank-Wolfe algorithm is that it requires O( T ) gradient queries for each function ft , which may be even more prohibitive. In this subsection, we show how we can use Online Gradient Ascent to design an algorithm with sublinear regret and robust to stochastic gradients when the functions ft are monotone and continuous DR-submodular. First, it was shown by Hassani et al. (2017) that a direct usage of unbiased estimates of the gradients in Frank-Wolfe-type algorithms can lead to arbitrarily bad solutions in the context of stochastic submodular maximization. This happens due to the non-vanishing variance of gradient approximations. As a result, new techniques should be developed for the online optimization algorithm with access to unbiased estimates of the gradients of ft (instead of the exact gradients). To handle the stochastic noise in the gradient, we consider 2 the (stochastic) gradient ascent method. In Theorem 2, we show that the ( γ 2γ+1 )-regret of (stochastic) Online √ Gradient Ascent is bounded by O( T ) for γ-weakly DR-submodular functions. In particular, for the special √ case of γ = 1, the 1/2-regret of Online Gradient Ascent is bounded by O( T ) for continuous DR-submodular functions. The precise description of Online Gradient Ascent is presented in Algorithm 2 while its stochastic version is presented in Algorithm 3. Theorem 2. (Proof in Appendix B) Assume that the functions ft : X → R+ are monotone and weakly DR-submodular with parameter γ for t = 1, 2, 3, . . . , T . Let {xt : 1 ≤ t ≤ T } be the choices of Algorithm 2 4 This equation holds if some regularity conditions are satisfied, in light of Lebesgue’s dominated convergence theorem. 6 Algorithm 2 Online Gradient Ascent Input: convex set P, T , x1 ∈ P, step sizes {ηt } Output: {xt : 1 ≤ t ≤ T } 1: for t ← 1, 2, 3, . . . , T do 2: Play xt and receive reward ft (xt ). 3: xt+1 = ΠP (xt + ηt ∇ft (xt )) 4: end for Algorithm 3 Online Stochastic Gradient Ascent Input: convex set P, T , x1 ∈ P, step sizes {ηt } Output: {xt : 1 ≤ t ≤ T } 1: for t ← 1, 2, 3, . . . , T do 2: Play xt and receive reward ft (xt ). 3: Observe gt such that E[gt |xt ] = ∇ft (xt ) 4: xt+1 = ΠP (xt + ηt gt ) 5: end for (Algorithm 3, respectively) and let ηt = D √ , G t then we have √ T T X 3γDG T γ2 X ∗ f (x ) − f (x ) ≤ t t t γ 2 + 1 t=1 2(γ 2 + 1) t=1 and √ T T X 3γDG T γ2 X ∗ ft (x ) − E [ft (xt )] ≤ . γ 2 + 1 t=1 2(γ 2 + 1) t=1 for Algorithm 2 and Algorithm 3, respectively, where D = diam(P) and G = sup1≤t≤T,x∈P k∇ft (x)k (for Algorithm 3, G = sup1≤t≤T kgt k) are assumed to be finite. In particular, when ft is continuous DR-submodular (γ = 1), we have T T X √ 1X 3 ft (x∗ ) − ft (xt ) ≤ DG T 2 t=1 4 t=1 and T T X √ 3 1X ft (x∗ ) − E[ft (xt )] ≤ DG T , 2 t=1 4 t=1 respectively. 4 Experiments In the experiments, we compare the performance of the following algorithms: • Meta-Frank-Wolfe. We choose r(x) = kx − x0 k2 /2 as the regularizer of the RFTL in Meta-Frank-Wolfe. RFTL has a parameter η that balances the sum of inner products with the gradients of each step and the regularizer (Hazan, 2016). • Online Gradient Ascent. We also denote the step size (also known as the learning rate) of the online gradient ascent by η. Therefore Online Gradient Ascent also has a parameter η. • Random100. For each objective function ft , Random100 samples 100 points in the constraint set and selects the one that maximizes ft . We would like to emphasize that Random100 is infeasible in the online setting since online algorithms have to make decisions before an objective function is revealed. 7 10000 7500 5000 2500 Meta-FW (η=0.1) Meta-FW (η=0.01) OGA (η=0.1) OGA (η=0.01) SurrGA (η=0.1) SurrGA (η=0.01) Random100 7500 5000 3000 1 − 1 e -regret Meta-FW (η=0.1) Meta-FW (η=0.01) OGA (η=0.1) OGA (η=0.01) SurrGA (η=0.1) SurrGA (η=0.01) Random100 1 − 1 e -regret 1 − 1 e -regret 10000 2500 0 0 0 25 50 Iteration index 75 100 0 25 50 Iteration index (a) 2000 1500 100 Meta-FW (η=1e-3) Meta-FW (η=8e-4) OGA (η=1e-3) OGA (η=8e-4) 0 25 (b) 3.8 3.7 3.6 Meta-FW (η=0.8) Meta-FW (η=1) OGA (η=0.8) OGA (η=1) 3.5 0 10 20 30 Iteration index 40 50 75 100 Meta-FW (η=0.8) Meta-FW (η=1) OGA (η=0.8) OGA (η=1) 4.5 4.0 5 10 15 Number of RFTL instances (d) 50 Iteration index (c) 5.0 1 − 1 e -regret 1 − 1 e -regret 75 2500 20 (e) Figure 1: In the legends of all subfigures, we write Meta-FW for Meta-Frank-Wolfe, OGA for Online Gradient Ascent, and SurrGA for Surrogate Gradient Ascent. The results for the multilinear extension are presented in Figs. 1a and 1b. We present the (1 − 1/e)-regret versus the number of iterations in Fig. 1a. In Fig. 1b we illustrate the result for the setting in which only an unbiased estimate of the gradient is available. Fig. 1c shows how the (1 − 1/e)-regret evolves for the non-convex/non-concave quadratic programming. Figs. 1d and 1e are about the D-optimal experiment design problem. Fig. 1d shows the (1 − 1/e)-regret versus the number of iterations, while Fig. 1e shows how the number of RFTL instances K influences the performance of Meta-Frank-Wolfe. • Surrogate Gradient Ascent. When the objective functions are the multilinear extension of submodular coverage functions, we also studied the performance of gradient ascent applied to a surrogate function, which is shown to be a concave upper bound for the multilinear extension (Karimi et al., 2017). 4.1 Multilinear Extension As our first experiment, we consider a sequence of multilinear extensions of weighted coverage functions (see Section 2.2). Recall that such functions have a concave lower bound. Thus, we introduce another baseline Surrogate Gradient Ascent that uses supergradient ascent to maximize the concave lower bound function (1 − 1/e)f¯(x). The result is presented in Fig. 1a. We observe that Random100 has the highest regret and both Meta-Frank-Wolfe and Online Gradient Ascent, whose performance is slightly inferior to that of Meta-Frank-Wolfe, outperform Surrogate Gradient Ascent. Then, we study the case where only an unbiased estimate of the gradient is available. For any x ∈ [0, 1]n , let ˜ (x)]i , f (Ri ∪ {i}) − f (Ri ), [∇f where Ri is a random subset of [n] \ {i} such that each j 6= i is in Ri with probability xj independently. Then ˜ (x)] = ∇f (x) (Calinescu et al., 2011). The result in this setting is presented in Fig. 1b. Notice we have E[∇f that in Fig. 1b the regret of Random100 and Surrogate Gradient Ascent is uninfluenced by the stochastic gradient oracle since they do not rely on the exact gradient of the original objective function. Meta-FrankWolfe and Online Gradient Ascent both incur higher regret in Fig. 1b than in Fig. 1a. In addition, the stochastic gradient oracle has more impact upon Meta-Frank-Wolfe than Online Gradient Ascent. This agrees with our theoretical guarantee for Online Gradient Ascent and a result from (Hassani et al., 2017), which states that Frank-Wolfe-type algorithms are not robust to stochastic noise in the gradient oracle. 8 4.2 Non-Convex/Non-Concave Quadratic Programming Quadratic programming problems have objective functions of the form f (x) = 12 x> Hx + h> x + c and linear equality and/or inequality constraints. If the matrix H is indefinite, the objective function becomes non-convex and non-concave. We constructed m linear inequality constraints Ax ≤ b, where each entry of A ∈ Rm×n is sampled uniformly at random from [0, 1]. We set m = 2. In addition, we require that the variable x reside in a positive cuboid. Formally, the constraint is a positive polytope P = {x ∈ Rn : Ax ≤ b, 0 ≤ x ≤ u}. We set b = u = 1. To ensure that the gradient is non-negative, we set h = −H> u. Without loss of generality, we assume that the constant term c is 0. Thus the function is f (x; H) = ( 21 x − u)> Hx; it is fully determined by the matrix H. In our online optimization setting, we assume that the T functions f1 , f2 , . . . , fT are associated with matrices H1 , H2 , . . . , HT . For every Hi , its entries are sampled uniformly at random from [−100, 0]. We set K = 50. The result is illustrated in Fig. 1c. It can be observed that with the same step size η, the regret of Meta-Frank-Wolfe is smaller than Online Gradient Ascent. 4.3 D-Optimal Experimental Design P  N > The objective function of the D-optimal design problem is f (λ) = log det . We write A(λ) i=1 λi xi xi PN > for i=1 λi xi xi for the ease of notation. It is DR-submodular because for any i and j ∂ 2 f (λ) −1 = −(x> xi )2 ≤ 0. j A(λ) ∂λj ∂λi For every xi , its entries are sampled from the standard normal distribution independently. We try to solve the maximization in the polytope P = {λ : A(λ − 1) ≤ 1, 1 ≤ λ ≤ 2}. Each entry of A is sampled uniformly from [0, 1] and the number of inequality constraints is set to 2. The polytope is shifted to avoid 0 since the function is undefined at λ = 0. In Fig. 1d, we illustrate how the function value attained by the algorithms varies as it experiences more iterations; K is fixed to be 50 in this set of experiments. We observe that Meta-Frank-Wolfe outperforms all other baselines. In addition, Meta-Frank-Wolfe achieves better performance when the step size η = 1. In the second set of experiments, we show the function values attained by the algorithms at the end of the 50th iteration, with K ranging from 1 to 20 for Meta-Frank-Wolfe. Recall that K is the number of Frank-Wolfe steps in Meta-Frank-Wolfe. The result is presented in Fig. 1e. Since K is not a parameter of Online Gradient Ascent, the regret of Online Gradient Ascent remains constant as K varies. The regret of Meta-Frank-Wolfe is reduced as K increases. This agrees with our intuition that more Frank-Wolfe steps yield better performance. 5 Related Work Submodular functions. Submodularity is a structural property that is often associated with set functions (Nemhauser et al., 1978; Fujishige, 2005). It has found far-reaching applications in statistics and artificial intelligence, including active learning (Golovin and Krause, 2011), viral marketing (Kempe et al., 2003; Gomez Rodriguez et al., 2012; Zhang et al., 2016), network monitoring (Leskovec et al., 2007; Gomez Rodriguez et al., 2010), document and corpus summarization (Lin and Bilmes, 2011; Kirchhoff and Bilmes, 2014; Sipos et al., 2012), crowd teaching (Singla et al., 2014), feature selection (Elenberg et al., 2016), and interpreting deep neural networks (Elenberg et al., 2017). However, submodularity goes beyond set functions and can be extended to continuous domains (Wolsey, 1982; Topkis, 1978). Maximizing a submodular set function is inherently related to its continuous relaxation through the multilinear extension (Calinescu et al., 2011), which is an example of the DR-submodular function. A variant of the Frank-Wolfe algorithm, called continuous greedy (Calinescu et al., 2011; Vondrák, 2008), can be used to maximize, within a (1 − 1/e) approximation to the optimum, the multilinear extension of a submodular set function (Calinescu et al., 2011) or more generally a monotone smooth submodular function subject to a polytope (Chekuri et al., 2015). It is also known that finding a better approximation guarantee is impossible under reasonable complexitytheoretic assumptions (Feige, 1998; Vondrák, 2013). More recently, Bian et al. (2017) generalized the above 9 results by considering the maximization of continuous DR-submodular functions subject to down-closed convex bodies and showed that the same continuous greedy method achieves a (1−1/e) guarantee. In a different line of work, Hassani et al. (2017) studied the applicability of the (stochastic) gradient ascent algorithms to the stochastic continuous submodular maximization setting, where the objective function is defined in terms of an expectation. They proved that gradient methods achieve a 1/2 approximation guarantee for monotone DR-submodular functions, subject to a general convex body. It is also known that gradient methods cannot achieve a better guarantee in general (Hassani et al., 2017; Vondrák et al., 2011). Furthermore, it is also shown in (Hassani et al., 2017) that the continuous greedy algorithms are not robust in stochastic settings (where only unbiased estimates of gradients are available) and can provide arbitrarily poor solutions, in general (thus motivating the need for stochastic projected gradient methods). Even though it is not the focus of this paper, we should mention that continuous submodular minimization has also been studied recently (Bach, 2015; Staib and Jegelka, 2017). Online optimization. Most of the work in online optimization considers convex (when minimizing the loss) or concave (when maximizing the reward) functions. The protocol of online convex optimization (OCO) was first defined by√ Zinkevich (2003). In his influential paper, he proposed the online gradient descent method and showed an O( T ) regret bound. The result was later improved to O(log(T )) regret by Hazan et al. (2007) for strongly convex functions. Kalai and Vempala (2005) developed another class of algorithms termed Follow-The-Leader (FTL) with the idea of finding a point that minimizes the accumulated sum of all objective functions revealed so far. However, there are simple situations in which the regret of FTL grows linearly with T . To circumvent this issue, Kalai and Vempala (2005) introduced random perturbation as a regularization and proposed the follow-the-perturbed-leader algorithm, following an early work (Hannan, 1957). In addition, Shalev-Shwartz and Singer (2007) and Abernethy et al. (2008a) designed the regularized-follow-the-leader (RFTL) algorithm. A comprehensive survey of OCO can be found in (Hazan, 2016; Shalev-Shwartz et al., 2012). Recently, Lafond et al. (2015) studied the setting in which the loss functions {ft : 1 ≤ t ≤ T } are drawn i.i.d. from a fixed distribution and proposed the online Frank-Wolfe algorithm. They showed an O(log3 (T )) regret for strongly convex loss functions. Furthermore, they showed that their algorithm p finds a stationary point to the stochastic loss at a rate of O( 1/T ). Garber and Hazan (2013) proposed a conditional gradient algorithm for online convex optimization problem over polyhedral √ sets. Only a single linear optimization step is performed in each iteration and this algorithm achieves O( T ) regret bound for convex losses and O(log T ) regret bound for strongly convex losses. Luo and Schapire (2014) proposed a general methodology for devising online learning algorithms based on a drifting-games analysis. Hazan et al. (2017) goes beyond convexity and considered regret minimization in repeated games with non-convex loss functions. They introduced a new objective termed local regret and proposed online non-convex optimization algorithms that achieve optimal guarantees for this new objective. Our work, in contrast, considers nonconvex objective functions that can be approximately maximized. In our notion of α-regret, we design two algorithms that can compete with the best fixed offline approximate solution (and not necessarily the stationary points) with tight regret bounds. Online submodular optimization. Existing work considered online submodular optimization in a discrete domain. Streeter and Golovin (2009) and Golovin et al. (2014) proposed online optimization algorithms for submodular set functions under cardinality and matroid constraints, respectively. Our work studies the online submodular optimization in continuous domains. We should point out that the online algorithm proposed in Golovin et al. (2014) relies on the multilinear continuous relaxation, which is simply an instance of the general class of DR-submodular functions that we consider here. 6 Conclusion In this paper, we considered an online optimization process, where the objective functions were continuous DR-submodular. We proposed two online optimization algorithms, Meta-Frank-Wolfe (that has access to exact gradients) and Online Gradient Ascent (that only has access to unbiased estimates of the gradients), both with no-regret guarantees. We also evaluated the performance of our algorithms in practice. Our results 10 make an important contribution in providing performance guarantees for a subclass of online non-convex optimization problems. Acknowledgments This work was supported by AFOSR YIP award (FA9550-18-1-0160). 11 References Jacob D Abernethy, Elad Hazan, and Alexander Rakhlin. Competing in the dark: An efficient algorithm for bandit linear optimization. In COLT, pages 263–274, 2008a. Jacob Duncan Abernethy, Elad Hazan, and Alexander Rakhlin. An efficient algorithm for bandit linear optimization. In COLT, 2008b. Francis Bach. Submodular functions: from discrete to continous domains. arXiv preprint arXiv:1511.00394, 2015. An Bian, Baharan Mirzasoleiman, Joachim M. Buhmann, and Andreas Krause. Guaranteed non-convex optimization: Submodular maximization over continuous domains. In AISTATS, February 2017. Gruia Calinescu, Chandra Chekuri, Martin Pál, and Jan Vondrák. Maximizing a monotone submodular function subject to a matroid constraint. SIAM Journal on Computing, 40(6):1740–1766, 2011. Chandra Chekuri, TS Jayram, and Jan Vondrák. On multiplicative weight updates for concave and submodular function maximization. In Proceedings of the 2015 Conference on Innovations in Theoretical Computer Science, pages 201–210. ACM, 2015. Reza Eghbali and Maryam Fazel. Designing smoothing functions for improved worst-case competitive ratio in online optimization. In NIPS, pages 3287–3295, 2016. Ethan R Elenberg, Rajiv Khanna, Alexandros G Dimakis, and Sahand Negahban. Restricted strong convexity implies weak submodularity. arXiv preprint arXiv:1612.00804, 2016. Ethan R Elenberg, Alexandros G Dimakis, Moran Feldman, and Amin Karbasi. Streaming weak submodularity: Interpreting neural networks on the fly. In NIPS, page to appear, 2017. Uriel Feige. A threshold of ln n for approximating set cover. Journal of the ACM (JACM), 45(4):634–652, 1998. Satoru Fujishige. Submodular functions and optimization, volume 58. Elsevier, 2005. Dan Garber and Elad Hazan. A linearly convergent conditional gradient algorithm with applications to online and stochastic optimization. arXiv preprint arXiv:1301.4666, 2013. Daniel Golovin and Andreas Krause. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. JAIR, 42:427–486, 2011. Daniel Golovin, Andreas Krause, and Matthew Streeter. Online submodular maximization under a matroid constraint with application to learning assignments. Technical report, arXiv, 2014. M Gomez Rodriguez, B Schölkopf, Langford J Pineau, et al. Influence maximization in continuous time diffusion networks. In ICML, pages 1–8. International Machine Learning Society, 2012. Manuel Gomez Rodriguez, Jure Leskovec, and Andreas Krause. Inferring networks of diffusion and influence. In SIGKDD, pages 1019–1028. ACM, 2010. Corinna Gottschalk and Britta Peis. Submodular function maximization on the bounded integer lattice. In International Workshop on Approximation and Online Algorithms, pages 133–144. Springer, 2015. James Hannan. Approximation to bayes risk in repeated play. Contributions to the Theory of Games, 3: 97–139, 1957. Hamed Hassani, Mahdi Soltanolkotabi, and Amin Karbasi. Gradient methods for submodular maximization. arXiv preprint arXiv:1708.03949, 2017. Elad Hazan. Introduction to online convex optimization. Foundations and Trends R in Optimization, 2(3-4): 157–325, 2016. 12 Elad Hazan, Amit Agarwal, and Satyen Kale. Logarithmic regret algorithms for online convex optimization. Machine Learning, 69(2):169–192, 2007. Elad Hazan, Karan Singh, and Cyril Zhang. Efficient regret minimization in non-convex games. arXiv preprint arXiv:1708.00075, 2017. Sham M Kakade, Adam Tauman Kalai, and Katrina Ligett. Playing games with approximation algorithms. SIAM Journal on Computing, 39(3):1088–1106, 2009. Adam Kalai and Santosh Vempala. Efficient algorithms for online decision problems. Journal of Computer and System Sciences, 71(3):291–307, 2005. Mohammad Karimi, Mario Lucic, Hamed Hassani, and Andreas Krause. Stochastic submodular maximization: The case of coverage functions. In NIPS, page to appear, 2017. David Kempe, Jon Kleinberg, and Éva Tardos. Maximizing the spread of influence through a social network. In SIGKDD, pages 137–146. ACM, 2003. Katrin Kirchhoff and Jeff Bilmes. Submodularity for data selection in statistical machine translation. In EMNLP, pages 131–141, 2014. Jean Lafond, Hoi-To Wai, and Eric Moulines. On the online Frank-Wolfe algorithms for convex and nonconvex optimizations. arXiv preprint arXiv:1510.01171, 2015. Jure Leskovec, Andreas Krause, Carlos Guestrin, Christos Faloutsos, Jeanne VanBriesen, and Natalie Glance. Cost-effective outbreak detection in networks. In SIGKDD, pages 420–429. ACM, 2007. Hui Lin and Jeff Bilmes. A class of submodular functions for document summarization. In ACL, pages 510–520, 2011. Haipeng Luo and Robert E Schapire. A drifting-games analysis for online learning and applications to boosting. In NIPS, pages 1368–1376, 2014. George L Nemhauser, Laurence A Wolsey, and Marshall L Fisher. An analysis of approximations for maximizing submodular set functionsi. Mathematical Programming, 14(1):265–294, 1978. Hanamantagouda P Sankappanavar and Stanley Burris. A course in universal algebra, volume 78 of Graduate Texts in Mathematics. 1981. Shai Shalev-Shwartz. Online learning: Theory, algorithms, and applications. PhD thesis, The Hebrew University of Jerusalem, 2007. Shai Shalev-Shwartz and Yoram Singer. A primal-dual perspective of online learning algorithms. Machine Learning, 69(2-3):115–142, 2007. Shai Shalev-Shwartz et al. Online learning and online convex optimization. Foundations and Trends R in Machine Learning, 4(2):107–194, 2012. Adish Singla, Ilija Bogunovic, Gábor Bartók, Amin Karbasi, and Andreas Krause. Near-optimally teaching the crowd to classify. In ICML, pages 154–162, 2014. Ruben Sipos, Adith Swaminathan, Pannaga Shivaswamy, and Thorsten Joachims. Temporal corpus summarization using submodular word coverage. In CIKM, pages 754–763. ACM, 2012. Tasuku Soma and Yuichi Yoshida. Maximizing monotone submodular functions over the integer lattice. In International Conference on Integer Programming and Combinatorial Optimization, pages 325–336. Springer, 2016. Matthew Staib and Stefanie Jegelka. Robust budget allocation via continuous submodular functions. In ICML, pages 3230–3240, 2017. 13 Matthew Streeter and Daniel Golovin. An online algorithm for maximizing submodular functions. In NIPS, pages 1577–1584, 2009. Donald M Topkis. Minimizing a submodular function on a lattice. Operations research, 26(2):305–321, 1978. Jan Vondrák. Submodularity in combinatorial optimization. PhD thesis, Charles University, 2007. Jan Vondrák. Optimal approximation for the submodular welfare problem in the value oracle model. In STOC, pages 67–74. ACM, 2008. Jan Vondrák. Symmetry and approximability of submodular maximization problems. SIAM Journal on Computing, 42(1):265–304, 2013. Jan Vondrák, Chandra Chekuri, and Rico Zenklusen. Submodular function maximization via the multilinear relaxation and contention resolution schemes. In STOC, pages 783–792. ACM, 2011. Laurence A Wolsey. An analysis of the greedy algorithm for the submodular set covering problem. Combinatorica, 2(4):385–393, 1982. Yuanxing Zhang, Yichong Bai, Lin Chen, Kaigui Bian, and Xiaoming Li. Influence maximization in messenger-based social networks. In Proceedings of IEEE GLOBECOM 2016, Washington D.C., USA, December 4–8 2016. Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In ICML, pages 928–936, 2003. 14 Appendix A Proof of Theorem 1 Before presenting the proof of Theorem 1, we need two lemmas first. Lemma 1 shows that a β-smooth function can be bounded by quadratic functions from above and below. Lemma 2 shows the concavity of continuous DR-submodular functions along non-negative and non-positive directions. Lemma 1. If f is β-smooth, then we have for any x and y, f (x) − f (y) − ∇f (x)> (x − y) ≤ β kx − yk2 . 2 f (x) − f (y) − ∇f (y)> (x − y) ≤ β kx − yk2 . 2 Proof. Let us define an auxiliary function g(t) = f (x + t(y − x)). We observe that g(0) = f (x) and g(1) = f (y). The derivative of g(t) is g 0 (t) = ∇f (x + t(y − x))> (y − x). We have Z 1 f (y) − f (x) = g(1) − g(0) = g 0 (t)dt = 0 Z 1 ∇f (x + t(y − x))> (y − x)dt. 0 The left-hand side of the first inequality is equal to Z 1 ∇f (x + t(y − x))> (x − y)dt − ∇f (x)> (x − y) 0 Z 1 = (∇f (x + t(y − x)) − ∇f (x))> (x − y) dt 0 Z 1 ≤ (∇f (x + t(y − x)) − ∇f (x))> (x − y) dt 0 Z 1 ≤ k∇f (x + t(y − x)) − ∇f (x)kkx − ykdt 0 Z 1 ≤ βtkx − yk2 dt 0 β = kx − yk. 2 Exchanging x and y in the first inequality, we obtain the second one immediately. Lemma 2 (Proposition 4 in Bian et al. (2017)). A continuous DR-submodular function is concave along any non-negative direction and any non-positive direction. Lemma 2 implies that if f is continuous DR-submodular, fixing any x in its domain, g(z) , f (x + zv) is concave in z as long as v ≥ 0 holds elementwise. Now we present the proof of Theorem 1. Proof. As the first step, let us fix t and k. Since ft is β-smooth, by Lemma 1, for any ξ ≥ 0 and x, v ∈ Rn≥0 , we have β ft (x + ξv) − ft (x) − ∇ft (x)> (ξv) ≥ − kξvk2 2 Let L , βR2 . We deduce ft (xt (k + 1)) − ft (xt (k)) = ft (xt (k) + 1 k 1 L v ) − ft (xt (k)) ≥ hvtk , ∇ft (xt (k))i − . K t K 2K 2 15 We sum the above equation over t and obtain T X T X LT 1 k . hvt , ∇ft (xt (k))i − ft (xt (k + 1)) − ft (xt (k)) ≥ 2 K 2K t =1 t=1 The RFTL algorithm instance E k finds {vtk : 1 ≤ t ≤ T } such that T X hvk∗ , ∇ft (xt (k))i − t=1 T X √ hvtk , ∇ft (xt (k))i ≤ rk ≤ 2DG T , t=1 where vk∗ = arg max v∈P T X hv, ∇ft (xt (k))i t=1 k and r is the total regret that the RFTL instance suffers by the end of the T th iteration. According to the √ regret bound of the RFTL, we know that rk ≤ 2DG T . Therefore, ! T T X 1 X k∗ LT ft (xt (k + 1)) − ft (xt (k)) ≥ . hv , ∇ft (xt (k))i − rk − 2 K 2K t=1 t=1 PT We define x∗ , arg maxv∈P t=1 ft (v) and wtk = (x∗ −xt (k))∨0. For every t, we have wtk = (x∗ −xt (k))∨0 ≤ x∗ . It is obvious that wtk ≥ 0. Therefore we deduce that wtk ∈ X . Due to the concavity of ft along any non-negative direction (see Lemma 2), we have ft (xt (k) + wtk ) − ft (xt (k)) ≤ hwtk , ∇ft (xt (k))i. In light of the above equation, we obtain a lower bound for PT t=1 hv k∗ , ∇ft (xt (k))i: T T X X hvk∗ , ∇ft (xt (k))i ≥ hx∗ , ∇ft (xt (k))i t=1 t=1 T (a) X ≥ hwtk , ∇ft (xt (k))i t=1 ≥ T X (ft (xt (k) + wtk ) − ft (xt (k))) t=1 = T X (ft (x∗ ∨ xt (k)) − ft (xt (k))) t=1 ≥ T X (ft (x∗ ) − ft (xt (k))). t=1 We use the fact that ∇ft (xt (k)) ≥ 0 and x∗ ≥ wtk entrywise in the inequality (a). ! T T X 1 X LT ∗ k ft (xt (k + 1)) − ft (xt (k)) ≥ (ft (x ) − ft (xt (k))) − r − . K t=1 2K 2 t=1 After rearrangement, T X t=1 (ft (xt (k + 1)) − ft (x∗ )) ≥ (1 − T 1 X 1 LT ) (ft (xt (k)) − ft (x∗ )) − rk − . K t=1 K 2K 2 16 Therefore, T X (ft (xt (K)) − ft (x∗ )) ≥ (1 − t =1 k=0 = (1 − Since (1 − T K−1 1 X k LT 1 KX r − ) (ft (xt (0)) − ft (x∗ )) − K K 2K t=1 (ft (0) − ft (x∗ )) − t=1 1 K K−1 X rk − k=0 LT . 2K ≤ e−1 , we have 1 K K) T X 1 K ) K T X (ft (x∗ ) − ft (xt (K))) ≤ (1 − t =1 T K−1 1 KX 1 X k LT ) (ft (x∗ ) − ft (0)) + r + K K 2K t=1 k=0 ≤ e−1 T X (ft (x∗ ) − ft (0)) + t=1 1 K K−1 X rk + k=0 LT . 2K After rearrangement, we have T X ft (xt (K)) ≥ (1 − 1/e) T X t =1 ft (x∗ ) + e−1 t=1 T X ft (0) − t=1 K−1 1 X k LT r − . K 2K 2 k=0 Plugging in the definition of rk gives T X ft (xt ) = T X ft (xt (K)) ≥ (1 − 1/e) ft (x∗ ) + e−1 t=1 t=1 t=1 T X T X √ LT ft (0) − 2DG T − . 2K t=1 Recall that xt (K) is exactly xt . Thus equivalently, we have (1 − 1/e) T X ft (x∗ ) − t=1 Appendix B B.1 T X ft (xt ) ≤ −e−1 t=1 T X √ βR2 T . ft (0) + 2DG T + 2K t=1 Proof of Theorem 2 Gradient Ascent Case The theoretical guarantee of gradient ascent methods applied to concave functions relies on a pivotal property that characterizes concavity: if F is concave, then F (y) − F (x) ≤ h∇F (x), y − xi. Fortunately, there is a similar property that holds for monotone weakly DR-submodular functions, which is presented in Lemma 3. Lemma 3. Let F : X → R+ be a monotone and weakly DR-submodular function with parameter γ. For any two vector x, y ∈ X , we have   1 1 F (y) − 1 + 2 F (x) ≤ h∇F (x), y − xi . γ γ The proof of Lemma 3 can be found in the proof of Theorem 4.2 in (Hassani et al., 2017). Now we can prove Theorem 2 in the gradient ascent case. PT Proof. Let x∗ = arg maxx∈P t=1 ft (x). We define ∇t , ∇ft (xt ). By the definition of xt+1 and properties of the projection operator for a convex set, we have 2 2 2 2 2 ∗ kxt+1 − x∗ k = kΠP (xt + ηt ∇t ) − x∗ k ≤ kxt + ηt ∇t − x∗ k ≤ kxt − x∗ k + ηt2 k∇t k − 2ηt ∇> t (x − xt ). 17 Therefore we deduce ∗ ∇> t (x − xt ) ≤ ≤ 2 2 2 2 kxt − x∗ k − kxt+1 − x∗ k + ηt2 k∇t k 2ηt 2 kxt − x∗ k − kxt+1 − x∗ k ηt G2 + 2ηt 2 By Lemma 3, we obtain that  1 ft (x ) − 1 + 2 γ ∗ If we define 1 η0  f (xt ) ≤ 1 h∇t , x∗ − xt i . γ , 0, it can be deduced that    T  T X 1X > ∗ 1 ft (x∗ ) − 1 + 2 ft (xt ) ≤ ∇ (x − xt ) γ γ t=1 t t =1 " # T T  G2 X 1 1 X 2 2 ηt ≤ kxt − x∗ k − kxt+1 − x∗ k + γ 2ηt t=1 2 t=1 " # ! T T 1 1 X 1 G2 X ∗ 2 1 ≤ kxt − x k ( − ηt ) + γ 2 t=1 ηt ηt−1 2 t=1 " # T 1 D2 G2 X ≤ ηt + γ 2ηT 2 t=1 √ 3 ≤ DG T . 2γ After rearrangement, it is clear that √ T T X 3γDG T γ2 X ∗ ft (xt ) ≤ ft (x ) − . γ 2 + 1 t=1 2(γ 2 + 1) t=1 B.2 Stochastic Gradient Ascent Case Proof. The strategy for the stochastic gradient ascent case is similar to that of the gradient ascent case. Again, by the definition of xt+1 , we have 2 2 2 2 2 kxt+1 − x∗ k = kΠP (xt + ηt gt ) − x∗ k ≤ kxt + ηt gt − x∗ k ≤ kxt − x∗ k + ηt2 kgt k − 2ηt gt> (x∗ − xt ) Therefore we deduce 2 gt> (x∗ − xt ) ≤ 2 2 2 2 kxt − x∗ k − kxt+1 − x∗ k + ηt2 kgt k kxt − x∗ k − kxt+1 − x∗ k ηt G2 ≤ + 2ηt 2ηt 2 18 Similarly, if we define 1 η0 , 0 and in light of Lemma 3, it can be deduced that T X     T  1X  > ∗ 1 E ft (x∗ ) − 1 + 2 ft (xt ) ≤ E ∇t (x − xt ) γ γ t=1 t =1 = = ≤ ≤ ≤ ≤ T  1X   > ∗ E E ∇t (x − xt )|xt γ t=1 T  1X   > ∗ E E gt (x − xt )|xt γ t=1 " # T T i G2 X 1 1 X h 2 2 ηt E kxt − x∗ k − kxt+1 − x∗ k + γ 2ηt t=1 2 t=1 " # ! T T i 1 1 1 X h 1 G2 X ∗ 2 E kxt − x k ( − ηt ) + γ 2 t=1 ηt ηt−1 2 t=1 " # T 1 D2 G2 X ηt + γ 2ηT 2 t=1 √ 3 DG T . 2γ After rearrangement, it is clear that √ T T X 3γDG T γ2 X ∗ E [ft (xt )] ≤ ft (x ) − . γ 2 + 1 t=1 2(γ 2 + 1) t=1 19
2cs.AI
Better Unrelated Machine Scheduling for Weighted Completion Time via Random Offsets from Non-Uniform Distributions arXiv:1606.08817v1 [cs.DS] 28 Jun 2016 Sungjin Im∗ Shi Li † Abstract In this paper we consider the classic scheduling problem of minimizing total P weighted completion time on unrelated machines when jobs have release times, i.e, R|rij | j wj Cj using the three-field notation. For this problem, a 2-approximation is known based on a novel convex programming (J. ACM 2001 by Skutella). It has been a long standing open problem if one can improve upon this 2-approximation (Open Problem 8 in J. of Sched. 1999 by Schuurman and Woeginger). We answer this question in the affirmative by giving a 1.8786-approximation. We achieve this via a surprisingly simple linear programming, but a novel rounding algorithm and analysis. A key ingredient of our algorithm is the use of random offsets sampled from non-uniform distributions. P We also consider the preemptive version of the problem, i.e, R|rij , pmtn| j wj Cj . We again use the idea of sampling offsets from non-uniform distributions to give the first better than 2-approximation for this problem. This improvement also requires use of a configuration LP with variables for each job’s complete schedules along with more careful analysis. For both non-preemptive and preemptive versions, we break the approximation barrier of 2 for the first time. ∗ Electrical Engineering and Computer Science, University of California, 5200 N. Lake Road, Merced CA 95344. [email protected]. Supported in part by NSF grant CCF-1409130. † Department of Computer Science and Engineering, University at Buffalo, 1 White Road, Buffalo, NY 14260. [email protected]. Supported in part by NSF grant CCF-1566356. 1 Introduction Modern computing facilities serve a large number of jobs with different characteristics. To cope with this challenge, they are equipped with increasingly heterogeneous machines that are clustered and connected in networks, so that each job can be scheduled on a more suitable machine [25, 23, 8]. Further, the large number of machines of different generations are deployed over a long period of time, increasing the heterogeneity. The scheduling decision must factor in the heterogeneity and communication overhead. Unrelated machine scheduling is a widely studied classic model that captures various scenarios including the above. There is a set J of jobs to be scheduled on a set M of unrelated machines. Each job j ∈ J can have an arbitrary processing time/size pi,j depending on the machine i it gets processed; if pi,j = ∞, then job j cannot be scheduled on machine i. Furthermore, due to the communication delay, job j is available for service only from time ri,j , which can be also arbitrary depending on the job j and the machine i the job gets assigned to. The parameter ri,j is often called as job j’s arrival/release time.1 Another parameter wj is used to capture job j’s importance. Minimizing total (weighted) completion time is one of the most popular scheduling objectives that has been extensively studied, even dating back to 50’s [32]. The scheduler must assign each job j to a machine i and complete it. We consider two settings, preemptive and non-preemptive schedules. In the non-preemptive setting, each job must be completed without interruption once it starts getting processed. On the other hand, in the preemptive setting, each job’s processing can be interrupted to process other jobs and be resumed later. In both cases, job j’s completion time is, if j is assigned to machine i, defined as the P first time when the job gets processed for pi,j units of time. Then, the objective is to minimize j∈J wj Cj . These P two non-preemptive and P preemptive versions can be described as R|rj | j wj Cj and R|rj , pmtn| j wj Cj respectively, using the popular three-field notation in scheduling literature. Both versions of the problem are strongly NP-hard even in the single machine setting [21], and are APX-hard even when all jobs are available for schedule at time 0 [18], in which case preemption does not help. For the non-preemptive case, Skutella gave a 2-approximation based on a novel convex programming [30], which improved upon the (2+ǫ)-approximation based on linear programming [26]. It has been an outstanding open problem if there exists a better than 2-approximation [30, 27, 26, 20, 34]. In particular, it is listed in [27] as one of the top 10 opens problems in the field of approximate scheduling algorithms; see the Open Problem 8. When jobs have no arrival times, i.e. ri,j = 0 for all i, j, very recently Bansal et al. [6] gave a better than 1.5-approximation in a breakthrough result, improving upon the previous best 1.5-approximations due to Skutella [30] and Sethuraman and Squillante [28]. In fact, the Open Problem 8 consists of two parts depending on whether jobs have release times or not. Bansal et al. [6] solved the first part of Open Problem 8, and the second part still remained open. 1.1 Our Results In this paper, we answer the second part of the open problem in the affirmative by giving a better than 2-approximation. Theorem 1.1 (Section 2). For a constant α < 1.8786, there exists an α-approximation for P R|rj | j wj Cj . 1 For simplicity, we will mostly assume that job j’s release time ri,j is the same for all machines. This will justify using a simpler notation rj in place of ri,j . Like most of previous works, extending our result to release dates with dependency on machines is straightforward. 1 Surprisingly, we give this result by rounding a very simple and natural LP that has not been studied in previous works. Our LP can be viewed as a stronger version of the time-indexed LP in [26], by taking the non-preemption requirement into consideration. However, even with this stronger LP, the rounding algorithm in [26] does not yield a better than 2-approximation (see the discussion about use of uniform distribution in Section 3.2), and we believe this is why the previous works overlooked this simple LP. Improving the 2-approximation ratio requires not only the stronger LP, but also novel rounding algorithm and analysis. Our result also gives a positive answer to the conjecture made by Sviridenko and Wiese [34]. They considered a configuration LP where there is a variable for every machine i ∈ M and subset of jobs S ⊆ J. The variable is associated with the optimal total weighted completion time of the jobs in S on machine i. They showed that one can solve their LP within a factor of 1 + ǫ, but could not give a better than 2-approximation, conjecturing that their LP have an integrality gap strictly less than 2. Indeed, one can show that the configuration LP of [34] isP the strongest among all Pconvex programmings of the following form (see Appendix A): minimize i∈M fi (xi ) subject to i∈M xi,j = 1 for every j ∈ J and xi,j ≥ 0 for every i ∈ M, j ∈ J, where xi = (xi,j )j∈J ∈ [0, 1]J and fi is some convex function over [0, 1]J such that if xi ∈ {0, 1}J , then fi (xi ) is at most the total weighted completion time of scheduling jobs {j : xi,j = 1} optimally on machine i. All results mentioned in this paper (including our results) are based on programmings of this form and thus the configuration LP is the strongest among them. Hence, our result gives a 1.8786 upper bound on the integrality gap of the configuration LP. With a solution to the configuration LP, one can derive a natural independent rounding algorithm. For each job j, independently assign j to a machine i with probability xi,j . Then for every machine i, we schedule all jobs assigned to i; this can be done optimally if all release times are 0 [32], and nearly optimally (within (1 + ǫ) factor) in general [1, 17]. When all jobs have release time 0, the algorithm gives a 1.5-approximation. However, [6] showed this independent rounding algorithm can not give a better than 1.5-approximation, which motivated them to develop a clever dependent rounding algorithm. P algorithm is known to give a 2-approximation For R|rj | j wj Cj , the independent rounding P [26, 30]. In contrast to the status for R|| j wj Cj , no matching lower bound was known for this algorithm. Our result indirectly shows that the independent rounding can achieve 1.8786approximation. Thus we do not need to apply the sophisticated dependence rounding scheme P of [6], which only led to a tiny improvement on the approximation ratio for R|| j wj Cj . We complement our positive result by showing that the independent rounding algorithm can not give an approximation ratio better than e/(e − 1) ≈ 1.581. Theorem 1.2 (Section B). There is an instance for which the independent rounding gives an approximation ratio worse than e/(e − 1) − ǫ ≥ 1.581 − ǫ for any ǫ > 0. We continue to study the preemptive case. In the preemptive case, two variants were considered in the literature depending on whether jobs can migrate across machines or must be completed scheduled on one of the machines. If migration is not allowed, the work in [26] still gives a (2 + ǫ)approximation since the LP therein is a relaxation for preemptive schedules but the rounding outputs a non-preemptive schedule. If migration is allowed, [30] gives a 3-approximation. Our main result for the preemptive case is the first better than 2-approximation when migration is not allowed. Theorem 1.3 P (Section 3). For a constant α < 1.99971, there exists an α-approximation for R|rj , pmtn| j wj Cj . 2 We note that our algorithm is based on a stronger linear programming relaxation. The configuration LP of [34] is for non-preemptive schedules hence not usable for preemptive schedules. Our LP is a different type of configuration LP where there are variables for each job’s complete schedules. While we use an LP for preemptive schedules, we output a non-preemptive schedule. 1.2 Our Techniques As mentioned before, we give a better than 2-approximation for the non-preemptive case based on a very simple LP. In this LP, we have an indicator variable yi,j,s which is 1 if job j starts at time s on machine i. Then, we add an obvious constraint that no more than one job can be processed at any time on any machine. This LP has a pseudo-polynomial size but can be reduced to a polynomial size using standard techniques with a loss of (1 + ǫ) factor in approximation. As mentioned earlier, our algorithm falls intoP the independent rounding framework: we assign each job j to machine i with probability xi,j = s yi,j,s independently following the optimal LP solution. Then, it remains to schedule jobs assigned to each machine.2 Any solution to our LP is also a solution to the LP in [26]. When restricted to a solution to our LP, the rounding algorithm of [26] works as follows. For every j that is assigned to i, we choose sj = s randomly with probability proportional to yi,j,s. Then we choose τj uniformly at random from [sj , sj + pi,j ]; here τj − sj can be viewed as a random extra offset applied to j. We schedule jobs assigned to i non-preemptively in increasing order of τj values. While this gives a 2-approximation, this is the best one can obtain using their LP since it has a matching integrality gap. Even with our stronger LP, the algorithm only gives a 2-approximation. We use a more sophisticated distribution to sample τj for individual jobs. Discovering such a distribution and showing how it helps improve the approximation ratio requires a novel analysis. We are not the first that use non-uniform distributions for scheduling problems. Goemans et al. [16] usedP non-uniform distributions in their α-point rounding for the single machine scheduling, i.e. 1|rj | j wj Cj to give a 1.6853-approximation. However, their analysis does not lend itself to multiple machines. The LP objective considered in [16] uses the notion of fractional completion time, which views a job j of size pj as consisting of pj unit pieces with weight wj /pj . In this view, the optimal schedule trivially follows from the simple greedy Smith rule. [16] heavily uses this special structure to get a better than 2 approximation. However, this relaxation inherently loses a factor 2 when applied to multiple machines even with some correction terms [26, 30]. Hence to overcome the 2-approximation barrier, one has to deviate from this relaxation and the special structure used in [16], which calls for use of a stronger LP along with new algorithms and/or analysis. Intuitions on the effect of non-uniform distributions can be found in Section 2, particularly in discussion of the limitations of uniform distributions. As mentioned before, the preemptive result requires an even stronger LP where there is a variable for each job’s complete schedule. Since preemption is allowed, even when all parameters are polynomially bounded, the LP has exponentially many variables. We solve this LP by solving its dual with help of a separation oracle. While the algorithm for the non-preemptive case naturally extends to the preemptive case, the analysis doesn’t. At a high level, the analysis for both cases needs to carefully handle the interaction between busy times and idle times which both can contribute jobs delays. Non-preemptive schedules possess better structural properties which allow us to break down the analysis into that for each time step. However, preemptive schedules lack such properties and require a different analysis of a somewhat amortized flavor. P Since 1|rj | j wj Cj admits a PTAS, given the set of jobs assigned to i, one can find a (1 + ǫ)-approximately optimal schedule on i. However, it is hard to directly relate this schedule to the fractional solution. 2 3 1.3 Other Related Work P The first non-trivial O(log2 n)-approximation for R|rij | j wj Cj was given by Stein et al. [24] using a hypergraph matching. Then, subsequent works [17, 26, 30] gave constant approximations, culminating in a 2-approximation [30] which was the best known prior to our work. The work in [17] uses the celebrated rounding for the generalized assignment problem [29] to round an LP with intervals of doubling lengths, thereby giving a 16/3-approximation. As mentioned before, [26] gives a (2 + ǫ)-approximation, and there is an easy instance of matching integrality gap for their LP. Subsequently, Skutella gave a 2-approximation using a convex programming [30], which is tight since the CP has an integrality gap of 2. When machines are identical or uniformly related, a special case of unrelated machines, PTASes are known [1, 31, 10]. Minimizing makespan or equivalently the maximum completion time is a closely related objective. For this problem when all jobs arrive at time 0, Lensta et al. gave a 2-approximation and showed it does not admit a better than 1.5 approximation unless P = NP [22]. Reducing this gap remains open. Svensson showed that one can estimate the optimal makespan within a factor of 33/17 + ǫ for the special case of restricted assignment [33]. For other interesting special cases, see [12] and its follow-up works. For the dual objective of maximizing the minimum load on any machine, see [7, 3, 2, 9, 13]. For the minimizing ℓp normsPof completion times, see [4, 19]. For the objective of minimizing total flow time, i.e. j (Cj − rj ), a poly-logarithmic approximation is known [5]. For earlier works for the restricted assignment case, see [14, 15]. Due to the vast literature on scheduling, our discussion on related work is necessarily incomplete. For a nice survey and more pointers, see [11]. 2 Non-Preemptive Scheduling We begin by giving an LP for the non-preemptive case. To present our algorithm and analysis more transparently, we assume that all parameters are polynomially bounded, i.e. all wj , rj , pi,j are poly(|J|, |M |). Although we can also handle the case when pij = ∞ by not allowing j to be scheduled on machine i, we assume such a case does not happen since the extension is straightforward. These simplifying Passumptions will be removed in Section C. Define T := i,j pi,j + maxj rj so that any ‘reasonable’ scheduler can complete all jobs by the time T . Throughout this section, s is always an integer. X min wj yi,j,s(s + pi,j ) (LPinterval ) i∈M, j∈J, s∈[0,T ) X s.t ∀i ∈ M, j ∈ J (1) ∀j ∈ J (2) yi,j,s ≤ 1 ∀i ∈ M, t ∈ [T ] (3) yi,j,s ≥ 0 ∀i ∈ M, j ∈ J, s ∈ [0, T ) yi,j,s = xi,j s∈[0,T ) X X xi,j = 1 i∈M j∈J, s∈[max{0,t−pi,j },t) yi,j,s = 0 ∀i ∈ M, j ∈ J, s < rj or s > T − pi,j To see this is a valid LP relaxation for non-preemptive schedules, assume that all variables can only take integer values. Then, the first two constraints require that each job j must be assigned to exactly one machine, which is captured by the indicator variable xi,j . The variable yi,j,s = 1 if 4 and only if j starts getting processed at time s on machine i. The constraints (3) ensure that only one job gets processed at a time on any machine. The last constraint prohibits jobs from getting processed before their arrival times. We obtain a valid LP relaxation by allowing variables to have fractional values. Rounding. We now describe how to round the LP, which consists of two steps. The first step is to define a ‘pseudo’ arrival time τj ≥ rj for each job j. For each job j, we can view {yi,j,s}i,s as a probability distribution over pairs (i, s) due to Constraint (1), and choose a pair (ij , sj ) according to the distribution randomly and independently. Job j will be scheduled on machine ij . Let Θ be some distribution over real numbers in [0, 1] where no number in the distribution occurs with positive probability; Θ will be fixed later. We randomly and independently choose a number θj from Θ. Define τj = sj + θj · pij ,j . We assume w.l.o.g. that all jobs have different τj values since this event happens almost surely. In the second step, we finalize each machine’s schedule. For each i ∈ M , let Ji = {j ∈ J : ij = i} be the set of jobs that are assigned to i. Let π be the ordering of Ji according to increasing order of τj values. We schedule jobs in Ji on machine i according to π, pretending that τj is job j’s actual arrival time. That is, job j ∈ Ji starts when all jobs in Ji ahead of j in the ordering of π complete, or at time τj , whichever comes later. Notice that if we use the actual arrival times rj instead of the pseudo ones for scheduling, we can obtain the optimum schedule on i respecting the ordering π – that is, each job j ∈ Ji starts when all jobs in Ji before j according to π complete, or at time rj , whichever comes later. The schedule given by our algorithm might be worse than this optimum schedule respecting π. However, for the sake of analysis, it is more convenient to use our schedule, rather than the optimum one. Our schedule on machine i might have fractional starting times, but it is not an issue since we can convert the schedule to the optimum one respecting π, in which all starting times are integral. 2.1 Analysis It will be convenient to think of the LP solution as a set Ri of rectangles for each machine i. For each pair of j and s with yi,j,s > 0, we have a rectangle Ri,j,s of length pi,j and height yi,j,s in Ri . Horizontally, the rectangle Ri,j,s covers the time interval (s, s + pi,j ]. For any machine i, the total height of rectangles in Ri covering any time point t ∈ (0, T ] is at most 1. We will analyze the expected completion time of each job j and upper bound it by the corP responding LP quantity, y i,s i,j,s (s + pi,j ). Towards this end, henceforth we fix a job j ∈ J, the machine i ∈ M job j is assigned to, and a value of τ ∈ (0, T ] job j is given. We consider E[Cj |ij = i, τj = τ ], i.e, the expected completion time of j, conditioned on the event that ij = i b to denote E[·|ij = i, τj = τ ] and Pr[·] c to denote and τj = τ . For notational convenience, we use E[·] b j ] by τ and pi,j , we will get the desired bound on E[Cj ] by Pr[·|ij = i, τj = τ ]. After bounding E[C deconditioning. The key issue we have to handle when jobs have arrival times is that there can be idle times before job j starts. Hence we have to consider not only the volume of jobs scheduled before job j, but also the total length of idle times. Definition 2.1. For a time point t ∈ (0, T ], we say that t is idle, if there are no jobs scheduled at time t on machine i in our schedule. Let idle(t) indicate whether the time point t is idle or not. With this definition, we are ready to formally break down Cj into several quantities of different characteristics. 5 Cj = X j ′ ∈J pi,j ′ + i :τj ′ <τj Z τj idle(t)dt + pi,j . (4) 0 The first term is the total length of jobs scheduled before j on machine i and the second is the total length of idle times before τj . Notice that there are no idle points in [τj , Cj ) since all jobs j ′ ∈ Ji scheduled before j have τj ′ < τj . Uniform Distribution and its Limitations. Before we present a better than 2-approximation, we take a short detour to discuss how we recover a simple 2-approximation by setting Θ to be the  b j ], we first consider E b P′ uniform distribution over [0, 1]. To compute E[C j ∈Ji ,τj ′ <τ pi,j ′ . If some ′ ′ j ∈ Ji has τj ′ < τ = τj , we say that the pair (j , sj ′ ) contributed pi,j ′ to the sum. For each j ′ 6= j  c ij ′ = i, sj ′ = and integer s < τ , the expected contribution of the pair (j ′ , s) to the sum is Pr    c τj ′ < τ |ij ′ = i, sj ′ = s pi,j ′ = yi,j ′ ,s · min{1, (τ − s)/pi,j ′ } · pi,j ′ = yi,j ′ ,s · min{pi,j ′ , τ − s}. This is s Pr exactly the area of the portion of the rectangle Ri,j ′ ,s before time point τ . Summing up over all pairs   b P′ (j ′ 6= j, s < τ ), E j ∈Ji ,τj ′ <τ pi,j ′ is at most the total area of the portions of Ri before τ , which b j ] ≤ 2τ + pi,j . is at most τ . The total length of idle slots before τ is obviously at most τ . Thus, E[C Since E[τj |ij = i, sj = s] = s + pi,j /2, we have E[Cj |ij =Pi, sj = s] ≤ 2(s + pi,j /2) + pi,j = 2(s + pi,j ). Since Pr[ij = i, sj = s] = yi,j,s, we have that E[Cj ] ≤ 2 i,s yi,j,s(s + pi,j ), which is exactly twice the contribution of j to the LPinterval objective. Thus, we obtain a 2-approximation for the problem. However, uniform distribution does not yield a better than 2-approximation. To see this, consider the following instance and LP solution. There are 1/ǫ+1 machines indexed by 1, 2, ..., 1/ǫ+ 1. There is one unit-sized job j ∗ with arrival time r and it is scheduled on each of machines 1, 2, ..., 1/ǫ by ǫ fraction during (r, r + 1]; j ∗ is not allowed to be scheduled on machine 1/ǫ + 1. There are 1/ǫ big jobs of sizes p ≫ r with arrival time 0, which are indexed by j1 , j2 , ..., j1/ǫ . Each big job jk can be assigned to either machine k or machine 1/ǫ+1. The job jk starts on machine k at time 0 by 1 − ǫ fraction, and on machine 1/ǫ + 1 by ǫ fraction. For simplicity, say the unit-sized job has a unit weight and the big jobs have zero (or infinitesimally small) weights so that the objective is essentially dominated by the unit sized job j ∗ ’s completion time. Clearly, j ∗ has completion time r + 1 in the LP solution. We now show that the above rounding makes j ∗ ’s completion time arbitrarily close to 2r in expectation. Fix the machine j ∗ is assigned to by the above algorithm; w.l.o.g. assume that the machine is 1. With 1−ǫ probability, job j1 is assigned to machine 1; under this event, j1 has a smaller τ value than j ∗ with probability r/p. Hence j ∗ starts at time p with probability (1−ǫ)r/p, otherwise at time r, meaning that j ∗ ’s expected starting time is at least (1 − ǫ)(r/p) × p + (1 − (1 − ǫ)r/p) × r which tends to 2r as ǫ → 0 and p → ∞. This shows one cannot get a better than 2-approximation using uniform distribution. Finding a Better Distribution. The above example is simple yet illuminating. We first observe that pushing back the small job a lot due to big job might be a sub-optimal choice. Intuitively, a bigger job is less sensitive to delay since the delay can be charged to the job’s processing time. We could try to shift mass in the distribution Θ to the right. Then, big jobs will be less likely to have smaller τ values than the small job. However, this could increase τj values in expectation, thereby increasing the objective. We would like to avoid increasing the offset added to τj which was pi,j /2 (assuming that job j goes to machine i). To satisfy both requirements, we shall shift the mass from both ends to the middle. In the above example, the job j ∗ overlaps the left-end of the big job j1 . Shifting the mass from the left to the middle will decrease the probability that τj1 < τj ∗ . On the other hand, shifting the mass from the right to the middle will decrease the expectation of τj ∗ . 6 The remainder of this section is devoted to studying the effect of using different distributions on the approximation ratio. Let f : [0, 1] → R≥0 be the probability density function (PDF) of Θ Rt and F (t) = 0 f (t′ )dt′ be the cumulative distribution function (CDF) of Θ. Recall that we fixed a job j ∈ J, the machine i ∈ M job j is assigned to, and a value of τ ∈ [0, T ) job   j is given. For every ′ j ∈ J \ j, t ∈ (0, T ] and integer s, we shall use s ⊳j ′ t to indicate that s ∈ max{0, t − pi,j ′ }, t . In other words, s ⊳j ′ t means that if j ′ starts at s, then it must get processed at time t. For every t ∈ (0, T ], define     X X t−s t−s and h(t) = yi,j ′ ,s · F . g(t) = yi,j ′ ,s · f pi,j ′ pi,j ′ ′ ′ j ∈J\j, s⊳j ′ t j ∈J\j, s⊳j ′ t P It is worth mentioning that s⊳j y ′ ·f ′ t i,j ,s  t−s pi,j ′  1 pi,j ′ is the density of the probability that τj ′ = t. Thus, integrating g(t) from time 0 to τ = τj will give the expected volume of work done before job j, which is the first term of (4) in expectation. The usefulness of h(t) will be discussed shortly.   Z τ X b Lemma 2.2. E g(t)dt. pi,j ′  = 0 j ′ ∈Ji :τj ′ <τ P roof. LHS = X j ′ ∈J\j = = = X c j ′ = i, τj ′ < τ ] = pi,j ′ · Pr[i pi,j ′ X j ′ ∈J\j s∈[0,τ ) X X pi,j ′ j′ yi,j ′ ,s · pi,j ′ j ′ ∈J\j min{(τ −s)/pi,j ′ ,1} X s∈[0,τ )   c τj ′ < τ |ij ′ = i, sj ′ = s yi,j ′ ,s · Pr f (θ)dθ 0 1 Z min{τ,s+pi,j ′ }  t−s pi,j ′ f pi,j ′ s   Z τ t−s yi,j ′ ,s · f g(t)dt. dt = pi,j ′ 0 t s∈[0,τ ) j ′ ∈J\j Z τ X X t=0 j ′ ∈J\j s⊳ yi,j ′ ,s · Z X  dt We now shift our attention to bounding the second term in (4) using the function h(t). As we observed when using uniform distributions, the obvious upper bound on the second term is τ . To improve upon this,  need to show a considerable fraction of times are not idle. We note that  we P t−s is the probability that job j ′ is processed at time t when starting at τj ′ . If s⊳j ′ t yi,j ′ ,s · F pi,j ′ such an event occurs, then time t will be shown to be non-idle, hence we get some credits. Claim 2.3. h(t) ≤ 1 for every t ∈ [0, T ). Proof. Since F is a CDF, we have F (t′ ) ≤ 1 for every t′ ∈ [0, 1]. Thus, h(t) ≤ by Constraint (3). b Lemma 2.4. For every t ∈ (0, τ ], we have E[idle(t)] ≤ e−h(t) . P j ′ ∈J\j, s⊳j ′ t yi,j ′ ,s ≤1 Proof. We say t′ is empty if there are no jobs j ′ ∈ Ji such that t′ ∈ (τj ′ , τj ′ + pi,j ′ ]; let empty(t′ ) denote the indicator variable that is 1 iff t′ is empty. We first observe that if some t′ ∈ (0, T ] is not empty, then t′ is not idle. This is because a job j ′ such that t′ ∈ (τj ′ , τj ′ + pi,j ′ ] is not processed at 7 time t′ only when other jobs are. Thus, b b E[idle(t)] ≤ E[empty(t)]   X Y     c ij ′ = i, t ∈ (τj ′ , τj ′ + pi,j ′ ] c ij ′ = i, t ∈ (τj ′ , τj ′ + pi,j ′ ] ≤ exp − Pr = 1 − Pr j ′ ∈J\j j ′ ∈J\j         X X X ′ t − s t − s j  c ij ′ = i, t ∈ (sj ′ , sj ′ + pi,j ′ ], θj ′ <  Pr ≤ exp − = exp − yi,j ′ ,s · F ′ p pi,j ′ i,j ′ ′ s⊳ t j ∈J\j j ∈J\j j′ = e−h(t) . Z τ  1 b h(t)dt. E[idle(t)]dt ≤ τ − 1 − Lemma 2.5. e 0 0 Rτ Rτ b Proof. By Lemma 2.4, we have 0 E[idle(t)]dt ≤ 0 e−h(t) dt. Notice that h(t) ∈ [0, 1] for every t ∈ [0, 1] by Claim 2.3. Thus by the convexity of the function e−x , we have that e−h(t) ≤ (1 − h(t))e0 + h(t)e−1 = 1 − (1 − 1/e)h(t). Taking the integral from t = 0 to τ gives the lemma.   Rφ R1 Lemma 2.6. Let ρ = supφ∈(0,1] F (φ) − 1 − 1e 0 F (θ)dθ /φ, β = 0 f (θ)θdθ and α = 1 + max{ρ, (1 + ρ)β}. Then our algorithm is an α-approximation algorithm. Z τ b j ] in terms of τ = τj and pi,j , then obtain an To prove Lemma 2.6, we first upper bound E[C upper bound on E[Cj ] by deconditioning. b j ] ≤ (1 + ρ)τ + pi,j . Lemma 2.7. E[C Proof. By applying the bounds in Lemmas 2.2 and 2.5 to Eq. (4), we have  Z τ Z τ 1 b g(t)dt − 1 − E[Cj ] − τ − pi,j ≤ h(t)dt e 0 0        Z τ X t−s t−s 1 = yi,j ′ ,s f F − 1− dt pi,j ′ e pi,j ′ 0 ′ j 6=j,s⊳j ′ t X = y j ′ 6=j,s∈[0,τ ) = X j ′ 6=j,s∈[0,τ ) i,j ′ ,s · Z s      t−s t−s 1 F − 1− dt f pi,j ′ e pi,j ′    Z min{(τ −s)/p ′ ,1}  i,j 1 · f (θ) − 1 − F (θ) dθ. e 0 min{τ,s+pi,j ′ }  yi,j ′ ,s · pi,j ′  Rφ By the definition of ρ and that 0 f (θ)dθ = F (φ) for φ ∈ [0, 1], we have X b j] ≤ E[C yi,j ′ ,s · pi,j ′ · ρ · min{(τ − s)/pi,j , 1} + τ + pi,j j ′ 6=j,s∈[0,τ ) =ρ X j ′ 6=j,s∈[0,τ ) yi,j ′ ,s · min{τ − s, pi,j ′ } + τ + pi,j ≤ ρτ + τ + pi,j = (1 + ρ)τ + pi,j , where the last inequality holds because the sum is the total area of the portions of rectangles in Ri before time τ . P Lemma 2.8. E[Cj ] ≤ α i∈M,s∈[0,T ) yi,j,s(s + pi,j ). 8 Proof. Now, we consider all machines i ∈ M . Then E[Cj ] equals to X Pr[ij = i, sj = s] 0 i∈M,s∈[0,T ) ≤ X yi,j,s i∈M,s∈[0,T ) = X yi,j,s i∈M,s∈[0,T ) = Z X Z 1 f (θ) E[Cj |ij = i, sj = s, τj = s + θpi,j ]dθ 1 f (θ) ((1 + ρ)(s + θpi,j ) + pi,j ) dθ Z 1 f (θ)((1 + ρ)s + pi,j )dθ + 0 Z 1 f (θ)(1 + ρ)θpi,j dθ 0 X  yi,j,s ((1 + ρ)s + pi,j + (1 + ρ)βpi,j ) i∈M,s∈[0,T ) ≤ [By Lemma 2.7] 0 yi,j,s max{1 + ρ, 1 + (1 + ρ)β}(s + pi,j ) = α i∈M,s∈[0,T ) X yi,j,s(s + pi,j ). i∈M,s∈[0,T ) We are now ready to complete the proof of Lemma 2.6. Summing up E[wj Cj ] over all jobs j ∈ J, we have i hX X wj yi,j,s(s + pi,j ). wj Cj ≤ α E j∈J i∈M,j∈J,s∈[0,T ) Notice that the right-hand-side is exactly α times the cost of the LP solution. Thus, our algorithm is an α-approximation. To complete the proof of Theorem 1.1, we only need to find a distribution Θ whose α value is no greater than the approximation ratio claimed in the theorem. We note that we first used a factor revealing LP to find out the best distribution that minimizes α. Then we discovered a truncated quadratic function is the best fit for the obtained discretized PDF. To find the best coefficients, we ran another program and obtained a distribution that yields a slightly better approximation ratio than one we could using the factor revealing LP. We set the PDF f as follows: ( 0.1702θ 2 + 0.5768θ + 0.8746 if 0 ≤ θ ≤ 0.85897 . (5) f (θ) = 0 otherwise Notice that f (θ) increases as θ goes from 0 to 0.85897 and becomes 0 when θ > 0.85897. This is consistent with the previous discussion that we shift the probability mass from both ends to the middle. Then, by easy calculation one can show that β < 0.46767 and ρ < 0.8785. Thus α = 1 + max {ρ, (1 + ρ)β} < 1.8786. Details on this calculation can be found in Appendix D. 3 Preemptive Scheduling This section is devoted to proving Theorem 1.3, which claims a better than 2-approximation for the preemptive case. Note that migration is not allowed, i.e. each job must be processed on only one of the machines. In the preemptive setting, a job’s processing may be interrupted, so we need to choose pi,j unit-length time slots on machine i to schedule job j on machine i. This motivates the following definition. 9 Definition 3.1 (Chains). A chain A for job j ∈ J on machine i ∈ M is a sequence (t1 , t2 , · · · , tpi,j ) of integers such that rj < t1 < t2 < · · · < tpi,j ≤ T . Equivalently, we may view A as the set {t1 , t2 , · · · , tpi,j }, or as a function from (0, pi,j ] to (0, T ] such that A(ϑ) = t⌈ϑ⌉ + ϑ − ⌈ϑ⌉ for all ϑ ∈ (0, pi,j ]. For all t ∈ (0, T ], let A−1 (t) = sup{ϑ ∈ (0, pi,j ] : A(ϑ) ≤ t}. A chain A = (t1 , t2 , · · · , tpi,j ) completely describes j’s schedule on machine i: we schedule j on slots (t1 − 1, t1 ], (t2 − 1, t2 ], · · · , (tpi,j − 1, tpi,j ]. Thus, A(ϑ) is the time at which we have run j for ϑ units of time. In particular, A(pi,j ) is the completion time of j. We may use CA := A(pi,j ) to denote j’s completion time under the schedule A of job j. Notice that A−1 (t) is the amount of time in which j is processed before t in A. Let Ai,j denote the set of all chains for job j on machine i. Linear Programming. We are now ready to present our LP using the notion of chains. For notational convenience, when we refer to a chain A, we assume it is associated with a machine i and a job j satisfying A ∈ Ai,j . X X min wj CA · zA (LPchain ) s.t X X i∈M X A∈Ai,j X j∈J A∈Ai,j :t∈A i∈M,j∈J A∈Ai,j zA ≥ 1 ∀j ∈ J (6) zA ≤ 1 ∀i ∈ M, t ∈ [T ] (7) zA ≥ 0 ∀i ∈ M, j ∈ J, A ∈ Ai,j To see LPchain is a valid relaxation, assume that variables can only take integer values. In LPchain we have an indicator variable zA for every possible chain A ∈ Ai,j for all i and j, which is 1 if and only if j is scheduled following the chain description A. The first constraint requires that every job must complete; note that we do not need equality here since the optimal solution will satisfy equality. It is also worth mentioning that job j never gets processed before its arrival time rj since j’s chains don’t allow it. Finally, the second constraint ensures that every machine is used by at most one job at any point in time – there is at most one chain that schedules a job at any time. Thus we get a valid LP relaxation by allowing variables to have fractional values. Although the LP has exponentially many variables, we can solve it using standard techniques – we solve the dual using the Ellipsoid method with a separation oracle. To keep the flow of presentation, details are deferred to Section 3.1. Algorithm. Our rounding is a natural generalization of the rounding for non-preemptive scheduling. To see this, suppose that a chain A ∈ Ai,j is a sequence of pi,j consecutive integers. Then A corresponds to an interval. If every chain in the support of z corresponds to an interval, then the fractional solution is a valid solution to LPinterval for non-preemptive scheduling. In this scenario, our rounding works exactly in the same way as that for non-preemptive scheduling. Thus, we can generalize the former rounding by generalizing intervals to chains. More specifically, our rounding algorithm works as follows. Let Θ be some distribution over [0, 1]. For every j ∈ J, we randomly and independently choose a pair (ij , Aj ) such that Pr[(ij , Aj ) = P (i, A)] = zA for every i ∈ M, A ∈ Ai,j . As i∈M,A∈Ai,j zA = 1 for every j, the random procedure is well-defined. For each j, we randomly and independently choose a number θj from Θ. Let τj = Aj (θj · pij ,j ). We assume that all jobs have different τj values since the event happens almost surely. As in the algorithm for the non-preemptive scheduling, we let Ji = {j ∈ J : ij = i} and schedule all jobs in Ji on machine i in increasing order of τj . We schedule the jobs as early as possible, maintaining the property that job j starts no earlier than τj . Notice that the schedule our algorithm constructed is non-preemptive, even though the problem allows preemption. 10 Overview of the Analysis. The analysis is more involved than the one for the non-preemptive case. To see this, let’s recall how we gave a better than 2-approximation for the non-preemptive case. We can still break down a job’s completion time as in Eq. (4) where job j’s completion time is decomposed into three quantities: total volume of jobs with smaller τ values, total length of idle times before τj , and the size of job j itself. As we observed, if we use a uniform distribution for Θ, it is easy to get a 2-approximation by showing that both quantities are bounded by τj , which is j’s starting time plus half of its size in expectation. Then, by using a non-uniform distribution Θ with more mass around the center, we could have the following benefits: (i) if a job j ′ 6= j is processed a little before τj , it is less likely to have a smaller τ value; and (ii) otherwise, a considerable fraction of job j ′ is processed before τj , thus contributes to reducing the number of idle times. Then, using the non-preemptive structure of the schedule, we were able to analyze each time’s contribution to the first and second quantities in Eq. (4). While the high-level idea is the same, we have to take a different analysis route for the preemptive case since each job’s schedule is scattered over time, which keeps us from defining h. Note that many jobs may contribute to making a time t busy since we don’t have a nice structural property given by the intervals but not by the chains. In particular, when a lot of jobs are partially processed around time t, the time will highly likely to become non-idle. This create an issue for the analysis since we don’t get enough idle times compared to the volume of jobs we used. Hence we have to bound Cj by taking a more global view of the schedule. In the analysis, we will consider two cases. Let W denote the volume of work done by LP before τj . If W mostly comes from jobs that are processed very little before τj , we can reduce the first quantity in (4) using the non-uniform distribution. Otherwise, we can show that a large fraction of W comes from jobs that are processed a lot by the LP by time (9/10)τj . Then, either a lot of jobs complete by time τj or the entire interval [(9/10)τj , τj ] becomes non-idle. In either case, we can have a better bound on the second quantity in Eq. (4) than the trivial τj . Somewhat subtle definitions are needed for the analysis, but this is a high-level overview. 3.1 Solving the LP We first assume that T is polynomially bounded and discuss later how to handle large T . The dual of LPchain is as follows. max s.t ηj − X t∈A X j∈J ηj − ξi,t ≤ wj CA ηj ≥ 0 X ξi,t (LPchain−d ) i∈M,t ∀i, j, A ∈ Ai,j (8) ∀j ∈ J ξi,t ≥ 0 ∀i ∈ M, t ∈ [T ] Note that LPchain−d has polynomially many variables, but exponentially many constraints. To solve the dual, we use the Ellipsoid method. Fortunately, there is a very simple separation oracle. Fix i and j, and C ∈ [rj + pi,j , T ]. Our goal is to find A with C = CA for which Constraint (8) is violated if such A exists. P Since the right-hand-side wj CA and ηj are fixed, it suffices to find a chain A ∈ Ai,j that minimizes t∈A ξi,t and completes job j exactly at time C. Thus, we only need to consider the set A consisting of pi,j − 1 slots (t − 1, t] in (rj , C − 1] with the smallest ξi,t values, and the slot (C − 1, C]. If Constraint (8) is violated for this A, we found a violated constraint. Otherwise, all the constraints are satisfied for the fixed i, j and C. 11 Using the Ellipsoid method with the above separation oracle, we can obtain a basic optimal solution of LPchain−d , in which the number of tight constraints is bounded by the number of variables. Since LPchain−d has polynomially many variables, the basic solution makes only polynomially many constraints tight. Due to the strong duality, there is an optimal solution to the LPchain where all variables corresponding to dual constraints that are not tight are zero. Hence we can obtain an optimal solution to LPchain with a poly-sized support. We now extend this argument to large T . Let R := {rj | j ∈ J} be the set of all jobs’ arrival times. We add to R, exponentially increasing time steps, i.e. ⌈(1 + ǫ)k ⌉ for all integers 0 ≤ k ≤ K where K is the smallest k such that ⌈(1 + ǫ)k ⌉ ≥ T . If R = {t0 , t1 , t2 , ...}, we break (0, T ] into intervals I1 = (t0 , t1 ], I2 = (t1 , t2 ], · · · . Note that jobs can arrive only at the beginning of the intervals. Also note that there are polynomially many intervals. For each chain A ∈ Ai,j , CA is defined slightly differently from before: CA is tk where k is the largest k′ such that A takes some time slots from Ik′ . Notice that we have A−1 (pi,j ) ≤ CA ≤ (1 + ǫ)A−1 (pi,j ). That is, CA (1 + ǫ)approximates the actual completion time of j when it is scheduled following A. Constraint (7) is changed to X X |Ik ∩ A|zA ≤ tk − tk−1 ∀i ∈ M, k j∈J A∈Ai,j The dual is changed to, max s.t ηj − X k X j∈J ηj − X i∈M,k (tk − tk−1 )ξi,k |A ∩ Ik |ξi,k ≤ wj CA ∀i, j, A ∈ Ai,j The separation oracle is almost the same. The only change is that we are allowed to pick up to tk − tk−1 time slots from Ik to find A that is most likely to violate the constraint. All the remaining procedure is identical. 3.2 Analysis We fix j ∈ J, i ∈ M and τ ∈ (0, T ] and condition on the event that ij = i and τj = τ . Using the b denote E[·|ij = i, τj = τ ] and Pr[·] c denote Pr[·|ij = i, τj = τ ]. For same notations as before, let E[·] any t ∈ (0, T ], we say t is idle if there are no jobs scheduled at time t on machine i, and use idle(t) to indicate whether t is idle or not. We will again use Eq. (4) for the analysis of E Cj . We do not try to optimize the approximation ratio. Rather we will use a distribution Θ that is very close to the uniform distribution to make the analysis more transparent. The probability density function (PDF) of Θ is f (θ) = 1/(1 − 2λ) if θ ∈ (λ, 1 − λ)R and f (θ) = 0 otherwise, t where λ ∈ (0, 0.005) is some constant to be decided later. Let F (t) = 0 f (θ)dθ be its cumulative distribution function (CDF). Note that this is a uniform distribution with small portion of both ends clipped out. It is not hard to show that if λ = 0 then we can still obtain a 2-approximation. The following claims easily follow from elementary algebra. Claim 3.2. For any θ, θ ′ such that λ ≤ θ ≤ θ ′ ≤ 1, we have F (θ) θ ≤ θ ′ −λ θ ′ (1−2λ) . Claim 3.3. For any θ, θ ′ such that λ ≤ θ ′ ≤ 1/2 and θ ′ ≤ θ ≤ 1, we have F (θ) θ ≥ θ ′ −λ θ ′ (1−2λ) . We start by defining heavy and light chains. Roughly speaking, a chain A ∈ Ai,j is said to be heavy if a considerable fraction of the corresponding job j is processed before τj = τ , otherwise light. 12 ′ Definition 3.4. Given a chain A ∈ Ai,j for some job j ′ 6= j, we say A is heavy if A−1 (τ ) ≥ pi,j ′ /15 ′ ′ i,j ′ and light otherwise. Let Ai,j be the sets of heavy and light chains in Ai,j , respectively. h and Al P P −1 (τ ). Let W = W + W = −1 (τ ) and W = ′ zA A Let Wh = i,j ′ zA A h l l ′ j ′ 6=j,A∈Ai,j j 6=j,A∈Ah l P −1 j ′ 6=j,A∈Ai,j ′ zA A (τ ). Then, W is the total area of the portions of the rectangle chains before τ ; here we view zA fraction of chain A as a chain of rectangles with height zA on times in A. In the light of this view, we immediately have W ≤ τ . We continue our analysis by considering two cases depending on how much light/heavy chains contribute to W . 3.2.1 Case 1: Wl ≥ W/3. In this case, we focus on the expected total length of jobs scheduled on machine i before j. For a light chain, a large portion is after τ . Since the non-uniform distribution Θ moves the mass to the middle, it will give smaller expected total length if many chains are light. In the following, the first −1 inequality is due to Claim 3.2 with θ ′ = 1/15 and θ = Ap (τ′ ) . i,j  b E X j ′ ∈Ji :τj ′ <τ 1 ≤ 1 − 2λ 1 = 1 − 2λ =  pi,j ′  = X zA ′ j ′ 6=j,A∈Ai,j h X X zA F j ′ 6=j,A∈Ai,j ′  A−1 (τ ) pi,j ′ −1 zA A i,j ′ j ′ 6=j,A∈A (τ ) −  p  A−1 (τ ) pi,j ′  pi,j ′ (1/15 − λ) + (1/15)(1 − 2λ) 1 1 − 15λ − 1 − 2λ 1 − 2λ  X zA ′ j ′ 6=j,A∈Ai,j l X  A−1 (τ ) pi,j ′  pi,j ′ zA A−1 (τ ) ′ j ′ 6=j,A∈Ai,j l W 15λ W 5λW 1 − 5λ 1 − 5λ − Wl ≤ − = W ≤ τ. 1 − 2λ 1 − 2λ 1 − 2λ 1 − 2λ 1 − 2λ 1 − 2λ Thus, we have 3.2.2 i,j ′  Case 2: Wh ≥ 2W/3. b j] ≤ E[C  2− 3λ 1 − 2λ  τ + pi,j . (9) In this case, we shall further divide heavy chains into good and bad ones. Roughly speaking, a good chain doesn’t process the corresponding job too much very close to τ . Intuitively, good chains will likely lead to the job being processed considerably before time τ . We will show that there are ‘enough’ good chains that will make a lot of times before τ non-idle. ′ Definition 3.5. We say a heavy chain A ∈ Ai,j for some j ′ 6= j is good, if A−1 (9τ /10) ≥ A−1 (τ )/2, ′ i,j ′ i,j ′ and bad otherwise. Let Ai,j hg and Ahb be the sets of good and bad heavy chains in Ah , respectively. P P Let Whg = j ′ 6=j,A∈Ai,j′ zA A−1 (τ ) and Whb = j ′ 6=j,A∈Ai,j′ zA A−1 (τ ) respectively. So, Wh = hb hg Whg + Whb . Next we show that there are not many bad chains. Claim 3.6. Whb ≤ τ /5. X zA A−1 (τ ) ≤ 2 Proof. Whb = ′ j ′ 6=j,A∈Ai,j hb X ′ j ′ 6=j,A∈Ai,j hb 13 zA (A−1 (τ ) − A−1 (9τ /10)) ≤ τ /5. Thus, we have secured lots of good chains, precisely Whg ≥ 2W/3 − τ /5.   Z τ   X (1 − idle(t))dt ≥ min τ /10, pi,j ′ . Lemma 3.7.   0 ′ j ∈Ji :τj ′ <9τ /10 Proof. The LHS of the inequality is the total length of non-idle times on machine i before time τ . P ′ ′ ′ If all jobs in J = {j ∈ Ji : τj < 9τ /10} completes before τ , LHS is at least j ′ ∈J ′ pi,j ′ . Otherwise, t is not idle for any t ∈ (9τ /10, τ ] and thus LHS is at least τ /10. We will lower bound the expected value of the RHS in Lemma 3.7 as follows. Note that we only use jobs j ′ that have good chains since other jobs are not very useful for deriving a lower b j assuming that bound. The proof is somewhat technical, so we first derive an upper bound on EC the bound is true.    (1−30λ) γW τ P b . Lemma 3.8. Q := E min 10 , j ′ ∈J :A ∈Ai,j′ ,τ <9τ /10 pi,j ′ ≥ 10hg where γ = 1 − 1e 30(1−2λ) i j′ hg j′ Lemmas 3.7 and 3.8 will give us an upper bound on the length of idle times before τ . To bound the total expected volume of jobs with smaller τ values than job j, we use the following obvious bound.    −1   −1  X X X A (τ ) 1 1 A (τ ) b zA W. pi,j ′ ≤ pi,j ′ = E pi,j ′  = zA F ′ ′ p 1 − 2λ p 1 − 2λ i,j i,j ′ ′ ′ ′ i,j ′ i,j j ∈Ji :τj ′ <τ j 6=j,A∈A j 6=j,A∈A Applying these two bound to Eq. (4) and using the fact that W ≤ τ , we have     γWhg γ 2W τ 1 1 W+ τ− W +τ − − + pi,j ≤ + pi,j Ê[Cj ] ≤ 1 − 2λ 10 1 − 2λ 10 3 5 1 γ 7τ 2 − 2λ − (1 − 1/e)(1/30 − λ)(7/150) ≤ τ +τ − · + pi,j = τ + pi,j . 1 − 2λ 10 15 1 − 2λ (10) This bound (10) will be combined with (9) for Case 1 in the following section to complete the analysis. The remainder of this section is devoted to proving Lemma 3.8. The main difficulty in lower bounding Q is no matter how big the second term in Q is, the quantity is capped at τ /10. Hence if jobs are very large compared to the cap, Q can be very small. Fortunately, we have found lots of good chains. Good chains process their corresponding jobs considerably before τ . This implies that such jobs cannot be very large compared to τ . J\j For formal proof, we define a random function Ψ(α, p′ ) over a vector α ∈ [0, 1]J\j and p′ ∈ R≥0 as follows. Initially let S ← 0. Then for every j ′ 6= j, with probability αj ′ , we let S = S + pj ′ . Then c ′ ∈ Ji , Aj ′ ∈ Ai,j ′ , τj ′ < 9τ /10] and p∗′ = pi,j ′ let Ψ(α, p′ ) = min{τ /10, S}. We define α∗j ′ = Pr[j j hg for every j ′ 6= j. Then Q is exactly E Ψ(α∗ , p∗ ). The following lemma will allow us to increase job sizes while keeping their expected contribution to S the same. Lemma 3.9. If for some job j ′ = 6 j and some real number a ≥ 1, we update αj ′ to αj ′ /a and p′j ′ ′ ′ to apj ′ , then E Ψ(α, p ) can only decrease. 14 Proof. Let S ′ be the contribution of J \ {j, j ′ } to S in the definition of Ψ(α, p′ ). In other words, we fix the random events for all jobs except j and j ′ . Then, S = S ′ + p′j ′ with probability αj ′ and S = S ′ with probability 1 − αj ′ . Assume that S ′ ≤ τ /10 since otherwise, Ψ is the same for both cases. Before updating α and p′ , we have E[Ψ|S ′ ] = αj ′ min{S ′ + p′j ′ , τ /10} + (1 − αj ′ ) min{S ′ , τ /10} = S ′ + αj ′ min{p′j ′ , τ /10 − S ′ } = S ′ + min{αj ′ pj ′ , αj ′ (τ /10 − S ′ )}. After the update, αj ′ becomes αj ′ /a and p′j becomes ap′j . Thus, after update, E[Ψ|S ′ ] = S ′ + min{αj ′ pj ′ , (αj ′ /a)(τ /10 − S ′ )}, which shows that E[Ψ] can only decrease after the update. The next step is to show that a large fraction of the second quantity in Q (or comes from good chains. P 1−30λ ∗ ∗ Lemma 3.10. j ′ 6=j αj ′ pj ′ ≥ 2(1−2λ) Whg . P j ′ 6=j α∗j ′ p∗j ′ ) Proof. X α∗j ′ p∗j ′ = j ′ 6=j X zA F ′ j ′ 6=j,A∈Ai,j hg  A−1 (9τ /10) pi,j ′ X ≥ 1/30 − λ (1 − 2λ)/30 j ′ 6=j,A∈Ai,j hg ≥ 1 − 30λ 1 · 1 − 2λ 2 X j ′ 6=j,A∈Ai,j hg zA ′   pi,j ′ A−1 (9τ /10) pi,j ′ zA A−1 (τ ) = ′  pi,j ′ = 1 − 30λ 1 − 2λ X j ′ 6=j,A∈Ai,j hg zA A−1 (9τ /10) ′ 1 − 30λ Whg . 2(1 − 2λ) The first inequality follows by observing that for any good chain A, we have A(9τ /10)/pi,j ′ ≥ 1/30 −1 and applying Claim 3.3 with θ ′ = 1/30 and θ = A p(9τ′/10) . i,j i,j ∗ Notice if α∗j ′ > 0 then Ai,j hb 6= ∅. Thus, taking an arbitrary A ∈ Ahb , we have pj ′ = pi,j ′ ≤ 15A−1 (τ ) ≤ 15τ . Initially let α = α∗ and p′ = p∗ . Then we apply Lemma 3.9: for every j ′ such that αj ′ > 0, we scale down αj ′ and scale up p′j ′ by the same factor so that p′j ′ becomes 15τ . P 1−30λ Whg as the operations After the update, we have E Ψ(α, p′ ) ≤ Q. Moreover, j ′ 6=j αj ′ p′j ′ ≥ 2(1−2λ) P 1−30λ Whg maintained the left-hand-side in the bound of Lemma 3.10. Thus, j ′ 6=j αj ′ ≥ 30(1−2λ) τ . Now, ′ ′ consider the process for computing Ψ(α, p ). The probability that we add some pj ′ = 15τ to S is     Y Y X (1 − 30λ)Whg −αj ′   1− (1 − αj ′ ) ≥ 1 − e = 1 − exp − αj ′ ≥ 1 − exp − 30(1 − 2λ)τ j ′ 6=j j ′ 6=j j ′ 6=j   Whg 1 (1 − 30λ)Whg ≥ 1− =γ . e 30(1 − 2λ)τ τ γW γW τ = 10hg . Note that the expectation is lower bounded by the Thus, E Ψ(α, p′ ) ≥ τ hg · 10 probability multiplied by τ /10 since the total size of S is capped at τ /10 in Ψ. This completes the proof of Lemma 3.8. 15 3.2.3 Wrapping up: Combining the Two Cases b j ] < 1.99942τ + pi,j . For We set λ = 1/5100, then in both cases (Eq. (9) and (10)), we have E[C i,j a chain A ∈ A , E[τj |ij = i, Aj = A] is at most A(pi,j ) − pi,j /2; this is where LPchain with each chain’s cost associated with the corresponding job’s completion time plays a crucial role. Thus, X E[Cj ] < zA (1.99942(CA − pi,j /2) + pi,j ) i∈M,A∈Ai,j = X i∈M,A∈Ai,j zA (1.99942CA + 0.00029pi,j ) ≤ 1.99971 X zA CA . i∈M,A∈Ai,j This is exactly 1.99971 times the (unweighted) contribution of j to the LP solution. Thus, our algorithm is a 1.99971-approximation, implying Theorem 1.3. A The Strength of the Configuration LP In this section, we consider all convex programmings of the following form: X min fi (xi ) s.t (11) i∈M X xi,j = 1 ∀j ∈ J; xi,j ≥ 0 ∀i ∈ M, j ∈ J. i∈M (12)  In the above, xi = xi,j j∈J ∈ [0, 1]J is the vector of xi,j s for all jobs; and fi is a convex function over [0, 1]J . In order for this convex programming to be valid, we require: (*) For every xi ∈ {0, 1}J , fi (xi ) is at most the total weighted completion time of the optimal schedule of jobs {j : xi,j = 1} on machine i. In this form, the only connection across different machines is made by Constraint (12).PExcept for this constraint, the machines are treated separately. All known programmings for R|| j wj Cj P and for R|rj | j wj Cj , including our interval LP, the LPs of [28, 26], the convex programming of [30], the SDPs of [30, 6] and the configuration LP of [34], are of this form. P In the configuration LP of [34], the definition of fi (xi ) is the minimum of S⊆J yi,S Wi,S over all vectors (yi,S )S⊆J satisfying X yi,S = 1; S⊆J X yi,S = xi,j , ∀j ∈ J; yi,S ≥ 0; ∀S ⊆ J; S⊆J:j∈S (13) where Wi,S is the total weighted completion time of scheduling S on machine i optimally.3 3 In the configuration LP of [34], each S is not just a set of a jobs, but an actual schedule of some jobs on i. However, it is easy to see that their version is equivalent to ours. 16 Let fi∗ be the definition of the function fi in the configuration LP. We shall show that for every convex function fi satisfying (*), we have fi (xi ) ≤ fi∗ (xi ) for every xi ∈ [0, 1]J . Indeed, consider the vector (yi,S )S⊆J that defines the fi∗ (xi ) value. We have   X X X fi (xi ) = fi  yi,S v S  ≤ yi,S fi (v S ) ≤ yi,S Wi,S = fi∗ (xi ), S⊆J S⊆J S⊆J where v S is the indicator vector for S: vjS = 1 if j ∈ S and vjS = 0 if j ∈ / S. The first equality is due to Constraint (13). The first inequality follows from the convexity of fi and the second from (*). Thus, the configuration LP gives the largest possible fi (xi ) value for every xi ∈ [0, 1]J . B Lower Bound In this section, we show a lower bound of e/(e − 1) − ǫ ≥ 1.581 for any algorithm based on independent rounding; see the discussion before Theorem 1.2 for the description. We remark that our instance is very similar to the instance of [16] P which gives an e/(e − 1)-lower bound on the integrality gap of some time-indexed LP for 1|rj | j wj Cj . In our lower bound instance, the fractional solution is a convex combination of optimum integral solutions; however, the independent rounding algorithm gives a solution whose cost is at least e/(e− 1) − ǫ times that of an optimum integral solution. Thus the limitation of the independent rounding algorithm is irrespective of the underlying convex programming: even if the convex programming exactly captures the convex hull of all integral solutions, the rounding algorithm still produces a sub-optimum solution. We assume 1/ǫ is an integer and T is an integer multiple of 1/ǫ3 . Assume that T is sufficiently large. The lower bound instance consists of 1/ǫ+1 identical machines indexed by 1, 2, 3, · · · , 1/ǫ+1, b of size T and T small jobs j s , j s , · · · , j s of size 1. Big jobs arrive at 1/ǫ big jobs j1b , j2b , · · · , j1/ǫ 1 2 T time 0; the small job jts arrives at time t − 1 for every t ∈ [T ]. Each big job has weight eǫ , and the −t/T small job jts has weight e T . We now define the fractional solution, in which all big jobs are scheduled in the interval (0, T ] and the small job jts is scheduled in the interval (t − 1, t] for every t ∈ [T ]. For every i ∈ [1/ǫ], jib is scheduled on machine i with fraction 1 − ǫ, and on machine 1/ǫ + 1 with fraction ǫ. Every small job jts is scheduled on every machine i with fraction ǫ. Notice that this fractional solution is a convex combination of integral 1/ǫ solutions, each with fraction ǫ in the combination. In the i-th integral solution, we schedule all small jobs on machine i, jib on machine 1/ǫ + 1 and jib′ on machine i′ for every i′ ∈ [1/ǫ] \ {i}. The cost of the fractional solution of any valid convex programming is at most the cost of each integral solution, which is T X e−t/T T t=1 t+ 1 ǫ 1 · ·T ≤ ǫ e T Z T e−t/T (t + 1)dt + 0 T e   T 1 T −θ 1 e (θ + 1/T )dθ + ≤T = −T (θ + 1)e θ=0 + 1 − + e e e      0  1 T 1 2 T + + 1− = 1− (T + 1). = 1− e e e e Z 1 −θ (14) We now proceed to consider the expected cost of the solution produced by the independent rounding algorithm. We will only lower bound the expected cost on machine 1 since machines 17 1, 2, 3, · · · , 1/ǫ are symmetric; we shall ignore the cost on machine 1/ǫ + 1. Since we only consider machine 1, we use j b to denote j1b , and jt to denote jts for every t ∈ [T ]. We observe that for any sufficiently large interval, almost ǫ fraction of jobs arriving during the interval are assigned to the machine with a high probability. Lemma B.1. With probability at least 1 − ǫ, for every 0 ≤ ℓ ≤ T − ǫT , there are at least (1 − ǫ)ǫ2 T values ℓ′ ∈ [ℓ, ℓ + ǫT ), such that jℓ′ is assigned to the machine. Proof. This follows from standard concentration inequalities together with the fact that T is sufficiently large. Thus, we proceed with our analysis assuming that the event in the lemma happens and j b is assigned to machine 1. It is convenient to pretend that all small jobs are assigned to machine 1, but their weights are scaled down by a factor of ǫ. The only flexibility we have is to select an integer τ ∈ [0, T ] and schedule all jobs in Ji using the order j1 , j2 , · · · , jτ , j b , jτ +1 , jτ +2 , · · · , jT since small jobs arriving later have smaller weights. The cost incurred by small jobs in {j1 , j2 , · · · , jτ } is, X ℓ∈[τ ]:jℓ ∈Ji e−ℓ/T ℓ ≥ T ⌊τ /(ǫT )⌋−1 X (1 − ǫ)ǫ2 T k=0 e−kǫT /T (kǫT ) T ⌊τ /(ǫT )⌋−1 X 3 = (1 − ǫ)ǫ T = (1 − ǫ)ǫT Z k=0 ǫ⌊τ /(ǫT )⌋ −kǫ e −θ e 3 k ≥ (1 − ǫ)ǫ T ≥ θdθ ǫ Z ⌊τ /(ǫT )⌋ e−tǫ tdt 1 (1 − ǫ)ǫT Z τ /T −ǫ e−θ θdθ. (15) ǫ The first inequality follows by considering small jobs arriving during each interval [kǫT, (k+1)ǫT ) for 0 ≤ k ≤ ⌊τ /(ǫT )⌋ − 1. Each of the intervals has length ǫT hence has at least (1 − ǫ)ǫ2 T jobs arriving during the interval due to Lemma B.1. Every job arriving during [kǫT, (k + 1)ǫT ) has completion time at least kǫT and weight at least e−(k+1)ǫT /T /T = e−kǫ−ǫ /T . Note that the big job cannot start before τ − ǫT since at least one small job arrives during [τ − ǫT, τ ) due to Lemma B.1 and we decided to schedule the big job after the small job. Hence no job from {jτ +1 , jτ +2 , · · · , jT } can complete before τ − ǫT + T if it is assigned to machine 1. The cost incurred by small jobs in {jτ +1 , jτ +2 , · · · , jT } is,   ⌊(T −τ )/(ǫT )⌋ −ℓ/T X X e  (τ − ǫT + T ) ≥ τ + (1 − ǫ)T ·  (1 − ǫ)ǫ2 T e−(τ +kǫT )/T T T k=1 ℓ:τ <ℓ≤T,jℓ ∈Ji ⌊(T −τ )/(ǫT )⌋ 2 −τ /T = (1 − ǫ)ǫ (τ + (1 − ǫ)T )e 2 −τ /T = (1 − ǫ) ǫ(τ + T )e Z X k=1 ǫ⌊(T −τ )/(ǫT )⌋+ǫ −kǫ e −θ e ǫ 2 2 −τ /T ≥ (1 − ǫ) ǫ (τ + T )e 2 −τ /T dθ ≥ (1 − ǫ) ǫ(τ + T )e Z Z ⌊(T −τ )/(ǫT )⌋+1 e−tǫ dt 1 1−τ /T e−θ dθ. (16) ǫ In the above, the first inequality follows by considering small jobs arriving during each interval [τ + (k − 1)ǫT, τ + kǫT ) for 1 ≤ k ≤ ⌊(T − τ )/(ǫT )⌋. 18 Let β = τ /T . Then the cost incurred by small jobs is at least, (15) + (16) ≥ (1 − ǫ)ǫT Z ≥ (1 − ǫ)2 ǫT ≥ (1 − ǫ)2 ǫT = (1 − ǫ)2 ǫT = (1 − ǫ)2 ǫT = (1 − ǫ)2 ǫT Z 1−τ /T e−θ θdθ + (1 − ǫ)2 ǫ(τ + T )e−τ /T e−θ dθ ǫ ǫ  Z β−ǫ Z 1−β −θ −β −θ e θdθ + (1 + β)e e dθ ǫ ǫ  Z β Z 1−β −θ −β −θ e θdθ + (1 + β)e e dθ − 5ǫ 0 0   β −(θ + 1)e−θ 0 + (1 + β)e−β (1 − e−(1−β) ) − 5ǫ   1 − (β + 1)e−β + (1 + β)(e−β − e−1 ) − 5ǫ  1 − (1 + β)e−1 − 5ǫ . τ /T −ǫ As discussed above, the completion time of j b is at least τ +T −ǫT = (1+β−ǫ)T ≥ (1−ǫ)2 (1+β)T and the weight of jb is ǫ/e. So, the total weighted completion time of all jobs is at least,  (1 − ǫ)2 ǫT 1 − (1 + β)e−1 − 5ǫ + (1 − ǫ)2 ǫT (1 + β)e−1 = (1 − ǫ)2 ǫT (1 − 5ǫ) ≥ (1 − 7ǫ)ǫT. Thus, using the independent rounding algorithm, we can not get an approximation ratio better than (1/ǫ)(1 − 7ǫ)ǫT e = − O(ǫ) > 1.581 − O(ǫ), (1 − 1/e)(T + 1) e−1 proving Theorem 1.2. C Solving LPinterval When T is Not Polynomially Bounded In Section 2, we proved Theorem 1.1 assuming that all parameters are polynomially bounded by n and m. In this section, we show that we can remove this simplifying assumption with a loss of (1 + ǫ) in the approximation ratio for any constant 0 < ǫ ≤ 1/2. To make our algorithm work for arbitrary instances, we only need to reduce the size of LPinterval since the rounding algorithm runs in time polynomial in the number of non-zero variables in the LP solution. Towards this end, we will restrict jobs starting times to a poly-sized set S̄ of times. This will reduce the number of y variables. Also we will enforce Constraints (3) only for polynomially many times. Let δ = ǫ/2n. Let S̄ = {0, 1, 2, ..., ⌈1/δ⌉, ⌈(1 + δ)/δ⌉, ⌈(1 + δ)2 /δ⌉, ..., ⌈(1 + δ)K /δ⌉} where K is the smallest integer such that (1 + δ)K /δ ≥ (1 + ǫ)T . We enforce that every job starts only at a time in S̄, i.e. s ∈ S̄ in LPinterval . Since |S̄| = O( nǫ + 1δ log T ), we will have only polynomially many y variables. We keep Constraints (3) only for all i and t such that t − 1 ∈ S̄. Let’s call the resulting LP the new LP in contrast to LPinterval , which we will also call the old LP. It now remains to show two things: (i) there exists a feasible solution to the new LP whose value is at most (1 + ǫ) times the integral optimum; and (ii) the solution to the new LP is also a feasible solution to the old LP – in other words, we need to make sure that the new LP solution satisfies Constraints (3) for all times t and machines i. Here we need to increase the maximum time step T considered in the LP to (1 + ǫ)T , but this is a minor detail. We begin by showing (i). Fix an optimum solution and consider any fixed machine i. It suffices to show that we can transform the optimal schedule on machine i without increasing each job’s 19 start time by a factor of more than 1 + ǫ. We will only shift jobs’ start times, thus jobs assigned to machine i will remain there. For notational convenience, we rename jobs scheduled on i as 1, 2, 3, ..., n′ in increasing order of their starting times. Let s∗j denote j’s start time in the optimal solution. We define ∆j recursively. Consider j in increasing order and define ∆j be the smallest non-negative integer such that s̄j := s∗j + (∆1 + ∆2 + ... + ∆j ) ∈ S̄. We start processing each job j at time s̄j . It is easy to see that this schedule is feasible by inductively showing that one can feasibly schedule all jobs by starting jobs 1, 2, ..., j at times s̄1 , s̄2 , ...s̄j , respectively, and then the remaining jobs ∆1 + ∆2 + ... + ∆j time steps later than their respective start times in the original optimal solution. Notice that now all jobs start at times in S̄. We now show by induction on j that this shifting process increases each job’s start time by a factor of at most 1 + ǫ. Claim C.1. For any positive integer s, let ∆ be the smallest non-negative integer such that s + ∆ ∈ S̄. Then, s + ∆ ≤ (1 + δ)s. Proof. Suppose s > 1/δ since otherwise the claim is immediate. Then, we have ⌈(1 + δ)k /δ⌉ + 1 ≤ s ≤ ⌈(1 + δ)k+1 /δ⌉ for some integer k ≥ 0. Then ∆ ≤ ⌈(1 + δ)k+1 /δ⌉ − ⌈(1 + δ)k /δ⌉ − 1 ≤ (1 + δ)k+1 /δ − (1 + δ)k /δ = (1 + δ)k ≤ δs. Lemma C.2. For all j, s¯j ≤ (1 + ǫ)sj . Proof. We show by induction on j that s¯j ≤ (1 + δ)j sj . This claim is immediate when j = 1 by Claim C.1. Suppose the claim holds for all jobs 1, 2, ..., j − 1. From definition of s̄j−1 , we have ∆1 +∆2 +...∆j−1 ≤ ((1+δ)j−1 −1)sj−1 ≤ ((1+δ)j−1 −1)sj . Hence we have sj +∆1 +∆2 +...∆j−1 ≤ (1 + δ)j−1 sj . By applying Claim C.1 with s = sj + ∆1 + ∆2 + ...∆j−1 and ∆ = ∆j , we have s¯j ≤ (1 + δ)j sj . Then, for all j, we have s¯j ≤ (1 + δ)j sj ≤ exp(δj)sj ≤ (1 + 2δj)sj ≤ (1 + ǫ)sj where the second inequality follows since exp(z) ≤ 1 + 2z for z ≤ 1/2. We now shift our focus to proving (ii). Fix any feasible solution to the new LP. Fix a machine i. For the sake of contradiction, suppose Constraint (3) is violated for some time; let t∗ be the earliest such time step. Note that t∗ − 1 ∈ / S̄ since we kept Constraint (3) for all times in S̄. Let s be the latest time step before t∗ in S̄. Notice that s must exist since 0 ∈ S̄. Since t∗ ∈ / S̄, we ∗ know that no jobs start during (s, t ]. What this means is that every job processed at time t∗ is also processed at time t′ = s + 1 at the same rate. This is a contradiction since the total height of jobs processed at time t′ is at most one due to Constraint (3) for time t′ . D Details on Calculating α in Section 2 In this section, we discuss how we compute α in detail. Although we found the distribution via programming, we can verify the approximation guarantee purely analytically. Let a = 0.1702, b = 0.5768, c = 0.8746 and d = 0.85897. So f (θ) = aθ 2 + bθ + c if θ ∈ [0, d] and f (θ) = 0 if θ ∈ (d, 1]. For this f , we have Z 1 ad3 bd2 + + cd ≈ 1.00000125 > 1, f (θ)dθ = F (1) = 3 2 0 Z 1 ad4 bd3 cd2 f (θ)θdθ = β= + + < 0.46767. 4 3 2 0  Z φ   1 1 . F (θ)dθ We define ρ(φ) := F (φ) − 1 − e φ 0 20 Rφ F (φ) − (1 − 1/e) 0 F (θ)dθ decreases as φ goes from d to 1 since F (φ) remains a constant. Thus, when φ goes from d to 1, ρ(φ) will decrease as long as ρ(φ) remains positive. So, to compute ρ = supφ∈[0,1] ρ(φ), it suffices to consider φ ∈ [0, d]. For φ ∈ [0, d], we have    4  aφ3 bφ2 1 bφ3 cφ2 aφ 1 ρ(φ) = + + cφ − 1 − + + 3 2 e 12 6 2 φ   3  2 2 aφ bφ 1 bφ cφ aφ + +c− 1− + + , = 3 2 e 12 6 2   2  dρ(φ) aφ 2aφ b 1 bφ c = + − 1− + + = A2 φ2 + A1 φ + A0 , dφ 3 2 e 4 3 2 where A2 = −(1 − 1/e)a/4, A1 = 2a/3 − (1 − 1/e)b/3 and A0 = b/2 − (1√− 1/e)c/2. Since A2 is negative, we only need to consider ρ(φ) for φ = 0, φ = d and φ = φ∗ = A1 + A21 −4A0 A2 −2A2 ≈ 0.5338653.   3  1 bd2 cd ad ad2 bd + +c− 1− + + ρ(0) = c = 0.8746, ρ(d) = < 0.8763, 3 2 e 12 6 2    ∗3  aφ∗2 bφ∗ aφ 1 bφ∗2 cφ∗ ∗ ρ(φ ) = + +c− 1− + + ≈ 0.8784782 < 0.8785. 3 2 e 12 6 2 Thus ρ = supφ∈(0,1] ρ(φ) < 0.8785. Thus α = 1 + max {ρ, (1 + ρ)β} < 1.8786. References [1] Foto Afrati, Evripidis Bampis, Chandra Chekuri, David Karger, Claire Kenyon, Sanjeev Khanna, Ionnis Milis, Maurice Queyranne, Martin Skutella, Cliff Stein, et al. Approximation schemes for minimizing average weighted completion time with release dates. In Foundations of Computer Science, 1999. 40th Annual Symposium on, pages 32–43. IEEE, 1999. [2] Arash Asadpour, Uriel Feige, and Amin Saberi. Santa claus meets hypergraph matchings. In Approximation, Randomization and Combinatorial Optimization. Algorithms and Techniques, pages 10–20. Springer, 2008. [3] Arash Asadpour and Amin Saberi. An approximation algorithm for max-min fair allocation of indivisible goods. SIAM Journal on Computing, 39(7):2970–2989, 2010. [4] Yossi Azar and Amir Epstein. Convex programming for scheduling unrelated parallel machines. In Proceedings of the thirty-seventh annual ACM symposium on Theory of computing, pages 331–337. ACM, 2005. [5] Nikhil Bansal and Janardhan Kulkarni. Minimizing flow-time on unrelated machines. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages 851–860, 2015. [6] Nikhil Bansal, Ola Svensson, and Aravind Srinivasan. Lift-and-round to improve weighted completion time on unrelated machines. CoRR, abs/1511.07826, 2015 (to appear in STOC 2016). [7] Nikhil Bansal and Maxim Sviridenko. The santa claus problem. In Proceedings of the thirtyeighth annual ACM symposium on Theory of computing, pages 31–40. ACM, 2006. 21 [8] Anton Beloglazov and Rajkumar Buyya. Energy efficient allocation of virtual machines in cloud data centers. In Cluster, Cloud and Grid Computing (CCGrid), 2010 10th IEEE/ACM International Conference on, pages 577–578. IEEE, 2010. [9] Deeparnab Chakrabarty, Julia Chuzhoy, and Sanjeev Khanna. On allocating goods to maximize fairness. In Foundations of Computer Science, 2009. FOCS’09. 50th Annual IEEE Symposium on, pages 107–116. IEEE, 2009. [10] Chandra Chekuri and Sanjeev Khanna. A ptas for minimizing weighted completion time on uniformly related machines. In Automata, Languages and Programming, pages 848–861. Springer, 2001. [11] Chandra Chekuri and Sanjeev Khanna. Approximation algorithms for minimizing average weighted completion time. 2004. [12] Tomáš Ebenlendr, Marek Krčál, and Jiřı́ Sgall. Graph balancing: a special case of scheduling unrelated parallel machines. In Proceedings of the nineteenth annual ACM-SIAM symposium on Discrete algorithms, pages 483–490. Society for Industrial and Applied Mathematics, 2008. [13] Uriel Feige. On allocations that maximize fairness. In Proceedings of the nineteenth annual ACM-SIAM symposium on Discrete algorithms, pages 287–293. Society for Industrial and Applied Mathematics, 2008. [14] Naveen Garg and Amit Kumar. Minimizing average flow-time : Upper and lower bounds. In 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2007), October 20-23, 2007, Providence, RI, USA, Proceedings, pages 603–613, 2007. [15] Naveen Garg, Amit Kumar, and V. N. Muralidhara. Minimizing total flow-time: The unrelated case. In Algorithms and Computation, 19th International Symposium, ISAAC 2008, Gold Coast, Australia, December 15-17, 2008. Proceedings, pages 424–435, 2008. [16] Michel X Goemans, Maurice Queyranne, Andreas S Schulz, Martin Skutella, and Yaoguang Wang. Single machine scheduling with release dates. SIAM Journal on Discrete Mathematics, 15(2):165–192, 2002. [17] Leslie A Hall, Andreas S Schulz, David B Shmoys, and Joel Wein. Scheduling to minimize average completion time: Off-line and on-line approximation algorithms. Mathematics of operations research, 22(3):513–544, 1997. [18] Han Hoogeveen, Petra Schuurman, and Gerhard J Woeginger. Non-approximability results for scheduling problems with minsum criteria. INFORMS Journal on Computing, 13(2):157–168, 2001. [19] VS Kumar, Madhav V Marathe, Srinivasan Parthasarathy, and Aravind Srinivasan. A unified approach to scheduling on unrelated parallel machines. Journal of the ACM (JACM), 56(5):28, 2009. [20] VS Anil Kumar, Madhav V Marathe, Srinivasan Parthasarathy, and Aravind Srinivasan. Minimum weighted completion time. In Encyclopedia of Algorithms, pages 544–546. Springer, 2008. [21] Jan Karel Lenstra, AHG Rinnooy Kan, and Peter Brucker. Complexity of machine scheduling problems. Annals of discrete mathematics, 1:343–362, 1977. 22 [22] Jan Karel Lenstra, David B Shmoys, and Éva Tardos. Approximation algorithms for scheduling unrelated parallel machines. Mathematical programming, 46(1-3):259–271, 1990. [23] Tridib Mukherjee, Ayan Banerjee, Georgios Varsamopoulos, Sandeep KS Gupta, and Sanjay Rungta. Spatio-temporal thermal-aware job scheduling to minimize energy consumption in virtualized heterogeneous data centers. Computer Networks, 53(17):2888–2904, 2009. [24] Cynthia Phillips, Clifford Stein, and Joel Wein. Task scheduling in networks. SIAM Journal on Discrete Mathematics, 10(4):573–598, 1997. [25] Ramendra K Sahoo, Mark S Squillante, Anand Sivasubramaniam, and Yanyong Zhang. Failure data analysis of a large-scale heterogeneous server environment. In Dependable Systems and Networks, 2004 International Conference on, pages 772–781. IEEE, 2004. [26] Andreas S Schulz and Martin Skutella. Scheduling unrelated machines by randomized rounding. SIAM Journal on Discrete Mathematics, 15(4):450–469, 2002. [27] Petra Schuurman and Gerhard J Woeginger. Polynomial time approximation algorithms for machine scheduling: Ten open problems. Journal of Scheduling, 2(5):203–213, 1999. [28] Jay Sethuraman and Mark S Squillante. Optimal scheduling of multiclass parallel machines. In SODA, pages 963–964, 1999. [29] David B Shmoys and Éva Tardos. An approximation algorithm for the generalized assignment problem. Mathematical programming, 62(1-3):461–474, 1993. [30] Martin Skutella. Convex quadratic and semidefinite programming relaxations in scheduling. J. ACM, 48(2):206–242, March 2001. [31] Martin Skutella and Gerhard J Woeginger. A ptas for minimizing the total weighted completion time on identical parallel machines. Mathematics of Operations Research, 25(1):63–75, 2000. [32] Wayne E Smith. Various optimizers for single-stage production. Naval Research Logistics Quarterly, 3(1-2):59–66, 1956. [33] Ola Svensson. Santa claus schedules jobs on unrelated machines. SIAM Journal on Computing, 41(5):1318–1341, 2012. [34] Maxim Sviridenko and Andreas Wiese. Approximating the configuration-lp for minimizing weighted sum of completion times on unrelated machines. In Integer Programming and Combinatorial Optimization, pages 387–398. Springer, 2013. 23
8cs.DS
Full- and Reduced-order Model of Hydraulic Cylinder for Motion Control Michael Ruderman arXiv:1705.00916v2 [cs.SY] 24 Jul 2017 University of Agder (UiA), Post box 422, 4604-Kristiansand, Norway Email: [email protected] Abstract—This paper describes the full- and reduced-order models of an actuated hydraulic cylinder suitable for system dynamics analysis and motion control design. The full-order model incorporates the valve spool dynamics with combined deadzone and saturation nonlinearities – inherent for the orifice flow. It includes the continuity equations of hydraulic circuits coupled with the dynamics of mechanical part of cylinder drive. The resulted model is the fifth-order and nonlinear in states. The reduced model neglects the fast valve spool dynamics, simplifies both the orifice and continuity equations through an aggregation, and considers the cylinder rod velocity as output of interest. The reduced model is second-order that facilitates studying the system behavior and allows for direct phase plane analysis. Dynamics properties are addressed in details, for both models, with focus on the frequency response, system damping, and state trajectories related to the load pressure and relative velocity. I. INTRODUCING REMARK Hydraulic cylinders [1] are the first choice in numerous applications which require high forces and robust operation in outside, harsh, and hard-accessible environments. Motion control [2], force control [3], and hybrid of both [4] represent steady challenging tasks for the operation of hydraulic cylinders. Due to a complex nonlinear behavior, their reliable modeling, identification, and control [5] are crucial for subsequent exploitation. This note addresses the full- and reduced-order modeling of hydraulic cylinders seen from the system plant point of view required for the analysis and control design. II. and cylinder friction counteract the induced pressure-gradient force, thus resulting in the motion dynamics of cylinder drive. In the standard configuration with a constant supply pressure PS , the single available control input is that of the DCV denoted by u. Since the DCV spool is actuated by a proportional solenoid, the choice of the u quantity strictly depends on the way how the solenoid, and correspondingly DCV, is low-level controlled. Most simple case, u is the coil voltage applied through an amplifier so as to energize the electro-magnetic circuits of the solenoid. However, the more advanced and common case, which we also assume in the following, is when the control input u is directly proportional to the relative spool position. That means the latter is low-level controlled by an embedded DCV electronics, which includes an internal coil current loop and external spool position loop. Note that the spool relative displacement ν is provided by either a single or by a pair of electro-magnetic solenoids. In the first case, a pre-stressed returning spring ensures the bidirectional spool actuation, cf. with Fig. 1. In the second case, two synchronized solenoids are arranged in antagonistic way, thus making spool pushing and pulling fully identical. FULL-ORDER MODEL We first consider the full-order model of hydraulic cylinder controlled by a directional control valve (DCV). Note that the following modeling relies on the basics of hydraulic servo systems, provided e.g. in [1], and is close to developments which can also be founded in the previously published works on hydraulic servo systems, e.g. [5], [4]. However, whenever differences appear we will highlight these with the corresponding references. The DCV allows for a volumetric flow Qn of hydraulic medium from, correspondingly to, both chambers (A and B) of hydraulic cylinder, see Fig. 1. Note that here and later on the subscript n = {A, B, S, T } refers to the cylinder chambers A and B, hydraulic pressure supply (for instance pump), and the tank correspondingly. The pressure difference between both chambers generates the hydraulic actuation force which moves the cylinder piston with a rod in direction of the pressure gradient. The external mechanical loads, inertial force, Preprint of the manuscript accepted to IEEE 43rd Annual Conference of Industrial Electronics Society (IECON2017) Fig. 1. Principal structure of hydraulic cylinder controlled by DCV. The low-level controlled DCV has the closed-loop transfer characteristics of the second-order system described by G(s) = ν(s) ω02 . = 2 u(s) s + 2ξω0 s + ω02 (1) The closed-loop parameters are the eigen-frequency ω0 , damping ratio ξ and, ideal-case, unity gain which ensures the steadystate accuracy of the spool position control loop. Depending on the input amplitude |u| and working pressure in hydraulic circuits, the transfer characteristics G(s) can be varying in parameters and, therefore, bear some minor uncertainties in tran- sient behavior of the controlled spool position response. Some typical |u|-dependent variations in the nominal (measured) frequency response characteristics of the controlled DCV are in vicinity to corner frequencies, and therefore DCV control bandwidth. This can be found in several manufacturer data sheets of the commercially available DCVs with embedded electronics that implements a low-level spool position control. When the DCV assembly is equipped with a closed center spool, which is one of the most common configurations aimed for reducing the valve leakage and sensitivity to the small input signals, the spool-controlled flow characteristics are inherently subject to the dead-zone nonlinearity. That is a relative spool displacement below certain magnitude, in both directions across (zero) center position, does not lead to an orifice and therefore hydraulic flow. Furthermore, the orifice, which is governed by the spool displacement, is subject to saturations due to the maximally possible opening given by the inner structure of the valve body. Therefore, an internal flow-governing control variable z can be introduced as being related to the controlled spool position through two static nonlinearities, dead-zone and saturation, connected in series. Here we note that several previous works either neglect or only partially account for the above nonlinearities, while these can have an impact on the overall system dynamics in view of cylinder feedback control in the applications. So e.g. in [5], [3], [2], [6], [4] both nonlinearities are neglected. In [7] both nonlinearities are taken into account while disregardind the second-order DCV closed-loop dynamics and approximating the spool position response as a first-order system. A more detailed and sophisticated model of proportional valves with internal flow dynamics [8] explicitly analyzed this type of nonlinearities. However the spool travel ν has been assumed as an available external input, therefore without considering its controlled behavior and associated (internal) dynamics. Combining the DCV closed-loop dynamics (1) with the overall static nonlinearity described by  if |ν| ≥ α + β,  α sign(ν), 0, if |ν| < β, h(ν) = (2)  ν − β sign(ν), otherwise, results in the mechanical sub-model of DCV ν̈ + 2ξω0 ν̇ + ω 2 ν z = = ω 2 u, h(ν), (3) (4) where the output z is the orifice state which governs the valve flow. The parameters α and β denote the saturation level and dead-zone size correspondingly. For the sake of simplicity, we assume the same parameter values for both directions of the spool displacement, hence a symmetric DCV, while some more specific DCV assemblies can have different directiondependent α, β values, see e.g. [8] for details. Further we note that while the saturation level can be considered as constant and known a-priory, or at least after system identification, the dead-zone size can be subject to state-dependent uncertainties and altering (wear-related) effects. The state-dependent variations lead back to e.g. viscoelastic properties and clarity of the hydraulic medium, working pressure, temperature, and others. The volumetric flow of hydraulic medium associated with both outlet ports of DCV, and thus with both chambers of the connected hydraulic cylinder, is governed by the corresponding pressure differences and given by the orifice equations  √   zK √PS − PA , for z > 0, QA (z) = (5) zK PA − PT , for z < 0,   0, otherwise;  √   −zK √PB − PT , for z > 0, QB (z) = (6) −zK PS − PB , for z < 0.   0, otherwise. For the sake of clarity, we note that the configuration depicted in Fig. 1 implies z < 0, so that the (in) flow through the port B has the positive sign, and the (out) flow through the port A correspondingly negative. The valve flow coefficient r 2 K = Cd w , (7) ρ denoted also as a valve gain, depends of the oil density ρ, discharge coefficient of the orifice Cd , and wight of rectangular orifice area w. Last two are the structural parameters of the DCV assembly at hand, cf. with e.g. [9]. Also we note that while the flow direction in (5), (6) is determined by the sign of the orifice state z, including dead-zone, several works decide the flow direction depending on the sign of control input [5], spool position [3], [2], or pressure drop in the chambers [7]. The continuity equations of pressure the gradient [1] in both chambers are given by  E ṖA = QA − AA ẋ − CL (PA − PB ) , (8) VA  E  QB + AB ẋ − CL (PB − PA ) , (9) ṖB = VB where AA/B are the corresponding effective piston areas. Note that for the single-rod cylinders AA > AB , cf. with Fig. 1, while for the double-rod cylinders AA = AB is mostly assumed. The bulk modulus E = −V (dP/dV ) reflects the incompressibility of hydraulic medium in cylinder. While this is generally pressure-dependent, an effective bulk modulus is mostly assumed as a constant parameter for the rated operation pressure of hydraulic system at hand. The total volume in hydraulic circuits VA VB = = VA0 + AA sath (x), VB0 − AB sath (x) (10) (11) 0 depends each on the rod drive position, while VA/B is the total chambers volume (including piping and fittings between the DCV and cylinder) when the rod drive is in the initial zero position x = 0. Note that the drive displacement is subject to saturation, captured by sath operator in (10), (11), while h is the half-stroke of the symmetric cylinder. CL is an internal leakage coefficient of cylinder which characterizes an additional pressure drop due to (minor) penetration of the hydraulic medium between both chambers. That is caused by a non-zero clearance between the barrel and piston of hydraulic cylinder. Note that in ideal case, the leakage coefficient can be assumed as zero, though it constitutes a rather uncertain factor related to the life cycle of hydraulic cylinder, temperature-dependent material expansion, oil viscosity and, if applicable, external radial stress affecting the piston rod during the operation. The mechanical sub-model of cylinder drive can be directly formulated, for one translational degree-of-freedom (DOF), based on the Pascal’s and Newton’s second law as mẍ = PA AA − PB AB − f − FL . (12) The lumped moving mass of the cylinder piston with rod and, if applicable, external coupling (tool) is m, and all external counteracting forces are summarized by FL . Note that the latter are the matter of application and, in the most simple case of stand-alone hydraulic cylinder, can be assumed to be zero. The counteracting nonlinear friction f mainly depends on the relative velocity of the piston drive and acts as an inherent damping of the relative motion. Note that in more complex modeling of the motion dynamics, the friction f can be also considered as depending on the normal load, relative displacement at motion reversals, working temperature, and other factors. Furthermore, the kinetic friction is well-known to exhibit a time-varying behavior so that its model parameters can be assumed as drifting or, at least, with an uncertainty range. For more details on varying kinetic friction and its impact on the motion control we refer to e.g. [10], [11]. It can be stressed that the friction in hydraulic cylinders is mainly due to the contacts between the rods and lip seals, and between the piston o-rings, seals, and cylinder [12]. Also the viscous effects of hydraulic fluid contribute to arising friction which counteracts the induced motion of the cylinder drive. However, the major source of friction remains due to the tight lip and piston seals that are required to prevent internal and external leaks in the system. In the following, we will assume the kinetic friction as function of solely the relative velocity ẋ, while some works [13], [14] made attempts to explicitly incorporate dependency on the pressure, correspondingly pressure difference, into the friction law. Further we note that more sophisticated dynamic friction models can also capture some transient and memory-driven effects of nonlinear friction, see [15] for survey, and pre-sliding rate-independent damping [16] as well. The steady-state friction can be described by the wellknown Stribeck [17] characteristic curve   f (ẋ) = sign(ẋ) Fc + (Fs − Fc ) exp −|ẋ|δ χ−δ + σ ẋ, (13) which takes into account the constant Coulomb and linear viscous friction, plus the velocity-weakening effects in a low velocity range around zero. The static model (13) is parameterized by the Coulomb friction coefficient Fc > 0, Stribeck (or stiction) friction coefficient Fs > Fc , linear viscous friction coefficient σ > 0, and two Stribeck shape factors χ > 0 and δ 6= 0. In case the discontinuity at velocity zero crossing should be avoided in the model, to say without performing a more complex dynamic friction modeling, some heuristic approaches e.g. using tangens-hyperbolic functions instead of the sign-operator can be pursued, see for example [18]. Another reason for using the tangens-hyperbolic type smooth transitions, instead of the sign discontinuity, is that during fast transients the argument of square root in (5), (6) can yield temporary negative, thus making calculus improper. Several characteristic shapes of the steady-state friction determined in experiments on the hydraulic cylinder drives can be found in [19], [20], [3], [12], [6], [14]. It should be noted that the above friction parameters can be also subject to uncertainties dictated by the thermal and load conditions, life cycle and wear, dust, dwell-time, spatial properties of contacting surfaces and others. III. REDUCED MODEL The reduced model takes advantages of the fast DCV spool dynamics so that the second-order closed-loop behavior of DCV can be neglected. Alternatively, this can be approximated by some constant time delay, if the corresponding phase lag is still to be taken into account when designing a feedback control of the hydraulic cylinder. Further, the cylinder piston velocity is assumed as the system output of interest, since this can be either directly derived from the available position measurement or observed, correspondingly estimated, using various robust velocity estimation techniques known from the literature, e.g. [21], [22]. In the following, we assume that the time-constants of hydraulic and mechanical sub-dynamics are significantly larger than that of the DCV control loop, to say by two to three orders of magnitude. Consequently, the input of the reduced model can be assumed as u∗ = v which directly enters both nonlinearities according to (2). Therefore, the resulted reduced model is with static nonlinearities in the input channel. Introducing the load-related pressure PL = PA − PB and assuming a closed hydraulic circuit, i.e. |QA | = |QB |, the orifice equations (5), (6) can be aggregated into one r   1 QL = zK (14) PS − sign(z)PL , 2 while it is valid PA = PS + PL , 2 PB = PS − PL . 2 (15) Note that (14) represents an average load flow through the DCV and occurs as further nonlinearity in the input channel of the reduced model. This incorporates, however, a dynamic feedback of the load pressure PL so that only (2) can be considered as a static input nonlinearity in forward. Furthermore it should be stressed that (14), (15) assume also zero pressure in the tank, cf. with (5), (6), which is however a reasonable simplification for various hydraulic cylinder drive systems. Following the above way of aggregation, the hydraulic continuity equations (8), (9) can be transformed into one related to the load pressure gradient  4E  ṖL = (16) QL − Āẋ − CL PL . Vt Here the total hydraulic actuator volume is Vt = VA0 + VB0 and the average effective piston area is Ā = 0.5(AA + AB ). Note that the latter yields an exact value for double-rod cylinders, while for single rod cylinders it bears an averaging error of the half of the rod cross-section area. Correspondingly, the dynamics (12) of mechanical part transforms (for the reduced model) into m d ẋ = PL Ā − f (ẋ) − FL , dt (17) with the cylinder drive velocity ẋ as system output and total friction force given by (13). Here we recall that the reduced model (13)-(17) with the input nonlinearity (2), (4) has the second-order dynamics, while the external load force FL acts as an internal state disturbance interfering between the first and second integrators of the forward dynamics path. IV. ANALYSIS OF SYSTEM DYNAMICS In the following, we discuss dynamic properties of both models while making some qualitative comparisons between them and demonstrating the differences in terms of the measured frequency response functions and state trajectories. For the latter we consider the [PL , ẋ] space, since both dynamic states are the most significant and characteristic for the response of hydraulic, correspondingly mechanic, parts of cylinder drives under an actuation. Before comparing the models, we provide a detailed analysis of the linearized reduced-order dynamics so as to disclose the principal system behavior with impact of linearization. For the accompanying TABLE I. S YSTEM PARAMETERS OF NUMERICAL SIMULATION Param. Value Units Param. Value Units α β ω ξ Cd w ρ E PS PT CL 1e-3 3e-4 1200 0.7 0.65 0.02 850 1e8 1e7 0 0 m m rad/s none none m kg/m3 Pa Pa Pa 1/s AA AB VA0 VB0 m Fc Fs σ χ δ h 5e-3 4.7e-3 1.2e-3 1.15e-3 20 600 900 2000 0.02 0.8 0.2 m2 m2 m3 m3 kg N N kg/s m/s none m numerical simulations, the system parameters listed in Table I are assumed. All units are given in SI. The numerical values are assigned artificially but, at the same time, lie in the range of realistic values for the DVC controlled hydraulic cylinder actuators, cf. with parameters provided e.g. in [12], [6]. A. Linearized reduced-order dynamics The purpose of a DCV is to supply hydraulic cylinders with the controlled volumetric flow which energizes the hydraulic circuits and mechanical drive according to (8), (9), (12), correspondingly (16), (17). Therefore, to obtain first an insight into dynamic behavior of the system, i.e. in frequency domain, the reduced-order model can be directly linearized between the load flow and rod velocity as ẋ(s) Ā−1 G(s) = = −2 2 , QL (s) ωc s + 2ζωc−1 s + 1 Despite the above simplification, the linearized dynamics (18)-(20) offers a creditable estimation of the second-order system behavior. This is, above all, in terms of the system gain, eigenfrequency and therefore system stiffness, and damping which reveals the system as stronger or less oscillatory and has a direct impact on the closed-loop behavior when designing a feedback control. It is evident that the gain between the flow and cylinder velocity is inverse to the effective piston area, so that the cylinders with larger Ā can achieve higher velocities. Also the eigenfrequency and therefore achievable control bandwidth increase with Ā, according to (19). At the same time, one should keep in mind that increasing Ā proportionally reduces the system damping, see (20), and therefore evokes additional issues of system stability. Furthermore from (19), one can see that both the moving mass and total hydraulic volume constitute the inertial terms which slow down the system eigenfrequency. From the energy transfer point of view it appears as logically consistent, since a higher hydraulic volume is more inertial, correspondingly with higher amount of kinetic energy for the same displacement rate. The bulk modulus E appears as an equivalent stiffness of hydraulic medium so that larger E increases the system eigenfrequency, according to (19). However, unlike the mechanical stiffness, the bulk modulus influences the system damping as well, cf. with (20). One can sum up that the parameters pair E/Vt , in addition to the effective piston area, is decisive for the system eigenfrequency and damping, as related to hydraulic circuits. This is crucial for specifying and dimensioning of hydraulic cylinder actuators during the design. Also it is obvious that the friction is the single factor influencing the overall system damping without having inverse impact on its eigenfrequency. The associated closed-loop dynamics for system (18) can be analyzed when examining the root locus of the open-loop kG(s)s−1 . Here the position of cylinder rod is taken as output of interest (used for a feedback control), and k is a system feedback gain. The root locus diagram, depicted in Fig. 2 for /0 $""" 12" %"" 12" " %"" (18) with the cylinder eigenfrequency and damping given by r E , (19) ωc = 2Ā Vt m r σ Vt ζ = . (20) Em 4Ā Note that the single step required to obtain the linearized dynamics (18) is that of assuming zero leakage coefficient and neglecting the nonlinear part of the system friction. The latter implies that a relative motion of cylinder rod becomes solely damped by the viscous friction with a linear damping coefficient σ. This represents an artificial case of the weakest mechanical damping, while a real dynamics of hydraulic cylinder is subject to additional rate-independent damping due to the Coulomb and presliding friction, correspondingly stiction. &''()*'+,- $""" !"" Fig. 2. #"" $"" " $"" #"" !"" &. Root locus for the open-loop kG(s)s−1 . the parameters from Table I, discloses that the system remains oscillating due to the conjugate-complex pole pair and become unstable starting from certain feedback gain value. Next the attention is to be paid to the impact of the load pressure feedback on the load flow according to (14). Keeping constant z value as a DCV operation point, the flow-pressure characteristics can be directly computed while max PL = PS . The static flow/pressure characteristic curves for different zvalues, starting from the neutral (closed) orifice state z = 0 and going until its maximal value z = α, are depicted in Fig. 3 for the assumed system parameters from Table I. Note that for negative load values the depicted characteristic curves are symmetrical with respect to both axes and lie in the third quadrant for the negative (PL , QL ) pairs. Considering the working points ẑ and P̂L and positive DCV operation range, this without loss of generality, one can show that q ∂QL (21) = K PS − P̂L =: Cq , ∂z P̂L ∂QL K ẑ =: −Cqp . (22) = − p ∂PL ẑ 2 PS − P̂L Both partial derivatives allow to introduce the so called flowgain coefficient Cq and flow-pressure coefficient Cqp . Then, for linearizing the orifice equation (14), one can write Q̂L = Cq z − Cqp PL . (23) It is evident that the pressure-dependent coefficient Cq amplifies the input orifice state z and, therefore, introduces solely an additional gain to the transfer function (18). On the x 10 z 5 P S 0 2 4 6 P (Pa) 8 Fig. 3. 10 6 x 10 L 10 Static load flow-pressure characteristic curves. magnitude (dB) contrary, the pressure feedback coefficient Cqp reshapes the G(s) dynamics so that the frequency response characteristics changes depending on the operation point. Already from the characteristic curves shown in Fig. 3, one can see that the feedback gain Cqp , which is a slope of the tangent to the (QL , PL ) curve for each (ẑ, P̂L ) working point, is rather low for small amplitudes. For zero load flows, i.e. at neutral DCV state with zero orifice, the feedback gain remains zero even for higher load pressures. This explain why the hydraulic cylinders under pressure often exhibit a steady-state vibration noise, even when no apparent motion of cylinder, i.e. no load flow, occur. 80 40 0 phase (deg) 0 zlow, PL,low −90 zlow, PL,high z 10 10 10 3 2 1 Full−order, |u|=α Full−order, |u|=0.3α Reduced, |u|=α Reduced, |u|=0.3α 0 10 1 10 2 10 3 frequency (rad/s) Fig. 5. FRFs of full-order and reduced models at different input amplitudes. The FRFs of the full-order and reduced models have been obtained from the numerical simulation at different excitation amplitudes, |u| = {α, 0.3α}, when applying a down-chirp 600–1 Hz and excluding the input nonlinearities (2). Estimated with a standard H1 correlation algorithm and smoothed, the FRFs are depicted opposite to each other in Fig. 5. One can see that for both models the low inputs do not excite the hydraulicrelated resonance peak. The resonance peak of the reduced model is also shifted to the lower frequencies. At higher frequencies the reduced model has inherently lower, −40 dB per decade, decrease due to the second order dynamics. ,P high −180 1 10 amplitude QL (m3) 10 0 B. Magnitude-dependent frequency response In what follows, the numerical simulations of the fullorder and reduced models, according to Sections II, III, have been used while assuming the parameters from Table I and Forward-Euler integration with a fixed step (0.0001) solver of MathWorks Simulinkr software. The sign(ẋ) in (13) has been replaced by tanh(400ẋ) so as to capture the negative pressure differences under square root in the orifice equations. −4 15 Obviously, for zero flow-pressure coefficient, i.e. for no load pressure feedback, the (24) transforms to the previously considered dynamics (18) amplified by the flow gain Cq . To provide a quantitative comparison between the linearized dynamics (24) at different operation points assume four pairs by combining the relatively low and high values ẑlow,high = {0.05α, 0.95α} and P̂L,low,high = {0.05PS , 0.95PS }. Recall that α and PS constitute the upper bounds for z and PL correspondingly. The frequency response functions (FRFs) for all four (ẑ, P̂L ) combinations are shown opposite to each other in Fig. 4. One can see that the low and high load pressure values change significantly the system gain, while the principal shape of the frequency response, with corresponding eigenfrequency and damping, remains quite similar. It can be noted that an increased system damping is solely in case of the maximal orifice and load pressure (red solide line). low zhigh, Phigh C. State trajectories 2 10 frequency (rad/sec) 3 10 4 10 Fig. 4. FRFs of linearized system (24) at different (ẑ, P̂L ) operation points. For better exposition of the above analysis consider the linearized transfer function between the orifice state z and rod velocity ẋ, which can be obtained from (18)-(20) and (23) as Ĝ(s) = ẋ(s) Cq G(s) . = z(s) 1 + Cqp (ms + σ)Ā−1 G(s) (24) The (PL , ẋ) state trajectories are analyzed, for both models, when applying a low sinusoidal amplitude 0.4e-3, which is close to the dead-zone size β, and high sinusoidal amplitude 1e-3, which corresponds to the saturated orifice state. Both input sinusoidals are at 0.1 Hz frequency without phase shift. The velocity responses and phase plane portraits of both models are shown in Fig. 6, for the low (on the top) and high (on the bottom) excitation amplitudes. One can see that while the velocity patterns of both models coincide well with each other, the load pressure trajectories are quite different in both, transient oscillations and steady-state locations. This is not surprising since at relatively low load pressures, the reduced model averaging of the orifice and continuity equations yields the hydraulic circuits as ideally symmetrical. On 0.060.06 0.060.06 (a) (a) 0.020.02 (b) (b) 0 −0.03 −0.03 −0.06 −0.06 0 dx/dt (m/s) 0.030.03 0 1.4 1.4 1.6 1.6 dx/dt (m/s) dx/dt (m/s) dx/dt (m/s) 0.030.03 0 −0.03 −0.03 Reduced Reduced Full−order Full−order 10 10 5 Reduced Reduced Full−order Full−order −3 −3 0 3 PL (Pa)(Pa) 5 x 10x 10 −0.06 −0.06 −6 −6 t (s)t (s) 0.1 0.1 dx/dt (m/s) 0.2 dx/dt (m/s) (a) 0.2 0 −0.1 0 −0.1 Reduced Full−order 10 15 −0.2 0 (b) 5 −0.2 −6 t (s) −3 PL (Pa) Reduced Full−order 0 3 5 x 10 Fig. 6. Velocity trajectories (a) and phase plane portraits (b) for the sinusoidal inputs with low (upper) and high (below) amplitudes. the contrary, the full-order model takes into account the oneside rod cylinder that reflects in the shifted (unbalanced) load pressure during a cyclic open-loop excitation. From both, velocity trajectories and phase plane portraits, one can see zero velocity regions corresponding to the DCV dead-zone. Further one can recognize the transient oscillations of both states in the anti-phase each time the relative motion restarts in an opposite direction. After the fast transients, the (PL , ẋ)-trajectory attains a non-oscillating pattern which corresponds to the steady-state motion in case of the higher excitation amplitude. V. CONCLUSIONS The full- and reduced-order dynamic models for DCV controlled hydraulic cylinders have been described in details. A possible reduction from the 5th to the 2nd order dynamics has been provided while explaining the related assumptions and implications. The system behavior has been analyzed and the basic equations have been exposed in terms of their parametrization and coupling between each other. Numerical examples with parameters assumed close to the real hydraulic servo systems have been considered, with particular focus on the open-loop behavior in frequency domain and trajectories of the most relevant system states, load pressure and cylinder velocity. The given modeling and analysis should serve for better understanding the dynamics of hydraulic cylinder drives and associated identification and motion control design. ACKNOWLEDGMENT This work has received funding from the European Union Horizon 2020 research and innovation programme H2020- MSCA-RISE-2016 under the grant agreement No 734832. R EFERENCES [1] H. E. Merritt, Hydraulic control systems. John Wiley & Sons, 1967. [2] B. Yao, F. Bu, J. Reedy, and G.-C. Chiu, “Adaptive robust motion control of single-rod hydraulic actuators: theory and experiments,” IEEE/ASME Trans. on Mechatronics, vol. 5, no. 1, pp. 79–91, 2000. [3] A. Alleyne and R. Liu, “A simplified approach to force control for electro-hydraulic systems,” Control Engineering Practice, vol. 8, no. 12, pp. 1347–1356, 2000. [4] J. Komsta, N. van Oijen, and P. Antoszkiewicz, “Integral sliding mode compensator for load pressure control of die-cushion cylinder drive,” Control Engineering Practice, vol. 21, no. 5, pp. 708–718, 2013. [5] G. A. Sohl and J. E. Bobrow, “Experiments and simulations on the nonlinear control of a hydraulic servosystem,” IEEE Trans. on Control Systems Technology, vol. 7, no. 2, pp. 238–247, 1999. [6] L. Márton, S. Fodor, and N. Sepehri, “A practical method for friction identification in hydraulic actuators,” Mechatronics, vol. 21, no. 1, pp. 350–356, 2011. [7] S. Aranovskiy, “Modeling and identification of spool dynamics in an industrial electro-hydraulic valve,” in IEEE 21st Mediterranean Conference on Control & Automation (MED), 2013, pp. 82–87. [8] B. Eryilmaz and B. H. Wilson, “Unified modeling and analysis of a proportional valve,” Journal of the Franklin Institute, vol. 343, no. 1, pp. 48–68, 2006. [9] E. N. Viall and Q. Zhang, “Determining the discharge coefficient of a spool valve,” in American Control Conference (ACC2000), vol. 5, 2000, pp. 3600–3604. [10] M. Ruderman and M. Iwasaki, “Observer of nonlinear friction dynamics for motion control,” IEEE Trans. on Industrial Electronics, vol. 62, no. 9, pp. 5941–5949, 2015. [11] M. Ruderman, “Integral control action in precise positioning systems with friction,” in IFAC 12th Workshop on Adaptation and Learning in Control and Signal Processing, 2016, pp. 82–86. [12] W. S. Owen and E. A. Croft, “The reduction of stick-slip friction in hydraulic actuators,” IEEE/ASME Trans. on Mechatronics, vol. 8, no. 3, pp. 362–371, 2003. [13] A. Bonchis, P. I. Corke, and D. C. Rye, “A pressure-based, velocity independent, friction model for asymmetric hydraulic cylinders,” in IEEE International Conference on Robotics and Automation, vol. 3, 1999, pp. 1746–1751. [14] M. Ottestad, N. Nilsen, and M. R. Hansen, “Reducing the static friction in hydraulic cylinders by maintaining relative velocity between piston and cylinder,” in 12th International Conference on Control, Automation and Systems (ICCAS), 2012, pp. 764–769. [15] B. Armstrong-Hélouvry, P. Dupont, and C. C. De Wit, “A survey of models, analysis tools and compensation methods for the control of machines with friction,” Automatica, vol. 30(7), pp. 1083–1138, 1994. [16] M. Ruderman and D. Rachinskii, “Use of Prandtl-Ishlinskii hysteresis operators for Coulomb friction modeling with presliding,” in Journal of Physics: Conference Series, vol. 811, no. 1, 2017, p. 012013. [17] R. Stribeck, “Die wesentlichen Eigenschaften der Gleit- und Rollenlager,” VDI-Zeitschrift (in German), vol. 46, no. 36–38, pp. 1341– 1348,1432–1438,1463–1470, 1902. [18] J. Yao, W. Deng, and Z. Jiao, “Adaptive control of hydraulic actuators with LuGre model-based friction compensation,” IEEE Tran. on Industrial Electronics, vol. 62, no. 10, pp. 6469–6477, 2015. [19] S. Tafazoli, C. De Silva, and P. Lawrence, “Friction estimation in a planar electrohydraulic manipulator,” in American Control Conference (ACC’95), vol. 5, 1995, pp. 3294–3298. [20] P. Lischinsky, C. Canudas-de Wit, and G. Morel, “Friction compensation for an industrial hydraulic robot,” IEEE Control Systems Magazine, vol. 19, no. 1, pp. 25–32, 1999. [21] A. Levant, “Robust exact differentiation via sliding mode technique,” Automatica, vol. 34, no. 3, pp. 379–384, 1998. [22] J. Davila, L. Fridman, and A. Levant, “Second-order sliding-mode observer for mechanical systems,” IEEE Trans. on Automatic Control, vol. 50, no. 11, pp. 1785–1789, 2005.
3cs.SY
Detecting Change-Points in Time Series by Maximum Mean Discrepancy of Ordinal Pattern Distributions Mathieu Sinn IBM Research Dublin, Ireland Ali Ghodsi Department of Statistics and Actuarial Science, University of Waterloo Waterloo, Ontario, Canada Abstract As a new method for detecting change-points in high-resolution time series, we apply Maximum Mean Discrepancy to the distributions of ordinal patterns in different parts of a time series. The main advantage of this approach is its computational simplicity and robustness with respect to (non-linear) monotonic transformations, which makes it particularly well-suited for the analysis of long biophysical time series where the exact calibration of measurement devices is unknown or varies with time. We establish consistency of the method and evaluate its performance in simulation studies. Furthermore, we demonstrate the application to the analysis of electroencephalography (EEG) and electrocardiography (ECG) recordings. 1 INTRODUCTION Detecting changes in the temporal evolution of a system (biological, physical, mechanical, etc.) is of major importance, e.g. in medical diagnostics, industrial quality control, or the analysis of financial markets. In statistics, the problem of inferring the time point of a change from a sequence of observations is known as change-point detection. There is a vast literature on parametric and non-parametric methods for testing the presence of change-points and for estimating their locations. For an overview, we refer to the monographs of Chen and Gupta (2000) and Brodsky and Darkhovsky (1993, 2000). Recently, Harchaoui et al. (2009) have introduced an estimator for change-points based on kernels. In this paper, we propose to detect change-points by comparing the distributions of ordinal patterns in different parts of a time series. In order to capture differences among the distributions automatically, we apply Karsten Keller Institute of Mathematics University of Lübeck Lübeck, Germany the Maximum Mean Discrepancy (MMD) criterion recently introduced by Gretton et al. (2007a, 2007b). The proposed method is computationally fast and robust with respect to (non-linear) monotonic transformations of the observations, which makes it particularly attractive for the exploration of high-resolution biophysical time series where the exact calibration of measurement devices is unknown or varies with time. In real-life applications, such changes in the calibration occur, e.g., for electroencephalography (EEG) recordings where small displacements of electrodes result in changes of the conductivity. Detecting changes in the dynamics of a time series by looking at ordinal pattern distributions has first been proposed by Bandt and Pompe (2002). More specifically, they consider permutation entropy, which is the Shannon entropy of ordinal pattern distributions, as a measure for detecting changes in the complexity of time series. Permutation entropy has been applied to the analysis of epileptic activity in EEG data (Li et al., 2007; Bruzzo et al., 2008) and to measuring anaesthetic drug effects (Li et al., 2008; Olofsen et al., 2008). In methodological studies, Keller et al. (2007a, 2007b) define further statistics of ordinal pattern distributions besides permutation entropy and investigate properties of the distributions themselves. Bandt and Shiha (2007) derive formulas for ordinal pattern probabilities in stochastic processes; Sinn and Keller (2011) study statistical properties of estimators of these probabilities. This paper is organized as follows: In Section 2, we formalize the change-point problem and review the definition of ordinal pattern distributions. Section 3 shows how MMD can be used to automatically detect change-points and discusses related work. In Section 4, we evaluate the performance of our methods in simulation studies and demonstrate the application to real-life time series. Section 5 concludes the paper. 2 OUTLINE OF THE METHOD 2.1 In this paper, we consider the problem of inferring the time point of a change in the distribution of an observed time series. The basic idea is to look at the order structure in different parts of the time series; if we find a time point with a clear difference between the order structure before and afterwards, we conclude that it is a change-point. Formally, we describe the problem as follows: Let N denote the set of natural numbers and Z the set of integers. Consider a real-valued stochastic process X = (Xt )t∈Z on some probability space (Ω, A, P), where Ω denotes the sample space, A the set of measurable events and P the probability measure. Let Y = (Yt )t∈Z be the process of increments given by Yt := Xt − Xt−1 for t ∈ Z. Throughout this paper, we always assume the following holds: (A1) The process Y is non-degenerate, i.e., all finitedimensional distributions of Y are absolutely continuous with respect to the Lebesgue measure. (A2) The processes (Y0 , Y−1 , . . .) and (Y1 , Y2 , . . .) are strictly stationary and ergodic. Note that as a consequence of (A1), the values of X are pairwise distinct P-almost surely, that is, P(Xt1 6= Xt2 ) = 1 (1) for all t1 , t2 ∈ Z with t1 6= t2 . Now let m, n ∈ N. Suppose that we observe a time series of length m + n with a change in the underlying distribution after the first m time points, and m, n are unknown (only the length m + n is observable). Then finding the location of the change-point is equivalent to estimating the pair (m, n). We model this situation by assuming the observed time series is a realization of X at times t = −m, −m + 1, . . . , n − 2, n − 1. If the distributions of (Y0 , Y−1 , . . .) and (Y1 , Y2 , . . .) are different, then t = 0 is a change-point in X and we obtain m observations before and n observations afterwards. A generalization of the situation with only one change in the distribution is the multiple change-point problem where the time series potentially has more than one change-point. A common approach to solve this problem is to iteratively apply a method for detecting single change-points, i.e., after the detection of the first change-point, the method is applied to the time segments before and afterwards to search for further change-points. In Section 4.1, we will consider this approach in more detail. ORDINAL PATTERN DISTRIBUTIONS We use the concept of ordinal pattern distributions to describe the order structure of a time series. An ordinal pattern represents the order relations among successive values of a time series; if the values are pairwise different, it is natural to identify ordinal patterns with permutations. Counting the number of occurrences of the permutations in a time series (or parts of it) yields the empirical distribution of ordinal patterns. Here we give a formal definition of ordinal patterns. Let d ∈ N be fixed. By Π we denote the set of permutations {0, 1, . . . , d}, which we represent by (d + 1)tuples containing each of the numbers 0, 1, . . . , d exactly one time. Let the permutations be denoted by π 1 , π 2 , . . . , π (d+1)! so that Π = {π 1 , π 2 , . . . , π (d+1)! }. Now consider the partition of Rd+1 obtained by identifying vectors whose components are correspondingly ordered: For π = (r0 , r1 , . . . , rd ) ∈ Π, let B(π) be the subset of Rd+1 containing every vector (x0 , x1 , . . . , xd ) satisfying (i) xr0 ≥ xr1 ≥ . . . ≥ xrd , (ii) if xri = xri+1 , then ri > ri+1 . Obviously, the union of all subsets B(π 1 ), B(π 2 ), . . . , B(π (d+1)! ) is equal to Rd+1 , and by condition (ii) the pair of subsets B(π i ), B(π j ) is disjoint if i 6= j. By saying that the ordinal pattern of order d at time t ∈ Z is given by π = (r0 , r1 , . . . , rd ), we designate the event (Xt , Xt−1 , Xt−2 , . . . , Xt−d ) ∈ B(π). According to (1), this event is equivalent to Xt−r0 > Xt−r1 > . . . > Xt−rd P-almost surely. Note that a more general definition of ordinal patterns includes an additional parameter τ ∈ N (called the delay) which allows us to consider the events (Xt , Xt−τ , . . . , Xt−dτ ) ∈ B(π) (see Keller et al. (2007a)). Figure 1 shows all the possible outcomes for ordinal patterns of order d = 3. For example, if ω ∈ Ω is such that Xt (ω) > Xt−1 (ω) > Xt−2 (ω) > Xt−3 (ω) (thus, the time series roughly looks like the upper left plot in Figure 1), then the ordinal pattern at time t is given by (0,1,2,3). If Xt (ω) > Xt−1 (ω) > Xt−3 (ω) > Xt−2 (ω), then the ordinal pattern is given by (0, 1, 3, 2), and so on. The dark gray patterns (0, 1, 2, 3) and (3, 2, 1, 0) in Figure 1 occur if the underlying time series is monotonically increasing and decreasing, respectively. The light gray patterns occur if the past two increments H0,1,2,3L H0,1,3,2L H0,3,1,2L H3,0,1,2L H0,2,1,3L H0,2,3,1L H0,3,2,1L H3,0,2,1L H2,0,1,3L H2,0,3,1L H2,3,0,1L H3,2,0,1L H1,0,2,3L H1,0,3,2L H1,3,0,2L H3,1,0,2L H1,2,0,3L H1,2,3,0L H1,3,2,0L H3,1,2,0L H2,1,0,3L H2,1,3,0L H2,3,1,0L H3,2,1,0L Figure 1: Possible outcomes for ordinal patterns of order d = 3. have the same sign, and the white patterns occur after changes between “upwards” and “downwards”. Next, we consider the distribution of ordinal patterns in the process X. For t ∈ Z and k = 1, 2, . . . , (d + 1)! define pk (t) X has a change-point at t = 0. The key idea of our method for change-point detection is to measure the difference between the empirical ordinal pattern distributions in different parts of a time series. 2.2 := P( (Xt , Xt−1 , . . . , Xt−d ) ∈ B(π k ) ), that is, pk (t) denotes the probability that the ordinal pattern at time t is given by π k . By the distribution of ordinal patterns at time t we mean the stochastic vector p(t) := (p1 (t), p2 (t), . . . , p(d+1)! (t)) . Note that the ordinal pattern at time t actually only depends on the increments Yt , Yt−1 , . . . , Yt−d+1 (see Sinn and Keller (2011)). Hence, a sufficient condition for the ordinal pattern distributions p(t1 ) and p(t2 ) to be identical is that the random vectors (Yt1 , Yt1 −1 , . . . , Yt1 −d+1 ) and (Yt2 , Yt2 −1 , . . . , Yt2 −d+1 ) have the same distribution. According to assumption (A2), we obtain that . . . = p(−1) = p(0) and p(d) = p(d + 1) = . . . , i.e., the ordinal pattern distribution at times t ≤ 0 and t ≥ d, respectively, are identical. In general, the distributions p(t) with t = 1, 2, . . . , d − 1 are equal neither to p(0) nor to p(d) because they depend on increments both before and after t = 0. In the following, we write p− and p+ to denote the generic distributions p(0) and p(d), respectively. Obviously, a necessary condition for p− 6= p+ is that EMPIRICAL ORDINAL PATTERN DISTRIBUTIONS In the following, let 1{·} denote the function which evaluates to 1 if the statement in the brackets is true, and to 0 otherwise. For w ∈ N and t ∈ Z, define p̂k (w, t) := 1 w wt+w X  1 (Xs , Xs−1 , . . . , Xs−d ) ∈ B(π k ) , s=wt+1 that is, p̂k (w, t) is the relative frequency of time points in the time window {wt+1, wt+2, . . . , wt+w} at which the ordinal pattern is π k . The parameter w determines the size of the time window; as we will see in Theorem 1 below, the larger w, the closer we can expect p̂k (w, t) be to pk (t). Now, taking into account all the estimates p̂k (w, t) for k = 1, 2, . . . , (d + 1)! gives us the empirical ordinal pattern distribution  p̂(w, t) := p̂1 (w, t), p̂2 (w, t), . . . , p̂(d+1)! (w, t) . As the following theorem shows, p̂(w, t) converges to p− if t < 0, and to p+ if t ≥ 0 (P-almost surely). This result also holds if the “calibration” of X changes at a number of points that grows sublinearly in time. Theorem 1 Suppose that conditions (A1)and (A2) hold. Then  p− if t < 0, lim p̂(w, t) = p+ if t ≥ 0, w→∞ P-almost surely. This result also holds if we observe the “distorted” process (h(Xt , t))t∈Z instead of (Xt )t∈Z with X h(x, t) := 1{t ∈ (tj−1 , tj ] } hj (x), j∈Z where the mappings hj : R → R are strictly increasing for all j ∈ Z, and (tj )j∈Z is an increasing sequence in Z which satisfies  ] j ∈ Z : tj ∈ [−w, w] = 0. lim w→∞ w Proof. First, we consider the case t < 0. Since (Y0 , Y−1 , . . .) is ergodic and   E 1{(Xs , Xs−1 , . . . , Xs−d ) ∈ B(π k )} = pk (0) for all s ≤ w(t + 1) with w ∈ N, the Ergodic Theorem shows that p̂k (w, t) converges to pk (0) P-almost surely (Cornfeld et al., 1982). If t > 0, then wt + 1 ≥ d for sufficiently large w, and hence   E 1{(Xs , Xs−1 , . . . , Xs−d ) ∈ B(π k )} = pk (d) for all s ≥ wt + 1. Since (Y1 , Y2 , . . .) is ergodic, the Ergodic Theorem shows that p̂k (w, t) converges to pk (d) P-almost surely. In the case t = 0, we have p̂k (w, t) = d−1 1 X 1{(Xs , Xs−1 , . . . , Xs−d ) ∈ B(π k )} w s=1 + w 1 X 1 {(Xs , Xs−1 , . . . , Xs−d ) ∈ B(π k )}. w s=d Since the first term on the right hand side tends to 0 and the second one converges to pk (d) P-almost surely, the result follows. Now suppose that we observe (h(Xt , t))t∈Z instead of X. Note that if t, j ∈ Z satisfy t − d ≥ tj−1 and t ≤ tj , then (h(Xt ), h(Xt−1 ), . . . , h(Xt−d )) lies in B(π k ) if and only if (Xt , Xt−1 , . . . , Xt−d ) lies in B(π k ). Therefore, for any t ∈ Z, the number of time points s ∈ {wt + 1, wt + 2, . . . , wt + w} at which the indicator functions of these two events are unequal is bounded by (d + 1)-times the number of j ∈ Z for which tj ∈ [wt + 1, wt + w]. Since the latter number divided by w tends to 0 as w → ∞, we obtain the result.  2.3 DETECTING CHANGE-POINTS Based on the definition of ordinal pattern distributions and the consistency result of Theorem 1, we now present our method for change-point detection. Suppose that X has a change-point at time t = 0 which results in a difference between the ordinal pattern distributions p− and p+ . Furthermore, suppose that we observe X at times t = −wm+1, −wm+2, . . . , wn−1, wn where w ∈ N is “large” and m, n ∈ N are unknown (only the sum m + n is observed). In this setting, the problem of estimating the location of the change-point is equivalent to estimating the unknown values m and n. Our proposed method proceeds as follows: 1. We partition the observations of X into (m + n) non-overlapping blocks of size w each. 2. For each block, we compute the empirical ordinal pattern distribution, which gives us the (m + n)dimensional vector z(w) := (2) (p̂(w, −m), p̂(w, −m + 1), . . . , p̂(w, n − 1)). According to Theorem 1, we have lim z(w) w→∞ = ( p− , . . . , p− , p+ , . . . , p+ ) (3) {z } | {z } | m times n times P-almost surely. Thus, if the m + n ordinal pattern distributions can be divided into two clearly distinct groups, the sizes of these groups can be taken as estimates for m and n. In the following section, we apply Maximum Mean Discrepancy to determine these groups. Before discussing related work, let us make some remarks: Remark 1. Our method is robust with respect to changes in the “calibration” of the process X. In particular, if h− and h+ are both strictly increasing functions, then the ordinal pattern distributions p− and p+ in the transformed process (. . . , h− (X−1 ), h− (X0 ), h+ (X1 ), h+ (X2 ), . . .) are identical. As mentioned in the introduction, this robustness is often desirable for the analysis of biophysical time series the exact calibration of which is unknown or varies with time. Remark 2. If d is large enough, then our method does detect changes of the complexity of X measured by the permutation entropy (Bandt and Pompe, 2002; Keller and Sinn, 2009). Furthermore, it is capable to detect changes in the autocorrelation structure of Gaussian processes (Bandt and Shiha, 2007). Remark 3. There is some trade-off between the choice of the order of the ordinal patterns d and the time window size w. In general, a larger order d permits to detect changes of the higher-order autocorrelations of Y or, equivalently, in the lower frequency domain. On the other hand, the time window size w needs to be much larger than (d+1)! in order to obtain reliable estimates of all the ordinal pattern probabilities, however, the larger w, the less accurate the localization of the change-points. For our experiments in Section 4, we have chosen d = 3 and w = 500, that is, we consider 24 different ordinal patterns and are capable to localize change-points with a precision of ±250 time points which, for the EEG and ECG recordings, corresponds to approximately ±1 second. See also Section 3.3 for a further discussion on this issue. 3 MAXIMUM MEAN DISCREPANCY In order to group the components of the vector z(w) defined in (2), we use a recently proposed criterion called Maximum Mean Discrepancy (MMD). Let Z be an arbitrary set and z = (z1 , z2 , . . . , zm+n ) ∈ Z m+n with m, n ∈ N. MMD is a new criterion for testing whether z1 , z2 , . . . , zm and zm+1 , zm+2 , . . . , zm+n come from different distributions (Gretton et al., 2007a, 2007b). The basic approach is to measure the similarity of points z, z 0 ∈ Z using a kernel k(z, z 0 ). In our case, Z is the set of (d + 1)!-dimensional stochastic vectors, and for k(z, z 0 ) we choose the Radial Basis Function (RBF) kernel 0 k(z, z ) kz − z 0 k2 exp − 2σ 2  =  where k · k denotes the Euclidean norm and σ 2 > 0 is a smoothing parameter. For m0 , n0 ∈ N with m0 + n0 = m + n, the Maximum Mean Discrepancy is given by MMD(z, m0 , n0 ) :=  1 K1 (z, m0 , n0 ) 2 K2 (z, m0 , n0 ) K3 (z, m0 , n0 ) 2 − + m0 m0 m0 n0 n0 n0 where 0 0 0 K1 (z, m , n ) := 0 m X m X k(zi , zj ) , i=1 j=1 0 K2 (z, m0 , n0 ) := 0 m X n X k(zi , zm0 +j ) , i=1 j=1 0 0 0 K3 (z, m , n ) := 0 n X n X i=1 j=1 k(zm0 +i , zm0 +j ) . The terms m01m0 K1 (z, m0 , n0 ) and n01n0 K3 (z, m0 , n0 ) can be regarded as the average similarity of points within the groups z1 , z2 , . . . , zm0 and zm0 +1 , zm0 +2 , . . . , zm0 +n0 , respectively, while m10 n0 K2 (z, m0 , n0 ) measures the average similarity between the two groups. The maximal MMD value is obtained for that partition of z which yields maximum similarity within the groups and maximum dissimilarity between them. The next theorem shows how the MMD criterion can be used to locate change-points in X. Theorem 2 Suppose that conditions (A1) and (A2) hold and let z(w) be as defined in (2). Then for all m0 , n0 ∈ N with m0 + n0 = m + n, we have lim MMD(z(w), m0 , n0 ) n n m oq  2 1 − k(p− , p+ ) , 0 = min 0 n m P-almost surely. In particular, if p− 6= p+ , then   0 0 lim arg 0max MMD(z(w), m , n ) = (m, n) 0 2 w→∞ w→∞ (m ,n )∈N , m0 +n0 =m+n P-almost surely. Proof. Suppose that m0 ≤ m. By equation (3) and the fact that k(z, z) = 1 for all z ∈ X , the limits of K1 (z(w), m0 , n0 ), K2 (z(w), m0 , n0 ) and K3 (z(w), m0 , n0 ) are given by m0 m0 , m0 (m − m0 ) + m0 n k(p− , p+ ) and n0 (n0 −2n)+2n(n0 −n) k(p− , p+ ), respectively. Putting all terms together, we obtain q  n lim MMD(z(w), m0 , n0 ) = 0 2 1 − k(p− , p+ ) . w→∞ n In the case m0 > m, which is equivalent to n0 ≤ n, the result follows by symmetry. Now the second statement is obvious.  3.1 BIAS CORRECTION Theorem 2 shows that if the ordinal pattern distributions p− and p+ are different, then the argument (m0 , n0 ) which maximizes MMD(z(w), m0 , n0 ) is a strongly consistent estimator of (m, n). For finite w, however, practical experiments suggest that this estimator is biased towards (1, m+n−1) and (m+n−1, 1), particularly when the difference between p− and p+ is small (see Section 4.1). Here we give a heuristic explanation: suppose that the similarity between any two components of z = (z1 , z2 , . . . , zm+n ), as measured by the RBF kernel, is approximately equal to some constant δ > 0. For the random vector z(w), this is likely to be the case if the difference between p− and p+ is so small that all estimates are scattered in the same region. A simple calculation shows that m+n (4) MMD(z, m0 , n0 ) ≈ 1 − δ m 0 n0 6 4 0.6 2 0.5 0.20 0.15 0.4 0 -4000 -2 -2000 0 2000 4000 0.3 0.10 0.2 -4 0.05 0.1 -6 0.0 0 5 10 15 0.00 0 20 5 10 15 20 5 10 15 20 5 10 15 20 1.0 0.8 0.6 0.6 0.5 0.6 0.5 0.4 0.4 0.4 0.3 0.2 0.3 0.2 0.2 0.0 0.1 -4000 -2000 0 2000 4000 0.0 0 0.1 5 10 15 0.0 0 20 0.05 0.6 0.04 0.8 0.5 0.03 0.4 0.02 0.3 0.01 0.2 0.00 0.1 0 5 10 15 20 Figure 2: Top: Realization of an AR(1) process with a change-point at t = 0. Middle: Ordinal pattern distributions in time windows of size w = 500. Bottom: Resulting values for MMD (gray) and CMMD (black). 0.0 0 0.6 0.4 0.2 5 10 15 0.0 0 20 Figure 3: Distribution of the change-point estimators based on MMD (left) and CMMD (right). computation, note that for m0 , n0 ∈ N with m0 + n0 = m + n, and hence the argument maximizing MMD(z, m0 , n0 ) is likely to be (m0 , n0 ) = (1, m + n − 1) or (m0 , n0 ) = (m + n − 1, 1). Next we propose a correction for the bias: define the Corrected Maximum Mean Discrepancy K1 (z, m0 + 1, n0 − 1) = K1 (z, m0 , n0 ) 0 +2 m X k(zi , zm0 +1 ) + k(zm0 +1 , zm0 +1 ), i=1 K2 (z, m0 + 1, n0 − 1) = K2 (z, m0 , n0 ) 0 CMMD(z, m0 , n0 ) := MMD(z, m0 , n0 ) m+n−1 − max MMD(z, m̃, ñ). (m̃,ñ)∈N2 , m0 n0 m̃+ñ=m+n − m X k(zi , z m0 +1 )+ i=1 0 nX −1 k(zm0 +1 , zm0 +1+i ), i=1 K3 (z, m0 + 1, n0 − 1) = K3 (z, m0 , n0 ) 0 n X The correction term on the right hand side can be regarded as an estimate of the bias of the MMD statistic (compare to (4)). Experimental results show the superiority of using CMMD instead of MMD (see Section 4.1). Note that the estimator of (m, n) based on CMMD is no longer consistent; in order to preserve consistency, the correction term would have to be scaled by a factor that tends to 0 as w → ∞. Using these formulas, MMD(z(w), m0 , n0 ) can be evaluated iteratively for all (m0 , n0 ) = (1, m + n − 1), . . . , (m + n − 1, 1). Thus, computing the argument which maximizes MMD(z(w), m0 , n0 ) requires O((m + n)2 ) arithmetic operations. 3.2 3.3 EFFICIENT COMPUTATION Let us discuss the computational complexity of our method. The computation of the ordinal pattern distributions is linear in the length of the input sequence and can be realized by very efficient algorithms (Keller et al., 2007b). Computing the estimate of (m, n) by directly evaluating MMD(z(w), m0 , n0 ) for all m0 , n0 ∈ N with m0 + n0 = m + n requires O((m + n)3 ) arithmetic operations (Gretton et al., 2007a). For a more efficient −2 k(zm0 +1 , zm0 +i ) + k(zm0 +1 , zm0 +1 ). i=1 RELATED WORK There is an extensive literature on change-point detection, including both parameteric and non-parametric approaches (Chen and Gupta, 2000; Brodsky and Darkhovsky, 1993, 2000). Recently, a kernel-based method been proposed by Harchaoui et al. (2009). The main difference to our approach is that all these methods aim to find the exact location of change-points and give some guarantees on the significance level. 20 20 20 15 15 15 10 10 10 5 5 5 5 10 15 20 5 10 15 20 5 10 15 20 Figure 4: Detection of multiple change-points. The black coloring corresponds to the maximum frequencies 34.0% (left), 15.1% (middle) and 2.2% (right), the white coloring corresponds to 0%. This precision comes at the price of a high computational burden; for example, Harchaoui’s method has a running time which is cubic in the input size. Our method is designed to find the approximate location of change-points, where the precision is controlled by the time window size w. Because of its computational efficiency, our method is particularly attractive for the fast exploration of high-resolution time series such as EEG recordings, which often consist of hundreds of thousands of data points. Note that our approach can be combined with existing methods in order to first obtain the approximate locations of a set of candidate change-points before determining their exact locations and testing for significance. 4 4.1 EXPERIMENTS below represents the relative frequency of the ordinal pattern (0,1,2,3) (the first pattern in Figure 1), the space between the first and the second line from below represents the relative frequency of (0,1,3,2) (the second pattern in Figure 1), and so on. In the framework of Section 2, we have m = n = 10, i.e., there are 10 time windows before and after the change-point. As can be seen, the distributions before and after the change-point are slightly different. The bottom plot of Figure 2 shows the resulting MMD and CMMD values for (m0 , n0 ) = (1, 19), (2, 18), . . . , (19, 1). In all our experiments, we used σ 2 = 1 in the RBF kernel, however, we found that the results were not very sensitive with respect to the choice of σ 2 . The maximal MMD value is obtained for (m0 , n0 ) = (19, 1), while maximizing the argument of CMMD yields the true value (10, 10). SIMULATED DATA Change of the autoregressive coefficient. Let us first illustrate our method for simulated data. The top plot of Figure 2 shows a realization of a first order autoregressive (AR(1)) process with standard normal innovations where, at time t = 0, the autoregressive coefficient changes from 0.1 to 0.3. There are two changes of the process “calibration”: at time t = −2000, the variance increases from 1 to 2, and at time t = 2000, the variance decreases to 21 and values greater than 2 and smaller than −2, respectively, are scaled by the factor 2. According to Remark 1 at the end of Section 2, we are not interested in detecting these changes of the calibration, but only in the change-point at t = 0. Comparing MMD and CMMD. In Figure 3, we compare the distribution of the change-point estimators based on MMD and CMMD. Again, the underlying model is an AR(1) process of length 10, 000 and the time window size is w = 500. In this experiment, we chose (m, n) = (5, 15), and the autoregressive coefficient changes from 0.1 to 0.2 (top), from 0.1 to 0.3 (middle) and from 0.1 to 0.4 (bottom). The distributions of the estimators are obtained by 1, 000 Monte Carlo replications. As can be seen, the estimator based on CMMD performs better in all three cases; the one based on MMD is biased towards (1,19) and (19,1), particularly if the change of the autoregressive coefficient is small. The middle plot of Figure 2 shows the distribution of ordinal patterns in time windows of size w = 500. The order is d = 3, so there are 24 different patterns (compare to Figure 1). Their relative frequencies are represented by the space between horizontal lines: the space between the bottom line and the first line from Multiple change-point detection. Figure 4 shows the results obtained for the detection of multiple change-points. The underlying model is an AR(1) process of length 10, 000 with a change of the autoregressive coefficient at 2, 500 and 7, 500 1.0 800 800 700 0.5 600 600 500 0.0 400 50 100 150 200 250 400 300 200 -0.5 200 100 0 2 4 6 8 10 0 2 4 6 8 10 -1.0 1.0 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 0.0 0.0 0 50 100 150 200 250 0.15 0.10 0.05 0.00 0 50 100 150 200 0 50 100 150 200 0 50 100 150 200 0.08 0.07 0.06 0.05 0.04 0.03 250 Figure 5: Top: 250 seconds long part of an EEG recording. Middle: Ordinal pattern distributions. Bottom: Resulting MMD values. Figure 6: Top: 10 seconds of an ECG before and after an increase of the heart rate. Middle: Ordinal pattern distributions. Bottom: Resulting MMD values. time points, namely, from 0.1 to 0.4 and 0.4 to 0.1 (left), from 0.1 to 0.3 and 0.3 to 0.1 (middle), and from 0.1 to 0.2 and 0.2 to 0.1 (right). To localize these change-points, we applied our method twice: first to the entire sequence, then to the longer one of the resulting two time segments. Figure 4 displays the distribution of the estimates obtained by 1, 000 Monte Carlo replications. The coloring of the cell (x, y) represents the frequency of replications with the first change-point detected at 500x time points and the second one at 500y time points. As can be seen, the localization in the first two experiments is fairly precise. In the third experiment, the estimates are more scattered, however, this is true even in the single change-point setting (compare to Figure 3). Heart rate changes in ECG data. Figure 6 shows the application of our method to the detection of heart rate changes in electrocardiography (ECG) recordings. The middle plot displays the distribution of ordinal patterns in 100 non-overlapping time windows of 2 seconds, again corresponding to the time window size w = 512. After 100 seconds, there is a slight change in the heart rate from approximately 90 to 105 beats per minute (compare to the plots in the top row). As the bottom plot shows, this change-point is easily detected even by the non-corrected MMD values. 4.2 REAL-LIFE TIME SERIES Epileptic activity in EEG time series. The top plot of Figure 5 shows a 250 seconds long part of an EEG recording which was digitized with a sampling rate of 256 Hertz, so the time series consists of 250 · 256 = 64, 000 data points. The increase in amplitude after 160 seconds is related to the onset of an epileptic seizure. The middle plot shows the distribution of ordinal patterns in non-overlapping time windows of 2 seconds, that is, w = 512. Same as in Figure 2, the order of the patterns is d = 3. The bottom plot displays the resulting MMD values. The maximum is obtained at the onset of the seizure, thus indicating the presence of a change-point after 160 seconds. 5 CONCLUSIONS We have presented a new method for detecting changepoint in time series based on measuring the maximum mean discrepancy of ordinal pattern distributions. The main advantages of our approach are its computational efficiency and robustness towards (nonlinear) signal distortions. These properties make it particularly attractive for the fast exploration of biophysical time series the exact calibration of which is unknown or varies with time. We believe that our approach can be efficiently combined with existing change-point detection methods to first approximately localize of a set of candidates before determining the exact location and testing for significance. We have established asymptotical properties of our method and evaluated its performance both for simulated and reallife data, including the application to multiple changepoint problems. References effect of Sevoflurane. Anesthesiology 109, 3, 448-456. C. Bandt and B. Pompe (2002). Permutation entropy: A natural complexity measure for time series. Phys. Rev. Lett. 88, 174102. E. Olofsen, J.W. Sleigh and A. Dahan (2008). Permutation entropy of the electroencephalogram: a measure of anaesthetic drug effect. British Journal of Anaesthesia 110, 6, 810-821. C. Bandt and F. Shiha (2007). Order patterns in time series. J. Time Ser. Anal. 28, 646-665. B.E. Brodsky and B.S. Darkhovsky (1993). Nonparametric Methods in Change-Point Problems. Kluwer Academic Publishers, Dordrecht. B.E. Brodsky and B.S. Darkhovsky (2000). Nonparametric Statistical Diagnosis. Kluwer Academic Publishers, Dordrecht. A.A. Bruzzo, B. Gesierich, M. Santi, C.A. Tassinari, N. Birbaumer and G. Rubboli (2008). Permutation entropy to detect vigilance changes and preictal states from scalp EEG in epileptic patients. A preliminary study. Neurol. Sci. 29, 3-9. J. Chen and A.K. Gupta (2000). Parametric Statistical Change Point Analysis. Birkhäuser, Boston. I.P. Cornfeld, S.V. Fomin and Y.G. Sinai (1982). Ergodic Theory. Springer-Verlag, Berlin. A. Gretton, K.M. Borgwardt, M. Rasch, B. Schölkopf and A.J. Smola (2007a). A Kernel Method for the Two-Sample-Problem. Advances in Neural Information Processing Systems 19: Proceedings of the 2006 Conference, 513-520. A. Gretton, K.M. Borgwardt, M. Rasch, B. Schölkopf and A.J. Smola, A (2007b). A Kernel Approach to Comparing Distributions. Proceedings of the TwentySecond AAAI Conference on Artificial Intelligence, 1637-1641. Z. Harchaoui, F. Bach and E. Moulines (2009). Kernel change-point analysis. Advances in Neural Information Processing Systems 21, 609-616. K. Keller, H. Lauffer and M. Sinn (2007a). Ordinal analysis of EEG time series. Chaos and Complexity Letters 2, 247-258. K. Keller and M. Sinn (2009). A standardized approach to the Kolmogorov-Sinai entropy. Nonlinearity 22, 2417-2422. K. Keller, M. Sinn and J. Emonds (2007b). Time series from the ordinal viewpoint. Stochastics and Dynamics 2, 247-272. X. Li, G. Ouyang and D.A. Richards (2007). Predictability analysis of absence seizures with permutation entropy. Epilepsy Research 77, 70-74. X. Li, S.M.E. Cui and L.J. Voss (2008). Using permutation entropy to measure the electroencephalographic M. Sinn and K. Keller (2011). Estimation of ordinal pattern probabilities in Gaussian processes with stationary increments. Computational Statistics and Data Analysis 55, 4, 1781-1790.
5cs.CE
1 Extreme Learning Machine with Local Connections arXiv:1801.06975v1 [cs.LG] 22 Jan 2018 Feng Li, Sibo Yang, Huanhuan Huang, and Wei Wu Abstract—This paper is concerned with the sparsification of the input-hidden weights of ELM (Extreme Learning Machine). For ordinary feedforward neural networks, the sparsification is usually done by introducing certain regularization technique into the learning process of the network. But this strategy can not be applied for ELM, since the input-hidden weights of ELM are supposed to be randomly chosen rather than to be learned. To this end, we propose a modified ELM, called ELM-LC (ELM with local connections), which is designed for the sparsification of the input-hidden weights as follows: The hidden nodes and the input nodes are divided respectively into several corresponding groups, and an input node group is fully connected with its corresponding hidden node group, but is not connected with any other hidden node group. As in the usual ELM, the hiddeninput weights are randomly given, and the hidden-output weights are obtained through a least square learning. In the numerical simulations on some benchmark problems, the new ELM-CL behaves better than the traditional ELM. Index Terms—Extreme learning machine (ELM), local connections, sparsification of input-hidden weights, high dimensional input data. I. I NTRODUCTION F EEDFORWARD neural networks (FNNs) have been widely used in many fields due to their outstanding approximation capability [1], [2]. The most popular learning method for FNNs is the back-propagation (BP) algorithm [3], [4], which is essentially composed of numerous gradient descent searching steps. One of the drawbacks of this gradientbased learning method is its slow convergence. Extreme learning machine (ELM) [5], [6], [7] was proposed to speed up the convergence by randomly choosing, rather than iteratively learning, the weights between the input and hidden layers. ELM was shown to be highly efficient and easy to perform [5], [8]. To guarantees the convergence of ELM, the number of the hidden nodes is required to be greater than or equal to the number of the training samples, which is usually quite large in practice. Although it is not a necessary condition for the convergence, but indeed the the number of the hidden nodes should be quite large. At least, it should be greater than the number of the input nodes (=the dimension of the input data) due to the following intuitive argument: For instance, a data set in lower (resp. higher) dimensional space is easier (resp. harder) to be classified when it is randomly mapped into a higher (resp. lower) dimensional space. Therefore, there will be very many input-hidden weights when the number of the input nodes is big. Regularization methods are often used in the BP learning process to remove the redundant weights [9], [10]. But this strategy is not good to apply here for removing the redundant W. Wu is the corresponding author (e-mail: [email protected]). F. Li, S. Yang, H. Huang and W. Wu are with the School of Mathematical Sciences, Dalian University of Technology, Dalian 116024, China. input-hidden weights of ELM since, as mentioned above, the input-hidden weights of ELM are supposed to be randomly chosen rather than iteratively learned. For a related work on the local connection of ELM, we mention a local receptive fields based ELM (ELM-LRF) [11]. ELM-LRF is designed for the data sets of images, which are important examples of high dimensional data sets. Each elementary visual feature usually lies in different positions of an image datum. A remarkably successful neural network for dealing with such kind of data sets is the convolutional neural network (CNN) [12], [13], [14], [15]. Convolutional hidden nodes are introduced in CNN for extracting and locating the elementary visual features in different places of the the input image. CNN combines the technologies of local receptive fields [16], [17], [18], visual cortex [19], shared weights and pooling etc.. Like the usual feedforward neural networks, CNN is also trained by the BP method, and needs huge computational capability to tune the parameters. To overcome this difficulty, ELM-LRF was proposed recently by combining the network structure of CNN with the learning strategy of ELM. The efficiency of ELM-LRF has been proved empirically in a few applications and generalizations [20], [21], [22], [23], [24]. In this paper, we concern with another class of input data: They are of comparatively high dimension but, not like the image data etc., each component of the input data represents a specific attribute. We call them HDNI (High Dimensional Non-Image) data. When we are trying to build up a neural network to work on HDNI data, the technologies such as visual cortex, shared weights and pooling etc. are no longer applicable. But the idea of local receptive fields (or local connections) remains useful. To deal with HDNI data, we propose an ELM with local connections (ELM-LC), of which the input and hidden nodes are divided into corresponding groups, and are connected in a group-group manner. Let us elaborate the network structure of ELM-LC by a simple example. Suppose that the input dimension is nine and that the output dimension is m. As illustrated in Fig. 1, we divide the nine input nodes into three groups such that each group contains three input nodes. (For simplicity, the bias nodes are ignored in the discussion here.) Each group of input nodes is fully connected with a corresponding hidden node group containing four hidden nodes, but is not connected with the other hidden node groups. Then, the hidden nodes are simply fully connected with the output node. Each pair of input-hidden groups works like the input and hidden layers of a small ELM network. A hidden node group should contains more nodes than its corresponding input node group. All these small ELM networks collaborate with each other through the hidden-output weights to get the final output. As in the usual ELM, the input-hidden weights are 2 randomly given, and the hidden-output weights are obtained through a least square learning. y Output m 1 y Output gi(x) Ⱦ1 Ⱦi 1 ȾL i L Hidden (‫ܟ‬୧ , b୧ ) Hidden n 1 Input x Input Fig. 2. Schematic diagram of fully connected ELM. x Fig. 1. Illustration of input-hidden local connections. The idea of ELM-LC might be illustrated intuitively by a famous Indian fable “The six blind men and the elephant”: Each of the six blind men feels an elephant only by touching a separate part of it, and draws a conclusion what the elephant is like. This fable tells us “not to take a part for the whole”. But on the other hand, if the six gentlemen work together by synthesizing their understandings for different parts of the elephant, it is very likely for them to reach a complete picture of the elephant. The concept of “local connection” in our method means that each blind man only touches a part, rather than the whole, of the elephant, so as to lighten his work load. As a comparison, the task of ELM-LRF is to find and locate an elephant in a picture, where the elephant may appear in different places of the picture. And the task of ELM-LC is to identify an elephant by recognizing and synthesizing the different parts of it. It is our expectation to get a sparse and robust network ELM-LC for HDNI data. Numerical simulations are carried out on some benchmark problems, showing that ELM-CL behaves better than the traditional ELM on HDNI data. The remaining part of this paper is organized as follows. The description of the algorithm ELM-LC is presented in Section II. Supporting numerical simulations are provided in Section III. Some conclusions are drawn in Section IV. II. D ESCRIPTION OF THE ALGORITHM ELM-LC to the hidden layer by a random feature mapping. Then the output with respect to x is obtained by a linear mapping as follows: L X βi gi (x) y= = i=1 L X βi g(wi · x + bi ), i=1 m where y ∈ R is the output vector, βi = (βi1 , βi2 , · · · , βim )T ∈ Rm is the outgoing weight vector from i-th hidden node, wi = (w1i , w2i , · · · , wni )T ∈ Rn is the ingoing weight vector of the i-th hidden node, g(·) : R1 → R1 is a given activation function, and bi is the bias ofthe i-th hidden node. N Let xj , tj j=1 ⊂ Rn × Rm be a given sample set, where tj is the ideal output for the input xj . The corresponding network outputs are yj = L X βi g(wi · xj + bi ), j = 1, 2, · · · , N. (2) i=1 The aim of ELM learning is to build up the network such that yj − tj = 0, or equivalent, to find wi , bi and βi such that L X βi g(wi · xj + bi ) = tj , j = 1, 2, · · · , N. (3) i=1 The N equations in (3) can be written compactly as: Hβ = T, A. A brief review of ELM ELM is a kind of single-hidden-layer feedforward neural network proposed by Huang et al. in [5], [6], [7]. The key idea of ELM is to randomly generate the input-hidden weights and biases instead of tuning them iteratively, which speed up the learning process intensively and transform the original nonlinear problem into a linear problem. To elaborate, let us consider a feedforward neural network with n input nodes, L hidden nodes and m output nodes as shown in Fig. 2. An input vector x ∈ Rn is first converted (1) (4) Here,  g(w1 · x1 + b1 )  .. H= . ···  g(wL · x1 + bL )  ..  . ··· g(w1 · xN + b1 ) · · · g(wL · xN + bL )  T β1   β =  ...  , βLT L×m , (5) N ×L (6) 3  tT1   T =  ...   tTN . (7) L×m In ELM, the parameters wi and bi (i = 1, 2, · · · , L) are randomly generated rather than iteratively learned. Thus, the original nonlinear system is transformed into the linear system (4), which can be approximately solved by the usual leastsquare method: β̂ = H† T, (8) where H† is the Moore-Penrose generalized inverse of matrix H [25]:  T H HHT )−1 , if N ≤ L H† = (9) HT H)−1 H, if N > L. B. ELM-LC (ELM with local connections) The proposed ELM with local connections (ELM-LC) is described below. To choose the number of hidden nodes for each data set, we perform ELM with different numbers of hidden nodes, and then choose the number of hidden nodes that achieves the smallest training error. The corresponding ELM-LC will then use the same number of hidden nodes. A. Regression problem The following formula is used for generating the two artificial data sets: y = f (x) + σ · ε, where x is a d-dimensional vector; f (x) is an Rd → R1 function; and ε is a standard Gaussian noise added into the model to better test the generalization performance, which is independent of x with noise level σ = 0.5. The two regression functions used for our simulations are defined respectively as follows. Algorithm 1 : ELM-LC N Input. Input a given sample set xj , tj j=1 ⊂ Rn × Rm , the hidden node number L, and the group number k. L should be large enough so as to satisfy the condition for the Grouping below. Grouping. Divide the n input nodes roughly equally into k groups, and similarly divide the L hidden nodes into corresponding k groups, such that each hidden node group contains at least one more node than its corresponding input group. Random input-hidden weights. Fully connect each input node group with its corresponding hidden node group by using randomly chosen weights, and the input node group has no connection with other hidden node group. Computing of hidden-output weights. Perform least square learning to compute the hidden-output weights as in the usual ELM. Output. Output the input-hidden and hidden-output weights.  Remark. We give a remark about the number of the inputhidden weights. For both ELM and ELM-LC, there are n input nodes and L hidden nodes. Obviously, the number of the inputhidden weights of ELM is nL. For ELM-LC, the input nodes and hidden nodes are divided into k groups. When the nodes are equally divided, the number of the input-hidden weights of ELM-LC is nL k . III. N UMERICAL SIMULATION Two artificial data sets and a UCI data set Facebook are used in our numerical simulation for regression problems. For classification problems, we use three UCI data sets: Forest Types, Biodegradation, and Ionosphere. The usual Sigmoid function is used as the activation function for the hidden layer nodes. Our proposed ELM-LC is compared with the standard ELM. Each algorithm is run for ten trials for each data set. (10) Function I : d = 12, f (x) = f (x1 , x2 , · · · , x12 ) = 12 X xi · sin(x2i ), i=1 and d = 15, Function II : f (x) = f (x1 , x2 , · · · , x15 ) = 15 X xi + (−1)i ln(x2i ). i=1 For each function, 800 training samples are generated, where the input x of each sample is uniformly distributed on [−2, 2]d, and its corresponding output y is obtained by (10). 200 test samples are generated similarly. The experiments are also performed on a real world regression data set Facebook [26]. This data set is composed of 40949 training examples and 10044 test examples with 53 attributes and one target variable. For Function I, the ELM has 12 input nodes and 32 hidden nodes, and the input and hidden nodes respectively are equally divided into 4 groups for ELM-LC. Similarly, the ELM for Function II has 15 input nodes and 30 hidden nodes, which are divided into 5 groups for ELM-LC. And the ELM for the Facebook data set has 53 input nodes and 74 hidden nodes, which are divided into 9 groups for ELM-LC. The training and test errors are shown in Tables I and II, where the mean, maximal and minimal values of the errors over the training or test samples are presented. We can see that the errors of ELM-LC are smaller than those of the standard ELM on the three data sets. The Table III shows the number of the input-hidden weights of ELM and ELM-LC. It can be seen that the number of the input-hidden weights of ELM-LC is much smaller than that of ELM. 4 TABLE I C OMPARISON RESULTS OF TRAINING ERROR . Mean ELM-LC ELM Function I Max Min 0.0423 0.0892 0.0533 0.1000 0.0283 0.0835 Mean 1.5171 2.1276 Function II Max Min 1.7466 2.8241 1.3100 1.8229 Mean Fackbook Max 0.0884 0.1059 0.0898 0.1153 Mean Facebook Max 0.0404 0.0786 0.0619 0.1282 Min 0.0864 0.1005 TABLE II C OMPARISON RESULTS OF T EST ERROR . Mean ELM-LC ELM Function I Max Min 0.0486 0.1017 0.0652 0.1139 0.0413 0.0871 Mean 1.5568 2.2835 TABLE III N UMBER OF INPUT- HIDDEN WEIGHTS OF ELM AND ELM-LC FOR REGRESSION PROBLEMS . Function I Function II Facebook 96 384 90 450 434 3922 ELM-LC ELM TABLE IV D ESCRIPTION OF THE DATA SETS Name Features Classes Forest Types Biodegradation Ionosphere 27 41 34 d, h, s, and o RB and NRB Good and Bad Size Training Test 325 837 250 198 218 101 B. Classification problem The first data set for classification problem is the Forest Types data set [27]. Each datum has 27 attributes indicating certain characteristics of the forest types. The data are divided into four classes: ‘s’ (‘Sugi’ forest), ‘h’ (‘Hinoki’ forest), ‘d’ (‘Mixed deciduous’ forest) and ‘o’ (‘Other’ non-forest land). The second data set is the Biodegradation data set [28] with 41 molecular descriptors and two classes: ready biodegradable (RB) and not ready biodegradable (NRB). The third one is the Ionosphere data set [29] with 34 attributes and two classes: ‘Good’ returns and ‘Bad’ returns. More detailed information of these data sets is given in Table IV. For the Forest Types data, the ELM has 27 input nodes and 36 hidden nodes, and these input and hidden nodes respectively are equally divided into 9 groups for ELM-LC. Similarly, for the Biodegradation data, there are 41 input nodes and 101 hidden nodes, which are roughly equally divided into 10 groups; And the Ionosphere data has 34 input nodes and 51 hidden nodes, which are equally divided into 17 groups. The results of training and test accuracies are shown in Tables V and VI. We can see that ELM-LC achieves better training and test accuracies than the usual ELM on the three data sets. From Table VII, it can be seen that the number of the input-hidden weights of ELM-LC is much smaller than that of ELM. Function II Max Min 1.8262 2.7076 1.1891 1.8201 Min 0.0332 0.0425 IV. C ONCLUSION In this paper, we propose an ELM with local connections (ELM-LC). Its input and hidden nodes are divided into corresponding groups, and each input node group is fully connected with its corresponding hidden node group but is not connected with other hidden node groups. Hence, ELM-LC has sparse input-hidden weights compared with the usual fully connected ELM. As in the usual fully connected ELM, the input-hidden weights are randomly chosen rather than iteratively learned, and the hidden-output weights are obtained through a least square learning. ELM-LC is designed for the so called HDNI data, which has comparatively high dimensional input data but, not like the image data etc., each component of the input data represents a specific attribute. Numerical simulations on two artificial data sets and four real world UCI data sets show that ELM-LC achieves better learning and test (generalization) accuracies than the usual fully connected ELM with the same number of hidden nodes. ACKNOWLEDGMENT This research was supported by the National Science Foundation of China (NO: 61473059, 61403056) and the Fundamental Research Funds for the Central Universities of China. R EFERENCES [1] S. Haykin, “Neural networks: a comprehensive foundation,” Prentice Hall PTR, 1994. [2] J. M. Zurada, “Introduction to artificial neural systems,” West publishing company, St. Paul, 1992. [3] D. E. Rumelhart, G. E. Hinton, and R. J. Williams, “Learning representations by back-propagation errors,” Nature, vol. 323, no. 6088, pp. 533-536, 1986, doi: 10.1038/323533a0. [4] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R.E. Howard, W. Hubbard, and L. D. Jackel, “Backpropagation applied to handwritten zip code recognition,” Neural Comput., vol. 1, no. 4, pp. 541-551, 1989, doi: 10.1162/neco.1989.1.4.541 . [5] G. B. Huang, Q. Y. Zhu, and C. K. Siew, “Extreme learning machine: theory and applications,” Neurocomputing, vol. 70, no. 1, pp. 489-501, 2006, doi: 10.1016/j.neucom.2005.12.126. [6] G. B. Huang, D. H. Wang, and Y. Lan, “Extreme learning machines: a survey,” Int. J. Mach. Learn. Cybern., vol. 2, no. 2, pp. 107-122, 2011, doi: 10.1007/s13042-011-0019-y. [7] J. Tang, C. Deng, and G. B. Huang, “Extreme learning machine for multilayer perceptron,” IEEE Trans. Neural Netw. Learn. Syst., vol. 27, no. 4, pp. 809-821, 2016, doi: 10.1109/TNNLS.2015.2424995. [8] G. B. Huang, and L. Chen, “Enhanced random search based incremental extreme learning machine,” Neurocomputing, vol. 71, no. 16, pp. 34603468, 2008, doi: 10.1016/j.neucom.2007.10.008. 5 TABLE V C OMPARISON OF TRAINING ACCURACY Mean ELM-LC ELM 90.18 86.06 Forest Types Max Min 91.38 88.62 88.92 82.77 Biodegradation Mean Max Min Mean 89.00 87.96 92.75 90.08 89.96 89.13 88.05 87.10 Ionosphere Max Min 94.00 92.00 91.60 88.00 TABLE VI C OMPARISON OF TEST ACCURACY Mean ELM-LC ELM 90.55 85.56 Forest Types Max Min 91.92 88.89 89.39 82.83 Biodegradation Mean Max Min Mean 83.76 82.47 97.03 96.73 85.32 83.49 82.11 80.28 Ionosphere Max Min 99.01 98.02 96.04 95.05 TABLE VII N UMBER OF INPUT- HIDDEN WEIGHTS OF ELM AND ELM-LC FOR CLASSIFICATION PROBLEMS . ELM-LC ELM Forest Types Biodegradation Ionosphere 108 972 415 4141 102 1734 [9] W. Wu, Q. W. Fan, and J. M. Zurada et al., “Batch gradient method with smoothing L1/2 regularization for training of feedforward neural networks,” Neural Netw., vol. 50, pp. 72-78, 2014, doi: 10.1016/j.neunet.2013.11.006. [10] Q. W. Fan, J. M. Zurada, and W. Wu, “Convergence of online gradient method for feedforward neural networks with smoothing L1/2 regularization penalty,” Neurocomputing, vol. 131, pp. 208-216, 2014, doi: 10.1016/j.neucom.2013.10.023. [11] G. B. Huang, Z. Bai, L. L. C. Kasun, and C. M. Vong, “Local receptive fields based extreme learning machine,” IEEE Comput. Intell. Mag., vol. 10, no. 2, pp. 18-29, 2015, doi: 10.1109/MCI.2015.2405316. [12] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” In Advances in neural information processing systems, pp. 1097-1105, 2012. [13] K. Kavukcuoglu, P. Sermanet, Y.L. Boureau, K. Gregor, M. Mathieu, and Y. LeCun, “Learning convolutional feature hierarchies for visual recognition,” In Advances in neural information processing systems, pp. 1090-1098, 2010. [14] T. Pfister, K. Simonyan, J. Charles, and A. Zisserman, “Deep convolutional neural networks for efficient pose estimation in gesture videos,” In Asian Conference on Computer Vision, pp. 538-552, 2014. [15] J. Li, X. Mei, D. Prokhorov, and D. Tao, “Deep neural network for structural prediction and lane detection in traffic scene,” IEEE Trans. Neural Netw. Learn. Syst., vol. 28, no. 3, pp. 690-703, 2017, doi: 10.1109/TNNLS.2016.2522428. [16] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proc. IEEE, vol. 86, no. 11, pp. 22782324, 1998, doi: 10.1109/5.726791. [17] S. A. Eslami, N. Heess, C. K. Williams, and J. Winn, “The shape boltzmann machine: a strong model of object shape,” Int. J. Comput. Vis., vol. 107, no. 2, pp. 155-176, 2014, doi: 10.1007/s11263-013-0669-1. [18] D. Turcsany, A. Bargiela, and T. Maul, “Local receptive field constrained deep networks,” Inform. Sciences, vol. 349, pp. 229-247, 2016, doi: 10.1016/j.ins.2016.02.034. [19] D. H. Hubel, and T. N. Wiesel, “Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex,” The Journal of physiology, vol. 160, no. 1, pp. 106-154, 1962, doi: 10.1113/jphysiol.1962.sp006837. [20] Z. Bai, L. L. C. Kasun, and G. B. Huang, “Generic object recognition with local receptive fields based extreme learning machine,” Procedia Computer Science, vol. 53, pp. 391-399, 2015, doi: 10.1016/j.procs.2015.07.316. [21] Q. Lv, X. Niu, Y. Dou, J. Xu, and Y. Lei, “Classification of hyperspectral remote sensing image using hierarchical local-receptive-field-based extreme learning machine,” IEEE Geosci. Remote Sens. Lett., vol. 13, no. 3, pp. 434-438, 2016, doi: 10.1109/LGRS.2016.2517178. [22] Y. Wang, Z. Xie, K. Xu, Y. Dou, and Y. Lei, “An efficient and effective convolutional auto-encoder extreme learning machine network for 3d feature learning,” Neurocomputing, vol. 174, pp. 988-998, 2016, doi: 10.1016/j.neucom.2015.10.035. [23] J. Huang, Z. L. Yu, Z. Cai, Z. Gu, Z. Cai, W. Gao, and Q. Du, “Extreme learning machine with multi-scale local receptive fields for texture classification,” Multidimens. Syst. Signal Process., vol. 28, no. 3, pp. 995-1011, 2017, doi: 10.1007/s11045-016-0414-3. [24] F. Li, H. Liu, X. Xu, and F. Sun, “Multi-Modal Local Receptive Field Extreme Learning Machine for object recognition,” In IEEE International Joint Conference on Neural Networks (IJCNN), pp. 1696-1701, 2016. [25] A. Ben-Israel, and T. N. Greville, “Generalized inverses: theory and applications,” Springer Science & Business Media, 2003. [26] K. Singh, R. K. Sandhu, and D. Kumar, “Comment volume prediction using neural networks and decision trees,” In IEEE UKSim-AMSS 17th International Conference on Computer Modelling and Simulation, 2015. [27] B. Johnson, R. Tateishi, and Z. Xie, “Using geographically-weighted variables for image classification,” Remote Sens. Lett., vol. 3, no. 6, pp. 491-499, 2012, doi: 10.1080/01431161.2011.629637. [28] K. Mansouri, T. Ringsted, D. Ballabio, R. Todeschini, and V. Consonni, “Quantitative structureCactivity relationship models for ready biodegradability of chemicals,” J. Chem Inf. Model., vol. 53, no. 4, pp. 867-878, 2013, doi: 10.1021/ci4000213. [29] M. Lichman, “UCI Machine Learning Repository. Irvine,” CA: University of California, School of Information and Computer Science, 2013.
2cs.AI
Spatial Adaptation in Trend Filtering Adityanand Guntuboyina∗ , Donovan Lieu, Sabyasachi Chatterjee, and Bodhisattva Sen† arXiv:1702.05113v1 [math.ST] 16 Feb 2017 423 Evans Hall Berkeley, CA 94720 e-mail: [email protected] 367 Evans Hall Berkeley, CA 94720 e-mail: [email protected] 5734 S. University Avenue Chicago, IL 60637 e-mail: [email protected] 1255 Amsterdam Avenue New York, NY 10027 e-mail: [email protected] Abstract: We study trend filtering, a relatively recent method for univariate nonparametric regression. For a given integer r ≥ 1, the rth order trend filtering estimator is defined as the minimizer of the sum of squared errors when we constrain (or penalize) the sum of the absolute rth order discrete derivatives over the input points. For r = 1, the estimator reduces to total variation regularization which has received much attention in the statistics and image processing literature. In this paper, we study the performance of the trend filtering estimator for every r ≥ 1, both in the constrained and penalized forms. Our main results show that the estimator is optimally spatially adaptive. Specifically, we prove that, in spite of being a nonparametric estimator, when the underlying function is a (discrete) spline with few “knots”, the risk (under the global squared error loss) of the trend filtering estimator (with an appropriate choice of the tuning parameter) achieves the parametric n−1 -rate, up to a logarithmic (multiplicative) factor. Our results also include high probability statements on the loss and are stated in sharp oracle form, i.e., our results apply to misspecification and have leading constant one for the misspecified term. Moreover, some of the metric entropy results used in this paper, derived using connections to fat shattering, are of independent interest. Keywords and phrases: Adaptive splines, discrete splines, fat shattering, higher order total variation regularization, metric entropy bounds, nonparametric function estimation, risk bounds, subdifferential, tangent cone. ∗ † Supported by NSF Grant DMS-1309356 Supported by NSF Grant DMS-1150435 1 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 2 1. Introduction Consider the nonparametric regression problem where we observe data generated according to the model: Yi = f ∗ (i/n) + ξi , i = 1, . . . , n, (1) where f ∗ : [0, 1] → R is the unknown regression function, and ξ1 , . . . , ξn are unobserved independent errors having the normal distribution with mean zero and variance σ 2 . The goal is to recover the underlying function f ∗ from measurements Y1 , . . . , Yn . Alternatively, in the Gaussian sequence formulation, (1) can be expressed as Y = θ∗ + ξ, (2) where ξ ∼ Nn (0, σ 2 In ), and θ∗ := (f ∗ (1/n), f ∗ (2/n), . . . , f ∗ (1)) is unknown. Here Nn (0, σ 2 In ) denotes the multivariate normal distribution with mean vector zero and covariance matrix σ 2 In . In this paper, we study the performance of trend filtering, a relatively new method for nonparametric regression with special emphasis on its spatial adaptation properties. For a given integer r ≥ 1, the rth order trend filtering estimator is defined as the minimizer of the sum of squared errors when we constrain or penalize the sum of the absolute rth order discrete derivatives over the input points. Formally, given a fixed integer r ≥ 1 and a tuning parameter V ≥ 0, the rth order trend filtering estimator for θ∗ in the constrained form is given by   1 (r) 2 (r) 1−r kY − θk : kD θk1 ≤ V n (3) θ̂V := argmin 2 θ∈Rn where V > 0 is a tuning parameter (the multiplicative factor n1−r is just for normalization), D(0) θ := θ, D(1) θ := (θ2 − θ1 , . . . , θn − θn−1 ) and D(r) θ, for r ≥ 2, is recursively (r) (1) (r−1) defined as θ). Also k · k1 denotes the usual L1 norm defined by PkD θ := D (D kxk1 := i=1 |xi | for x = (x1 , . . . , xk ) ∈ Rk . Note that kD(r) θk1 also equals V (D(r−1) θ) P where V (α) := ki=2 |αi − αi−1 | denotes the variation of a vector α = (α1 , . . . , αk ) ∈ Rk . For simplicity, we denote the operator D(1) by simply D. Alternatively, the trend filtering estimator in the penalized form is defined as   1 (r) 2 r−1 (r) θ̂λ := argmin kY − θk + σn λkD θk1 2 θ∈Rn (4) for r ≥ 1 and tuning parameter λ ≥ 0. There is an abuse of notation here in that we are using the same notation for both the constrained and the penalized estimators. It may be noted, however, that when the subscript of θ̂(r) is V , we are referring to the constrained estimator (3) while when the subscript is λ, we are referring to the penalized estimator (4). For r = 1, (4) reduces to the one-dimensional discrete version of total variation regularization which was first proposed by Rudin et al. [32] and has since been heavily used imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 3 in the image processing community. The penalized estimator (4), for general r ≥ 1, was first proposed by Steidl et al. [34] in the image processing literature who termed it higher order total variation regularization. The same estimator was later rediscovered by Kim et al. [19] who coined the name trend filtering for it. Many properties of the estimator have been studied in Tibshirani [35]. It should also be mentioned here that a continuous version of (4), where the discrete differences are replaced by continuous derivatives, was proposed much earlier in the statistics literature by Mammen and van de Geer [25] under the name locally adaptive regression splines. The presence of the L1 norm in the constraint in (3) (resp. penalty in (4)) ensures sparsity (r) (r) (r) of the vector D(r) θ̂V (resp. D(r) θ̂λ ). This sparsity, in turn, implies that the vector θ̂V (r) (resp. θ̂λ ) is given by (f (1/n), . . . , f (n/n)) for a function f that is a discrete spline of degree r − 1 (see e.g., Steidl et al. [34]). Discrete splines are piecewise polynomials with regularity at the knots. They differ from the usual (continuous) splines in the form of the regularity condition at the knots: for splines, the regularity condition translates to derivatives of adjacent polynomials agreeing at the knots while for discrete splines, the regularity condition translates to discrete differences of adjacent polynomials agreeing at the knots; see Mangasarian and Schumaker [26] for details. We also refer the reader to Tibshirani [35] and Wang et al. [39] for detailed studies of the properties of trend filtering estimators including continuous time representations. The use of the trend filtering estimators in practical applications mainly stems from the fact that they present a way of fitting (discrete) splines to data where the knots are chosen automatically and without any input from the user (except for the value of the tuning parameter V or λ). Because of the automatic selection of the knots, trend filtering can be regarded as a spatially adaptive method. Note that such spatial adaptation is not exhibited by the (well-known) classical nonparametric regression methods such as local polynomials, kernels and splines, with a fixed tuning parameter. It is therefore natural to ask if trend filtering has any optimality properties as a spatially adaptive technique. The goal of this paper is to perform a theoretical study of the spatial adaptation properties of trend filtering. We would like to mention here that theoretical analysis of spatially adaptive nonparametric regression methods is hard. Indeed there have been many spatially adaptive estimators proposed in the statistical literature in the last 30 years (and more), including CART (Breiman et al. [3]), MARS (Friedman [11]), variable-bandwidth kernel/spline methods (see e.g., Brockmann et al. [4], Müller and Stadtmüller [27], Pintore et al. [29] and Zhou and Shen [40]) and wavelets (Donoho and Johnstone [8]). However, as far as we are aware, only a few results exist that rigorously establish the optimality of these spatially adaptive estimators; notable exceptions include wavelets (see e.g., Donoho and Johnstone [8]) and variable-bandwidth kernel methods (see e.g., Lepski et al. [22] and Goldenshluger and Nemirovski [13]). Moreover, the analysis of trend filtering estimators is more involved compared to estimators based on wavelets and variable-bandwidth kernels because the trend filtering estimators are given by the output of an optimization algorithm and have no closed form expressions. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 4 Borrowing from the framework of Donoho and Johnstone [8], we study optimality of trend filtering under the usual squared error loss and prove that trend filtering is optimally spatially adaptive when estimating (discrete) splines. The risk of an estimator θ̂ for θ∗ under the squared error loss function is defined by R(θ̂, θ∗ ) := 1 Eθ∗ kθ̂ − θ∗ k2 n where k·k denotes the usual Euclidean norm on Rn . We shall provide upper bounds on the (r) (r) risks R(θ̂V , θ∗ ) and R(θ̂λ , θ∗ ) as well as high probability upper bounds on the random (r) (r) loss functions kθ̂V − θ∗ k2 /n and kθ̂λ − θ∗ k2 /n. Suppose that the true vector θ∗ has the property that the vector D(r) θ∗ has k non-zero entries, i.e., kD(r) θ∗ k0 = k (formally kxk0 is defined as the number of entries of the vector x that are non-zero). It then follows that θ∗ is given by a piecewise polynomial made of k + 1 polynomials each of degree (r − 1). Given data Y ∼ Nn (θ∗ , σ 2 In ), an ideal (oracle) spatial method would put knots corresponding to θ∗ and then fit a polynomial of degree (r − 1) in each of the partitions given by the knots. Such an ideal estimator will have risk (under the squared error loss function) bounded by Kr σ 2 (k + 1)/n for a constant Kr depending only on r. This motivates the following question which is the focus of this (r) paper: When kD(r) θ∗ k0 = k, how do the risks of the trend filtering estimators θ̂V and (r) θ̂λ compare with the oracle risk of σ 2 (k + 1)/n? The main results of this paper for constrained trend filtering estimators (Theorem 2.2 (r) and Corollary 2.4) imply that when kD(r) θ∗ k0 = k, the risk of θ̂V satisfies (r) R(θ̂V , θ∗ ) ≤ Cr (c)σ 2 en k+1 log , n k+1 provided (i) the tuning parameter V is chosen to be close to V ∗ := nr−1 kD(r) θ∗ k1 , and (ii) each of the polynomial pieces of θ∗ have length bounded below by cn/(k + 1) for a positive constant c (in fact, our result requires a weaker version of this condition; see (12) and Remark 2.2). Here Cr (c) is a positive constant that depends only on r and the constant c from the second assumption above. The implication of this result is that, under the natural minimum length condition on θ∗ described in the second assumption above, if the tuning parameter V is properly chosen, the constrained trend filtering estimator has risk that is suboptimal only by a factor log(en/(k + 1)) compared to the oracle risk (ignoring multiplicative constants). Further, minimax results suggest that this additional logarithmic factor cannot be removed; see e.g., [18, Chapter 13]. This demonstrates that trend filtering is optimally spatially adapting to discrete splines. We shall also argue that the minimum length condition cannot be completely removed. This idea of using oracle risks to prove spatial adaptation goes imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 5 back to Donoho and Johnstone [8] who used it to establish spatial adaptation of wavelet shrinkage methods to piecewise polynomials. Our results are actually stronger compared to the adaptation results of Donoho and Johnstone [8] for the case of wavelets; the risk bounds in Donoho and Johnstone [8] had additional logarithmic factors. We also prove results for the penalized trend filtering estimators. Here we prove (see (1) Theorem 2.5) that, for r = 1, when kD(1) θ∗ k0 = k, the risk of θ̂λ is bounded from above by en log k+1 provided the minimum length condition holds and the tuning parameter C(c)σ 2 k+1 n λ is chosen appropriately. For r ≥ 2, we prove in Theorem 2.6 that, when kD(r) θ∗ k0 = k, 2r (r) en the risk of θ̂λ is bounded from above by Cr (c)σ 2 (k+1) log k+1 + Cr (c)σ 2 (k+1) under the n n same conditions (optimal choice of λ and the minimum length condition) as before. We would like to mention here that our results also include high probability statements (r) (r) on the loss kθ̂V − θ∗ k2 /n (or kθ̂λ − θ∗ k2 /n) in addition to risk bounds. We also state all our results in sharp oracle form, i.e., our results apply to misspecification and have leading constant one for the misspecified term (see Bellec [2] for background on sharp oracle inequalities under misspecification). All previous adaptation results for trend filtering only applied to the case r = 1 (total variation regularization) and to the best of our knowledge, our result is the first to deal with arbitrary r ≥ 1. In fact, even for r = 2 such adaptation results “are not currently available” although conjectures do; see Remark 21 of Lin et al. [24]. Furthermore, for r = 1, previous results, which dealt only with the penalized form of the estimator as opposed to the constrained form (Dalalyan et al. [6], Lin et al. [24]) had additional factors involving n and k in their risk bounds; see Remark 2.4 in Section 2 for a precise comparison of our result with existing ones. Our rationale for also studying the constrained form of the estimator is that the constrained estimator has smaller risk compared to the penalized estimator in some situations. For example, the following result (due to Oymak and Hassibi [28]) states that for every θ∗ , lim σ↓0 1 1 (r) (r) inf R(θ̂V , θ∗ ) ≤ lim 2 inf R(θ̂λ , θ∗ ). 2 σ↓0 σ λ σ V (5) The above result shows that, in the low σ limit, the ideal constrained estimator has smaller risk and hence is a better estimator compared to the ideal penalized estimator. We would like to mention here that there exists another strand of theoretical optimality results for trend filtering (established in Mammen and van de Geer [25] and Tibshirani (r) [35]) which prove that the risk of the penalized trend filtering estimator θ̂λ is bounded by a constant multiple of n−2r/(2r+1) for an appropriate choice of λ under a boundedness condition on kD(r) θ∗ k1 . These results are often referred to as slow rates because they are slower than the parametric rate n−1 (even though they are still minimax under the assumed condition on θ∗ ). In this paper, we also provide a version of these results for (r) the constrained trend filtering estimator θ̂V (see Theorem 2.1). It should be observed that these slow-rate results do not imply spatial adaptation because they do not use any sparsity constraint on D(r) θ∗ . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 6 Let us now briefly describe the techniques and ideas underlying the proofs of the results (r) in the paper. For studying the constrained trend filtering estimator θ̂V , we follow general results on the accuracy of constrained least squares estimators, see e.g., Bellec [2], Oymak (r) and Hassibi [28], according to which risk bounds of θ̂V can be obtained by controlling the Gaussian width of the tangent cone of the convex set  (6) K (r) (V ) := θ ∈ Rn : kD(r) θk1 ≤ V n1−r at θ∗ . The notion of tangent cones is recalled in (37). Also for a set T ⊆ Rn , we refer to E supα∈T :kαk≤1 hZ, αi as the Gaussian width of T where Z ∼ Nn (0, In ) is a standard n-dimensional Gaussian vector. We shall alternatively refer to the Gaussian width of T as the expected Gaussian supremum taken over the set T . We provide a precise characterization of the tangent cones of K (r) (V ) in Lemma 4.1. These tangent cones have a complicated structure (especially for r ≥ 2) that makes calculating their Gaussian widths non-trivial. Our idea behind these calculations is the observation that, under a unit norm constraint, every vector α belonging to the tangent cone of K (r) (V ) at θ∗ is nearly made up of two (r − 1)th order convex/concave sequences in each polynomial part of θ∗ ; as proved in our Lemma 3.2. A sequence θ ∈ Rn is said to be (r − 1)th order convex/concave if the vector D(r−1) θ is monotone (see Kuczma [20]). This observation allows us to compute the expected Gaussian suprema over these tangent cones using metric entropy results (which we establish via connections between metric entropy and fat shattering; Rudelson and Vershynin [31]) and also available results (from Bellec [2]) on the Gaussian widths of shape constrained cones. Note that the set of all (r−1)th order convex sequences in Rn forms a convex cone in Rn and these cones have been studied in the literature on shape constrained estimation. Our main expected Gaussian suprema result (Lemma 4.3) and our metric entropy results (stated in Subsection 4.4) are also of independent interest. The results for the penalized estimator are based on a precise characterization of the subdifferential of the penalty function θ 7→ kD(r) θk1 (see Proposition 4.4). This subdifferential is complicated especially for r ≥ 2. However it turns out that the penalty function is such that it is possible to relate risk properties of the penalized estimator to the constrained estimator (we use ideas from Foygel and Mackey [10] for this) and thus we derive risk results for the penalized trend filtering estimator as a corollary to our results for the constrained estimator. The rest of this paper is organized as follows. Our main results are described in Section 2: Subsection 2.1 deals with the constrained estimator while Subsection 2.2 is about the penalized estimator. The proofs for the main results are given in Section 3. Our proofs use several intermediate results about various things such as tangent cone characterizations of the constraint sets, Gaussian width calculations, subdifferential characterizations of the penalty functions and metric entropy results. Some of these intermediate results might themselves be of independent interest and we highlight these in Section 4. The paper has an Appendix which consists of two sections: Section A contains proofs of the key technical imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 7 supporting results of the paper and Section B contains additional technical results and proofs. 2. Main Results Throughout Cr will denote a positive constant that depends on r alone although its precise value will change from equation to equation. We shall assume that n ≥ 2r throughout the paper (many of our results also hold under the weaker condition n ≥ r + 1). Also ξ will denote a vector having the Nn (0, σ 2 In ) distribution while Z will denote a vector having the Nn (0, In ) distribution. 2.1. Results for the Constrained Estimator (r) Let us start by stating our slow rate bound of n−2r/(2r+1) for risk of the estimator θ̂V under the condition that the tuning parameter V satisfies kD(r) θ∗ k1 ≤ V n1−r . This slow rate result is similar to results in Mammen and van de Geer [25] and Tibshirani [35]; the only difference being that our theorem below applies to the constrained form of trend filtering. We also explicitly write down the dependence of the bound on V and σ. Theorem 2.1. Fix r ≥ 1. Suppose that the tuning parameter V is chosen so that nr−1 kD(r) θ∗ k1 ≤ V . Then there exists a positive constant Cr depending on r alone such that !  2 1/r 2r/(2r+1) 2 σ σ V (r) , log(en) . (7) R(θ̂V , θ∗ ) ≤ Cr max n n Also for every x > 0, we have 1 (r) kθ̂ − θ∗ k2 ≤ Cr max n V  σ 2 V 1/r n 2r/(2r+1) σ2 log(en) , n ! + 4σ 2 x n (8) with probability at least 1 − e−x . Remark 2.1. It is known that the rate n−2r/(2r+1) is the minimax rate of convergence over the class of θ ∈ Rn with kD(r) θk1 ≤ V n1−r (see e.g., Donoho and Johnstone [7]). This means that the constrained trend filtering estimator with tuning parameter V is minimax optimal over {θ ∈ Rn : kD(r) θk1 ≤ V n1−r }. This result was known previously for the penalized estimator; see Tibshirani [35]. Before we state our main spatial adaptation result, we need to introduce some notation. Fix an integer r ≥ 1 and let n ≥ r + 1. For a vector θ ∈ Rn and an index 2 ≤ j ≤ n − r + 1, we say that j is an rth order knot (or knot of order r) of θ provided (D(r−1) θ)j−1 6= (D(r−1) θ)j . Note that first order knots are just jumps and second order knots are points imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 8 of change of slope. We also say that an rth order knot j has sign +1 if (D(r−1) θ)j−1 < (D(r−1) θ)j and sign −1 if (D(r−1) θ)j−1 > (D(r−1) θ)j . For θ ∈ Rn , we let kr (θ) := kD(r) θk0 and V (r) (θ) := nr−1 kD(r) θk1 . (9) When r = 1, note that V (1) (θ) = kDθk1 = |θ2 − θ1 | + · · · + |θn − θn−1 | which is simply the variation of θ. We therefore simply denote V (1) (θ) by V (θ). It also follows then that V (r) (θ) = nr−1 V (D(r−1) θ). It may be observed that kr (θ) equals precisely the number of rth order knots of θ. Also, note that as D(r) θ is a vector of length n − r, we necessarily have kr (θ) = kD(r) θk0 ≤ n − r ≤ n − 1. Suppose kr (θ) = k and let 2 ≤ j1 < · · · < jk ≤ n − r + 1 denote all the rth order knots of θ with associated signs r1 , . . . , rk ∈ {−1, 1}. Also let r0 = rk+1 = 0. Further, let n0 :=P j1 + r − 2, ni := ji+1 − ji for 1 ≤ i ≤ k − 1 and nk := n − r + 2 − jk and observe that ki=0 ni = n. Finally, let   n ni∗ := min ni , for i = 0, 1, . . . , k. k+1 We now define two quantities δr (θ) and ∆r (θ) in the following way: !1/2 k−1 X 1−2r 1−2r δr (θ) := n1−2r + nk∗ + ni∗ I{ri 6= ri+1 } 0∗ (10) i=1 and   2r−1 1/r en δr2 (θ) δr (θ) n en k+1 log + + √ log (11) ∆r (θ) := n k+1 n k+1 k+1 n where, in the definition of δr (θ), the quantity I{ri 6= ri+1 } denotes the indicator variable that equals 1 if ri 6= ri+1 and 0 if ri = ri+1 . Note that trivially ∆r (θ) ≥ (k + 1)/n ≥ 1/n. (r) Our results will show that the risk of the estimator θ̂V for θ∗ will essentially be controlled by ∆r (θ∗ ). The key point to note about ∆r (θ) is the fact (easy to check) that when cn (12) min ni ≥ 0≤i≤k:ri 6=ri+1 k+1 for a positive constant c ≤ 1 (here r1 , . . . , rk ∈ {−1, 1} are the signs of the rth order knots of θ while r0 and rk+1 are taken to be zero), then  1−2r cn 2 δr (θ) ≤ (k + 1) k+1 and consequently  k+1 k+1 en ∆r (θ) ≤ 1 + c1−2r log + c(1−2r)/(2r) n k+1 n  k + 1 en ≤ 1 + c1−2r + c(1−2r)/(2r) log . n k+1 (13) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 9 We say that θ satisfies the minimum length condition with constant c if condition (12) holds. We have just observed that when θ satisfies the minimum length condition with en constant c then ∆r (θ) ≤ Cr (c) k+1 log k+1 for a constant Cr (c) depending only on c and r. n The following is the main result of the paper for the constrained trend filtering estimator. (r) Theorem 2.2. Fix r ≥ 1 and n ≥ 2r. Consider the estimator θ̂V defined in (3) with tuning parameter V ≥ 0. Then for every θ∗ ∈ Rn , we have   1 ∗ (r) ∗ 2 2 kθ − θk + Cr σ ∆r (θ) (14) R(θ̂V , θ ) ≤ inf n θ∈Rn :V (r) (θ)=V for a positive constant Cr , depending only on r. Also for every x > 0, we have   1 (r) 1 ∗ 4σ 2 x ∗ 2 2 2 kθ̂V − θ k ≤ inf kθ − θk + Cr σ ∆r (θ) + n n n θ∈Rn :V (r) (θ)=V (15) with probability at least 1 − e−x . Theorem 2.2 applies to every θ∗ ∈ Rn and is stated in the sharp oracle form. It implies (r) that the risk of θ̂V for the truth θ∗ is small provided there exists some θ ∈ Rn with V (r) (θ) = V such that (a) kθ − θ∗ k is small, and (b) ∆r (θ) is small. Theorem 2.2 gives the following corollary describes the performance of the best constrained trend filtering estimator (as opposed to the estimator for a fixed tuning parameter V ) again in sharp oracle form. Corollary 2.3. For every θ∗ ∈ Rn , we have   1 ∗ (r) ∗ 2 2 inf R(θ̂V , θ ) ≤ infn kθ − θk + Cr σ ∆r (θ) V ≥0 θ∈R n (16) and for every x > 0, 1 (r) inf kθ̂V − θ∗ k2 ≤ infn V ≥0 n θ∈R   1 ∗ 4σ 2 x 2 2 kθ − θk + Cr σ ∆r (θ) + n n (17) with probability at least 1 − e−x . Theorem 2.2 also yields the following corollary which is a non-oracle inequality and is more readily interpretable. Recall from (13) that ∆r (θ) is bounded from above by a constant en multiple of k+1 log k+1 provided kr (θ) = k and θ satisfies the minimum length condition n (12). (r) Corollary 2.4. Consider the estimator θ̂V with tuning parameter V . Suppose θ∗ satisfies the minimum length condition (12) with constant c, then 2 σ 2 (kr (θ∗ ) + 1) en (r) R(θ̂V , θ∗ ) ≤ V − V (r) (θ∗ ) + Cr (c) log n kr (θ∗ ) + 1 (18) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 10 where Cr (c) is a positive constant that depends on r and c alone. Also, for every x > 0, we have 2 1 (r) σ 2 (kr (θ∗ ) + 1) en 4σ 2 x kθ̂V − θ∗ k2 ≤ V − V (r) (θ∗ ) + Cr (c) log + n n kr (θ∗ ) + 1 n (19) with probability at least 1 − e−x . Further, if V is chosen so that 2 σ 2 (kr (θ∗ ) + 1) en V − V (r) (θ∗ ) ≤ C log n kr (θ∗ ) + 1 for a positive constant C, then we have (r) R(θ̂V , θ∗ ) ≤ Cr (c, C) σ 2 (kr (θ∗ ) + 1) en log n kr (θ∗ ) + 1 (20) for a positive constant Cr (c, C) that depends on r, c and C alone and, for every x > 0, σ 2 (kr (θ∗ ) + 1) en 4σ 2 x 1 (r) kθ̂V − θ∗ k2 ≤ Cr (c, C) log + n n kr (θ∗ ) + 1 n (21) with probability at least 1 − e−x . Corollary 2.4 should be interpreted in the following way. Suppose kr (θ∗ ) = k so that θ∗ is a discrete spline made of k +1 polynomial pieces with each polynomial being of degree r −1. An oracle piecewise polynomial estimator that knows where to put the knots based on θ∗ would therefore achieve a risk of Cr σ 2 k+1 . Corollary 2.4 states that the trend filtering n (r) en estimator θ̂V achieves the same risk up to a multiplicative factor of log k+1 provided (i) (r) ∗ ∗ the tuning parameter V is chosen to be close to V (θ ), and (ii) θ satisfies the minimum length condition (12) with some constant c. We would like to emphasize here that Theorem 2.2 and Corollary 2.4 both apply to every r ≥ 1. On the other hand, existing adaptation results for trend filtering all deal with the case r = 1 (which corresponds to total variation regularization). Even in the case when r = 1, our results are stronger compared to the existing results in the literature (see Remark 2.4 for a precise comparison). Remark 2.2 (On the minimum length condition). We would like to remark here that the minimum length condition (12) required for Corollary 2.4 is weaker than existing minimum length conditions in the literature (this comparison is only for r = 1 because no results exist for r ≥ 2) which are all of the form min ni ≥ 0≤i≤k cn k+1 where k = k1 (θ∗ ). (22) Indeed our condition (12) requires that ni ≥ cn/(k + 1) be true only for those i for which ri 6= ri+1 while (22) requires this for all i. To see why our condition can be substantially imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 11 weaker, consider, for example, the situation when θ∗ is an (r − 1)th order convex/concave sequence i.e., D(r−1) θ∗ is a monotonic vector (for r = 1, this means that θ∗ is itself monotone while for r = 2, this means that θ∗ is convex/concave). In this case, condition (12) is equivalent to requiring that ni ≥ cn/(k + 1) only for i = 0 and i = k which is much weaker than requiring it for all 0 ≤ i ≤ k. Remark 2.3 (The minimum length condition cannot be removed). We shall argue here via simulations that the minimum length condition in Corollary 2.4 cannot be removed. Suppose that θ∗ is given by ∗ =0 θ1∗ = · · · = θn−1 and θn∗ = 5 (23) (1) and consider estimating θ∗ from an observation Y ∼ Nn (θ∗ , In ) (i.e., σ = 1) by θ̂V (i.e., r = 1) with tuning parameter V = V (1) (θ∗ ) = 5. It is clear here that k1 (θ∗ ) = 1. The minimum length condition (12) is not satisfied because n0 = n − 1 and n1 = 1. The (1) risk R(θ̂V , θ∗ ) can be computed via simulation. In Figure 1 (left panel), we have plotted (1) log R(θ̂V , θ∗ ) against log n for values of n between 1000 and 5000 (chosen to be equally spaced on the log-scale). For each value of n, we calculated the risk using 100 Monte Carlo replications. The slope of the least squares line through these points turned out to be close (1) to −2/3 which indicates that the risk R(θ̂V , θ∗ ) decays at the rate n−2/3 . This rate is slower than the rate given by Corollary 2.4 indicating that inequality (18) is not true for this θ∗ . On the other hand, the n−2/3 rate here makes sense in light of Theorem 2.1. Therefore, even though the vector Dθ∗ is sparse (with kDθ∗ k0 = 1), the rate of convergence of θ̂(1) is equal to the slow rate n−2/3 and not the fast rate given by Corollary 2.4. This points to the necessity of the minimum length condition (12). Least Squares Slope is -0.6877 -4.4 -3.0 -2.9 -4.2 -2.8 -2.7 log Risk -3.8 -4.0 log Risk -2.6 -3.6 -2.5 -3.4 -2.4 Least Squares Slope is -0.4084 7.0 7.5 8.0 log n 8.5 7.0 7.5 8.0 8.5 log n (1) Fig 1: Left: plot of log R(θ̂V , θ∗ ) against log n for θ∗ as in (23). The least squares slope is close to −2/3 which suggests that the risk decays as n−2/3 instead of the fast rate given by (2) Corollary 2.4. Right: plot of log R(θ̂V , θ∗ ) against log n for θ∗ defined in (24). The least squares slope is close to −2/5 which suggests that the risk decays as n−2/5 instead of the fast rate given by Corollary 2.4. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 12 Another counterexample for the necessity of (12) for Corollary 2.4 is: ∗ θ1∗ = · · · = θbn/2c =0 and ∗ ∗ θbn/2c+1 = θbn/2c+2 = · · · = θn∗ = 5. (24) (2) Here consider the problem of estimating θ∗ by the estimator θ̂V (i.e., r = 2) with tuning parameter V = V (2) (θ∗ ) = 10n. It is clear that k2 (θ∗ ) = 2, n0 = bn/2c, n1 = 1 and n2 = n − bn/2c − 1. The minimum length condition (12) is not satisfied because n1 is too (2) small. The risk log R(θ̂V , θ∗ ) is plotted against log n in the right panel of Figure 1 (the values of n are chosen as before). The slope of the least squares line here is close to −2/5 which suggests that the risk decays slowly than what is given by Corollary 2.4. Note here that n−2/5 is exactly the rate (slow rate) given by Theorem 2.1 (take r = 2 and V = 10n in (7)). 2.2. Results for the Penalized Estimator (r) In this section, we present risk results for the penalized estimator θ̂λ defined in (4). We first consider the case where r = 1 which corresponds to one-dimensional total variation (r) regularization and is the most studied estimator in the class {θ̂λ , r ≥ 1}. Even though (1) results exist for the risk of θ̂λ , it appears that the following result is stronger than all (1) the existing risk results for θ̂λ (see Remark 2.4 after the next theorem). In the following theorem, ∆1 (θ) and k1 (θ) denote, respectively, the quantities ∆r (θ) (defined in (11)) and kr (θ) (defined in (9)) for r = 1. Theorem 2.5. There exists a universal positive constant C such that   1 ∗ (1) ∗ 2 2 kθ − θk + Cσ ∆1 (θ) . inf R(θ̂λ , θ ) ≤ infn λ≥0 θ∈R n (25) Also, for every x > 0, 1 (1) inf kθ̂λ − θ∗ k2 ≤ infn λ≥0 n θ∈R   1 ∗ 4σ 2 x 2 2 kθ − θk + Cσ ∆1 (θ) + n n (26) with probability at least 1 − e−x . Further, if θ∗ satisfies the minimum length condition (12) with constant c, then (1) inf R(θ̂λ , θ∗ ) ≤ C(c)σ 2 λ≥0 k1 (θ∗ ) + 1 en log n k1 (θ∗ ) + 1 (27) for a constant C(c) depending on c alone. Also, for each x > 0, 1 (1) k1 (θ∗ ) + 1 en 4σ 2 x kθ̂λ − θ∗ k2 ≤ C(c)σ 2 log + λ≥0 n n k1 (θ∗ ) + 1 n inf (28) with probability at least 1 − e−x . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 13 Remark 2.4 (Comparison to existing results). Among the class of existing results for (1) the risk of θ̂λ , the strongest seems to be due to Lin et al. [24] who proved that when λ is (1) appropriately selected (depending on θ∗ ), the estimator θ̂λ satisfies the risk bound (1) R(θ̂λ , θ∗ ) ≤ C  p σ 2 (k1 (θ∗ ) + 1)  [log(k1 (θ∗ ) + 1) + log log n] log n + k1 (θ∗ ) + 1 (29) n provided cn (30) 0≤i≤k k1 (θ∗ ) + 1 for a positive constant c. Here the integers n0 , . . . , nk are the gaps between the jumps of θ∗ (as defined between equations (9) and (10)). This result from Lin et al. [24] improves earlier results due to Dalalyan et al. [6], Harchaoui and Lévy-Leduc [15], Lévy-Leduc and Harchaoui [23]. It is easy to see that the bound given by (29) is weaker than that given by (27) in two respects: (a) there are additional terms in (29) involving log n and k1 (θ∗ ) compared to (27), and (b) our minimum length condition (12) is weaker than (30). Indeed our condition (12) requires that ni ≥ cn/(k1 (θ∗ ) + 1) only for those i for which ri 6= ri+1 while (30) requires this for all i. min ni ≥ (r) We next state our risk result for θ̂λ for r ≥ 2. For c > 0, let Mr (c) denote the class of all θ ∈ Rn which satisfy the minimum length condition (12) with constant c. Note that this class depends on r. Indeed, it is possible for a vector θ to satisfy (12) for some r but not for other values of r. For example, θ∗ defined in (24) satisfies (12) for r = 1 but not for r = 2. Theorem 2.6. Fix r ≥ 2. For every θ∗ ∈ Rn and c > 0, we have (r) inf R(θ̂λ , θ∗ ) ≤ λ≥0  inf θ∈Mr (c) kθ∗ − θk2 + Cr (c)σ 2 n  kr (θ) + 1 en (kr (θ) + 1)2r log + n kr (θ) + 1 n  (31) for a positive constant Cr (c) that depends on r and c alone. Also, for every x > 0, we have (r) inf R(θ̂λ , θ∗ ) ≤ λ≥0  inf θ∈Mr (c) kθ∗ − θk2 + Cr (c)σ 2 n  kr (θ) + 1 en (kr (θ) + 1)2r log + n kr (θ) + 1 n  + 4σ 2 x n with probability at least 1 − e−x . Remark 2.5. When θ∗ satisfies the minimum length condition (12) with constant c i.e., if θ∗ ∈ Mr (c), then we can take θ = θ∗ in Theorem 2.6 to deduce that   kr (θ∗ ) + 1 en (kr (θ∗ ) + 1)2r (r) ∗ 2 log + inf R(θ̂λ , θ ) ≤ Cr (c)σ λ≥0 n kr (θ∗ ) + 1 n along with an analogous high probability statement. It may be noted that the above result is weaker than our corresponding risk bound for the constrained trend filtering estimator (Corollary 2.4) because of the additional term involving (kr (θ∗ ) + 1)2r . We believe that this term is redundant and is an artifact of our proof. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 14 3. Proofs of the Main Results 3.1. Proof of Theorem 2.1 (r) We prove Theorem 2.1 in this subsection. The estimator θ̂V is the least squares estimator subject to the constraint that θ ∈ K (r) (V ) (recall that the set K (r) (V ) is defined in (6)). The general theory of such estimators has a long history and is, by now, well established (see e.g., Chatterjee [5], Hjort and Pollard [17], Van de Geer [36], Van der Vaart and (r) Wellner [38]). This theory implies that one can bound the risk of θ̂V based on accurate upper bounds for " # G(t) := E sup hξ, θ − θ∗ i (32) θ∈K (r) (V ):kθ−θ∗ k≤t for t > 0. We control G(t) using the following lemma which is crucial for the proof of Theorem 2.1. Lemma 3.1. Fix an integer r ≥ 1. Then there exists a positive constant Cr such that for every n ≥ r, t ≥ 0 and V ≥ 0, we have " #  √ 1/(2r) p nV E sup hξ, θi ≤ Cr σt + Cr σt log(en). (33) t θ∈Rn :kθk≤t,kD(r) θk1 ≤V n1−r Lemma 3.1 is proved in Subsection A.2 and the ideas behind its proof are as follows. By Dudley’s entropy bound, the left hand side of (33) can be bounded from above using bounds on the metric entropy numbers of the following subset of Rn (the -metric entropy number of a set, formally defined in Subsection 4.4, is the logarithm of the -covering number which is further defined as the smallest number of Euclidean balls of radius  required to cover the set):  Sr (V, t) := α ∈ Rn : kαk ≤ t, kD(r) αk1 ≤ V n1−r . (34) For bounding the metric entropy numbers of Sr (V, t), our idea is to use existing connections between metric entropy and fat shattering dimension from Rudelson and Vershynin [31] (the definition of fat shattering dimension and its connections to metric entropy are described in Subsection 4.4). At a high level, we relate the class Sr (V, t) to the classes of the form  Cr (a, V ) := θ ∈ Rn : a ≤ (Dr−1 θ)1 ≤ · · · ≤ (Dr−1 θ)n−r+1 ≤ a + V (35) for a ∈ R and V ≥ 0. The fat shattering dimension of Cr (a, V ) can be controlled as in Lemma 4.7 which allows us to bound the metric entropy of suitable subsets of Cr (a, V ) via Rudelson and Vershynin [31, Corollary 6.4]. This allows us to deduce accurate upper bounds on the metric entropy of Sr (V, t) which are described in Theorem 4.5. Below, we provide the proof of Theorem 2.1 based on Lemma 3.1. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 15 Proof of Theorem 2.1. As kD(r) θ∗ k1 ≤ V n1−r , it follows that θ∗ ∈ K (r) (V ) (the set (r) K (r) (V ) is defined in (6)). Note also that θ̂V is the least squares estimator over K (r) (V ). (r) Our strategy for controlling the risk of θ̂V is based on Chatterjee [5, Corollary 1.2] which says that  C (r) R(θ̂V , θ∗ ) ≤ max t20 , σ 2 (36) n for a universal positive constant C, where t0 > 0 is such that G(t0 ) ≤ t20 /2 with G(t) defined as in (32). In order to apply this result, we need to bound the function G(t) from above. By triangle inequality, kD(r) (θ − θ∗ )k1 ≤ kD(r) θk1 + kD(r) θ∗ k1 so that G(t) = E hξ, θ − θ∗ i ≤ E sup θ∈K (r) (V ):kθ−θ∗ k≤t hξ, αi . sup α∈Rn :kαk≤t,kD(r) αk1 ≤2V n1−r The right hand side above is controlled in Lemma 3.1 from which we deduce that  √  2r1 p nV + Cr σt log(en) G(t) ≤ Cr σt t for a constant Cr depending on r alone. We now observe that  √  2r1 t2 nV Cr σt ≤ t 4 if and only if t ≥ (4Cr )2r/(2r+1) σ 2r/(2r+1) V √ 1/(2r+1) n and p p t2 if and only if t ≥ 4Cr σ log(en). Cr σt log(en) ≤ 4 It follows therefore that G(t0 ) ≤ t20 /2 provided   p √ 1/(2r+1) t0 := max (4Cr )2r/(2r+1) σ 2r/(2r+1) V n , 4Cr σ log(en) . The proof of inequality (7) is therefore complete by inequality (36). Inequality (8) can be derived as a consequence of (7) and the fact that the map y 7→ (r) kθ̂V − θ∗ k is 1-Lipschitz (see e.g., van de Geer and Wainwright [37, Section 2]). By the usual concentration inequality for Lipschitz functions of Gaussian variables, this gives  2 o n −z (r) (r) ∗ ∗ P kθ̂V − θ k ≥ Eθ∗ kθ̂V − θ k + σz ≤ exp . 2 This gives that 1 (r) 4σ 2 x (r) kθ̂V − θ∗ k2 ≤ 2R(θ̂V , θ∗ ) + n n −x with probability at least 1 − e so that inequality (8) follows from (7). imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 16 3.2. Proof of Theorem 2.2 (r) The proof of Theorem 2.2 will use available techniques connecting the risk of θ̂V to expected Gaussian suprema over tangent cones to K (r) (V ). Specifically, for θ ∈ K (r) (V ), let TK (r) (V ) (θ) denote the tangent cone to K (r) (V ) at θ, defined by  TK (r) (V ) (θ) := u(η − θ) : u ≥ 0, η ∈ K (r) (V ) . (37) Then the following pair of results from Bellec [2, Corollary 2.2] connects the risk and (r) loss of θ̂V to expected Gaussian suprema taken over tangent cones to K (r) (V ): For every θ∗ ∈ Rn , we have (r) R(θ̂V , θ∗ ) ≤  1 inf θ∈Rn :V (r) (θ)=V  2 2 σ σ E kθ − θ∗ k2 + + n n n α∈T K 2   sup hZ, αi  (θ):kαk≤1 (r) (V ) and, for every x > 0,  1 2σ 2  1 (r) ∗ 2 E kθ̂ −θ k ≤ inf kθ − θ∗ k2 + n V n θ∈Rn :V (r) (θ)=V  n α∈T K 2   2σ 2 sup hZ, αi + (1+2x)  n (θ):kαk≤1 (r) (V ) with probability at least 1 − e−x . In both the above inequalities, Z is an n-dimensional standard Gaussian random vector. From these results (and the trivial fact that ∆r (θ) ≥ 1/n so that 1/n + Cr ∆r (θ) ≤ (1 + Cr )∆r (θ)) , it is clear that for the proof of Theorem 2.2, it is enough to prove that " # p for every θ ∈ Rn with V (r) (θ) = V . (38) E sup hZ, αi ≤ Cr n∆r (θ) α∈TK (r) (V ) (θ):kαk≤1 In order to prove the above inequality, we obviously need to understand the set TK (r) (V ) (θ) for θ ∈ Rn with V (r) (θ) = V . The following result provides a necessary condition that is satisfied by every vector α ∈ TK (r) (V ) (θ) with kαk ≤ 1. This lemma is proved in Subsection A.1. Recall, from Section 2, the notion of rth order knots (along with their signs) of vectors in Rn . We shall also use the following notation. For α ∈ Rm and 1 ≤ a ≤ b ≤ m, we let Va,b (α) := V (αa , . . . , αb ) = |αa+1 − αa | + · · · + |αb − αb−1 |. (39) Lemma 3.2. Fix V > 0, r ≥ 1, n ≥ r and θ ∈ Rn with V (r) (θ) = V . Suppose 2 ≤ j1 < · · · < jk ≤ n − r + 1 denote any set of indices which contains all the rth order knots of θ. Let r1 , . . . , rk be such that ri is the sign of the knot corresponding to ji if ji is a knot and ri is arbitrary in {−1, 0, 1} if ji is not a knot. Also let j0 = 1, jk+1 = n − r + 2 and r0 = rk+1 = 0. The indices j0 , j1 , . . . , jk , jk+1 define a partition I0 , . . . , Ik of {1, . . . , n} in the following way: I0 := {j0 , . . . , j1 + r − 2} and Ii = {ji + r − 1, . . . , ji+1 + r − 2} for i = 1, . . . , k. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 17 Let ni denote the cardinality of Ii for i = 0, 1, . . . , k i.e., n0 := j1 + r − 2 and ni = ji+1 − ji for 1 ≤ i ≤ k. Then there exists a positive constant Cr (that depends on r alone) such that for every α ∈ TK (r) (V ) (θ) with kαk ≤ 1, there exist indices `0 ∈ I0 , `1 ∈ I1 , . . . , `k ∈ Ik such that v u k k uX X Γi (α, `i ) ≤ Cr t ni1−2r I{ri 6= ri+1 } (40) i=0 i=0 where Γi (α, `i ) := Vji ,ji+1 −1 (∆) − ri+1 (∆ji+1 −1 − ∆`i ) − ri (∆`i − ∆ji ) (41) with ∆ = (∆1 , . . . , ∆n−r+1 ) := D(r−1) α. Remark 3.1. It may be noted that the indices j1 , . . . , jk in Lemma 3.2 are not exactly the knots of θ. They are any set of indices that contain the knots of θ. We shall mostly work with the case when j1 , . . . , jk are exactly the set of knots of θ but we shall need this additional generality to deal with one special situation when some of the distances between the knots of θ are too large. In this case (see the last part of the proof of Theorem 2.2), we shall add additional indices to the knots in order to keep the inter-distances manageable. The proof of Lemma 3.2 is involved and is given in Subsection A.1. The insight provided by Lemma 3.2 into the structure of {α ∈ TK (r) (V ) (θ) : kαk ≤ 1} (note that understanding this set is necessary for proving (38)) is as follows. Suppose that n0 , . . . , nk are such that the right hand side of (40) is small. In this case, Lemma 3.2 P implies that for every α ∈ TK (r) (V ) (θ) with kαk ≤ 1, there exist indices `0 , . . . , `k for which ki=0 Γi (α, `i ) is small. It is helpful here to observe that Γi (α, `i ) is always nonnegative. Also, if Γi (α, `i ) = 0, then D(r−1) α is made of two monotone pieces in the interval from ji to ji+1 − 1 (one piece from ji to `i and the other from `i to ji+1 − 1). When r = 1, this means that α is made of two monotone pieces in the interval from ji to ji+1 − 1. When r = 2, this means that α is made of two convex/concave pieces in the interval from ji to ji+1 − 1. For general r, this means that α is made of two (r − 1)th order convex/concave functions in the interval from ji to ji+1 − 1. Extending this argument, when Γi (α, `i ) is small, D(r−1) α is nearly made of two monotone pieces in the interval from ji to ji+1 − 1; equivalently α is nearly made of two (r − 1)th order convex/concave sequences in the interval from ji to ji+1 − 1. This suggests therefore that in order to prove (38), we need to prove bounds on the Gaussian suprema for vectors α ∈ Rn for which D(r−1) α is nearly monotone. This is the content of the next lemma which is another main ingredient for the proof of Theorem 2.2. Lemma 3.3. Fix r ≥ 1, n ≥ r, 1 ≤ l ≤ n − r + 1, t > 0 and δ ≥ 0. For θ ∈ Rn , let ∆(θ) = (∆1 (θ), . . . , ∆n−r+1 (θ)) := D(r−1) θ. Also let ξ ∼ Nn (0, σ 2 In ). For every r1 , r2 ∈ {−1, 0, 1}, the quantity h  G := E sup hξ, θi : θ ∈ Rn , kθk ≤ t, and i V (∆(θ)) ≤ r1 (∆` (θ) − ∆1 (θ)) + r2 (∆n−r+1 (θ) − ∆` (θ)) + δ imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 18 is bounded from above as G ≤ Cr σ t + δn(2r−1)/2 p log(en) + Cr σt(2r−1)/(2r) n(2r−1)/(4r) δ 1/(2r) for a positive constant Cr that depends on r alone. The proof of Lemma 3.3 is given in Subsection A.2 (in fact, in Subsection A.2, we prove Lemma 4.3 which is a more accurate result compared to Lemma 3.3 in the sense that Lemma 4.3 gives a bound that depends on the actual values of r1 and r2 ). The proof of Lemma 4.3 uses results on expected Gaussian suprema for classes of shape-constrained vectors from Bellec [2]. We are now ready to prove Theorem 2.2. Proof of Theorem 2.2. As the proof is rather long, we divide it into many steps. Step I: We first note that the case when V = 0 is trivial. This is because the set (r) {θ ∈ Rn : kD(r) θk1 = 0} is a subspace of dimension r so that θ̂V =0 becomes a linear projection onto a subspace. Thus, 1 (r) 1 σ2 kθ̂V =0 − θ∗ k2 − inf kθ − θ∗ k2 ∼ χ2r n n θ∈Rn :kD(r) θk1 =0 n where χ2r denotes the chi-squared distribution with r degrees of freedom. This and a standard tail bound for chi-squared random variables such as (see e.g., Laurent and Massart [21, Subsection 4.1])  P χ2r ≤ 2r + 4x ≥ 1 − e−x for every x > 0 proves Theorem 2.2 for V = 0; note that when θ ∈ Rn is such that V (r) (θ) = V = 0, we have kr (θ) = 0, δr (θ) = n(1/2)−r and ∆r (θ) = n2 log(en) + n1 . We shall assume from now on that V > 0. Based on the discussion at the beginning of this subsection, it is enough to prove (38). We therefore fix θ ∈ Rn with V (r) (θ) = V . We need to bound the quantity " # G := E sup hZ, αi (42) α∈TK (r) (V ) (θ):kαk≤1 where Z is a standard n-dimensional Gaussian random vector. We bound G by breaking the set {α ∈ TK (r) (V ) (θ) : kαk ≤ 1} into smaller subsets. Let 2 ≤ j1 < · · · < jk ≤ n − r + 1 denote all the rth order knots of θ. Also let r1 , . . . , rk ∈ {−1, 1} denote the signs of the knots. For convenience, we take j0 = 1, jk+1 = n − r + 2 and Pk r0 = rk+1 = 0. Let n0 = j1 + r − 2 and nu = ju+1 − ju for u = 1, . . . , k. Check that u=0 nu = n. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 19 Step II: We shall prove (38) first under the simplifying assumption that ni ≤ 2n k+1 for every i = 0, 1, . . . , k. (43)  The goal of this step is to find a collection of sets whose union covers α ∈ TK (r) (V ) (θ) : kαk ≤ 1 (see (45)). For every vector α ∈ Rn , let us define the vectors α(0) := (αj0 , . . . , αj1 +r−2 ) and α(u) := (αju +r−1 , . . . , αju+1 +r−2 ) for u = 1, . . . , k. Note that the vector α(u) has length exactly equal to nu for u = 0, . . . , k. Let M denote the class of all vectors m := (m0 , . . . , mk ) where each mi is an integer with P 1 ≤ mi ≤ k + 1 and such that ki=0 mi ≤ 2(k + 1). Because  the number of (k + 1)-tuples p−1 of positive integers whose sum is equal to p equals k , it is easy to see that M is a finite set whose cardinality |M| can be bounded as |M| ≤ 2k+1 X p=k 2k + 1 p  ≤ 22k+1 ≤ 4k+1 . Also let L denote the class of all vectors ` := (`0 , . . . , `k ) where each `i is an integer such that j0 ≤ `0 ≤ j1 − 1 and ju + r − 1 ≤ `Q u ≤ ju+1 − 1 for u = 1, . . . , k. The cardinality |L| of L is clearly bounded from above by ku=0 nu . Let v u k−1 u X 1−2r 1−2r t δ := Cr n0 + nk + ni1−2r I{ri 6= ri+1 } i=1 where Cr is the constant given by Lemma 3.2. Note that δ ≤ Cr δr (θ) (44) where δr (θ) is as defined in (10). This is because ni ≥ ni∗ for every i and 1 − 2r < 0. Also for ` ∈ L, α ∈ Rn and 0 ≤ i ≤ k, let Γi (α, `i ) be defined (as in (41)) as   Vji ,ji+1 −1 (D(r−1) α) − ri+1 (D(r−1) α)ji+1 −1 − (D(r−1) α)`i − ri (D(r−1) α)`i − (D(r−1) α)ji . For every m, q ∈ M and ` ∈ L, let T (m, q, `) denote the set of all α ∈ Rn with kαk ≤ 1 for which qi δ mi and Γi (α, `i ) ≤ kα(i) k2 ≤ k+1 k+1 for every i = 0, 1, . . . , k. We then claim that [  α ∈ TK (r) (V ) (θ) : kαk ≤ 1 ⊆ T (m, q, `). (45) m,q∈M,`∈L imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 20 To see (45), note first that it follows from Lemma 3.2 that for every α ∈ TK (r) (V ) (θ) with P kαk ≤ 1, there exists ` ∈ L such that ki=0 Γi (α, `i ) ≤ δ. This implies that for every 0 ≤ i ≤ k, the inequality 0 ≤ Γi (α, `i ) ≤ δ and so there exists an integer 1 ≤ qi ≤ k + 1 such that (qi − 1)δ qi δ ≤ Γi (α, `i ) ≤ . k+1 k+1 The integers q0 , . . . , qk would then have to satisfy k X δ≥ Γi (α, `i ) ≥ δ i=0 k X qi − 1 k+1 i=0 P which is equivalent to ki=0 qi ≤ 2(k + 1). Thus q = (q0 , q1 , . . . , qk ) ∈ M. Similarly, for each 0 ≤ i ≤ k, the inequality 1 ≥ kαk2 ≥ kα(i) k2 holds so that there exists an integer 1 ≤ mi ≤ k + 1 such that mi − 1 mi ≤ kα(i) k2 ≤ . k+1 k+1 P P As ki=0 kα(i) k2 ≤ 1, the integers mi , 0 ≤ i ≤ k, satisfy ki=0 mi ≤ 2(k + 1) which implies that m = (m0 , . . . , mk ) ∈ M. This completes the proof of (45). Step III: In this step we find an upper bound of G (in (42)) that depends on the collection T (m, q, `). Using (45), we can bound the quantity G in (42) via " # G≤E max sup m,q∈M,`∈L α∈T (m,q,`) hZ, αi . Since Z is Gaussian, the first maximum in the right hand side above can be taken outside the expectation up to an additional correction term. We state this as a general result in Lemma B.1. Note that each set T (m, q, `) contains the zero vector and also that every vector in T (m, q, `) has norm bounded from above by 1. Therefore the quantity D in Lemma B.1 can be taken to be 1 (also take σ = 1 in Lemma B.1). Lemma B.1 thus gives " # r p π G ≤ max E sup hZ, αi + 4 log |M| + 2 log |L| + . m,q∈M,`∈L 2 α∈T (m,q,`) As |M| ≤ 4k+1 and, by concavity of the logarithm, log |L| ≤ k X log ni ≤ (k + 1) log i=0 we obtain (using also the fact that " G≤ max m,q∈M,`∈L E n en ≤ (k + 1) log , k+1 k+1 √ 2 + 4 log 4 < 3) that # r sup α∈T (m,q,`) hZ, αi + 3 en (k + 1) log + k+1 r π . 2 (46) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering We now fix m, q ∈ M and ` ∈ L and attempt to bound " G(m, q, `) := E # hZ, αi . sup 21 (47) α∈T (m,q,`) P P We write hZ, αi = ki=0 Z (i) , α(i) so that G(m, q, `) ≤ ki=0 Gi (m, q, `) where Gi (m, q, `) := E[supα∈T (m,q,`) Z (i) , α(i) ]. Let us now fix 0 ≤ i ≤ k and bound Gi (m, q, `). By the definition of T (m, q, `), " # Gi (m, q, `) ≤ Z (i) , α(i) sup (48) α∈T (i) (m,q,`) where   mi qi δ n (i) 2 T (m, q, `) := α ∈ R : kα k ≤ . , Γi (α, `i ) ≤ k+1 k+1 (i) Step IV: In this step, we describe how Lemma 3.3 can be used to bound the right hand side in (48). Fix 0 ≤ i ≤ k. We do this by rewriting the underlying set T (i) (m, q, `) in a form recognizable from Lemma 3.3. For convenience, let δi := qi δ . k+1 We claim that for every 0 ≤ i ≤ k and α ∈ T (i) (m, q, `), we have     V (∆(α(i) )) ≤ ri+1 (∆(α(i) ))ni −r+1 − (∆(α(i) ))`0i + ri (∆(α(i) ))`0i − (∆(α(i) ))1 + δi (49) where ∆(α(i) ) := D(r−1) α(i) and `0i is related to `i via `0 := `00 and `i = ji + r − 2 + `0i for 1 ≤ i ≤ k. (50) Before proving (49), let us observe that the expected supremum of Z (i) , α(i) over all α(i) which satisfy the norm condition kα(i) k2 ≤ mi /(k + 1) and which satisfy (49) can be controlled directly using Lemma 3.3 (this is done in the next step). The argument for (49) goes as follows. Fix α ∈ T (i) (m, q, `) and observe that, from the definition of T (i) (m, q, `), we have Γi (α, `i ) ≤ δi . For i = 0, inequality (49) is exactly the same as Γ0 (α, `0 ) ≤ δ0 . For 1 ≤ i ≤ k, note that (D(r−1) α(i) )` = (D(r−1) α)ji +r−2+` for every 1 ≤ ` ≤ ni − r + 1, (51) which implies that V (D(r−1) α(i) ) = Vji +r−1,ji+1 −1 (D(r−1) α) and that  Vji ,ji+1 −1 (D(r−1) α) ≥ V (D(r−1) α(i) ) + ri (D(r−1) α)ji +r−1 − (D(r−1) α)ji . The notation Va,b (·) may be recalled from (39). The above inequality, together with Γi (α, `i ) ≤ δi , allows us to deduce that n o n o V (D(r−1) α(i) ) ≤ ri+1 (D(r−1) α)ji+1 −1 − (D(r−1) α)`i +ri (D(r−1) α)`i − (D(r−1) α)ji +r−1 +δi . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 22 Using (50) and (51), it is now easy to see that the above inequality is the same as (49). This proves (49). Step V: Next, we use the characterization in (49) to bound Gi (m, q, `) using Lemma 3.3. p Indeed, we can take σ = 1, t = mi /(k + 1) ≤ 1, n = ni , ` = `0i and δ = δi in Lemma 3.3 to obtain r Gi (m, q, `) ≤ Cr    p mi (2r−1)/(4r) (2r−1)/(4r) 1/(2r) mi (2r−1)/2 + δ i ni log(eni ) + Cr ni δi k+1 k+1 for all 0 ≤ i ≤ k. Here P Cr is a constant that depends on r alone. This inequality, together with G(m, q, `) ≤ ki=0 Gi (m, q, `), gives the following upper bound for G(m, q, `)/Cr : (2r−1)/(4r) k r k k  X X X p mi p mi ni (2r−1)/2 1/(2r) log(eni ) + δi ni log(eni ) + δi . (52) k + 1 k + 1 i=0 i=0 i=0 We now bound separately each of the three termsP above. For the first term, note that by the Cauchy-Schwarz inequality and the fact that ki=0 mi ≤ 2(k + 1), we get v v u k u k r k r uX u X X p √ en mi m i t t log(eni ) ≤ log(eni ) ≤ 2 (k + 1) log k+1 k + 1 i=0 k+1 i=0 i=0 where we have also used concavity of the logarithm function to claim that en (k + 1) log k+1 . For the second term in (52), we write k X (2r−1)/2 δ i ni p Pk i=0 log(eni ) ≤ k h iX i h p p (2r−1)/2 (2r−1)/2 log(eni ) ≤ max ni log(eni ) log(eni ) δi ≤ 2δ max ni i=0 0≤i≤k i=0 0≤i≤k P P where we have used that ki=0 δi = δ ki=0 qi /(k + 1) ≤ 2δ. Assumption (43) now gives (2r−1)/2 r  h i p en n (2r−1)/2 r max ni . log(eni ) ≤ 2 log 0≤i≤k k+1 k+1 We thus obtain k X (2r−1)/2 r en . log k+1 i=0 P P P For the third term in (52), we use Holder’s inequality ( i αi βi ≤ ( i αip )1/p ( i βiq )1/q with p = 2r/(2r − 1) and q = 2r) to obtain !(2r−1)/(2r) !1/(2r) (2r−1)/(4r) k  k r k X X X mi ni m n i i 1/(2r) δi ≤ δi k + 1 k + 1 i=0 i=0 i=0 v (2r−1)/(2r) u k k uX mi X ni  ≤ 21/(2r) δ 1/(2r) t k + 1 i=0 i=0 (2r−1)/2 δi n i p log(eni ) ≤ 21+r δ  n k+1 ≤ 2(2r+1)/(4r) δ 1/(2r) n(2r−1)/(4r) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 23 P where, in the second inequality above, we used ki=0 δi ≤ 2δ and the Cauchy-Schwarz P P inequality and, in the final inequality, we used ki=0 mi ≤ 2(k + 1) and ki=0 ni = n. Putting the bounds for the three terms in (52) together, we obtain r  (2r−1)/2 r G(m, q, `) en n en 1+r ≤ 2(k + 1) log +2 δ log Cr k+1 k+1 k+1 + 2(2r+1)/(4r) δ 1/(2r) n(2r−1)/(4r) (53) which gives (note also that δ ≤ Cr δr (θ) by (44)) p G(m, q, `) ≤ cr n∆r (θ), √ √ √ √ √ for a suitable constant cr depending only on r; note that a + b + c ≤ 3 a + b + c for a, b, c > 0. Combined with (46), this completes the proof of (38) when assumption (43) is true. Step VI: Now we work with the situation when the assumption (43) is violated. Our basic idea here is that we will add indices to the set of knots j1 , . . . , jk to create a new set of indices which contains all the knots of θ and which satisfies an assumption similar to (43). Specifically for every i ≥ 1 for which ni is strictly larger than 2n/(k + 1), we add the indices       2n 2n 2n , ji + 2 , . . . , ji + Ai ji + k+1 k+1 k+1 to the original set of knots, where bxc denotes the largest integer less than or equal to x. Here Ai is the integer part of the ratio of ni to b2n/(k + 1)c and hence  −1 2n Ai ≤ ni . k+1  2n   2n  , 2−r +2 k+1 , . . . , 2− Similarly, if n0 ≥ 2n/(k +1), then we add the indices 2−r + k+1  2n   2n −1 r + A0 k+1 to the original set of knots j1 , . . . , jk where again A0 ≤ n0 k+1 . This construction will create a set of indices j10 < · · · < jk0 0 that contains all the original knots and which satisfy 2n for every i = 0, . . . , k 0 (54) n0i ≤ k+1 0 where n0i are defined with respect to j10 < · · · < jk0 0 as n00 = j10 + r − 2 and n0i := ji+1 − ji0 0 0 for i = 1, . . . , k . We now note that the number of these new indices, k , satisfies 0 k ≤k+ k X i=0 where we have used implies that   2n Ai ≤ k + k+1 2n k+1  ≥ 2n k+1 n0i ≤ −1 ≥ 4n +1 k0 −1 X k i=0 n . k+1  2n ni = k + n k+1 −1 ≤ 2k + 1 The inequality k 0 ≤ 2k + 1, along with (54), for every i = 0, . . . , k 0 . (55) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 24 For these indices j10 , . . . , jk0 0 , we shall assign signs r01 , . . . , r0k0 ∈ {−1, 0, 1} in the following way. If ji0 is a knot (i.e., it is one of j1 , . . . , jk ), then r0i equals the sign of the knot ji . If ji0 is not a knot, then we assign r0i to be the sign of the nearest knot that is to the right of ji0 (if there is no knot to the right of ji0 , then we take r0i to be zero). We now go through the previous proof (which was under the case when assumption (43) is satisfied) with the set of indices j10 , . . . , jk0 0 and signs r01 , . . . , r0k0 . Instead of (43), we use the inequality (55) which has a slightly worse constant 4 instead of 2. This argument will end with an inequality similar to (53) (but with slightly different constants). Thus we obtain the following upper bound for G:  2r−1 en n en G2 0 0 2 ≤ (k + 1) log 0 + (δ ) log 0 + (δ 0 )1/r n(2r−1)/(2r) (56) 0 Cr k +1 k +1 k +1 for a constant Cr where !1/2 0 δ 0 := k X (n0i )1−2r I{r0i 6= r0i+1 } . i=0 Now because k ≤ k 0 ≤ 2k + 1, we have k + 1 ≤ k 0 + 1 ≤ 2(k + 1) and thus we can replace the k 0 on the right hand side of (56) by k by enlarging the constant Cr slightly. Finally, to complete the proof, it suffices to observe that because of the construction of the set of indices j10 , . . . , jk0 0 and the choice of the signs, we have 0 2 (δ ) = ≤ k  X i=0 k X i=0 1−2r   2n I{ri 6= ri+1 } min ni , k+1 1−2r 1−2r n1−2r I{ri 6= ri+1 } = n0∗ + nk∗ + i∗ k−1 X n1−2r I{ri 6= ri+1 } = δr2 (θ). i∗ i=1 This, along with replacing k 0 by k in (56), completes the proof of Theorem 2.2. 3.3. Proofs of Corollary 2.3 and Corollary 2.4 The proof of Corollary 2.3 is almost immediate from Theorem 2.2 and is given first. Proof of Corollary 2.3. Inequality (16) follows directly from (14) by taking infimum over V ≥ 0 on both sides of (14). To prove (17), fix u > 0, θ∗ ∈ Rn and let Vu ≥ 0 be such that     1 ∗ 1 ∗ 2 2 2 2 inf kθ − θk + Cr σ ∆r (θ) ≤ infn kθ − θk + Cr σ ∆r (θ) + u. θ∈R n n θ∈Rn :V (r) (θ)=Vu imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 25 We then obtain from (15) that     1 ∗ 4σ 2 x 1 (r) −x ∗ 2 2 2 1−e ≤P inf kθ̂ − θ k ≤ kθ − θk + Cr σ ∆r (θ) + n Vu n n θ∈Rn :V (r) (θ)=Vu     2 1 ∗ 4σ x 1 (r) kθ̂Vu − θ∗ k2 ≤ infn kθ − θk2 + Cr σ 2 ∆r (θ) + u + ≤P θ∈R n n n     1 (r) 1 ∗ 4σ 2 x ∗ 2 2 2 kθ − θk + Cr σ ∆r (θ) + u + . ≤ P inf kθ̂V − θ k ≤ infn V ≥0 n θ∈R n n The above holds for every u > 0 so we can let u ↓ 0 to derive (17). We now turn to the proof of Corollary 2.4 which we prove as a consequence of Theorem 2.2 and Theorem 2.1. The following lemma will be needed for this (this lemma is proved in Subsection B.4). Lemma 3.4. Fix r ≥ 1 and n ≥ r + 1. For every θ ∈ Rn , there exists η ∈ Rn such that kD(r) ηk1 = 0 kθ − ηk2 ≤ n2r−1 kD(r) θk21 . and (57) Remark 3.2. When r = 1, the inequality in (57) is equivalent to n X θi − θ̄ 2 ≤ nkDθk2 = nV 2 (θ) i=1 which relates the variance of θ1 , . . . , θn to the variation. Therefore Lemma 3.4 can be seen as a relation between variance and variation for general r ≥ 1. We are now ready to prove Corollary 2.4. Proof of Corollary 2.4. Recall from (9) that V (r) (θ∗ ) = nr−1 kD(r) θ∗ k1 . We first consider the case when V (r) (θ∗ ) > 0. In this case, we use Lemma 3.4 to claim the existence of η ∗ ∈ Rn such that V (r) (η ∗ ) = 0 and 2 kθ∗ − η ∗ k2 ≤ n2r−1 kD(r) θ∗ k21 = n V (r) (θ∗ ) . (58) Let now θ ∈ Rn be defined as θ := η ∗ + V V (r) (θ ∗ ) (θ∗ − η ∗ ) . As V (r) (η ∗ ) = 0, it follows that V (r) (θ) = V . We therefore obtain   1 ∗ 1 2 2 inf kθ − αk + Cr σ ∆r (α) ≤ kθ∗ − θk2 + Cr σ 2 ∆r (θ) (r) n n n α∈R :V (α)=V  2 1 ∗ V ∗ 2 = kθ − η k 1 − (r) ∗ + Cr σ 2 ∆r (θ) n V (θ )  (r) ∗ 2 ≤ V − V (θ ) + Cr σ 2 ∆r (θ) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 26 where the last inequality above follows from (58). We now note that, by construction, θ satisfies the minimum length condition (12) with the same constant c because θ∗ does so. As a consequence, we have from (13) that ∆r (θ) ≤ Cr (c) k+1 en log n k+1 where Cr (c) depends on r and c alone and k = kr (θ) = kr (θ∗ ). We have thus shown that   2 k+1 1 ∗ en 2 2 inf kθ − αk + Cr σ ∆r (α) ≤ V − V (r) (θ∗ ) + Cr (c)σ 2 log . (r) n n n k+1 α∈R :V (α)=V Inequalities (18) and (19) then directly follow from Theorem 2.2. We now assume that V (r) (θ∗ ) = 0. Here we have kr (θ∗ ) = 1 so that the second term on 2 the right hand side of (18) becomes Crnσ log(en). Note also that because V (r) (θ∗ ) = 0 and V ≥ 0, we can use Theorem 2.1. To complete the proof, we therefore only need to prove that !  2 1/r 2r/(2r+1) 2 (2r+1)/(2r) 2 Cr σ σ σ V 2 log(en) ≤ V + log(en). (59) Cr max , n n n To prove the above inequality, we may assume that  σ 2 V 1/r n 2r/(2r+1) > Cr1/(2r) σ2 log(en) n for otherwise (59) is trivial. It is now straightforward to check that the above inequality is equivalent to V2 σ2 < C −(2r+1)/(2r) . n (log en)2r+1 r From here, it is easy to show that  Cr σ 2 V 1/r n 2r/(2r+1) ≤ V2 ≤V2 (log en)2r which proves (59). This completes the proof of (18) and (19) when V (r) (θ∗ ) = 0. Inequalities (20) and (21) trivially follow from (18) and (19) respectively. 3.4. Proof of Theorem 2.5 The proof of Theorem 2.5 is based on the following result which gives a sharp oracle inequality for the risk of penalized estimators in terms of Gaussian mean squared distances to scaled subdifferentials of the penalty function at the parameter values. The non-oracle imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 27 formulation of this result comes from Oymak and Hassibi [28, Theorem 3.2]. This sharp oracle version essentially follows from the results of Bellec [2]. For a nonempty set C of Rn , its Gaussian mean squared distance D(C) is defined as   D(C) := E dist2 (Z, C) where dist(Z, C) := inf kZ − xk (60) x∈C and Z is a standard Gaussian vector in Rn . Theorem 3.5. Let f : Rn → R be a convex function and θ∗ ∈ Rn . Given data Y ∼ Nn (θ∗ , σ 2 In ), consider the following estimator for θ∗ :   1 f 2 θ̂λ := argmin kY − θk + σλf (θ) . 2 θ∈Rn Then the risk R(θ̂λf , θ∗ ) of θ̂λf satisfies   1 ∗ σ2 f ∗ 2 R(θ̂λ , θ ) ≤ infn kθ − θk + D(λ∂f (θ)) θ∈R n n (61) where ∂f (θ) denotes the subdifferential of the convex function f at θ and λ∂f (θ) := {λv : v ∈ ∂f (θ)}. Also for every x > 0, we have 1 f kθ̂λ − θ∗ k2 ≤ infn θ∈R n   2σ 2 4σ 2 x 1 ∗ 2 kθ − θk + D(λ∂f (θ)) + n n n (62) with probability at least 1 − e−x . From the above theorem, it is clear that for proving Theorem 2.5 (and Theorem 2.6), we need to bound from above the quantity inf λ≥0 D(λ∂f (θ)) for f (θ) := kD(r) θk1 . Now let cone(∂f (θ)) := ∪λ≥0 λ∂f (θ) and observe that for every λ ≥ 0, the set λ∂f (θ) is contained in cone(∂f (θ)). As a direct consequence of inequality (67) below, along with inequality (38), it can be shown that D(cone(∂f (θ))) ≤ Cr n∆r (θ). A natural idea to control inf λ≥0 D(λ∂f (θ)) is therefore to relate it to D(cone(∂f (θ))). It is trivial to see that D(cone(∂f (θ))) ≤ inf λ≥0 D(λ∂f (θ)) (because cone(∂f (θ)) contains λ∂f (θ) for every θ and D(G1 ) ≤ D(G2 ) if G2 ⊆ G1 ). But this trivial inequality does not help us as we need to bound inf λ≥0 D(λ∂f (θ)) from above. We therefore need upper bounds for inf λ≥0 D(λ∂f (θ)) in terms of D(cone(∂f (θ))). Some general results relating these two quantities are available from Foygel and Mackey [10] and we shall use these results in the sequel. For proving Theorem 2.5, we only need to study the case r = 1. Here we use the following result from Foygel and Mackey [10, Proposition 1] which bounds D(λ∂f (θ)) from above via D(cone(∂f (θ))) under a condition on the subdifferential ∂f (θ). imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 28 Proposition 3.6 (Foygel and Mackey). Suppose that the subdifferential ∂f (θ) satisfies the following property: there exists v0 ∈ ∂f (θ) such that hv − v0 , v0 i = 0 for every v ∈ ∂f (θ). Then inf D(λ∂f (θ)) ≤ λ≥0 p D(cone(∂f (θ))) + 6 2 + 4. (63) (64) Remark 3.3. Foygel and Mackey [10, Proposition 1] actually prove that p inf E [dist(Z, λ∂f (θ))] ≤ E [dist(Z, cone(∂f (θ)))] + 6 ≤ D(cone(∂f (θ))) + 6. λ≥0 From here, inequality (64) follows from the observation that Z 7→ dist(Z, λ∗ ∂f (θ)) is 1Lipschitz (where λ∗ minimizes the right hand side above) so that by standard Gaussian concentration Z ∞ n √o ∗ Var (dist(Z, λ ∂f (θ))) = P |dist(Z, λ∗ ∂f (θ)) − E (dist(Z, λ∗ ∂f (θ)))| ≥ t dt 0 Z ∞ e−t/2 dt = 4. ≤ 2 0 Therefore D(λ∗ ∂f (θ)) ≤ (E [dist(Z, λ∗ ∂f (θ))])2 + 4 from which (64) follows. We are now ready to prove Theorem 2.5. The basic idea is to realize that condition (63) holds for f (θ) := kDθk1 provided Dθ 6= 0n−1 (this condition however is not true for f (θ) := kD(r) θk1 for r ≥ 2 which makes the proof of the risk bounds for the penalized estimator for r ≥ 2 harder). Proof of Theorem 2.5. We only need to prove inequalities (25) and (26). The remaining two inequalities in the statement of Theorem 2.5 would then follow by taking θ = θ∗ in the infimum on the right hand side of inequalities (25) and (26) respectively together with en the observation that ∆1 (θ) ≤ C(c) k+1 log k+1 when θ satisfies (12) with constant c. n From Theorem 3.5, it is clear that inequalities (25) and (26) would follow from the inequality: inf D(λ∂f (θ)) ≤ Cn∆1 (θ) for every θ ∈ Rn . (65) λ≥0 It is obvious that proving the above inequality requires determination of the subdifferential ∂f (θ) where f denotes the function f (α) := kDαk1 . Let j1 < · · · < jk denote the first order knots (i.e., jumps) of θ with associatedP signs r1 , . . . , rk . The subdifferential ∂f (θ) consists precisely of vectors v ∈ Rn for which ni=1 vi = 0 and, for j = 2, . . . , n,  n X rj if j is a first order knot vi = ∈ [−1, 1] otherwise. i=j imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 29 This characterization of the subdifferential follows from the more general result in Proposition 4.4 which describes the subdifferential of α 7→ kD(r) αk1 for every r ≥ 1. To prove (65), let us first consider the case when kDθk1 = 0 i.e., the case when θ is a constant. In this case, it is easy to see from the above expression for ∂f (θ) that the sets λ∂f (θ) are increasing as λ increases, and that ∪λ≥0 λ∂f (θ) = {v ∈ Rn : v1 + · · · + vn = 0} These imply that D(λ∂f (θ)) ↓ nEZ̄ 2 = 1 as λ ↑ ∞. Thus inf λ≥0 D(λ∂f (θ)) = 1 which implies (65). We now assume that kDθk1 > 0. In this case, we shall argue that the subdifferential ∂f (θ) satisfies the condition (63). Recall that 2 ≤ j1 < · · · < jk ≤ n denote the jumps (first order knots) of θ and their signs are r1 , . . . , rk . Also let j0 = 1, jk+1 = n + 1, r0 = rk+1 = 0 and n0 := j1 − 1, ni := ji+1 − ji for 1 ≤ i ≤ k. Define the vector v0 = (v01 , . . . , v0n ) ∈ Rn in the following way. For 1 ≤ i ≤ n, let 0 ≤ l ≤ k be the unique integer such that jl ≤ i < jl+1 . Then we take v0i := (rl − rl+1 )/nl . With this choice of v0 , we shall check below that condition (63) holds. To see this, let Iu := {ju , . . . , ju+1 − 1} for u = 0, 1, . . . , k and note that   k X X ru − ru+1 ru − ru+1 hv − v0 , v0 i = vi − nu nu u=0 i∈Iu ! k k X X ru − ru+1 X (ru − ru+1 )2 = vi − . n n u u u=0 u=0 i∈I u The quantity above P equals zero because, by the characterization of the subdifferential ∂f (θ), we have i∈Iu vi = ru − ru+1 for every v ∈ ∂f (θ) and 0 ≤ u ≤ k. This proves that the condition (63) holds. We can therefore employ Proposition 3.6 to obtain p 2 inf D(λ∂f (θ)) ≤ D(cone(∂f (θ))) + 6 + 4. (66) λ≥0 The required bound (65) now follows from (38) as described below. We first note that the polar cone of cone(∂f (θ)) equals the tangent cone of the set {α ∈ Rn : f (α) ≤ f (θ)} at θ. This is a standard result from convex geometry (see e.g., Hiriart-Urruty and Lemaréchal [16]). When f (θ) := kDθk1 , note that, in our notation, the set {α ∈ Rn : f (α) ≤ f (θ)} is precisely K (1) (V (θ)). Thus, the polar cone to cone(∂f (θ)) equals TK (1) (V (θ)) (θ) (recall the notation of the tangent cone from (37)). From this observation and Amelunxen et al. [1, Proposition 10.1], it follows that !2 D(cone(∂f (θ))) ≤ 1 + E sup hZ, αi . (67) α∈TK (1) (V (θ)) (θ):kαk≤1 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 30 The above two displayed inequalities, combined with inequality (38) with r = 1, imply 2 q 2 inf D(λ∂f (θ)) ≤ 1 + C1 n∆1 (θ) + 6 + 4 ≤ Cn∆1 (θ) λ≥0 for a constant C (here we have also used that n∆1 (θ) ≥ 1). This proves (65) and completes the proof of Theorem 2.5. 3.5. Proof of Theorem 2.6 In this subsection, we define f : Rn → R to be the function f (α) := kD(r) αk1 . We shall use Theorem 3.5 as in the case when r = 1. However Proposition 3.6 is unfortunately not available as condition (63) is not true for r ≥ 2. An understanding of the subdifferential ∂f (θ∗ ) is required for proving Theorem 2.6. The next result describes facts about ∂f (θ∗ ) that are necessary for the proof. Lemma 3.7. Let f : Rn → R be given by f (θ) := kD(r) θk1 and let θ∗ ∈ Rn . 1. If D(r) θ∗ 6= 0n−r , then there exists v0 ∈ Rn such that kv0 k ≥ (r − 1)! −r+1/2 n and hv − v0 , v0 i = 0 for all v ∈ ∂f (θ∗ ). r−1 (r + 1)2 (68) 2. Suppose that θ∗ satisfies the minimum length condition (12) with constant c, then there exists v ∗ ∈ ∂f (θ∗ ) such that kv ∗ k ≤ Cr c−r+1/2 (k + 1)r n−r+1/2 (69) where Cr is a constant depending only on r. Lemma 3.7 is proved in Subsection A.3 using the precise characterization of the subdifferential ∂f (θ∗ ) in Proposition 4.4. We are now ready to prove Theorem 2.6. Proof of Theorem 2.6. From Theorem 3.5, it is clear that Theorem 2.6 will follow from the inequality  inf D(λ∂f (θ)) ≤ Cr (c) (kr (θ) + 1) log λ≥0 en + (kr (θ) + 1)2r kr (θ) + 1  (70) for every θ ∈ Mr (c). As in the proof of Theorem 2.6, it is easy to deal with the case when D(r) θ = 0n−r by letting λ ↑ ∞ which gives inf λ≥0 D(λ∂f (θ)) = r. We therefore assume that D(r) θ 6= 0n−r . For convenience of notation, we denote kr (θ) by k. For (70), let us first argue that it is enough to prove that p 2 r D(cone(∂f (θ))) + Cr (c)(k + 1) +4 (71) inf D(λ∂f (θ)) ≤ λ≥0 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 31 for a constant Cr (c) depending on r and c alone. Before giving the proof of (71), let us first explain how (71) implies (70). To see this, we proceed exactly as towards the end of the proof of Theorem 2.5 (after inequality (66)) to argue that !2 D(cone(∂f (θ))) ≤ 1 + sup E hZ, αi . α∈TK (r) (V (r) (θ)) (θ):kαk≤1 We then use inequality (38) (and the fact that n∆r (θ) ≥ 1) to deduce that D(cone(∂f (θ))) ≤ Cr n∆r (θ). Inequality (70) then follows as a consequence of (13). We therefore only need to prove (71). For (71), as described in Remark 3.3, it is sufficient to prove that inf E [dist(Z, λ∂f (θ))] ≤ E [dist(Z, cone(∂f (θ)))] + Cr (c)(k + 1)r . λ≥0 (72) To prove (72), we shall use ideas from Foygel and Mackey [10, Proof of Proposition 1]. The basic intuition here is the following. The projection of Z onto cone(∂f (θ)) is of course a projection onto λ∂f (θ) for a random λ. The idea is to show that this random λ concentrates which will connect E [dist(Z, λ∂f (θ))] to E [dist(Z, cone(∂f (θ)))]. Choose v0 and v ∗ as in Lemma 3.7 satisfying (68) and (69) respectively. Let (r + 1)2r+1 −r+ 1 2 C + 1, Cr (c) = c r (r − 1)! where Cr is as in inequality (69). Note then that 4kv ∗ k + 2 ≤ (Cr (c) − 1)(k + 1)r + 2 ≤ Cr (c)(k + 1)r . kv0 k (73) Define the function λ : Rn → R as λ(z) := argmin dist(z, λ∂f (θ)). λ≥0 It follows from Foygel and Mackey [10, Proof of Lemma 3] that λ(z) is a kv10 k -Lipschitz function of z (it may be noted that Foygel and Mackey [10, Lemma 3] requires the assumption that ∂f (θ) satisfies (63) which is not true here for r ≥ 2. However their proof only requires the assumption that hv − v0 , v0 i = 0 for all v ∈ ∂f (θ) which is true here from (68); the assumption that v0 ∈ ∂f (θ) is not necessary). Because λ(z) is kv10 k -Lipschitz, we obtain from standard Gaussian concentration that   2 −2 P(E) ≥ 1 − 2e where E := |λ(Z) − E[λ(Z)]| < . kv0 k Assume that E holds, and choose v ∈ ∂f (θ) such that dist(Z, cone(∂f (θ))) = kZ −λ(Z)vk. Let 2 λ∗ := E[λ(Z)] + , kv0 k imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering and note that λ(Z) < λ∗ < λ(Z) + 4 kv0 k 32 on E. By convexity of ∂f (θ),   λ(Z) λ(Z) v ∗ ∈ ∂f (θ). v+ 1− ∗ λ∗ λ Thus, dist (Z, λ∗ ∂f (θ)) ≤ kZ − (λ(Z)v + (λ∗ − λ(Z))v ∗ )k ≤ kZ − λ(Z)vk + (λ∗ − λ(Z))kv ∗ k < dist(Z, cone(∂f (θ))) + 4kv ∗ k . kv0 k Therefore,   1 1 2kv ∗ k ∗ ≥ P(E) ≥ 1 − 2e−2 . P dist(Z, λ ∂f (θ)) − dist(Z, cone(∂f (θ))) < 2 2 kv0 k The above inequality, along with the observation that 1 1 z 7→ dist(z, λ∗ ∂f (θ)) − dist(z, cone(∂f (θ))) 2 2 is a 1-Lipschitz function of z implies, via Foygel and Mackey [10, Lemma 4], that s     ∗ 1 1 2kv k 1 ∗ E dist(Z, λ ∂f (θ)) − dist(Z, cone(∂f (θ))) ≤ + 2 log 2 2 kv0 k 1 − 2e−2 < 2kv ∗ k + 1, kv0 k and thus E[dist(Z, λ∗ ∂f (θ))] ≤ E[dist(Z, cone(∂f (θ)))] + 4kv ∗ k + 2. kv0 k This, along with (73), proves (72) which completes the proof of Theorem 2.6. 4. Some Useful Technical Results In this section, we highlight some technical results which are needed for the proofs of the key results from Section 3. These results are all proved in Section A and Section B. We believe that these results are useful in their own right and are of independent interest. 4.1. Characterization of the Tangent Cone TK (r) (V ) (θ) Understanding the structure of the tangent cones of the convex set K (r) (V ) at vectors θ ∈ K (r) (V ) is crucial for the proof of Lemma 3.2 which itself is an important ingredient for the proof of Theorem 2.2 (our main risk result for constrained trend filtering). Recall imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 33 the definition of K (r) (V ) from (6) and the notion of the tangent cone TK (r) (V ) (θ) from (37). The following lemma gives a precise characterization of TK (r) (V ) (θ). Recall the notation Va,b (α) (from (39)) for 1 ≤ a ≤ b ≤ m and α ∈ Rm . Also recall, from Section 2, the notion of rth order knots (along with their signs) of vectors in Rn . Lemma 4.1. Fix r ≥ 1, n ≥ r + 1 and let K (r) (V ) be as in (6). Let θ ∈ K (r) (V ) be such that V (r) (θ) = V . (i) Let 2 ≤ j1 < · · · < jk ≤ n − r + 1 denote all the rth order knots of θ along with associated signs r1 , . . . , rk ∈ {−1, 1}. Then ( TK (r) (V ) (θ) = α ∈ Rn : k X Vji ,ji+1 −1 (D(r−1) α) ≤ i=0 k X  ri (D(r−1) α)ji −1 − (D(r−1) α)ji  ) (74) i=1 with the convention j0 = 1 and jk+1 = n − r + 2. (ii) Suppose 2 ≤ j1 < · · · < jk ≤ n − r + 1 denote any set of indices which contains all the rth order knots of θ. Let r1 , . . . , rk be such that ri is the sign of the knot corresponding to ji if ji is a knot and ri is arbitrary in {−1, 0, 1} if ji is not a knot. Then ( TK (r) (V ) (θ) ⊆ n α∈R : k X Vji ,ji+1 −1 (D (r−1) α) ≤ k X  ri (D (r−1) α)ji −1 − (D (r−1) α)ji )  (75) i=1 i=0 where again j0 = 1 and jk+1 = n − r + 2. Remark 4.1. Lemma 4.1 only deals with those θ ∈ K (r) (V ) for which V (r) (θ) = V . On the other hand, it is easy to see that when V (r) (θ) < V , the tangent cone TK (r) (V ) (θ) = Rn . Remark 4.2. It must be clear from the right hand side of (75) that the tangent cone TK (r) (V ) (θ) only depends on the knot indices j1 , . . . , jk and the knot signs r1 , . . . , rk . For example, the exact values of θ at j1 , . . . , jk are not relevant for the determination of the tangent cone. We next state a result on the magnitude of min1≤i≤n−r+1 (D(r−1) θ)i for a vector θ with kθk ≤ 1. This result, while being of independent interest, also plays a key role for the proof of Lemma 3.2. Lemma 4.2. Fix r ≥ 1. There exists a positive constant Cr depending only on r such that for every n ≥ 2r, t > 0 and θ ∈ Rn with kθk ≤ t, there exist indices `1 , `2 ∈ {1, . . . , n − r + 1} such that (D(r−1) θ)`1 ≤ Cr n(1/2)−r t and (D(r−1) θ)`2 ≥ −Cr n(1/2)−r t. (76) Remark 4.3. Lemma 4.2 is trivial for r = 1 (when it holds with C1 = 1) but the extension to r ≥ 2 is non-trivial. Also, for general r ≥ 2, the two indices `1 and `2 will be different and it will be incorrect to claim that for every θ ∈ Rn with kθk ≤ 1, there exists a single index ` ∈ {1, . . . , n − r + 1} for which |(D(r−1) θ)` | ≤ Cr n(1/2)−r t. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 34 4.2. A result on Expected Gaussian Suprema Our key expected Gaussian supremum result is Lemma 3.3 which was crucially used in the proof of Theorem 2.2. In fact, we prove the following more precise result from which Lemma 3.3 easily follows. Lemma 4.3. Fix r ≥ 1, n ≥ r, 1 ≤ ` ≤ n − r + 1, t > 0 and δ ≥ 0. For θ ∈ Rn , let ∆(θ) = (∆1 (θ), . . . , ∆n−r+1 (θ)) := D(r−1) θ. For every r1 , r2 ∈ {−1, 0, 1}, the quantity h  G := E sup hξ, θi : θ ∈ Rn , kθk ≤ t, and i V (∆(θ)) ≤ r1 (∆` (θ) − ∆1 (θ)) + r2 (∆n−r+1 (θ) − ∆` (θ)) + δ is bounded from above as  p σtn(2r−1)/(2r) δ 1/(2r) n(2r−1)/(4r) + σt log(en)o    p  p  (2r−1)/(2r) `(2r−1)/4r δ 1/(2r) + t log(e` ) + σ t + δ`(2r−1)/2   σ t log(e`2 ) 1 1 2 G n o   p ≤ (2r−1)/4r (2r−1)/2 p (2r−1)/(2r) ` 1/(2r) + t log(e` )  log(e` ) + σ t δ σ t + δ` Cr 1 2 2 1    p     (2r−1)/2 p  σ t + δ`(2r−1)/2 log(e`1 ) + σ t + δ` log(e`2 ) 1 2 : r1 = r2 = 0 : r1 = 0, r2 6= 0 : r1 6= 0, r2 = 0 : r1 6= 0, r2 6= 0 where `1 := ` + r − 1, `2 := n − ` − r + 1 and Cr is a positive constant depending on r alone. Remark 4.4. It is easy to see that Lemma 4.3 implies Lemma 3.3. This is a consquence of the fact that the integers `1 and `2 appearing in Lemma 4.3 are both bounded from above by n. 4.3. Subdifferential of θ 7→ kD (r) θk1 Understanding the subdifferential of the function f : Rn → R defined by f (θ) := kD(r) θk1 is crucial for proving risk results of the penalized trend filtering estimator. The following result precisely characterizes the subdifferential of f and is crucial for proving Lemma 3.7. Proposition 4.4. Fix θ ∈ Rn . Then ∂f (θ) consists of vectors v ∈ Rn such that  n  X r+i−j−1 aj := vi = 0 r−1 i=j and for 1 ≤ j ≤ r, (77)   n  X r+i−j−1 sgn((D(r) θ)j−r ) if (D(r) θ)j−r 6= 0 aj := vi = ∈ [−1, 1] otherwise r−1 i=j for r < j ≤ n. Here sgn(x) denotes the sign of x for x 6= 0. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 35 4.4. Metric Entropy and Fat Shattering Results We now state our main metric entropy result which is critical for our expected Gaussian suprema calculations (recall that expected Gaussian suprema can be related to metric entropy via Dudley’s entropy bound). The following result might also be of independent interest. Let us first formally define the notion of metric entropy. For a set K ⊂ Rn and  > 0, we define N (, K) to be the smallest integer m for which there exist points a1 , . . . , am ∈ Rn satisfying sup inf ka − ai k ≤  a∈K 1≤i≤m where, as usual, k · k denotes the Euclidean norm. The -metric entropy of K is the logarithm of N (, K). Our main metric entropy result is the following theorem which bounds the metric entropy of the class Sr (V, t) (defined in (34) and also recalled in the theorem below). Theorem 4.5. For r ≥ 1, t > 0, V > 0 and n ≥ r, let  Sr (V, t) := θ ∈ Rn : kθk ≤ t, V (D(r−1) θ) ≤ V n1−r . Then for every  > 0, we have    √ 1/r 2r nr t V n + r log 2 + √ + Cr log N (, Sr (V, t)) ≤ Cr   n (78) for a constant Cr that depends only on r. As mentioned in Subsection 2.1, the above theorem is proved using existing connections between metric entropy and fat shattering dimension. Let us first recall the notion of fat shattering dimension (see e.g., Pollard [30], Rudelson and Vershynin [31]): Definition 4.1 (Fat Shattering Dimension). Let K be a subset of Rn . For t ≥ 0, we say that a subset {i1 , . . . , im } of {1, . . . , n} is t-shattered by K if there exist real numbers hi1 , . . . , him such that for every subset S ⊆ {i1 , . . . , im }, there exists a vector θ ∈ K for which θik ≤ hik if ik ∈ S and θik ≥ hik + t if ik ∈ / S. The fat shattering dimension of K, denoted by v(K, t) is defined as the maximum cardinality of a set {i1 , . . . , im } ⊆ {1, . . . , n} that is t-shattered by K. A deep connection between fat shattering dimension and metric entropy is given by the following result due to Rudelson and Vershynin [31, Corollary 6.4] which bounds the metric entropy using the fat shattering dimension. Theorem 4.6 (Rudelson and Vershynin). Let K be a subset of Rn . Assume that there exists a decreasing function v : (0, ∞) → (0, ∞) and a real number a > 2 such that v(K, s) ≤ v(s) and 1 v(as) ≤ v(s) 2 for all s > 0. (79) imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering Then there exists a constant C depending on a alone such that    √ log N (, K) ≤ Cv . C n 36 (80) In the course of proving Theorem 4.5 using the fat shattering dimension, we prove the following result which provides an upper bound on the fat shattering dimension of the class Cr (a, V ) defined in (35). This result might be of independent interest. Lemma 4.7. For every V > 0, a ∈ R, r ≥ 1, n ≥ r and t > 0, we have v(Cr (a, V ), t) ≤ r + V 1/r n1−(1/r) Cr t1/r (81) for a positive constant Cr that depends solely on r. Acknowledgements We thank Ryan Tibshirani for informing us about the reference, Steidl et al. [34], and for many other helpful comments. Appendix A: Proofs for key technical supporting results from the paper In this section, we prove the key technical supporting results which were used for the proofs of the main results of the paper. In Subsection A.1, we study the tangent cones of K (r) (V ) and provide proofs of Lemma 4.1 and Lemma 3.2. Subsection A.2 is devoted to calculations of expected Gaussian suprema and to the proofs of Lemma 3.1 and Lemma 4.3. In Subsection A.3, we study the subdifferential of θ 7→ kD(r) θk1 and provide proofs of Proposition 4.4 and Lemma 3.7. Subsection A.4 is devoted to the proof of Theorem 4.5 which is our main metric entropy result. A.1. Study of the tangent cones TK (r) (V ) (θ) and the proof of Lemma 3.2 This section deals with the tangent cone of the convex set K (r) (V ) (defined in (6)) at θ ∈ Rn for which V (r) (θ) = V . This tangent cone, which was defined in (37), is denoted by TK (r) (V ) (θ). The ultimate goal of this subsection is to prove Lemma 3.2 which was crucial for the proof of Theorem 2.2. We start by proving Lemma 4.1 which gives a precise characterization of TK (r) (V ) (θ). Recall the notation (39). Also recall, from Section 2, the notion of rth order knots (along with their signs) of vectors in Rn . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 37 Proof of Lemma 4.1. We start with the proof of the first part of the lemma. Let T denote the set on the right hand side of (74). Let us first prove that T ⊆ TK (r) (V ) (θ). For this, we fix α ∈ T and argue that α ∈ TK (r) (V ) (θ), i.e., we show that there exists c > 0 such that θ + cα ∈ K (r) (V ). For c > 0, first note that, by the definition of V (·), the variation v := V (D(r−1) (θ + cα)) can be written as v= k X Vji ,ji+1 −1 (D (r−1) k X (θ + cα)) + i=0 (D(r−1) (θ + cα))ji − (D(r−1) (θ + cα))ji −1 i=1 Because θ has no rth order knots except at j1 , . . . , jk , first term above can be simplified to obtain v=c k X Vji ,ji+1 −1 (D (r−1) α) + k X i=0 (D(r−1) (θ + cα))ji − (D(r−1) (θ + cα))ji −1 . i=1 Now when c > 0 is sufficiently small, we can rewrite the above as v=c k X Vji ,ji+1 −1 (D (r−1) α) + i=0 = V (D k X n o ri (D(r−1) (θ + cα))ji − (D(r−1) (θ + cα))ji −1 i=1 (r−1) θ) + c ( k X Vji ,ji+1 −1 (D (r−1) α) − i=0 k X  ri (D (r−1) α)ji −1 − (D (r−1) α)ji  ) i=1 ≤ V n1−r where the last step follows from the fact that α ∈ T and V (D(r−1) θ) = V n1−r . This proves T ⊆ TK (r) (V ) . We shall now verify that TK (r) (V ) ⊆ T . As T is a closed convex cone, it is enough to show that α − θ ∈ T for every α ∈ K (r) (V ). For this, as D(r−1) (α − θ) = D(r−1) α − D(r−1) θ, we need to show that k X Vji ,ji+1 −1 (D(r−1) (α − θ)) + i=0 k X ri (D(r−1) α)ji − (D(r−1) α)ji −1  (82) i=1 is not larger than k X  ri (D(r−1) θ)ji − (D(r−1) θ)ji −1 . (83) i=1 This is easy because (83) equals V (D(r−1) θ) = V n1−r and (82) is clearly bounded from above by V (D(r−1) α) ≤ V n1−r . This proves the first part of the lemma. The second part is an easy consequence of the first part of the lemma and the following trivial observation. If ji and ji+1 denote two consecutive knots of θ and if ji0 is any integer with ji < ji0 < ji+1 , then  Vji ,ji+1 −1 (∆) ≥ Vji ,ji0 −1 (∆) + Vji0 ,ji+1 −1 (∆) + r0i ∆ji0 − ∆ji0 −1 for every α ∈ Rn and r0i ∈ {−1, 0, 1} where ∆ := D(r−1) α. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 38 The following corollary to Lemma 4.1 gives a simple sufficient condition for a vector α to belong to TK (r) (V ) (θ). Corollary A.1. Fix r ≥ 1 and let K (r) (V ) be as in (6). Let θ be any point in K (r) (V ) for which V (r) (θ) = V . Let 2 ≤ j1 < · · · < jk ≤ n − r + 1 and r1 , . . . , rk ∈ {−1, 0, 1} be as in Lemma 4.1(ii). For every 0 ≤ i ≤ k, let `i denote an arbitrary index lying in the set {ji , . . . , ji+1 − 1}. Then for every α ∈ TK (r) (V ) (θ) we have (with the convention that j0 = 1, jk+1 = n − r + 2, r0 = 0 and rk+1 = 0) k X Γi (α, `i ) ≤ i=0 k X (ri+1 − ri )(D(r−1) α)`i (84) i=0 where  Γi (α, `i ) := Vji ,ji+1 −1 (∆) − ri+1 ∆ji+1 −1 − ∆`i − ri (∆`i − ∆ji ) with ∆ = (∆1 , . . . , ∆n−r+1 ) := D(r−1) α. Proof of Corollary A.1. Fix α ∈ TK (r) (V ) (θ). Lemma 4.1 gives that k X Vji ,ji+1 −1 (∆) ≤ i=0 k X ri (∆ji −1 − ∆ji ) . (85) i=1 Writing  Vji ,ji+1 −1 (∆) = Γi (α, `i ) + ri+1 ∆ji+1 −1 − ∆`i + ri (∆`i − ∆ji ) P in (85), we deduce that ki=0 Γi (α, `i ) is bounded from above by k X i=1 ri (∆ji −1 − ∆ji ) − k X  ri+1 ∆ji+1 −1 − ∆`i − i=0 k X ri (∆`i − ∆ji ) . i=0 It is now trivial to check that the expression above equals the right hand side of (84) which completes the proof of Corollary A.1. We next show that under the assumption that kαk ≤ 1, the right hand side of (84) can be made to be small by choosing `0 , . . . , `k appropriately. This is the content of the next lemma. Let 2 ≤ j1 < · · · < jk ≤ n−r+1 and r1 , . . . , rk ∈ {−1, 0, 1} be as in Lemma 4.1(ii). Also let j0 = 1, jk+1 = n − r + 2 and r0 = rk+1 = 0. The indices j0 , j1 , . . . , jk , jk+1 can be used to define a partition of {1, . . . , n} in the following way: I0 := {j0 , . . . , j1 + r − 2} and Ii = {ji + r − 1, . . . , ji+1 + r − 2} for i = 1, . . . , k. Observe that the length of Ii equals ni where n0 := j1 + r − 2 and ni = ji+1 − ji for 1 ≤ i ≤ k. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 39 Lemma A.2. Let θ ∈ Rn and let 2 ≤ j1 < · · · < jk ≤ n − r + 1 and r1 , . . . , rk ∈ {−1, 0, 1} be as in Lemma 4.1(ii). Also let j0 = 1, jk+1 = n − r + 2 and r0 = rk+1 = 0. Further let I0 , . . . , Ik and n0 , . . . , nk be as described above. For every α ∈ Rn with kαk ≤ 1, there exist indices `0 ∈ I0 , . . . , `k ∈ Ik such that v u k k uX X n1−2r I{r 6= r } (r − r )(D(r−1) α) ≤ C t (86) i+1 i `i r i i i+1 i=0 i=0 where Cr is a positive constant that depends only on r. Remark A.1. The role of θ ∈ Rn in the above lemma is just to define the ji ’s and the ri ’s as in Lemma 4.1(ii). Remark A.2. The right hand side of (86) is obviously always bounded from above by P 1/2 k 1−2r Cr . However, for some special θ, it can be much smaller. For example, if i=0 ni j1 , . . . , jk all represent the knots of θ and if D(r−1) θ is monotone, then the signs r1 , . . . , rk are all equal and in that case the right hand side of (86) is much smaller and is bounded 1/2 by Cr n1−2r + n1−2r . 0 k Proof of Lemma A.2. The proof of Lemma A.2 is crucially reliant on Lemma 4.2 (proved in Section B.3) which essentially says that supα∈Rn :kαk≤t min1≤i≤n−r+1 (D(r−1) α)i ≤ Cr n(1/2)−r t for every t > 0 and n ≥ r. Fix α ∈ Rn . Define α(0) := (αj0 , . . . , αj1 +r−2 ) and α(u) := (αju +r−1 , . . . , αju+1 +r−2 ) Note that the vector α (u) for u = 1, . . . , k. has length exactly equal to nu , for u = 0, . . . , k. Fix 0 ≤ u ≤ k and let tu := kα(u) k. By Lemma 4.2, there exists an index `0u ∈ {1, . . . , nu − r + 1} such that (ru+1 − ru )(D(r−1) α(u) )`0u ≤ 2Cr nu1/2−r tu I{ru 6= ru+1 } (87) for a constant Cr depending on r alone. Taking `0 := `00 and `u := ju + r − 2 + `0u for 1 ≤ u ≤ k, and using the fact that (D(r−1) α)`0u = (D(r−1) α)`u , we deduce from (87) that (ru+1 − ru )(D(r−1) α)`u ≤ 2Cr n1/2−r tu I{ru 6= ru+1 } u for every u = 0, 1, . . . , k. The left hand side of (A.2) can therefore be bounded as k X i=0 (ri+1 − ri )(D(r−1) α)`i ≤ 2Cr k X 1/2−r ni ti I{ri 6= ri+1 } i=0 v v v u k u k u k uX uX uX t 2 ≤ 2C t n1−2r I{r 6 = r } t ni1−2r I{ri 6= ri+1 } ≤ 2Cr t i i+1 r i i i=0 i=0 i=0 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering where we have used Cauchy-Schwarz inequality and the fact that Pk 2 i=0 ti 40 = kαk2 ≤ 1. It is now easy to see that Lemma 3.2 is a consequence of Corollary A.1 and Lemma A.2. Proof of Lemma 3.2. The result follows from combining Corollary A.1 and Lemma A.2. A.2. Expected Gaussian Suprema Calculations: Proofs of Lemma 3.1 and Lemma 4.3 In this section, we shall provide proofs for the Gaussian suprema results: Lemma 3.1 (which was crucially used for the proof of Theorem 2.1) and Lemma 4.3 (which is a stronger version of Lemma 3.3 that was crucial for the proof of Theorem 2.2). We start with the proof of Lemma 3.1 which itself is based on an important metric entropy result (Theorem 4.5; proved in Subsection A.4). Proof of Lemma 3.1. Let G denote the left hand side of (33). We use Dudley’s entropy bound to deduce that Z tp log N (, Sr (V, t)) d G ≤ Cσ 0 where the set Sr (V, t) is defined as {θ ∈ Rn : kθk ≤ t, V (D(r−1) θ) ≤ V n1−r } and N (, Sr (V, t)) denotes the -covering number of Sr (V, t) under the Euclidean metric. These covering numbers are bounded in Theorem 4.5 which furnishes a constant Cr such that   √ 1/(2r) s  p 2r nr t V n log N (, Sr (V, t)) ≤ Cr + r log 2 + √ + Cr for every  > 0   n where we have also used the elementary inequality a1 , a2 , a3 ≥ 0. It follows therefore that √ a1 + a2 + a3 ≤ √ √ √ a1 + a2 + a3 for  √ 1/(2r)  Z ts  V n 2r nr t + Cr σt + Cr σ log 2 + √ d. G ≤ Cr σt t  n 0 (88) The last integral above can be controlled in the following way:   Z ts  Z 1s  r r 1 2nt 2r nr d = log 2 + √ log 2 + √ du t 0  n u n 0 s s  √    Z nn−r Z 1 r r 2n 2r nr = log 2 + √ du + √ log 2 + √ du. u n u n 0 nn−r imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 41 √ −r In the second integral above, we use u ≥ nnp to argue that the second integral is p r 2r−1 bounded from above by log(2 + 2 n ) ≤ Cr log(en). For the first integral, we use   2r nr 2r nr 2r+1 nr √ √ log 2 + ≤1+ ≤ √ u n u n u n to obtain √ Z 0 nn−r s   2r nr log 2 + √ du ≤ Cr . u n We have therefore proved that  √ 1/(2r) p V n + Cr σt log(en) G ≤ Cr σt t for a constant Cr which completes the proof of Lemma 3.1. We now turn to the proof of Lemma 4.3. As described in Remark 4.4, Lemma 4.3 implies Lemma 3.3. Before proceeding to prove Lemma 4.3, we prove an auxiliary result below which will considerably simplify the proof of Lemma 4.3. Lemma A.3. For every r ≥ 1, n ≥ r, t > 0 and δ ≥ 0, we have   E   sup θ∈Rn :kθk≤t V (D(r−1) θ)≤(D(r−1) θ)n−r+1 −(D(r−1) θ)1 +δ p   r−1/2 log(en) hξ, θi ≤ C σ t + δn r  (89) for a constant Cr that depends on r alone. Proof of Lemma A.3. We can assume without loss of generality that t = 1 (which is ensured by scaling and replacing δ by δ/t). The idea of this proof is to write θ as the difference of two vectors α(θ) and β(θ) which satisfy min1≤i≤n−r (D(r) α(θ))i ≥ 0 and min1≤i≤n−r (D(r) β(θ))i ≥ 0. A recent result from Bellec [2, Theorem 7] will then be used to control the Gaussian suprema over the class of all γ ∈ Rn which satisfy min1≤i≤n−r (D(r) γ)i ≥ 0. To construct the sequences α(θ) and β(θ), we use Lemma B.2 which gives the following formula for expressing a vector θ ∈ Rn in terms of D(r) θ and (D(i) θ)1 for i = 0, . . . , r − 1:   i−r  r  X X i−j−1 i−1 (r) θi = (D θ)j + (D(j−1) θ)1 r−1 j−1 j=1 j=1   where we take the convention that ab = 0 for b > a, 00 = 1 and that the first term in the right hand side is zero unless i > r. Motivated by the above expression, we define α(θ) := (α1 (θ), . . . , αn (θ)) and β(θ) := (β1 (θ), . . . , βn (θ)) in the following way:   r  r  X X i−j−1 i−1 (r) + αi (θ) := (D θ)j + (D(j−1) θ)1 r − 1 j − 1 j=1 j=1 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering and 42  r  X i−j−1 βi (θ) := (D(r) θ)− j r−1 j=1 where x+ := max(x, 0) and x− := x − x+ . It is easy then to observe the following: (a) (r) (r) − θ = α(θ) − β(θ), (b) (D(r) α(θ))i = (D(r) θ)+ i , (D β(θ))i = (D θ)i , (c) both vectors α(θ) [r] and β(θ) belong to Sn where Sn[r]  := n γ∈R : min (D 1≤i≤n−r (r)  n o γ)i ≥ 0 = γ ∈ Rn : (D(r−1) γ)1 ≤ · · · ≤ (D(r−1) γ)n−r+1 , and (d) (D(j−1) β(θ))1 = 0 for 1 ≤ j ≤ r. From these, it follows that V (D (r−1) θ) = kD (r) θk1 = = n−r X i=1 n−r X |(D(r) θ)i | (D(r) α(θ))i + i=1 (r−1) = (D n−r X (D(r) β(θ))i i=1 α(θ))n−r+1 − (D(r−1) α(θ))1 + (D(r−1) β(θ))n−r+1 − (D(r−1) β(θ))1 = (D(r−1) α(θ))n−r+1 − (D(r−1) α(θ))1 + (D(r−1) β(θ))n−r+1 . From the above (and the fact that D(r−1) θ = D(r−1) α(θ) − D(r−1) β(θ)), it is straightforward to observe that the condition V (D(r−1) θ) ≤ (D(r−1) θ)n−r+1 − (D(r−1) θ)1 + δ is equivalent to δ (D(r−1) β(θ))n−r+1 ≤ . 2 (90) [r] Now for β(θ) ∈ Sn , (D(j−1) β)1 = 0 for 1 ≤ j ≤ r, and satisfying (90), we can use Lemma B.2 (with r replaced by r − 1) to observe that    i−r+1  δ X i−j−1 δ i−1 δ 0 ≤ βi (θ) ≤ = ≤ ir−1 2 j=1 r−2 2 r−1 2 where we have used the identity (112). A consequence of the above is that kβ(θ)k2 ≤ n δ 2 X 2r−2 δ 2 2r−1 i ≤ n 4 i=1 4 or kβ(θ)k ≤ δnr−1/2 /2. Because kθk ≤ 1, we further deduce that δ kα(θ)k ≤ kθk + kβ(θ)k ≤ 1 + nr−1/2 . 2 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering Based on these observations, if  43   G := E   hξ, θi , sup θ∈Rn :kθk≤t V (D(r−1) θ)≤(D(r−1) θ)n−r+1 −(D(r−1) θ)1 +δ we can write " # G≤E " # hξ, αi + E sup [r] sup hξ, −βi . [r] α∈Sn :kαk≤1+δnr−1/2 /2 β∈Sn :kβk≤δnr−1/2 /2 By an elementary scaling property and the fact that ξ and −ξ have the same distribution, we deduce that " #  G ≤ 1 + δnr−1/2 E sup hξ, αi . [r] α∈Sn :kαk≤1 The right hand side above can be bounded using a recent result from Bellec [2, Theorem 7] which states that " # p E sup hξ, αi ≤ Cr σ log(en) [r] α∈Sn :kαk≤1 for a constant Cr . To be precise, Bellec [2, Theorem 7] proved that the “statistical dimen[r] sion” of the cone Sn is bounded from above by Cr2 log(en) for a positive constant Cr2 . See Bellec [2] or Amelunxen et al. [1] for a precise definition of statistical dimension of a convex cone. From here, the above displayed inequality follows from Amelunxen et al. [1, Proposition 10.2] which says that for every cone K, the quantity E supα∈K,kαk≤1 hξ/σ, αi is bounded from above by the square root of the statistical dimension of K. We therefore have p G ≤ Cr 1 + δnr−1/2 log(en). which completes the proof of Lemma A.3. We are now ready to prove Lemma 4.3. Proof of Lemma 4.3. The case when r1 = r2 = 0 follows directly from Lemma 3.1 so we assume that at least one of r1 and r2 is non-zero. For θ ∈ Rn , let θ(1) := (θ1 , . . . , θ`+r−1 ) and θ(2) := (θ`+r , . . . , θn ). We analogously define ξ (1) and ξ (2) . Recall that ∆ ≡ ∆(θ) = (∆1 (θ), . . . , ∆n−r+1 (θ)) := D(r−1) θ. We first claim that under the assumption V (∆) ≤ r1 (∆` − ∆1 ) + r2 (∆n−r+1 − ∆` ) + δ, we have V (D(r−1) θ(1) ) = V (∆1 , . . . , ∆` ) ≤ r1 (∆` − ∆1 ) + δ (91) V (D(r−1) θ(2) ) = V (∆`+r , . . . , ∆n−r+1 ) ≤ r2 (∆n−r+1 − ∆`+r ) + δ. (92) and imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 44 Inequality (91) is a consequence of r1 (∆` − ∆1 ) + r2 (∆n−r+1 − ∆` ) + δ ≥ V (∆) ≥ V (∆1 , . . . , ∆` ) + r2 (∆n−r+1 − ∆` ) while (92) is a consequence of r1 (∆` − ∆1 ) + r2 (∆n−r+1 − ∆` ) + δ ≥ V (∆) ≥ r1 (∆` − ∆1 ) + V (∆`+r , . . . , ∆n−r+1 ) + r2 (∆`+r − ∆` ). P From inequalities (91) and (92), and the fact that hξ, θi = 2i=1 ξ (i) , θ(i) , it follows that G ≤ G1 + G2 where    G1 := E sup ξ (1) , θ(1) : kθ(1) k ≤ t, V (D(r−1) θ(1) ) ≤ r1 ((D(r−1) θ(1) )` − (D(r−1) θ(1) )1 ) + δ and h nD E oi G2 := E sup ξ (2) , θ(2) : kθ(2) k ≤ t, V (D(r−1) θ(2) ) ≤ r2 ((D(r−1) θ(2) )n−`−2r+2 − (D(r−1) θ(2) )1 ) + δ . We now argue that n o ( p Cr σ t(2r−1)/(2r) (` + r − 1)(2r−1)/(4r) δ 1/(2r) + t log(e(` + r − 1)) : r1 = 0 G1 ≤ p  log(e(` + r − 1)) : r1 6= 0. Cr σ t + δ(` + r − 1)(2r−1)/2 To see this, note first that when r1 = 0, the bound will simply follow from Lemma 3.1. When r1 = 1, the bound will follow from Lemma A.3. Finally when r1 = −1, we can switch from θ(1) to −θ(1) so that the bound will again follow from Lemma A.3. An identical argument also gives ( G2 ≤ n o p Cr σ t(2r−1)/(2r) (n − ` − r + 1)(2r−1)/(4r) δ 1/(2r) + t log(e(n − ` − r + 1)) : r2 = 0 p  Cr σ t + δ(n − ` − r + 1)(2r−1)/2 log(e(n − ` − r + 1)) : r2 6= 0. By putting together the above bounds for G1 and G2 the proof of Lemma 4.3 is complete. A.3. Subdifferential of θ 7→ kD (r) θk1 and proof of Lemma 3.7 This subsection provides a study of the subdifferential ∂f (θ) where f (θ) := kD(r) θk1 with an aim to prove Lemma 3.7. We start by proving Proposition 4.4 which gives a precise characterization of the subdifferential. Proof of Proposition 4.4. Let us first construct an n × n matrix M such that for every β ∈ Rn , we have  (D(i−1) β)1 for i = 1, . . . , r (M β)i = (D(r) β)i−r for i = r + 1, . . . , n. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 45 This is of course possible because β 7→ (D(i) β)j is a linear mapping. More specifically, it can be checked that M = (Mij ) defined by (  (−1)i−j i−1 I{1 ≤ j ≤ i ≤ n} for 1 ≤ i ≤ r, 1 ≤ j ≤ n i−j  Mij = i−j r I{i − r ≤ j ≤ i} for r + 1 ≤ i ≤ n, 1 ≤ j ≤ n (−1) i−j satisfies the requirement. This is a consequence of the expression:   j+r X r j+r−k βk (D β)j = (−1) k−j k=j (r) for 1 ≤ j ≤ n − r. It is easy to see from the formula for M that it is lower triangular with positive diagonal entries and hence invertible. Now a vector v ∈ Rn is in ∂f (θ) if and only if it satisfies for every β ∈ Rn . f (θ + β) − f (θ) ≥ hv, βi (93) The left hand side above can be written as f (θ + β) − f (θ) = n−r X   |(D(r) θ)j + (M β)j+r | − |(D(r) θ)j | . (94) j=1 The right hand side in (93) can be written using Lemma B.2 as hv, βi = n X vi βi i=1 n X   i−r  n r  X X X i−j−1 i−1 (r) = vi (D β)j + vi (D(j−1) β)1 r − 1 j − 1 i=1 j=1 i=1 j=1    n−r n r n  X X i−j−1 X X i−1 (r) (j−1) = (D β)j vi + (D β)1 vi r−1 j−1 j=1 i=r+j j=1 i=j = n−r X ar+j (M β)r+j + j=1 r X bj (M β)j j=1 where  n  X i−1 bj := vi , 1 ≤ j ≤ r j−1 i=1 and ar+j  n  X i−j−1 := vi , 1 ≤ j ≤ n − r. r−1 i=r+j We now set β = ±M −1 ej for 1 ≤ j ≤ r, where ej is the j’th standard basis vector of Rn . Then, using (94), f (θ + β) − f (θ) = 0, so we must have hv, βi = bj = 0. Now set β = λM −1 er+j for 1 ≤ j ≤ n − r. If (D(r) θ)j > 0, then f (θ + β) − f (θ) = λ for imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 46 λ ≥ −(D(r) θ)j , and hv, βi = λar+j . In particular, ar+j ≤ 1 by taking λ > 0, and ar+j ≥ 1 by taking 0 > λ ≥ −(D(r) θ)j , so we must have ar+j = 1. Similarly, if (D(r) θ)j < 0, then we must have ar+j = −1. If (D(r) θ)j = 0, then f (θ + β) − f (θ) = |λ|, so we must have ar+j ∈ [−1, 1]. We have thus proved that if v ∈ ∂f (θ), then bj = 0 for 1 ≤ j ≤ r and  sgn((D(r) θ)j ) if (D(r) θ)j 6= 0 ar+j = ∈ [−1, 1] otherwise for 1 ≤ j ≤ n − r. On the other hand, it is easy to see that if these two conditions are satisfied, then v ∈ ∂f (θ). The proof of Lemma 4.4 will then be complete by the observation that bj = 0 for 1 ≤ j ≤ r is equivalent to aj = 0 for 1 ≤ j ≤ r, where aj is as defined in (77). To see this, just note that   n     r  r  n i  X X X X r−j i−1 r−j r−j X i−1 bk = vi = vi r−k r − k i=k k − 1 r−k k−1 i=j k=j k=j k=j   X   n r  n X X r−j i−1 r+i−j−1 = vi = vi = aj . r−k k−1 r−1 i=j i=j k=1 so that (aj )rj=1 is related to (bj )rj=1 by a triangular linear system. This completes the proof of Proposition 4.4. Proof of Lemma 3.7. We are now ready to prove Lemma 3.7. The proof of the first part of the lemma (inequality (68)) is short while the proof of the second part (inequality (69) is long. We first provide the proof of inequality (68) and then proceed to the proof of inequality (69). Proof of inequality (68). Fix θ∗ ∈ Rn with D(r) θ∗ 6= 0n−r . Let aff(∂f (θ∗ )) denote the affine hull of ∂f (θ∗ ). We shall take v0 to be the projection of the zero vector 0n on aff(∂f (θ∗ )). It is then easy to see that hv − v0 , v0 i = 0 for all v ∈ ∂f (θ∗ ). It therefore only remains to prove the lower bound on kv0 k. Because ∂f (θ∗ ) is given by a finite number of linear inequalities (i.e., it is a polyhedron), its affine hull is given by the intersection of the inequalities which are actually equalities (see, for example, Schrijver [33, Chapter 8]). Therefore, aff(∂f (θ∗ )) is given by the vectors v ∈ Rn for which (77) holds and for which  n  X r+i−j−1 aj = vi = sgn(D(r) θ∗ ) r − 1 i=j for r < j ≤ n such that (D(r) θ∗ )j−r 6= 0. Let the number of rth order knots of θ∗ be k so that the number of equalities in aff(∂f (θ∗ )) is k + r. We can represent these equalities in matrix form as Bv = b where B is (k + r) × n and b ∈ Rk+r with kbk1 = 1. Note also that maxi,j |Bij | ≤ n+r−2 so that r−1   k+r X n+r−2 kBxk1 (r + 1)k kBk1 := sup = max |Bij | ≤ (k + r) ≤ (2n)r−1 . 1≤j≤n kxk (r − 1)! r − 1 x6=0 1 i=1 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 47 As a result, because the vector v0 satisfies Bv0 = b, we obtain kv0 k1 (r − 1)! −r+1/2 kbk1 k (r + 1)k kv0 k ≥ √ ≥ √ (2n)r−1 = ≥√ n . (r + 1)2r−1 n nkBk1 n (r − 1)! This proves (68). Proof of Inequality (69). Fix θ∗ ∈ Rn . Let 2 ≤ j1 < · · · < jk ≤ n − r + 1 be the rth order knots of θ along with associated signs r1 , . . . , rk ∈ {−1, 1}. Also let j0 = 1, jk+1 = n − r + 2 and r0 = rk+1 = 0. It will be convenient below to take mi := ji + r − 1 for l = 0, . . . , k. Also let n0 = j1 + r − 2 and ni = ji+1 − ji for i = 1, . . . , k. Because it is assumed that the minimum length condition (12) holds for θ∗ with constant c, it follows that ni ≥ cn/(k + 1) whenever ri 6= ri+1 . Let g : R → R be a smooth (i.e., C ∞ ) function such that 1. g(0) = 0, g(1) = 1. 2. g(j) (0) = g(j) (1) = 0 for j ≥ 1. 3. g(t) ∈ [0, 1] for t ∈ [0, 1]. where g(j) is the j th order derivative of g. For example, the function g(x) := where   ( −1 for t ∈ (0, 1) γ exp t(1−t) φ(t) = 0 otherwise R1 where γ is chosen so that 0 φ(t)dt = 1 will satisfy the requirements for g. Rx 0 φ(t)dt Let us now define a function S : [1, n + r] → R as follows: ( 0    for t ∈ [1, r] ∪ [n + 1, n + r]  S(t) = t−mi t−mi + ri+1 g ni for mi ≤ t ≤ mi+1 and 0 ≤ i ≤ k ri 1 − g ni By an abuse of notation, we shall also denote by S, the n+r-dimensional vector (S(1), . . . , S(n+ r)). It will be clear from the context whether we are referring to the vector S or the function S. From the properties of g, it is easy to deduce that S(mi ) = ri and S (j) (mi ) = 0 for all j and 0 ≤ i ≤ k + 1. Also supt∈[1,n+r] |S(t)| ≤ 1. The first key observation is that the vector v ∗ ∈ Rn defined by vj∗   j+r X r k−j := (−1) (D S)j = (−1) Sk k − j k=j r (r) for 1 ≤ j ≤ n belongs to the subdifferential ∂f (θ∗ ). To see this, we need to use Proposition 4.4. Note imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 48 that for 1 ≤ j ≤ n, a∗j :=  n  X r+i−j−1 r−1 i=j vi∗  i+r   n  X r+i−j−1 X r k−i = (−1) Sk r−1 k−i i=j n+r X = = k=i min(k,n) Sk X i=k−r n X k X Sk   r r+i−j−1 k−i r−1 (−1) k=j k=j  k−i k−i    r r+i−j−1 k−i r−1 (−1) i=k−r where the last equality follows because Sk = 0 for k = n + 1, . . . , n + r. Now let   r+i−j−1 βi := for i = . . . , −2, −1, 0, 1, 2, . . . r−1 where the binomial coefficient is taken to be zero if r + i − j − 1 < r − 1. Then   k n n X X X r k−i ∗ (−1) Sk (D(r) β)k−r . Sk βi = aj = k − i i=k−r k=j k=j It is now easy to see that βi is a polynomial in i for i ≥ j + 1 − r which implies that (D(r) β)k−r = 0 for k ≥ j + 1. It can also be checked that (D(r) β)j−r = 1. This therefore gives a∗j = Sj for j = 1, . . . , n. Proposition 4.4 and the fact that Sj = S(j) = 0 for 1 ≤ j ≤ r, S(mi ) = ri and |S(t)| ≤ 1 for all t proves that v ∗ ∈ ∂f (θ∗ ). We shall now bound kv ∗ k by writing ∗ 2 kv k = k+1 X m l −1 X vj∗ 2 + l=0 j=ml −r+1 = k+1 X m l −1 X k mX l+1 −r X j=ml l=0 (r) vj∗ 2 2 ((D S)j ) + l=0 j=ml −r+1 k mX l+1 −r X l=0 ((D(r) S)j )2 j=ml Let Mr := sup g(r) (t) , t∈[0,1] and note that −r S (r) (t) ≤ |rl+1 − rl |Mr n−r l ≤ 2Mr nmin for t ∈ [ml , ml+1 ] and 0 ≤ l ≤ k where nmin := min 0≤i≤k:ri 6=ri+1 ni . Then for ml − r < j < ml + r and 0 ≤ l ≤ k + 1 we have |S(j)| ≤ 2rr 2er 2Mr n−r min √ |j − ml |r ≤ Mr n−r ≤ Mr n−r min min r! r! 2πr imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 49 by (r − 1)-th order Taylor expansion about ml and Stirling’s approximation. (The bound trivially holds if j < r or j > n; if j ∈ / (ml−1 , ml+1 ), then the bound holds by expansion about the nearest mi ). Thus for ml − r < j < ml and 0 ≤ l ≤ k + 1, again by Stirling’s approximation, we have r   X r 2er 2r+1 er √ √ |(D S)j | ≤ Mr n−r ≤ Mr n−r min min i 2πr 2πr i=0 (r) and so k+1 X l=0 m l −1 X k+1 X 22r+2 e2r 2 −2r Mr nmin ((D S)j ) ≤ (r − 1) 2πr j=m −r+1 l=0 (r) 2 (95) l ≤ 2(k + 2) −2r 2r 2 (2e)2r Mr2 n−2r min ≤ (2e) Mr (k + 1)nmin . π We now proceed to the second term for bounding kv ∗ k. For this, let Nr = sup g(r+1) (t) , t∈[0,1] and note that S (r+1) (t) ≤ |rl+1 − rl |Nr nl−r−1 . for t ∈ [ml , ml+1 ] and 0 ≤ l ≤ k. Then for ml ≤ j ≤ ml+1 − r and 0 ≤ l ≤ k, r (r) (r) (−1) (D S)j − S (j) ≤ r   X r |rl+1 − rl |Nr n−r−1 l i=0 ≤p (r + 1)! i 2r er+1 2π(r + 1) r+1 i 2r rr+1 ≤ |rl+1 − rl |Nr n−r−1 l (r + 1)! |rl+1 − rl |Nr nl−r−1 ≤ 2r−1 er+1 √ |rl+1 − rl |Nr n−r−1 , l π by r-th order Taylor expansion about j and Stirling’s approximation, using the fact that the r’th order forward difference approximates the r’th derivative up to an error depending on the (r + 1)’th derivative (i.e. all lower order terms in the Taylor expansion cancel). Then the trivial inequality |a2 − b2 | ≤ (a − b)2 + 2|b||a − b| gives, for 2 Tj := ((D(r) S)j )2 − S (r) (j) , the upper bound 2 Tj ≤ (−1)r (D(r) S)j − S (r) (j) + 2 S (r) (j) (−1)r (D(r) S)j − S (r) (j) 2r er+1 22r−2 e2r+2 √ (rl+1 − rl )2 Mr Nr n−2r−1 ≤ (rl+1 − rl )2 Nr2 n−2r−2 + l l π π ≤ (2e)2r (rl+1 − rl )2 (Mr + Nr )Nr nl−2r−1 . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 50 So for 0 ≤ l ≤ k we have, ml+1 −r ml+1 −r X (r) 2 ((D S)j ) − X S (r) (j) 2 ≤ (nl − r + 1)(2e)2r (rl+1 − rl )2 2Mr + Nr )Nr n−2r−1 l j=ml j=ml ≤ (2e)2r (rl+1 − rl )2 (Mr + Nr )Nr nl−2r ≤ 4(2e)2r (Mr + Nr )Nr n−2r min . (the above bound trivially holds if nl < r.) Thus k mX l+1 −r X (r) 2 ((D S)j ) ≤ k mX l+1 −r X j=ml l=0 l=0 2 −2r S (r) (j) + 4(2e)2r (Mr + Nr )Nr (k + 1)nmin . Now let d  (r) 2  , g (t) dt Kr = sup t∈[0,1] and note that (96) j=ml d  (r) 2  ≤ (rl+1 − rl )2 Kr nl−2r−1 S (t) dt for t ∈ [ml , ml+1 ] and 0 ≤ l ≤ k, regarding the derivative as one-sided at the endpoints. Then for ml ≤ j ≤ ml+1 − r and 0 ≤ l ≤ k, Z j+1 Z j+1 2 2 (r) (r) S (j) − S (t) dt ≤ (rl+1 − rl )2 Kr n−2r−1 (t − j)dt l j j 1 = (rl+1 − rl )2 Kr n−2r−1 l 2 by a zeroth order Taylor expansion about j. So for 0 ≤ l ≤ k we have ml+1 −r X (r) S (j) 2 Z ml+1 −r+1 − ml j=ml 2 1 S (r) (t) dt ≤ (nl − r + 1) (rl+1 − rl )2 Kr n−2r−1 l 2 1 ≤ (rl+1 − rl )2 Kr n−2r ≤ 2Kr n−2r min . l 2 (The bound trivially holds if nl < r.) Thus k mX l+1 −r X l=0 j=ml (r) S (j) 2 ≤ k Z X l=0 ml+1 −r+1 S (r) (t) 2 −2r dt + 2Kr (k + 1)nmin . (97) ml Let Z Ir = 1 2 g(r) (t) dt, 0 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 51 and note that for 0 ≤ l ≤ k, Z ml+1 −r+1 2 S (t) dt ≤ (r) Z ml+1 2 S (t) dt = (r) = (rl+1 − rl ) Thus k Z X l=0 ml+1 ml ml ml Z 2 Ir n−2r+1 l jm+1 −r+1 S (r) (t) 2   2 t − ml (r) (rl+1 − rl ) g n−2r dt l nl 2 ≤ 4Ir n−2r+1 min . dt ≤ 4Ir (k + 1)n−2r+1 min . (98) ml Combining bounds (95), (96), (97), and (98), we have −2r −2r −2r+1 2r kv ∗ k2 ≤ (2e)2r Mr2 (k + 1)n−2r min + 4(2e) (Mr + Nr )Nr (k + 1)nmin + 2Kr (k + 1)nmin + 4Ir (k + 1)nmin  −2r+1 ≤ (2e)2r (Mr + 2Nr )2 + 2Kr + 4Ir (k + 1)nmin . p (2e)2r (Mr + 2Nr )2 + 2Kr + 4Ir This proves the desired inequality (69) with Cr = (because of the fact that nmin ≥ cn/(k + 1) under assumption (12)). A.4. Metric Entropy Result This section is dedicated to the proof of our main metric entropy result, Theorem 4.5, which is essential for our expected suprema calculations. The following notion will be useful in the proof of Theorem 4.5. Definition A.1. For r ≥ 1, n ≥ r, real numbers a0 , . . . , ar−1 and non-negative real numbers s0 , . . . , sr−1 , let Cr ({ai }, {si }) denote the class of all θ ∈ Rn for which ai ≤ (D(i) θ)1 ≤ ai + si , i = 0, 1, . . . , r − 2, and ar−1 ≤ (D(r−1) θ)1 ≤ · · · ≤ (D(r−1) θ)n−r+1 ≤ ar−1 + sr−1 . The following lemma gives an upper bound on the metric entropy of Cr ({ai }, {si }). This is the most important ingredient for the proof of Theorem 4.5. The proof of this lemma is given in Subsection B.6 and is based on an upper bound on the fat shattering dimension of the classes Cr (a, V ) (proved in Lemma 4.7) together with Theorem 4.6 which relates fat shattering dimension to metric entropy. Lemma A.4. For every  > 0, r ≥ 1, n ≥ r, a0 , . . . , ar−1 ∈ R and s0 , . . . , sr−1 ≥ 0, we have !1/r √ Pr n j=1 nj−1 sj−1 log N (, Cr ({ai }, {si })) ≤ Cr  where Cr is a positive constant that depends on r alone. We are now ready to prove Theorem 4.5. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering Proof of Theorem 4.5. Fix δ > 0 and let  Ki := max u ≥ 0 integer : uδ ≤ 2i t 52 for 0 ≤ i < r. It is then clear that Ki ≤ 2i t/δ < Ki + 1 for every 0 ≤ i < r. Let K denote the class of all vectors k := (k0 , . . . , kr−1 ) where each ki is an integer satisfying −(Ki + 1) ≤ ki ≤ Ki . For every k = (k0 , . . . , kr−1 ) ∈ K, let  M(k) := θ ∈ Sr (V, t) : ki δ ≤ (D(i) θ)1 ≤ (ki + 1)δ for 0 ≤ i < r . As (i) (D θ)1 = i+1 X j (−1) j=1   2  2 !1/2 i i + ··· + kθk 0 i  1/2 2i = kθk ≤ 2i kθk ≤ 2i t i  i θj ≤ j−1 for θ ∈ Sr (V, t) and 0 ≤ i < r, it follows that Sr (V, t) ⊆ ∪k∈K M(k). As a result N (, Sr (V, t)) ≤ X N (, M(k)) ≤ 2r r−1 Y (Ki + 1) sup N (, M(k)). i=0 k∈K k∈K Since Ki ≤ 2i t/δ ≤ 2r−1 t/δ, we deduce   2r t log N (, Sr (V, t)) ≤ r log 2 + + sup log N (, M(k)). δ k∈K (99) We now bound log N (, M(k)) from above for a fixed k ∈ K. For every θ ∈ Rn , let us define two vectors α(θ) := (α1 (θ), . . . , αn (θ)) and β(θ) := (β1 (θ), . . . , βn (θ)) in Rn via   i−r  r  X X i−j−1 i−1 (r) + αi (θ) := (D θ)j + (D(j−1) θ)+ 1 r − 1 j − 1 j=1 j=1 and βi (θ) :=  i−r  X i−j−1 j=1 r−1 (D (r) θ)− j (100)  r  X i−1 + (D(j−1) θ)− 1 j − 1 j=1 where x := max(x, 0) and x− = x − x+ . It then follows from Lemma B.2 that θ = α(θ) − β(θ) and, consequently, + log N (, M(k)) ≤ log N (/2, Mα (k)) + log N (/2, Mβ (k)) (101) where Mα (k) := {α(θ) : θ ∈ M(k)} and Mβ (k) := {β(θ) : θ ∈ M(k)} . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 53 We now show how to control log N (/2, Mα (k)) below. The argument for log N (/2, Mβ (k)) will be similar. The main idea here (recall the definition of Cr ({ai }, {si }) from Definition A.1) is to note that Mα (k) ⊆ Cr ({ai }, {si }) (102) with ai = k+ i δ for i = 0, . . . , r − 1, and si = δ for i = 0, . . . , r − 2 and sr−1 = V n1−r + δ. To see (102), first note that from the definition of α(θ) in (100), it is straightforward to check that (D(r) α(θ))j = (D(r) θ)+ for j = 1, . . . , n − r (103) j and (D(i) α(θ))1 = (D(i) θ)+ 1 for 0 ≤ i < r. (104) From these identities, it is easy to verify (102) in the following way. Let θ ∈ M(k) so that α(θ) ∈ Mα (k). Then ki δ ≤ (D(i) θ)1 ≤ (ki + 1)δ for 0 ≤ i < r. This implies (because the map x 7→ x+ is non-decreasing and subadditive) via (104) that + (i) (i) + k+ i δ ≤ (D α(θ))1 = (D θ)1 ≤ ki δ + δ. (105) Also the identity (103) implies that D(r) α(θ) ≥ 0 which, together with (105), means that (r−1) k+ α(θ))1 ≤ · · · ≤ (D(r−1) α(θ))n−r+1 = V (D(r−1) α(θ)) + (D(r−1) α(θ))1 r−1 δ ≤ (D ≤ V (D(r−1) α(θ)) + k+ r−1 δ + δ. The statement (102) will therefore be proved if we establish that V (D(r−1) α(θ)) ≤ V n1−r . This follows since V (D(r−1) α(θ)) = kD(r) α(θ)k1 = k(D(r) θ)+ k1 ≤ kD(r) θk1 = V (D(r−1) θ) ≤ V n1−r . This proves (102). We can therefore use Lemma A.4 to bound log N (/2, Mα (k)) as 1/r  r−1 δn +V 1/(2r) . log N (/2, Mα (k)) ≤ Cr n  Using the elementary inequality (a + b)1/r ≤ a1/r + b1/r , we obtain the simpler inequality  √ 1/r δ 1/r n1−1/2r V n log N (/2, Mα (k)) ≤ Cr + Cr . (106) 1/r   Combining (99), (101) and (106), we obtain    √ 1/r 2r t δ 1/r n1−1/2r V n log N (, Sr (V, t)) ≤ r log 2 + + Cr + C . r δ 1/r  √ Note that δ > 0 above is arbitrary. Taking δ =  nn−r , we obtain (78) which completes the proof of Theorem 4.5. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 54 Appendix B: Additional technical results and proofs B.1. A result on Gaussian suprema Lemma B.1. Suppose p, n ≥ 1 and let Θ1 , . . . , Θp be subsets of Rn each containing the origin and each contained in the closed Euclidean ball of radius D centered at the origin. Then, for ξ ∼ N (0, σ 2 I), we have r     p π E max sup hξ, θi ≤ max E sup hξ, θi + Dσ . (107) 2 log p + 1≤i≤p 1≤i≤p θ∈Θi 2 θ∈Θi Proof of Lemma B.1. For every t ≥ 0, by the union bound   X   p P sup hξ, θi ≥ E sup hξ, θi + tσ . P max sup hξ, θi ≥ max E sup hξ, θi + tσ ≤ 1≤i≤p θ∈Θi 1≤i≤p θ∈Θi i=1 θ∈Θi θ∈Θi Now by hypothesis, every vector in Θi has norm bounded by D. As a result, the map ξ 7→ supθ∈Θi hξ, θi is Lipschitz with constant D. By the Gaussian concentration inequality, we deduce therefore that     t2 P sup hξ, θi ≥ E sup hξ, θi + σt ≤ exp − 2 for every 1 ≤ i ≤ p. 2D θ∈Θi θ∈Θi Consequently,       t2 P max sup hξ, θi ≥ max E sup hξ, θi + tσ ≤ min p exp − 2 , 1 1≤i≤p 1≤i≤p θ∈Θi 2D θ∈Θi for every t ≥ 0. Integrating both sides of this inequality from t = 0 to t = ∞, we obtain +      Z ∞ t2 ≤σ min p exp − 2 , 1 dt. E max sup hξ, θi − max E sup hξ, θi 1≤i≤p 1≤i≤p θ∈Θi 2D θ∈Θi 0 The trivial inequality a ≤ b + (a − b)+ therefore gives       Z ∞ t2 E max sup hξ, θi ≤ max E sup hξ, θi + σ min p exp − 2 , 1 dt. 1≤i≤p θ∈Θi 1≤i≤p 2D θ∈Θi 0 We will now bound the integral from above. For this, we simply write       Z ∞ Z D√2 log p Z ∞ t2 t2 min p exp − 2 , 1 dt ≤ 1dt + p √ exp − 2 dt 2D 2D 0 0 D 2 log p   p p √ = D 2 log p + 2πpD 1 − Φ( 2 log p) . We now √ complete the proof of (107) via the Gaussian tail bound 1−Φ(x) ≤ exp(−x2 /2)/2 for x = 2 log p (see e.g., Dumbgen [9]). imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 55 B.2. A formula for θ in terms of D (r) θ Lemma B.2. Fix r ≥ 1 and n ≥ r. For every θ ∈ Rn and 1 ≤ i ≤ n, we have   i−r  r  X X i−j−1 i−1 (r) θi = (D θ)j + (D(j−1) θ)1 r − 1 j − 1 j=1 j=1  where we take the convention that ab = 0 for b > a, the right hand side is zero unless i > r. 0 0  (108) = 1 and that the first term in Proof of Lemma B.2. We shall use induction on r ≥ 1. For r = 1, the formula (123) becomes i−1 X θi = (Dθ)j + θ1 (109) j=1 which is trivial because (Dθ)j = θj+1 − θj . Let us now assume that (123) is true for some r = ` ≥ 1 and we shall then prove it for r = ` + 1. Because (123) is true for r = `, we have   i−`  `  X X i−j−1 i−1 (`) θi = (D θ)j + (D(j−1) θ)1 . ` − 1 j − 1 j=1 j=1 (110) Inequality (109) for θ replaced by D` θ gives ` ` (D θ)j = (D θ)1 + j−1 X (D(`+1) θ)k . k=1 Using the above identity in (110), we obtain θi =  i−`  X i−j−1 `−1 j=1 = j−1  i−` X X j=1 k=1 = i−`−1 X (D θ)1 + j−1 X ! (D k=1 (`+1) θ)k +  `  X i−1 j=1 j−1 (D(j−1) θ)1   X  i−`  `  X i−j−1 i−j−1 i−1 (D(`+1) θ)k + (D` θ)1 + (D(j−1) θ)1 ` − 1 j − 1 `−1 j=1 j=1 (D(`+1) θ)k k=1 `   X  i−`  i−`  `  X X i−j−1 i−j−1 i−1 + (D` θ)1 + (D(j−1) θ)1 . `−1 ` − 1 j − 1 j=1 j=1 (111) j=k+1 We now use the following elementary identity involving binomial coefficients: For every two integers a and b with 0 ≤ b < a, we have         b b+1 a a+1 + + ··· + = . (112) b b b b+1 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 56 This identity gives    i−`  X i−j−1 i−k−1 = and ` − 1 ` j=k+1  i−`  X i−j−1 j=1 `−1   i−1 = . ` From the above and (111), we deduce that θi = i−`−1 X (D (`+1)  θ)k k=1  X  `+1  i−k−1 i−1 + (D(j−1) θ)1 ` j − 1 j=1 which is exactly (123) for r = ` + 1. This completes the proof of Lemma B.2. B.3. A result on the magnitude of min1≤i≤n−r+1 (D (r−1) θ)i when kθk ≤ 1 This section is devoted to the proof of the Lemma 4.2 which was crucially used in the proof of Lemma A.2. Proof of Lemma 4.2. We only need to prove the first inequality in (76). The second inequality follows by applying the first inequality to −θ. Via Lemma B.2, we can write the following for every θ ∈ Rn with kθk ≤ t: !2   n i−r  r  X X X i − j − 1 i − 1 t2 ≥ kθk2 = sj + (D(j−1) θ)1 r − 1 j − 1 i=1 j=1 j=1 where sj := (D(r) θ)j for = 1, . . . , n − r. It follows from here that   !2 n i−r  r  X X X i − j − 1 i − 1 t2 ≥ inf sj − βj . β1 ,...,βr ∈R r − 1 j − 1 i=1 j=1 j=1  i−1 We now define two matrices. Let X be the n × r matrix whose (i, j)th entry equals j−1 .  i−j−1 th Let S be the n × (n − r) matrix whose (i, j) entry equals r−1 . Throughout we use  the convention that ab = 0 when a < b. Also let s := D(r) θ = (s1 , . . . , sn−r )T and β := (β1 , . . . , βr ) . It is then easy to see from the previous inequality that t2 ≥ inf β1 ,...,βr ∈R kSs − Xβk2 = sT S T (I − PX )Ss (113) where PX = X(X T X)−1 X T is the projection matrix on to the column space of X. We now need the following two facts about the matrix A := S T (I − PX )S. These facts (whose proofs are long) are proved in Proposition B.5 and Proposition B.6 respectively. 1. If 1 denotes the n − r vector consisting of ones, then 1T A1 ≥ Cr n2r+1 for a constant Cr depending on r alone. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 57 2. Every entry of the matrix A is positive. We shall now complete the proof of Lemma 4.2 assuming the above two facts about the matrix A. Let δ := min1≤j≤n−r sj . Our goal is to prove that δ ≤ Cr tn−r−1/2 so we can assume that δ ≥ 0 for otherwise there is nothing to prove. In that case, inequality (113) and the second fact about A together imply t2 ≥ δ 2 1T S T (I − PX )S1 = δ 2 1T A1. The first fact about A then gives t2 ≥ Cr δ 2 n2r+1 and this completes the proof of Lemma 4.2. The remainder of this subsection is devoted to proving the two facts about the matrix A := S T (I − PX )S stated in the proof of Lemma 4.2. These proofs are tedious and long.  k if k ≥ 0 and 0 otherwise, where (n)k is the We adopt the convention that nk = (n) k! falling factorial, extending the definition of the binomial coefficient   to integerk arguments.  n n n We will make judicious use of the identities k = n−k and k = (−1) k−n−1 , as k   n  Pr m+n m well as the Chu-Vandermonde identity, = k=0 k r−k , in its equivalent form r  Pr  n  m+n m = k=s k−s r−k . r−s   i−1 Recall that X is the n × r matrix with Xij = j−1 = i−1 , S is the n × (n − r) matrix i−j   i−j−1 i−j−1 with Sij = r−1 = i−j−r if i − j ≥ r and 0 otherwise, and A = S T (I − PX )S where PX is the projection onto the column space of X. Our first step is to compute the inverse of the matrix A explicitly. This is the content of the following Proposition.  2r Proposition B.3. Let T be the (n − r) × (n − r) matrix with Tij = (−1)i−j r+i−j . Then −1 T =A . In order to prove Proposition B.3, we need the following lemma. Lemma B.4. Let Y be the r × (n − r) matrix with Yij = (−1)r+i−j  r n × (n − r) matrix with Uij = (−1)r+i−j i−j . Then XY + ST = U . r+i−1 i−j  , and let U be Proof of Lemma B.4. We have (XY + ST )ij = r X k=1 r X Xik Ykj + n−r X Sil Tlj l=1   X    i−r i−1 r+k−1 2r l−j i − l − 1 = (−1) + (−1) i−k k−j i−l−r r+l−j k=j l=1     r  i−r  X X i − 1 −r − j −r 2r r r+i−j = (−1) + (−1) . i − k k − j i − l − r r + l − j k=j l=1 r+k−j  If i < j, then at least one of i − k, k − j is negative, since (i − k) + (k − j) = i − j < 0. Hence (XY )ij = 0, and similarly (ST )ij = 0, so (XY + ST )ij = 0 = Uij . Otherwise, there imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 58 are three cases. If j ≤ i ≤ r, then (ST )ij = 0 since the sum is empty and (XY )ij = (−1) r   i  X i − 1 −r − j i−k k=j k−j     r −r + i − j − 1 r+i−j = Uij . = (−1) = (−1) i−j i−j r If r < j ≤ i, then (XY )ij = 0 since the sum is empty, and r+i−j (ST )ij = (−1) i−r  X l=j−r −r i−l−r  2r r+l−j  r+i−j = (−1)  r i−j  = Uij . Finally, if j ≤ r < i, then r (U − XY )ij = Uij − (−1)   i  X i − 1 −r − j    i X i − 1 −r − j + (−1) i−k k−j k=r+1 r i−k k−j   i−r  X i−1 −r − j r = (−1) i−k−r r+k−j k=1    i−r X i−1 2r + k − 1 k−j (−1) = i−k−r r+k−j k=1    i−r X i−1 2r + k − 1 k−j (−1) = i−k−r r+j−1 k=1  X   r+j  i−r X i−1 2r k−1 k−j = (−1) i − k − r l=1 r + j − l l−1 k=1     i−r X k X i−1 2r k−1 k−j = (−1) i−k−r r+l−j k−l k=1 l=1 X    i−r  i−r X 2r i−1 k−1 k−j = (−1) r + l − j i−k−r k−l l=1 k=l  X   i−r i−r  X 2r i−1 −l l−j = (−1) r + l − j k=l i − k − r k − l l=1    i−r X 2r i−l−1 l−j = (−1) = (ST )ij r+l−j i−l−r l=1 k=j where the sixth equality above follows from the fact that  k−1 = 0 for l > k. l−1 2r r+j−l  = 0 for l > r + j and We are now ready to prove Proposition B.3. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 59 Proof of Proposition B.3. Let Y and U be defined as in Lemma B.4. Note that    r+j n X X r T r+k−j k − 1 (X U )ij = Xki Ukj = (−1) k−i r+k−j k=1 k=i   r+j  X −i r r+i−j . = (−1) k−i r+j−k k=i If r + j < i, then (X T U )ij = 0 since the sum is empty. Otherwise,   r−i T r+i−j =0 (X U )ij = (−1) r+j−i since 0 ≤ r − i < r + j − i for 1 ≤ i ≤ r. That is, X T U = 0r×(n−r) ; then each column of U is in N (X T ) = C(X)⊥ , so (I − PX )U = U . Lemma B.4 gives (I − PX )ST = (I − PX )(U − XY ) = U . Also,     n r+i  r+i  X X X r r r r i−j T i−j Uki Ukj = (−1) (U U )ij = = (−1) . k−i k−j r+i−k k−j k=1 k=j k=j If r + i < j, then (U T U )ij = 0 = Tij since the sum is empty. Otherwise,   2r T i−j (U U )ij = (−1) = Tij . r+i−j That is, U T U = T . Then T AT = T S T (I − PX )ST = ((I − PX )ST )T (I − PX )ST = U T U = T , and T is invertible since U is lower triangular with full column rank n − r and rank(U T U ) = rank(U ). Thus AT = In−r , i.e. T = A−1 . We shall now prove the first fact about A in the proof of Lemma 4.2: the bound on 1T A1. In fact, the result below gives a precise formula for this quantity from which the stated bound trivially follows. −1 n+r  −1 n+r  Proposition B.5. 1Tn−r A1n−r = 2rr = 2rr . 2r+1 n−r−1 Proof of Proposition B.5. Let us first complete the proof of Proposition B.5 assuming that the following claim is true. We shall subsequently give the proof of this claim. A1n−r = b where b is the (n − r)-dimensional vector with bi = (114)  2r −1 r  n−i r  r+i−1 r . By (114), for the claimed expression of 1Tn−r A1n−r , it is equivalent to show that  n+r . To see this, write n−r−1 2r r  T 1n−r b =     n−r n−r X n − ir + i − 1 n−r X  n − i r + i − 1 2r T 2r X bi = 1n−r b = = r r r r n−r−i i−1 i=1 i=1 i=1     n−r X  −r − 1 −r − 1 n+r n−r−1 n−r−1 −2r − 2 = (−1) = (−1) = n−r−i i−1 n−r−1 n−r−1 i=1 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 60 which proves Proposition B.5 assuming that (114)  is true. We shall now prove (114). By 2r 2r Proposition B.3, it is equivalent to show that r T b = r 1n−r . We have    X n−r 2r 2r (T b)i = Tij bj r r j=1     n−r X 2r n−j r+j−1 i−j = (−1) r+i−j r r j=1     n−r X 2r n−j r+j−1 i−j = (−1) r+j−i n−r−j r j=1     n X 2r n+r−j j−1 r+i−j = (−1) j−i n−j r j=r+1     n X 2r −r − 1 j − 1 n−r+i = (−1) . j − i n − j r j=r+1  Since j−1 is a degree r polynomial with leading coefficient r!1 and ((j − i)k )rk=0 is a basis r  Pr for degree r polynomials, we can write j−1 = k=0 ck (j − i)k with cr = r!1 . Then r     r n  X 2r 2r −r − 1 X n−r+i (T b)i = (−1) ck (j − i)k r j − i n − j j=i k=0    n r XX 2r − k −r − 1 n−r+i = (−1) ck (2r)k j−i−k n−j j=i k=0    r n X X 2r − k −r − 1 n−r+i = (−1) ck (2r)k j−i−k n−j j=i+k k=0   r X r−k−1 n−r+i = (−1) ck (2r)k n−i−k k=0       2r (2r)r n − r − i −1 n−r+i = . = (−1) cr (2r)r = r! n−r−i r n−r−i   2r The first equality follows from the fact that j−i = 0 for j < i and j−1 = 0 for j ≤ r. r   2r 2r−k (j − i)k = (2r)k j−i−k . The third The second equality follows from the identity j−i  2r−k equality follows from the fact that j−i−k = 0 for j < i + k. This completes the proof of (114). We now turn to the second claimed fact about A in the proof of Lemma 4.2. This is the content of the following proposition. Proposition B.6. Every entry of the matrix A is positive. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 61 We need the following lemma for the proof of Proposition B.6. Lemma B.7. Let x be the (n − r)-dimensional vector with xi = Then x is the first column of A.   n−i  n+r−1 −1 r+i−2 . n−1 r−1 n−r−i Proof of Lemma B.7. By Proposition B.3, it is equivalent to show that T x = e1 , where e1 is the first standard basis vector of Rn−r . We have     n−r n+r−1 n+r−1 X (T x)i = Tij xj n−1 r j=1 = n−r X i−j (−1) j=1  2r r+i−j    r+j−2 n−j r−1 n−r−j n−r X    2r r+j−2 −r − 1 r+j−i r−1 n−r−j j=1    n  X j − 2 −r − 1 2r n−r−i = (−1) n−j j−i r−1 j=r+1    n  X 2r j − 2 −r − 1 = (−1)n−r−i j−i r−1 n−j j=i     2r −1 −r − 1 n−r−i − (−1) δi1 , 1−i r−1 n−1 = (−1)n−r−i where δij is the Kronecker delta. The last equality follows from the fact that  j−2 for j < i and r−1 = 0 for 2 ≤ j ≤ r. Now n−r−i  2r 1−i −(−1) j−2 r−1   −1 r−1 2r j−i  =0        −r − 1 n+r−1 n+r−1 i−1 r − 1 = (−1) δi,1 = δi,1 . n−1 r−1 n−1 n−1 Pr−1 − i)k , similarly to the proof of Proposition B.5,    X   r−1 n  n  X 2r j − 2 −r − 1 2r −r − 1 X = ck (j − i)k j−i r−1 n−j j−i n − j k=0 j=i j=i    n X r−1 X 2r − k −r − 1 ck (2r)k = j−i−k n−j j=i k=0   r−1 n  X X 2r − k −r − 1 = ck (2r)k j−i−k n−j k=0 j=i+k   r−1 X r−k−1 = ck (2r)k = 0. n − i − k k=0 Writing = k=0 ck (j The second and third equalities follow from the same reasoning as in the proof of Proposition B.5. The last equality follows from the fact that 0 ≤ r − k − 1 < n − i − k for i ≤ n − r. Thus (T x)i = δi,1 , i.e. T x = e1 . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 62 We are now ready to prove Proposition B.6 Proof of Proposition B.6. Let x be defined as in Lemma B.7. Observe that xk+1 r+k−1 n−r−k = · xk k n−k and xn−r−k+1 n−k k−1 = · , xn−r−k n−r−k+1 r+k−1 so xk+1 xn−r−k+1 k−1 n−r−k · = · < 1. xk xn−r−k k n−r−k+1 Then for i ≤ n−r+1 , 2 xn−r−i+1 = xi n−r−i Y k=i xk+1 = xk n−r−i Y k=i xn−r−k+1 xn−r−k v un−r−i u Y xk+1 xn−r−k+1 =t ≤1 xk xn−r−k k=i is increasing in i since the number of terms in the product decreases as i increases. Let 1 ≤ i ≤ j ≤ n − r such that i + j ≤ n − r + 1. If j ≤ n−r+1 , then 2 xn−r−i+1 xn−r−j+1 · ≤ 1. xi xj Otherwise, let j 0 = n − r − j + 1, so that i ≤ j 0 ≤ xn−r−i+1 xn−r−j+1 xn−r−i+1 · = · xi xj xi  xn−r−j 0 +1 x0j n−r+1 . 2 −1 Then xn−r−j 0 +1 ≤ · x0j  xn−r−j 0 +1 x0j −1 = 1. Thus xi xj − xn−r−i+1 xn−r−j+1 ≥ 0. Observe that T is a symmetric Toeplitz matrix. By Lemma B.7, x is the first column of A, so the symmetric Gohberg-Semencul formula (see, for example, Gohberg and Semencul [12]) gives    x1 0 ··· 0 x1 x2 · · · xn−r    x1 ··· 0  1    x2   0 x1 · · · xn−r−1  A=  . .. .  . .. . . ..  .. x1  .. . ..   .. . . . .  xn−r xn−r−1 · · · x1 0 0 ··· x1    0 ··· 0 0 0 xn−r · · · x2 .. ..  .. xn−r · · · . 0 0 . . .     .. −  ..  , ..   .. .. . .  .   . . . . xn−r  0 0 x2 · · · xn−r 0 0 0 ··· 0 imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 63 or " i # i−1 X 1 X Aij = xk xk+j−i − xn−r−k+1 xn−r+i−j−k+1 x1 k=1 k=1 # " i−1 X 1 xi xj + = (xk xk+j−i − xn−r−k+1 xn−r+i−j−k+1 ) . x1 k=1 Since T is symmetric Toeplitz, in particular it is symmetric persymmetric; by Proposition B.3, T = A−1 , so A is symmetric persymmetric as well. It suffices then to consider Aij for 1 ≤ i ≤ j ≤ n − r satisfying i + j ≤ n − r + 1. Now 1 ≤ k ≤ k + j − i ≤ n − r and k + (k + j − i) ≤ n − r + 1 for 1 ≤ k ≤ i − 1, hence xk xk+j−i − xn−r−k+1 xn−r+i−j−k+1 ≥ 0 xx and Aij ≥ xi 1 j > 0. Thus Aij > 0 for all 1 ≤ i, j ≤ n − r which completes the proof of Proposition B.6. B.4. A Result on Variance and Variation (Lemma 3.4) In this subsection, we provide the proof of Lemma 3.4 which was used in the proof of Corollary 2.4. Proof of Lemma 3.4. Note that first that for r = 1, the result follows by taking η = θ̄1n and using the inequality n X θi − θ̄ 2 ≤ nkDθk21 = nV 2 (θ), (115) i=1 which is a consequence of the fact that |θi − θ̄| ≤ maxk,l |θk −θl | ≤ V (θ) for every 1 ≤ i ≤ n. Let us therefore assume that r ≥ 2. We may assume without loss of generality that the vector D(r−1) θ has mean zero (if not, we will work with θ̃ instead of θ where θ̃ is created by subtracting a suitable polynomial sequence of degree (r − 1) from θ; this will ensure that D(r−1) θ̃ has mean zero and that D(r) θ = D(r) θ̃). Let X be the n × (r − 1) matrix  i−1 whose (i, j)th entry equals j−1 . Let S be the n × (n − r + 1) matrix whose (i, j)th entry   equals i−j−1 . Throughout we use the convention that ab = 0 when a < b. Let η denote r−2 the projection of θ on to the column space of X. We shall prove that the conditions of Lemma 3.4 are satisifed for this choice of η. Note first that η belongs to the column space of X which implies that the entries ηi of η will be given by a polynomial in i of degree at most r − 2 so that D(r−1) η = 0n−r+1 . The reader may observe that D(r−1) η = 0n−r+1 is stronger than the statement of Lemma 3.4 which reads D(r) η = 0n−r . This is because we have assumed that D(r−1) θ has mean zero. When this condition is not true, we would need to add a polynomial sequence of degree (r − 1) to η so that then D(r−1) η will have a constant mean which is same as saying that D(r) η = 0n−r . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 64 Note from Lemma B.2 that SD(r−1) θ differs from θ by a polynomial of degree at most r − 2 so that θ − η = (I − PX )θ = (I − PX )SD(r−1) θ where PX is the projection matrix on to the column space of X. As a result kθ − ηk2 = k(I − PX )SD(r−1) θk2 ≤ k(I − PX )Sk2 kD(r−1) θk2 where k(I −PX )Sk denotes the operator norm of the matrix (I −PX )S. It is clear that the square of the operator norm of (I − PX )S equals the operator norm of A := S T (I − PX )S so that kθ − ηk2 ≤ kAkkD(r−1) θk2 . Note now that because A is symmetric, its operator norm is bounded by its k · k∞ norm (see, for example, Golub and Loan [14, Corollary 2.3.2]) defined by kAk∞ := max 1≤i≤n−r+1 n−r+1 X |aij | j=1 and hence we have kθ − ηk2 ≤ kAk∞ kD(r−1) θk2 . (116) It may be noted that the matrix A is the same matrix that appeared in the previous section (for example, in Proposition B.6 and Proposition B.5) with r replaced by r − 1. Therefore because all entries of A are positive (Proposition B.6), we deduce that kAk∞ = kA1n−r+1 k∞ (this latter k · k∞ norm refers to the usual L∞ norm for vectors). In the proof of Proposition B.5, we gave a precise expression for A1n−r+1 (see equation (114)). Using this, we deduce that (note that r needs to be replaced by r − 1 in (114))   n−i r+i−2 n2r−2 r−1 r−1 2r−2   ≤ . kAk∞ = max 2r−2 2r−2 ≤ n 1≤i≤n−r+1 r−1 r−1 Using the above with inequality (116), we obtain kθ − ηk2 ≤ n2r−2 kD(r−1) θk2 . To bound the right hand side above further, we use (115) (note that the mean of the vector D(r−1) θ is taken to be zero) to deduce that kθ − ηk2 ≤ n2r−1 kD(r) θk21 which completes the proof of Lemma 3.4. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 65 B.5. Proof of the fat shattering bound (Lemma 4.7) This subsection is devoted to the proof of our fat shattering bound, Lemma 4.7. Recall the notion of fat shattering dimension from Definition 4.1. For the proof of Lemma 4.7, we shall use the notion of divided differences (see, for example, Kuczma [20, Chapter 15]). For k ≥ 1, indices 1 ≤ `1 < · · · < `k ≤ n and real numbers α`1 , . . . , α`k , the divided difference [`1 , . . . , `k ; α] is defined as [`1 , . . . , `k ; α] := k X Q i=1 α`i j6=i (`i − `j ) As examples, note that [`1 ; α] = α`1 and [`1 , `2 ; α] = (α`2 − α`1 )/(`2 − `1 ). It is easy to verify that the divided differences satisfy the recursive relation [`1 , . . . , `k ; α] = [`2 , . . . , `k ; α] − [`1 , . . . , `k−1 ; α] . `k − `1 We shall use the following two facts about divided differences for the proof of Lemma 4.7. The first fact is given in the Lemma B.8 which is a simple consequence of Kuczma [20, Theorem 15.3.1]. Lemma B.8. Fix r ≥ 1 and n ≥ r. Suppose θ ∈ Rn satisfies (D(r−1) θ)1 ≤ · · · ≤ (D(r−1) θ)n−r+1 . Then for every choice of indices 1 ≤ i1 < · · · < ir+1 ≤ n, we have [i2 , . . . , ir+1 ; θ] ≥ [i1 , . . . , ir ; θ]. Remark B.1. When r = 2, it is easy to see that Lemma 2.2 reduces to the well-known increasing slopes property of convex sequences. The second fact about divided differences is given in Lemma B.9 which is a consequence of Kuczma [20, Lemma 15.2.5 and Theorem 15.2.6]. Lemma B.9. Fix r ≥ 1 and n ≥ r. For every choice of indices 1 ≤Pi1 < i2 < · · · < ir ≤ n, there exist non-negative real numbers {ci , 1 ≤ i ≤ n − r + 1} with n−r+1 ci = 1 such that i=1 n−r+1 X 1 ci (D(r−1) θ)i [i1 , . . . , ir ; θ] = (r − 1)! i=1 for every θ ∈ Rn . We are now ready to give the proof of Lemma 4.7. Proof of Lemma 4.7. Fix t > 0 and suppose that S := {i1 , . . . , im } (with 1 ≤ i1 < · · · < im ≤ n) is a subset of {1, . . . , n} that is t-shattered by C(V ). Let hi1 , . . . , him denote the associated levels and denote by h the vector in Rm given by (hi1 , . . . , him ). We shall then imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 66 prove that m is bounded from above by the right hand side of (81). Note that we can assume that m ≥ r (otherwise there is nothing to prove). We first claim that j+r−1 X [ij , ij+1 , . . . , ij+r−1 ; h] ≥ [ij−1 , . . . , ij+r−2 ; h] + t (−τk,j ){τk,j < 0} (117) k=j−1 for every j = 2, . . . , m − r + 1 where τk,j := Y 1 1 − ik − i` j−1≤`≤j+r−2:`6=k ik − i` j≤`≤j+r−1:`6=k Y for k = j, . . . , j + r − 2 and j+r−2 τj−1,j := (−1)r Y `=j 1 i` − ij−1 j+r−2 and τj+r−1,j := 1 Y `=j ij+r−1 − i` In the above, for r = 1, we take τj−1,j = −1 and τj,j = 1. To see (117), note first that because S is t-shattered by Cr (a, V ), there exists θ ∈ Cr (a, V ) such that θik ≤ hik whenever τk,j ≥ 0 and θik ≥ hik + t whenever τk,j < 0. Because θ ∈ Cr (a, V ), Lemma B.8 gives [ij , ij+1 , . . . , ij+r−1 ; θ] ≥ [ij−1 , . . . , ij+r−2 ; θ] P It can be checked that the above inequality is equivalent to j+r−1 k=j−1 τk,j θik ≥ 0 which is further equivalent to j+r−1 X j+r−1 τk,j θik {τk,j ≥ 0} ≥ k=j−1 X (−τk,j )θik {τk,j < 0} k=j−1 The above inequality, together with the fact that θik ≤ hik when τk,j ≥ 0 and θik ≥ hik + t when τk,j < 0, gives (117). From (117), it is easy that by recursive application, one obtains [ij , ij+1 , . . . , ij+r−1 ; h] ≥ [iu , iu+1 , . . . , iu+r−1 ; h] + t j−1 a+r X X (−τk,a+1 ) {τk,a+1 < 0} a=u k=a for every 1 ≤ u < j ≤ m − r + 1. Taking u = 1 and j = m − r + 1, we obtain [im−r+1 , . . . , im ; h] − [i1 , . . . , ir ; h] ≥ tTr . where Tr := m−r a+r XX (118) (−τk,a+1 ) {τk,a+1 < 0} . a=1 k=a imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 67 We now claim that [i1 , . . . , ir ; h] ≥ a (r − 1)! and [im−r+1 , . . . , im ; h] ≤ a+V . (r − 1)! (119) We shall prove the first inequality in (119) The proof of the second inequality will Pbelow. r be similar. One can write [i1 , . . . , ir ; h] as j=1 βj hij for some real coefficients βj . Because S is t-shattered by Cr (a, V ), there exists θ ∈ Cr (a, V ) such that hij ≥ θij for βj ≥ 0 and hij < θij for βj < 0. This implies that [i1 , . . . , ir ; h] = r X βj hij ≥ j=1 r X βj θij = [i1 , . . . , ir ; θ]. j=1 Lemma B.9 now implies that, for some ci ≥ 0, 1 ≤ i ≤ n − r + 1 with have n−r+1 X a 1 ci (D(r−1) θ)i ≥ [i1 , . . . , ir ; θ] = (r − 1)! i=1 (r − 1)! Pn−r+1 i=1 ci = 1, we where the last inequality follows because θ ∈ Cr (a, V ). This proves (119). Combining (119) and (118), we obtain Tr ≤ V . t(r − 1)! (120) We now claim the following lower bound for Tr : T1 = m − 1 and Tr ≥ (m − r)r nr−1 (r − 1)r−1 for every r ≥ 2. (121) Before we prove (121), note first that as a consequence of the above pair of inequalities, inequality (81) holds with C1 = 1 and  Cr = (r − 1)r−1 (r − 1)! 1/r for r ≥ 2. Therefore, to complete the proof of Lemma 4.7, we only need to prove inequality (121). To prove (121), we assume that r ≥ 2 (the fact that T1 = m − 1 is obvious) and note first that τa+r−1,a+1 < 0 for every a = 1, . . . , m − r . As a result, Tr ≥ m−r X (−τa+r−1,a+1 ) ≥ a=1 m−r X a=1 1 . (ia+r−1 − ia ) . . . (ia+r−1 − ia+r−2 ) By the AM-GM inequality, we have  (ia+r−1 − ia ) . . . (ia+r−1 − ia+r−2 ) ≤ (ia+r−1 − ia ) + · · · + (ia+r−1 − ia+r−2 ) r−1 r−1 . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 68 If we define sj := ij+1 − ij for j = 1, . . . , m − 1, then it is easy to see that r−2 r−2 X (ia+r−1 − ia ) + · · · + (ia+r−1 − ia+r−2 ) X j + 1 = sa+j ≤ sa+j . r−1 r−1 j=0 j=0 We have deduced therefore that Tr ≥ m−r X !r−1 1 Pr−2 j=0 a=1 sa+j We now use the convexity of the map x 7→ (1/x)r−1 for x > 0 to obtain (m − r)r Tr ≥ P r−1 . m−r Pr−2 s a=1 j=0 a+j Inequality (121) follows from here because m−r r−2 XX a=1 j=0 sa+j = r−2 m−r X X sa+j = j=0 a=1 r−2 X (im−r+j+1 − ij+1 ) ≤ n(r − 1). j=0 This completes the proof of Lemma 4.7. B.6. Proof of the metric entropy bound for Cr ({ai }, {si }) (Lemma A.4) We shall provide the proof Lemma A.4 in this subsection. The proof is based on Lemma 4.7 and Theorem 4.6 which provides an upper bound for the metric entropy in terms of the fat shattering dimension. Proof of Lemma A.4. It turns out that it is enough to prove the following bound on the fat shattering dimension of Cr ({ai }, {si }): Pr v(Cr ({ai }, {si }), t) ≤ Cr j−1 sj−1 j=1 n t !1/r . (122) Indeed, Lemma B.6 is a direct consequence of the above inequality along with Theorem 4.6. To see this, note that if inequality (122) is true, one can simply take the function v(·) in Theorem 4.6 to be !1/r Pr j−1 sj−1 j=1 n . v(s) = Cr s Then the condition (79) in Theorem 4.6 is true with a = 2r and Lemma B.6 is therefore a consequence of inequality (80). imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 69 The key therefore is to prove (122). For this, note first the identity (which is a consequence of Lemma B.2 applied with r − 1 instead of r) θi = i−r+1 X  j=1   r−1  X i−j−1 i−1 (r−1) (D θ)j + (D(j−1) θ)1 . r−2 j − 1 j=1 (123) This identity obviously implies the following lower and upper bounds on θi for every θ ∈ Cr ({ai }, {si }): θi ≥ i−r+1 X  j=1   r−1  X i−j−1 i−1 ar−1 + aj−1 r−2 j−1 j=1 and θi ≤ i−r+1 X     r−1  r−1  i−r+1 X X X  i − j − 1 i−j−1 i−1 i−1 ar−1 + aj−1 + sj−1 + sr−1 r−2 j−1 j−1 r−2 j=1 j=1 j=1 j=1   i−r+1 r−1  r  X i − j − 1 X X i−1 i−1 = ar−1 + aj−1 + sj−1 . r−2 j−1 j−1 j=1 j=1 j=1 These imply that for every 1 ≤ i ≤ n, we have  r  r X X n−1 max θi − min θi ≤ sj−1 ≤ nj−1 sj−1 . θ∈Cr ({ai },{si }) θ∈Cr ({ai },{si }) j − 1 j=1 j=1 P As a consequence, it turns out that v(Cr ({ai }, {si }), t) = 0 if t > Γ := rj=1 nj−1 sj−1 and hence inequality (122) is trivially true when t > Γ. We can therefore assume that t ≤ Γ. In this case, because Cr ({ai }, {si }) ⊆ Cr (ar−1 , sr−1 ), Lemma 4.7 gives 1/r nr−1 sr−1 v(Cr ({ai }, {si }), t) ≤ v(Cr (ar−1 , sr−1 ), t) ≤ r + Cr t  1/r  1/r  1/r Γ Γ Γ ≤r + Cr = (Cr + r) t t t  which proves (122) when t ≤ Γ. The completes the proof of Lemma B.6. References [1] Amelunxen, D., M. Lotz, M. B. McCoy, and J. A. Tropp (2014). Living on the edge: Phase transitions in convex programs with random data. Information and Inference, iau005. [2] Bellec, P. C. (2015). Sharp oracle inequalities for least squares estimators in shape restricted regression. arXiv preprint arXiv:1510.08029 . imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 70 [3] Breiman, L., J. H. Friedman, R. A. Olshen, and C. J. Stone (1984). Classification and regression trees. Wadsworth Statistics/Probability Series. Wadsworth Advanced Books and Software, Belmont, CA. [4] Brockmann, M., T. Gasser, and E. Herrmann (1993). Locally adaptive bandwidth choice for kernel regression estimators. J. Amer. Statist. Assoc. 88 (424), 1302–1309. [5] Chatterjee, S. (2014). A new perspective on least squares under convex constraint. The Annals of Statistics 42 (6), 2340–2381. [6] Dalalyan, A., M. Hebiri, and J. Lederer (2017). On the prediction performance of the lasso. Bernoulli 23 (1), 552–581. [7] Donoho, D. L. and I. M. Johnstone (1998). Minimax estimation via wavelet shrinkage. Annals of Statistics 26 (3), 879–921. [8] Donoho, D. L. and J. M. Johnstone (1994). Ideal spatial adaptation by wavelet shrinkage. Biometrika 81 (3), 425–455. [9] Dumbgen, L. (2010). Bounding standard gaussian tail probabilities. arxiv preprint. arXiv preprint arXiv:1012.2063 . [10] Foygel, R. and L. Mackey (2014). Corrupted sensing: Novel guarantees for separating structured signals. IEEE Transactions on Information Theory 60 (2), 1223–1247. [11] Friedman, J. H. (1991). Multivariate adaptive regression splines. Ann. Statist. 19 (1), 1–141. With discussion and a rejoinder by the author. [12] Gohberg, I. and A. Semencul (1972). On the inversion of finite toeplitz matrices and their continuous analogs. Mat. issled 2, 201–233. [13] Goldenshluger, A. and A. Nemirovski (1997). On spatially adaptive estimation of nonparametric regression. Math. Methods Statist. 6 (2), 135–170. [14] Golub, G. H. and C. F. V. Loan (2013). Matrix Computations (Fourth ed.). JHU Press. [15] Harchaoui, Z. and C. Lévy-Leduc (2012). Multiple change-point estimation with a total variation penalty. Journal of the American Statistical Association. [16] Hiriart-Urruty, J.-B. and C. Lemaréchal (2012). Fundamentals of convex analysis. Springer Science & Business Media. [17] Hjort, N. L. and D. Pollard (1993). Asymptotics for minimisers of convex processes. Technical report. available at arXiv preprint arXiv:1107.3806. [18] Johnstone, I. M. (2015). Gaussian estimation: Sequence and wavelet models. Available at http://statweb.stanford.edu/~imj/GE09-08-15.pdf. [19] Kim, S.-J., K. Koh, S. Boyd, and D. Gorinevsky (2009). l1 trend filtering. SIAM Rev. 51 (2), 339–360. [20] Kuczma, M. (2009). An introduction to the theory of functional equations and inequalities: Cauchy’s equation and Jensen’s inequality. Springer Science & Business Media. [21] Laurent, B. and P. Massart (2000). Adaptive estimation of a quadratic functional by model selection. Annals of Statistics, 1302–1338. [22] Lepski, O. V., E. Mammen, and V. G. Spokoiny (1997). Optimal spatial adaptation to inhomogeneous smoothness: an approach based on kernel estimates with variable bandwidth selectors. Ann. Statist. 25 (3), 929–947. [23] Lévy-Leduc, C. and Z. Harchaoui (2008). Catching change-points with lasso. In imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017 Chatterjee, S., Guntuboyina, A., Lieu, D. and Sen, B./Spatial Adaptation in Trend Filtering 71 Advances in Neural Information Processing Systems, pp. 617–624. [24] Lin, K., J. Sharpnack, A. Rinaldo, and R. J. Tibshirani (2016). Approximate recovery in changepoint problems, from `2 estimation error rates. arXiv preprint arXiv:1606.06746 . [25] Mammen, E. and S. van de Geer (1997). Locally adaptive regression splines. The Annals of Statistics 25 (1), 387–413. [26] Mangasarian, O. L. and L. L. Schumaker (1971). Discrete splines via mathematical programming. SIAM Journal on Control 9 (2), 174–183. [27] Müller, H.-G. and U. Stadtmüller (1987). Variable bandwidth kernel estimators of regression curves. Ann. Statist. 15 (1), 182–201. [28] Oymak, S. and B. Hassibi (2013). Sharp mse bounds for proximal denoising. Foundations of Computational Mathematics, 1–65. [29] Pintore, A., P. Speckman, and C. C. Holmes (2006). Spatially adaptive smoothing splines. Biometrika 93 (1), 113–125. [30] Pollard, D. (1990). Empirical Processes: Theory and Applications, Volume 2 of NSFCBMS Regional Conference Series in Probability and Statistics. Hayward, CA: Institute of Mathematical Statistics. [31] Rudelson, M. and R. Vershynin (2006). Combinatorics of random processes and sections of convex bodies. Annals of Mathematics, 603–648. [32] Rudin, L. I., S. Osher, and E. Fatemi (1992). Nonlinear total variation based noise removal algorithms. Physica D: Nonlinear Phenomena 60 (1), 259–268. [33] Schrijver, A. (1986). Theory of linear and integer programming. Wiley-Interscience Series in Discrete Mathematics. John Wiley & Sons, Ltd., Chichester. A WileyInterscience Publication. [34] Steidl, G., S. Didas, and J. Neumann (2006). Splines in higher order tv regularization. International journal of computer vision 70 (3), 241–255. [35] Tibshirani, R. J. (2014). Adaptive piecewise polynomial estimation via trend filtering. The Annals of Statistics 42 (1), 285–323. [36] Van de Geer, S. (2000). Applications of Empirical Process Theory. Cambridge University Press. [37] van de Geer, S. and M. Wainwright (2015). On concentration for (regularized) empirical risk minimization. arXiv preprint arXiv:1512.00677 . [38] Van der Vaart, A. and J. A. Wellner (1996). Weak Convergence and Empirical Process: With Applications to Statistics. Springer-Verlag. [39] Wang, Y.-X., A. J. Smola, and R. J. Tibshirani (2014). The falling factorial basis and its statistical applications. In ICML, pp. 730–738. [40] Zhou, S. and X. Shen (2001). Spatially adaptive regression splines and accurate knot selection schemes. J. Amer. Statist. Assoc. 96 (453), 247–259. imsart-generic ver. 2014/10/16 file: PaperTreFilV16.tex date: February 20, 2017
10math.ST
arXiv:1712.04404v1 [math.ST] 12 Dec 2017 STATISTICAL ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION MARC HOFFMANN AND ALINE MARGUET Abstract. We consider a binary branching process structured by a stochastic trait that evolves according to a diffusion process that triggers the branching events, in the spirit of Kimmel’s model of cell division with parasite infection. Based on the observation of the trait at birth of the first n generations of the process, we construct nonparametric estimator of the transition of the associated bifurcating chain and study the parametric estimation of the branching rate. In the limit n → ∞, we obtain asymptotic efficiency in the parametric case and minimax optimality in the nonparametric case. Mathematics Subject Classification (2010): 62G05, 62M05, 60J80, 60J20, 92D25. Keywords: Branching processes, bifurcating Markov chains, statistical estimation, geometric ergodicity, scalar diffusions. 1. Introduction 1.1. Motivation. The study of structured populations, with a strong input from evolutionary or cell division modelling in mathematical biology (see for instance the textbooks [27, 30] and the references therein) has driven the statistics of branching Markov processes over the last few years. Several models have been considered, with data processed either in discrete or continuous time. In this context, one typically addresses the inference of critical parameters like branching rates, modelled as functions of biological traits like age, size and so on. In many cases, this approach is linked to certain piecewise deterministic Markov models or bifurcating Markov chains (BMC) in discrete time. These models are well understood from a probabilist point of view (in discrete time Guyon [17], Bitseki-Penda et al. [6, 7], in continuous time Bansaye and Méléard [4], Bansaye et al. [3] or more recently Marguet [26] for a general approach). For the statistical estimation, we refer to [8, 14, 15, 21], and the references therein, see also Bitseki-Penda and Olivier [29], de Saporta et al. [12, 13], Azaı̈s et al. [1] or recently Bitseki-Penda and Roche [5]. In these models, the traits of a population between branching events like cell division evolve through time according to a dynamical system. The next logical step is to replace this deterministic evolution by a random flow, that allows one to account for traits that may have their own random evolution according to some exogeneous input. A paradigmatic example is Kimmel’s model (see Kimmel [22] and Bansaye [2]) where the trait is given by a density of parasites within a cell that evolve according to a diffusion process. The statistical analysis of such models is the topic of the present paper. We consider a population model with binary division triggered by a trait x ∈ X where X ⊆ R is an open (possibly unbounded) interval. The trait φx (t) of each individual evolves according to (1) dφx (t) = r(φx (t))dt + σ(φx (t))dWt , φx (0) = x, where r, σ : X → X are regular functions and (Wt )t≥0 is a standard Brownian motion. Each individual with trait x dies according to a killing or rather division rate x 7→ B(x). (An individual 1 2 MARC HOFFMANN AND ALINE MARGUET 0.8 X0 ; 0.6 trait X∅ X00 X10 0.4 0 1 X01 0.2 X1 00 01 10 11 X11 0.0 0.0 0.1 0.2 0.3 time 0.4 0.5 0.6 Figure 1. Example of a trajectory and its associated genealogy. with trait φx (t) at time t dies with probability B(φx (t))dt during the interval [t, t + dt].) At division, a particle is replaced by two new individuals with trait at birth given respectively by θx and (1 − θ)x where θ is drawn according to κ(x)dx for some symmetric probability density function κ(x) on [0, 1]. The model is described by the traits of the population, formally given as a Markov process (2) X = (X1 (t), X2 (t), . . .), t ≥ 0 with values in k≥1 X , where the Xi (t) denote the (ordered) traits of the living particles at time t. Its distribution is entirely determined by an initial condition at t = 0 and by the parameters (r, σ, B, κ). S k 1.2. Statistical setting by reduction to a bifurcating Markov chain model. We assume we have data at branching events (i.e. at cell division) and we wish to make inference on the parameters of the model. Using the Ulam-Harris-Neveu notation, for m ≥ 0, let Gm = {0, 1}m (with G0 = {∅}) and introduce the infinite genealogical tree [ T= Gm . m∈N For u ∈ Gm , set |u| =Sm and define the concatenation u0 = (u, 0) ∈ Gm+1 and u1 = (u, 1) ∈ Gm+1 . n For n ≥ 0, let Tn = m=0 Gm denote the genealogical tree up to the n-th generation. We denote by Xu the trait at birth of an individual u ∈ T. From the branching events, we assume that we observe Xn = (Xu )u∈Tn , so that we have 2n+1 − 1 random variables with value in X. Asymptotics are taken as n grows to infinity. An example of trajectory is represented on Figure 1 with the associated genealogy. There are several objects of interest that we may try to infer from the data Xn . First, one may notice that the Markov structure of X in (2) turns (Xu , u ∈ T) into a bifurcating Markov chain according to the terminology introduced by Delmas and Guyon [17]. A bifurcating Markov chain is specified by 1) a measurable state space, here X (endowed with its Borel sigma-field) with a ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 3  Markov kernel P from X to X × X and 2) a filtered probability space Ω, F, (Fm )m≥0 , P . Following Guyon, [17], Definition 2, we have the Definition 1. A bifurcating Markov chain (BMC) is a family (Xu )u∈T of random variables with value in X such that Xu is F|u| -measurable for every u ∈ T and Y   Y Pψu (Xu ) ψu (Xu , Xu0 , Xu1 ) Fm = (3) E u∈Gm u∈Gm for R every m ≥ 0 and any family of (bounded) measurable functions (ψu )u∈Gm , where Pψ(x) = ψ(x, y1 , y2 )P(x, dy1 dy2 ) denotes the action of P on ψ. X×X The distribution of (Xu )u∈T is thus entirely determined by P and an initial distribution for X∅ . A key role for understanding the asymptotic behavior of the bifurcating Markov chain is the socalled tagged-branch chain, that consists in picking a lineage at random in the population (Xu )u∈T : it is a Markov chain with value in X defined by Y0 = X∅ and for m ≥ 1: Ym = X∅1 ...m , where (m )m≥1 is a sequence of independent Bernoulli random variables with parameter 1/2, independent of (Xu )u∈T , with transition Q = (P1 + P2 )/2 (4) obtained from the marginal transitions of P: Z Z P1 (x, dy) = P(x, dy dy2 ) and P2 (x, dy) = y2 ∈X P(x, dy1 dy). y1 ∈X Guyon proves in [17] that if (Ym )m≥0 is ergodic with invariant measure ν(dx) on X, then a convergence of the type Z 1 X (5) ψ(Xu , Xu0 , Xu1 ) → Pψ(x)ν(dx) |Tn | X u∈Tn holds as n → ∞ for appropriate test functions g, almost surely and appended with appropriate central limit theorems (Theorem 19 in [17]). 1.3. Main results. In this context, there are several quantities that can be inferred from the data Xn as n grows and that are important in order to understand the dynamics of (Xu )u∈T . Under suitable assumptions on the stochastic flow (1), the transition Q admits an invariant measure ν and we have fast convergence of the tagged-chain (Ym )m≥1 to equilibrium. This enables us to construct in a first part nonparametric estimators of ν and Q with an optimal rate of convergence. Notice that since the fragmentation kernel κ(x) that distributes the trait of the parent between its two children is symmetric, we have P1 = P2 = Q. This reveals the structure of the underlying BMC. However, estimators of ν and Q do not give us any insight about the parameters (r, σ, B, κ) of the model. In a second part, we investigate the inference of the division rate x 7→ B(x) as a function of the trait x ∈ X when the other parameters r, σ and κ(x) are known. This seemingly stringent assumption is necessary given the observation scheme Xn . If extraneous data were available, estimators of the parameters r, σ and κ could be obtained in a relatively straightforward manner: i) As soon as a discretisation of the values of the flow are available, standard techniques about inference in ergodic diffusions can be applied to recover x 7→ r(x) and x 7→ σ(x)2 , see for instance [20, 23]. 4 MARC HOFFMANN AND ALINE MARGUET ii) The fact that an individual u distributed its traits to its offspring in a conservative way enables one to recover the fraction θu distributed among the children. Indeed the individual u born at bu with lifespan du − bu has trait φXu (du − bu ) at its time of death. It follows that its children have trait at birth given by Xu0 = θu φXu (du − bu ), Xu1 = (1 − θu )φXu (du − bu ), where the θu are drawn independently from the distribution κ(x)dx and therefore, the X θu identifies θu . In turn, the estimation of x 7→ κ(x) reduces to a relationship Xuu0 = 1−θ u 1 standard density estimation problem from data (θu )u∈Tn , see for instance [19]. The identification and estimation of the branching rate x 7→ B(x) from data Xn is more delicate and is the topic of the second part of the paper. Under minimal regularity assumptions developed in Section 2 below, it is not difficult to obtain an explicit representation of the transition Q(x, dy) = QB (x, dy) = qB (x, y)dy that reads Z 1 i hZ ∞ Rt κ(z) y/z (6) qB (x, y) = B(y/z)σ(y/z)−2 E e− 0 B(φx (s))ds dLt (φx ) dz, z 0 0 where Lyt (φx ) denotes the local time at t in y of the semimartingale (φx (t))t≥0 . Assuming (r, σ, κ) known (or identified by extraneous observation schemes) we study the estimation of x 7→ B(x) when B belongs to a parametric class of functions {Bϑ , ϑ ∈ Θ} for some regular subset of the Euclidean space Rd . Under a certain ordering property (Definition 13 in Section 3.2 below) that ensures identifiability of the model and suitable standard regularity properties, we realise a standard maximum likelihood proxy estimation of B thanks to (6) by maximising the contrast Y ϑ 7→ qϑ (Xu− , Xu ), ϑ ∈ Θ, u∈T? n T?n = Tn \ G0 ) and we prove that it achieves asymptotic efficiency and discuss its practical (with implementation. It is noteworthy that for the parametric estimation of B, there is no straightforward contrast minimisation procedure (at least we could not find any) whereas qB (x, y) is explicit. The fairly intricate dependence of B in the representation (6) makes however the whole scheme relatively delicate, both mathematically and numerically. Clearly, other observation schemes are relevant in the context of cell division modelling. For instance, one could consider a (large) time T > 0 and observe the branching process Xt defined in (2) for every t ∈ [0, T ]. This entails the possibility to extract the times (Tu ) at which branching events occur, like e.g. in [21]. However, the continuous time setting is drastically different and introduce the additional difficulty of bias sampling, an issue we avoid in the present context. Alternatively, one could consider the augmented statistical experiment where one observes (Xu , Tu )u∈Tn , but the underlying mathematical structure is presumably not simpler. Our results show in particular that for the parametric estimation of the branching rate B, although the times at which branching event occur are statistically informative, their observation is not necessary to obtain optimal rates of convergence as soon as (r, σ, κ) are known. 1.4. Organisation of the paper. Section 2.1 is devoted to the construction of the stochastic model, our assumptions and the accompanying statistical experiments. In particular, we have a nice structure enough so that explicit representations of P and Q are available (Proposition 5). We give a first result on the geometric ergodicity of the model via an explicit Lyapunov function in Theorem 6 and derive in Theorem 7 a rate of convergence for the variance of empirical measures of the data Xn = (Xu )u∈Tn against test functions ϕ(Xu ) or ψ(Xu− , Xu ) with a sharp control in ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 5 terms of adequate norms for ϕ, ψ that do not follow from the standard application of the geometric ergodicity of Theorem 6. This is crucial for the subsequent applications to the nonparametric estimation of Q and its invariant measure ν that are given in Theorem 10 of Section 3.1. Section 3.2 is devoted to the parametric estimation of the branching rate, where an asymptotically efficient result is proved for a maximum likelihood estimator in Theorem 20. It is based on a relatively sharp study of the transition Q, thanks to local time properties of the stochastic flow that triggers the branching events. Section 4 is devoted to the numerical implementation of the parametric estimator of B. In particular, in order to avoid the computational cost of the explicit computation of qϑ (Xu− , Xu ), we take advantage of our preceding results and implement a nonparametric estimator on Monte-Carlo simulations instead, resulting in a feasible procedure for practical purposes. The proofs are postponed to Section 5 and an Appendix Section 6 contains useful auxiliary results. 2. A cell division model structured by a stochastic flow 2.1. Assumptions and well-posedness of the stochastic model. Dynamics of the traits. Remember that X ⊆ R is an open, possibly unbounded interval. The flow is specified by r, σ : X → X which are measurable and that satisfy the following assumption: Assumption 2. For some r1 , σ1 , σ2 > 0, we have |r(x)| ≤ r1 (1 + |x|) and σ1 ≤ σ(x) ≤ σ2 , for every x ∈ X. Moreover, for some r2 > 0, we have sgn(x)r(x) < 0 for |x| ≥ r2 (with sgn(x) = 1{x>0} − 1{x≤0} ). Under Assumption 2, there is a unique strong solution to (1) (for instance [28], Theorem 5.2.1.). We denote by (Φx (t), t ≥ 0) the unique solution to (1) with initial condition x ∈ X. In particular, (Φx (t), t ≥ 0) is a strong Markov process and is ergodic (cf. [23], Theorem 1.16.). Note that when X is bounded, the drift condition sgn(x)r(x) < 0 for large enough x can be dropped. Division events. An individual with trait x dies at an instantaneous rate x 7→ B(x), where B : X → [0, ∞) satisfies the following condition: Assumption 3. The function x 7→ B(x) is continuous. Moreover, for some b1 , b2 > 0 and γ ≥ 0, γ we have b1 ≤ B(x) ≤ b2 |x| + b1 for every x ∈ X. Under Assumptions 2 and 3, the process X in (2) is well defined and the size of the population does not explode in finite time almost-surely, see for instance Marguet [26]. Note that the lower bounds for σ and B are not needed for the well-posedness of X but rather for later statistical purposes. Fragmentation of the trait at division. Finally, we make an additional set of assumptions on the fragmentation distribution κ(z)dz that ensures in particular the non-degeneracy of the process. Assumption 4. We have κ(z) = κ(1 − z) for almost every z ∈ [0, 1], supp(κ) ⊂ [ε, 1 − ε] for some 0 < ε < 1/2, inf z∈[ε,1−ε] κ(z) ≥ δ. The symmetry condition of Assumption 4 on the fragmentation distribution κ(z)dz ensures that the law of the trait at birth is identical for both children. The other parts of Assumption 4 are slightly technical and may presumably be relaxed. 6 MARC HOFFMANN AND ALINE MARGUET Representations of P and Q. Under Assumptions 2, 3 and 4, we obtain closed-form formulae for the transition P defined via (3) and the mean or marginal transition Q of the BMC (Xu )u∈T , see (4) that also gives the transition probability of the discrete Markov chain with value in X corresponding to the trait at birth along an ancestral lineage. These representations are crucial for the subsequent analysis of the variance of the estimators of P and of the invariant measure ν. Proposition 5. Work under Assumptions 2, 3 and 4. For every x, y, y1 , y2 ∈ X, we have P(x, dy1 dy2 ) = p(x, y1 , y2 )dy1 dy2 and Q(x, dy) = q(x, y)dy, with (7)  i hZ ∞ Rt κ y1 /(y1 + y2 ) −2 p(x, y1 , y2 ) = B (y1 + y2 ) σ(y1 + y2 ) E e− 0 B(φx (s))ds dLyt 1 +y2 (φx ) y1 + y2 0 and Z (8) q(x, y) = 0 where Lyt (φx ) 1 hZ ∞ Rt i κ(z) y/z −2 B(y/z)σ(y/z) E e− 0 B(φx (s))ds dLt (φx ) dz, z 0 denotes the local time at t in y of the semimartingale (φx (t))t≥0 . 4, we have p(x, y1 , y2 ) = p(x, y2 , y1 ) for every x, y1 , y2 ∈ X and also R Note that by Assumption R p(x, y , y)dy = p(x, y, y 1 1 2 )dy2 = q(x, y) for every x, y ∈ X. X X 2.2. Convergence of empirical measures. Convergence of Q to equilibrium. Assumptions 2,3 and 4 imply a drift condition for the Lyapunov function V (x) = x2 on X and a minorisation condition over a small set so that in turn Q is geometrically ergodic. Let Q = Q(ri , bi , σi , zi , γ, ε, δ, i = 1, 2) be the class of all transitions Q = Q(r, σ, B, κ) defined over X that satisfy Assumptions 2,3 and 4 with appropriate constants. An invariant probability R measure for Q is a probability ν on X such that νQ = ν, where νQ(dy) = x∈X ν(dx)Q(x, dy). Define Z Qr (x, dy) = Q(x, dz)Qr−1 (z, dy) with Q0 (x, dy) = δx (dy) for the r-th iteration of Q. For ϕ : X → R, we set |ϕ(x)| x∈X 1 + V (x) |ϕ|V = sup and write ν(ϕ) = R X ϕ(x)ν(dx) when no confusion is possible. Theorem 6 (Convergence to equilibrium). Work under Assumptions 2, 3 and 4. Then any Q ∈ Q admits an invariant probability distribution ν. Moreover, for V (x) = x2 , there exist C = C(Q) > 0 and ρ = ρ(Q) ∈ (0, 1) such that for every m ≥ 1, the bound Qm ϕ − ν(ϕ) V ≤ Cρm ϕ − ν(ϕ) V holds as soon as |ϕ|V < ∞. Moreover, supQ∈Q C(Q) < ∞ and supQ∈Q ρ(Q) < 1. In particular, we have |Qm ϕ(x) − ν(ϕ)| ≤ Cρm (1 + V (x))|ϕ − ν(ϕ)|∞ for every x ∈ X. ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 7 Control of empirical variances. Theorem 6 is the key ingredient in order to control the rate of convergence of empirical means of the form (9) Mn (ψ) = 1 X ψ(Xu− , Xu ) |T?n | ? u∈Tn that converge to P νQ(ψ) for any reasonable test function ψ : X × X → R. (If ϕ : X → R we set Mn (ϕ) = |Tn |−1 u∈Tn ϕ(Xu ) → ν(ϕ) and we have a formal correspondence between the two expressions by writing ψ(x, y) = ϕ(y) as a function of the second variable.) In order to derive nonparametric estimators of ν and Q by means of kernel functions ψ that shall depend on n, we need sharp estimates in terms of ψ. We shall restrict our study to transitions Q ∈ Q for which the geometric rate of convergence to equilibrium ρ = ρ(Q) given in Theorem 6 satisfies ρ(Q) ≤ 1/2. Let Q1/2 ⊂ Q denote the set of such transitions. We need some notation. We denote by | · |1 the usual L1 -norm w.r.t. the Lebesgue measure on X×X. For a function ψ = X×X → R we set ψ ? (x) = supy∈X |ψ(x, y)| and ψ? (y) = supx∈X |ψ(x, y)| and define Z ^Z |ψ|∧1 = |ψ(x, y)|dxdy sup |ψ(x, y)|dy. X×X X x∈X Note in particular that when ψ(x, y) = ϕ(y) is a function of y only, we may have that |ψ? |1 = R |ϕ(y)|dy is finite while ψ is not integrable on X × X as a function of two variables. For a positive X measure ρ on X, let also Z |ψ|ρ = |ψ(x, y)|ρ(dx)dy + |ψ|∧1 . X×X We write Pµ for the law of (Xu )u∈T with initial distribution µ for X∅ . Remember that V (x) = x2 from Theorem 6. Theorem 7. Work under Assumptions 2, 3 and 4. Let µ be a probability measure on X such that µ(V 2 ) < ∞. Let ψ : X × X → R a bounded function such that ψ? is compactly supported. The following estimate holds true:  2    Eµ Mn (ψ) − ν(Qψ) . |Tn |−1 |ψ 2 |µ+ν + |ψ ? ψ|µ + 1 + µ(V 2 )1/2 |ψ? |1 |ψ|ν , where the symbol . means up to an explicitly computable constant that depends on Q and on supp(ψ? ) only. Moreover, the estimate is uniform in Q ∈ Q1/2 . Several remarks areR in order: 1) We have a sharp order in terms of the test functions ψ, that behave no worse than X2 ψ 2 under minimal regularity on ν which is satisfied, see Lemma 25 below (and of course µ, although this restriction could easily be relaxed). This behaviour is the one expected for instance in the IID case and is crucial for the subsequent statistical application of Theorem 10 where the functions ψ will be kernel depending on n. 2) Theorem 7 can be derived with other more competitive tools in the uniform geometric ergodic case, see e.g. [8, 5], a case we do not recover here since X is not necessarily bounded. 3) Theorem 7 has an analog in [15] for piecewise deterministic growth-fragmentation models, but our proof is somewhat simpler here and sharper (we do not pay the superfluous logarithmic term in [15]). 8 MARC HOFFMANN AND ALINE MARGUET 3. Statistical estimation 3.1. Nonparametric estimation of Q and ν. Under Assumptions 2, 3 and 4, any Q(x, dy) = q(x, y)dy admits an invariant probability measure ν(dx) = ν(x)dx, the regularity of ν(x) being R inherited from that of Q via ν(x) = X q(z, x)ν(dz). Fix (x0 , y0 ) ∈ X × X. We are interested in constructing estimators of q(x0 , y0 ) and ν(x0 ) from the observation Xn when both functions satisfy some Hölder regularity properties in the vicinity of (x0 , y0 ). To that end, we need approximating kernels. 8. A function G : X → R is a kernel of order k if it is compactly supported and satisfies RDefinition ` x G(x)dx = 1{`=0} for ` = 0, . . . , k. X The construction and numerical tractability of approximating kernels is documented in numerous textbooks, see for instance Tsybakov [33]. For bandwidth parameters h, h1 , h2 > 0, we set Gh (y) = h−1 G(h−1 y) and −1 −1 −1 −1 G⊗2 h1 ,h2 (x, y) = h1 h2 G(h1 x)G(h1 y  and obtain approximations of ν(y0 ) and q(x0 , y0 ) by setting Z Gh ? ν(y0 ) = Gh (y − y0 )ν(y)dy X and Z Gh ? q(x0 , y0 ) = X×X G⊗2 h1 ,h2 (x − x0 , y − y0 )ν(x)q(x, y)dxdy. The convergence of Mn (ϕ) to ν(ϕ) suggests to pick ϕ = Gh (· − x0 ) that converges to Gh ? ν(x0 ) and use it as a proxy of ν(x0 ). We obtain the estimator  νbn (x0 ) = Mn Gh (· − x0 ) , specified by the choice of h > 0 and the kernel G. Likewise, an estimator of q(x0 , y0 ) is obtained by considering the quotient estimator with numerator ψ = Gh1 ,h2 (· − x0 , · − y0 ) that converges to Gh ? ν(x0 )q(x0 , y0 ) and denominator νbn,h (x0 ) in order to balance the superfluous weight ν(x0 ) in the numerator. We obtain the estimator  Mn G⊗2 h1 ,h2 (· − x0 , · − y0 )  qbn (x0 , y0 ) = , Mn Gh (· − x0 ) ∨ $ specified by the choice of h, h1 , h2 > 0, a threshold $ > 0 and the kernel G. In order to quantify the kernel approximation, we introduce anisotropic Hölder classes. For α > 0, we write α = bαc + {α} with bαc an integer and 0 < {α} ≤ 1. Definition 9. Let α, β > 0 and Vx0 and V(y0 ) be bounded neighbourhoods of x0 and y0 . i) The function ϕ : Vx0 → R belongs to the Hölder class Hα (x0 ) if (10) |ϕ(bαc) (y) − ϕ(bαc) (x)| ≤ C|y − x|{α} for every x, y ∈ Vx0 . ii) The function ψ : Vx0 × Vy0 → R belongs to the anisotropic Hölder class Hα,β (x0 , y0 ) if x 7→ ψ(x, y0 ) ∈ Hα (x0 ) and y 7→ ψ(x0 , y) ∈ Hβ (y0 ) hold simultaneously. ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 9 We obtain a semi-norm on Hα (x0 ) by setting |ϕ|Hα (x0 ) = supx∈Vx0 |ϕ(x)| + cα (ϕ), where cα (ϕ) is the smallest constant for which (10) holds. Likewise, we equip Hα,β (x0 , y0 ) with the semi-norm |ψ|Hα,β (x0 ,y0 ) = |ψ(·, y0 )|Hα (x0 ) + |ψ(x0 , ·)|Hβ (y0 ) . The space Hα,β (x0 , y0 ) is appended with (semi) Hölder balls  Hα,β (x0 , y0 )(R) = ψ : X × X → R, |ψ|Hα,β (x0 ,y0 ) ≤ R , R > 0. We are ready to state our convergence result over transitions Q that belong to α,β (x0 , y0 )(R), R > 0, Qα,β 1/2 (R) = Q1/2 ∩ H with a slight abuse of notation. Theorem 10. Work under Assumptions 2,3, 4. Assume that the initial distribution µ is absolutely continuous w.r.t. the Lebesgue measure with a locally bounded density function and satisfies µ(V 2 ) < ∞. Let α, β > 0. Specify νbn (y0 ) by a kernel of order k > max{α, β} and h = |Tn |−1/(2β+1) and qbn (x0 , y0 ) with the same kernel and h1 = |Tn |−s(α,β)/(α∧β)(2s(α,β)+1) , h2 = |Tn |−s(α,β)/β(2s(α,β)+1) and $n → 0. Then, for every R > 0  2 1/2 sup E νbn (y0 ) − ν(y0 ) . |Tn |−β/(2β+1) Q∈Qα,β (R) 1/2 and sup Q∈Qα,β (R) 1/2  2 1/2 E qbn (x0 , y0 ) − q(x0 , y0 ) . $n−1 |Tn |−s(α,β)/(2s(α,β)+1) hold true, where s(α, β)−1 = (α ∧ β)−1 + β −1 is the effective anisotropic smoothness associated with (α, β). Several remarks are in order: 1) We obtain an optimal result in the minimax sense for estimating ν(y0 ) and in the R case β ≥ α for estimating q(x0 , y0 ). This stems from the fact that the representation ν(x) = X ν(y)q(y, x)dy henceforth q ∈ Hα,β implies that ν ∈ Hβ . In turn, the numerator of qbn (x0 , y0 ) is based on the estimation of the function ν(x)q(x, y) ∈ Hα∧β,β . 2) In the estimation of q(x0 , y0 ), we have a superfluous term $n−1 in the error that can be taken arbitrarily small, and that comes from the denominator of the estimator. It can be removed, however at a significant technical cost. Alternatively, one can get rid of it by weakening the error loss: it is not difficult to prove  p 1/p E qbn (x0 , y0 ) − q(x0 , y0 ) . |Tn |−s(α,β)/(2s(α,β)+1) for every 0 < p < 2, and the result of course also holds in probability. 3) The assumption that µ is absolutely continuous can also be removed. 4) Finally, a slightly annoying fact is that the estimators νbn (x0 ) and qbn (x0 , y0 ) require the knowledge of (α, β) to be tuned optimally, and this is not reasonable in practice. It is possible to tune our estimators in practice by cross-validation in the same spirit as in [21], but an adaptive estimation theory still needs to be established. This lies beyond the scope of the paper, and requires concentration inequalities, a result we do not have here, due to the fact that the model is not uniformly geometrically ergodic (otherwise, we could apply the same strategy as in [8, 5]). 3.2. Parametric estimation of the division rate. In order to conduct inference on the division rate x 7→ B(x), we need more stringent assumptions on the model so that we can apply the results of Theorem 7. The main difficulty lies in the fact that we need to apply Theorem 7 to test functions of the form ψ(x, y) = log q(x, y) when applied to the loglikelihood of the data, and that these functions are possibly unbounded. 10 MARC HOFFMANN AND ALINE MARGUET A stochastic trait model as a diffusion on a compact with reflection at the boundary. We circumvent this difficulty by assuming that the trait φx (t) of each individual evolves in a bounded interval with reflections at the boundary and with no loss of generality, we take X = [0, L] for some L > 0. The dynamics of the traits now follows (11) dφx (t) = r(φx (t))dt + σ(φx (t))dWt + d`t , Rt where the solution (`t )t≥0 to `t = 0 (1{φx (s)=0} + 1{φx (s)=L} )d`s accounts for the reflection at the boundary and (Wt )t≥0 is a standard Brownian motion. Under Assumption 2 (that reduces here to the boundedness of r, σ and the ellipticity of σ) there exists a unique strong solution to (11), see for instance Theorem 4.1. in [32]. A slight modification of Proposition (5) gives the following explicit formulae for the transitions P and Q. Remember that by Assumption 4, we have supp(κ) ⊂ [ε, 1 − ε]. Define   L−y1 ε ε . D = 0 < y1 ≤ εL, 1−ε y1 ≤ y2 ≤ 1−ε ε y1 ∪ εL ≤ y1 ≤ (1 − ε)L, 1−ε y1 ≤ y2 ≤ y1 Then the explicit formula for p(x, y1 , y2 ) given in (7) remains unchanged provided (x, y1 , y2 ) ∈ X×D and it vanishes outside of X × D. For q(x, y), the formula (8) now becomes Z ∞ R  Z 1 κ(z) y/z −2 − 0t B(φx (s))ds (12) q(x, y) = B(y/z)σ(y/z) E e dLt (φx ) dz, y/L z 0 for (x, y) ∈ X × {0 ≤ y ≤ (1 − ε)L} and 0 otherwise. Adapting the proof of Theorem 6 to the case of a diffusion living on a compact interval (formally replacing [−w, w] by [0, L] in the proof of Proposition 22 below) one easily checks that Theorem 6 remains valid in this setting (applying for instance Theorem 4.3.16 in [9]). In turn, Theorem 7 also holds true in the case of a reflected diffusion. For parametric estimation, the control on the variance of Mn (ψ) is less demanding and we will simply need the following Corollary 11. Work under Assumptions 2,3, 4 in the case of a reflected diffusion on [0, L] for the evolution of the trait (φx (t), t ≥ 0). Let ψ : X × X → R. Then, for any probability measure µ, we have   sup Eµ (Mn (ψ) − ν(Qψ))2 . |Tn |−1 sup ψ(x, y)2 . Q∈Q1/2 x,y Maximum likelihood estimation. From now on, we fix a triplet (r0 , σ0 , κ0 ) and we let the division rate x 7→ B(x) belong to a parametric class  B = B : X → R, B(x) = B0 (ϑ, x), x ∈ X, ϑ ∈ Θ , where x 7→ B0 (x, ϑ) is known up to the parameter ϑ ∈ Θ, and Θ ⊂ Rd for some d ≥ 1 is a compact subset of the Euclidean space. In this setting, the model is entirely characterised by ϑ which is our parameter of interest. A first minimal stability requirement of the parametric model is the following Assumption 12. We have Q(B) = {Q = Q(r0 , σ0 , B, κ), B ∈ B} ⊂ Q1/2 . A second minimal requirement is the identifiability of the class B, namely the fact that the map B 7→ Q(r0 , σ0 , B, κ0 ) from B to Q is injective. This is satisfied in particular if B satisfies a certain orderliness property. ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 11 Definition 13. A class B of functions from X → [0, ∞) is orderly if ϕ1 , ϕ2 ∈ B implies either ϕ1 (x) ≤ ϕ2 (x) for every x ∈ X or ϕ2 (x) ≤ ϕ1 (x) for every x ∈ X. Proposition 14. Let B be orderly in the sense of Definition 13 and Q(B) ⊂ Q for some (r0 , σ0 , κ0 ). Then B 7→ Q(r0 , σ0 , B, κ0 ) is injective. We further stress the dependence on ϑ by introducing a subscript in the notation whenever relevant. We formally obtain a statistical experiment  En = Pnϑ , ϑ ∈ Θ by letting Pnϑ denote the law of Xn = (Xu , u ∈ Tn ) under Pϑ with initial condition X∅ distributed according to νϑ on the product space X|Tn | endowed with its Borel sigma-field. The experiment En is dominated by the Lebesgue measure on X|Tn | and we obtain a likelihood function by setting Y  (13) Ln ϑ, (Xu , u ∈ Tn ) = qϑ (Xu− , Xu ), u∈T? n where Xu− denotes the trait of the parent of u. Taking any maximiser of (13) we obtain a maximum likelihood estimator  ϑbn ∈ argmax Ln ϑ, Xn ϑ∈Θ provided a maximiser exists. Convergence results and asymptotic efficiency. We first have an existence and consistency result of ϑbn under the following non-degeneracy assumption that strengthens Assumption 3. Assumption 15. The function B0 : Θ × X → [0, ∞) is continuous and for some positive b3 , b4 , we have 0 < b3 ≤ inf B0 (ϑ, x) ≤ sup B0 (ϑ, x) ≤ b4 ϑ,x ϑ,x  Moreover, the class B = B0 (ϑ, ·), ϑ ∈ Θ is orderly in the sense of Definition 13. Theorem 16. Work under Assumptions 2, 4, 12 and 15. Then, for every ϑ ∈ Θ, ϑbn converges to ϑ in probability as n → ∞. Our next result gives an explicit rate of convergence and asymptotic normality for ϑbn . We need further regularity assumptions. Assumption 17. The set Θ has non empty interior and, for every x ∈ X the map ϑ 7→ B0 (ϑ, x) is three times continuously differentiable. Moreover, for every 1 ≤ i, j, k ≤ d: sup |∂ϑi B0 (ϑ, x)| + sup |∂ϑ2i ϑj B0 (ϑ, x)| + sup |∂ϑ3i ϑj ϑk B0 (ϑ, x)| < ∞. ϑ,x ϑ,x ϑ,x Introduce the Fisher information Ψ(ϑ) at point ϑ ∈ Θ as the d × d-matrix with entries: ∂ q ∂ q  Z ∂ϑi qϑ (x, y) ∂ϑj qϑ (x, y) ϑi ϑ ϑj ϑ Ψ(ϑ)i,j = νϑ Qϑ = νϑ (x)qϑ (x, y)dxdy, qϑ2 qϑ (x, y)2 X×X for 1 ≤ i, j ≤ d. Assumption 18. For every ϑ in the interior of Θ, the matrix Ψ(ϑ) is nonsingular. 12 MARC HOFFMANN AND ALINE MARGUET Although standard in regular parametric estimation, Assumption 18 is not obviously satisfied even if we have the explicit formula (12), for qϑ (x, y), due to its relatively intricate form. We can however easily show that it is satisfied in the special case of a trait evolving as a reflected diffusion with constant drift. More general parametrisations are presumably possible, adapting the proof delayed until Appendix 6.2. Proposition 19. Assume d = 1, B0 (ϑ, x) = ϑ for every x ∈ X, with Θ = [ϑ1 , ϑ2 ] ⊂ (0, ∞), r(x) = r1 < 0 and σ(x) = σ0 > 0 for every x ∈ X. Let κ(z) = (1 − 2ε)−1 for every z ∈ [ε, 1 − ε]. There exists an explicit open interval I ⊂ (0, 1/2) such that Assumption 18 is satisfied as soon as ε ∈ I. We are ready to state our final result on asymptotic normality of ϑbn . Theorem 20. Work under Assumptions 2, 4, 12, 15, 17 and 18. For every ϑ in the interior of Θ, we have  T1/2 (ϑbn − ϑ) → N 0, Ψ(ϑ)−1 n in distribution as n → ∞, where N(0, Ψ(ϑ)−1 ) denote the d-dimensional Gaussian distribution with mean 0 and covariance the inverse of the Fisher matrix Ψ(ϑ). Several remarks are in order: 1) Although asymptotically optimal, the practical implementation of ϑbn is a challenging question that we plan to address in a systematic way. 2) As for classical estimation in diffusion processes (see e.g. [11, 16]), the assumptions of Theorem 20, especially Assumption 18 are standard. However, the fact that they hold true in the simple case of Proposition 19 and a glance at the proof is an indication that they are certainly true in wider generality. 4. Numerical implementation We consider the implementation of the estimator ϑbn in the case of a branching population structured by a trait drawn according to a Brownian motion reflected on [0, 1], namely Z t φx (t) = x + Wt + `t , `t = (1{φx (s)=0} + 1{φx (s)=1} )d`s , t ≥ 0, 0 where (Wt )t≥0 is a standard Brownian motion. We pick κ(z) = (1 − 2ε)−1 1[ε,1−ε] (z) so that an individual with trait x at division splits into two individuals with traits U x and (1 − U )x respectively, where U is uniformly distributed on [ε, 1 − ε]. We pick ε = 10−4 . 4.1. Generation of simulated data. Given a division rate B and an initial trait xin ∈ R, we recursively construct a dataset of size Tn = 2n+1 − 1. We pick T large enough so that each individual of the (Nn + 1)-th generation is born before time T . For each individual u in the ”current” population (composed of individuals from generations smaller than Nn ) and born at time t < T , i) we simulate a reflected diffusion using the Euler scheme for reflected stochastic differential equations of [24] with initial condition xin and time step ∆t until time T , ii) we draw the lifetime of u by rejection sampling, iii) we add to the population two new individuals with respective traits at birth given by U x and (1 − U )x where U is a realisation of a uniform random variable on [ε, 1 − ε] and x is the trait of u at division, iv) we remove the individual u from the ”current” population. We can thus simulate a sample of size 2n+1 − 1 by considering all the couples composed of the traits at birth of an individual and its ancestor. ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 0.563 0.563 0.562 0.562 Ln (ϑ, X) 0.564 Ln (ϑ, X) 0.564 13 0.561 0.561 0.560 0.560 0.559 0.559 1.25 1.50 1.75 2.00 2.25 2.50 2.75 1.25 1.50 ϑ 1.75 2.00 2.25 2.50 2.75 ϑ  Figure 2. The contrast Ln ϑ, (Xu , u ∈ Tn ) for n = 14 and B(x, ϑ) ≡ 2 with ∆ϑ = 0.05 (left) and ∆ϑ = 0.01 (right). We look at the results only for ∆ϑ = 0.05 because for smaller values of the increment, the noise due to computational errors is too important compared to the different values of the contrast. 4.2. Implementation of the maximum likelihood. For a given dataset Xn , we approximate  Ln ϑ, (Xu , u ∈ Tn ) using, for a given ϑ, the nonparametric estimator qbn (Xu− , Xu ) introduced in Section 3.1.  More specifically, we implement qbn (x0 , y0 ) = Mn G⊗2 h ,h (·−x0 ,·−y0 ) 1 2  Mn Gh (·−x0 ) ∨$ for every (x0 , y0 ) on a grid of −1 −1/2 mesh n−1 exp(−x2 /2), h = 2|Tn |−1/3 , 1 × n2 √of [0, 1] × [0, 1] with n1 = n2 = 200, G(x) = (2π) h1 = h2 = 0.1 h, $ = 10−6 . We next use an interpolation scheme provided by the package Interpolations in Julia to compute the value of the transition at each (Xu− , Xu ) ∈ Xn . For synthetic data, we pick n = 19, resulting in a tree of size 220 − 1 = 1 048 575 with initial value xin = 0.5 and ∆t = 5 10−4 . 4.3. Results. We consider the following parametric classes B0 (ϑ, x) = ϑ and B1 (ϑ, x) = 1 + ϑx. We compute 300 Monte-Carlo samples of size |Tn | = 215 − 1 = 32 767 for ϑ = ϑ1 = 2 and ϑ = ϑ2 = 15 in both cases. Therefore, we apply our results to four different cases. In each case, we approximate qϑ (Xu− , Xu ) for different values of ϑ ∈ Θ = [ϑmin , ϑmax ] and we compute the corresponding ϑbn . We progressively reduce the increment ∆ϑ for the choice of ϑ until the contrast of likelihood starts to be noisy (see Figure 2), adapting at each level the choice for the upper and lower bounds of Θ. The results are displayed in Table 1. We recover the parameter in all four cases, with various accuracies. The most accurate value is obtained for B1 with a small value of the parameter, i.e. ϑ = 2. We did not reach the optimal accuracy |Tn? |−1/2 ≈ 6 10−3 . One could presumably obtain a better accuracy by choosing a finer discretisation of [0, 1] × [0, 1] for the computation of the qbn . But this choice leads to an important increase of the computational time. The results in the case of a linear division rate are less accurate. Those results could also probably be improved using a cross-validation procedure for the choice of the bandwidth parameters h, h1 , h2 . 14 MARC HOFFMANN AND ALINE MARGUET B B0 B1 ϑ 2 15 2 15 Mean 1.9908 15.029 2.1392 15.023 Std Dev. 0.0845 0.4763 0.3485 0.6425 ϑmin 1.8 14 1.375 13.75 ϑmax 2.2 16 3 16.5 ∆ϑ 0.05 0.25 0.125 0.25 Table 1. Results for B in B1 and B2 . For each parametric class of functions B1 and B2 , we display the results for ϑ = 2 and ϑ = 15. The third and fourth columns corresponds respectively to the mean value and the standard deviation of ϑbn , computed with 300 different data sets of size 2n+1 − 1 = 32767. The fifth and sixth columns correspond to a 95% confidence interval. The last column corresponds to the value of the step for the discretisation of Θ, which limits the accuracy of the result. 5. Proofs 5.1. Proof of Proposition 5. We first prove (8). By the occupation times formula, a change of variable and Fubini’s theorem, for any bounded ϕ : X → R and x ∈ X, we have   Qϕ(x) = E ϕ(Xu ) Xu− = x Z ∞ hZ 1 i   Rt =E κ(z) ϕ zφx (t) B φx (t) e− 0 B(φx (s))ds dtdz 0 0 Z Z ∞ R y/z i t dL (φx ) κ(z) ϕ(y)B(y/z) dydz e− 0 B(φx (s))ds t z σ(y/z)2 R 0 0 Z Z 1 Z h ∞ Rt i κ(z) y/z = ϕ(y) B(y/z)σ(y/z)−2 E e− 0 B(φx (s))ds dLt (φx )dz dy, z R 0 0 hZ =E 1 where (Lyt (φx ))t≥0 is the local time of φx at y ∈ X. Since supp(κ) ⊂ [ε, 1 − ε], the above integrals are well defined and (8) is established. We turn to (7). By (3), for any bounded ψ : X3 → R and x ∈ X, we have Z ∞ hZ 1 i   Rt Pψ(x) = E κ(z) ψ x, zφx (t), (1 − z)φx (t) B φx (t) e− 0 B(φx (s))ds dtdz 0 0 ∞ i κ(z) Rt y /z B y1 /z σ(y1 /z) e− 0 B(φx (s))ds dLt 1 (φx ) dzdy1 z R 0 0  Z hZ ∞ Rt i  κ y1 /(y1 + y2 ) = ψ x, y1 , y2 B (y1 + y2 ) σ(y1 + y2 )−2 E e− 0 B(φx (s))ds dLyt 1 +y2 (φx ) y1 + y2 D 0 Z Z = 1 ψ x, y1 , 1−z z y1   −2 hZ E where we set y2 = 1−z z y1 in order to obtain the last line. The integral is taken over the domain   ε D = (y1 , y2 ) ∈ R2 , 1−ε y1 ≤ y2 ≤ 1−ε ε y1 ⊂ supp (y1 , y2 ) 7→ κ(z1 + z2 ) therefore the above integral is well defined and the representation (7) is proved. 5.2. Proof of Theorem 6. The proof goes along a classical path: we establish a drift and a minorisation condition in Proposition 21 and 22 below, and then apply for instance Theorem 1.2. in [18], see also the references therein. ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 15 Proposition 21 (Drift condition). Let V (x) = x2 . Work under Assumptions 2,3 and 4. There exist explicitly computable 0 < v1 = v1 (ε) < 1 and v2 = v2 (ε, r1 , r2 , σ1 , σ2 , b1 ) > 0 such that QV (x) ≤ v1 V (x) + v2 . Proposition 22 (Minorisation condition). Work under Assumption 2, 3 and 4. For large enough w > 0, there exists α ∈ (0, 1) and a probability measure µ on X such that inf {x,|x|≤w} Q(x, A) ≥ αµ(A) for every Borel set A ⊂ X. R1 Proof of Proposition 21. Fix x ∈ X and let m(κ) = 0 z 2 κ(z)dz. By Itô formula, we obtain the decomposition Z 1 Z ∞ h i  Rt QV (x) = κ(z) E z 2 φx (t)2 B φx (t) e− 0 B(φx (s))ds dtdz = m(κ)(I + II + III + IV ), 0 0 where Z ∞ h i  Rt I = x2 E B φx (t) e− 0 B(φx (s))ds dt, 0 Z ∞ hZ t i  Rt II = 2 E φx (u)r(φx (u))du B φx (t) e− 0 B(φx (s))ds dt, 0 0 Z ∞ hZ t i 2  Rt III = E σ φx (u) du B φx (t) e− 0 B(φx (s))ds dt, 0 0 Z ∞ hZ t i   Rt IV = 2 E φx (u)σ φx (u) dWu B φx (t) e− 0 B(φx (s))ds dt. 0 R∞ 0 Rt First, note that 0 B(φx (t))e− 0 B(φx (s))ds dt = 1, therefore I = x2 by Fubini’s theorem. We turn to II. By Fubini’s theorem again: Z ∞ hZ ∞   Rt  i II = 2 E φx (u)r φx (u) B φx (t) e− 0 B(φx (s))ds dt du 0 u hZ ∞  − R u B(φx (s))ds i = 2E φx (u)r φx (u) e 0 du Z 0 Z h ∞ Rt i = 2 zr(z)σ(z)−2 E e− 0 B(φx (s))ds dLzt (φx ) dz. 0 R by the occupation times formula. By Assumption 2 we have zr(z) < 0 for |z| ≥ r2 , therefore: Z r2 hZ ∞ Rt i II ≤ 2 zr(z)σ(z)−2 E e− 0 B(φx (s))ds dLzt (φx ) dz −r2 0 Z r2 h Z ∞ R i t −2 ≤ 2r1 r2 (1 + r1 )σ1 E e− 0 B(φx (s))ds dLzt (φx ) dz −r 0 Z ∞2  −2 ≤ 2r1 r2 (1 + r1 )σ1 e−b1 t P − t2 ≤ φx (t) ≤ r2 dt ≤ 2r1 r2 (1 + r1 )σ1−2 b−1 1 . 0 16 MARC HOFFMANN AND ALINE MARGUET using successively Assumption 2, 3 and the occupation times formula. For the term III, we have Z ∞ Z i  2 ∞  Rt III = E σ φx (u) B φx (t) e− 0 B(φx (s))ds du u Z0 ∞ h i Ru = E σ(φx (u))2 e− 0 B(φx (s))ds du 0 R∞ by Fubini again and this last quantity is less than σ22 0 e−b1 t dt = σ22 b−1 1 by Assumption 2 and 3. Similarly for the term IV, we have Z i hZ ∞  Rt  ∞ B φx (t) e− 0 B(φx (s))ds dtdWu IV = 2 E σ φx (u) u 0 i hZ ∞  − R u B(φx (s))ds dWu = 2E σ φx (u) e 0 0 and this last quantity vanishes. Putting the estimates for I, II, III and IV together, we conclude QV (x) ≤ m(κ)x2 + m(κ)(2r1 r2 (1 + r1 )σ1−2 + σ22 )b−1 1 . Since supp(κ) ⊂ [ε, 1−ε], we have m(κ) ≤ (1−ε)2 < 1 and this completes the proof with v1 = m(κ) and v2 = m(κ)(2r1 r2 (1 + r1 )σ1−2 + σ22 )b−1 1 .  Proof of Proposition 22. Step 1). Let x ∈ [−w, w] and A p ⊂ X be a Borel set. Applying Assumption 4, introducing the event W(φx (t)) = {2w ≤ φx (t) ≤ 2w (1 − ε)/ε)}, applying Fubini’s theorem and a change of variable, we successively obtain Z 1 Z ∞ h i  Rt Q(x, A) = κ(z) E 1{zφx (t)∈A} B φx (t) e− 0 B(φx (s))ds dtdz 0 ≥ b1 0 Z 1 Z κ(z) 0 Z 0 ∞ ∞ h Rt E 1W(φx (t)) 1{zφx (t)∈A} e− 0 B Z h R − 0t B(φx (s))ds E 1W(φx (t)) e ≥ b1 Z 0 = 1{y∈A} f (x, y)dy, φx (t)  i dtdz φx (s) ds i  1{y∈A} κ y/φx (t) φx (t)−1 dy dt 0 R Rt   R∞  with f (x, y) = b1 0 E 1W(φx (t)) 1{y≤φx (t)} e− 0 B(φx (s))ds κ y/φx (t) φx (t)−1 dt. Step 2). We now prove that f is bounded below independently of x. By Assumption 4 and the definition of W(φx (t)), we have Z ∞ h i Rt f (x, y) ≥ δb1 E 1W(φx (t)) 1{εφx (t)≤y≤(1−ε)φx (t)} e− 0 B(φx (s))ds φx (t)−1 dt 0 δb1 o h(x, y), 1n √ 2w (1 − ε)/ε 2w ε(1−ε)≤y≤2w(1−ε) Rt p  R∞  with h(x, y) = 0 E 1W(φx (t)) e− 0 B(φx (s))ds dt. Let ∆ = (1 + (1 − ε)/ε)w denote the mid-point p of the interval [2w, 2w (1 − ε)/ε]. Let also Tyx = inf {t > 0, φx (t) ≥ y} denote the exit time of the ≥ p ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 17 interval (inf X, y) by (φx (t))t≥0 . It follows that i hZ ∞ Rt 1W(φx (t)) e− 0 B(φx (s))ds dt h(x, y) ≥ E x T∆ Z ∞ = i h x R t+T∆ B(φx (s))ds dt E 1W(φx (t+T∆x )) e− 0 Z0 ∞ h i x R T∆ Rt x E 1W(φx (t+T∆x )) e− 0 B(φx (s))ds e− 0 B(φx (s+T∆ ))ds dt = Z0 ∞ h i Rt x γ x ≥ E 1W(φx (t+T∆x )) e−T∆ (b2 ∆ +b1 ) e− 0 B(φx (s+T∆ ))ds dt, 0 x by Assumption 3 and because φx (s) ≤ ∆ for every s ≤ T∆ . Applying the strong Markov property, we further obtain Z ∞ h i Rt x γ (14) h(x, y) ≥ E 1W(φ∆ (t)) e−T∆ (b2 ∆ +b1 ) e− 0 B(φ∆ (s))ds dt 0 p x ∆ since φx (T∆ ) = ∆ for x ≤ wp< ∆. Introduce next TW = inf{t ≥ 0, φ∆ (t) ∈ / [2w, 2w (1 − ε)/ε]}, i.e. the exit time of [2w, 2w (1 − ε)/ε] by (φ∆ (t))t≥0 . By (14) and Assumption 3 again, it follows that ∆ h Z TW i Rt x γ γ h(x, y) ≥ E 1W(φ∆ (t)) e−T∆ (b2 ∆ +b1 ) e− 0 (b2 |φx (s)| +b1 )ds dt "Z0 ∆ # ≥E TW 0 x 1W(φ∆ (t)) e−T∆ (b2 ∆ γ +b1 ) −v3 t e dt , p p ∆ and where v3 = b2 (2w (1 − ε)/ε)γ + b1 . Since using that φx (t) ≤ 2w (1 − ε)/ε for t ≤ TW −w x ∆ > −w, the event {T∆ ≤ T∆ } holds almost-surely for every x ∈ [−w, w] and therefore ∆ h Z TW i     −w −w γ γ ∆ (15) h(x, y) ≥ E e−T∆ (b2 ∆ +b1 ) e−tv3 dt ≥ v3−1 E e−T∆ (b2 ∆ +b1 ) E 1 − e−TW v3 . 0 −w ∆ by the independence of TW and T∆ . Furthermore, for every a, x ∈ X with x < a, we have P (Tax < ∞) = lim u→−∞ s(u) − s(x) , s(u) − s(a) Ry Rx where s(x) = inf X exp(−2 inf X r(z)σ(z)−2 dz)dy, is the scale function associated to (φx (t))t≥0 . By the classical Feller classification of scalar R diffusions (see e.g. Revuz and Yor [31]), we have the equivalence P (Tax < ∞) = 0 if only if inf X s(x)dx = 0 but that latter property contradicts −w Assumption 2. Therefore, there exist w1 , δ1 > 0 such that P(T∆ ≤ w1 ) > δ1 . It follows that     −w γ γ γ (16) E e−T∆ (b2 ∆ +b1 ) ≥ E e−w1 (b2 ∆ +b1 ) 1{T −w ≤w1 } ≥ δ1 e−w1 (b2 ∆ +b1 ) ∆ and since (17) ∆ TW > 0 almost surely, there exists δ2 > 0, independent of x, such that   ∆ E 1 − e−TW v3 > δ2 . Back to (15), putting together (16) and (17), we obtain h(x, y) ≥ v3−1 δ1 e−w1 (b2 ∆ γ +b1 ) δ2 18 MARC HOFFMANN AND ALINE MARGUET and eventually f (x, y) ≥ γ δb δ δ p 1 1 2 1n2w√ε(1−ε)≤y≤2w(1−ε)o e−w1 (b2 ∆ +b1 ) . 2w (1 − ε)/εv3 Step 3). Define the probability measure µ(dy) = f (y)dy on X by f (y) = and let α = (1 − ε − 1 p  1n2w√ε(1−ε)≤y≤2w(1−ε)o , 2w 1 − ε − ε(1 − ε) p ε(1 − ε)) √ b1 δδ1 δ2 (1−ε)/εv3 e−w1 (b2 ∆ γ +b1 ) . We may assume that 0 < α < 1 (the 0 lower bound remains valid if we replace δ by δ < δ for instance) and we thus have established Q(x, A) ≥ αµ(A), for an arbitrary Borel set A ⊂ X. The proof of Proposition 22 is complete.  5.3. Proof of Theorem 7. Preparations. We first state a useful estimate on the local time of Lyt (φx ) as t → ∞. Its proof is delayed until Appendix 6.1. Lemma 23. Work under Assumption 2. For every compact K ⊂ X and for every t ≥ 0, we have sup x∈X,y∈K E [Lyt (φx )] . 1 + t3/2 , up to a constant that only depends on r1 , r2 and σ2 . In particular, for every c > 0, the function Z ∞ y 7→ e−ct sup E [Lyt (φx )] dt 0 x∈X is well-defined and locally bounded, uniformly over Q. Lemma 23 enables us to obtain estimates on the action of P and Q on functions ψ : X × X → R with nice behaviours that will prove essential for obtaining Theorem 7. We set Z Z Qψ(x) = ψ(x, y)q(x, y)dy, P(ψ ⊗ ψ)(x) = ψ(x, y1 )ψ(x, y2 )p(x, y1 , y2 )dy1 dy2 , X X×X where p(x, y1 , y2 ) and q(x, y) are given in Proposition 5. Lemma 24. Work under Assumptions 2, 3 and 4. Let ψ : X × X → R be bounded and such that ψ? has compact support. There exists a constant csupp(ψ? ) depending on supp(ψ? ) (and Q) such that Z (18) |Qψ(x)| ≤ csupp(ψ? ) |ψ(x, y)|dy X and ? |P(ψ ⊗ ψ)(x)| ≤ csupp(ψ? ) ψ (x) Z X |ψ(x, y)|dy. Note in particular that (18) implies in turn the estimate Z 2 2 |Q ψ(x)| ≤ csupp(ψ? ) |ψ|1 ∧ csupp(ψ? ) | ψ? (y)|dy . |ψ|∧1 . X ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 19 Proof. By Assumption 3, we have Z ∞ Z 1    Rt E ψ(x, zφx (t))B φx (t) e− 0 B(φx (s))ds dtdz κ(z) |Qψ(x)| = ≤ ≤ Z 0 1 Z 0 ∞ κ(z) 0 0 Z 1 Z κ(z) 0 0 ∞    γ E ψ(x, zφx (t)) b2 |φx (t)| + b1 e−b1 t dtdz ∞ Z h  γ E ψ(x, zφx (t)) b2 |φx (t)| + b1 i b1 e−b1 s ds dtdz. t Next, by Fubini’s theorem and the occupation times formula, we derive Z s Z 1 Z ∞   E |ψ(x, zφx (t))|(b2 |φx (t)|γ + b1 ) dtdsdz |Qψ(x)| ≤ κ(z) b1 e−b1 s 0 ≤ 0 0 1 Z ∞ Z b1 e−b1 s κ(z) 0 0 1 Z −1 = 0 κ(z)z Z ≤ csupp(ψ? ) Z R |ψ(x, zy)|(b2 |y|γ + b1 )σ(y)−2 E[Lys (φx )]dydsdz ∞ Z b1 e −b1 s 0 R Z R |ψ(x, y)|(b2 |y/z|γ + b1 )σ(y/z)−2 E[Ly/z s (φx )]dydsdz |ψ(x, y)|dy, and (18) is proved with csupp(ψ? ) = sup y∈supp(ψ? ),x∈X,z∈[ε,1−ε] b1 (b2 |y/z|γ + b1 )σ(y/z)−2 z −1 Z ∞ e−b1 s E[Ly/z s (φx )]ds. 0 This last quantity is finite by Lemma 23. For the second estimate, we have Z 1 Z ∞ Rt     |P(ψ ⊗ ψ)(x)| ≤ κ(z) E ψ x, zφx (t) ψ x, (1 − z)φx (t) B(φx (t))e− 0 B(φx (s))ds dtdz 0 0 ≤ Qψ(x) sup ψ(x, y) y and we conclude by applying (18).  Completion of proof of Theorem 7. Without loss of generality, we may assume that ν(Qψ) = 0, the general case being obtained by considering the function ψ(x, y) − ν(Qψ). Of course, the compact support property is lost by adding a constant and one has to be careful when revisiting the estimates of Step 1) to Step 4) below. They exhibit additional error terms that all have the right order using Lemma 24 and the fact that P1 = Q1 = 1. Step 1). We start with a standard preliminary decomposition, see for instance [6, 7], expanding the sum in u ∈ T?n . We have E[Mn (ψ)2 ] = |T?n |−2 Eµ ≤ |T?n |−2 n X  X 2  ψ(Xu− , Xu ) m=1 u∈Gm n  X m=1 h Eµ X u∈Gm ψ(Xu− , Xu ) 2 i1/2 2 20 MARC HOFFMANN AND ALINE MARGUET by triangle inequality. Thus Theorem 7 amounts to control 2   X = Im + IIm , Eµ ψ(Xu− , Xu ) u∈Gm with Im = Eµ  X  ψ(Xu− , Xu )2 , u∈Gm IIm = Eµ X   ψ(Xu− , Xu )ψ(Xv− , Xv ) . u,v∈Gm ,u6=v Step 2). The control of the term Im is straightforward: by Lemma 24 we have Z 2 I1 = 2µ(Qψ ) ≤ 2csupp(ψ? ) ψ(x, y)2 µ(dx)dy for m = 1, X×X Im = 2m µ(Qm ψ 2 ) ≤ 2m (c2supp(ψ? ) |ψ 2 |1 ∧ csupp(ψ? ) |ψ?2 |1 ) for m ≥ 2, therefore Im . 2m |ψ 2 |µ holds for every m ≥ 1. In the case ν(Qψ) 6= 0, we replace |ψ 2 |µ by |ψ 2 |µ+ν . Step 3). We further decompose the main term IIm = IIIm + IVm , having  X  IIIm = Eµ ψ(Xw , Xw0 )ψ(Xw , Xw1 ) , w∈Gm−1 IVm = Eµ X  X  ψ(Xu , Xui )ψ(Xv , Xvj ) . u,v∈Gm−1 ,u6=v i,j=0,1 The control of IIIm is straightforward:  X   IIIm = Eµ P(ψ ⊗ ψ)(Xw ) = 2m−1 µ Qm−1 P(ψ ⊗ ψ) . w∈Gm−1 In the same way as for the term Im , by Lemma 24, one readily checks that |IIIm | . 2m−1 |ψ ? ψ|µ . Step 4). We now turn to the main term IVm . Writing here u ∧ v for the most common recent ancestor of u and v, conditioning w.r.t. F|u∧v|+1 and using the conditional independence of (Xu , Xui ) and (Xv , Xvj ) given F|u∧v|+1 thanks to the BMC property (3), we successively obtain h X X  i IVm = Eµ Eµ ψ(Xu , Xui )ψ(Xv , Xvj ) F|u∧v|+1 u,v∈Gm−1 ,u6=v i,j=0,1 = Eµ h = Eµ h X X    i Eµ ψ(Xu , Xui ) F|u∧v|+1 Eµ ψ(Xv , Xvj ) F|u∧v|+1 u,v∈Gm−1 ,u6=v i,j=0,1 X X    i Eµ Qψ(Xu ) F|u∧v|+1 Eµ Qψ(Xv ) F|u∧v|+1 u,v∈Gm−1 ,u6=v i,j=0,1 = 4 Eµ h X u,v∈Gm−1 ,u6=v i Q|u|−|u∧v| ψ(Xu∗ )Q|u|−|u∧v| ψ(Xv∗ ) , ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 21 where u∗ (respectively v ∗ ) is the descendant of u ∧ v which is an ancestor of u (respectively v). Conditioning further w.r.t. F|u∧v| we obtain h i X  IVm = 4 Eµ P Q|u|−|u∧v| ψ ⊗ Q|u|−|u∧v| ψ (Xu∧v ) u,v∈Gm−1 ,u6=v X =4 u,v∈Gm−1 ,u6=v =4 m−1 X  µ Q|u∧v| P(Q|u|−|u∧v| ψ ⊗ Q|u|−|u∧v| ψ) X l=1 u,v∈Gm−1 ,|u∧v|=m−l−1  µ Qm−l−1 P(Ql ψ ⊗ Ql ψ) , obtaining the last term by rearranging the sum u, v ∈ Gm−1 that expands over indices |u|−|u∧v| = m − 1 − |u ∧ v| that vary from 1 to m − 1. Notice also that for l = 1, . . . , m − 1, {u 6= v ∈ Gm−1 , |u ∧ v| = m − l − 1} = |Gm−l−1 | × 2l × 2l−1 , where |Gm−l−1 | is the number of common ancestors, 2l is the number of choices for u (the first descendant in generation m − 1 of the ancestor from generation m − l − 1) and 2l−1 is the number choices of v (the second descendant, satisfying u ∧ v ∈ Gm−1 ). We finally obtain IVm = 4 m−1 X l=1  2m+l−2 µ Qm−l−1 P(Ql ψ ⊗ Ql ψ) . By Lemma 24 and Theorem 6 one easily obtains the following estimates:  |µ Qm−2 P (Qψ ⊗ Qψ) | . |ψ? |1 |ψ|∧1 for l = 1, and for l ≥ 2:   |µ Qm−l−1 P(Ql ψ ⊗ Ql ψ) | . |ψ|2∧1 ∧ ρ2(l−1) |ψ? |21 µ Qm−l−1 P((1 + V ) ⊗ (1 + V )) . In the case ν(Qψ) 6= 0, we replace |ψ|∧1 by |ψ|ν . We claim that  (19) µ Qm−l−1 P((1 + V ) ⊗ (1 + V )) . 1 + µ(V 2 ) and postpone the proof of (19) to Step 6 below. It follows that for any ` ≥ 1: ∞ X  |IVm | . 2m |ψ? |1 |ψ|∧1 + 2m 2` |ψ|2∧1 ∧ ρ2(l−1) |ψ? |21 1 + µ(V 2 ) l=1  ≤ 2m |ψ? |1 |ψ|∧1 + 2m |ψ|2∧1 m m  ` X l=1 ∞   X 2−l (2ρ)2l 2l + |ψ? |21 1 + µ(V 2 ) |ψ|2∧1 2` ≤ 2 |ψ? |1 |ψ|∧1 + 2 inf `≥1  m 1/2 . 2 1 + µ(V ) |ψ? |1 |ψ|∧1 . l=`+1 + |ψ? |21   1 + µ(V ) 2−` 2 Step 5). Putting together the estimates obtained for Im in Step 2, IIIm in Step 3 and IVm in Step 4, and recalling IIm = IIIm + IVm we eventually derive:  X 2    Eµ ψ(Xu− , Xu ) . 2m |ψ 2 |µ + |ψ ? ψ|µ + 1 + µ(V )1/2 |ψ? |1 |ψ|∧1 . u∈Gm In the case ν(Qψ) 6= 0, we replace |ψ 2 |µ by |ψ 2 |µ+ν and |ψ|∧1 by |ψ|ν as follows from Step 2 and 4. Taking square root, summing in 1 ≤ m ≤ n, taking square again and normalising by |T?n |−2 we 22 MARC HOFFMANN AND ALINE MARGUET obtain Theorem 7. Step 6). It remains to establish (19). We only sketch the argument which is similar to the proof of Proposition 21. First, one easily obtains P((1 + V ) ⊗ (1 + V )) . 1 + QV (x) + QV 2 (x), and it follows that  µ(Qm−l−1 P (1 + V ) ⊗ (1 + V )) . 1 + µ(Qm−l V ) + µ(Qm−l V 2 ) . 1 + µ(V ) + µ(Qm−l V 2 ) by Proposition 21. Applying Itô’s formula and using Assumptions 2 and 3 on can check that QV 2 (x) . 1 + V (x)2 + QV (x) . 1 + V (x)2 by Proposition 21 again. We obtain (19) by integrating w.r.t. µ. 5.4. Proof of Theorem 10. Preparations. We first establish local estimates on the invariant density ν. Lemma 25. Work under Assumptions 2, 3 and 4. Let Q ∈ Q and let ν be the associated invariant density of Theorem 6. Let x0 ∈ X. There exist positive constants ci = ci (x0 , Q) and a bounded neighbourhood Vx0 with non-empty interior such that 0 < c1 ≤ inf ν(x) ≤ sup ν(x) ≤ c2 . x∈Vx0 x∈Vx0 Moreover, 0 < inf Q∈Q c1 (x0 , Q) ≤ supQ∈Q c2 (x0 , Q) < ∞. Proof. Let Vx0 = [a, b] ⊂ X be a bounded neighbourhood of x0 and   Vεx0 = a/(1 − ε) ∧ a/ε, b/ε ∨ b/(1 − ε) . By Proposition 5, using Assumptions 2, 3 and 4, for every x ∈ Vx0 , we successively obtain Z ν(x) = ν(y)q(y, x)dy X hZ ∞ Rt i κ(z) x/z B(x/z)σ(x/z)−2 E e− 0 B(φy (s))ds dLt (φy ) dzdy z X 0 0 Z hZ ∞ i γ −(1+γ) −2 ≤ (b2 |x| + b1 )ε σ1 ν(y) sup E e−b1 t dLxt (φy ) dy Z = Z 1 ν(y) X = (b2 |x|γ + b1 )ε−(1+γ) σ1−2 b1 x∈Vεx Z Z X 0 0 ∞ ν(y)   e−b1 t sup E Lxt (φy ) dtdy. x∈Vεx 0 0   By Lemma 23, we have supx∈εVx0 E Lxt (φy ) . 1 + t3/2 uniformly over Q and the first part of the lemma easily follows. For the second part of the lemma, we have Z hZ ∞ i Rt γ ν(x) ≥ b1 σ2−2 ν(y) infε E e−b2 0 |φy (s)| ds−b1 t dLxt (φy ) dy x∈Vx X ≥ b1 σ2−2 Z [−N,N ]∩X ≥ b1 σ2−2 e−(b2 M γ 0 0 hZ ν(y) infε E +b1 )T x∈Vx 0 Z [−N,N ]∩X T e−(b2 M 0 γ +b1 )t i dLxt (φy )1{supt≤T |φy (t)|≤M } dy   ν(y) infε E LxT (φy )1{supt≤T |φy (t)|≤M } dy x∈Vx0 ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 23     for arbitrary constants M, N, T > 0. Since E LxT (φy )1{supt≤T |φy (t)|≤M } ↑ E LxT (φy ) uniformly in (x, y) ∈ Vx0 × [−N, N ] as M grows, pick M large enough so that for every y ∈ [−N, N ] ∩ X, we have     infε E LxT (φy )1{supt≤T |φy (t)|≤M } ≥ 21 infε E LxT (φy ) . x∈Vx x∈Vx 0 0 Next, we use the fact that Assumption 2 implies that the law of the random variable φy (t) admits a density ρt (y, x) w.r.t. the Lebesgue measure and that this density is bounded away from zero on   RT compact sets in (y, x), see for instance [11, 16]. In turn E LxT (φy ) = 0 ρt (y, x)dt ≥ τT > 0 for some τT depending also on M and N and we infer Z τT −2 −(b2 M γ +b1 )T b1 σ2 e ν(x) ≥ ν(y)dy 2 [−N,N ]∩X and we obtain the result by taking N sufficiently large. The proof is complete.  Completion of proof of Theorem 10. Step 1). Write νbn (y0 ) − ν(y0 ) = I + II, with 1 X Gh (Xu − y0 ) − ν(QGh (· − y0 )) and II = Gh ? ν(y0 ) − ν(y0 ). I= |Tn | u∈Tn We plan to apply Theorem 7 to I with ψ(x, y) = ϕ(y) = Gh (y − y0 ). By Lemma 25, ν is locally bounded and we easily check that Z Z |ψ 2 |µ+ν . |Gh (y − y0 )2 |dy = h−1 G(y)2 dy . h−1 , X X |ψ ? ψ|µ . sup |Gh (y)| y Z X |Gh (y − y0 )|dy . h−1 , and |ψ? |1 |ψ|∧1 . Z X |Gh (y − y0 )|dy 2 . 1. Therefore, by Theorem 7, we have Eµ [I 2 ] . |Tn |−1 h−1 and this term is of orderR |Tn |−2β/(2β+1) from the choice of h. For the term II, Lemma 25 and the representation ν(x) = X ν(y)q(y, x)dy show that ν ∈ Hβ (y0 ) as soon as q ∈ Hα,β (x0 , y0 ). Then, by classical kernel approximation (see e.g. the textbook by Tsybakov [33]) we have that II 2 . h2β since the order k of the kernel G satisfies k > β, and thus II 2 the same order as I 2 from the choice of h. Step 2). For the estimation of q(x0 , y0 ), write qbn (x0 , y0 ) − q(x0 , y0 ) = I + II, with and  Mn G⊗2 h1 ,h2 (· − x0 , · − y0 ) − ν(x0 )q(x0 , y0 )  I= , Mn Gh (· − x0 ) ∨ $n   q(x0 , y0 ) ν(x0 ) − Mn Gh (· − x0 ) ∨ $n  II = . Mn Gh (· − x0 ) ∨ $n We have I ≤ III + IV, with  ⊗2 III = $n−1 Mn G⊗2 h1 ,h2 (· − x0 , · − y0 ) − Gh1 ,h2 ? ν(x0 )q(x0 , y0 ) 24 MARC HOFFMANN AND ALINE MARGUET and IV = $n−1 G⊗2 h1 ,h2 ? ν(x0 )q(x0 , y0 ) − ν(x0 )q(x0 , y0 ) . We plan to apply Theorem 7 to bound III with ψ(x, y) = Gh1 ,h2 (x − x0 , y − y0 ). Using Lemma 25 and the fact that µ is absolutely continuous, we have |ψ|µ+ν . |ψ|1 . It readily follows that −1 |ψ 2 |µ+ν . |Gh1 (· − x0 )2 |1 |Gh2 (· − y0 )2 |1 . h−1 1 h2 , |ψ ? ψ|µ . |Gh1 (· − x0 ) sup |Gh2 (y − y0 )|Gh1 (· − x0 )Gh2 (· − y0 )|1 y −1 = |Gh1 (· − x0 ) |1 sup |Gh2 (y − y0 )||Gh2 (· − y0 )|1 . h−1 1 h2 , 2 y and |ψ? |1 |ψ|1 . sup |Gh1 (x − x0 )||Gh2 (· − y0 )|21 |Gh1 (· − x0 )|1 . h−1 1 . x We conclude   −1 Eµ III 2 . $n−2 |Tn |−1 h−1 1 h2 , and this term has order $n−2 |Tn |−2s(α,β)/(2s(α,β)+1) from the choice of h1 and h2 . By kernel approximation and the fact that G has order k > max{α, β}, noting that (x, y) 7→ µ(x)q(x, y) ∈ Hα∧β,β , we have from the choice of h1 , h2 . |IV | . hα∧β + hβ2 . $n−1 |Tn |−s(α,β)/(2s(α,β)+1) 1 We turn to the term II. We plan to use  2 2 ν(x0 ) − Mn Gh (· − x0 ) ∨ $n . ν(x0 ) − Mn Gh (· − x0 ) + 1 Mn (Gh (·−x0 ))<$n . Pick n large enough so that 0 < $n ≤ τ (x0 ) = 12 inf Q∈Q,x∈Vx0 ν(x), a choice which is possible by Lemma 25. Since {Mn (Gh (· − x0 )) < $n } ⊂ {Mn (Gh (· − x0 )) − ν(x0 ) < −τ (x0 )}, we further infer   2  Eµ ν(x0 ) − Mn Gh (· − x0 ) ∨ $n  2    ≤ Eµ ν(x0 ) − Mn Gh (· − x0 ) + Pµ ν(x0 ) − Mn Gh (· − x0 ) ≥ τ (x0 )  2  . Eµ ν(x0 ) − Mn Gh (· − x0 ) . Applying Step 1) of the proof, we derive   Eµ II 2 . $n−2 |Tn |−2β/(2β+1) and this term has negligible order. The proof of Theorem 10 is complete.  R  Rx y r(z) 5.5. Proof of Proposition 14. Let s(x) = 0 exp −2 0 σ(z) and m(x) = 2 dz 2 σ(x)2 s0 (x) . Con- sider the infinitesimal generator L associated to the diffusion process (11), written in its divergence form  1 d  1 d Lf (x) = f (x) , f ∈ D(L), m(x) dx s(x) dx ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 25 with domain D(L) densely defined on twice continuously differentiable functions f satisfying the boundary condition f 0 (0) = f 0 (L) = 0. By Itô formula and Fubini’s theorem, for f ∈ D(L), we have Z Z 1 hZ ∞ i Rt d f (y)q(x, y)dy = − κ(z)E f (zφx (t)) e− 0 B(φx (s))ds dt dz dt X 0 0 Z 1 Z 1 i hZ ∞ Rt = κ(z)fz (x)dz + κ(z)E Lfz (φx (t)) e− 0 B(φx (s))ds dt dz, 0 0 0 where we set fz (x) = f (zx) for z ∈ [ε, 1 − ε] since supp(κ) ⊂ [ε, 1 − ε] by Assumption 4. Pick  Rx R y 2 R uε−1 |r(v)|2 dv σ(v) f (x) = 0 exp 2ε−1 0 e 0 s(u)−1 du dy, and note that  Z zxε−1 |r(v)|  2 dv f 0 (zx). f 00 (zx) = exp 2 2 εs(zx) σ(v) 0 It follows that for z ≥ ε and every x ∈ X, we have z zs(x)f 00 (zx) − s0 (x)f 0 (zx) m(x) s2 (x) R  0 |r(v)| zf (zx) 2zs(x) 2 R0zxε−1 σ(v) −2 0x 2 dv = e − e m(x)s(x)2 εs(zx) Lfz (x) = r(v) σ(v)2 dv  > 0. Now let B1 , B2 : X → [0, ∞) be two functions in an orderly class B according to Definition 13 and write qB1 and qB2 for the associated transition densities. With no loss of generality, we may (and will) assume that B1 (x) ≤ B2 (x) for every x ∈ X. Assume that qB1 = qB2 . Since supp(κ) ⊂ [ε, 1 − ε], we have Z  f (y) qB1 (x, y) − qB2 (x, y) dy X 1−ε Z = hZ κ(z)E ε ∞ Lfz (φx (t)) e− Rt 0 B1 (φx (s))ds 0 − e− Rt 0 B2 (φx (s))ds i dtdz = 0. Our choice of f and the property B1 ≤ B2 implies that the integrand is non-negative. It follows that Rt Rt  κ(z) e− 0 B1 (φx (s))ds − e− 0 B2 (φx (s))ds = 0 Rt Rt dzdt ⊗ P-a.s. Picking z such that κ(z) > 0, we obtain 0 B1 (φx (s))ds = 0 B2 (φx (s))ds P-a.s. for of the integrand in t. By the occupation times formula, it follows that  y Revery t ≥ 0 by continuity B (y) − B (y) L (φ )dy = 0, almost-surely, and by the ordering property, B1 (y) = B2 (y) for 1 2 x t X every y such that Lyt (φx ) > 0, i.e. for y ∈ [inf 0≤s≤t φx (s), sup0≤s≤t φx (s)] → X as t → ∞. The proof of Proposition 14 is complete. 5.6. Proof of Theorem 16. Preparation for the proof. We first establish uniform bounds for qϑ (x, y). Remember that in the reflected case, we have X = [0, L] and supp(κ) ⊂ [ε, 1 − ε] under Assumption 4. Lemma 26. Work under Assumptions 2, 4 and 15. For sufficiently small η > 0, we have: 0< inf x∈X,y∈Xη ,ϑ∈Θ where Xη = [0, (1 − ε)L − η]. qϑ (x, y) ≤ sup x,y∈X,ϑ∈Θ qϑ (x, y) < ∞, 26 MARC HOFFMANN AND ALINE MARGUET Proof. The proof is close to that of Lemma 25. Let x ∈ X and y ∈ Xη . We have Z 1−ε Z  κ(z)  ∞ −b4 t y/z inf qϑ (x, y) ≥ b3 σ2−2 e E dLt (φx ) dz ϑ∈Θ z 0 ε∨yL−1 Z ∞ Z 1−ε  y/z  κ(z) e−b4 t E Lt (φx ) dtdz ≥ b3 σ2−2 b4 z 0 ε∨yL−1 Z ∞   η e−b4 t inf E Lyt (φx ) dt ≥ (1 − ε)−1 b3 σ2−2 b4 x,y∈X L 0 According to [10], Section 5, proof of Lemma 5.37, the law of φx (t) is absolutely continuous with density with y 7→ ρt (x, y) that can be taken continuous and that satisfies inf x,y∈X ρt (x, y) > 0 for every t > 0. Therefore Z t  y  inf E Lt (φx ) = inf ρs (x, y)ds ≥ τt > 0 x,y∈X x,y∈X 0 and the result follows. The upper bound readily follows from Z Z 1−ε  ∞ −b3 t y  κ(z) dz sup E e dLt (φx ) sup qϑ (x, y) ≤ b4 σ1−2 z ϑ∈Θ x,y∈X 0 ε Z ∞   −2 −1 −b3 t ≤ ε b4 σ1 sup E e dLyt (φx ) x,y∈X = ε−1 b4 σ1−2 b3 sup x,y∈X which is finite by Lemma 23. Z 0 ∞   e−b3 t E Lyt (φx ) dt 0  Completion of proof of Theorem 16. This proof is classical (see for instance van der Vaart [34] Theorem 5.14). We nevertheless give it for self-containedness. For a ∈ Θ, let Z Z M(a, ϑ) = νϑ (dx) log qa (x, y)qϑ (x, y)dy. X X X X √ First, a 7→ M(a, ϑ) has a unique maximum at a = ϑ, as stems from the inequality log(x) ≤ 2( x−1) for x ≥ 0. Indeed Z Z qa (x, y) qϑ (x, y)dy M(a, ϑ) − M(ϑ, ϑ) = νϑ (dx) log q ϑ (x, y) X X Z Z p p  ≤ νϑ (dx) 2 qa (x, y) qϑ (x, y)dy − 2 X Z ZX p 2 p qa (x, y) − qϑ (x, y) dy ≤ 0. ≤− νϑ (dx) Next, writing mU (x, y) = supa∈U log qa (x, y), we prove that for every a 6= ϑ ∈ Θ, there exists a neighbourhood Ua of a such that:   (20) νϑ Qϑ mUa < νϑ Qϑ log qϑ = M(ϑ, ϑ). Pick a decreasing sequence of open balls (U` (a))`≥1 around a with vanishing diameters. For every x, y ∈ X we have mU` (a) (x, y) ↓ log qa (x, y) by continuity of a 7→ log qa (x, y) thanks to the ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 27  continuity of B0 according to Assumption 15. By Lemma 26, we also have νϑ Qϑ mU < ∞ for any U ⊂ Θ therefore  νϑ Qϑ mUl (a) ↓ νϑ Qϑ log qa ) = M(a, ϑ) ≤ M(ϑ, ϑ) by monotone convergence with equality only if a = ϑ, and this proves the existence of Ua such that (20) holds. We are now ready to prove the consistency result. For η 0 > 0, the compact ball Cη0 (ϑ) = {a ∈ Θ, |a − ϑ| ≥ η 0 } can be covered by finitely many open neighbourhoods Ua1 , . . . Uap with ai ∈ Cη0 (ϑ) and such that (20) holds for every Uai . For η > 0, let (η) mU (x, y) = sup log qa (x, y)1{qa (x,y)≥η} . a∈U Abbreviating Ln (a, (Xu )u∈Tn ) by Ln (a), it follows that |T?n |−1 sup a∈Cη0 (ϑ) log Ln (a) ≤ max |T?n |−1 1≤i≤p X (η) mUa (Xu− , Xu ) i u∈T? n → max νϑ Qϑ mUai < M(ϑ, ϑ)  (21) 1≤i≤p in probability as n → ∞ and letting η → 0, as stems from Corollary 11 and the fact that supx,y∈Xη mUai (x, y) < ∞ by Lemma 26. Finally, if ϑbn ∈ Cη0 (ϑ), then, by definition of ϑbn , we have |T?n |−1 sup a∈Cη0 (ϑ) log Ln (a) ≥ |T?n |−1 log Ln (ϑbn ) ≥ |T?n |−1 log Ln (ϑ) > M(ϑ, ϑ) − n , where n → 0 in probability, as follows from Corollary 11. We conclude the proof by noticing that   ϑbn ∈ Cη0 (ϑ) ⊂ |T?n |−1 sup Ln (a) ≥ M(ϑ, ϑ) − n a∈Cη0 (ϑ) and the fact that the probability of this last event converges to 0 by (21) as n → ∞. 5.7. Proof of Theorem 20. Preparation for the proof. We start by proving some useful estimates on the gradient and Hessian of log qϑ . Let Γϑ = ∇ϑ log qϑ = (∂ϑ1 log qϑ , . . . , ∂ϑd log qϑ ) , Γϑ,i = ∂ϑi log qϑ , 1 ≤ i ≤ d. Lemma 27. Work under Assumptions 2, 4, 15 and 17. For every 1 ≤ i, j ≤ d and η > 0, we have sup x∈X,y∈Xη ,ϑ∈Θ |Γϑ,i (x, y)| < ∞, sup x∈X,y∈Xη ,ϑ∈Θ |∂ϑ Γϑ (x, y)i,j | < ∞, sup x∈X,y∈Xη ,ϑ∈Θ where k·k corresponds to the operator norm for the Hessian ∂ϑ2 Γϑ (x, y). Proof. According to Lemma 26, since Γϑ (x, y) = ∂ϑ qϑ (x, y) qϑ (x, y) ∂ϑ2 Γϑ (x, y) < ∞ 28 MARC HOFFMANN AND ALINE MARGUET componentwise, it suffices to show |∂ϑi qϑ (x, y)| . 1 in order to establish the first bound. We have: Z 1−ε i hZ ∞ Rt κ(z) y/z ∂ϑi qϑ (x, y) = ∂ϑi B0 (ϑ, y/z)σ(y/z)−2 E e− 0 B0 (ϑ,φx (s))ds dLt (φx ) dz z ε∨yL−1 0 Z 1−ε Z t Z ∞ R i h t κ(z) y/z − ∂ϑi B0 (ϑ, φx (s))ds dLt (φx ) . B0 (ϑ, y/z)σ(y/z)−2 E e− 0 B0 (ϑ,φx (s))ds z ε∨yL−1 0 0 By Assumption 2, 15 and 17 we readily obtain Z 1−ε h Z ∞ i Rt y/z |∂ϑi qϑ (x, y)| . E (1 + t)e− 0 B0 (ϑ,φx (s))ds dLt (φx ) κ(z)dz ε 0 By Assumption 17 and integration by part, we have Z i hZ ∞ R  ∞  y/z y/z − 0t B0 (ϑ,φx (s))ds dLt (φx ) ≤ E (1 + t)e−b3 t dLt (φx ) E (1 + t)e 0 Z ∞0 y/z = (1 − b3 (1 + t))e−b3 t E[Lt (φx )]dt. 0 This last term is bounded by Lemma 23 and |∂ϑi qϑ (x, y)| . 1 follows. We turn to the second bound: clearly, for 1 ≤ i, j ≤ d ∂ϑ Γϑ (x, y)i,j = ∂ϑ2i ϑj qϑ (x, y)qϑ (x, y) − ∂ϑi qϑ (x, y)∂ϑj qϑ (x, y) qϑ (x, y)2 and thanks to Lemma 26 and the first bound, we only need to show |∂ϑ2i ϑj qϑ (x, y)| . 1 in order to Rt κ(z) obtain the second bound. Define ωt (y, z, ϑ) = 1{ε∨yL−1 ,1−ε} (z) zσ(y/z) 2 exp(− 0 B0 (ϑ, φx (s))ds). We have Z 1 hZ ∞ i y/z ∂ϑ2i θj qϑ (x, y) = ∂ϑ2i ϑj B0 (ϑ, y/z)E ωt (y, z, ϑ)dLt (φx ) dz 0 Z 1 + 0 hZ B0 (ϑ, y/z)E 0 − (`,`0 )=(i,j),(j,i) + Z 1 1 Z ∂ϑi B0 (ϑ, φx (s))ds 0 0 0 Z ωt (y, z, ϑ) 0 t Z ωt (y, z, ϑ) 0 ∞ t y/z ∂ϑj B0 (ϑ, φx (s))ds dLt i (φx ) dz 0 ∞ hZ ∂θ` B0 (ϑ, y/z)E hZ B0 (ϑ, y/z)E 0 t ωt (y, z, ϑ) 0 Z X Z ∞ 0 t i y/z ∂θ`0 B0 (ϑ, φx (s))dsdLt (φx ) dz y/z ∂ϑ2i ϑj B0 (ϑ, φx (s))dsdLt i (φx ) dz and we proceed in the same way as for the first estimate, using repeatedly Assumption 2, 15 and 17. The proof of the third bound is analogous.  Completion of proof of Theorem 20. This proof is classical (see for instance van der Vaart [34] Theorem 5.41). We nevertheless give it for self-containedness. By definition of ϑbn and a Taylor expansion around ϑ, we have X 0= Γϑbn (Xu− , Xu ) u∈T? n = X  u∈T? n  Γϑ (Xu− , Xu ) + ∂ϑ Γϑ (Xu− , Xu )(ϑbn − ϑ) + (ϑbn − ϑ)T ∂ϑ2 Γϑen (Xu− , Xu )(ϑbn − ϑ) , ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 29 for some ϑen on the segment line between ϑ and ϑbn . Rearranging the sum and introducing the normalisation |T?n |1/2 , we derive X X  ∂ϑ Γϑ (Xu− , Xu ) + |T?n |−1 (ϑbn − ϑ)T ∂ϑ2 Γϑen (Xu− , Xu ) |T?n |1/2 (ϑbn − ϑ) (22) |T?n |−1 u∈T? n = − |T?n |−1/2 u∈T? n X Γϑ (Xu− , Xu ). u∈T? n We plan to apply the central limit theorem for bifurcating Markov chain proved by Guyon, see [17] Corollary 24 on the right-hand side. By Lemma 26 and 27 we have that Qϑ (Γϑ,i Γϑ,j ) and Qϑ (Γϑ,i Γϑ,j Γϑ,k Γϑ,l ) are bounded functions on X for all 1 ≤ i, j, k, l ≤ d. Moreover, we have νϑ (Qϑ Γϑ,i ) = 0. Therefore X  Γϑ (Xu− , Xu ) → N 0, Ψ(ϑ) (23) |T?n |−1/2 u∈T? n in distribution as n → ∞, where Ψ(ϑ) is the Fisher information matrix defined after Assumption 17. Next, since ∂ϑ Γϑ is bounded by Lemma 27, we have X (24) |T?n |−1 ∂ϑ Γϑ (Xu− , Xu ) → Ψ(ϑ) u∈T? n in probability as n → ∞. Moreover, by Lemma 27, we have: supx,y∈X,ϑ∈Θ ∂ϑ2 Γϑ (x, y) < ∞ and since ϑbn − ϑ converges to 0 by Theorem 16, it follows that X (25) |T?n |−1 (ϑbn − ϑ)T ∂θ2 Γϑen (Xu− , Xu ) → 0 u∈T? n in probability as n → ∞ tends to infinity. Combining (23), (24) and (25) in (22) we finally obtain  Ψ(ϑ)|T?n |1/2 (ϑbn − ϑ) → N 0, Ψ(ϑ) in distribution as n → ∞. We conclude thanks to the invertibility of Ψ(ϑ) granted by Assumption 18. 6. Appendix 6.1. Proof of Lemma 23. Step 1). Fix δ > 0 and let Kδ = {y ∈ X, inf z∈K |y − z| ≤ δ} denote the δ-enlargement of K. For x ∈ X, let τx = inf{t ≥ 0, φx (t) ∈ Kδ }, inf ∅ = ∞, and    φsup Kδ (t − τx )+ δ φx (t) φK x (t) =   φinf Kδ (t − τx )+ if if if x > sup Kδ x ∈ Kδ x < inf Kδ . δ For every y ∈ K, we have Lyt (φx ) = Lyt (φK x ), and by Itô-Tanaka’s formula, it follows that Z t  K y y Kδ Kδ Kδ δ δ Lt (φx ) = Lt (φx ) = φx (t) − y − |φx (0) − y| − sgn φK x (s) − y dφx (s). 0 30 MARC HOFFMANN AND ALINE MARGUET δ Assume first that x > sup Kδ . Observing that Lyt (φx ) = 0 on {τx ≥ t}, and that dφK x (s) vanishes on [0, τx ) on {τx < t}, we readily have Lyt (φx ) (26) = δ φK x (t) − y − | sup Kδ − y| − Z t  K δ δ sgn φK x (s) − y dφx (s) τx ∧t = φsup Kδ (t − τx )+ − y − | sup Kδ − y| −  Z (t−τx )+ 0  sgn φsup Kδ (s) − y dφsup Kδ (s). We plan to bound each term separately. Step 2). By Itô’s formula, (φsup Kδ (t) − y)2 = (sup Kδ − y)2 + I + II, with t Z  2(φsup Kδ (s) − y)r(φsup Kδ (s)) + σ(φsup Kδ (s))2 ds, I= 0 t Z II = 2 0 (φsup Kδ (s) − y)σ(φsup Kδ (s))dWs . First, I ≤ 2σ1−2 Z R (z − y)r(z)Lzt (φsup Kδ )dz + tσ22 by the occupation times formula and Assumption 2. Introduce |y|r2 R= |y| ∨ r2 , where r2 is defined ∞ in Assumption 2. Since z − y > 0 and r(z) < 0 for z > |y|r2 , we have |y|r (z − y)r(z)Lzt (φx )dz < 0. 2 R −|y| Similarly −∞ r2 (z − y)r(z)Lzt (φx )dz < 0. It follows that Z R (z − y)r(z)Lzt (φx )dz ≤ Z |y|r2 −|y|r2 ≤ r1 Z (z − y)r(z)Lzt (φx )dz |y|r2 −|y|r2 |z − y|(1 + |z|)Lzt (φx )dz ≤ r1 (|y|r2 − y)(1 + |y|r2 ) Z Lzt (φx )dz R ≤ r1 (|y|r2 − y)(1 + |y|r2 )t, therefore I ≤ 2σ1−2 r1 (|y|r2 − y)(1 + |y|r2 )t + σ22 t = tκ(y) say. Since E[II] = 0, we derive by Cauchy-Schwarz’s inequality (27)   p E φsup Kδ (t) − y ≤ (sup Kδ − y)2 + tκ(y). ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 31 Step 3). We are ready to control each term of (26). We have    E φsup Kδ (t − τx )+ − y Z Z    (t−τx )+    (t−τx )+ σ φsup Kδ (s) dWs r φsup Kδ (s) ds + E ≤ | sup Kδ − y| + E 0 0 Z Z u  t    2 1/2 ≤ | sup Kδ − y| + r1 E (1 + |φsup Kδ (s)|)ds + E sup σ φsup Kδ (s) dWs u≤t 0 0  √  |φsup Kδ (s)|ds + 2σ2 t ≤ | sup Kδ − y| + r1 t + r1 E 0 Z tp √ ≤ | sup Kδ − y| + r1 t + r1 (sup Kδ )2 + sκ(0)ds + 2σ2 t Z t 0 .1 + t 3/2 , where we successively applied Assumption 2, Doob’s inequality and (27). In the same way Z (t−τx )+  − sgn φsup Kδ (s) − y dφsup Kδ (s) 0 Z t Z u  ≤r1 (1 + |φsup Kδ (s)|)ds + sup sgn(φsup Kδ (s) − y)σ φsup Kδ (s) dWs . u≤t 0 0 Taking expectation and using the foregoing arguments, this last quantity is also of order 1 + t3/2 and Lemma 23 is proved for x > sup Kδ . Step 4). If x < inf Kδ , we apply the same arguments, replacing | sup Kδ | by | inf Kδ | with obvious changes. Likewise if x ∈ Kδ we may replace | sup Kδ | by max{| sup Kδ |, | inf Kδ |}. 6.2. Proof of Proposition 19. Remember that 2 Z   ∂ q 2  Z ∂ϑ qϑ (x, y) ϑ ϑ dy. = νϑ (dx) Ψ(ϑ) = νϑ Qϑ qϑ qϑ (x, y) X X If A ⊂ X is a Borel set with Leb(A) > 0, we have Z νϑ (A) = 1A (y)qϑ (x, y)νϑ (dx)dy ≥ inf qϑ (x, y) Leb(A) > 0 X×X x,y since inf x,y∈X qϑ (x, y) > 0 by Lemma 26. By continuity of y 7→ ∂ϑ qϑ (x, y) on [0, L], it suffices then to show the existence x, y ∈ X such that ∂ϑ qϑ (x, y) > 0. For x, y ∈ X, we have Z 1−ε Z i κ(z) −2 h ∞ y/z ∂ϑ qϑ (x, y) = σ E (1 − ϑt)e−ϑt dLt (φx ) dz z ε∨yL−1 0 Z yε−1 hZ ∞ i du κ(y/u)σ −2 E (1 − ϑt)e−ϑt dLut (φx ) = u y(1−ε)−1 0 hZ ∞  dt i =E κ y/φx (t) (1 − ϑt)e−ϑt 1{y(1−ε)−1 ≤φx (t)≤yε−1 } φx (t) 0 Z ∞ h 1 1 i = (1 − ϑt)e−ϑt E 1{y(1−ε)−1 ≤φx (t)≤yε−1 } dt 1 − 2ε 0 φx (t) 32 MARC HOFFMANN AND ALINE MARGUET by the change of variable u = yz −1 , the occupation times formula, and the specific form of κ. For t ≥ 0, define Z yε−1 h 1 i dz At (x, y) = E 1{y(1−ε)−1 ≤φx (t)≤yε−1 } = ρt (x, z) , φx (t) z −1 y(1−ε) for which a closed-form formula is known, see for instance [25], Section 4.1, given by ρt (x, z) = ∞ 2 r1 (z−x) X e−a(n)t/2 2r1 e2r1 x + e g(n, x)g(n, z), e2r1 L − 1 L a(n) n=1 with g(n, x) =  πn   πn  πn + r1 sin x , and a(n) = r12 + π 2 n2 /L2 . cos x L L L It follows that At (x, y) = with I(n, y) = 2r1 e2r1 x log e2r1 L − 1  1−ε ε  + ∞ 2 −r1 x X e−a(n)t/2 e g(n, x)I(n, y) L a(n) n=1 R yε−1 er1 z g(n, z) dz z , and therefore Z ∞ 1 ∂ϑ qϑ (x, y) = (1 − ϑt)e−ϑt At (x, y)dt 1 − 2ε 0 Z ∞ e−a(n)t/2  1 2 −r1 x X  ∞ e (1 − ϑt)e−ϑt dt g(n, x)I(n, y) = 1 − 2ε L a(n) 0 n=1 Z yε−1 ∞ X 1 g(n, x)g(n, z) dz = . e−r1 (x−z) (1 − 2ε)L y(1−ε)−1 (ϑ + a(n)/2)2 z n=1 y(1−ε)−1 Let x ∈ [0, L] be such that g(n, x) 6= 0 for every n ≥ 1. Since x 7→ g(n, x) is continuous on [0, L], there exists 0 < εn < 12 such that g(n, x)g(n, z) > 0 for all z ∈ J(εn , x) = [2εn x, 2(1 − εn )x]. Let N > 0 be such that for all z ∈ J(ε1 , x): |RN (x, z)| = ∞ X n=N +1 g(n, x)g(n, z) g(1, x)g(1, z) < , (ϑ + a(n)/2)2 (ϑ + a(1)/2)2 which exists because by normal convergence of the above series. Then, for every z ∈ J(max{εn , 1 ≤ n ≤ N }, x) we have ∞ N X X g(1, x)g(1, z) g(n, x)g(n, z) g(n, x)g(n, z) = + RN (x, z) > − |RN (x, z)| > 0. 2 2 (ϑ + a(n)/2) (ϑ + a(n)/2) (ϑ + a(n)/2)2 n=1 n=1 Finally, for ε > max{εn , 1 ≤ n ≤ N }, picking y = 2ε(1 − ε)x yields [y(1 − ε)−1 , yε−1 ] = J(ε, x) ⊂ J(max{εn , 1 ≤ n ≤ N }, x) so that ∂ϑ qθ (x, y) > 0. Acknowledgement. We are grateful to V. Bansaye for helpful discussion and comments. A.M. acknowledge partial support by the Chaire Modélisation Mathématique et Biodiversité of Veolia Environnement - École Polytechnique - Museum National Histoire Naturelle - F.X. ESTIMATION IN A RANDOMLY STRUCTURED BRANCHING POPULATION 33 References [1] Romain Azaı̈s, François Dufour, and Anne Gégout-Petit. Non-parametric estimation of the conditional distribution of the interjumping times for piecewise-deterministic Markov processes. Scand. J. Stat., 41(4):950–969, 2014. [2] Vincent Bansaye. Proliferating parasites in dividing cells: Kimmel’s branching model revisited. Ann. Appl. Probab., 18(3):967–996, 2008. [3] Vincent Bansaye, Jean-François Delmas, Laurence Marsalle, and Viet Chi Tran. Limit theorems for Markov processes indexed by continuous time Galton-Watson trees. Ann. Appl. Probab., 21(6):2263–2314, 2011. [4] Vincent Bansaye and Sylvie Méléard. Stochastic models for structured populations, volume 1 of Mathematical Biosciences Institute Lecture Series. Stochastics in Biological Systems. Springer, Cham; MBI Mathematical Biosciences Institute, Ohio State University, Columbus, OH, 2015. Scaling limits and long time behavior. [5] S. Valère Biteski-Penda and Roche Angelina. Local bandwidth selection for kernel density estimation in bifurcating markov chain model. arXiv:1706.07034, 2017. [6] S. Valère Bitseki Penda, Hacène Djellout, and Arnaud Guillin. Deviation inequalities, moderate deviations and some limit theorems for bifurcating Markov chains with application. Ann. Appl. Probab., 24(1):235–291, 2014. [7] S. Valère Bitseki Penda, Mikael Escobar-Bach, and Arnaud Guillin. Transportation and concentration inequalities for bifurcating Markov chains. Bernoulli, 23(4B):3213–3242, 2017. [8] S. Valère Bitseki Penda, Marc Hoffmann, and Adélaı̈de Olivier. Adaptive estimation for bifurcating Markov chains. Bernoulli, 23(4B):3598–3637, 2017. [9] O. Cappé, E. Moulines, and T. Ryden. Inference in Hidden Markov Models (Springer Series in Statistics). Springer-Verlag New York, Inc., 2005. [10] P. Cattiaux. Stochastic calculus and degenerate boundary value problems. Ann. Inst. Fourier (Grenoble), 42(3):541–624, 1992. [11] D. Dacunha-Castelle and D. Florens-Zmirou. Estimation of the coefficients of a diffusion from discrete observations. Stochastics, 19(4):263–284, 1986. [12] Benoı̂te de Saporta, Anne Gégout-Petit, and Laurence Marsalle. Asymmetry tests for bifurcating auto-regressive processes with missing data. Statist. Probab. Lett., 82(7):1439–1444, 2012. [13] Benoı̂te de Saporta, Anne Gégout-Petit, and Laurence Marsalle. Random coefficients bifurcating autoregressive processes. ESAIM Probab. Stat., 18:365–399, 2014. [14] M. Doumic, M. Hoffmann, P. Reynaud-Bouret, and V. Rivoirard. Nonparametric estimation of the division rate of a size-structured population. SIAM J. Numer. Anal., 50(2):925–950, 2012. [15] Marie Doumic, Marc Hoffmann, Nathalie Krell, and Lydia Robert. Statistical estimation of a growthfragmentation model observed on a genealogical tree. Bernoulli, 21(3):1760–1799, 2015. [16] Valentine Genon-Catalot and Jean Jacod. On the estimation of the diffusion coefficient for multi-dimensional diffusion processes. Ann. Inst. H. Poincaré Probab. Statist., 29(1):119–151, 1993. [17] J. Guyon. Limit theorems for bifurcating Markov chains. Application to the detection of cellular aging. The Annals of Applied Probability, 17(5/6):1538–1569, 2007. [18] M. Hairer and J. C Mattingly. Yet another look at Harris’ ergodic theorem for Markov chains. Seminar on Stochastic Analysis, Random Fields and Applications VI, pages 109–117, 2011. [19] V. H. Hoang. Estimating the division kernel of a size-structured population. arXiv:1509.02872, 2015. [20] Marc Hoffmann. Adaptive estimation in diffusion processes. Stochastic Process. Appl., 79(1):135–163, 1999. [21] Marc Hoffmann and Adélaı̈de Olivier. Nonparametric estimation of the division rate of an age dependent branching process. Stochastic Process. Appl., 126(5):1433–1471, 2016. [22] Marek Kimmel. Quasistationarity in a branching model of division-within-division. In Classical and modern branching processes (Minneapolis, MN, 1994), volume 84 of IMA Vol. Math. Appl., pages 157–164. Springer, New York, 1997. [23] Y. A Kutoyants. Statistical inference for ergodic diffusion processes. Springer Science & Business Media, 2013. [24] D. Lépingle. Euler scheme for reflected stochastic differential equations. Mathematics and Computers in Simulation, 38(1-3):119–126, 1995. Probabilités numériques (Paris, 1992). [25] V. Linetsky. On the transition densities for reflected diffusions. Advances in Applied Probability, 37(2):435–460, 2005. [26] A. Marguet. Uniform sampling in a structured branching population. arXiv:1609.05678, 2016. [27] S. Méléard. Modèles aléatoires en écologie et évolution. (French) [Random models in ecology and evolution]. Mathématiques et Applications (Berlin) [Mathematics and Applications]. Springer-Verlag, Berlin, 2016. [28] Bernt Øksendal. Stochastic differential equations: an introduction with applications. Springer Science & Business Media, 2003. 34 MARC HOFFMANN AND ALINE MARGUET [29] S. Valère Bitseki Penda and Adélaı̈de Olivier. Autoregressive functions estimation in nonlinear bifurcating autoregressive models. Stat. Inference Stoch. Process., 20(2):179–210, 2017. [30] Benoı̂t Perthame. Transport equations in biology. Frontiers in Mathematics. Birkhäuser Verlag, Basel, 2007. [31] Daniel Revuz and Marc Yor. Continuous martingales and Brownian motion, volume 293 of Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences]. Springer-Verlag, Berlin, third edition, 1999. [32] H. Tanaka. Stochastic differential equations with reflecting boundary condition in convex regions. Stochastic Processes: Selected Papers of Hiroshi Tanaka, 9:157, 1979. [33] Alexandre B. Tsybakov. Introduction à l’estimation non-paramétrique, volume 41 of Mathématiques & Applications (Berlin) [Mathematics & Applications]. Springer-Verlag, Berlin, 2004. [34] A. W. van der Vaart. Asymptotic statistics. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 1998. Marc Hoffmann, Université Paris-Dauphine, PSL Research University, CNRS, CEREMADE, 75016 Paris, France. E-mail address: [email protected] Aline Marguet, CMAP, Ecole Polytechnique, Route de Saclay, 91128 Palaiseau Cedex, France. E-mail address: [email protected]
10math.ST
—preprint— dup – Explicit un-sharing in Haskell Joachim Breitner arXiv:1207.2017v1 [cs.PL] 9 Jul 2012 Karlsruhe Institute of Technology [email protected] Abstract of the programmer. Therefore, we propose a new primitive operation dup which copies a (possibly unevaluated) value on the heap. We propose two operations to prevent sharing in Haskell that do not require modifying the data generating code, demonstrate their use and usefulness, and compare them to other approaches to preventing sharing. Our claims are supported by a formal semantics and a prototype implementation. data Box a = Box a dup :: a → Box a Its value semantics are that of (\x → Box x); the wrapping in Box just serves the purpose of controlling the exact point of execution of dup by case-analyzing the Box. Using dup allows us to modify in the above example only the code of f to prevent sharing and achieve constant memory usage: Categories and Subject Descriptors D.1.1 [Programming Techniques]: Applicative (Functional) Programming; D.3.3 [Programming Languages]: Language Constructs and Features— Data types and structures; E.2 [Data storage representation] Keywords space leak, lazy evaluation, sharing, functional programming, natural semantics let f xs = case dup xs of Box xs’ → last xs’ + head xs l = [1..100000000] in f l 1. Introduction Thanks to the immutable nature of data in a pure functional programming language such as Haskell, there are many possibilities for sharing, i.e. one object in memory can used in multiple places in the program. In general, this is a good thing, as it can save both execution time (by not calculating the data again) and memory space (by not copying the data). But there are cases where sharing can hurt, and sometimes hurt badly. A famous example ([1, 15]) is the following function: let l f f in f In Section 3, we demonstrate the use of dup and other approaches on the more elaborate example introduced in Section 2, taking on the programmer’s point of view. An sharp-witted reader with knowledge of a typical implementation of a Haskell runtime might already have noticed that just copying the object on the heap representing the parameter xs might not be enough: If, for example, the first cons-cell of xs is already evaluated, then dup xs will copy that cell, but the thunk representing the tail of the list will still be shared between xs’ and xs, and f will again devour memory. Such things may occur without the programmer’s knowledge, e.g. during a compiler optimization pass. To that end, we propose a variant of dup, called deepDup, which effectively copies the complete heap referenced by its argument. This happens – as one would expect for anything related to Haskell – lazily: The objects referenced by the parameter are copied if and when they are needed. In other words: After having evaluated a function which only works on deepDup’ed copies of its parameters, nothing this evaluation has created on the heap is referenced anymore, unless it is referenced by the function’s return value (this is formalized in Theorem 2). Our specific contributions are: = [1..100000000] :: [Int] → Int xs = last xs + head xs l This program is space-leaky and will quickly run out of memory. If we substitute the term for xs in the body of f and evaluate that expression, it runs quickly and in constant memory. We have avoided the sharing of xs between the calls to last and head and the list elements can be garbage collected as soon as they have been consumed by last. This came at the expense of evaluating the list twice, which is fine, as the list is large but cheap to calculate. But this source transformation, as well as other source transformations to avoid sharing (see Section 3.3 and 3.4), is not always possible or desirable, e.g. when the parameter passed to f comes from library code not under the control • We introduce primitives that give the programmer the possibility to explicitly prevent sharing. • In contrast to approaches based on source transforma- tions, using dup and deepDup does not require changes to the generating code. • We provide precise semantics in the context of Launch- bury’s natural semantics for Lazy Evaluation (Section 4) and prove that the recursive variant deepDup is effective. • We show the feasibility of our approach using a proof-of- concept implementation targeting code compiled by an unmodified GHC. (Section 5) [Copyright notice will appear here once ’preprint’ option is removed.] Joachim Breitner: dup – Explicit un-sharing in Haskell 1 2018/1/17 -s option) and runs in 24.15 seconds.1 Sharing is indeed the −− The problem specification type S = ... init :: S succs :: S → [S] value :: S → Integer problem here: If we remove the last line of main, the program runs in 2 MB of memory and takes 6.70 seconds. 3. Unsharing the example We want to improve the space performance of the program in the example and thus, due to the saved work in the garbage collector, also the runtime performance. In the following, we use dup, first wrapping the argument of solve, then the argument of rate, and deepDup. We also try two variants that work without new primitives, but require refactoring the generating code. The statistics are collected in Figure 2, where all six strategies are applied to −− The search tree code data Tree = Node S [Tree] fstChild :: Tree → Tree fstChild (Tree _ (x:xs)) = x tree :: S → Tree tree s = Node s (map tree (succs s)) • an otherwise unreferenced tree, i.e. the example code solve :: Tree → [S] solve (Node n ts) = n : solve picked where rated = [ (t, rate depth t) | t ← ts ] picked = fst (maximumBy (comparing snd) rated) depth = ... without the last line of the main function, • a shared, unevaluated tree as shown in Figure 1, • a shared, unevaluated tree wrapped in another thunk, by passing (fstChild t) to solve, • a shared tree that has been partly evaluated forcing seq (fstChild t) before passing t to the solver, rate :: Int → Tree → Integer rate 0 (Node s _) = value s rate d (Node _ ts) = maximum (map (rate (d−1)) ts) • a shared tree that has been fully evaluated by the unmod- ified solver before, • a shared, unevaluated tree that is processed twice by the main = do let t = tree init print $ solve t !! 10000 doSomethingElseWith t (possibly modified) solver. In the two variants based on refactoring, the data type used for the tree does not allow for partial or full evaluation, so these runs are omitted. Figure 1. The running example 3.1 Using dup We now modify the example to use our new primitives. There are a few choices in doing so, with different trade-offs. One candidate for dup’ing is the function solve: We know that the parameter t to solve is an unevaluated expression, and decoupling that from the t that we pass to doSomethingElseWith will allow the garbage collector to clean up the tree as solve proceeds to process it (Figure 3, second row). So we wrap solve in solveDup and use that in main. 2. The running example For the remainder of the paper, we will use one running example to demonstrate and discuss the use of dup. The task at hand, inspired by the minimax algorithm that searches for an optimal strategy in a two-player turn-based game, is to find a path through a (possibly infinite) tree that maximizes some valuation of the nodes. So abstractly, we have a type S of states, a valuation function value, an initial state init and for every state s, a list of successor states succs s. For the sake of simplicity of the presentation, we assume this succs s to be always non-empty (see also Figure 1). Based on these functions, we define a search tree and a solver. The solver picks the successor with the highest rating, whereas the rating is the highest value of nodes at a configurable depth. Assume a constant number of successors b, b > 0, and that the value of depth is d. Consider what happens when we want to calculate the first 10 000 elements of the solution: The rate function will evaluate lots of nodes that will not be picked for the solution. But as they are still referenced by the tree t, the garbage collector cannot get rid of them. So in addition to the 10 000 interesting nodes, roughly 10 000 · (b − 1) · b d−1 nodes are evaluated that the programmer knows are not required to be kept around. The first row of Figure 3 depicts the heap during this evaluation, with d = 1 and b = 2. More concretely with d = 4, b = 4, type S = Word32 and a very cheap succs and value functions, this program requires 4 189 MB of system memory (as reported by the GHC runtime as “total memory in use” when passed the Joachim Breitner: dup – Explicit un-sharing in Haskell solveDup t = case dup t of Box t’ → solve t’ And indeed, we have almost achieved the performance of the original program without sharing: 3 MB and 6.74 seconds. Another candidate for dup’ing is the function rate: As this is the function whose return value is taken into account when deciding whether to pick the argument or not, we know that in most cases, its argument will not be used any more. Therefore, by creating a wrapper rateDup that duplicates the argument, and using that in solve, we allow for the argument and all its children to be garbage collected once rate has finished. rateDup d t = case dup t of Box t’ → rate d t’ Both the runtime and the memory footprint of the program are greatly reduced compared to the original program: It uses 5 MB of memory and takes 2.34 seconds to finish. It is surprising that this even surpasses the speed of the original program without sharing. The reason is that with rate wrapped in dup, the first child of the node under inspection 1 All statistics are obtained on a machine with 2 GHz and sufficient (32 GB) RAM. The complete code used to generate these statistics is available in the ghc-dup repository at http://darcs.nomeata.de/ghc-dup. 2 2018/1/17 no sharing MB sec. original solveDup rateDup solveDeepDup unit lifting church encoding 2 2 2 2 1 2 shared tree MB sec. 6.70 6.71 2.33 6.63 1.79 7.12 4 189 3 5 2 1 2 24.15 6.74 2.34 6.74 1.78 7.06 add. thunk MB sec. 4 188 4 188 5 2 1 2 24.35 24.32 2.34 6.60 1.78 7.19 partly eval’ed MB sec. fully eval’ed MB sec. 4 188 4 188 5 2 4 189 4 189 4 189 4 189 24.08 24.03 2.33 6.79 30.36 30.50 31.28 29.72 run twice MB sec. 4 189 2 4 153 2 1 2 29.73 13.47 29.01 13.30 3.56 14.35 Figure 2. Time and space performance for b = 4 and d = 4 original: T N T solveDup: T T T T T T N T N N T rateDup: N T T N N N N N N TT TT TT TT TT TT TT TT TT TT N N T T N T N N N N N N N N N N N N N N N TT TT TT TT TT TT TT TT TT TT N N N T T T N N N N N N N T N N N T T N T: thunk, N: node, =: dup’ed closure, garbage, T : current argument of solve, T : current argument of rate T N T N T T N N T N N N N N N N N N N N TT TT TT TT TT TT TT TT TT TT Figure 3. The heap during original and dup’ed evaluation with b = 2 and d = 1 solveDup: N T T solveDeepDup: N N T T N T T N T N T N D T N D N T N T N N T T N T D: deepDup application thunk T N N N N N N N N N N N N N N N N N TT TT TT TT TT TT TT TT TT TT N D N N N T N D T N N T N N T N N T N N N N N N N N N N N TT TT TT TT TT TT TT TT TT TT Figure 4. Comparing solveDup and solveDeepDup applied to a partly evaluated tree with b = 2 and d = 1 Joachim Breitner: dup – Explicit un-sharing in Haskell 3 2018/1/17 no sharing MB sec. original solveDup rateDup solveDeepDup unit lifting church encoding 2 2 2 2 2 2 108.70 108.76 141.53 108.61 141.49 113.23 shared tree MB sec. 1 641 2 8 2 2 2 115.72 108.71 141.92 108.71 141.48 113.10 add. thunk MB sec. 1 643 1 643 9 2 2 2 113.99 114.19 139.00 107.10 141.49 113.04 partly eval’ed MB sec. 1 642 1 642 9 2 115.47 115.63 141.82 108.71 fully eval’ed MB sec. 1 641 1 641 1 641 1 641 119.01 118.96 119.35 118.66 run twice MB sec. 1 641 2 1 638 2 2 2 118.89 217.26 258.22 217.74 282.86 225.74 Figure 5. Time and space performance for b = 4 and d = 4 using an expensive succs function. of solve can be freed already when its next child is evaluated by rate (Figure 3, last row, second-to-last column), so the copying garbage collector needs to do even less work. A common approach is to replace values that you do not want to be shared by functions, e.g. by turning a bound expression let x = e into a lambda expression let x = \() → e. At every point in the program where e is required, one can get the value of it using x (); there will be no sharing between different calls to x () One needs to be careful, though, as some compiler optimizations can introduce unwanted sharing again. The code 3.2 Using deepDup Using dup is a fragile business and requires the programmer to have a very good idea about what is happening at runtime. It will fail, for example, in two common situations: If the call to solveDup in main in Figure 1 would not just pass the tree t but rather an expression referencing t, e.g. xs :: () → [Int] xs () = [1..10000000] print $ solveDup (fstChild t) !! 1000 main = do print (last (xs ())) print (head (xs ())) then dup will only copy this unevaluated expression, but both copies will reference the same unevaluated expression for t, and we are back at the original performance (4 188 MB, 24.32 seconds). The same effect occurs if the tree is already partly evaluated. This may even be caused by a compiler transformation, e.g. the wrapper/worker transformation, assuming that doSomethingElseWith is strict in its argument [10]. Then, the parameter t is the Node constructor referencing other nodes or unevaluated trees, and copying the constructor does not help to prevent sharing the referenced data, as shown in the first row of Figure 4. This is where deepDup comes in: Intuitively, deepDup takes a complete and private copy of the entire heap reachable from its argument, hence preventing any unwanted evaluation outside this copy. In fact this is done lazily: It will just copy the object specified by its parameter, and change all references therein so that before they are evaluated, deepDup copies them. So by wrapping solve in a call to deepDup: works as expected without optimization. Passing -O to GHC results in sharing again, as a result of the full laziness transformation. In fact, in a discussion of this example on the GHC bug tracker [12], Claus Reinke suggests an operation like dup to solve this.2 Applying this pattern to our problem, and aiming for a tree with unshareable subtrees, we can define the following types: data UTree’ = UNode S [UTree] type UTree = () → UTree’ The required changes to the functions on trees are mechanical and guided by the type checker. The resulting code, when not hit by some optimization-induced re-sharing, shows very good time and space complexity. If sharing is desired at some points of the program, those parts will have to work with the regular Tree type, possibly leading to a duplication of code. solveDeepDup t = case deepDup t of Box t’ → solve t’ 3.4 Church encoding we achieve the performance of a successful run with dup (2 MB and 6.60 seconds), but also in the cases where t has already been partly evaluated or is wrapped in another unevaluated expression. The second row of Figure 4 shows deepDup at work. Using deepDup is therefore more reliable and easier to handle: The programmer need not have an exact idea of the evaluation state of the arguments when deepDup is called. And the recursive copying is surprisingly cheap: Even when the tree is already fully evaluated, e.g. by an earlier call to solve t !! 10000, the runtime stays the same within the precision of the benchmark. An alternative is to restructure the program so that the value that must not be shared is not represented using data constructors but rather as a higher-order function [2, 5]. This transformation is known as the Church encoding of a data type, or a variant thereof. For the algebraic tree data type in our running example, we would obtain the following type and conversion functions: 3.3 The unit type argument pattern 2 If, however, the type signature of xs is not given, then no unwanted sharing happens even with -O. The inferred most general type of xs is polymorphic with type class constraints. This implies that additional parameters are being passed under the hood and they successfully prevent sharing. type CTree = forall a. (S → [a] → a) → a toCTree :: Tree → CTree toCTree (Node s ts) f = f s $ map (\t → toCTree t f) ts The problem at hand is, of course, not new, and Haskell programmers have solved it one way or the other before, by rewriting the code to allow more control over sharing. Joachim Breitner: dup – Explicit un-sharing in Haskell 4 2018/1/17 4. A natural semantics fromCTree :: CTree → Tree fromCTree ct = ct Node To substantiate our claims about the usefulness of dup and especially deepDup, we give them a precise meaning within Launchbury’s natural semantics for lazy evaluation [6] and prove that all memory allocated by a function whose arguments are wrapped with deepDup can be freed after the function has been completely evaluated. We extend Launchbury’s semantics for normalized lambda calculus with our two primitives: A church-encoded tree corresponding to the value tree s can be nicely created with the following code: ctree :: S → CTree ctree s f = f s $ map (\s’ → ctree s’ f) (succs s) Unfortunately, adapting solve to this type is a non-trivial task, as the two recursions happening therein (solve and rate) need to be folded into one pass: x, y ∈ Var e ∈ Exp ::= ńx. e | e x | x | let x1 = e1 , . . . , xn = en in e | csolve :: CTree → [S] csolve t = fst (t csolve’) where csolve’ :: S → [([S], Int → Int)] → ([S], Int → Int) csolve’ n rc = ( n : fst (maximumBy (comparing (($ depth) ◦ snd)) rc) , \d → if d == 0 then value n else maximum (map (($ d−1) ◦ snd) rc)) dup x | deepDup x Γ, ∆, Θ ∈ Heap = Var → 7 Exp z ∈ Val ::= ńx. e His lambda terms are normalized, i.e. all bound variables are distinct and all applications are applications of an expression to a variable. The set of free variables of an expression e is fv(e). Similarly, the set of unguarded free variables ufv(e) of an expression e, is inductively defined just like fv(e) with the exception that ufv(deepDup x ) = ∅. A value ẑ is z with all bound variables renamed to completely fresh variables. To avoid having to introduce constructors and case expressions as well we assume dup and deepDup to return their result without the wrapping in Box. This captures the semantics of the Haskell expression This additional complexity might make this approach impractical in larger settings. Note, though, that applying this pattern to the list data type turns a list into its right fold and can enable deforestation [3]. 3.5 Comparison and interpretation As we can see from the statistics in Figure 2, the unit type argument pattern is the clear winner in both runtime and space performance. It is ahead of rateDup for the same reason that made rateDup faster than solveDup: Now even the subtrees in recursive calls of rate are freed immediately. Unfortunately, it requires a thorough refactoring of both the data generating and data consuming code; all combinators working on the data type need to be carefully rewritten to preserve the nonsharing behavior of the lifted data type. Also, the full laziness transformation can break the pattern, making it slightly fragile. The church encoding pattern shows good and predictable memory performance, but exhibits slightly worse runtime behavior. The cases where it is ahead of other approaches it wins only due to the garbage collector overhead induced by unprevented sharing. As the previous pattern, it requires extensive refactoring. Our primitives come with very small overhead when applied to data that is actually unshared, as we show in the first column. In fact, careful use of dup can improve performance noticeably even if only small pieces of data can be un-shared and thus freed quickly. While dup is subtle to use, deepDup is robust and its effect is more precisely defined, as shown in the next section. Obviously, avoiding sharing is a bad idea when the result is expensive to create. Figure 5 runs the same benchmark with an expensive (but otherwise equal) succs function. If the tree needs to be processed twice, then throwing the result away after the first run (as done in the last column) results in a serious loss of run-time performance. Also for the same reason that the rateDup and unit lifting variants were faster before they now slow down the program, as parts of the tree are evaluated twice. On the other hand, if the memory footprint becomes larger than the available memory, being able to run the program slowly is still better than not being able to run it at all, so even in this case there can be uses for dup and deepDup. Joachim Breitner: dup – Explicit un-sharing in Haskell (\x. let Box y = dup x in y) :: a → a. In addition to the unmodified reduction rules L AM, A PP, VAR and L ET, we add the two rules D UP and D EEP in Figure 6. The use of ufv(e) instead of fv(e) in the rule D EEP D UP is required to avoid a livelock if deepDup x is evaluated while x is itself bound to deepDup y. In the following every heap/term pair Γ : e is assumed to be distinctly named, i.e. every binding occurring in Γ and in e binds a distinct variable; this property is preserved by the reduction rules. Besides the natural semantics, Launchbury also defines a denotational semantics. He models values as a lifted function space, denoted Value, and environments ρ ∈ Env = Var → Value as functions from variables into values. He writes ρ ≤ ρ′ if ρ′ extends ρ, i.e. they differ only for variables where ρ is bottom. The expression JeKρ is the value of the expression e in the environment ρ. The semantics of a heap Γ is given by {{Γ }}ρ, which is the environment ρ updated by the values specified in the heap. This is defined as a fixed point, as the heap may contain recursive references: {{ x1 7→ e1 , . . . , xn 7→ en }}ρ = µρ′ .ρ ⊔ ( x1 7→ Je1 Kρ′ ) ⊔ · · · ⊔ ( xn 7→ Jen Kρ′ ) This definition makes sense on environments ρ that are consistent with Γ, i.e. if ρ and Γ bind the same variable, then they are bound to values for which an upper bound exists. Launchbury proves his natural semantics to be correct with respect to the denotational semantics. Naturally, we want to preserve this property. Our new primitives should be invisible to the denotational semantics, hence we extend 5 2018/1/17 Γ : ńx. e ⇓ Γ : ńx. e Γ : e ⇓ ∆ : ńy. e′ ∆ : e′ [ x/y] ⇓ Θ : z A PP Γ : ex ⇓ Θ : z L AM Γ:e⇓∆:z VAR Γ, x 7→ e : x ⇓ ∆, x 7→ z : ẑ Γ, x 7→ e, x ′ 7→ ê : x ′ ⇓ ∆ : z x ′ fresh D UP Γ, x 7→ e : dup x ⇓ ∆ : z Γ, x1 7→ e1 , . . . , xn 7→ en : e ⇓ ∆ : z L ET Γ : let x1 = e1 , . . . , xn = en in e ⇓ ∆ : z Γ, x 7→ e, x ′ 7→ ê[ y1′ /y1 , . . . , y′n /yn ], y1′ 7→ deepDup y1 , . . . , y′n 7→ deepDup yn : x ′ ⇓ ∆ : z ufv(e) = {y1 , . . . , yn } x ′ , y1′ , . . . , yn fresh D EEP Γ, x 7→ e : deepDup x ⇓ ∆ : z Figure 6. Natural semantics extended for dup and deepDup = Jx ′ K{{Γ′ }}ρ the semantics function as follows: Jdup xKρ := JxKρ JdeepDup xKρ := JxKρ . = JzK{{∆}}ρ by (i) and, by (ii), Theorem 1 (Theorem 2 from [6]) If Γ : e ⇓ ∆ : z, then for all environments ρ, {{Γ, x 7→ e}}ρ ≤ {{Γ ′ }}ρ ≤ {{∆ }}ρ. JeK{{Γ}}ρ = JzK{{∆}}ρ and {{Γ }}ρ ≤ {{∆ }}ρ. More interesting than the semantic correctness of our additional rules is what properties of deepDup we can prove with them. Following our intuition from the introduction, we formulate the next theorem, where Γ ⊆ ∆ means that Γ and ∆ agree on the domain of Γ and only new variables are bound. P ROOF. The proof in [6] is by induction on the derivation; we only have to give it for the two new cases corresponding to the rules D UP and D EEP. We assume that the fresh variables in the rules are chosen to be undefined in ρ: Theorem 2 Consider the expression Case: dup x By induction, we know (i) Jx ′ K{{Γ,x 7→ e,x′7→ ê}}ρ = JzK{{∆}}ρ and (ii) {{Γ, x 7→ e, x ′ 7→ ê}}ρ ≤ {{∆ }}ρ. For the first part, we have e = let x1′ = deepDup x1 , . . . , xn′ = deepDup xn in e′ with fv(e′ ) ⊆ { x1′ , . . . , xn′ }. If Γ : e ⇓ ∆ : z and z is a closed value (i.e. fv(z) = ∅), then Γ ⊆ ∆. Jdup xK{{Γ,x 7→ e }}ρ This implies that any value on the heap ∆ that was created during the evaluation of e can be freed afterwards. The theorem is an immediate consequence of statement (a) of the following Lemma 3, with Γ0 = Γ. We will need the notion of the unguarded reachable set urΓ (e) of an expression e in a context Γ, which is mutually defined for all expressions as the smallest sets which fulfill the equation = JxK{{Γ,x 7→ e }}ρ = JeK{{Γ,x 7→ e }}ρ = JêK{{Γ,x 7→ e }}ρ = JêK{{Γ,x 7→ e,x′7→ ê}}ρ x ′ fresh = Jx ′ K{{Γ,x 7→ e,x′7→ ê}}ρ = JzK{{∆}}ρ urΓ (e) = ufv(e) ∪ by (i) Note that ufv(e) ⊆ as desired. The second part follows from (ii) and from x ′ being fresh: x ∈ufv( e ) urΓ ( Γ x ). implies urΓ (e) ⊆ urΓ (e′ ). (a) Γ0 ⊆ ∆, (b) U ∩ ur∆ (z) = ∅ and (c) U ∩ urΓ (y) = ∅ implies U ∩ ur∆ (y) = ∅ for y ∈ dom Γ. Case: deepDup x Let Γ ′ denote the heap in the assumption of the rule, i.e. Γ, x 7→ e, x ′ 7→ ê[ y1′ /y1 , . . . , y′n /yn ], y1′ 7→ deepDup y1 , . . . , y′n 7→ deepDup yn . By induction, we know (i) Jx ′ K{{Γ′ }}ρ = JzK{{∆}}ρ and (ii) {{Γ ′ }}ρ ≤ {{∆ }}ρ. The newly introduced variables y′i , i = 1, . . . , n, have the same semantics as their original counterparts: P ROOF. The proof is by induction on the structure of the derivation Γ : e ⇓ ∆ : z. Case: ńx. e Immediate. Case: e x From urΓ (e x ) = urΓ (e) ∪ urΓ ( x ) and the assumption U ∩ urΓ (e x ) = ∅ we have U ∩ urΓ (e) = ∅ and U ∩ urΓ ( x ) = ∅. From the first induction hypothesis we obtain (i) Γ0 ⊆ ∆, (ii) U ∩ ur∆ (ńy. e′ ) = ∅ and (iii) U ∩ ur∆ ( x ) = ∅. As ur∆ (e′ [ x/y]) ⊆ ur∆ (ńy. e′ ) ∪ ur∆ ( x ), (ii) and (iii) imply U ∩ ur∆ (e′ [ x/y]) = ∅. With (i) we obtain (a) Γ0 ⊆ Θ and (b) U ∩ urΘ (z) = ∅ from the second induction hypothesis. Statement (c) follows immediately from the induction hypothesizes. Jy′i K{{Γ′ }}ρ = JdeepDup yi K{{Γ′ }}ρ = Jyi K{{Γ′ }}ρ = Jyi K{{Γ,x 7→ e }}ρ. This implies (iii) Jê[ y1′ /y1 , . . . , y′n /yn ]K{{Γ′ }}ρ = JeK{{Γ,x 7→ e }}ρ. Hence JdeepDup xK{{Γ,x 7→ e }}ρ = JxK{{Γ,x 7→ e }}ρ = JeK{{Γ,x 7→ e }}ρ Joachim Breitner: dup – Explicit un-sharing in Haskell ufv(e′ ) S Lemma 3 Let Γ0 be a heap and U = dom Γ0 its domain. If Γ : e ⇓ ∆ : z, Γ0 ⊆ Γ and U ∩ urΓ (e) = ∅, then {{Γ, x 7→ e}}ρ ≤ {{Γ, x 7→ e, x ′ 7→ ê}}ρ ≤ {{∆ }}ρ = Jê[ y1′ /y1 , . . . , y′n /yn ]K{{Γ′ }}ρ  by (iii) 6 2018/1/17 Case: x Removing a variable from a heap does not increase unreachable sets, so urΓ (e) ⊆ urΓ,x 7→ e (e) ⊆ urΓ,x 7→ e ( x ). From x ∈ urΓ,x 7→ e ( x ) and the assumption U ∩ urΓ,x 7→ e ( x ) = ∅ we have x∈ / U, thus Γ0 ⊆ Γ, and U ∩ urΓ (e) = ∅. From the induction hypothesis we now obtain Γ0 ⊆ ∆ and U ∩ ur∆ (z) = ∅. As ∆ ⊆ (∆, x 7→ z), ufv(z) = ufv(ẑ) and ur∆ (z) = ur∆,x 7→ z(ẑ), the statements (a) Γ0 ⊆ (∆, x 7→ z) and (b) U ∩ ur∆,x 7→ z(ẑ ) = ∅ follow. Let y ∈ dom Γ0 with U ∩ urΓ,x 7→ e (y) = ∅. As urΓ (y) ⊆ urΓ,x 7→ e (y) we have U ∩ urΓ (y) = ∅ and hence U ∩ ur∆ (y) = ∅ from the induction hypothesis. This and (b) imply (c), as ur∆,x 7→ z(y) ⊆ ur∆ (y) ∪ ur∆ (z). Info pointer Code pointer S x ∈ufv( e ) urΓ′ ( Γ ′ Other fields Figure 7. The common layout of heap objects = { x ′ } ∪ {y1′ , . . . , y′n } S ∪ i=1,...,n urΓ′ (Γ ′ y′i ) = { x ′ } ∪ {y1′ , . . . , y′n } S ∪ i=1,...,n urΓ′ (deepDup yi ) = { x ′ } ∪ {y1′ , . . . , y′n } and, as these are all fresh variables, U ∩ urΓ′ ( x ′ ) = ∅. Clearly, Γ0 ⊆ (Γ, x 7→ e) ⊆ Γ ′ , so the first statement follows from the induction hypothesis. Statement (c) follows immediately as the additional variables are fresh.  x) ⊆ ufv(el ) ∪ { x1 , . . . , xn } S ∪ x ∈ufv( e l ) urΓ′ (Γ ′ x ) ∪ urΓ′ (Γ ′ x1 ) ∪ · · · ∪ urΓ′ (Γ ′ xn ) = ufv(el ) ∪ { x1 , . . . , xn } S ∪ x ∈ufv( e l ) urΓ′ (Γ ′ x ) Having cast our intuition of dup and deepDup into a precise form using a formal semantics, we now explain how we have implemented this semantics, or rather a pragmatic approximation, in a real environment. ∪ urΓ′ (e1 ) ∪ · · · ∪ urΓ′ (en ) = ufv(el ) ∪ { x1 , . . . , xn } S ∪ x ∈ufv( e l ) urΓ′ (Γ ′ x ) 5. The prototype implementation Our implementation3 works with the Glasgow Haskell Compiler (GHC), version 7.4.1, and requires no modifications to the compiler or its runtime: The code is compiled to a usual object file, linked into the resulting binary and called via the foreign function interface. GHC compiles Haskell code first to a polymorphic, explicitly typed lambda-calculus called Core [14, 16], then to the Spineless Tagless G-machine (STG) [9]. From there, it generates Cmm code, an implementation of the portable assembly language C-- which is then compiled to machine code, either directly or via LLVM. Our work looks at objects in the sense of the STG, so we only need to worry about data representation on the heap [9]. Design decisions regarding the earlier transformations, such as the evaluation model [7], are thus not important here. The common layout of all objects, or closures, on the heap is a pointer to a statically allocated info table, followed by the payload (Figure 7). The info table indicates the type of the object (not to be confused with the type from the type system – these are completely irrelevant at this stage), contains layout information about the payload required by the garbage collector, namely what words are pointers to other objects and what words are not, and the code to be run when the object is evaluated. There are various types of objects on the heap, most important are: = urΓ′ (el ) ∪ { x1 , . . . , xn } = urΓ (el ) ∪ { x1 , . . . , xn }. As all bound variables are distinct from variables in the heap, no xi ∈ U. From U ∩ urΓ (el ) = ∅, we have U ∩ urΓ′ (e) = ∅ and statements (a) and (b) follow from the induction hypothesis. For y ∈ dom Γ the unreachable set of y cannot contain any of x1 , . . . , xn , as the heap/term pair Γ : el is distinctly named, so we have urΓ (y) = urΓ′ (y) and (c) follows from the induction hypothesis. Case: dup x Clearly Γ0 ⊆ Γ, x 7→ e ⊆ Γ, x 7→ e, x ′ 7→ ê. Also, urΓ,x 7→ e,x ′7→ ê ( x ′ ) = urΓ,x 7→ e,x ′7→ ê (ê) ∪ { x ′ } = urΓ,x 7→ e (e) ∪ { x ′ } ⊆ urΓ,x 7→ e (dup x ) ∪ { x ′ }. As x ′ is fresh, x ′ ∈ / U and from U ∩ urΓ,x 7→ e (dup x ) = ∅ we have U ∩ urΓ,x 7→ e,x ′7→ ê ( x ′ ) = ∅, so the first statement follows from the induction hypothesis. Statement (c) follows immediately as x ′ is fresh. Case: deepDup x Let Γ ′ denote the heap Γ, x 7→ e, x ′ 7→ ê[ y1′ /y1 , . . . , y′n /yn ], y1′ 7→ deepDup y1 , . . . , y1′ 7→ deepDup y1 . Recall that, by definition, ufv(deepDup x ) = ∅, hence urΓ′ (deepDup x ) = ∅. So • Data constructors, representing fully evaluated values. The payload are pointers to the parameters of the constructor. • Function closures, representing functions. Locally defined urΓ′ ( x ′ ) = { x ′ } ∪ urΓ′ (ê[ y1′ /y1 , . . . , y′n /yn ]) ′ = {x } functions capture their free variables, these are stored in the payload. ∪ ufv(ê[ y1′ /y1 , . . . , y′n /yn ]) ∪ S z ∈ufv( ê[ y1′ /y1 ,...,y ′n /y n ]) urΓ′ ( Γ Joachim Breitner: dup – Explicit un-sharing in Haskell Entry code Layout info Case: let x1 = e1 , . . . , xn = en in e For brevity, let Γ ′ = Γ, x1 7→ e1 , . . . , xn 7→ en and el = let x1 = e1 , . . . , xn = en in e. Clearly Γ0 ⊆ Γ ⊆ Γ ′ . Also, for each e∗ ∈ {e, e1 , . . . , en } we have ufv(e∗ ) ⊆ ufv(el ) ∪ { x1 , . . . , xn }. This implies urΓ′ (e) = ufv(e) ∪ Payload ′ 3 Available z) 7 at http://darcs.nomeata.de/ghc-dup 2018/1/17 dupClosure { clos = UNTAG(R1); // Allocate space for the new closure (len) = foreign "C" closure_sizeW(clos "ptr") []; ALLOC_PRIM(WDS(len), R1_PTR, dupClosure); copy = Hp - WDS(len) + WDS(1); p = 0; for: // Copy the info pointer and payload if(p < len) { W_[copy + WDS(p)] = W_[clos + WDS(p)]; p = p + 1; goto for; } RET_P(copy); } deepDupClosure { clos = UNTAG(R1); // Allocate space for the new closure (len) = foreign "C" closure_sizeW(clos "ptr") []; ptrs = TO_W_(%INFO_PTRS(%GET_STD_INFO(clos))); bytes = WDS(len) + ptrs * SIZEOF_StgAP + WDS(ptrs); ALLOC_PRIM(bytes, R1_PTR, dupClosure); copy = Hp - WDS(len) + WDS(1); p = 0; for1: // Copy the info pointer and payload if(p < len) { W_[copy + WDS(p)] = W_[clos + WDS(p)]; p = p + 1; goto for1; } // Do not wrap deepDup thunks again if (W_[copy] == stg_ap_2_upd_info && W_[copy + WDS(1)] == Dup_deepDupFun_closure) { goto done; } if p = 0; for2: // Wrap all referenced closures in deepDup thunks if(p < ptrs) { ap = Hp - bytes + WDS(1) + p * SIZEOF_StgAP + WDS(p); W_[ap] = stg_ap_2_upd_info; W_[ap + WDS(1)] = Dup_deepDupFun_closure; W_[ap + WDS(2)] = W_[clos + WDS(p)]; W_[copy + WDS(p)] = ap; p = p + 1; goto for2; } done: RET_P(copy); } Figure 8. The Cmm code for dup • Thunks, which are unevaluated expressions. Again, the payload contains references to their free variables. • Applications of a function to a number of arguments. This closure type is usually only used by the GHC interpreter, but we use it in the implementation of deepDup. • Indirections, which point to another object on the heap in their payload. These are created during evaluation and removed by the garbage collector. When a thunk is evaluated, it is replaced by an indirection which points to the result of the evaluation, which can be a data constructor or a function closure. This way, when another reference to the thunk is evaluated, the computation is not repeated but the calculated result is used directly, hence the result is shared. The indirections do not stay around forever: The next garbage collector run, which copies all live data, will replace references to indirections by whatever the indirection points to. As we want to avoid this sharing, we need to prevent the original reference to be replaced by the indirection. We cannot change the code of the thunk, but we can copy the thunk, thus creating a new copy that is not referenced by other code, and then evaluate that. The essence of the surprisingly simple code is listed in Figure 8; the closure to duplicate is passed in the register R1 and Hp is the heap pointer which is increased by ALLOC_PRIM. As discussed in Section 3.2, this simple approach is not always sufficient, and we want a recursive variant, deepDup. This function, shown in Figure 9, needs to access the info table of the closure to figure out what part of the payload is a pointer to another heap object. For every referenced object, an application thunk is created which applies deepDup (or rather the variant deepDupFun with the better suited type a → a), unless we are about to deepDup a deepDup thunk. In that case, we just copy it, but leave the argument alone, reflecting the use of ufv(e) instead of fv(e) in the Rule D EEP in the formal semantics. The code listing does not include a few shortcuts, e.g. data constructors without pointer arguments such as integer values are not copied. Figure 9. The Cmm code for deepDup closure to the heap using the code above would make the garbage collector abort, as it does not expect a static thunk to be found on the heap. But it is not possible to change the type of the closure, as the info table containing the type lies directly next to the code. And in order to create a modified info table somewhere else, the code needs to be copied as well. Therefore, dup and deepDup currently does not work for static thunks. When it is passed such a thunk, it prints a warning and returns the original reference, retaining sharing. It should be possible for dup to support static thunks with some additional information in the compiled code. Currently, when execution enters a static thunk and the stack and heap checks have been passed, the thunk is replaced by an indirection into the heap and an update frame is pushed on the stack. If there was a way to jump over the code that sets up the indirection and update frame, e.g. via an alternative entry point included in the info table, dup could create a thunk on the heap that calls the static thunk via this route, effectively kicking off evaluation without affecting the original static thunk. For deepDup things are more complicated, as references to static objects are not part of the heap object, but are scattered throughout the machine code. Moving these references to the heap would solve the issue here at hand, but is clearly too expensive. Also, the prototype does not take multithreaded programs into account and will likely produce bad results when used in such an environment, e.g. when another thread replaces a thunk by an indirection during the thunk copy loop 5.1 Limitations of the implementation Our implementation is but a prototype; it does not yet work in all situations. One large problem is posed by statically allocated thunks: A value, say nats = [0..], defined at the module level is compiled to a thunk with closure type THUNK_STATIC , also called a constant applicative form (CAF), and receives special treatment by the garbage collector. Copying such a Joachim Breitner: dup – Explicit un-sharing in Haskell 8 2018/1/17 in dupClosure . Similarly, there are several specialized closure type (arrays, mutable references, weak pointers[8] and others [11, page HeapObjects]). For each of them, we would need to determine whether they can be safely duplicated and if so, whether this is actually useful. In the presence of Lazy IO, duplicating thunks can be outright dangerous: Not only can the original and the duplicated thunk evaluate to different values but this can make the program crash, e.g. when one copy is done evaluating and causes a file to be closed, while the second copy continues to read from it. Generally everything implemented with unsafePerformIO is prone to behave badly when combined with dup or deepDup. Function closures need special treatment as there are cases where code assumes a certain reference to always be a function closure and never a thunk that will evaluate to a function. But this is what deepDup wants to create. Currently, deepDup will in this case leave the reference as it is. A solution would be to copy the function closure eagerly, so that the reference in the copy again points to a function closure. This would require more sophisticated code to detect cycles. and polymorphic lambda-terms, April 2012. URL http://okmij.org/ftp/tagless-final/course/Boehm-Berarducci.html. [6] J. Launchbury. A natural semantics for lazy evaluation. In POPL ’93, pages 144–154, 1993. [7] S. Marlow and S. L. Peyton Jones. Making a fast curry: push/enter vs. eval/apply for higher-order languages. Journal of Functional Programming, 16(4-5):415–449, 2006. [8] S. Peyton Jones, S. Marlow, and C. Elliott. Stretching the storage manager: Weak pointers and stable names in haskell. In Implementation of Functional Languages, volume 1868, pages 37–58. 2000. [9] S. L. Peyton Jones. Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine. Journal of Functional Programming, 2:127–202, 1992. [10] S. L. Peyton Jones and J. Launchbury. Unboxed values as first class citizens in a non-strict functional language. In FPCA, volume 523, pages 636–666, 1991. [11] S. L. Peyton Jones and the GHC developers. Glasgow Haskell Compiler Commentary, 2012. URL http://hackage.haskell.org/trac/ghc/wiki/Commentary . [12] C. Reinke. -O introduces space leak. The GHC bugtracker, September 2006. URL http://hackage.haskell.org/trac/ghc/ticket/917 . [13] C. J. Sampson. Experience report: Haskell in the ’real world’: writing a commercial application in a lazy functional lanuage. In ICFP ’09, pages 185–190, 2009. [14] M. Sulzmann, M. M. Chakravarty, S. L. Peyton Jones, and K. Donnelly. System F with type equality coercions. In TLDI ’07, pages 53–66, 2007. [15] The Wikimedia Foundation. Haskell Wikibook – Graph reduction, July 2012. URL http://en.wikibooks.org/w/index.php?title=Haskell/Graph reduction&oldid=231 [16] A. Tolmach, T. Chevalier, and the GHC team. An external representation for the ghc core language, February 2012. URL http://www.haskell.org/ghc/docs/7.4.1/core.pdf . [17] S. Wehr. Kommerzielle Softwareentwicklung mit Haskell. Hal6, Leipzig, Oct 2011. URL http://www.factisresearch.com/resources/Talk Wehr Hal6 2011-10-07.pdf. Talk. 6. Conclusions and further work While Haskell gives the programmer great devices to get their programs to do the right thing, such as referential transparency and the type system, she has less means to analyze and control their runtime behavior. Several commercial users have mentioned this as one of the main drawbacks of Haskell [4, 13, 17]. This problem deserves more attention and we hope that this work is one step towards a Haskell with better controllable and understandable time and space behavior. We have shown the feasibility of an explicit sharingpreventing operator in a lazy functional language. We provided two variants, dup and deepDup, the former is simpler, but possibly more subtle to put to use effectively, the latter works more predictably, but may impose a larger performance penalty. This is, on a prototypical level, possible with an unmodified Haskell compiler. As described in Section 5.1, there is work to be done on the implementation before it can be used in production code. Some of that might require changes to the compiler code. Given how sensitive the code is to changes in the runtime representation of Haskell values, a productive version of dup would probably have to be shipped along with the compiler. Acknowledgments I would like to thank Andreas Lochbihler for fruitful discussions and proof-reading and the anonymous referees for being supportive of the idea and constructive about the presentation. This work was supported by the Deutsche Telekom Stiftung. References [1] A. Bakewell and C. Runciman. A model for comparing the space usage of lazy evaluators. In PPDP, pages 151–162, 2000. [2] C. Böhm and A. Berarducci. Automatic synthesis of typed lambda-programs on term algebras. Theoretical Compututer Science, 39:135–154, 1985. [3] A. J. Gill, J. Launchbury, and S. L. Peyton Jones. A short cut to deforestation. In FPCA, pages 223–232, 1993. [4] E. Hesselink. Silk: making the sematic web functional. Functional Programming Exchange 2012, London, March 2012. Talk. [5] O. Kiselyov. Beyond Church encoding: BoehmBerarducci isomorphism of algebraic data types Joachim Breitner: dup – Explicit un-sharing in Haskell 9 2018/1/17
6cs.PL
The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence 1 Deep Activity Recognition Models with Triaxial Accelerometers Mohammad Abu Alsheikh and Ahmed Selim and Dusit Niyato arXiv:1511.04664v2 [cs.LG] 25 Oct 2016 Linda Doyle and Shaowei Lin and Hwee-Pink Tan Abstract Despite the widespread installation of accelerometers in almost all mobile phones and wearable devices, activity recognition using accelerometers is still immature due to the poor recognition accuracy of existing recognition methods and the scarcity of labeled training data. We consider the problem of human activity recognition using triaxial accelerometers and deep learning paradigms. This paper shows that deep activity recognition models (a) provide better recognition accuracy of human activities, (b) avoid the expensive design of handcrafted features in existing systems, and (c) utilize the massive unlabeled acceleration samples for unsupervised feature extraction. Moreover, a hybrid approach of deep learning and hidden Markov models (DL-HMM) is presented for sequential activity recognition. This hybrid approach integrates the hierarchical representations of deep activity recognition models with the stochastic modeling of temporal sequences in the hidden Markov models. We show substantial recognition improvement on real world datasets over state-of-the-art methods of human activity recognition using triaxial accelerometers. Introduction Existing sensor-based activity recognition systems (Chen et al. 2012) use shallow and conventional supervised machine learning algorithms such as multilayer perceptrons (MLPs), support vector machines, and decision trees. This reveals a gap between the recent developments of deep learning algorithms and existing sensor-based activity recognition systems. When deep learning is applied for sensor-based activity recognition, it results in many advantages in terms of system performance and flexibility. Firstly, deep learning provides an effective tool for extracting high-level feature hierarchies from high-dimensional data which is useful in classification and regression tasks (Salakhutdinov 2015). These automatically generated features eliminate the need for handcrafted features of existing activity recognition systems. Secondly, deep generative models, such as deep belief networks (Hinton, Osindero, and Teh 2006), can utilize unlabeled activity samples for model fitting in an unsupervised Copyright c 2016, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. pre-training phase which is exceptionally important due to the scarcity of labeled activity datasets. In the contrary, unlabeled activity datasets are abundant and cheap to collect. Thirdly, deep generative models are more robust against the overfitting problem as compared to discriminative models (e.g., MLP) (Mohamed, Dahl, and Hinton 2012). In this paper, we present a systematic approach towards detecting human activities using deep learning and triaxial accelerometers. This paper is also motivated by the success of deep learning in acoustic modeling (Mohamed, Dahl, and Hinton 2012; Dahl et al. 2012), as we believe that speech and acceleration data have similar patterns of temporal fluctuations. Our approach is grounded over the automated ability of deep activity recognition models in extracting intrinsic features from acceleration data. Our extensive experiments are based on three public and community-based datasets. In summary, our main results on deep activity recognition models can be summarized as follows: • Deep versus shallow models. Our experimentation shows that using deep activity recognition models significantly enhances the recognition accuracy compared with conventional shallow models. Equally important, deep activity recognition models automatically learn meaningful features and eliminate the need for the hand-engineering of features, e.g., statistical features, in state-of-the-art methods. • Semi-supervised learning. The scarce availability of labeled activity data motivates the exploration of semisupervised learning techniques for a better fitting of activity classifiers. Our experiments show the importance of the generative (unsupervised) training of deep activity recognition models in weight tuning and optimization. • Spectrogram analysis. Accelerometers generate multifrequency, aperiodic, and fluctuating signals which complicate the activity recognition using time series data. We show that using spectrogram signals instead of the raw acceleration data exceptionally helps the deep activity recognition models to capture variations in the input data. • Temporal Modeling. This paper presents a hybrid approach of deep learning and hidden Markov model (DLHMM) for better recognition accuracy of temporal sequence of activities, e.g., fitness movement and car maintenance checklist. This hybrid technique integrates the hi- The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence erarchical representations of deep learning with stochastic modeling of temporal sequences in HMMs. Experiments show that a DL-HMM outperforms HMM-based methods for temporal activity recognition. Specifically, the learned representation of deep activity recognition models is shown to be effective in estimating the posterior probabilities of HMMs. Unlike Gaussian mixture models which provide an alternative method, deep neural networks do not impose restrict assumptions on the input data distribution (Mohamed, Dahl, and Hinton 2012). Related Work In this section, we will focus on classification and feature engineering methods for activity recognition using accelerometers. For a more comprehensive review of the field, we refer interested readers to recent survey papers (Lara and Labrador 2013; Chen et al. 2012). Limitations of Shallow Classifiers Machine learning algorithms have been used for a wide range of activity recognition applications (Parkka et al. 2006; Khan et al. 2010; Altun and Barshan 2010; Kwapisz, Weiss, and Moore 2011), allowing the mapping between feature sets and various human activities. The classification of accelerometer samples into static and dynamic activities using MLPs is presented in (Khan et al. 2010). Conventional neural networks, including MLPs, often stuck in local optima (Rumelhart, Hinton, and Williams 1986) which leads to poor performance of activity recognition systems. Moreover, training MLPs using backpropagation (Rumelhart, Hinton, and Williams 1986) only hinders the addition of many hidden layers due to the vanishing gradient problem. The authors in (Parkka et al. 2006) used decision trees and MLPs to classify daily human activities. In (Berchtold et al. 2010), a fuzzy inference system is designed to detect human activities. (Kwapisz, Weiss, and Moore 2011) compared the recognition accuracy of decision tree (C4.5), logistic regression, and MLPs, where MLPs are found to outperform the other methods. In this paper, we show significant recognition accuracy improvement on real world datasets over state-of-theart methods for human activity recognition using triaxial accelerometers. Additionally, even though some previous works have purportedly reported promising results of activity recognition accuracy, they still require a degree of handcrafted features as discussed below. Limitations of Handcrafted Features Handcrafted features are widely utilized in existing activity recognition systems for generating distinctive features that are fed to classifiers. The authors in (Altun and Barshan 2010; Berchtold et al. 2010; Kwapisz, Weiss, and Moore 2011; Xu et al. 2012; Catal et al. 2015) utilized statistical features, e.g., mean, variance, kurtosis and entropy, as distinctive representation features. On the negative side, statistical features are problem-specific, and they poorly generalize to other problem domains. In (Zappi et al. 2008), the signs of raw signal (positive, negative, or null) are used 2 as distinctive features. Despite its simple design, these sign features are plain and cannot represent complex underlying activities which increase the number of required accelerometer nodes. The authors in (Bächlin et al. 2010) used the energy and frequency bands in detecting the freezing events of Parkinson’s disease patients. Generally speaking, any handcrafted-based approach involves laborious human intervention for selecting the most effective features and decision thresholds from sensory data. Quite the contrary, data-driven approaches, e.g., using deep learning, can learn discriminative features from historical data which is both systematic and automatic. Therefore, deep learning can play a key role in developing selfconfigurable framework for human activity recognition. The author in (Plötz, Hammerla, and Olivier 2011) discussed the utilization of a few feature learning methods, including deep learning, in activity recognition systems. Nonetheless, this prior work is elementary in its use of deep learning methods, and it does not provide any analysis of the deep network construction, e.g., setup of layers and neurons. Moreover, our probabilistic framework supports temporal sequence modeling of activities by producing the activity membership probabilities as the emission matrix of an HMM. This is a considerable advantage for temporally modeling human actions that consist of a sequence of ordered activities, e.g., fitness movement and car maintenance checklist. Problem Statement This section gives a formal description of the activity recognition problem using accelerometer sensors. Data Acquisition Consider an accelerometer sensor that is attached to a human body and takes samples (at time index t ) of the form rt = r∗t + wt , t = 1, 2, . . . (1) T  x rt rty rtz is a 3D accelerometer where rt = data point generated at time t and composed of rtx , rty , and rtz which are the x-acceleration, y-acceleration, and zacceleration components, respectively. The proper acceleration in each axis channel is a floating-point value that is bounded to some known constant B > 0 such that |rtx | ≤ B, |rty | ≤ B, and |rtz | ≤ B. For example, an accelerometer with B = 2g units indicates that it can record proper acceleration up to twice the gravitational acceleration (recall that meter 1g ' 9.8 second 2 ). Clearly, an accelerometer that is placed on a flat surface record a vertical acceleration value of ±1g upward. r∗t ∈ R3 is a vector that contains 3-axial noiseless acceleration readings. wt ∈ R3 is a noise vector of independent, zero-mean Gaussian random variables with variance 2 2 σw such that wt v N (0, σw I3 ). Examples of added noise during signal acquisition include the effect of temperature drifts and electromagnetic fields on electrical accelerometers (Fender et al. 2008). Three channel frames sxt , syt , and szt ∈ RN are then formed to contain the x-acceleration, y-acceleration, and z-acceleration components, respectively. Particularly, these The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence = [ T x rt+N −1 ] , (2) ··· y rt+N −1 z rt+N −1 T ] , (3) T (4) ··· ] . The sequence size N should be carefully selected such as to ensure an adequate and efficient activity recognition. We assume that the system supports M different activities. Specifically, let A = {a1 , a2 , . . . , aM } be a finite activity space. Based the windowed excerpts sxt , sxt , and szt , the activity recognition method infers the occurrence of an activity yt ∈ A. yt ... yT xt Class membership probability Softmax regression Binarybinary RBM Temporal modeling xT Optional step Time Supported activities HMM P(xT | yT ) ... Eating [ ··· x2 Walking = rty rtz ... ... Watching TV [ rtx x1 . . . sxt szt = y2 Emission matrix yt  maxP(ai | x t ) 1i  M . . . sxt P( y2 | y1 ) y1 P(x1 | y1 ) . . . channel frames are created using a sliding window as follows: 3 Learning deep generative model Gaussianbinary RBM One-sided spectrum Spectrogram Data Preprocessing A spectrogram of an accelerometer signal is a three dimensional representation of changes in the acceleration energy content of a signal as a function of frequency and time. Historically, spectrograms of speech waveforms are widely used as distinguishable features in acoustic modeling, e.g., the mel-frequency cepstral (Zheng, Zhang, and Song 2001). In this paper, we use the spectrogram representation as the input of deep activity recognition models as it introduces the following advantages: 1. Classification accuracy. The spectrogram representation provides interpretable features in capturing the intensity differences among nearest acceleration data points. This enables the classification of activities based on the variations of spectral density which reduce the classification complexity. 2. Computational complexity. After applying the spectrogram on sxt , sxt , and szt , the length of the spectral signal is L = 3( N2 + 1) while the time domain signal length is 3N . This significantly reduces the computational burdens of any classification method due to the lower data dimensionality. Henceforth, the spectrogram signal of the triaxial accelerometer is denoted as xt ∈ RL , where L = 3( N2 + 1) is the concatenated spectrogram signals from the triaxial input data. Deep Learning for Activity Recognition: System and Model Our deep model learns not only the classifier’s weights used to recognize different activities, but also the informative features for recognizing these activities from raw data. This provides a competitive advantage over traditional systems that are hand-engineered. The model fitting and training consist of two main stages: (i) An unsupervised, generative, and pre-training step, and (ii) a supervised, discriminative, and fine-tuning step. The pre-training step generates intrinsic features based on a layer-by-layer training approach using unlabeled acceleration samples only. Firstly, we use deep belief networks (Hinton, Osindero, and Teh 2006) to find the activity membership probabilities. Then, we show how to utilize the activity membership probabilities generated by Time-series segmentation Triaxial accelerometer Data acquisition Figure 1: Activity recognition using deep activity recognition model. Our system automatically (1) takes triaxial acceleration time series, (2) extracts the spectrogram of windowed excerpts, (3) computes intrinsic features using a deep generative model, and then (4) recognizes the underlying human activities by finding the posterior probability distriM bution {P (ai |xt )}i=1 . This deep architecture outperforms existing methods for human activity recognition using accelerometers as shown by the experimental analysis on real world datasets. Furthermore, an optional step involves using the emission probabilities out of the deep model to train a hidden Markov model (HMM) for modeling temporal patterns in activities. deep models to model the temporal correlation of sequential activities. Figure 1 shows the working flow of the proposed activity recognition system. We implement deep activity recognition models based on deep belief networks (BBNs). DBNs are generative models composed of multiple layers of hidden units. In (Hinton, Osindero, and Teh 2006), the hidden units are formed from restricted Boltzmann machines (RBMs) which are trained in a layer-by-layer fashion. Notably, an alternative approach is based on using stacked autoencoders (Bengio et al. 2007). An RBM is a bipartite graph that is restricted in that no weight connections exist between hidden units. This restriction facilitates the model fitting as the hidden units become conditional independent for a given input vector. After the unsupervised pre-training, the learned weights are fine-tuned in an up-down manner using available data labels. A practical tutorial on the training of RBMs is presented in (Hinton 2012). Deep Activity Recognition Models DBNs (Hinton, Osindero, and Teh 2006) can be trained on greedy layer-wise training of RBMs as shown in Figure 2. In our model, the acceleration spectrogram signals The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence High-level code Hidden code GRBM h1 W1 Concatenated triaxial acceleration data x BRBM W2 GRBM W1 x h3 h2 BRBM W3 h2 h1 BRBM W2 h1 GRBM W1 x Figure 2: The greedy layer-wise training of DBNs. The first level is trained on triaxial acceleration data. Then, more RBMs are repeatedly stacked to form a deep activity recognition model until forming a high-level representation. x are continuous and are fed to a deep activity recognition model. As a result, the first layer of the deep model is selected as a Gaussian-binary RBM (GRBM) which can model the energy content in the continuous accelerometer data. Afterward, the subsequent layers are binary-binary RBMs (BRBMs). RBMs are energy-based probabilistic models which are trained using stochastic gradient descent on the negative log-likelihood of the training data. For the GRBM layer, the energy of an observed vector v = x and a hidden code h is denoted as follows: 1 > E (v = x, h) = (v − b) (v − b)−c> h−v> Wh (5) 2 where W is the weight matrix connecting the input and hidden layers, b and c are the visible and hidden unit biases, respectively. For a BRBM, the energy function is defined as follows: E (v, h) = −b> v − c> h − v> Wh. (6) An RBM can be trained using the contrastive divergence approximation (Hinton 2002) as follows:  4Wij = α hvi hj idata − hvi hj i1 (7) where α is a learning rate. hvi hj idata is the expectation of reconstruction over the data, and hvi hj i1 is the expectation of reconstruction over the model using one step of the Gibbs sampler. Please refer to (Hinton, Osindero, and Teh 2006; Hinton 2012) for further details on the training of DBNs. For simplicity, we denote the weights and biases of a DBN model as θ which can be used to find the posterior probabilities P (ai |xt , θ) for each joint configuration (ai , xt ). To this end, the underlying activity yt can be predicted at time t using the softmax regression as follows: yt = arg max {P (ai |xt , θ)} . 1≤i≤M 4 models (HMMs) (Rabiner and Juang 1986) are a type of graphical models that can simulate the temporal generation of a first-order Markov process. The temporal activity recognition problem includes finding the most probable sequence of (hidden) activities y1 , . . . , yT that produce an (observed) sequence of input x1 , . . . , xT . An HMM model Φ is represented as a 3-tuple Φ = (π, ψ, Υ) where π = (P (y1 = ai ) : i = 1, . . . , M ) is the prior probabilities of all activities in the first hidden state, ψ = (P (yt = ai |yt−1 = aj ) : i, j = 1, . . . , M ) is the transition probabilities, and Υ = (P (xt |yt = ai ) : i = 1, . . . , M and t = 1, . . . , T ) is the emission matrix for observables xt from hidden symbols ai . Given a sequence of observations, the emission probabilities is found using a deep model. In particular, the joint probabilities P (yt , xt ) of each joint configuration (yt , xt ) in an HMM is found as follows: P (yt , xt ) = P (y1 ) P (x1 |y1 ) T Y P (yi |yi−1 ) P (xi |yi(9) ), i=2 = P (yt−1 , xt−1 ) P (yt |yt−1 ) P (xt |yt ) , (10) Herein, (10) shows that an HMM infers the posterior distribution P (yt |xt ) as a recursive process. This decoding problem is solved for the most probable path of sequential activities. Computational Complexity Our algorithm consists of three working phases: (a) data gathering, (b) offline learning, and (c) online activity recognition and inference. The computational burden of the offline learning is relatively heavy to be run on a mobile device as it based on stochastic gradient descent optimization. Therefore, it is recommended to run the offline training of a deep activity recognition model on a capable server. Nonetheless, after the offline training is completed, the model parameter θ is only disseminated to the wearable device where the online activity recognition is lightweight with a linear time complexity (O (L × D)), where D is the number of layers in the deep activity recognition model. Here, the time complexity of the online activity recognition system represents the time needed to recognize the activity as a function of the accelerometer input length. The time complexity of finding the short-time Fourier transform (STFT) is O (L log (L)). Finally, the time complexity of the HMM decoding problem is O M 2 × T . (8) Baselines and Result Summary Alternatively, the temporal patterns in a sequence of activities can be further analyzed using HMMs. The following section establishes the probabilistic connection between the input data xt and activity prediction yt over a sequence of observations 1 ≤ t ≤ T . Datasets Temporal Activity Recognition Models (DL-HMM) • WISDM Actitracker dataset (Kwapisz, Weiss, and Moore 2011): This dataset contains 1, 098, 213 samples of one triaxial accelerometer that is programmed to sample at a rate of 20 Hz. The data samples belong to 29 users In some activity recognition applications, there is a temporal pattern in executed human activities, e.g., car checkpoint (Zappi et al. 2008). Hidden Markov For empirical comparison with existing approaches, we use three public datasets that represent different application domains to verify the efficiency of our proposed solution. These three testbeds are described as follows: Performance Measures For binary classification (experimentation on the Daphnet dataset), we use three performance metrics: TP TN Sensitivity (TPR) = TP+FN , specificity (TNR) = TN+FP , TP+TN and accuracy (ACC) = TP+TN+FP+FN where TP, TN, FP, and FN mean true positive, true negative, false positive, and false negative, respectively. For multiclass classification of non-overlapping activities, which are based on the experimentation of the WISDM Actitracker and Skoda checkpoint datasets, the average recognition accuracy (ACC) is found PM T Pi +T Ni 1 as ACC = M i=1 T Pi +T Ni +F Pi +F Ni , where M is the number of supported activities. Baselines Table 1 summarizes the main performance results of our proposed method and some previous solutions on using the three datasets. Deep activity recondition models introduce significant accuracy improvement over conventional methods. For example, it improves accuracy by 6.53% over MLPs and 3.93% over ensemble learning on the WISDM Actitracker dataset. Similarly, significant improvements are also reported for the Daphnet freezing of gait and Skoda checkpoint datasets. This summarized result shows that the deep models are both (a) effective in improving recognition accuracy over state-of-the-art methods, and (b) practical for avoiding the hand-engineering of features. Experiments on Real Datasets Spectrogram Analysis Figure 3 shows triaxial time series and spectrogram signals of 6 activities of the WISDM Actitracker dataset. Clearly, the high frequency signals (a.k.a. AC components) belong Raw signal 20 Frequency (Hz) 40 60 Time (sec) 25 20 15 10 5 0 −5 −10 −15 Moving average −20 80 100 120 0 (d) X-specgram (b) Y-axis Raw signal 20 40 60 Time (sec) 10 8 8 6 6 4 4 4 2 2 20 40 60 Time (sec) 80 0 0 100 Raw signal 20 40 Moving average 60 80 Time (sec) 100 20 10 0 −10 −20 −30 −40 −50 −60 −70 2 20 40 60 Time (sec) 80 0 0 100 120 (f) Z-specgram 10 8 6 0 0 (c) Z-axis 25 20 15 10 5 0 −5 −10 −15 Moving average −20 80 100 120 0 (e) Y-specgram 20 40 60 80 Time (sec) 100 (a) 200 neurons per layer 100 99 98.75 98 99.2 97.55 97 96.97 Best 96 97.46 3 Number of layers 98.3 97 96.87 97.26 97.06 4 97.85 97.75 5 99.35 97.85 Best 96 95 1 98.74 Testing (c) 1000 neurons per layer 99.66 99.44 99.0 100 98 2 99.28 97.46 Training 95 1 99 99.29 Training 2 Testing 3 Number of layers 4 5 Recognition accuracy (%) Figure 3: Frequency spectrum as a parametric representation. Data samples of a triaxial accelerometer and their corresponding spectrogram representation (WISDM Actitracker dataset). These samples belong to five everyday human activities: jogging t ∈ [0, 20), walking t ∈ [20, 40), upstairs t ∈ [40, 60), downstairs t ∈ [60, 80), sitting t ∈ [80, 100), and standing t ∈ [100, 120). The acceleration signal is usual subtle and only cover a small range of the frequency domain. Recognition accuracy (%) • Skoda checkpoint dataset (Zappi et al. 2008): The 10 distinctive activities of this dataset belong to a car maintenance scenario in typical quality control checkpoints. The sampling rate is 98 Hz. Even though the dataset contains 20 nodes of triaxial accelerometers, it would be inconvenient and costly to fix 20 nodes to employee hands which can hinder the maintenance work. Therefore, we use one accelerometer node (ID # 16) for the experimental validation of deep models. 5 (a) X-axis 10 Recognition accuracy (%) • Daphnet freezing of gait dataset (Bächlin et al. 2010): We used this dataset to demonstrate the healthcare applications of deep activity recognition models. The data samples are collected from patients with the Parkinson’s disease. Three triaxial accelerometers are fixed at patient’s ankle, upper leg, and trunk with a sampling frequency of 64 Hz. The objective is to detect freezing events of patients. The dataset contains 1, 140, 835 experimentation samples from 10 users. The samples are labeled with either “freezing” or “no freezing” classes. 25 20 15 10 5 0 −5 −10 −15 −20 0 Recognition accuracy (%) and 6 distinctive human activities of walking, jogging, sitting, standing, and climbing stairs. The acceleration samples are collected using mobile phones with Android operating system. Acceleration (m=s2 ) The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence (b) 500 neurons per layer 100 99 98.73 99.01 98 97 97.16 97.16 96 99.4 97.79 97.84 100 99 98 97.95 2 98.7 97.16 Best Training 95 1 97 99.25 Testing 3 Number of layers 4 99.82 97.65 97.75 97.46 97.55 96.58 Best 96 95 1 5 (d) 2000 neurons per layer 99.77 99.34 98.98 Training 2 Testing 3 Number of layers 4 5 Figure 4: Optimizing deep activity recognition models. Activity recognition using the WISDM Actitracker dataset under different DBN setup. At each figure, the rates of activity recognition accuracy are shown for both training and testing data samples. The input length is 303 which corresponds to 10-second frames. to activities with active body motion, e.g., jogging and walking. On the other hand, the low frequency signals (a.k.a. DC components) are collected during semi-static body motions, e.g., sitting and standing. Thereby, these low frequency activities are only distinguishable by the accelerometer measurement of the gravitational acceleration. Performance Analysis In our experiments, the data is firstly centered to the mean and scaled to a unit variance. The deep activity recognition models are trained using stochastic gradient decent with mini-batch size of 75. For the first GBRM layer, the pretraining learning rate is set to 0.001 with pre-training epochs of 150. For next BRBM layers, the number of pre-training epochs is fixed to 75 with pre-training learning rate of 0.01. The fine-tuning learning rate is 0.1 and the number of finetuning epochs is 1000. For interested technical readers, Hinton (Hinton 2012) provides a tutorial on training RBMs with many practical advices on parameter setting and tuning. The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence DATASET WISDM S OLUTION Our solution (Zappi et al. 2008) C4.5 Logistic regression MLPs Ensemble learning Deep learning models Energy threshold on power spectral density (0.5sec) C4.5 and k-NNs with feature extraction methods Deep learning models HMMs Our solution Deep learning models (Hammerla et al. 2013) Skoda W INDOW SIZE R EFERENCE (Kwapisz, Weiss, and Moore 2011) (Kwapisz, Weiss, and Moore 2011) (Kwapisz, Weiss, and Moore 2011) (Catal et al. 2015) Our solution (Bächlin et al. 2010) Daphnet 6 ACCURACY (%) 85.1 78.1 91.7 94.3 98.23 TPR: 73.1 and TNR: 81.6 TPR and TNR ∼ 82 10 sec 4 sec - TPR and TNR ∼ 91.5 Node 16 (86), nodes 20, 22 and 25 (84) Node 16 (89.38) 4 sec 4 sec Table 1: Comparison of our proposed solution against existing methods in terms of recognition accuracy. C4.5 is a decision tree generation method. Discriminative training only # OF LAYERS ACCURACY (%) 1 3 5 1 3 5 96.87 97.75 97.85 96.87 96.46 96.51 (a) Transition matrix 2 Activity index E XPRIEMENT Generative & discriminative training 4 6 8 (b) Prior probabilities 10 Table 2: Comparison of accuracy improvements due to the pre-training stage. Each layer consists of 1000 neurons. 2 1. Deep models outperforms shallow ones. Clearly, the general trend in the recognition accuracy is that using more layers will enhance the recognition accuracy. For example, using 4 layers of 500 neurons at each layer is better than 2 layers of 1000 neurons at each layer, which is better than 1 layer of 2000 neurons. 2. Overcomplete representations are advantageous. An overcompete representation is achieved when the number of neurons at each layer is larger than the input length. An overcompete representation is essential for learning deep models with many hidden layers, e.g., deep model of 2000 neurons per layer. On the other hand, it is noted that a deep model will be hard to optimized when using undercomplete representations, e.g., 5 layers of 200 neurons at each layer. This harder optimization issue is distinguishable from the overfitting problem as the training data accuracy is also degrading by adding more layers (i.e., an overfitted model is diagnosed when the recognition accuracy on training data is enhancing by adding more layer while getting poorer accuracy on testing data). Therefore, we recommend 4x overcomplete deep activity recognition models (i.e., the number of neurons at each layer is four times the input size). Pre-training Effects Table 2 shows the recognition accuracy with and without the pre-training phase. These results confirm the importance of the generative pre-training phase of deep activity recognition models. Specifically, a generative pre-training of a deep model guides the discriminative training to better generalization solutions (Erhan et al. 2010). Clearly, the generative pre-training is almost ineffec- 6 8 10 2 Activity index 0.0 Deep Model Structure Figure 4 shows the recognition accuracy on different DBN structures (joint configurations of number of layers and number of neurons per layer). Two important results are summarized as follows: 4 0.1 0.2 0.3 0.4 0.5 0.6 4 6 8 10 Activity index 0.7 0.8 0.9 1.0 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 Figure 5: Transition and prior probabilities of sequential activities. (a) The transition matrix ψ ∈ RN ×N that represents the probabilities of moving among activities A = {a1 , a2 , . . . , a10 }. (b) The prior belief π ∈ RN that stores the initial probabilities of different activities. These parameters are extracted from the Skoda checkpoint dataset (node ID 16). tive for 1-layer networks. However, using the generative pretraining becomes more essential for the recognition accuracy of deeper activity recognition models, e.g., 5 layers. Temporal Modeling We used a deep activity recognition model with 3 layers of 1000 neurons each. The recognition accuracy is 89.38% for the 10 activities on the Skoda checkpoint dataset (node ID 16), improving 3.38% over the HMM method presented by (Zappi et al. 2008). Furthermore, the results can be significantly enhanced by exploring the temporal correlation in the dataset. Our hybrid DL-HMM achieves near perfect recognition accuracy of 99.13%. In particular, Figure 5 shows the parameters of a HMM model that is used to model the temporal sequences of the Skoda checkpoint dataset. Here, the checkpoint task must follow a specific activity sequence. Conclusions and Future Work We investigated the problem of activity recognition using triaxial accelerometers. The proposed approach is superior to traditional methods of using shallow networks with handcrafted features by using deep activity recognition models. The deep activity recognition models produce significant improvement to the recognition accuracy by extracting hierarchical features from triaxial acceleration data. Moreover, the recognition probabilities of deep activity recognition models are utilized as an emission matrix of a hidden The Workshops of the Thirtieth AAAI Conference on Artificial Intelligence Markov model to temporally model a sequence of human activities. References [Altun and Barshan 2010] Altun, K., and Barshan, B. 2010. Human activity recognition using inertial/magnetic sensor units. In Human Behavior Understanding. Springer. 38–51. [Bächlin et al. 2010] Bächlin, M.; Plotnik, M.; Roggen, D.; Maidan, I.; Hausdorff, J. M.; Giladi, N.; and Tröster, G. 2010. Wearable assistant for Parkinson’s disease patients with the freezing of gait symptom. IEEE Transactions on Information Technology in Biomedicine 14(2):436–446. [Bengio et al. 2007] Bengio, Y.; Lamblin, P.; Popovici, D.; Larochelle, H.; et al. 2007. Greedy layer-wise training of deep networks. Advances in neural information processing systems 19:153. [Berchtold et al. 2010] Berchtold, M.; Budde, M.; Gordon, D.; Schmidtke, H. R.; and Beigl, M. 2010. ActiServ: Activity recognition service for mobile phones. In Proceedings of the International Symposium on Wearable Computers, 1–8. IEEE. [Catal et al. 2015] Catal, C.; Tufekci, S.; Pirmit, E.; and Kocabag, G. 2015. On the use of ensemble of classifiers for accelerometer-based activity recognition. Applied Soft Computing. [Chen et al. 2012] Chen, L.; Hoey, J.; Nugent, C. D.; Cook, D. J.; and Yu, Z. 2012. Sensor-based activity recognition. IEEE Transactions on Systems, Man, and Cybernetics, Part C: Applications and Reviews 42(6):790–808. [Dahl et al. 2012] Dahl, G. E.; Yu, D.; Deng, L.; and Acero, A. 2012. Context-dependent pre-trained deep neural networks for large-vocabulary speech recognition. IEEE Transactions on Audio, Speech, and Language Processing 20(1):30–42. [Erhan et al. 2010] Erhan, D.; Bengio, Y.; Courville, A.; Manzagol, P.-A.; Vincent, P.; and Bengio, S. 2010. Why does unsupervised pre-training help deep learning? The Journal of Machine Learning Research 11:625–660. [Fender et al. 2008] Fender, A.; MacPherson, W. N.; Maier, R.; Barton, J. S.; George, D. S.; Howden, R. I.; Smith, G. W.; Jones, B.; McCulloch, S.; Chen, X.; et al. 2008. Twoaxis temperature-insensitive accelerometer based on multicore fiber Bragg gratings. IEEE sensors journal 7(8):1292– 1298. [Hammerla et al. 2013] Hammerla, N. Y.; Kirkham, R.; Andras, P.; and Ploetz, T. 2013. On preserving statistical characteristics of accelerometry data using their empirical cumulative distribution. In Proceedings of the International Symposium on Wearable Computers, 65–68. ACM. [Hinton, Osindero, and Teh 2006] Hinton, G. E.; Osindero, S.; and Teh, Y.-W. 2006. A fast learning algorithm for deep belief nets. Neural computation 18(7):1527–1554. [Hinton 2002] Hinton, G. E. 2002. Training products of experts by minimizing contrastive divergence. Neural computation 14(8):1771–1800. 7 [Hinton 2012] Hinton, G. E. 2012. A practical guide to training restricted Boltzmann machines. In Neural Networks: Tricks of the Trade. Springer. 599–619. [Khan et al. 2010] Khan, A. M.; Lee, Y.-K.; Lee, S. Y.; and Kim, T.-S. 2010. A triaxial accelerometer-based physicalactivity recognition via augmented-signal features and a hierarchical recognizer. IEEE Transactions on Information Technology in Biomedicine 14(5):1166–1172. [Kwapisz, Weiss, and Moore 2011] Kwapisz, J. R.; Weiss, G. M.; and Moore, S. A. 2011. Activity recognition using cell phone accelerometers. ACM SigKDD Explorations Newsletter 12(2):74–82. [Lara and Labrador 2013] Lara, O. D., and Labrador, M. A. 2013. A survey on human activity recognition using wearable sensors. IEEE Communications Surveys & Tutorials 15(3):1192–1209. [Mohamed, Dahl, and Hinton 2012] Mohamed, A.-R.; Dahl, G. E.; and Hinton, G. 2012. Acoustic modeling using deep belief networks. IEEE Transactions on Audio, Speech, and Language Processing 20(1):14–22. [Parkka et al. 2006] Parkka, J.; Ermes, M.; Korpipaa, P.; Mantyjarvi, J.; Peltola, J.; and Korhonen, I. 2006. Activity classification using realistic data from wearable sensors. IEEE Transactions on Information Technology in Biomedicine 10(1):119–128. [Plötz, Hammerla, and Olivier 2011] Plötz, T.; Hammerla, N. Y.; and Olivier, P. 2011. Feature learning for activity recognition in ubiquitous computing. In IJCAI ProceedingsInternational Joint Conference on Artificial Intelligence, volume 22, 1729. [Rabiner and Juang 1986] Rabiner, L. R., and Juang, B.-H. 1986. An introduction to hidden markov models. IEEE ASSP Magazine 3(1):4–16. [Rumelhart, Hinton, and Williams 1986] Rumelhart, D. E.; Hinton, G. E.; and Williams, R. J. 1986. Learning representations by back-propagating errors. Nature 323(6088):533– 536. [Salakhutdinov 2015] Salakhutdinov, R. 2015. Learning deep generative models. Annual Review of Statistics and Its Application 2(1):361–385. [Xu et al. 2012] Xu, W.; Zhang, M.; Sawchuk, A. A.; and Sarrafzadeh, M. 2012. Robust human activity and sensor location corecognition via sparse signal representation. IEEE Transactions on Biomedical Engineering 59(11):3169–3176. [Zappi et al. 2008] Zappi, P.; Lombriser, C.; Stiefmeier, T.; Farella, E.; Roggen, D.; Benini, L.; and Tröster, G. 2008. Activity recognition from on-body sensors: Accuracy-power trade-off by dynamic sensor selection. In Wireless sensor networks. Springer. 17–33. [Zheng, Zhang, and Song 2001] Zheng, F.; Zhang, G.; and Song, Z. 2001. Comparison of different implementations of MFCC. Journal of Computer Science and Technology 16(6):582–589.
9cs.NE
FACTORING GROUPS INTO DENSE SUBSETS arXiv:1602.01603v1 [math.GR] 4 Feb 2016 IGOR PROTASOV, SERHII SLOBODIANIUK Abstract. Let G be a group of cardinality κ > ℵ0 endowed with a topology T such that |U | = κ for every non-empty U ∈ T and T has a base of cardinality κ. We prove that G could be factorized G = AB (i.e. each g ∈ G has unique representation g = ab, a ∈ A, b ∈ B) into dense subsets A, B, |A| = |B| = κ. We do not know if this statement holds for κ = ℵ0 even if G is a topological group. 1. Introduction For a cardinal κ, a topological space X is called κ-resolvable if X can be partitioned into κ dense subsets [1]. In the case κ = 2, these spaces were defined by Hewitt [4] as resolvable spaces. If X is not κ-resolvable then X is called κ-irresolvable. In topological groups, the intensive study of resolvability was initiated by the following remarkable theorem of Comfort and van Mill [2]: every countable non-discrete Abelian topological group G with finite subgroup B(G) of elements of order 2 is 2-resolvable. In fact [11], every infinite Abelian group G with finite B(G) can be partitioned into ω subsets dense in every non-discrete group topology on G. On the other hand, under Martin’s Axiom, the countable Boolean group G, G = B(G) admits maximal (hence, 2-irresolvable) group topology [5]. Every non-discrete ω-irresolvable topological group G contains an open countable Boolean subgroup provided that G is Abelian [6] or countable [10], but the existence of non-discrete ω-irresolvable group topology on the countable Boolean group implies that there is a P -point in ω ∗ [6]. Thus, in some models of ZFC (see [8]), every non-discrete Abelian or countable topological group is ω-resolvable. For systematic exposition of resolvability in topological and left topological group see [3, Chapter 13]. Recently, a new kind resolvability of groups was introduced in [7]. A group G provided with a topology T is called box κ-resolvable if there is a factorization G = AB such that |A| = κ and each subset aB is dense in T . If G is left topological (i.e. each left shift x 7→ gx, g ∈ G is continuous) then this is equivalent to B is dense in T . We recall that a product AB of subsets of a group G is factorization if G = AB and the subsets {aB : a ∈ A} are pairwise disjoint (equivalently, each g ∈ G has the unique representation g = ab, a ∈ A, b ∈ B). For factorizations of groups into subsets see [9]. By [7, Theorem 1], if a topological group G contains an injective convergent sequence then G is box ω-resolvable. This note is to find some conditions under which an infinite group G of cardinality κ provided with the topology could be factorized into two dense subsets of crdinality κ. To this goal, we propose a new method of factorization based on filtrations of groups. 2. Theorem and Question We recall that a weight w(X) of a topological space X is the minimal cardinality of bases of the topology X. Theorem. Let G be an infinite group of cardinality κ, κ > ℵ0 , endowed with a topology T such that w(G, T ) ≤ κ and |U| = κ for each non-empty U ∈ T . Then there is a factorization G = AB into dense subsets A, B, |A| = |B| = κ. We do not know whether Theorem is true for κ = ℵ0 even if G is a topological group. 2010 Mathematics Subject Classification. 20A05, 22A05. Key words and phrases. factorization, filtration, resolvability, box resolvability. 2 IGOR PROTASOV, SERHII SLOBODIANIUK Question. Let G be a non-discrete countable Hausdorff left topological group G of countable weight. Can G be factorized G = AB into two countable dense subsets? In Comments, we give a positive answer in the following cases: each finitely generated subgroup of G is nowhere dense, the set {x2 : x ∈ U} is infinite for each non-empty open subset of G, G is Abelian. 3. Proof We begin with some general constructions of factorizations of a group G via filtrations of G. Let G be a group with the identity e and let κ be a cardinal. A family {Gα : α < κ} of subgroups of G is called a filtration if S (1) G0 = {e}, G = α<κ Gα ; (2) Gα ⊂ S Gβ for all α < β; (3) Gβ = α<β Gα for every limit ordinal β. Every ordinal α < κ has the unique representation α = γ(α)+n(α), where γ(α) is either limit ordinal or 0 and n(α) ∈ ω, ω = {0, 1, . . . }. We partition κ into two subsets E(κ) = {α < κ : n(α) is even}, O(κ) = {α < κ : n(α) is odd}. For each α ∈ E(κ), we choose some system Lα of representatives of left cosets of Gα+1 \ Gα by Gα so Gα+1 \ Gα = Lα Gα . For each α ∈ O(κ), we choose some system Rα of representatives of right cosets of Gα+1 \ Gα by Gα so Gα+1 \ Gα = Gα Rα . We take an arbitrary element g ∈ G \ {e} and choose the smallest subgroup Gγ such that g ∈ Gγ . By (3), γ = α(g) + 1 so g ∈ Gα(g)+1 \ Gα(g) . If α(g) ∈ E(κ) then we choose x0 (g) ∈ Lα (g) and g0 ∈ Gα (g) such that g = x0 (g)g0. If α(g) ∈ O(κ) then we choose y0 (g) ∈ Rα (g) and g0 ∈ Gα (g) such that g = g0 y0 (g). If g0 = e, we make a stop. Otherwise we repeat the argument for g0 and so on. Since the set of ordinals < κ is well ordered, after finite number of steps we get the representation (4) g = x0 (g)x1 (g) . . . xλ(g) (g)yρ(g) . . . y1 (g)y0(g), xi ∈ Lαi (g) , α0 (g) > α1 (g) > · · · > αλ(g)(g) , yi ∈ Rβi (g) , β0 (g) > β1 (g) > · · · > βρ(g)(g) . If either {α0 (g), . . . , αλ(g) (g)} = ∅ or {β0 (g), . . . , βρ(g) (g)} = ∅ then we write g = yρ(g) . . . y1 (g)y0(g) or g = x0 (g)x1 (g) . . . xλ(g) (g). Thus, G = AB where A is the set of all elements of the form x0 (g)x1 (g) . . . xλ(g) and B is the set of all elements of the form yρ(g) . . . y1 (g)y0(g). To show that the product AB is a factorization of G, we assume that, besides (4), g has a representation g = z0 z1 . . . zλ tρ . . . t1 t0 . If g ∈ Gα+1 \ Gα and α ∈ O(κ) then z0 z1 . . . zλ tρ . . . t1 ∈ Gα so t0 = y0 (g). If α ∈ E(κ) then −1 z1 . . . zλ tρ . . . t1 t0 ∈ Gα so z0 = x0 (g). We replace g to gt−1 0 or to z0 g respectively and repeat the same arguments. Now we are ready to prove Theorem. Let {Uα : α < κ} be a κ-sequence of non-empty open sets such that each non-empty U ∈ T contains some Uα . Since |Uα | = κ for every α < κ, we can construct inductively a filtration {Gα : α < κ}, |Gα | = max{ℵ0 , |α|} such that, for each α ∈ E(κ) (resp. α ∈ O(κ)) there is a system Lα (resp. Rα ) of representatives of left (resp. right ) cosets of Gα+1 \ Gα by Gα such that Lα ∩ Uγ 6= ∅ (resp. Rα ∩ Uγ 6= ∅) for each γ ≤ α. Then the subsets A, B of above factorization of G are dense in T because Lα ⊂ A, Rβ ⊂ B for each α ∈ E(κ), β ∈ O(κ). FACTORING GROUPS INTO DENSE SUBSETS 3 4. Comments 1. Analyzing the proof, we see that Theorem holds under weaker condition: G has a family F of subsets such that |F | = κ, |F | = κ for each F ∈ F and, for every non-empty U ∈ T , there is F ∈ F such that F ⊆ U. If κ = ℵ0 but each finitely generating subgroup of G is nowhere dense, we can choose a family {Gn : n ∈ ω} such that corresponding A, B are dense. Thus, we get a positive answer to Question if each finitely generated subgroup H of G is nowhere dense (equivalently the closure of H is not open). 2. Let G be a group and A, B be subsets of G. We say that the product AB is a partial factorization if the subsets {aB : a ∈ A} are pairwise disjoint (equivalently, {Ab : b ∈ B} are pairwise disjoint). We assume that AB is a partial factorization of G into finite subsets and X be an infinite subset of G. Then the following statements are easily verified (5) there is x ∈ X such that x ∈ / B and A(B ∪ {x}) is a partial factorization; (6) if the set {x2 : x ∈ X} is infinite then there is x ∈ X such that (A ∪ {x, x−1 })B is a partial factorization. 3. Let G be a non-discrete Hausdorff topological group, AB be a partial factorization of G into finite subsets, A = A−1 , e ∈ A ∩ B and g ∈ / B. Then (7) there is a neighbourhood V of e such that, for U = V \ {e} and for any x ∈ U, the product (A ∪ {x, x−1 })(B ∪ {x−1 g}) is a partial factorization (so g ∈ (A ∪ {x, x−1 })(B ∪ {x−1 g})). It suffices to choose V so that V = V −1 and AUg ∩ AB = ∅, UB ∩ (AB ∪ AUg) = ∅, U 2 g ∩ AB = ∅, U ∩ A = ∅. We use A = A−1 only in UB ∩ AUg = ∅. 4. Let G be countable non-discrete Hausdorff topological group such that {x2 : x ∈ U} is infinite for every non-empty open subset U of G. We enumerate G = {gn : n ∈ ω}, g0 = e and choose a countable base {Un : n ∈ ω} for non-empty open sets. We put A0 = {e}, B0 = {e} and use (5), (6), (7) to choose inductively two sequences (An )n∈ω and (Bn )n∈ω of finite subsets of G such that for every n ∈ ω An ⊂ An+1 , Bn ⊆ Bn+1S , An = A−1 n , A Sn Bn is a partial factorization, gn ∈ An Bn , An ∩ Un 6= ∅, Bn ∩ Un 6= ∅. We put A = n∈ω An , B = n∈ω Bn and note that AB is a factorization of G into dense subsets. 5. Let G be a countable Abelian non-discrete Hausdorff topological group of countable weight. We suppose that G contains a non-discrete finitely generated subgroup H. Given any non-empty open subset U of G, we choose a neighborhood X of e in H and g ∈ S such that Xg ⊂ U. Since H is finitely generated, the set {x2 : x ∈ X} is infinite so we can apply comment 4. If each finitely generated subgroup of G is discrete then, to answer the Question we use comment 1. 6. Let G be a countable group endowed with a topology T of countable weight such that U is infinite −1 for every U ∈ T . Applying the inductive construction from comment 5 to An Bn and Bn+1 A−1 n , we get a partial factorization of G into two dense subsets. 7. Let G be a group satisfying the assumption of Theorem and let γ be an infinite cardinal, γ < κ. We take a subgroup A of cardinality γ and choose inductively a dense set B of representatives of right cosets of G by A. Then we get a factorization G = AB. In particular, if G is left topological then G is box γ-resolvable. References [1] J. Ceder, On maximally resolvable spaces, Fund.Math. 55 (1964) 87-93. [2] W. Comfort, J. van Mill, Group with only resolvable group topologies, Proc. Amer. Math. Soc. 120(1993) 687-696. [3] M. Filali, I. Protasov, Ultrafilters and Topologies on Groups, Math. Stud. Monogr. Ser., vol 13, VNTL, Lviv, 2010. [4] E. Hewitt, A problem of set-theoretic topology, Duke Math. J. 10 (1943) 309-333. [5] V. Malykhin, Extremally disconnected and similar groups, Soviet Math. Dokl. 16 (1975) 21-25; translation from Dokl. Akad. Nauk SSSR 220 (1975) 27-30. [6] I. Protasov, Irresolvable topologies on groups, Ukr. Math. J. 50 (1998) 1879-1887; translation from Ukr. Math. Zh. 50 (1998) 1646-1655. 4 IGOR PROTASOV, SERHII SLOBODIANIUK [7] [8] [9] [10] [11] I. Protasov, Box resolvability, preprint (http://arxiv.org/abs/1511.01046). S. Shelah, Proper Forcing, Lecture Notes Math, vol. 940, Springer-Verlag, 1982. S.Szabo, A. Sanders, Factoring Groups into Subsets, CRC Press, 2009. E. Zelenyuk, On partitions of groups into dense subsets, Topology Appl. 126(2000) 327-339. E. Zelenyuk, Partitions and sums with inverse in Abelian groups, J. Comb. Theory, Ser. A 115 (2008), 331-339 Department of Cybernetics, Kyiv University, Volodymyrska 64, 01033, Kyiv, Ukraine E-mail address: [email protected]; Department of Mechanics and Mathematics, Kyiv University, Volodymyrska 64, 01033, Kyiv, Ukraine E-mail address: [email protected]
4math.GR
Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 The evolutionary origins of modularity Jeff Clune, Jean-Baptiste Mouret and Hod Lipson Proc. R. Soc. B 2013 280, 20122863, published online 30 January 2013 Supplementary data "Data Supplement" http://rspb.royalsocietypublishing.org/content/suppl/2013/01/29/rspb.2012.2863.DC1.h tml References This article cites 34 articles, 9 of which can be accessed free http://rspb.royalsocietypublishing.org/content/280/1755/20122863.full.html#ref-list-1 This article is free to access Subject collections Articles on similar topics can be found in the following collections computational biology (13 articles) evolution (1383 articles) systems biology (32 articles) Email alerting service Receive free email alerts when new articles cite this article - sign up in the box at the top right-hand corner of the article or click here To subscribe to Proc. R. Soc. B go to: http://rspb.royalsocietypublishing.org/subscriptions Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 The evolutionary origins of modularity Jeff Clune1,2,†, Jean-Baptiste Mouret3,† and Hod Lipson1 1 Cornell University, Ithaca, NY, USA University of Wyoming, Laramie, WY, USA 3 ISIR, Université Pierre et Marie Curie-Paris 6, CNRS UMR 7222, Paris, France 2 rspb.royalsocietypublishing.org Research Cite this article: Clune J, Mouret J-B, Lipson H. 2013 The evolutionary origins of modularity. Proc R Soc B 280: 20122863. http://dx.doi.org/10.1098/rspb.2012.2863 Received: 30 November 2012 Accepted: 9 January 2013 Subject Areas: computational biology, evolution, systems biology Keywords: modularity, evolution, networks, evolvability, systems biology Author for correspondence: Jeff Clune e-mail: [email protected] † These authors contributed equally to this work. Electronic supplementary material is available at http://dx.doi.org/10.1098/rspb.2012.2863 or via http://rspb.royalsocietypublishing.org. A central biological question is how natural organisms are so evolvable (capable of quickly adapting to new environments). A key driver of evolvability is the widespread modularity of biological networks—their organization as functional, sparsely connected subunits—but there is no consensus regarding why modularity itself evolved. Although most hypotheses assume indirect selection for evolvability, here we demonstrate that the ubiquitous, direct selection pressure to reduce the cost of connections between network nodes causes the emergence of modular networks. Computational evolution experiments with selection pressures to maximize network performance and minimize connection costs yield networks that are significantly more modular and more evolvable than control experiments that only select for performance. These results will catalyse research in numerous disciplines, such as neuroscience and genetics, and enhance our ability to harness evolution for engineering purposes. 1. Introduction A long-standing, open question in biology is how populations are capable of rapidly adapting to novel environments, a trait called evolvability [1]. A major contributor to evolvability is the fact that many biological entities are modular, especially the many biological processes and structures that can be modelled as networks, such as metabolic pathways, gene regulation, protein interactions and animal brains [1–7]. Networks are modular if they contain highly connected clusters of nodes that are sparsely connected to nodes in other clusters [4,8,9]. Despite its importance and decades of research, there is no agreement on why modularity evolves [4,10,11]. Intuitively, modular systems seem more adaptable, a lesson well known to human engineers [12], because it is easier to rewire a modular network with functional subunits than an entangled, monolithic network [13,14]. However, because this evolvability only provides a selective advantage over the long term, such selection is at best indirect and may not be strong enough to explain the level of modularity in the natural world [4,10]. Modularity is probably caused by multiple forces acting to various degrees in different contexts [4], and a comprehensive understanding of the evolutionary origins of modularity involves identifying those multiple forces and their relative contributions. The leading hypothesis is that modularity mainly emerges because of rapidly changing environments that have common subproblems, but different overall problems [13,14]. Computational simulations demonstrate that in such environments (called modularly varying goals: MVG), networks evolve both modularity and evolvability [13,14]. By contrast, evolution in unchanging environments produces non-modular networks that are slower to adapt to new environments [13,14]. Follow-up studies support the modularity-generating force of MVG in nature: the modularity of bacterial metabolic networks is correlated with the frequency with which their environments change [15]. It is unknown how much natural modularity MVG can explain, however, because it is unclear how many biological environments change modularly, and whether they change at a high enough frequency for this force to play a significant role [11]. A related theory that also assumes a constantly changing environment and selection for evolvability is that modularity arises to enable modifying one subcomponent without affecting others [11]. There are other plausible & 2013 The Authors. Published by the Royal Society under the terms of the Creative Commons Attribution License http://creativecommons.org/licenses/by/3.0/, which permits unrestricted use, provided the original author and source are credited. Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 modular problem pixels for right subproblem evolutionary process non-modular networks selection on performance alone evolutionary process in new environment slow adaptation retina variation selection on performance and connection costs variation fast adaptation modular networks hypotheses (reviewed in [4]), including that variation mechanisms, such as gene duplication, create a bias towards the generation of modular structures [4] and that modularity evolves because of selection to make phenotypes robust to environmental perturbations [10]. We investigate an alternate hypothesis that has been suggested, but heretofore untested, which is that modularity evolves not because it conveys evolvability, but as a byproduct from selection to reduce connection costs in a network (figure 1) [9,16]. Such costs include manufacturing connections, maintaining them, the energy to transmit along them and signal delays, all of which increase as a function of connection length and number [9,17 –19]. The concept of connection costs is straightforward in networks with physical connections (e.g. neural networks), but costs and physical limits on the number of possible connections may also tend to limit interactions in other types of networks such as genetic and metabolic pathways. For example, adding more connections in a signalling pathway might delay the time that it takes to output a critical response; adding regulation of a gene via more transcription factors may be difficult or impossible after a certain number of proximal DNA binding sites are occupied, and increases the time and material required for genome replication and regulation; and adding more protein– protein interactions to a system may become increasingly difficult as more of the remaining surface area is taken up by other binding interactions. Future work is needed to investigate these and other hypotheses regarding costs in cellular networks. The strongest evidence that biological networks face direct selection to minimize connection costs comes from the vascular system [20] and from nervous systems, including the brain, where multiple studies suggest that the summed length of the wiring diagram has been minimized, either by reducing long connections or by optimizing the placement of neurons [9,17 –19,21 –23]. Founding [16] and modern [9] neuroscientists have hypothesized that direct selection to minimize connection costs may, as a side-effect, cause modularity. This hypothesis has never been tested in the context of evolutionary biology. The most related study was on nonevolving, simulated neural networks with a specific withinlife learning algorithm that produced more modularity when minimizing connection length in addition to performance [24], although the generality of the result was questioned when it was not replicated with other learning algorithms [25]. Without during-life learning algorithms, carefully constructed MVG environments or mutation operators strongly biased towards creating modules, attempts to evolve modularity in neural networks have failed [10,26,27]. Given the impracticality of observing modularity evolve in biological systems, we follow most research on the subject by conducting experiments in computational systems with evolutionary dynamics [4,11,13]. Specifically, we use a wellstudied system from the MVG investigations [13,14,27]: evolving networks to solve pattern-recognition tasks and Boolean logic tasks (§4). These networks have inputs that sense the environment and produce outputs (e.g. activating genes, muscle commands, etc.), which determine performance on environmental problems. We compare a treatment where the fitness of networks is based on performance alone (PA) to one based on two objectives: maximizing performance and minimizing connection costs (P&CC). A multi-objective evolutionary algorithm is used [28] with one (PA) or two (P&CC) objectives: to reflect that selection is stronger on network performance than connection costs, the P&CC cost objective affects selection probabilistically only 25 per cent of the time, although the results are robust to substantial changes to this value (§4). Two example connection cost functions are investigated. The default one is the summed squared length of all connections, assuming nodes are optimally located to minimize this sum (§4), as has been found for animal nervous systems [17,18,29,30]. A second measure of costs as solely the number of connections yields qualitatively similar results to the default cost function, and may better represent biological networks without connections of different lengths. More fit networks tend to have more offspring (copies that are randomly mutated), and the cycle repeats for a preset number of generations (figure 1, §4). Such computational evolving systems have substantially improved our understanding of natural evolutionary dynamics [4,11,13,14,31,32]. The main experimental problem involves a network that receives stimuli from eight inputs [13]. It can be thought of as an eight-pixel retina receiving visual stimuli, although other analogies are valid (§4), such as a genetic regulatory network exposed to environmental stimuli. Patterns shown on the retina’s left and right halves may each contain an ‘object’, meaning a pattern of interest (figure 2a). Networks evolve to answer whether an object is present on both the left and right sides of the retina (the L-AND-R environment) or whether an object is displayed on either side (the L-OR-R environment). Which patterns count as an object on the left and right halves are slightly different Proc R Soc B 280: 20122863 Figure 1. Main hypothesis. Evolving networks with selection for performance alone produces non-modular networks that are slow to adapt to new environments. Adding a selective pressure to minimize connection costs leads to the evolution of modular networks that quickly adapt to new environments. 2 rspb.royalsocietypublishing.org pixels for left subproblem Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 (a) input pattern 3 (e) left objects object on left? rspb.royalsocietypublishing.org retina performance alone (PA) object on right? right objects performance and connection costs (P&CC) retina AND yes/no (b) Q = 0.31 Q = 0.24 (c) Q = 0.40 Q = 0.46 Q = 0.46 Proc R Soc B 280: 20122863 performance (L-AND-R) performance and connection costs (P&CC) 1.00 0.98 0.96 performance alone (PA) 0.94 (f) (d) modularity (Q) 0.45 performance and connection costs (P&CC) 0.35 0.25 performance alone (PA) 0.15 modularity (Q) (g) 2500 5000 7500 10 000 12 500 15 000 generation 17 500 20 000 22 500 25 000 >0.2 0.6 0.5 0.4 0.3 0.2 0.1 generation: 0 generation: 1000 generation: 100 generation: 25 000 % of the population (per pixel) 0 modularity (Q) (h) 0.6 0.5 0.4 0.3 0.2 0.1 generation: 0 0 125 250 cost generation: 100 375 0 125 250 cost >0.2 generation: 1000 375 0 125 250 cost generation: 25 000 375 0 125 250 cost 375 % of the population (per pixel) 0 0 Figure 2. The addition of connection costs leads to higher-performing, functionally modular networks. (a) Networks evolve to recognize patterns (objects) in an eight-pixel retina. The problem is modularly decomposable because whether an object exists on the left and right sides can be separately determined before combining that information to answer whether objects exist on both sides (denoted by the AND logic function). (b) Networks from an example trial become more modular across evolutionary time (also see the electronic supplementary material, video S1) with a pressure to minimize connection costs in addition to performance (P&CC). (c) Median performance (+95% bootstrapped confidence intervals) per generation of the highest-performing network of each trial, which is perfect only when minimizing connection costs in addition to performance. (d ) Network modularity, which is significantly higher in P&CC trials than when selecting for performance alone (PA). (e) The 12 highest-performing PA networks, each from a separate trial. (f ) The 12 highest-performing P&CC networks, which are functionally modular in that they have separate modules for the left and right subproblems. Nodes are coloured according to membership in separate partitions when making the most modular split of the network (see text). The final networks of all 50 trials are visualized in the electronic supplementary material, figure S1. (g,h) Cost and modularity of PA and P&CC populations across generations, pooled from all 50 trials. A connection cost pushes populations out of high-cost, low-modularity regions towards low-cost, modular regions. Figure 3 shows the fitness potential of each map area. (figure 2a). Each network iteratively sees all possible 256 input patterns and answers true (0) or false (,0). Its performance is the percentage of correct answers, which depends on which nodes are connected, how strongly, and whether those connections are inhibitory or excitatory (§4). Networks are randomly generated to start each experiment. Their connections stochastically mutate during replication (§4). Network modularity is evaluated with an efficient approximation [33,34] of the widely used modularity metric Q, which first optimally divides networks into modules then measures the difference between the number of edges within each module and the number expected for random networks with the same number of edges [33,34]. Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 1.000 PA PA, perfect perf. P&CC P&CC perfect perf. 0.6 modularity (Q) 0.5 0.975 0.950 0.925 0.900 0.4 0.875 0.3 0.850 0.825 0.1 0.800 0.775 0 50 100 150 200 250 300 350 cost 0.750 Figure 3. The highest-performing networks found for each combination of modularity and cost for the retina problem. Colours indicate the highestperforming network found at that point in the modularity versus cost space, with yellow representing perfect performance. This map has been generated using the MOLE algorithm (§4). The best-performing network at the end of each of the 50 PA and P&CC runs are overlaid on the map. Networks with perfect performance exist throughout the space, which helps explain why modularity does not evolve when there is selection based on performance alone. Below a cost threshold of around 125 there is an inverse correlation between cost and modularity for perfectly performing networks. The lowest cost networks—those with the shortest summed lengths— that are high-performing are modular. 2. Results After 25 000 generations in an unchanging environment (L-AND-R), treatments selected to maximize performance and minimize connection costs (P&CC) produce significantly more modular networks than treatments maximizing performance alone (PA) (figure 2d, Q ¼ 0.42, 95% CI [0.25,0.45] vs. Q ¼ 0.18[0.16, 0.19], p ¼ 8  10209 using Matlab’s Mann –Whitney– Wilcoxon rank sum test, which is the default statistical test unless otherwise specified). To test whether evolved networks exhibit functional modularity corresponding to the left –right decomposition of the task we divide networks into two modules by selecting the division that maximizes Q and colour nodes in each partition differently. Left –right decomposition is visually apparent in most P&CC trials and absent in PA trials (figure 2e,f ). Functional modularity can be quantified by identifying whether left and right inputs are in different partitions, which occurs in 56 per cent of P&CC trials and never with PA (Fisher’s exact test, p ¼ 4  10211). Pairs of perfect sub-solution nodes—whose outputs perfectly answer the left and right subproblems—occur in 39 per cent of P&CC trials and 0 per cent of PA trials (Fisher’s exact test, p ¼ 3  1026, electronic supplementary material, figure S1). Despite the additional constraint, P&CC networks are significantly higher-performing than PA networks (figure 2c, electronic supplementary material, figure S13). The medianperforming P&CC network performs perfectly (1.0[1.0, 1.0]), but the median PA network does not (0.98[0.97, 0.98], p ¼ 2  10205). P&CC performance may be higher because its networks have fewer nodes and connections (see the electronic supplementary material, figure S8b,c), meaning fewer 4 Proc R Soc B 280: 20122863 0.2 parameters to optimize. Modular structures are also easier to adapt since mutational effects are smaller, being confined to subcomponents [8]. While it is thought that optimal, nonmodular solutions usually outperform optimal, modular designs, such ‘modularity overhead’ only exists when comparing optimal designs, and is not at odds with the finding that adaptation can be faster and ultimately more successful with a bias towards modular solutions [8]. To better understand why the presence of a connection cost increases performance and modularity, we searched for the highest-performing networks at all possible combinations of modularity and cost (§4). For high-performing networks, there is an inverse correlation between cost and modularity, such that the lowest-cost networks are highly modular (figure 3). Many runs in the P&CC treatment evolved networks in this region whereas the PA treatments never did. There are also many non-modular, high-cost networks that are high-performing, helping one explain why modularity does not evolve due to performance alone (figure 3). Comparing PA versus P&CC populations across generations reveals that a connection cost pushes populations out of high-cost, low-modularity areas of the search space into low-cost, modular areas (figure 2g,h). Without the pressure to leave high-cost, low-modularity regions, many PA networks remain in areas that ultimately do not contain the highest-performing solutions (figure 3, pink squares in the bottom right), further explaining why P&CC treatments have higher performance. We also found evidence of an inverse correlation between the total cost of a network and modularity in randomly generated networks, irrespective of performance, supporting the intuition that low-cost networks are more likely to be modular (see the electronic supplementary material, figure S12). P&CC networks are also more evolvable than PA networks. We ran additional trials until 50 P&CC and 50 PA trials each had a perfectly performing network (§4) and transferred these networks into the L-OR-R environment, which has the same subproblems in a different combination (see the electronic supplementary material, figure S6). The presence (P&CC) or absence (PA) of a connection cost remained after the environmental change. We performed 50 replicate experiments for each transferred network. We also repeated the experiment, except first evolving in L-OR-R and then transferring to L-AND-R. In both experiments, P&CC networks exhibit greater evolvability than PA by requiring fewer generations to adapt to the new environment (figure 4a, L-AND-R ! L-OR-R: 3.0[2.0, 5.0] versus 65[62, 69], p ¼ 3  10278; L-OR-R ! L-AND-R: 12.0[7.0, 21.0] versus 222.5[175.0, 290.0], p ¼ 9  102120). Modular networks thus evolve because their sparse connectivity has lower connection costs, but such modularity also aids performance and evolvability because the problem is modular. Minimizing connection costs can work in conjunction with other forces to increase modularity. Modularity levels are higher when combining P&CC with MVG environments (figure 4b: solid versus dotted green line, p ¼ 3  1025). Overall, P&CC (with or without MVG) yields similar levels of modularity as MVG at its strongest, and significantly more when rates of environmental change are too slow for the MVG effect to be strong (figure 4: green lines versus blue solid line). P&CC modularity is also higher than PA even on problems that are non-modular (figure 5a, p ¼ 5.4  10218). As rspb.royalsocietypublishing.org 0.7 Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 L-AND-R  L-OR-R (b) 600 400 200 0 PA P&CC L-OR-R  L-AND-R PA cost and modularity (see the electronic supplementary material, figure S10). After reading a preprint of this manuscript, a different research group replicated the main result in a different domain: they found that a connection cost causes modularity to evolve when optimizing computer chip architectures [35]. Confirming the generality of the finding that connection costs improve adaptation rates and that high-performing, low-cost networks are modular is an interesting area for future research. P&CC 0.50 0.40 MVG (P&CC) 0.35 0.30 0.25 unchanging environment (P&CC) MVG (PA) unchanging environment (PA) 0.20 0.15 10 103 102 generations between environmental changes 104 Figure 4. Evolving with connection costs produces networks that are more evolvable. (a) P&CC networks adapt faster to new environments than PA networks. Organisms were first evolved in one environment (e.g. L-AND-R) until they reached perfect performance and then transferred to a second environment (e.g. L-OR-R). Thick lines are medians, boxes extend from 25th to 75th data percentiles, thin lines mark 1.5  IQR (interquartile range), and plus signs represent outliers. Electronic supplementary material figure S6 is a zoomed-out version showing all of the data. (b) P&CC networks in an unchanging environment (dotted green line) have similar levels of modularity to the highest levels produced by MVG (solid blue line). Combining MVG with P&CC results in even higher modularity levels (solid green line), showing that the forces combined are stronger than either alone. to be expected, such modularity is lower than on modular problems ( p ¼ 0.0011, modular retina versus non-modular retina). This non-modular problem involves answering whether any four pixels were on (black), which is non-modular because it requires information from all retina inputs. As mentioned previously, performance and modularity are also significantly higher with an alternate connection cost function based on the number of connections (P&CC-NC) instead of the length of connections (figure 6). We also verified that modularity and performance are not higher simply because a second objective is used (figure 6). We further tested whether modularity arises even when the inputs for different modules are not geometrically separated, which is relevant when cost is a function of connection length. Even in experiments with randomized input coordinates (§4), a connection cost significantly increased performance (1.0[0.98, 1.0], p ¼ 0.0012) and modularity (Q ¼ 0.35[0.34, 0.38], p ¼ 1  1029), and performance and modularity scores were not significantly different than P&CC without randomized coordinates (see the electronic supplementary material, figure S7). All the results presented so far are qualitatively similar in a different model system: evolving networks to solve Boolean logic tasks. We tested two fully separable problems: one with five ‘exclusive or’ (XOR) logic modules (figure 5b), and another with hierarchically nested XOR problems (figure 5c). P&CC created separate modules for the decomposed problems in nearly every trial, whereas PA almost never did (see the electronic supplementary material, figures S2 and S3). P&CC performance was also significantly higher (figure 5b,c), and there was an inverse correlation between 3. Discussion and conclusion Overall, this paper supports the hypothesis that selection to reduce connection costs causes modularity, even in unchanging environments. The results also open new areas of research into identifying connection costs in networks without physical connections (e.g. genetic regulatory networks) and investigating whether pressures to minimize connection costs may explain modularity in human-created networks (e.g. communication and social networks). It is tempting to consider any component of modularity that arises due to minimizing connection costs as a ‘spandrel’, in that it emerges as a byproduct of selection for another trait [36,37]. However, because the resultant modularity produces evolvability, minimizing connection costs may serve as a bootstrapping process that creates initial modularity that can then be further elevated by selection for evolvability. Such hypotheses for how modularity initially arises are needed, because selection for evolvability cannot act until enough modularity exists to increase the speed of adaptation [4]. Knowing that selection to reduce connection costs produces modular networks will substantially advance fields that harness evolution for engineering, because a longstanding challenge therein has been evolving modular designs [8,10,27,38]. It will additionally aid attempts to evolve accurate models of biological networks, which catalyse medical and biological research [2,9,39]. The functional modularity generated also makes synthetically evolved networks easier to understand. These results will thus generate immediate benefits in many fields of applied engineering, in addition to furthering our quest to explain one of nature’s predominant organizing principles. 4. Methods (a) Experimental parameters Each treatment is repeated 50 times with different stochastic events (i.e. different random number generator seeds). Analyses and visualizations are of the highest-performing network per trial with ties broken randomly. The main experiments (retina, non-modular retina, 5-XOR, and hierarchical XOR) last 25 000 generations and have a population size of 1000. (b) Statistics For each statistic, we report the median +95% bootstrapped confidence intervals of the median (calculated by resampling the data 5000 times). In plots, these confidence intervals are smoothed with a median filter (window size ¼ 200) to remove sampling noise. Statistical significance is assessed using Matlab’s Mann – Whitney – Wilcoxon rank sum test. Proc R Soc B 280: 20122863 final modularity (Q) 0.45 5 rspb.royalsocietypublishing.org generations to adapt (a) Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 (a) (b) non-modular problem (c) multiple, separable problems hierarchical, separable problems XOR performance XOR performance modularity (Q) **** n.s. 0.8 1.0 0.4 modularity (Q) **** 0.8 0.8 P&CC XOR XOR XOR XOR performance *** P&CC PA modularity (Q) 0.8 1.0 **** 0.6 0.9 0.4 0.8 0.2 PA XOR XOR 0 PA P&CC 0.2 0.7 P&CC PA 0 PA P&CC PA P&CC PA P&CC PA P&CC Figure 5. Results from tests with different environmental problems. (a) Even on a non-modular problem, modularity is higher with P&CC, though it is lower than for modular problems. (b,c) P&CC performs better, is more modular, and has better functional decomposition than PA when evolving networks to solve five separate XOR functions and hierarchically nested XOR functions. The examples are the final, highest-performing networks per treatment. Electronic supplementary material figures S2 – S4 show networks from all trials. Three and four asterisks indicate p values less than 0.001 and 0.0001, respectively, and n.s. indicates no significant difference. (a) (b) 0.8 **** **** 0.6 1.0 0.4 P& CC C P& CC -N RO 0 P& CC P& C P& CC -N RO P& PA 0.9 PA 0.2 Figure 6. Alternate cost functions. Performance (a) and modularity (b) are significantly higher ( p, 0.0001) either with a cost function based on the length (P&CC) or number (P&CC-NC) of connections versus performance alone (PA) or performance and a random objective (P&RO). P&RO assigned a random number to each organism instead of a connection cost score and maximized that random number. Electronic supplementary material figure S7 contains visualizations of all P&CC-NC networks. (c) Length cost For P&CC treatments, prior to calculating connection costs, we place nodes in positions optimal for minimizing connection costs given the topology of the network, which is biologically motivated [17,18,29] and can be solved for mathematically [29]. Inputs and outputs are at fixed locations (see §4d). Visualizations reflect these node placements. (d) Geometric coordinates Nodes exist at two-dimensional (i.e. x,y) Cartesian locations. The geometric coordinates of the inputs and outputs for all problems were fixed throughout evolution, including the treatment where the within-row location of inputs are randomized at the beginning of each separate trial. The inputs for all problems have y-values of 0. For the retina problem, the x-values for the inputs are f23.5, 22.5, . . ., 3.5g and the output is at f4, 0g. For the problem with 5 XOR modules, the x-values for the inputs are f2 4.5, 23.5, . . ., 4.5g and the outputs all have y-values of 2 with x-values of f2 4, 22, 0, 2, 4g. For the problem with decomposable, hierarchically nested XOR functions, the x-values for the inputs are f2 3.5, 22.5, . . ., 3.5g and the outputs all have y-values of 4 with x-values of f22, 2g. The geometric location of nodes is consequential only when there is a cost for longer connections (i.e. the main P&CC treatment). (e) Evolvability experiment The evolvability experiments (figure 4a) are described in electronic supplementary material, figure S6. To obtain 50 trials that each had a perfectly performing network in L-AND-R and L-OR-R, respectively, took 110 and 116 trials for P&CC and 320 and 364 trials for PA. One thousand clones of each of these networks then evolved in the alternate environment until performance was perfect or 5000 generations passed. (f ) Biological relevance of network models This section provides a brief overview of the network models in this paper. A more complete review of network models is provided in [2,40 – 42] and the references therein. Network models can represent many types of biological processes by representing interactions between components Proc R Soc B 280: 20122863 0 P&CC PA XOR 0.4 0.9 0.2 0.9 XOR 0.6 **** 0.6 1.0 XOR rspb.royalsocietypublishing.org retina exactly 4 black pixels? 6 Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 Our model of a network is a standard, basic one used in machine learning [40], systems biology [2,13,14,43] and computational neuroscience [44]. It has also been used in previous landmark studies on the evolution of modularity [13,11]. The networks are feed-forward, meaning that nodes are arranged into layers, such that a node in layer n receives incoming connections only from nodes in layer n 2 1 and has outgoing connections only to nodes in layer n þ 1 (see the electronic supplementary material, figure S11b). The maximum number of nodes per hidden layer is 8/4/2 for the three hidden layers in the retina problem, 8 for the single hidden layer in the 5-XOR problem, and 8/4/4 for the three hidden layers in the hierarchical XOR problem. The possible values for connection weights are the integers 22, 21, 1 and 2. The possible values for thresholds (also called biases) are the integers 22, 21, 0, 1 and 2. Information flows through the network in discrete time steps one layer at a time. The output of each node in the network is the following P function of its inputs: yj ¼ tanhðlð i[Ij wij yi þ bÞÞ where yj is the output of node j, I is the set of nodes connected to j, wij is the strength of the connection between node i and node j, yi is the output of node i, and b is a threshold (also called a bias) that determines at which input value the output transitions from negative to positive. The tanh(x) transfer function ensures an output range of [21, 1]. l (here, 20) determines the slope of the transition between these inhibitory and excitatory extremes (see the electronic supplementary material, figure S11c). This network model can approximate any function with an arbitrary precision provided that it contains enough hidden nodes [45]. (h) Evolutionary algorithm The evolutionary algorithm is based on research into algorithms inspired by evolution that simultaneously optimize several objectives, called multi-objective algorithms [28]. These algorithms search for, but are not guaranteed to find, the set of optimal trade-offs: i.e. solutions that cannot be improved with respect to one objective without decreasing their score with respect to another one. Such solutions are said to be on the Pareto Front [28], described formally below. These algorithms are more general than algorithms that combine multiple objectives into a single, weighted fitness function, because the latter necessarily select one set of weights for each objective, whereas multi-objective algorithms explore all possible trade-offs between objectives [28]. The specific multi-objective algorithm in this paper is the widely used Non-dominated Sorting Genetic Algorithm, version II (NSGA-II) [28] (see the electronic supplementary material, figure S11a). As with most modern multi-objective evolutionary algorithms, it relies on the concept of Pareto dominance, defined as follows. (i) Mutational effects Mutations operate in essentially the same way as in the study by Kashtan & Alon [13]. In each generation, every new network is randomly mutated (see the electronic supplementary material, figure S11a). Four kinds of mutation are possible, which are not mutually exclusive: (i) each network has a 20 per cent chance of having a single connection added. Connections are added between two randomly chosen nodes that are not already connected and belong to two consecutive layers (to maintain the feed-forward property described previously); (ii) each network has a 20 per cent chance of a single, randomly chosen connection being removed; (iii) each node in the network has a 1/24 ¼ 4.16 per cent chance of having its threshold (also called its bias) incremented or decremented, with both options equally probable; five values are available {22, 21, 0, 1, 2}; mutations that produce values higher or lower than these five values are ignored; (iv) each connection in the network has a separate probability of being incremented or decremented of 2.0/n, where n is the total number of connections of the network. Four values are available {22, 21, 1, 2}; mutations that produce values higher or lower than these four values are ignored. The results in this manuscript are robust to varying these parameters. Because having more mutational events that remove connections than add them might also produce sparsely connected, modular networks, we repeated the main experiment with mutation rates biased to varying degrees (see the electronic supplementary material, figure S9). These experiments show that even having remove– connection events be an order of 7 Proc R Soc B 280: 20122863 (g) Network model details An individual x* is said to dominate another individual x, if both conditions 1 and 2 are true: (1) x* is not worse than x with respect to any objective; (2) x* is strictly better than x with respect to at least one objective. However, this definition puts the same emphasis on all objectives. In the present study, we take into account that the first objective (performance) is more important than the second objective (optimizing connection cost). To reflect this, we use a stochastic version of Pareto dominance in which the second objective is only taken into account with a given probability p. Lower values of p cause lower selection pressure on the second objective. Our results are robust to alternate values of p, including up to p ¼ 1.0 for static environments (see the electronic supplementary material, figure S5a–d) and p ¼ 0.95 for environments with modularly varying goals (see the electronic supplementary material, figure S5e). This stochastic application of the second objective is implemented as follows. Let r denote a random number in [0; 1] and p the probability to take the second objective into account. A solution x* is said to stochastically dominate another solution x, if one of the two following conditions is true: (1) r . p and x* is better than x with respect to the first objective; (2) r  p and x* is not worse than x with respect to either objective and x* is better than x with respect to at least one objective. Stochastic Pareto dominance is used in the algorithm twice (see the electronic supplementary material, figure S11a). (i) To select a parent for the next generation, two individuals x1 and x2 are randomly chosen from the current population; if x1 stochastically dominates x2, then x1 is selected, if x2 stochastically dominates x1, then x2 is selected. If neither dominates the other, the individual selected is the one which is in the less crowded part of the objective space [28]. (ii) To rank individuals, the set of stochastically non-dominated solutions is first identified and called the first Pareto layer (rank ¼ 1, e.g. l1 in electronic supplementary material, figure S11a); these individuals are then removed and the same operation is performed to identify the subsequent layers (additional ranks corresponding to l2, l3, etc. in electronic supplementary material, figure S11a). rspb.royalsocietypublishing.org [2,41,42]. Examples of biological systems that are commonly modelled as networks are genetic, metabolic, protein interaction and neural networks. All such networks can be represented abstractly as nodes representing components, such as neurons or genes, and the interactions between such components, such as a gene inhibiting another gene. The weight of connections indicates the type and strength of interactions, with positive values indicating activation, negative values indicating inhibition, and the magnitude of the value representing the strength of the interaction. Multiple nodes can connect to form a network (e.g. electronic supplementary material, figure S11b). Typically, information flows into the network via input nodes, passes through hidden nodes, and exits via output nodes. Examples include a gene regulatory network responding to changing levels of environmental chemicals or a neural network responding to visual inputs from the retina and outputting muscle commands. Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 To better understand evolving systems it would be helpful to visualize important constraints, trade-offs, and other correlations between different phenotypic dimensions in evolving populations (e.g. in this study, the performance, modularity, and cost for each possible network). If the search space is small enough, such values can be determined by exhaustively checking every possible solution. Such an approach is intractable for the problems in this manuscript. For example, for the main problem in the paper, which is the retina problem, the number of possible weights is (8  8) þ (8  4) þ (4  2) þ (2  1) þ 23 ¼ 129, owing to the number of nodes in the input, hidden, and output layers, as well as the bias for each of the 23 possible nodes. Each of these weights can be one of four values or a zero if no connection exists, and biases can be one of five values, leading to a search space of 5129 ¼ 1090. Given that it takes on average 0.0013 s to assess the fitness of a solution across all possible 256 inputs using a modern computer, it would take 4.1  1079 years of computing time to exhaustively determine the performance, modularity and cost for each solution in the search space. Because it is infeasible to exhaustively search the space, we randomly sampled it to see whether we would find highperforming solutions with a variety of cost and modularity scores. Specifically, we randomly generated more than two billion solutions, but every solution had poor performance. The highest-performing solution gave the correct answer for only 62 out of 256 retina patterns (24.2%), which is far below the performance of 93 per cent or greater for solutions routinely discovered by the evolutionary algorithm (see the electronic supplementary material, figure S1). We thus concluded that randomly sampling the space would not lead to the discovery of high-performing solutions. (k) Video of networks from each treatment evolving across generations A video is provided to illustrate the change in networks across evolutionary time for both the PA and P&CC treatments. In that the networks are visualized as described in the text. The video can be downloaded at: http://dx.doi.org/10.5061/dryad.9tb07. (l) Experimental data and source code All of the experimental data, source code and analysis scripts are freely available in a permanent online archive at http://dx.doi. org/10.5061/dryad.9tb07. Funding provided by an NSF Postdoctoral Research Fellowship in Biology to J.C. (DBI-1003220) and NSF CDI Grant ECCS 0941561. J.B.M. is supported by the ANR ( project Creadapt ANR12-JS03-0009). Thanks are due to Shimon Whiteson, Rafael Sanjuán, Stéphane Doncieux, Dusan Misevic, Jeff Barrick, Charles Ofria and the reviewers for helpful comments. References 1. 2. 3. 4. 5. 6. Pigliucci M. 2008 Is evolvability evolvable? Nat. Rev. Genet. 9, 75 –82. (doi:10.1038/nrg2278) Alon U. 2006 An introduction to systems biology: design principles of biological circuits. Boca Raton, FL: CRC Press. Carroll S. 2001 Chance and necessity: the evolution of morphological complexity and diversity. Nature 409, 1102 –1109. (doi:10.1038/35059227) Wagner GP, Pavlicev M, Cheverud JM. 2007 The road to modularity. Nat. Rev. Genet. 8, 921–931. (doi:10.1038/nrg2267) Hintze A, Adami C. 2008 Evolution of complex modular biological networks. PLoS Comput. Biol. 4, e23. (doi:10.1371/journal.pcbi.0040023) Mountcastle V. 1997 The columnar organization of the neocortex. Brain 120, 701– 722. (doi:10.1093/ brain/120.4.701) 7. Guimera R, Amaral L. 2005 Functional cartography of complex metabolic networks. Nature 433, 895 – 900. (doi:10.1038/nature03288) 8. Lipson H, 2007 Principles of modularity, regularity, and hierarchy for scalable systems. J. Biol. Phys. Chem. 7, 125–128. (doi:10.4024/40701.jbpc. 07.04) 9. Striedter G. 2005 Principles of brain evolution. Sunderland, MA: Sinauer Associates. 10. Wagner G, Mezey J, Calabretta R. 2001 Modularity: understanding the development and evolution of complex natural systems. Natural selection and the origin of modules. Cambridge, MA: MIT Press. 11. Espinosa-Soto C, Wagner A. 2010 Specialization can drive the evolution of modularity. PLoS Comput. Biol. 6, e1000719. (doi:10.1371/journal.pcbi. 1000719) 12. Suh NP. 1990 The principles of design, vol. 226. Oxford, UK: Oxford University Press. 13. Kashtan N, Alon U. 2005 Spontaneous evolution of modularity and network motifs. Proc. Natl Acad. Sci. USA 102, 13 773–13 778. (doi:10.1073/pnas.0503610102) 14. Kashtan N, Noor E, Alon U. 2007 Varying environments can speed up evolution. Proc. Natl Acad. Sci. USA 104, 13 711 –13 716. (doi:10.1073/ pnas.0611630104) 15. Parter M, Kashtan N, Alon U. 2007 Environmental variability and modularity of bacterial metabolic networks. BMC Evol. Biol. 7, 169. (doi:10.1186/ 1471-2148-7-169) 16. Ramón y Cajal S. 1899 Textura del sistema nervioso del hombre y de los vertebrados [Texture of the nervous system of man and the vertebrates]. Nicolás Moya. 8 Proc R Soc B 280: 20122863 ( j) Multi-objective landscape exploration algorithm We therefore designed an algorithm to find high-performing solutions with different combinations of modularity and length scores. We call this algorithm Multi-Objective Landscape Exploration (MOLE). It is a multi-objective optimization search [28] (see the electronic supplementary material, figure S11a) with two objectives. The first objective prioritizes individuals that have high performance. The second objective prioritizes individuals that are far away from other individuals already discovered by the algorithm, where distance is measured in a Cartesian space with connection costs on the x-axis and modularity on the y-axis. Algorithms of this type have been shown to better explore the search space because they are less susceptible to getting stuck in local optima [46]. Thus, unlike a traditional evolutionary algorithm that will only be drawn to a type of solution if there is a fitness gradient towards that type of solution, MOLE searches for high-performing solutions for every possible combination of modularity and cost scores. While this algorithm is not guaranteed to find the optimal solution at each point in the space, it provides a focused statistical sampling of how probable it is to discover a high-quality solution in each area of the search space. The MOLE maps in this paper (figure 3 and electronic supplementary material, figure S10) show the highestperforming network at each point in this Cartesian space found in 30 separate runs. rspb.royalsocietypublishing.org magnitude more probable than add-connection events does not reduce the number of connections or produce modular networks. In each of the experiments with biased mutation rates, the modularity and performance of the P&CC treatment with default mutation values was significantly greater than the PA treatment with biased mutation rate values. Our main results are qualitatively the same when weights and biases are real numbers (instead of integers) and mutated via Gaussian perturbation. Nodes are never added nor removed. For clarity, following [13], nodes without any connections are not displayed or included in results. Downloaded from rspb.royalsocietypublishing.org on January 30, 2013 27. 28. 29. 31. 32. 33. 34. 35. 36. Gould S, Lewontin R. 1979 The spandrels of San Marco and the panglossian paradigm: a critique of the adaptationist programme. Proc. R. Soc. Lond. B 205, 581–598. (doi:10.1098/rspb.1979.0086) 37. Solé R, Valverde S. 2006 Are network motifs the spandrels of cellular complexity? Trends Ecol. Evol. 21, 419 –422. (doi:10.1016/j.tree.2006.05.013) 38. Lipson H, Pollack J. 2000 Automatic design and manufacture of robotic lifeforms. Nature 406, 974– 978. (doi:10.1038/35023115) 39. Hoffman RE, Mcglashan TH. 2001 Neural network models of schizophrenia. The Neuroscientist 7, 441–454. (doi:10.1177/107385840100700513) 40. Haykin S. 1998 Neural networks: a comprehensive foundation, 2nd edn. Englewood Cliffs, NJ: PrenticeHall. 41. Newman M. 2003 The structure and function of complex networks. SIAM Rev. 45, 167–256. (doi:10.1137/S003614450342480) 42. Barabási A, Oltvai Z. 2004 Network biology: understanding the cell’s functional organization. Nat. Rev. Genet. 5, 101 –113. (doi:10.1038/ nrg1272) 43. Karlebach G, Shamir R. 2008 Modelling and analysis of gene regulatory networks. Nat. Rev. Mol. Cell Biol. 9, 770 –780. (doi:10.1038/nrm2503) 44. Trappenberg T. 2010 Fundamentals of computational neuroscience. Oxford, UK: Oxford University Press. 45. Cybenko G. 1989 Approximation by superpositions of a sigmoidal function. Math. Control Signals Systems (MCSS) 2, 303–314. (doi:10.1007/ BF02551274) 46. Lehman J, Stanley K. 2011 Abandoning objectives: evolution through the search for novelty alone. Evol. Comput. 19, 189–223. (doi:10.1162/ EVCO_a_00025) 9 Proc R Soc B 280: 20122863 30. and evolution: Proc. Sixth Neural Computation and Psychology Workshop, pp. 253–262. Berlin, Germany: Springer. Clune J, Beckmann BE, McKinley PK, Ofria C. 2010 Investigating whether hyperneat produces modular neural networks. In Proc. Genetic and Evolutionary Computation Conference, pp. 635 –642. New York, NY: ACM. Deb K. 2001 Multi-objective optimization using evolutionary algorithms. New York, NY: Wiley. Chklovskii DB. 2004 Exact solution for the optimal neuronal layout problem. Neural Comput. 16, 2067– 2078. (doi:10.1162/ 0899766041732422) Pérez-Escudero A, de Polavieja G. 2007 Optimally wired subnetwork determines neuroanatomy of Caenorhabditis elegans. Proc. Natl Acad. Sci. USA 104, 17 180–17 185. (doi:10.1073/pnas. 0703183104) Lenski RE, Ofria C, Pennock RT, Adami C. 2003 The evolutionary origin of complex features. Nature 423, 139 –144. (doi:10.1038/nature01568) Lenski RE, Ofria C, Collier TC, Adami C. 1999 Genome complexity, robustness and genetic interactions in digital organisms. Nature 400, 661 –664. (doi:10.1038/23245) Newman MEJ. 2006 Modularity and community structure in networks. Proc. Natl Acad. Sci. USA 103, 8577 –8582. (doi:10.1073/pnas.0601602103) Leicht EA, Newman MEJ. 2008 Community structure in directed networks. Phys. Rev. Lett. 118 703– 118 707. (doi:10.1103/PhysRevLett.100.118703) Chung H, Asnodkar A, Teuscher C. 2012 A structural analysis of evolved complex networks-onchip. In Proc. Fifth Int. Workshop on Network on Chip Architectures, pp. 17– 22. New York, NY: ACM. rspb.royalsocietypublishing.org 17. Cherniak C, Mokhtarzada Z, Rodriguez-Esteban R, Changizi K. 2004 Global optimization of cerebral cortex layout. Proc. Natl Acad. Sci. USA 101, 1081 – 1086. (doi:10.1073/pnas.0305212101) 18. Chen B, Hall D, Chklovskii D. 2006 Wiring optimization can relate neuronal structure and function. Proc. Natl Acad. Sci. USA 103, 4723 –4728. (doi:10.1073/pnas.0506806103) 19. Ahn Y-Y, Jeong H, Kim BJ. 2006 Wiring cost in the organization of a biological neuronal network. Physica A: Statist. Mech. Appl. 367, 531–537. (doi:10.1016/j.physa.2005.12.013) 20. LaBarbera M. 1990 Principles of design of fluid transport systems in zoology. Science 249, 992 – 1000. (doi:10.1126/science.2396104) 21. Laughlin SB, Sejnowski TJ. 2003 Communication in neuronal networks. Science (New York, N.Y.) 301, 1870–1874. (doi:10.1126/science.1089662) 22. Raj A, Chen Y-h. 2011 The wiring economy principle: connectivity determines anatomy in the human brain. PLoS ONE 6, e14832. (doi:10.1371/ journal.pone.0014832) 23. Chklovskii D, Schikorski T, Stevens C. 2002 Wiring optimization in cortical circuits. Neuron 34, 341 – 347. (doi:10.1016/S0896-6273(02)00679-7) 24. Jacobs R, Jordan M. 1992 Computational consequences of a bias toward short connections. J. Cogn. Neurosci. 4, 323– 336. (doi:10.1162/jocn. 1992.4.4.323) 25. Bullinaria J. 2001 Simulating the evolution of modular neural systems. In Proc. Twenty-third Annu. Conf. of the Cognitive Science Society, pp. 146–151. London, UK: Lawrence Erlbaum. 26. Di Ferdinando A, Calabretta R, Parisi D. 2001 Evolving modular architectures for neural networks. In Connectionist models of learning, development
9cs.NE
CONJECTURES AND COMPUTATIONS ABOUT VERONESE SYZYGIES arXiv:1711.03513v1 [math.AC] 9 Nov 2017 JULIETTE BRUCE, DANIEL ERMAN, STEVE GOLDSTEIN, AND JAY YANG Abstract. We formulate several conjectures which shed light on the structure of Veronese syzygies of projective spaces. Our conjectures are based on experimental data that we derived by developing a numerical linear algebra and distributed computation technique for computing and synthesizing new cases of Veronese embeddings for P2 . A central open question in the study of syzygies is to determine the Betti table of Pn under the d-uple Veronese embedding. While the case n = 1 is well understood – the resolution is an Eagon-Northcott complex – even the case n = 2 is wide open. In this paper, we formulate several conjectures which shed light on the structure of Veronese syzygies of projective spaces. For instance, Conjecture 6.1 predicts the most dominant torus (or Schur functor) weights that will arise in each entry of the Betti table of Pn under any d-uple embedding. Our conjectures are based on experimental data gathered using new techniques for computings syzygies of Veronese embeddings of P2 . These techniques are based upon the use of numerical linear algebra and distributed computation. For a fixed n, let S = C[x0 , x1 , . . . , xn ] be the polynomial ring with the standard grading. We are primarily interested in syzygies in the dth Veronese subring of S, which we denote S(0; d) := S (d) = ⊕i∈Z Sdi . We consider S(0; d) as an R-module, where R = Sym(Sd ) is the symmetric algebra on the vector space Sd . Geometrically, this corresponds to computing the n+d syzygies of Pn under the d-uple embedding Pn → P( d )−1 . Since Green’s landmark [Gre84a], the syzygies of a variety are often studied in parallel with the syzygies of the other line bundles on the variety, as this provides a unifying perspective (see also [Gre84b, Theorem 2.2], [EL93, Theorem 2], [EL12, Theorem 4.1]). Accordingly, we set S(b; d) := ⊕i∈Z Sdi+b as an R-module; this is the graded R-module associated to the pushforward of OPn (b) under the d-uple embedding. We analyze the Betti numbers of S(b; d), as well as multigraded and equivariant refinements. We write βp,p+q (P Kp,q (Pn , b; d) = TorR p (S(b; d), C)p+q = C n ,b;d) . Date: November 10, 2017. JB received support from the NSF GRFP under grant DGE-1256259, and from the Graduate School and the Office of the Vice Chancellor for Research and Graduate Education at the University of WisconsinMadison with funding from the Wisconsin Alumni Research Foundation. DE received support from NSF grant DMS-1601619. JY received support from NSF grant DMS-1502553. 1 Thus βp,p+q (Pn , b; d) denotes the vector space dimension of Kp,q (Pn , b; d). The natural linear action of GLn+1 (C) on S induces an action on Kp,q (Pn , b; d), and so we can decompose this as a direct sum of Schur functors of total weight d(p + q) + b i.e. M Kp,q (Pn , b; d) = Sλ (Cn+1 )⊕mλ , λ of weight d(p+q)+b where Sλ is the Schur functor corresponding to the partition λ [FH91, p. 76]. This is the Schur decomposition of Kp,q (Pn , b; d), and is the most compact way to encode the syzygies. Specializing to the action of (C∗ )n+1 , gives a decomposition of Kp,q (Pn , b; d) into a sum of Zn+1 -graded vector spaces of total weight d(p + q) + b. Specifically, writing C(−a) for the vector space C together with the (C∗ )n+1 -action given by (λ0 , λ1 , . . . , λn )·µ = λa00 λa11 · · · λann µ we have M n Kp,q (Pn , b; d) = C(−a)⊕βp,a (P ,b;d) a∈Zn+1 |a|=d(p+q)+b as a Zn+1 -graded vector spaces, or equivalently as (C∗ )n+1 representations. This is referred to as the multigraded decomposition of Kp,q (Pn , b; d). We are motivated by three main questions. The most ambitious goal is to provide a full description of the Betti table of every Veronese embedding in terms of Schur modules. Question 0.1 (Schur Modules). Compute the Schur module decomposition of Kp,q (Pn , b; d). Almost nothing is known, or even conjectured, about this question, even in the case of P2 . Our most significant conjecture provides a first step towards an answer to this question. Specifically, Conjecture 6.1 proposes an explicit prediction for the Schur modules Sλ ⊆ Kp,q (Pn , b; d) with the most dominant weights. Our second question comes from Ein and Lazarsfeld’s [EL12, Conjecture 7.5] and is related to more classical questions about Green’s Np -condition for varieties [Gre84a, EL93]: Question 0.2 (Vanishing). When is Kp,q (Pn , b; d) = 0? Our Conjecture 6.1 would also imply [EL12, Conjecture 7.5], and thus it offers a new perspective on Question 0.2. Conjecture 6.1 is based on a construction of monomial syzygies, introduced in [EEL16]. Our new data suggests a surprisingly tight correspondence between the dominant weights of Kp,q (Pn , b; d) and the monomial syzygies constructed in [EEL16], and that there is much more to be understood from this simple monomial construction. Our third question is inspired by Ein, Erman, and Lazarsfeld’s conjecture that each row of these Betti tables converges to a normal distribution [EEL15, Conjecture B]. Question 0.3 (Quantitative Behavior). Fix n, q and b. (1) Can one provide any reasonable quantitative description or bounds on Kp,q (Pn , b; d), either for a fixed d or as d → ∞? (2) More specifically, does the function p 7→ dim Kp,q (Pn , b; d), when appropriately scaled, converge to a normal distribution as d → ∞? 2 ◦◦◦ ◦ ◦◦◦ ◦ ◦◦ ◦ ◦ ◦ ◦ ◦◦ ◦◦◦◦◦ ◦ ◦ ◦ ◦ ◦ ◦◦◦◦ ◦◦◦◦◦ ◦ ◦ ◦ ◦ ◦ ◦◦◦ ◦ ◦ ◦ ◦ ◦ ◦◦◦◦ Figure 1. Plots of p 7→ dim Kp,1 (0; d) for d = 4, 5, and 6 suggest that the Betti numbers of the quadratic strand of the Veronese embeddings of P2 convergence towards a normal distribution as d → ∞. d b 0 1 2 6 3 4 5 # of Relevant Largest Matrices Matrix 1, 028 596, 898 × 1, 246, 254 148 7, 345 × 9, 890 148 7, 345 × 9, 890 1, 028 596, 898 × 1, 246, 254 1, 753 4, 175, 947 × 12, 168, 528 1, 753 4, 175, 947 × 12, 168, 528 Figure 2. This table summarizes data about the matrices involved in our computations of the Veronese syzygies of P2 when d = 6. We include it here to give a hint of the scale of computation involved. See §4 for more details. We provide some of the first evidence for the normally distributed behavior conjectured in [EEL15, Conjecture B] – see Figure 1 and §6.2. Additionally we produce an array of new conjectures related to Questions 0.1 and 0.3, including conjectures on: Boij-Söderberg coefficients; the number of (disctinct) Schur modules appearing in Kp,q (Pn , b; d); and a Schur functor interpretation of the conjecture of [CCDL, §8.3]. Our conjectures are based on new experimental data about the Kp,q (P2 , b; d) that arose from large-scale, systematic computations. Taken together, these new conjectures sharpen our understanding of Veronese syzygies, and provide tangible projects to explore. We computed the Kp,q (P2 , b; d) spaces for all p, q and essentially1 all 0 ≤ b ≤ d ≤ 6, as well as the corresponding Schur module decompositions and multigraded Hilbert series. For comparison: our Macaulay2 computations did not terminate for d = 5 and b = 0; this case, including multigraded decompositions, was recently computed by [GM16]; and the case d = 6 and b = 0, including multigraded decompositions, was computed even more recently [CCDL]. The main contribution of our experimental data is thus its comprehensiveness, as we include the pushforwards of other line bundles, the Schur functor decompositions, and more. Our computation is not based on new mathematical ideas, but rather in the synthesis of known results and the coordinated execution of many elementary steps. Since Betti numbers are Tor groups, they can be computed in two ways. The standard method is to use symbolic 1Due to the ongoing nature of this experiment, the end goal is a moving target. As of the writing of this paper, a few multigraded entries for d = 6 and b = 4, 5 were still running, and a few Schur functor entries for d = 6 and b = 0, 3 were unprocessed. On the other hand, we also produced some data for d = 7, 8. 3 algebra algorithms to compute a minimal free resolution, and to derive the Betti table from this resolution [EGSS02, Chapter 2]. This method is quite computationally intensive, and does not terminate for d ≥ 5. A second method is to compute the cohomology of the Koszul complex, which reduces the computation of these Tor groups to linear algebra (see §2 below). Despite this reduction long being know we are aware of only one large-scale effort at using it to compute Betti numbers [CCDL]. This is likely because, even for relatively simple cases, the problem remains quite complicated; the matrices quickly become massive and numerous. The crux of our technique is the use of high-speed high-throughput computing to compute multigraded Betti numbers. This allows us to compute each multigraded Betti number in parellel, relying on numerical linear algebra algorithms, in particular an LU-decomposition algorithm [GMSW87]. These algorithms are numerical in nature, and so rounding errors may creep in. However, our primary interest is in the testing and development of conjectures, so we do not require the precision of symbolic computation. Moreover, as discussed in §5, we can often correct for minor errors through a post-processing step, which converts the multigraded decomposition into the Schur functor decomposition. We have made our experimental data public in several formats. This includes a public database: syzygydata.com where the results of all computations have been presented and organized. It also includes a Macaulay2 package (in preparation) that incorporates the output of all computations. Our goal is to make our data readily accessible to others in hope of spurring further work on Veronese syzygies. This paper is organized as follows. §1 provides background and notation. §2 gives an outline of our computation. This is elaborated upon in §3 – §5, as we feel it may be useful for those interested in pursuing similar large-scale distributed computations. §6 contains our main experimental results, including conjectures on dominant schur modules §6.1) evidence for the normal distribution conjecture §6.2, discussion of Boij-Söderberg coefficients §6.3, unimodality conjectures §6.4, and a discussion of the redundancy of Betti numbers §6.5. Acknowledgments First of all, we thank Rob Lazarsfeld, as he helped inspire us to pursue this project in the first place. We thank Claudiu Raicu, for advice and code related to the Schur functor computations. We thank Michael Saunders and Stephen Wright for their helpful advice on using numerical methods to perform rank computations. We also Lawrence Ein, David Eisenbud, Frank-Olaf Schreyer, Mike Stillman, and the many other people who offered suggestions about this work. This research was performed using the compute resources and assistance of the UW-Madison Center For High Throughput Computing (CHTC) in the Department of Computer Sciences [CHTC]. The CHTC is supported by UW-Madison, the Advanced Computing Initiative, the Wisconsin Alumni Research Foundation, the Wisconsin Institutes for Discovery, and the National Science Foundation, and is an active member of the Open Science Grid, which is supported by the National Science Foundation and the U.S. Department of Energy’s Office of Science. 4 1. Mathematical Background 1.1. Betti Number Notation. Notation for Betti numbers can be confusing, so we outline our notation and discuss how it relates to other common notations. Throughout S = C[x0 , x1 , . . . , xn ]. Our computations center on the case n = 2 and thus in §2–§5 we restrict to the case n = 2. Given some d ≥ 1 we let R = Sym(Sd ) be the symmetric algebra, which is a polynomial ring on dim Sd many variables. While R depends on the choice of d, we often abuse notation and omit reference to d. We use S(0; d) to denote the dth Veronese subring S (d) = ⊕i Sdi ⊆ S, and we view S(0; d) as an R-module. The ring S(0; d) is the homogeneous coordinate ring of the image of Pn n+d under d-uple embedding ι : Pn ,− → P( d )−1 . We set S(b; d) := ⊕i Sb+di , which is the graded R-module corresponding to the pushforward ι∗ OPn (b). For the standard graded structure, we set Kp,q (Pn , b; d) = Torp (S(b; d), C)p+q . Using standard Betti number notation, we have βp,p+q (Pn , b; d) = βp,p+q (S(b; d)) = dim Kp,q (Pn , b; d). The Betti table of (n, b; d) is then the table where βp,p+q (S(b; d)) is placed in the (p, q)-spot. For the multigraded structure, we write Kp,q (Pn , b; d)a = Torp (S(b; d), C)a where a ∈ Zn+1 is a multidegree. In this notation we must have that |a| = d(p + q) + b. We also use the Betti number notation βp,a (Pn , b; d) = βp,a (S(b; d)) = dim Kp,q (Pn , b; d)a . Note the standard graded Betti numbers are recoverable from the multigraded Betti numbers via the equation X βp,a (Pn , b; d). βp,p+q (Pn , b; d) = a∈Zn+1 |a|=(p+q)d+b A useful way to keep track of the multigraded Betti numbers is via the Zn+1 -graded Hilbert series. In general if M is a Zn+1 -graded module then we use HSM (t0 , t1 , . . . , tn ) to denote the multigraded Hilbert series. This is particularly convenient for encoding the multigraded structure of the multigraded vector space Kp,q (Pn , b; d), as we can write X βp,a (S(b; d))ta HSKp,q (Pn ,b;d) (t0 , t1 , . . . , tn ) = a∈Zn+1 |a|=d(p+q)+b where if a = (a0 , a1 , . . . , an ) then ta := ta00 ta11 · · · tann . Remark 1.1. Since we will only consider the case n = 2 for much of the paper, we often write Kp,q (b; d) := Kp,q (P2 , b; d). We similarly abbreviate the notation for the multigraded Betti numbers in the cases where we are working with P2 . These notions of Betti numbers, and the relations between them, are perhaps best understood through an example. Example 1.2. Consider P2 ⊆ P9 embedded by OP2 (3). The Betti table of S(0; 3) is 1 − − − − − − − − 27 105 189 189 105 27 −. − − − − − − − 1 5 Focusing on the boldfaced 27, we have K1,1 (0; 3) = C27 and β1,2 (0; 3) = 27. As a Z3 -graded vector space, K1,1 (0; 3) has 19 distinct multidegrees, which we encode via the Hilbert series t40 t21 + t30 t31 + t20 t41 + t40 t1 t2 + 2t30 t21 t2 + 2t20 t31 t2 + t0 t41 t2 + t40 t22 + 2t30 t1 t22 HSK1,1 (0;3) (t0 , t1 , t2 ) = +3t20 t21 t22 + 2t0 t31 t22 + t41 t22 + t30 t32 + 2t20 t1 t32 + 2t0 t21 t32 + t31 t32 + t20 t42 +t0 t1 t42 + t21 t42 . Thus for instance K1,1 (0; 3)(4,2,0) = C and K1,1 (0; 3)(2,2,2) = C3 . 1.2. Schur Modules and Dominant Weights. We also consider the Schur functor decomposition of Kp,q (Pn , b; d) arising from the linear action of GLn+1 (C) on S, and so briefly review the relevant notation and terminology. See [FH91] for a review of this material. If λ = (λ0 ≥ λ2 ≥ · · · ≥ λn ) is a partition of weight |λ| = λ0 + λ1 + · · · + λn we write Sλ = Sλ (Cn+1 ) for the corresponding Schur functor, which is a representation of GLn+1 (C). The Schur functor decomposition of Kp,q (Pn , b; d) can be expressed as: M n Kp,q (Pn , b; d) = Sλ (Cn+1 )⊕mp,λ (P ,b;d) , |λ|=d(p+q)+b n with the mp,λ (P , b; d) = mp,λ (n, b; d) being the Schur functor multiplicities. The Schur functor decomposition is recoverable from the multigraded Betti numbers (see Algorithm 5.1). Given λ = (λ1 , λ2 , . . . , λa ) and λ0 = (λ01 , λ02 , . . . , λ0b ) we say that λ dominates λ0 (or λ  λ0 ) if Pk Pk 0 n+1 , and given a i=1 λk for all k ≥ max{a, b}. This induces a partial order on Z i=1 λi ≥ n+1 subset W ⊂ Z we often write domWeights W for the set of dominant weights in W . Example 1.3. Consider the Schur functor decomposition of K14,1 (5; 0), which appears in Appendix 2: K14,1 (5; 0) ∼ = S(34,21,20) ⊕ S(33,25,17) ⊕ S(33,24,18) ⊕ · · · The weight (33, 24, 18) is dominated by (33, 25, 17) but is not dominated by (34, 21, 20). In this case, the two maximally dominant weights are (34, 21, 20) (33, 25, 17). 1.3. Monomial syzygies. In [EEL16], Ein, Erman, and Lazarsfeld use monomial techniques to construct nonzero elements of Kp,q (Pn , b; d) for a wide range of values of the parameters. The basic idea behind the construction is the following: First, one replaces the Veronese ring S (d) = S(0; d) by the Veronese of a quotient S(0; d) := (S/(xd0 , xd1 , . . . , xdn ))(d) . Writing Sd for the quotient vector space Sd /((xd0 , xd1 , . . . , xdn ), a standard Artinian reduction argument induces a natural isomorphism between the syzygies of S(0; d), resolved over Sym(Sd ) and the syzygies of S (d) resolved over Sym(Sd ). A similar statement holds for S(b; d), and thus to produce nonzero elements of Kp,q (Pn , b; d) it is enough to produce nonzero syzygies of S(b; d). Ein, Erman, and Lazarsfeld produce monomial syzygies via the following recipe: for some degree e let f be the lex-leading monomial of degree e that is nonzero in R. For instance, if e = d then we would take f = xd−1 0 x1 . Next, let m1 , . . . , ms be distinct monomials in R such that mi f = 0 in R for all 1 ≤ i ≤ V s. For instance, mi could be any monomial divisible by x0 . Let ζ := m1 ∧ m2 ∧ · · · ∧ ms ⊗ ∈ s Sd ⊗ Sd . Then ζ will induce a cycle in the appropriate sequence of the form (2.1). Under mild restrictions on the mi , one also shows that ζ is not a boundary, and hence it induces a nonzero element the homology group Kp,q (Pn , b; d). 6 We write Ep,q (Pn , b; d) for the vector space of monomial syzygies constructed in [EEL16]. This is a Zn+1 -graded vector space, and hence we can also discuss the dominant weights of this space, which we denote by domWeights Ep,q (Pn , b; d). 2. Overview of computational Approach For our computations, we focus on the case of P2 . The standard computational approach involves computing a minimal free resolution for M , but the complexity grows quite quickly with d. For instance d = 2, 3, 4 are easily computable in Macaulay2, but our computation did not terminate for d = 5. We take a different approach, relying on linear algebra computations to determine the Betti table. Using the Koszul complex to compute Tor-groups, we have that the vector space Kp,q (b; d) is the cohomology of the complex: (2.1) Vp+1 Sd ⊗ Sb+(q−1)d ∂p+1 Vp Sd ⊗ Sb+qd ∂p Vp−1 Sd ⊗ Sb+(q+1)d where ∂p is defined by: ∂p (m1 ∧ m2 ∧ · · · ∧ mp ⊗ f ) = p X (−1)k m1 ∧ m2 ∧ · · · ∧ m b k ∧ · · · ∧ mp ⊗ (mk f ). k=1 Since the differential respects the Z3 -multigrading, it suffices to separate (2.1) into multigraded strands. Thus for each a = (a0 , a1 , a2 ) ∈ Z3 where a0 + a1 + a2 = b + d(p + q), we have that Kp,q (b; d)a is the cohomology of (2.2) Vp+1 Sd ⊗ Sb+(q−1)d  ∂p+1,a a V ( p Sd ⊗ Sb+qd )a ∂p,a Vp−1 Sd ⊗ Sb+(q+1)d  a . This reduces computing the multigraded (or graded) Betti numbers of M to the computation of a large number of individual matrices. Note if we choose bases for the source and target consisting of monomials each ∂p,a , is represented matrices whose entries are either 0 or ±1. Example 2.3. Consider K2,2 (0; 3)(7,3,2) , which is one of the multigraded entries for the structure sheaf OP2 under the 3-uple embedding. To compute this, we first construct the matrix ∂2,(7,3,2) . We choose products of monomials for a basis on both the source and target.  V2 For instance x3 ∧ x2 y ⊗ x2 y 2 z 2 ∈ S3 ⊗ S3 (7,3,2) is a basis vector in the source. We have ∂2,(7,3,2) (x3 ∧ x2 y ⊗ x2 y 2 z 2 ) = x3 ⊗ x4 y 3 z 2 − x2 y ⊗ x5 y 2 z 2 . Working over all such monomial, we represent ∂2,(7,3,2) by a matrix 3 4 3 2 x ⊗x y z x2 y ⊗ x5 y 2 z 2   x2 z ⊗ x5 y 3 z   xy 2 ⊗ x6 y 2 z 2   x3 ∧ x2 y ⊗ x2 y 2 z 2 1 −1 0 0 .. . x3 ∧ xy 2 ⊗ x3 yz 2 1 0 0 −1 .. . 7 x 3 ∧ x2 z ⊗ x2 y 3 z 1 0 −1 0 .. . ···  ··· ···   · · · .  ···  .. . The dimension of K2,2 (0; 3)(7,3,2) is determined by the ranks and sizes of these matrices. Since ∂2,(7,3,2) has 23 columns, we have dim K2,2 (0; 3)(7,3,2) = dim ker ∂2,(7,3,2) − dim im ∂3,(7,3,2)  = 23 − rank ∂2,(7,3,2) − rank ∂3,(7,3,2) = 23 − 8 − 15 = 0. Our computational approach can be summarized as follows: (1) Precomputation: We use known vanishing results and facts about Hilbert series to reduce the number of matrices whose rank we need to compute. We also use standard duality results to focus on simpler matrices in some cases. (2) Main computation: We construct the remaining relevant matrices, and use an LUdecomposition algorithm and distributed, high throughput computations to compute the ranks of those matrices. (3) Post-processing: We assemble our data to produce the total the multigraded Betti numbers and the standard Betti numbers , and we apply a highest weight decomposition algorithm to obtain the Schur module decompositions. While the largest computational challenges come from the main computation step, the scale of our data creates some challenges in executing and coordinating the other steps. In the following sections, we describe the relevant issues in some detail. Remark 2.4. With the exception of the rank computations, all other steps are symbolic in nature. However, since we use a numerical algorithm to compute the ranks of the matrices, there is potential for numerical error in that step. See §4.2. In post-processing, we decompose the Kp,q space into Schur modules, and this can correct small numerical errors. See §5.2. 3. Precomputation 3.1. Determining the relevant range of Betti numbers. A number of the Kp,q spaces are entirely determined by combining the Z3 -graded Hilbert series with known vanishing results. The following lemma is well-known to experts, but we include for reference. Lemma 3.1. The Z3 -graded Hilbert series for S(b; d) is a rational function of the form A(t0 , t1 , t2 )/B(t0 , t1 , t2 ) where X Y A(t0 , t1 , t2 ) = (−1)p dim Kp,q (b; d)a ta and B(t0 , t1 , t2 ) = 1 − tb . p,a b∈N3 ,|b|=d Proof. Let F be the minimal free resolution of S(b; d) as a R := Sym(Sd )-module. The ring R = Sym Sd inherits a natural Z3 -grading from the Z3 -grading on Sd , and thus we can assume that F = [· · · → F1 → F0 ] is Z3 -graded. If we write Fp := ⊕a R(−a)βp,a , then we have βp,a = dim Kp,q (b; d)a . The Z3 -graded Hilbert series of R is 1/B(t0 , t1 , t2 ) and thus the Hilbert series of R(−a) is ta /B(t0 , t1 , t2 ). The desired statement then follows from additivity of Hilbert series.  8 If we fix p, b, d and |a|, then Lemma 3.1 implies that A(t0 , t1 , t2 ) entirely determines Kp,q (b; d)a , unless there are multiple values of q such that Kp,q (b; d)a 6= 0. Definition 3.2. Given b and d, we define the relevant range as the set of pairs (p, q) where Kp,q (b; d) 6= 0 and where either Kp−1,q+1 (b; d) 6= 0 or Kp+1,q−1 (b; d) 6= 0. For instance, looking at β(P2 , 0; 5) in Appendix 1, we see that the relevant range is the set {(14, 1), (15, 1), (13, 2), (14, 2)}. All other entries are determined by the Hilbert series. Since it easy to compute the Hilbert series of the modules S(b; d), it will be much easier to compute Betti numbers outside of the relevant range. For P2 the relevant range is precisely understood. See [EL12, Remark 6.5] for the Kp,0 and Kp,2 statements, and [Gre84b, Theorem 2.2] and [Gre84a, Theorem 2.c.6] for the Kp,1 statements. 3.2. Computing outside the relevant range. For values outside of the relevant range, we compute βp,a (b; d) using the Hilbert series. Recall that we must have |a| = (p + q)d + b for the space to be nonzero. The following elementary algorithm computes A(t0 , t1 , t2 ). Algorithm 3.3. Input: b, d. Output: The polynomial  A(t0 , t1 , t2 ) for S(b; d),3 as in Lemma 3.1 - N := d d+2 − 2 P1 and L :=a{a ∈ N ||a| ≡ b(mod d) and |a| ≤ N }. - C(t0 , t1 , t2 ) := a∈L dim Sa t - Let A(t0 , t1 , t2 ) be the sum of all terms of degree ≤ N in the product of C(t0 , t1 , t2 ) and B(t0 , t1 , t2 ). Proof. By Lemma 3.1 we have A(t0 , t1 , t2 ) = HSS(b;d) (t0 , t1 , t2 )B(t0 , t1 , t2 ). If we can bound the degree of A(t0 , t1 , t2 ), then we can bound the number of terms in the power series HSS(b;d) that we will need to consider. Each S(b; d) is a Cohen-Macaulay R-module and thus has  d+2 projective dimension 2 − 3. And since 0 ≤ b ≤ d, the regularity of S(b; d) is at most 2.   Thus, the largest total degree of a nonzero Betti number of S(b; d) is N = d d+2 − 1 , and 2 it follows that deg A ≤ N . By definition, C(t0 , t1 , t2 ) is the sum of all terms of degree ≤ N in the power series HSS(b;d) (t0 , t1 , t2 ).  4. Main Computation 4.1. Constructing the matrices in the relevant range. Within the relevant range we can incorporate the S3 -symmetry to restrict to multidegrees (a0 , a1 , a2 ) where a0 ≥ a1 ≥ a2 . Moreover, we can use duality for Koszul cohomology groups to further cut down the number of matrices we need to compute [Gre84a, Theorem 2.c.6]. The table in Figure 3 lists the number of matrices needed (after accounting for duality and S3 -symmetries) in the computations for various values of d and b. Remark 4.1. For testing purposes, we also computed dim Kp,q (b; d) using our rank algorithms for many (p, q) outside of the relevant range, including all Kp,q (b; d)(b; d) for d ≤ 4. In all cases, the computation gave the correct result. 9 d b 0 1 4 2 3 # of Relevant Largest Matrices Matrix 0 N/A 0 N/A 56 255 × 669 56 255 × 669 d b 0 1 5 2 3 4 # of Relevant Largest Matrices Matrix 102 2, 151 × 3, 159 0 N/A 102 2, 151 × 3, 159 424 38, 654 × 95, 760 424 38, 654 × 95, 760 Figure 3. There are no relevant matrices for d < 4. For d = 4, 5 and each b, we list the number of relevant matrices. See Figure 2 for the data when d = 6. Some lines are identical because of duality of Koszul cohomology groups. Writing out and storing each of the matrices ∂p,a is inefficient, both in terms of runtime and memory. We streamline this process by utilizing a symmetry of the matrices ∂p,a for various a. Consider the commutative diagram Vp Sd ⊗ Sqd+b Vp  ∂p / Vp−1 φp Sd ⊗ Sq(d+1)+b Sd dp /  φp−1 Vp−1 Sd where φp (m1 ∧ m2 ∧ · · · ∧ m Ppp⊗ f ) =km1 ∧ m2 ∧ · · · ∧ mp and similarly for φp−1 , and where b k ∧ · · · ∧ mp . dp (m1 ∧ m2 ∧ · · · ∧ mp ) = k=1 (−1) m1 ∧ m2 ∧ · · · ∧ m We represent ∂p and dp as matrices with respect to the basis consisting of wedge/tensor powers of all monomials. For a multidegree a, we write dp,≤a for the submatrix of dp involving basis vectors of degree ≤ a. We claim that ∂p,a equals dp,≤a V . The crucial observation is the following. For a pure tensor m1 ∧ m2 ∧ · · · ∧ mp ⊗ f ∈ p Sd ⊗ Se of degree a, the monomial f is entirely determined by the multidegree a and by the monomials m1 , m2 , . . . , mp . In other words, if we know the multidegree of a monomial pure tensor, then the ⊗Se factor is redundant information. V Example 4.2. Let S = C[x, y, z] and consider a monomial m1 ∧ m2 ⊗ f ∈ ( 2 S3 ⊗ S3 )(7,3,2) . If m1 = x3 and x2 = x2 y then f must equal x2 y 2 z 2 . We can thus compute the rank of ∂p,a by computing the rank of a submatrix of a dp . So instead of constructing and storing each ∂p,a , we simply precompute the matrix dp and then take slices corresponding to any particular multidegree. In practice, this seemed to significantly improve the runtime and memory on the construction of the matrices, though we did not track precise comparisons with a more naive construction of the matrices. Example 4.3. For d = 6, it took one hour on a standard laptop to construct the relevant matrices for all b. One of the more complicated entries, K9,0 (3; 6), required 178 distinct matrices which took up a total of 2 GB of space. While the bulk of these matrices are very small, some of the matrices can be massive. See Figure 3 and Example 4.5 for more details. 10 4.2. Sparse linear algebra. Computing the cohomology of (2.2) amounts to computing the ranks of many matrices. However, as seen in Figure 3 these matrices can be quite large. While standard (dense) matrix algorithms quickly fail to terminate, the matrices turn out to be quite sparse, as the formula for ∂p given in equation 2.1 implies that each row of ∂p,a has only p distinct entries. Example 4.4. For K8,1 (0; 5) we use 41 matrices which range in size from 23 × 144 to 22, 349 × 24, 157. For the largest these matrices, only 0.03% of the entries are nonzero. We can thus use sparse algorithms for our rank computations. Specifically, we base our rank computation on a rank revealing version of LU-factorization. Like many matrix factorizations, LU-factorization seeks to write a matrix as product of two matrices that are easier to understand. In particular, if A is an m × n matrix with m ≥ n, then an exact LU-factorization writes A as:   U11 U12 QAP = LU = L 0 0 where: • • • • • Q is an m × m permutation matrix, P is a n × n permutation matrix, L is a lower triangular matrix with unit diagonal, U11 is a non-singular r × r upper-triangular matrix, and U12 is a r × (m − r) matrix. Given such a factorization the rank of A equals the size of U11 . Since we use numerical computation, in practice we generally factor A as:   U11 U12 QAP = LU = L 0 U22 where P, Q, L, U11 , U12 are as before, and U22 is, in a sense, insignificant relative to U11 . Specifically we want the smallest singular value of U11 to be much bigger than the largest singular value of U22 . The number of non-zero singular values of A is then approximately the number of non-zero singular values of U11 i.e. the size of U11 . (For a more in-depth discussion of using LU factorizations see [GVL96, Section 3.2].) We use the MatLab interface to the LUSOL library [GMSW87, ML] to produce an LUfactorization of each matrix A := ∂p,a . The matrix U is an n × m upper triangular matrix whose diagonal entries are decreasing in size, and U11 is the sub-matrix of U on the first k columns and rows where k is the largest number such that that |Uk,k | is greater than some chosen tolerance. (Since we do not have clear data on how to appropriately chose the tolerance, we chose instead to vary the tolerance. See Remark 5.2 below.) In this way we actually compute the numerical rank of A with respect to this given tolerance. More succinctly we approximate the rank of the differential A := ∂p,a by counting the number of diagonal entries of U larger than the above tolerance. While this approach using sparse LU-factorization algorithms allows us to go beyond what is currently possible with dense matrix algorithms there are two down sides. First, while spares, our matrices tend to have very high rank (relative to their size). For instance, the matrix 11 ∂9,(19,19,19) has size 596, 898 × 1, 246, 254 and rank 596, 307. This adds to the complexity of the LU-factorization algorithm, and increases runtime and memory usage. Second, due to the threshold and the approximate nature of our factorization, our rank computations are numerical and not symbolic in nature. There is the possibility of numerical error. See §5.2 for a discussion of error, and how post-processing catches some small numerical errors. 4.3. High Throughput Computations. The rank computations can be efficiently distributed over numerous different computers. We implemented these computations using high throughput computing via HTCondor [HTC] on both the University of Wisconsin-Madison campus computing pool [CHTC] and on the Open Science Grid [OSG]. In addition, since some of those rank computations require substantial RAM, we make use of University of Wisconsin-Madison’s High Throughput Computing cluster to manage our computations. We do not a priori know the RAM and time required for individual matrix computations. We thus start by submitting jobs with LUSOL’s default memory allocation. For the jobs that fail, we increase the memory allocation and resubmit. We iterate this process until the computation terminates. This approach works well with our data, as the bulk of of the matrices terminate with very little RAM. However, for some computations, the memory required exceeds 250 GB of RAM, and our hardware grid has a small number of nodes with this much RAM available. These largest computations can take days to complete Example 4.5. One of our larger computations was for the Betti number K9,0 (3; 6). After accounting for symmetries, the computation involved 178 distinct matrices, the largest of which was 596, 898 × 1, 246, 254. For the matrices, the RAM and time used were: • • • • 80% used < 1 GB RAM, taking < 1 minute on average, with a max of 18 minutes. 9% used 1-10 GB RAM, taking 13 minutes on average, with a max of 40 minutes. 10% 10-100 GB RAM, taking 5 hours on average, with a max of 15 hours. The remaining two matrices each used 450 GB RAM. One took 27 hours and the other took 49 hours. 5. Post-processing the Data 5.1. Betti numbers and Schur module decompositions. Finally, we assemble and postprocess the data. Obtaining the multigraded Betti numbers and the total Betti numbers is simple. For the multigraded and total Betti numbers, we have X βp,a (b; d) = rank(ker ∂p,a ) − rank(∂p+1,a ) and βp,p+q (b; d) = βp,a (b; d) a∈Zn+1 |a|=(p+q)d+b respectively. We determine the Schur module decomposition via the highest weight greedy algorithm below. For a polynomial P we write lex(P ) for the lex-leading monomial of P . Algorithm 5.1 (Schur Module Decomposition). 12 Input: βp,a (b; d) for fixed b, d, p and all a with |a| = (p + q)d + b. Output: A list K of the partitions appearing in the Schur module decomposition of Kp,q (b; d), with multiplicity. P - L := {a||a| = (p + q)d + b} and H = a∈L βp,a (b; d) · ta . - K = {}. - While the coefficient of lex(H) > 0 do: - Let λ = (λ1 , λ2 , λ3 ) be the weight of the lex-leading monomial in H. - Let K = K ∪ {λ}. - Let H equal H minus the multigraded Hilbert series of the Schur module Sλ (C3 ). - Return K. 5.2. Numerical Error. With the exception of the computation of the multigraded Betti numbers all other steps in our computation are symbolic. However, as we use numerical methods for the rank computations there is a chance for errors to appear in the multigraded Betti numbers. We can sometimes detect and correct numerical errors when we apply Algorithm 5.1. Since the Kp,q (b; d) spaces are GL3 -representations, each space must decompose as a direct sum of a much smaller number of Schur modules. Since the numerical errors tend to arise in the larger matrices, which tend to involve the most balanced weights, the greedy algorithm outlined in Algorithm 5.1 still sometimes suggests a “best fit Schur decomposition” for our multigraded data. For all cases with d ≤ 5, there appear to have been no numerical errors.2 With d = 6: there appear to be no numerical errors for b = 1, 2; there do appear to be some numerical errors for b = 0, 3 and we are continuing to process those results; and we are still awaiting the complete results for b = 4, 5, but we expect to find numerical errors in those cases as well. We believe that finding a more robust “best fit Schur decompose” algorithm will be crucial for extending our computation beyond d = 6. Remark 5.2. In a different direction, we also vary the tolerance in our computation as a way of understanding these numerical errors. For many of the rank computations, we actually perform an array of computations with various different values for the tolerance. This enables us to look over the data to see if a rank value is stable with respect to an array of tolerance values, as that would increase our confidence in the result. Moreover, we hope that this data will provide a foundation for predicting appropriate tolerance values, and thus improving the algorithm in the future. At the moment, this remains largely speculative. 6. Conjectures In this section, we summarize several conjectures and observations derived by combining our data with other known results. 2Interestingly, earlier computations where we used a QR-decomposition algorithm seem to have produced minor numerical errors in a small number of multigraded Betti numbers for d = 5. 13 6.1. Dominant Schur Modules. The most efficient way to encode the structure of the Betti tables of Veroneses is via the Schur functor description, as this encapsulates and encodes the essential symmetries of these Betti tables. We thus begin by focusing on Question 0.1. When analyzing a representation of GLn , the first layer is, in a sense, given by the dominant weight representations that appear in the decomposition. Our data led us to a conjecture about these dominant weight representations. This can be viewed as a first approximation of an answer to Question 0.1. Moreover, our proposed answer sharpens Ein and Lazarsfeld’s Vanishing Conjecture for Veronese syzygies [EL12, Conjecture 7.5], and it suggests a strong uniformity among the syzygies arising in each row of the Betti table. In §1 above we reviewed the monomial syzygy construction from [EEL16]. While the monomial syzygies Ep,q (Pn , b; d) represent only a small fraction of the total syzygies, they are conjecturally sufficient to give sharp vanishing/nonvanishing bounds [EEL16, Remark 2.8]. In other words, Ein and Lazarsfeld’s conjecture on vanishing says that Ep,q (Pn , b; d) 6= 0 ⇐⇒ Kp,q (Pn , b; d) 6= 0. We conjecture that these monomial syzygies not only control the (non)vanishing of the Kp,q (b; d), but they also determine the most dominant Schur module weights. Conjecture 6.1. For all n, d, b, p and q, we have: domWeights Ep,q (Pn , b; d) = domWeights Kp,q (Pn , b; d). We underscore the counterintuitive nature of the conjecture. We see no obvious reason why monomial syzygies should determine the vanishing/nonvanishing question, let alone why they would provide a full description of the dominant weights. But Conjecture 6.1, which was discovered primarily through our experimental data, suggests that these simple monomial syzygies are deeply connected to the Schur module structure of the Kp,q spaces. Example 6.2. The space K2,1 (0; 4) is the direct sum of 9 distinct Schur modules, each with multiplicity one. There are two dominant weight Schur modules: S(9,2,1) and S(8,4,0) . These are naturally in bijection with the two dominant weight monomial syzygies from E2,1 (0; 4): x30 x1 ∧ x30 x2 ⊗ x30 x1 and x30 x1 ∧ x20 x21 ⊗ x30 x1 . The conjecture also suggests a mysterious uniformity among all of the Kp,q (Pn , b; d) lying in a single row of a Betti table. Namely, if we vary only p, then the monomial syzygies constructed in [EEL16] naturally form a graded lattice, with a unique maximal and minimal element. In other words, is is natural to think of the entire qth row as a single object M K•,q (Pn , b; d) := Kp,q (Pn , b; d) p and to ask whether this vector space is a representation (or even an irreducible representation) over a larger group. Precisely such a phenomenon occurs when d = 2 by [Sam14]. Example 6.3. Consider K•,1 (P2 , 0; 3), which corresponds to the first row of the Betti table in Example 1.2. The most dominant weights of Kp,1 (P2 , 0; 3) are in bijection with the weights 14 of the monomial syzygies in the pth row of the following lattice: x2 y ⊗ x2 y x2 y ∧ xy 2 ⊗ x2 y x2 y ∧ x2 z ⊗ x2 y x2 y ∧ xy 2 ∧ x2 z ⊗ x2 y x2 y ∧ xy 2 ∧ x2 z ∧ xyz ⊗ x2 y x2 y ∧ xy 2 ∧ x2 z ∧ xyz ∧ y 2 z ⊗ x2 y x2 y ∧ xy 2 ∧ x2 z ∧ xyz ∧ xz 2 ⊗ x2 y x2 y ∧ xy 2 ∧ x2 z ∧ xyz ∧ y 2 z ∧ xz 2 ⊗ x2 y We have confirmed Conjecture 6.1 even in some cases where a full computation of the Kp,q is infeasible. Our rank computations of ∂p,a take the longest when a is highly balanced, e.g. a = (12, 11, 10). By contrast, Conjecture 6.1 addresses the most dominant – and thus most unbalanced – weights. The parallel nature of our computational techniques thus enabled us to verify Conjecture 6.1 in some cases when d = 7. In all of the examples we have computed, the multiplicities of the dominant weight Schur modules is always one. It would be interesting to know whether this always holds. Question 6.4. Let λ ∈ domWeights Kp,q (Pn , b; d). Does the representation Sλ (Cn+1 ) appear in Kp,q (Pn , b; d) with multiplicity one? Related to Conjecture 6.1 and Question 0.1, we propose the following vague question: Question 6.5. Find a compelling combinatorial description of the set domWeights Kp,q (Pn , b; d). A closely related conjecture based on the data is that the last nonzero Kp,1 (0; d) space is a particular irreducible Schur module.  Conjecture 6.6. Let p := d · d+1 , and let 2     d+2 d+1 2 1 (a, b, c) = − 1 , 6 d(d + 5) , 3 − 1 . 3 We have Kp,p+1 (P2 , 0; d) ∼ = S(a,b,c) . This provides a Schur functor analogue of the corresponding conjecture from [CCDL, §8.3]. Note that the specific value of p is the maximum value where Kp,p+1 (0; d) 6= 0. 6.2. Normal Distribution. In [EEL15] the authors show that a “randomly” chosen Betti table converges (up to some rescaling function) to a binomial distribution, which then in turn converges to a normal distribution via the law of large numbers. This led to the conjecture that for Veronese embeddings, a plot of Betti numbers in any row of the Betti should converge, after rescaling, to a normal distribution. 15 Normal Q-Q Plot 8 6 Sample Quantiles 0 0 2 2 4 4 Sample Quantiles 6 10 12 8 14 Normal Q-Q Plot -4 -2 0 2 -4 4 -2 0 2 4 Theoretical Quantiles Theoretical Quantiles Figure 4. These Q-Q plots are based on the Betti numbers in the first row of the Betti diagram of OP2 with respect to the d = 5 (on the left) and d = 6 embeddings. They suggest a normal distribution, as in [EEL15, Conjecture B]. In order to test this conjecture it is useful to define what we call the Betti distribution for (q, b, d). Fixing b, d, and q, we consider the function p 7→ C dim ·Kp+c,q (b; d) where C ∈ Q is the appropriate constant so that this is a discrete probability distribution and c ∈ Z is such that the first non-zero value occurs when p = 0. We then can compare these distributions to others in hopes of shedding light on the normality conjecture. One way to compare our data to a normal distribution is by creating a quantile-quantile (or Q-Q) plot. Specifically, having fixed q, b, and d we consider the Q-Q plot comparing the Betti distribution for (q, b, d) to the normal distribution of best fit. If these two distributions were approximately the same we would expect the points in the Q-Q plot to be roughly distributed along the line y = x. Our resulting plots provide mild, but limited, evidence for the conjecture. Examining these Q-Q plots in further detail it seems that noise in the tails of the rows often muddies plots. In light of this – and as the tails of the row are unlikely to effect any form of convergence to a normal distribution – we also performed the above procedure after truncating the first few and last entries of each row. These plots appear in Figure 4 and provide the first computational evidence for [EEL15, Conjecture B] for any variety of dimension > 1. These graphics not only support [EEL15, Conjecture B], but they suggest that the normally distributed might kick even for modest values of d. 6.3. Boij-Söderberg coefficients. Boij-Söderberg theory shows that the Betti table of any graded module can be decomposed as a positive rational sum of certain building blocks known as pure diagrams. The first proof of the main result appears in [ES09, Theorem 0.2], and [Flø12] provides an expository treatment of the theory, including definitions of the relevant terms. As a consequence of Boij-Söderberg theory, we can study the rational coefficients that arise in this decomposition. 16 To get coefficients that are well-defined, we need to choose a basis for the pure diagrams πd . Given a degree sequence d = (d0 , d1 , . . . , dr ) we set πd as the Betti table (with rational entries) where (Q 1 if j = di i6=j |di −dj | βi,j (πd ) := 0 if j 6= di . For instance 1 π(0,2,3) = 6 − − − 1 2  1 3 Then for any graded module M over a polynomial ring, there exists a chain of degree sequences CM such that we can uniquely write X β(M ) = ad πd with ad ∈ Q>0 . d∈CM See for instance [Flø12, Theorem 5.1] for a discussion of these decompositions and their uniqueness properties. We define the Boij-Söderberg coefficents of M as the sequence (ad )d∈CM . Example 6.7. Let  1 − β(S/I) =  − − S = Q[x, y, z] and I = hx2 , xy, y 4 i. Then we have the decomposition   1  1  1 − − − − − − − − 10 6 20 1 1 1      2 1  = 3 · − 2 3  + 3 ·  − 6 −  + 4 ·  − − − − − − − − −  − − − − − 1 1 1 − − − − 14 15 − − 15 and thus the Boij-Söderberg coefficients of S/I are (3, 3, 4). In [EEL15, §3], the Boij-Söderberg coefficients of Veronese varieties are shown to be closely connected to the conjectural “normal distribution” property discussed in the previous section, and thus Question 0.3 naturally raises the following question: Question 6.8. For fixed b and d → ∞, how do the Boij-Söderberg coefficients behave? The limited data we have gathered suggests that the Boij-Söderberg coefficients are unlikely to be evenly or sporadically distributed; see Example 6.10 and Figure 5. In fact, we conjecture: Conjecture 6.9. For any b, d, the Boij-Söderberg coefficients of β(P2 , b; d) are unimodal. We restrict this conjecture to P2 because more complicated overlaps between rows will arise for Pn with n ≥ 3 and d  0, and our data is insufficient to shed light on that. One can sharpen Question 6.8 in other ways: does one of the coefficients dominate, as in [Erm15]? Under appropriate rescaling, will the coefficients converge to a reasonable function in the limit? Example 6.10. We compute the Betti table β(P2 , 3; 5) to be 17 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ Figure 5. We plot the Boij-Söderberg coefficients of: OP2 (3) under the embedding by d = 5 (on the left) and OP2 under the embedding by d = 6 (on the right). See also Example 6.10. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 165 1260 5865 18360 39900 58695 49419 12870 2002 . . . . . . . . . . . . . 120 1575 9639 52650 172172 291720 338130 291720 192780 97920 37740 10710 2115 260 15 . . . . . . . . . . . . . . . . . . . The Boij-Söderberg coefficients are massive. For instance, the first coefficient is 2636271525888000. To make the coefficients more reasonable, we rescale by 10−16 and round off, yielding the sequence of (rescaled) Boij-Söderberg coefficients (.263627 , 1.5441 , 8.05149 , 4.52584 , 1.04027 , .455071 , .125537) Thes are plotted on the left in Figure 5. 6.4. Unimodality. Many natural statistics associated to the syzygies of Veronese embeddings appear to always behave unimodally. This leads us to propose the following question. Question 6.11. Fix d, n, b and q. When is each of the following a unimodal function of p? (1) (2) (3) (4) (5) The The The The The rank of Kp,q (Pn , b; d); number of distinct irreducible Schur modules appearing in Kp,q (Pn , b; d); total number of irreducible Schur modules appearing in Kp,q (Pn , b; d); largest multiplicity of a Schur module in Kp,q (Pn , b; d); number of dominant weights in Kp,q (Pn , b; d). The data suggests that these functions are nearly always unimodal. This would not be surprising, especially in light of the conjectural normally distributed behavior of the Betti numbers. However, proving unimodality of one of the above functions might be a more tractable first step towards Question 0.3. Remark 6.12. In Question 6.11(5) unimodality fails for d = 3 and b = 0. See Example 6.3. This is the only known failure of unimodality that we are aware of. Example 6.13. On P2 , we consider the case b = 2 and d = 4 and q = 0. See Appendix 1 for the Betti table. The rank of Kp,0 (P2 , 2; 4) is (6, 62, 276, 660, 825, 252) for 0 ≤ p ≤ 5, and the 18 4 2000 # dominant weights in Kp,1 (2; 5) # Schur modules in Kp,1 (2; 5) 0 0 3 p 17 3 p 17 Figure 6. The left plots the number of Schur modules (with multiplicity) in Kp,1 (P2 , 2; 5) for 3 ≤ p ≤ 17. The right plots the number of dominant weights for the same input. Both plots are unimodal, as suggested in Question 6.11. rank is 0 for other values of p. The number of irreducible Schur modules (with multiplicity) in Kp,0 (P2 , 2; 4) is (1, 2, 7, 12, 13, 5) for 0 ≤ p ≤ 5. Example 6.14. On P2 we consider the case b = 2 and d = 5 and q = 0. The number of irreducible Schur modules (with multiplicity) for Kp,0 (P2 , 2; 5) is plotted in Figure 6.14. The number of dominant weights in Kp,0 (P2 , 2; 5) is (1, 2, 2, 3, 3, 3, 4, 3, 3, 3, 3, 3, 2, 2, 1), and is also plotted in Figure 6.14. 6.5. Redundancy. The following question was first posed to us, in various forms, by Eisenbud, Lazarsfeld, and Raicu. We focus on the case of P2 for simplicity. Question 6.15. Fix b and let d  0. Are most syzygies of OP2 (b) under the d-uple embedding determined by the Hilbert series? Or are most syzygies irrelevant to the Hilbert series? More precisely, for which  > 0 and d  0 can we find some (p, q) where 1− dim Kp,q (P2 ,b;d) dim Kp−1,q+1 (P2 ,b;d) < ? Our data does not provide a clear indication of what to expect for this question. For d = 4, the entry with the highest proportion of “redundant” syzygies comes in the case b = 2, where we have K5,0 (2; 4) = 252 and K4,1 (2; 4) = 450 and 1− dim K5,0 (P2 ,2;4) dim K4,1 (P2 ,2;4) = 0.44. For d = 5 and d = 6, the most redundant entries also occur for b = 2 and (p, q) = (5, 0). In dim K5,0 (P2 ,2;5) the case d = 5 we have 1 − dim ≈ 0.59, and for d = 6 the corresponding value is K5,1 (P2 ,2;5) ≈ 0.57. It would be interesting to better understand what is possible in the limit as d → ∞. One could also questions about redundancy of multigraded Betti numbers or of Schur functors. For instance, a folklore question had been to produce an example where redundant Schur modules appear. For b = 0, we find that first case arises when d = 5, where both K14,1 (0; 5) and K13,2 (0; 5) have a copy of S(30,25,20) . Question 6.16. Do such redundant Schur modules appear frequently or only sporadically? 19 Example 6.17. For all d ≤ 5 and all 0 ≤ b < 4, the only redundant Schur modules that arise are S(30,25,20) which arises in both K14,1 (0; 5) and K13,2 (0; 5); S(30,24,21) which arises in both K14,1 (0; 5) and K13,2 (0; 5); and the dual examples for b = 3. References [CCDL] Wouter Castryck, Filip Cools, Jeroen Demeyer, and Alexander Lemmens, Computing graded Betti tables of toric surfaces. arXiv:1606.08181. [CHTC] Center for High Throughput Computing. Information at http://chtc.cs.wisc.edu/. [EEL15] Lawrence Ein, Daniel Erman, and Robert Lazarsfeld, Asymptotics of random Betti tables, J. Reine Angew. Math. 702 (2015), 55–75. , A quick proof of nonvanishing for asymptotic syzygies, Algebr. Geom. 3 (2016), no. 2, [EEL16] 211–222. [EL93] Lawrence Ein and Robert Lazarsfeld, Syzygies and Koszul cohomology of smooth projective varieties of arbitrary dimension, Invent. Math. 111 (1993), no. 1, 51–67. , Asymptotic syzygies of algebraic varieties, Invent. Math. 190 (2012), no. 3, 603–646. [EL12] [EGSS02] David Eisenbud, Daniel R. Grayson, Michael Stillman, and Bernd Sturmfels (eds.), Computations in algebraic geometry with Macaulay 2, Algorithms and Computation in Mathematics, vol. 8, Springer-Verlag, Berlin, 2002. [ES09] David Eisenbud and Frank-Olaf Schreyer, Betti numbers of graded modules and cohomology of vector bundles, J. Amer. Math. Soc. 22 (2009), no. 3, 859–888. [Erm15] D. Erman, The Betti table of a high-degree curve is asymptotically pure, Recent advances in algebraic geometry, London Math. Soc. Lecture Note Ser., vol. 417, Cambridge Univ. Press, Cambridge, 2015, pp. 200–206. [Flø12] Gunnar Fløystad, Boij-Söderberg theory: introduction and survey, Progress in commutative algebra 1, de Gruyter, Berlin, 2012, pp. 1–54. [FH91] William Fulton and Joe Harris, Representation theory, Graduate Texts in Mathematics, vol. 129, Springer-Verlag, New York, 1991. A first course; Readings in Mathematics. [GMSW87] Philip E. Gill, Walter Murray, Michael A. Saunders, and Margaret H. Wright, Maintaining LU factors of a general sparse matrix, Linear Algebra Appl. 88/89 (1987), 239–270. [GVL96] Gene H. Golub and Charles F. Van Loan, Matrix computations, 3rd ed., Johns Hopkins Studies in the Mathematical Sciences, Johns Hopkins University Press, Baltimore, MD, 1996. [Gre84a] Mark L. Green, Koszul cohomology and the geometry of projective varieties, J. Differential Geom. 19 (1984), no. 1, 125–171. [Gre84b] , Koszul cohomology and the geometry of projective varieties. II, J. Differential Geom. 20 (1984), no. 1, 279–289. [GM16] Ornella Greco and Ivan Martino, Syzygies of the Veronese modules, Comm. Algebra 44 (2016), no. 9, 3890–3906. [GE96] Ming Gu and Stanley C. Eisenstat, Efficient algorithms for computing a strong rank-revealing QR factorization, SIAM J. Sci. Comput. 17 (1996), no. 4, 848–869. [HTC] Computer Sciences Department HTCondor Team University of Wisconsin-Madison, HTCondor, open source distributed computing software. Information at https://research.cs.wisc.edu/ htcondor/. [M2] Daniel R. Grayson and Michael E. Stillman, Macaulay 2, a software system for research in algebraic geometry. Available at http://www.math.uiuc.edu/Macaulay2/. [ML] MATLAB, version 7.10.0 (R2010a), The MathWorks Inc., Natick, Massachusetts, 2010. [OSG] Open Science Grid. Information at https://www.opensciencegrid.org/. [Sam14] Steven V Sam, Derived supersymmetries of determinantal varieties, J. Commut. Algebra 6 (2014), no. 2, 261–286. [TTL05] Douglas Thain, Todd Tannenbaum, and Miron Livny, Distributed computing in practice: the Condor experience., Concurrency - Practice and Experience 17 (2005), no. 2-4, 323-356. 20 21 0 1 2 3 4 5 6 7 8 9 10 11 12 10 114 588 1804 3630 4950 4488 2376 450 55 . . . β(2, 3; 4) = . . . . . . . 252 825 660 276 62 6 . . . . . . . . . . . . . 0 1 2 3 4 5 6 7 8 9 10 11 12 6 62 276 660 825 252 . . . . . . . β(2, 2; 4) = . . . 55 450 2376 4488 4950 3630 1804 588 114 10 . . . . . . . . . . . . . 0 1 2 3 4 5 6 7 8 9 10 11 12 3 24 55 . . . . . . . . . . β(2, 1; 4) = . . 120 1089 3344 6237 7920 7095 4488 1947 536 75 . . . . . . . . . . . . . 1 0 1 2 3 4 5 6 7 8 9 10 11 12 1 . . . . . . . . . . . . β(2, 0; 4) = . 75 536 1947 4488 7095 7920 6237 3344 1089 120 . . . . . . . . . . . . 55 24 3 Here we include the Betti tables for n = 2, d = 4, 5, and 0 ≤ b ≤ d. Additional data such as multigraded Betti numbers, and further examples is available at syzygydata.com. Appendix 1: Total Betti Numbers 22 β(2, 4; 5) = β(2, 3; 5) = β(2, 2; 5) = 165 . . 1 260 . . . . 0 15 . . . . 10 . . 1 90 6 . . 1 . . 0 35 3 . . 1 165 . 0 . 1 0 β(2, 1; 5) = β(2, 0; 5) = 1 0 2 . . 2115 2 . . 3 . . . . . 4 . . 5 . . . 37740 4 120 . . 5 . . 5 . . 97920 . 1575 39900 5 . 6 . 6 . . 6 . . 192780 . 9639 58695 6 . 7 . 7 . 7 7 . . . . 8 . 8 12870 . 8 . . . . 9 . 9 2002 . 9 2002 . . 10 . . . . 10 10 . . . . 11 11 . 49419 . 12 . 12 . . 12 12 . 58695 9639 . 192780 . . 13 . 13 . 97920 . 13 . 39900 1575 13 . 97920 . 13 . . 14 . 29988 . 14 . 18360 120 14 . 37740 . 14 . . 15 . 5865 . 15 2160 375 . 15 . 5865 . 15 . 10710 . 15 . 10710 4200 4858 . 14 41616 2002 39780 117300 231540 . 12 . 134640 250920 52650 . 291720 12870 . . 11 . 417690 11 172172 . 338130 . . 11 291720 417690 590070 10 291720 . . 10 464100 548080 661232 . 9 291720 338130 . . 9 568854 568854 590070 . 8 172172 291720 . 52650 49419 . . 8 548080 464100 417690 . 7 . 417690 291720 231540 . 6 . 250920 134640 97920 2002 18360 4 . 5 117300 39780 29988 . 4 4858 10710 3 . . . 4 41616 4200 5865 375 3 5865 . 3 . 10710 . 3 2160 1260 . . 595 2 . 405 120 2 . 1830 . 2 . 1260 . 16 . 2115 . 16 . 1830 . 16 120 405 . 16 595 . . 16 . 165 . 17 . 260 . 17 . 165 . 17 35 . . 17 90 . . 17 . 10 . 18 . 15 . 18 1 . . 18 3 . . 18 6 . . 18 Appendix 2: Schur Module Decompositions Here we include the Schur module decomposition of Kp,q (5, 0) and Kp,q (5, 3) for all (p, q) in the relevant range. The dominant Schur modules are colored in red. Complete Schur module decompositions for the remainder of the computed examples is available at syzygydata.com. K14,1 (5; 0) ∼ = S(34,21,20) ⊕ S(33,25,17) ⊕ S(33,24,18) ⊕ S(33,23,19) ⊕ S(33,22,20) ⊕ S(32,25,18) ⊕ S(32,24,19) ⊕ S(32,23,20) ⊕ S(32,22,21) ⊕ S(31,25,19) ⊕ S(31,24,20) ⊕ S(31,23,21) ⊕ S(30,25,20) ⊕ S(30,24,21) ⊕ S(29,25,21) K15,1 (5; 0) ∼ = S(34,25,21) K13,2 (5; 0) ∼ = S(30,30,15) ⊕ S(30,28,17) ⊕ S(30,27,18) ⊕ S(30,26,19) ⊕ S(30,25,20) ⊕ S(30,24,21) ⊕ S(29,26,20) ⊕ S(29,24,22) ⊕ S(28,28,19) ⊕ S(28,27,20) ⊕ S2(28,26,21) ⊕ S(28,25,22) ⊕ S(28,24,23) ⊕ S(27,26,22) ⊕ S(27,24,24) ⊕ S(26,26,23) K14,2 (5; 0) ∼ = S(32,30,18) ⊕ S2(32,28,20) ⊕ S(32,27,21) ⊕ S2(32,26,22) ⊕ S2(32,24,24) ⊕ S(31,30,19) ⊕ S(31,29,20) ⊕ S2(31,28,21) ⊕ S2(31,27,22) ⊕ S2(31,26,23) ⊕ S(31,25,24) ⊕ S(30,30,20) ⊕ S(30,29,21) ⊕ S3(30,28,22) ⊕ S2(30,27,23) ⊕ S3(30,26,24) ⊕ S2(29,28,23) ⊕ S2(29,27,24) ⊕ S(29,26,25) ⊕ S2(28,28,24) ⊕ S(28,27,25) ⊕ S(28,26,26) K5,0 (5; 3) ∼ = S(20,4,4) ⊕ S(19,7,2) ⊕ S(19,6,3) ⊕ S(19,5,4) ⊕ S(18,8,2) ⊕ S2(18,7,3) ⊕ S3(18,6,4) ⊕ S2(17,9,2) ⊕ S4(17,8,3) ⊕ S6(17,7,4) ⊕ S3(17,6,5) ⊕ S2(16,10,2) ⊕ S5(16,9,3) ⊕ S9(16,8,4) ⊕ S6(16,7,5) ⊕ S4(16,6,6) ⊕ S3(15,11,2) 11 8 5 11 12 ⊕ S6(15,10,3) ⊕ S10 (15,9,4) ⊕ S(15,8,5) ⊕ S(15,7,6) ⊕ S(14,12,2) ⊕ S(14,11,3) ⊕ S(14,10,4) ⊕ S(14,9,5) 8 12 13 9 4 3 ⊕ S13 (14,8,6) ⊕ S(14,7,7) ⊕ S(13,13,2) ⊕ S(13,12,3) ⊕ S(13,11,4) ⊕ S(13,10,5) ⊕ S(13,9,6) ⊕ S(13,8,7) 9 5 4 7 4 ⊕ S3(12,12,4) ⊕ S7(12,11,5) ⊕ S12 (12,10,6) ⊕ S(12,9,7) ⊕ S(12,8,8) ⊕ S(11,11,6) ⊕ S(11,10,7) ⊕ S(11,9,8) ⊕ S3(10,10,8) ⊕ S(10,9,9) K6,0 (5; 3) ∼ = S(22,7,4) ⊕ S(21,9,3) ⊕ S(21,8,4) ⊕ S2(21,7,5) ⊕ S3(20,9,4) ⊕ S3(20,8,5) ⊕ S2(20,7,6) ⊕ S2(19,11,3) ⊕ S4(19,10,4) 6 ⊕ S7(19,9,5) ⊕ S5(19,8,6) ⊕ S4(19,7,7) ⊕ S(18,12,3) ⊕ S5(18,11,4) ⊕ S7(18,10,5) ⊕ S10 (18,9,6) ⊕ S(18,8,7) 14 4 5 8 12 ⊕ S2(17,13,3) ⊕ S5(17,12,4) ⊕ S12 (17,11,5) ⊕ S(17,10,6) ⊕ S(17,9,7) ⊕ S(17,8,8) ⊕ S(16,13,4) ⊕ S(16,12,5) 15 10 2 2 9 13 19 ⊕ S15 (16,11,6) ⊕ S(16,10,7) ⊕ S(16,9,8) ⊕ S(15,15,3) ⊕ S(15,14,4) ⊕ S(15,13,5) ⊕ S(15,12,6) ⊕ S(15,11,7) 8 7 11 15 8 8 ⊕ S13 (15,10,8) ⊕ S(15,9,9) ⊕ S(14,14,5) ⊕ S(14,13,6) ⊕ S(14,12,7) ⊕ S(14,11,8) ⊕ S(14,10,9) ⊕ S(13,13,7) 3 3 3 2 ⊕ S8(13,12,8) ⊕ S11 (13,11,9) ⊕ S(13,10,10) ⊕ S(12,12,9) ⊕ S(12,11,10) ⊕ S(11,11,11) K7,0 (5; 3) ∼ = S(24,9,5) ⊕ S(24,7,7) ⊕ S(23,10,5) ⊕ S(23,9,6) ⊕ S(23,8,7) ⊕ S2(22,11,5) ⊕ S2(22,10,6) ⊕ S4(22,9,7) ⊕ S2(21,12,5) ⊕ S3(21,11,6) ⊕ S5(21,10,7) ⊕ S4(21,9,8) ⊕ S3(20,13,5) ⊕ S4(20,12,6) ⊕ S8(20,11,7) ⊕ S5(20,10,8) ⊕ S5(20,9,9) 7 2 4 10 ⊕ S2(19,14,5) ⊕ S5(19,13,6) ⊕ S9(19,12,7) ⊕ S10 (19,11,8) ⊕ S(19,10,9) ⊕ S(18,15,5) ⊕ S(18,14,6) ⊕ S(18,13,7) 12 2 3 8 12 13 ⊕ S10 (18,12,8) ⊕ S(18,11,9) ⊕ S(18,10,10) ⊕ S(17,16,5) ⊕ S(17,15,6) ⊕ S(17,14,7) ⊕ S(17,13,8) ⊕ S(17,12,9) 8 6 4 ⊕ S8(17,11,10) ⊕ S(16,16,6) ⊕ S5(16,15,7) ⊕ S7(16,14,8) ⊕ S13 (16,13,9) ⊕ S(16,12,10) ⊕ S(16,11,11) ⊕ S(15,15,8) ⊕ S7(15,14,9) ⊕ S9(15,13,10) ⊕ S6(15,12,11) ⊕ S2(14,14,10) ⊕ S5(14,13,11) ⊕ S6(14,12,12) ⊕ S20 (13,13,12) 23 K8,0 (5; 3) ∼ = S(26,10,7) ⊕ S(25,10,8) ⊕ S(24,12,7) ⊕ S(24,11,8) ⊕ S2(24,10,9) ⊕ S(23,12,8) ⊕ S(23,11,9) ⊕ S2(23,10,10) ⊕ S(22,14,7) ⊕ S(22,13,8) ⊕ S3(22,12,9) ⊕ S2(22,11,10) ⊕ S(21,14,8) ⊕ S(21,13,9) ⊕ S3(21,12,10) ⊕ S(20,16,7) ⊕ S(20,15,8) ⊕ S3(20,14,9) ⊕ S3(20,13,10) ⊕ S2(20,12,11) ⊕ S(19,16,8) ⊕ S(19,15,9) ⊕ S3(19,14,10) ⊕ S(19,13,11) ⊕ S2(19,12,12) ⊕ S(18,18,7) ⊕ S(18,17,8) ⊕ S3(18,16,9) ⊕ S3(18,15,10) ⊕ S3(18,14,11) ⊕ S2(18,13,12) ⊕ S2(17,16,10) ⊕ S(17,15,11) ⊕ S3(17,14,12) ⊕ S2(16,16,11) ⊕ S2(16,15,12) ⊕ S2(16,14,13) ⊕ S(15,14,14) K9,0 (5; 3) ∼ = S(28,10,10) ⊕ S(26,12,10) ⊕ S(24,14,10) ⊕ S(24,12,12) ⊕ S(22,16,10) ⊕ S(22,14,12) ⊕ S(20,18,10) ⊕ S(20,16,12) ⊕ S(20,14,14) ⊕ S(18,18,12) ⊕ S(18,16,14) ⊕ S(16,16,16) K4,1 (5; 3) ∼ = S(14,14,0) K5,1 (5; 3) ∼ = S(18,14,1) ⊕ S(17,14,2) ⊕ S(16,14,3) ⊕ S(15,14,4) ⊕ S(14,14,5) K6,1 (5; 3) ∼ = S(21,15,2) ⊕ S(21,14,3) ⊕ S(20,15,3) ⊕ S(20,14,4) ⊕ S(19,17,2) ⊕ S(19,16,3) ⊕ S2(19,15,4) ⊕ S2(19,14,5) ⊕ S(18,17,3) ⊕ S(18,16,4) ⊕ S2(18,15,5) ⊕ S2(18,14,6) ⊕ S(17,17,4) ⊕ S(17,16,5) ⊕ S2(17,15,6) ⊕ S2(17,14,7) ⊕ S(16,15,7) ⊕ S(16,14,8) ⊕ S(15,15,8) ⊕ S(15,14,9) ⊕ S5(14,12,12) ⊕ S18 (13,13,12) K7,1 (5; 3) ∼ = S(24,15,4) ⊕ S(23,17,3) ⊕ S(23,16,4) ⊕ S3(23,15,5) ⊕ S(23,14,6) ⊕ S(23,13,7) ⊕ S(23,11,9) ⊕ S2(22,17,4) ⊕ S2(22,16,5) ⊕ S4(22,15,6) ⊕ S2(22,14,7) ⊕ S(22,13,8) ⊕ S(22,12,9) ⊕ S(22,11,10) ⊕ S(21,19,3) ⊕ S2(21,18,4) ⊕ S5(21,17,5) ⊕ S5(21,16,6) ⊕ S8(21,15,7) ⊕ S3(21,14,8) ⊕ S3(21,13,9) ⊕ S(21,12,10) ⊕ S2(21,11,11) ⊕ S(20,19,4) ⊕ S2(20,18,5) ⊕ S6(20,17,6) ⊕ S5(20,16,7) ⊕ S8(20,15,8) ⊕ S4(20,14,9) ⊕ S3(20,13,10) ⊕ S2(20,12,11) ⊕ S3(19,19,5) ⊕ S4(19,18,6) 4 6 5 4 ⊕ S9(19,17,7) ⊕ S8(19,16,8) ⊕ S10 (19,15,9) ⊕ S(19,14,10) ⊕ S(19,13,11) ⊕ S(18,18,7) ⊕ S(18,17,8) ⊕ S(18,16,9) ⊕ S8(18,15,10) ⊕ S3(18,14,11) ⊕ S2(18,13,12) ⊕ S6(17,17,9) ⊕ S4(17,16,10) ⊕ S7(17,15,11) ⊕ S2(17,14,12) ⊕ S2(17,13,13) ⊕ S3(16,15,12) ⊕ S(16,14,13) ⊕ S3(15,15,13) K8,1 (5; 3) ∼ = S(26,17,5) ⊕ S(26,16,6) ⊕ S2(26,15,7) ⊕ S2(26,13,9) ⊕ S(26,11,11) ⊕ S(25,18,5) ⊕ S2(25,17,6) ⊕ S3(25,16,7) ⊕ S4(25,15,8) ⊕ S3(25,14,9) ⊕ S2(25,13,10) ⊕ S2(25,12,11) ⊕ S(24,20,4) ⊕ S2(24,19,5) ⊕ S4(24,18,6) ⊕ S8(24,17,7) ⊕ S8(24,16,8) 6 7 2 5 9 13 ⊕ S10 (24,15,9) ⊕ S(24,14,10) ⊕ S(24,13,11) ⊕ S(24,12,12) ⊕ S(23,20,5) ⊕ S(23,19,6) ⊕ S(23,18,7) ⊕ S(23,17,8) 15 11 7 4 9 15 ⊕ S16 (23,16,9) ⊕ S(23,15,10) ⊕ S(23,14,11) ⊕ S(23,13,12) ⊕ S(22,21,5) ⊕ S(22,20,6) ⊕ S(22,19,7) ⊕ S(22,18,8) 21 23 12 7 6 13 ⊕ S22 (22,17,9) ⊕ S(22,16,10) ⊕ S(22,15,11) ⊕ S(22,14,12) ⊕ S(22,13,13) ⊕ S(21,21,6) ⊕ S(21,20,7) ⊕ S(21,19,8) 27 27 22 12 5 14 21 ⊕ S20 (21,18,9) ⊕ S(21,17,10) ⊕ S(21,16,11) ⊕ S(21,15,12) ⊕ S(21,14,13) ⊕ S(20,20,8) ⊕ S(20,19,9) ⊕ S(20,18,10) 9 17 22 19 26 21 4 ⊕ S28 (20,17,11) ⊕ S(20,16,12) ⊕ S(20,15,13) ⊕ S(20,14,14) ⊕ S(19,19,10) ⊕ S(19,18,11) ⊕ S(19,17,12) ⊕ S(19,16,13) 7 15 10 6 5 5 ⊕ S13 (19,15,14) ⊕ S(18,18,12) ⊕ S(18,17,13) ⊕ S(18,16,14) ⊕ S(18,15,15) ⊕ S(17,17,14) ⊕ S(17,16,15) 24 Department of Mathematics, University of Wisconsin, Madison, WI E-mail address: [email protected] URL: http://math.wisc.edu/~juliettebruce/ Department of Mathematics, University of Wisconsin, Madison, WI E-mail address: [email protected] URL: http://math.wisc.edu/~derman/ Department of Mathematics, University of Wisconsin, Madison, WI E-mail address: [email protected] Department of Mathematics, University of Wisconsin, Madison, WI E-mail address: [email protected] URL: http://math.wisc.edu/~yangjay/ 25
0math.AC
arXiv:1503.02227v3 [math.RT] 10 Nov 2016 Spin Characters of Hyperoctahedral Wreath Products Xiaoli Hu and Naihuan Jing∗ Abstract. The irreducible spin character values of the wreath products of the hyperoctahedral groups with an arbitrary finite group are determined. 1. Introduction Irreducible spin characters of the symmetric group Sn were studied by Schur [17] as one of the important examples in representation theory. Schur first derived a Frobenius-type formula for the nontrivial spin character values at conjugacy classes corresponding to partitions with odd integer parts in terms of Schur’s Q-functions, which is similar to the case of the symmetric group. Furthermore, Schur showed that beyond the Frobenius-type formula, there are other spin character values on special conjugacy classes corresponding to (odd) strict partitions, which are not given by his Q-functions but derived via his new twisted tensor product of basic spin representations. After Schur’s classic paper there have been quite a number of papers devoted to the spin groups and in particular, hyperoctahedral spin groups and their generalizations. Morris gave an alternative description of the twisted tensor product [12] and derived an iterative formula for Schur’s Q-functions. Later Morris also studied double covering groups of Weyl groups following Schur’s theory [13]. Sergeev [16] showed that representation theory of the e n is similar to that of the spin group Sen twisted hyperoctahedral group H (cf. [15, 10]), and proved that Schur’s Q-functions also served as generating functions for some irreducible spin supercharacters of the hyperoctahedral groups. Finally Yamaguchi [19] clarified this relationship and established an equivalence between the twisted group algebra of the symmetric group and the queer Lie superalgebra. 2010 Mathematics Subject Classification. Primary: 20C25; Secondary: 20C30, 20B30, 20C15. Key words and phrases. hyperoctahedral groups; wreath products; spin characters. Supported by NSFC grants 11271138, 11426116 and Simons Foundation grant 198129. ⋆ Corresponding Author. 1 2 XIAOLI HU AND NAIHUAN JING∗ e n = Γ ≀ Sen of a finite group Γ by the spin For the wreath product Γ symmetric group Sen , most part of the spin character table was determined by Frenkel, Wang and the second author using the vertex operator calculus [7]. The remaining part was completed by the authors [4, 5] using Clifford algebras. In 2002, Wang and the second author [7] generalized the method to e n of the spin hyperoctahedral group H e n by study the semi-direct product HΓ a finite group Γ. The status of the character theory can be easily described as follows. If we denote by Γ∗ (resp. Γ∗ ) the set of conjugacy classes (resp. e n are irreducible characters) of Γ, then the irreducible spin characters of HΓ ∗ determined by pairs of the strict partition-valued functions on Γ and the spin character values at the even conjugacy classes are provided by vertex operators in [7]. However, the spin character values at odd strict partitionvalued functions of Γ∗ are still unknown. This paper aims to give the complete spin character table of the semie n , which include projective characters of various Weyl direct product HΓ groups and their wreath products. Part of the motivation is to extend the e n ) to type B or D. The previous type A theory (the character theory of Γ following table shows the situation with the new case. Here SP 1n (Γ∗ ) (resp. SP 1n (Γ∗ )) denotes the set of odd strict partition-valued functions on Γ∗ (resp. Γ∗ ) and OP n (Γ∗ ) (resp. OP n (Γ∗ )) denotes the set of odd integer partitionvalued functions on Γ∗ (resp. Γ∗ ), where Γ∗ (resp. Γ∗ ) denotes the set of conjugacy classes (resp. irreducible characters) of the finite group Γ. The unknown part of the character values so far is denoted by a question mark. Note that there are two parities for spin hyperoctahedral wreath products and parition-valued functions, it happens that they are compatible for split conjugacy classes (see Prop. 3.1). Dρ± Spin chars  Conj. classes ρ ∈ OP n (Γ∗ ) (even) ρ ∈ SP 1n (Γ∗ ) (odd) ν ∈ SP n (Γ∗ ) l(ν) even vertex operators χν ν ∈ SP n (Γ∗ ) l(ν) odd vertex operators χ± ν e n Table 1. Spin character table of HΓ 0 ? The spin characters computable by vertex operators are actually character values that come from certain supermodules of the wreath products of hyperoctahedral groups. It turns out that the characters values at conjugacy classes indexed by partition-valued functions with odd integer parts SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 3 are the only non-zero values for certain modules, which then give the first part shown in the table. Our method to uncover the other spin character values is a detailed analysis of difference characters for the ordinary modules and also how they are related with the characters of the supermodules. We generalize Józefiak’s e n and supermodule approach [8, 10] to study spin representations of HΓ compute the associate spin characters at the odd strict conjugacy classes. While we take the advantage of the similarity between the representation theories of the wreath products and their hyperoctahedral counterparts, we also need to single out the difference in order to determine the nontrivial spin character values of the latter groups. Moreover, there is also another new point for hyperoctahedral wreath products. Previous work has been emphasizing their representations as a super theory, however in the current situation one needs to disengage the super theory to get their ordinary counterpart. 2. The spin hyperoctahedral groups Let Sn be the symmetric group on n letters for n ≥ 4. The hyperoctahedral group Hn := Z2 ≀ Sn is generated by transpositions si = (i, i + 1) (1 ≤ i ≤ n − 1) and involutions bj (1 ≤ j ≤ n) with the relations (2.1) s2i = 1, (si si+1 )3 = 1, (si sj )2 = 1 for |i − j| ≥ 2, si bi = bi+1 si , si bj = bj si for j 6= i, i + 1, b2j = 1, bi bj = bj bi for i 6= j. e n the group generated by si (1 ≤ i ≤ n − 1) and aj (1 ≤ We denote by H j ≤ n) and z with the following relations: (2.2) s2i = 1, (si si+1 )3 = 1, (2.3) si ai = ai+1 si , (2.4) a2j (si sj )2 = 1 for |i − j| ≥ 2, si aj = aj si for j 6= i, i + 1, = z, ai aj = zaj ai for i 6= j, where z belong to the center and z 2 = 1. e n is a semidirect product of the symmetric group Sn = Note that H hsi |1 ≤ i ≤ n − 1i and the 2-group generated by aj subject to the relations e n is a central extension of Hn = Zn ⋊ Sn through (2.4). Furthermore, H 2 (2.5) n e n −−θ− 1 −→ hzi ֒−→ H → Hn −→ 1, where θn is the group homomorphism sending si to (i, i+1) for 1 ≤ i ≤ n−1, e n is Z2 -graded with the aj to bj for 1 ≤ i ≤ n, and z to 1. The group H parity defined by p(ai ) = 1 and p(si ) = p(z) = 0. With this parity the group e n ) becomes a superalgebra. algebra C(H XIAOLI HU AND NAIHUAN JING∗ 4 The spin symmetric group Sen is the finite group generated by ti (1 ≤ i ≤ n − 1) and the central element z with the relations (2.6) t2i = z, z 2 = 1, (ti ti+1 )3 = 1, ti tj = ztj ti for |i − j| ≥ 2. For each n > 1, let An denote the algebra generated by ςi (1 ≤ i ≤ n − 1) and satisfy the following relations: (2.7) ςi2 = −1 (1 ≤ i ≤ n − 1), (ςi ςj )2 = −1 (|i − j| ≥ 2), (ςi ςi+1 )3 = −1 (1 ≤ i ≤ n − 2). The algebra An is also a superalgebra under the parity that d(ςi ) = 1 (1 ≤ i ≤ n − 1). In fact An is isomorphic (as a superalgebra) to the twisted group algebra C(Sen )/(1 + z) via ςi 7→ ti [17]. For n > 1, let Bn be the algebra generated by ωi (0 ≤ i ≤ n − 1) satisfying (2.8) (2.9) ωi2 = 1 (0 ≤ i ≤ n − 1), (ωi ωi+1 )3 = 1 (1 ≤ i ≤ n − 2), (ωi ωj )2 = 1 (|i − j| ≥ 2), (ω0 ω1 )4 = −1. The algebra Bn is the group algebra of a double covering group of the Coxeter group Hn and also a superalgebra by defining d(ω0 ) = 1 and d(ωi ) = e n ]/(1 + z) via ωi 7→ ti (1 ≤ i ≤ 0 for 1 ≤ i ≤ n − 1. Moreover Bn ∼ = C[H n − 1) and τi = ωi−1 · · · ω1 ω0 ω1 · · · ωi−1 7→ ai for i = 1, . . . , n. In particular, ω 0 ≡ τ1 . Let Cn be the Clifford algebra generated by ξi (i = 1, . . . , n) subject to the relations ξi2 = 1, ξi ξj = −ξj ξi (i 6= j). ˆ n denote It becomes a superalgebra under the parity d(ξi ) = 1. Let Cn ⊗A the super tensor product of the superalgebras Cn and An . It is proved in ˆ n ≃ Bn as superalgebras under the [19] that the super tensor product Cn ⊗A map ϑ: ξi ⊗ 1 7→ τi (1 ≤ i ≤ n), 1 1 ⊗ ςj 7→ √ (τj − τj+1 )ωj , (1 ≤ j ≤ n − 1) 2 where τi are defined above. (2.10) 3. Conjugacy classes of wreath products For a finite group Γ, set Γn = Γ × · · · × Γ, the n-th direct product of Γ. e n acts on Γn by permuting the factors: The twisted hyperoctahedral group H (3.1) z · (g1 , . . . , gn ) =(g1 , . . . , gn ), ai · (g1 , . . . , gn ) =(g1 , . . . , gn ), i = 1, . . . , n σ · (g1 , . . . , gn ) =(gσ−1 (1) , . . . , gσ−1 (n) ), σ ∈ Sn . SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 5 e n be the semi-direct product of Γn by H e n with the multiplication: Let HΓ ′ (3.2) ′ ′ ′ ′ ′ ′ (g, aσ) · (g , a σ ) = (gσ(g ), aσ(a )σσ ), ′ ′ where g, g ∈ Γn , a, a ∈ Πn , σ, σ ∈ Sn . From now on, we write HΓn for e n is a double cover of the wreath product of Sn by Γ × Z2 . Note that HΓ e n . For a subset HΓn . In the following we use the notations of [7] for HΓ e n and bI = I = {i1 , . . . , im } of {1, . . . , n}, we set aI = ai1 ai2 · · · aim ∈ H bi1 · · · bim ∈ Hn , where bi (i = 1, . . . , n) are the generators of Zn2 . We recall that a partition λ ofP n is a sequence of non increasing positive integers λi called parts such that i λi = n. We denote by l(λ) the number of parts or length of λ, and k λ k= λ1 +λ2 +· · · the weight of λ. A partition λ is called a strict partition if all parts λi are distinct. We also use the notation λ = (1m1 (λ) 2m2 (λ) · · · ) for the partition λ, where mk (λ) is the multiplicity of k in the parts λi ’s. The conjugacy classes of HΓn are parametrized by a pair of partitionvalued functions. For a cycle σ = (i1 . . . im ) ∈ Sn , the supp(σ) is defined to be I = {i1 , . . . , im }. For (g, bI σ) ∈ HΓn , the element bI σ can be uniquely written (up to order) as a product bI σ = (bI1 σ1 ) · · · (bIm σm ), where σ = σ1 · · · σm is a product of disjoint cycles of Sn and Ik ⊂ supp(σk ) for k = 1, . . . , m [7]. We call bIa σa a signed cycle of bI σ with the sign (−1)|Ia | . For each signed cycle bIk σk with σk = (j1 , . . . , jm ) the signed cycle-product of bIk σk is defined to be (−1)|Ik | gjm gjm−1 · · · gj2 gj1 . − For each c ∈ Γ∗ , let m+ k (c) (resp. mk (c)) (k ≥ 0) be the number of k-cycles of the permutation σ such that its positive (resp. negative) signed cycle-product lies in the conjugacy class c. For each c ∈ Γ∗ , set + + − − ρ+ (c) = (1m1 (c) 2m2 (c) . . .) and ρ− (c) = (1m1 (c) 2m2 (c) . . .), which are partitions indexed by c ∈ Γ∗ . Then ρ+ = (ρ+ (c))c∈Γ∗ , ρ− = (ρ− (c))c∈Γ∗ are two signed partition-valued functions on Γ∗ . Moreover, ρ = (ρ+ , ρ− ) defines a pair of partition-valued functions on Γ∗ with l(ρ) = l(ρ+ ) + l(ρ− ), where l(σ) is the total length of σ, and ||ρ+ || + ||ρ− || = ||ρ||, the total weight of the partition-valued function. It is proved [7] that the conjugacy classes of HΓn are indexed by pairs of partition-valued functions ρ = (ρ+ , ρ− ) such that ||ρ|| = n. In particular, ρ = (ρ+ , ρ− ) is called the type of the element (g, bI σ) ∈ HΓn . Two elements of HΓn are conjugate if and only if they have the same type. We write Cρ+ ,ρ− for the conjugacy class corresponding to elements of type (ρ+ , ρ− ). Furthermore, as any element of HΓn is of the form (g, bI σ), so a conjugacy class Cρ+ ,ρ− is called even or odd if the cardinality |I| is 6 XIAOLI HU AND NAIHUAN JING∗ e n is of the form (g, (−1)p aI σ) even or odd. Thus the general element of HΓ p p for p = ±1, where (−1) aI σ = (−1) (aI1 σ1 ) · · · (aIq σq ) and σ = σ1 · · · σq e n by is a disjoint union of cycles in Sn [7]. We define the parity p on HΓ p p(g, (−1) aI σ) = |I| mod 2. Note that this parity generalizes the parity e n (below (2.5)). Therefore the group algebra C[HΓ e n ] becomes a p for H superalgebra. Let Pn (Γ∗ ) denote the set of partition-valued functions of n on Γ∗ . Let OP n (Γ∗ ) (resp. SP n (Γ∗ )) be the subset of Pn (Γ∗ ) such that each part is odd (resp. every partition is strict). For i = 0, 1, let SP in (Γ∗ ) = {ρ ∈ SP n (Γ∗ )|i = (n−l(ρ)) mod 2}. When Γ = 1, the partition-valued functions become partitions, so we denote OP n , SP n and SP in (i = 0, 1). It is wellknown that the set SP n of strict partitions of n is one-to-one correspondent to the set OP n of partitions of n by odd integers [1]. e n of HΓn -conjugacy class Denote by Dρ+ ,ρ− the inverse image in HΓ Cρ+ ,ρ− under the homomorphism θn . For any x ∈ Cρ+ ,ρ− , if x is conjugate e n -conjugacy class; Otherwise, Dρ+ ,ρ− is a to zx then Dρ+ ,ρ− is also a HΓ split class, in this case Cρ+ ,ρ− (resp.Dρ+ ,ρ− ) is called a split conjugacy class e n ). It is easy to see that only split conjugacy classes of in HΓn (resp.HΓ e n can support nonzero spin character values. HΓ Proposition 3.1. [7] The conjugacy class Cρ+ ,ρ− in HΓn is split into two conjugacy classes if and only if (1) when Cρ+ ,ρ− is even, we have ρ+ ∈ OP n (Γ∗ ) and ρ− = ∅. (2) when Cρ+ ,ρ− is odd, we have ρ+ = ∅ and ρ− ∈ SP 1n (Γ∗ ). In view of Prop. 3.1, when Cρ+ ,ρ− is split, we can simply denote Dρ = = Dρ+ ∪ Dρ− , where Dρ− = zDρ+ . Consequently the order of the e n is given by centralizer of an element in Dρ of HΓ θn−1 (Cρ+ ,ρ− ) Zeρ = 21+l(ρ) Zρ , Q l(ρ(c)) and ζc is the order of the centralizer where Zρ = c∈Γ∗ ,i∈N imi (c) mi (c)!ζc of an element in conjugacy class c of Γ. For convenience, we also denote Q Q zρ(c) = i∈N imi (c) mi (c)!, so Zρ = c∈Γ∗ zρ(c) . 4. Character formulas for An and Bn e n ) is an ordinary representation π of A spin representation of Sen (or H e n ) such that π(z) = −1. From superalgebra viewpoint Józefiak [10] Sen (or H e n based on [17]. A general computed the spin super-character values of H discussion was given earlier in Morris and Jones [14] on spin characters. The foundation of all these works is Schur’s theory [17] that most character values of the spin symmetric group Sen are given by transition matrices between the basis of Schur’s Q-functions Qλ and that of power-sum symmetric functions pµ in the subring of symmetric functions generated by the power-sums of odd degrees: p1 , p3 , . . .. For basic information on Schur’s Q-functions, SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 7 see Macdonald’s classic monograph [11]. As the exceptional spin character en values are not given by symmetric functions, we will compute them for H in this section. Recall that An a quotient of the group algebra CSen (see (2.7)). As a superalgebra An is a direct product of finitely many simple superalgebras. For background materials on superalgebras, we refer the reader to [8]. For a modern account of Schur’s twisted tensor products, see also [18]. Simple (complex) superalgebras have two types: (1) Type M , M (r|s) is the block 2 × 2 matrices with the main diagonal blocks are r × r-matrices and s × s matrices. The degree zero part consists of diagonal blocks and degree one is formed by off-diagonal blocks. (2) Type Q, Q(n) is a block 2 × 2 matrices whose two main diagonals and off-diagonal are the same n × n matrices. The Z2 -grading is similar to that of type M . We will call an irreducible supermodule type M (resp. Q) if it corresponds to the simple superalgebra of type M (resp. Q). The Clifford superalgebra Cn is a simple superalgebra of type M (resp. Q) according to n even (resp. odd). Subsequently Ln = Cn is a simple Cn -module of type M (resp. Q) if n is even (resp. odd). Proposition 4.1. (Schur [17]) (1) The irreducible An -supercharacters are indexed by SP n . For ν ∈ SP n , let ζν be the character with type ν, then it is completely determined by its values ζνα at the conjugacy class indexed by α ∈ OP n and X l(ν)+l(λ)+p(ν) 2 zλ−1 ζνλ pλ , (4.1) Qν = 2 λ∈OP n where p(ν) is the parity of ν and zλ is the order of the centralizer of an element with cycle type λ in Sn . (2) The supercharacter ζν is of type M (resp. Q) when n − l(ν) is even (resp. odd). For ν ∈ SP n , let Vν be the An -module associated with ν. Since Bn ≃ ˆ Cn ⊗An and Cn has only one simple supermodule Ln , any irreducible super ˆ ν , where Vµ is irreducible An modules of Bn is a super tensor product Ln ⊗V supermodule. Subsequently there is a one-to-one correspondence between irreducible An -modules and irreducible Bn -modules. Proposition 4.2. (Józefiak [9]) (1) The irreducible supercharacters of Bn are completely indexed by the strict partitions of n. For ν ∈ SP n , if l(ν) is even (resp. odd) then the corresponding supercharacter ξν is of type M (resp. Q). (2) For each ν ∈ SP n , the supercharacter values are determined by X l(ν) (4.2) Qν = 2[ 2 ] zλ−1 ξνλ pλ . λ∈OP n where [x] denotes the largest integer ≤ x. XIAOLI HU AND NAIHUAN JING∗ 8 Now we consider the relationship between characters of modules and super modules. e n ) is called of double spin or A spin representation π of Sen (resp. H ′ sgn ∼ self-associate spin if π = (−1) ◦ π. Otherwise, π and π := (−1)sgn ◦ π are called a pair of associate spin representations. Here (−1)sgn is the onee n ). The following correspondimensional sign representation of Sen (resp. H dence between ordinary spin characters and super spin characters is crucial for our discussion. First of all, if V is a super module of the superalgebra An (resp. Bn ), then χV (x) = traceV (x) = 0 for any element x of degree one. On one hand, the character π of a spin super module of type M is also a double spin character by forgetting the super structure. If π is the character of an irreducible supermodule of type Q, then π = χ+ +χ− , where χ± are a pair of irreducible associate spin characters corresponding to π. Here χ− (x)=(−1)p(x) χ+ (x), where p is the parity of the superalgebra. For convenience, we denote the difference ∇(χ) = χ+ − χ− , which can be used to recover the associate spin e n ) we can characters from that of the supermodule. In summary, for Sen (or H get the ordinary spin character values on even conjugacy classes from the supercharacter formulas of An (or Bn ). Moreover, a double spin character is fully determined by its values on even conjugacy classes or degree 0 elements (as it vanishes on degree 1 elements), while associate spin characters may have non-zero values on odd conjugacy classes or degree 1 elements. The following well-known result shows how associate spin characters take values at the odd conjugacy classes. Proposition 4.3. (Schur [17]) For ν ∈ SP 1n , there corresponds a pair of associate spin characters ζν+ and ζν− of An , and ζν+ (ν + ) √ n−l(ν)+1 = ( −1) 2 r ν1 ν2 · · · νl , ζν+ (µ+ ) = 0 f or µ 6= ν ∈ SP 1n . 2 Moreover ζν− (µ+ ) = −ζν+ (µ+ ), where µ+ is an element in Dµ+ . On the other hand, if V is a double spin irreducible Bn -module, then V can be naturally equipped with a Bn -supermodule of type M as follows. Suppose V ≃ V ′ = (−1)sgn ⊗ V is irreducible, where sgn is the parity p defined below (2.5). As a vector space V ′ = V , the isomorphism map H ∈ GL(V ) and satisfies that Hg = (−1)sg(g) gH, ∀g ∈ Bn . Therefore H 2 commutes with Bn , so it is a scalar by Schur’s lemma. We can assume that H 2 = 1. Let V0 be the 1-eigenspace of H and V1 the (−1)eigenspace of H, then V = V0 ⊕V1 gives rise to the desired Bn -supermodule. (0) Moreover, both Vi are Bn -modules affording the character χVi , then for SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 9 (0) x ∈ Bn one has that (4.3) trV (x) = χV (x) := χV0 (x) + χV1 (x) (4.4) trV (Hx) = δV (x) := χV0 (x) − χV1 (x). Here the latter is usually called the difference character of V [17]. We will extend this notation to the spin character of a super module of type M , when viewed as a character for the subalgebra of degree zero. Note that (1) χ(x) = 0 if x ∈ Bn in this case. Also, if V is an irreducible associate spin Bn -module, then D(V ) = V ⊕ V ′ becomes an irreducible Bn -supermodule where D(V )0 = {(v, v)|v ∈ V }, D(V )1 = {(v, −v)|v ∈ V } and the action is induced from that of the ordinary (i) module, i.e. g (i) (u, v) = (g (i) u, (−1)i g(i) v) for g (i) ∈ Bn , the degree i(i) subspace of Bn (with respect to the parity p). Moreover, any irreducible associate spin module can be realized this way. Conversely, any irreducible supermodule U = U0 ⊕ U1 of type Q is of the form D(V ). In fact, let (−1)p : (x, y) 7→ (x, −y) be the parity endomorphism of U . Then V = { 12 (v + (−1)p v)|u ∈ U } and V ′ = { 12 (v − (−1)p v)|u ∈ U }. From now on till (4.7), we assume that {Bn } is a tower of finite-dimensional superalgebras: B= ∞ M Bn , n=0 where C = B0 ֒→ B1 ֒→ · · · ֒→ Bn ֒→ · · · and B a Hopf algebra under the natural multiplication and comultiplication: Ind ˆ n −→ m :Bm ⊗B Bm+n , m ˆ ∆ :Bm −→ ⊕i=0 ResBi ⊗ResB m−i . Two nontrivial examples of the tower system {Bn } for superalgebras were studied first in [3, 7]. See also [2] for the case of Sen . For two spin supermodules U and V of Bm and Bn , we define the super ˆ as a Bm ⊗B ˆ n -supermodule by (outer)-tensor product U ⊗V (x, y)(u ⊗ v) = (−1)p(x)p(y) (xu ⊗ yv), where x ∈ Bm and y ∈ Bn are homogeneous elements. In particular, −1 of ˆ n ֒→ Bm+n . Then Bm+n is identified with (−1, 1) or (1, −1) inside Bm ⊗B ˆ ˆ U ⊗V is a spin Bm ⊗Bn -supermodule. Moreover, let U and V be irreducible ˆ n respectively, then we have that [8] supermodules for Bm ⊗B ˆ is a simple Bm ⊗B ˆ n(1) if both U and V are of type M , then U ⊗V supermodule of type M ; ˆ is a simple Bm ⊗B ˆ n(2) if U and V are of different types, then U ⊗V supermodule of type Q; 10 XIAOLI HU AND NAIHUAN JING∗ ˆ ≃ N ⊕ N for some simple (3) if both U and V are of type Q, then U ⊗V ˆ n -supermodules N and N of type M. Bm ⊗B ˆ in (3) are constructed as follows. Let H1 The simple summands of U ⊗V (resp. H2 ) be the endomorphism (−1)p for U (resp. V ). Then N0 = {u ⊗ v + H1 u ⊗ H2 v + i(u ⊗ H2 v + H1 u ⊗ v)|u ∈ U, v ∈ V }, N1 = {u ⊗ v − H1 u ⊗ H2 v + i(u ⊗ H2 v − H1 u ⊗ v)|u ∈ U, v ∈ V }, N 0 = {u ⊗ v + H1 u ⊗ H2 v − i(u ⊗ H2 v + H1 u ⊗ v)|u ∈ U, v ∈ V }, N 1 = {u ⊗ v − H1 u ⊗ H2 v − i(u ⊗ H2 v − H1 u ⊗ v)|u ∈ U, v ∈ V }. Let − be the map N → N taking i to −i while keeping other part intact (like conjugation). Then α(x) : x 7→ (−1)p(x) x establishes a degree 1 isomorphism ˆ n -supermodules. from N to N as Bm ⊗B Using the method of [6] it can be verified that this super tensor product satisfies the associativity. Then we can pass this to usual spin modules as follows. Let V be an irreducible spin module. If V is an irreducible double spin module, then V can be naturally given an irreducible supermodule structure of type M as described above (still denoted by the same symbol for the supermodule). If V is an irreducible associate spin module, then D(V ) = V ⊕ V ′ is an irreducible supermodule of type Q, and D(V )0 ≃ V as ordinary modules. The following useful result can be proved by a similar method to [8], and we have added new values for later consideration of multi-products. Proposition 4.4. Let {Bn } be a tower system of finite dimensional superalgebras. Let f and g be the spin characters afforded by an irreducible Bm -module U and an irreducible Bn -module V respectively. Let x = x0 + x1 ∈ B m , y = y 0 + y 1 ∈ B n . ˆ (i) If both U and V are double spin, then the super tensor product U ⊗V is irreducible both as a supermodule of type M and an ordinary double spin ˆ n . In this case, f (x1 ) = g(y1 ) = f ⊛ g(xi , y1−i ) = 0 and module for Bm ⊗B f ⊛ g(x0 , y0 ) = f (x0 )g(y0 ), δ(f ⊛ g)(xi , yi ) = δ(f )(xi )δ(g)(yi ). (ii) If U is double spin and V is associate spin, then the super tensor ˆ n -supermodule of type Q and ˆ product U ⊗D(V ) is irreducible as a Bm ⊗B ′ decomposes into U ⊛ V ⊕ (U ⊛ V ) as an ordinary module, where (U ⊛ V )′ is the associated module of the irreducible module U ⊛ V . In this case, f (x1 ) = f ⊛ g(x1 , y0 ) = 0 and the following identities hold. f ⊛ g(x0 , y0 ) = f (x0 )g(y0 ), f ⊛ g(x0 , y1 ) = δ(f )(x0 )g(y1 ), ∆(f ⊛ g)(x0 , y0 ) = f (x0 )∆(g)(y0 ). (iii) If both U and V are associate spin, so they give rise irreducible super spin modules D(U ) and D(V ) of type Q. The super tensor product SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 11 ˆ ˆ mD(U )⊗D(V ) decomposes into W ⊕ W , where W is an irreducible Bm ⊗B supermodule of type M. Denote by W = U ⊛ V when it is viewed as an ordinary irreducible module (up to isomorphism). In this case, we have that f ⊛ g(x1 , y0 ) = f ⊛ g(x0 , y1 ) = δ(f ⊛ g)(x0 , y0 ) = 0 f ⊛ g(x0 , y0 ) = 2f (x0 )g(y0 ), √ δ(f ⊛ g)(x1 , y1 ) = 2 −1f (x1 )g(y1 ). Let µ be a partition, and suppose Vi (1 ≤ i ≤ m) is an irreducible spin (ordinary) Bµi -module. Since the starred tensor product ⊛ is associative ˆ µi [8, 6] (see our notation above), V1 ⊛ · · · ⊛ Vs is a well-defined spin ⊗B module. Let fi be the character of Vi , and assume that the first r of them are irreducible double spin (corresponding to type M ) and the latter k = m − r are irreducible associate spin (corresponding to type Q). Then f1 ⊛ · · · ⊛ fm is the character of an irreducible summand of the super tensor product ˆ · · · ⊗V ˆ r ⊗D(V ˆ ˆ · · · ⊗D(V ˆ V1 ⊗ r+1 )⊗ r+k ). Note that V1 ⊛ · · · ⊛ Vm is only defined up to isomorphism. Repeatedly using Prop. 4.4, we obtain that k (4.5) f1 ⊛ · · · ⊛ fm (x1 , . . . , xm ) = 2[ 2 ] f1 (x1 ) · · · fk (xm ), f1 ⊛ · · · ⊛ fm (x1 , . . . xr , yr+1 , . . . , ym ) √ k−1 = (2 −1) 2 δ(f1 )(x1 ) · · · δ(fr )(xr )fr+1 (yr+1 ) · · · fm (ym ), k odd (4.6) (4.7) f1 ⊛ · · · ⊛ fm (z1 , . . . , zm ) = 0, (0) (1) other type of zi ’s where xi ∈ Bµi , yi ∈ Bµi , zi ∈ Bµi , and [a] denotes the maximum integer ≤ a. We remark the last formula (4.7) is verified with our updated trivial values stated in Prop. 4.4. Now we can compute the associated spin characters on odd conjugacy e n . Let r = [ n ], and Ln = Cn e, where classes for H 2 √ 1 (4.8) e = e1 e2 · · · er , ei = (1 + −1ξ2i−1 ξ2i ). 2 Then ei are commutative idempotents, and √ Ln is a simple super Cn -module. Note that ξ i = ξ2i−1 ei = 12 (ξ2i−1 + −1ξ2i ) (i = 1, . . . , r) generate an exterior algebra: {ξ i , ξ j } = 0 due to the fact that ei ξ2i−1 ei = 0. For each ε = εr εr er ). e = (ξ1ε1 e1 )(ξ3ε2 e2 ) · · · (ξ2r−1 (ε1 , . . . , εr ) ∈ Zr2 , define ξ ε = ξ1ε1 ξ3ε2 · · · ξ2r−1 ε r ε r If n is even (resp. odd), then {ξ |ε ∈ Z2 } (resp. {ξ |ε ∈ Z2 } ∪ {ξ ε ξn |ε ∈ Zr2 }) Pis a basis of Ln . If n is odd, define cn ∈ End1Cn (Ln ) by cn (ξ ε ξnǫ ) = (−1) i εi +ǫ (ξ ε ξnǫ+1 ), where ε = (ε1 , . . . , εr ) ∈ Zr2 and ǫ ∈ Z2 . Here c2n = −1. e n -supermodules are indexed by By our earlier discussion, irreducible H strict partitions ν and they are type M (resp. Q) iff l(ν) are even (resp. odd). Correspondingly double irreducible spin characters are indexed by strict partitions ν with even l(ν), and pairs of irreducible associate spin characters are indexed by strict partitions ν with odd l(ν). XIAOLI HU AND NAIHUAN JING∗ 12 Let ξν be the character of the irreducible supermodule associated with ν. If l(ν) is even, then ξν vanishes at split conjugacy classes of degree one, i.e., ξν (Dρ± ) = 0 for any odd strict partition ρ ∈ SP 1 (as Dρ± are the only split odd classes by Theorem 3.1). Therefore, ξν ’s are completely given by Schur’s Q-functions in this case (see Prop. 4.2). So we are left with the task of fixing ξν with odd l(ν). In this case ξν breaks into a pair of associate spin characters ξν± . Again the character values on the even split classes are given by Schur’s Q-functions, and we only need to worry about ξν on the odd split conjugacy classes SP 1 . The following result computes the remaining character values for Bn that correspond to strict partitions of odd lengths. Theorem 4.5. For ν = (ν1 , . . . , νl ) ∈ SP n , let ξν be the corresponding spin supercharacter of Bn . When l(ν) is odd, ξν is decomposed into two e n . Moreover, (ξν± )(µ+ ) = 0 for associate ordinary spin characters ξν± of H 1 µ 6= ν ∈ SP n and for µ = ν, r √ ν1 ν2 · · · νl(ν) l(ν) n−m ± + , (4.9) ξν (ν ) = ±2 2 · ( −1) 2 2 where µ+ ∈ Dµ+ = θ −1 (C∅,µ ) and m is the number of odd parts in ν. Proof. We prove the formula by induction on l(ν). We first consider the case ν = (n), and divide into two cases according to the parity of n. Case (1). If n is odd, the Cn -module Ln is of type Q and the An character ζ(n) is of type M . This is not a special case of the formula, but we need to compute the difference character for the inductive procedure. The (0) element σ ((n),∅) of Bn is given by σ ((n),∅) = ω1 ω2 · · · ωn−1 ∈ Bn . Using Eq. (2.10), we obtain that (4.10) 1 1 ϑ−1 (ω1 ω2 · · · ωn−1 ) = ( √ (ξ1 − ξ2 ) ⊗ ς1 )( √ (ξ2 − ξ3 ) ⊗ ς2 ) · · · , 2 2 From [19], we have ςi ξj = −ξj ςi , then rearrange the above product into the following form (4.11) 2− n−1 2 (−1) (n−1)(n−2) 2 n−1 Y j=1 (ξj − ξj+1 ) ⊗ (ς1 ς2 · · · ςn−1 ). + ˆ (n) ) at the even element equals = 12 ∆(ch(Ln )⊗ζ Therefore, the value of ξ(n) to (4.12) 1 ˆ (n) (ϑ−1 (σ ((n),∅) )) ch(Ln )⊗ζ 2 n−1 Y (n−1)(n−2) n+1 2 2− 2 ch(Ln )( (ξj − ξj+1 ))ζ(n) (ς (n) ), =(−1) j=1 SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS where ς (n) = ς1 ς2 · · · ςn−1 . As the coefficient of 1 in (−1)(n−1)/2 , it follows that n−1 Y (4.13) ch(Ln )( j=1 (ξj − ξj+1 )) = 2 n+1 2 · (−1) Qn−1 j=1 (ξj n−1 2 13 − ξj+1 ) is . √ √ On the other hand, δ(ζ(n) )(ς (n) ) = ( −1)(n−1)/2 n (note n is odd). So we get the difference of the character is equal to 1 + ˆ (n) )(ϑ−1 (σ ((n),∅) ) )((n)) = ch(Ln )⊗δ(ζ δ(ξ(n) 2 √ n−1 √ =( −1) 2 n. (4.14) (1) Case (2). When n is even, σ (∅,(n)) = ω0 ω1 · · · ωn−1 ∈ Bn and its preimage equals to ϑ−1 (ω0 ω1 · · · ωn−1 ) (4.15) =2− n−1 2 · (−1) (n−1)(n−2) 2 ξ1 n−1 Y j=1 (ξj − ξj+1 ) ⊗ (ς1 ς2 · · · ςn−1 ), which is a product of an even element and an odd element. Note that Qn−1 n−2 n ch(Ln )(ξ1 j=1 (ξj − ξj+1 )) = 2 2 · (−1) 2 and it is of type M due to n + = 21 ∆(ξ(n) ). It follows from being even. Since ξ(n) is of type Q, so ξ(n) √ p n + (n) = ( −1) 2 n2 (Prop. 4.3) that ζ(n) 1 ˆ + )[ϑ−1 (σ (∅,(n)) )] ∆(ch(Ln )⊗ζ (n) 2 n−1 Y (n−1)(n−2) + 2 (ς(n) ) (ξj − ξj+1 )) · ζ(n) · (−1) ch(Ln )(ξ1 + ((n)) = ξ(n) =2− n−1 2 (4.16) j=1 − n−1 2 · (−1) =2 √ n√ =( −1) 2 n. (n−1)(n−2) 2 · (−1) n−2 2 √ n 2 · ( −1) 2 n 2 r n 2 Next, suppose ν = (ν1 , ν2 , . . . , νl ) is any strict partition of n with odd l = l(ν), say ν1 , . . . , νm are odd and νm+1 , . . . , νl are even, then by (4.5-4.6) it follows that ν1 +···+νm −m l √ √ 2 ξν+ (ν + ) =2[ 2 ] ( −1) · ν1 · · · νm νm+1 +···+νl √ √ 2 · νm+1 · · · νl · ( −1) (4.17) r n−m l √ ν1 ν2 · · · νl 2 2 . =2 ( −1) 2 XIAOLI HU AND NAIHUAN JING∗ 14 Note that hξν+ , ξν+ iSP 1n = 1/2. On the other hand hξν+ , ξν+ iSP 1n ≥ (4.18) = 1 e |Hn | X + − g∈D∅,ν ∪D∅,ν 1 21+l zν |ξν+ (g)|2 2 · |ξν+ (ν + )|2 l 1 · 2 · 22 = 1+l 2 ν1 · · · νl r ν1 · · · νl 2 2 1 = . 2 Therefore ξν+ (µ+ ) = 0 for µ 6= ν.  l(α+ )−1 For ν ∈ SP n , we have that ξν+ (α) = 2 2 ζν+ (α+ ) for α ∈ OP n and l(ν)−m−1 l(ν) √ 2 ζν+ (ν + ) for ν ∈ SP 1n , where α+ ∈ Dα+ and m is ξν+ (ν + ) = 2 2 ( −1) the number of odd parts in ν. e n. 5. Spin characters of HΓ e n -supermodules. We first recall the parametrization of irreducible spin HΓ Proposition 5.1. [7] The irreducible double spin representations over e n are indexed by strict partition valued functions with even length on HΓ Γ∗ , and the pairs of irreducible associate spin representations are indexed by strict partition-valued functions with odd length on Γ∗ . e n is a function f : HΓ e n −→ C such that A spin class function on HΓ e n ) be the f (zx) = −f (x) for any element x of a conjugacy class. Let R(HΓ e n . The usual bilinear space of complex-valued spin class functions on HΓ form is defined by hf, giHΓ e n = (5.1) = X 1 f (x̃)g(x̃−1 ) e n| |HΓ e n x̃∈HΓ X ρ∈OP n (Γ∗ )∪SP 1n (Γ∗ ) = X ρ∈OP n (Γ∗ )∪SP 1n (Γ∗ ) [ 1 e n| |HΓ 1 2l(ρ) Zρ X x)] f (e x)g(e x e∈Dρ+ ∪Dρ− f (Dρ+ )g(Dρ+ ), e n ). where and f, g ∈ R(HΓ e n is a spin class function such that A spin super class function φ on HΓ e n ) be the it vanishes further on odd strict conjugacy classes. Let R− (HΓ e n . It is easy to see that C-span space of spin super class functions on HΓ e e n ), therefore the the spin super-characters of HΓn form a C-basis of R− (HΓ SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 15 e n ) is given by standard bilinear form on R− (HΓ X 1 φ(x̃)ϕ(x̃−1 ) hφ, ϕiHΓ e n = e n| |HΓ e n x̃∈HΓ (5.2) X 1 = φ(Dρ+ )ϕ(Dρ+ ), l(ρ) 2 Zρ ρ∈OP n (Γ∗ ) e n ), as the (super)character values vanish on odd split where φ, ϕ ∈ R− (HΓ conjugacy classes. Wang and the second author [7] used the vertex operator calculus to e n -supermodules. In terms of our compute spin characters of all simple HΓ current discussion this means that the ordinary irreducible spin character e n at even conjugacy classes are determined by transition matrix values of HΓ between generalized (or more generally wreath product) Schur Q-functions and power-sum symmetric functions. Moreover, if χ is an irreducible spin e n then character of HΓ hχ, χiOP n (Γ∗ ) = 1, hχ, χiSP 1n (Γ∗ ) = 0 for χ a double spin, (5.3) 1 hχ, χiOP n (Γ∗ ) = hχ, χiSP 1n (Γ∗ ) = for χ an associate spin. 2 In the following we will compute the values of the associate spin characters at odd strict conjugacy classes, which are not given by the theory of symmetric functions or vertex operator calculus (see table 1). Recall that e n is even or odd according to the parity the general element (g, ±aI σ) ∈ HΓ of the cardinality of I. Let Uγ be the irreducible Γ-module afforded by the irreducible character γ ∈ Γ∗ . For each strict partition ν of n let Vν be the corresponding e n -supermodule afforded by the spin super character ξν . irreducible spin H Now let λ = (λγ )γ∈Γ∗ to be a partition-valued function on Γ∗ , we recall the following result which describes the corresponding simple supermodule of e λ. HΓ Proposition 5.2. [7] For each strict partition-valued function λ = N̂ ⊗|λγ | ⊗ Vλγ ) decomposes (λγ )γ∈Γ∗ ∈ SP n (Γ∗ ), the tensor product γ∈Γ∗ (Uγ m [2] e copies of an irreducible spin HΓλ -supermodule Wλ , completely into 2 where m denotes the number of the partitions λγ such that l(λγ ) is odd. Then e e n -supermodule the induced supermodule IndHΓn Wλ is the irreducible spin HΓ e λ HΓ indexed by λ, and it is of type M or Q according to l(λ) is even or odd. Let λ be a partition-valued function λ = (λx )x∈X , where λx = (λx (1), λx (2), . . .) is a partition for each color x ∈ X. We denote by λ̄ the ordinary partition obtained from λ by forgetting all the colors, i.e. its parts consist of all λx (i), x ∈ X. For a finite set X, let λ = (λx )x∈X ∈ SP n (X) and define 16 XIAOLI HU AND NAIHUAN JING∗ ′ Jλ = {x ∈ X|l(λx ) is odd } and Jλ = {x ∈ X|l(λx ) is even } such that P P ′ Jλ ∪ Jλ = X. We denote l(Jλ ) = x∈Jλ |λx | and x∈Jλ l(λx ), ||λ||Jλ = P is the number of odd parts in λx . For , where m m mJ λ = λx λx x∈Jλ each strict partition λγ let ξλγ be the corresponding irreducible spin supere |λ | . character of H γ It follows from Proposition 5.2 that the irreducible super-character |Jλ | Y (γ ⊗|λγ | ⊗ ξλγ ). ch(Wλ ) = 2−[ 2 ] γ∈Γ∗ e n The induced character χλ = IndHΓ e ch(Wλ ) is a double spin character when HΓλ e HΓn ± l(λ) is even and χ± λ = IndHΓ e λ ch(Wλ ) are associate spin characters when l(λ) is odd. For a partition-valued function (λγ ) = (λ1 , . . . , λl )γ , the partition (λγ ) = (λ1 , . . . , λl ) gives rise to a collection [γ] of partition-valued functions ρ = (ρc )c∈Γ∗ = (ρc1 , . . . , ρc|Γ∗ | ) on Γ∗ by ρ = (ργ1 , . . . , ργ|Γ∗ | ) such that ρ = (λγ ). Clearly |[γ]| = |Γ∗ |l(ρ) . For brevity a partition-valued function inside [γ] is usually written as ργ . Now suppose ρ = (ρc )c∈Γ∗ ∈ SP 1n (Γ∗ ) is an odd strict partition-valued function and λγ ∈ SP |λγ | (Γ∗ ) with l(λ) being odd. Then using (4.6) we have √ |Jλ | Y γ ⊗|λγ | ⊗ ξλ+γ (Dρ+γ )· ch(Wλ+ )(Dρ+ ) =(2 −1)[ 2 ] (5.4) Y ′ γ∈Jλ γ∈Jλ δ(γ ⊗|λγ | ⊗ ξλγ )(Dρ+γ ). e n -supermodules are indexed by strict partiBy Prop. 5.1, irreducible HΓ tion-valued functions λ ∈ SP(Γ∗ ) and they are type M (resp. Q) iff l(λ) are even (resp. odd). Correspondingly double irreducible spin characters are indexed by strict partition values functions λ with even l(λ), and pairs of irreducible associate spin characters are indexed by strict partitions λ ∈ SP(Γ∗ ) with odd l(λ). Let ξλ be the character of the irreducible supermodule associated with partition-valued function λ. If l(ν) is even, then ξλ vanishes at split conjugacy classes of degree one, i.e., ξλ (Dρ± ) = 0 for any odd strict partitionvalued function ρ ∈ SP 1 (Γ∗ ) (see Proposition 3.1). Therefore, ξλ ’s are completely given by the vertex operator calculus in this case (see [7]). So we are left with the task of fixing ξλ with odd l(λ). In this case ξλ breaks into a pair of associate spin characters ξλ± . Again the character values on the even split classes are given by vertex operator calculus, and we only need to worry about ξλ on the odd split conjugacy classes Dρ , ρ ∈ SP 1 (Γ∗ ). e n that The following result computes the remaining character values for HΓ correspond to strict partition-valued functions of odd lengths. SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 17 The following theorem gives the irreducible associate spin character values at conjugacy classes indexed by odd strict partition-valued functions for e n. HΓ ∗ Theorem 5.3. Let χ+ λ be an associate spin character (i.e. λ = (λγ )γ∈Γ ∈ SP n (Γ∗ ), l(λ) odd), for ρ ∈ SP 1n (Γ∗ ) we have ′ (i) when ρ = (ργ )γ∈Γ∗ such that ργ ∈ OSP |ργ | (Γ∗ ) for γ ∈ Jλ and ργ ∈ [λγ ] for γ ∈ Jλ then Y Y  Y ± ξλγ (tργ )· γ(c)l(ργ (c)) · χ+ λ (Dρ ) = ± γ∈Γ∗ 2 l(Jλ ) 2 (ii) γ∈Jλ ||ρ||J −mJ √ λ λ 2 ( −1) where tργ ∈ Dρ+γ and the value ± χ+ λ (Dρ ) ′ c∈Γ∗ Q sQ ′ ξ (t ) γ∈Jλ λγ ργ γ∈Jλ Q c∈Γ∗ zργ (c) 2 , is given by Schur Q-functions. = 0, otherwise. Proof. (i) We have already seen that Y γ(c)l(ργ (c)) · δ(ξλγ )(tργ ); δ(γ ⊗|λγ | ⊗ ξλγ )(Dρ±γ ) = ± c∈Γ∗ γ ⊗|λγ | ⊗ ξλ+γ (Dρ±γ ) = ± Y c∈Γ∗ γ(c)l(ργ (c)) · ξλ+γ (tργ ). e λ in HΓ e n Note that we will show that there is only one left coset T of HΓ such that (g, aI s)T = T . Suppose there are Kρ such cosets. It follows from Prop. 5.2 that (as l(λ) is odd, so |Jλ | is odd) Y |Jλ |−1 Y  Y ± 2 ξλγ (tργ )· γ(c)l(ργ (c)) · χ+ λ (Dρ ) = ± Kρ · 2 γ∈Γ∗ (5.5) Y 2 γ∈Jλ = ± Kρ 2 l(Jλ ) 2 l(λγ ) 2 Y γ∈Γ∗ |ργ |−mλ √ ( −1) 2 Y c∈Γ∗ ′ c∈Γ∗ sQ γ∈Jλ c∈Γ∗ zργ (c)  2 Y  ξλγ (tργ )· γ(c)l(ργ (c)) · ||ρ||J −mJ √ λ λ 2 ( −1) ′ sQ γ∈Jλ γ∈Jλ Q c∈Γ∗ zργ (c) 2 (ii) The first case: if ρ can not be decomposed into ∪γ∈Γ∗ (ργ ) such + that ργ ∈ SP |λγ | (Γ∗ ), then we have χ+ λ (Dρ ) = 0. So we can assume that + ρ = ∪γ∈Γ∗ (ργ ) such that ργ ∈ SP |λγ | (Γ∗ ) and χ+ λ (Dρ ) 6= 0. ′ (1) When ργ ∈ OSP |ργ| (Γ∗ ) for γ ∈ Jλ , we claim that ργ ∈ [λγ ] for γ ∈ Jλ . In fact, let S be the set of conjugacy classes ρ such that ρ = XIAOLI HU AND NAIHUAN JING∗ 18 ∪γ∈Γ∗ (ργ ). It is easy to see that if ξλγ (tργ ) is nonzero then ργ must be in ′ OSP |λγ | (Γ∗ ) := OP |λγ | (Γ∗ ) ∩ SP |λγ | (Γ∗ ) for γ ∈ Jλ and ργ must be in [λγ ] for γ ∈ Jλ . Then X 1 X 1 + + 2 |χ+ (ρ)|2 = hχ+ |χ+ λ λ , χλ iSP 1n (Γ∗ ) ≥ λ (Dρ )| e Z ρ Zρ ρ∈S ρ∈S = X Kρ2 Q ρ∈S Y Y ′ γ∈Jλ c∈Γ∗ (5.6) γ∈Γ∗ 2l(ργ Q ) 1 l(ργ (c)) c∈Γ∗ zργ (c) ζc γ(c)2l(ργ (c)) ξλ2γ (tργ ) · 2l(Jλ ) 1 X Y Y γ(c)2l(ργ (c)) Y ≥ · l(ρ (c)) 2 ζc γ ′ ρ∈S γ∈Jλ c∈Γ∗ γ∈J λ 1 Y X ( ≥ Q 2 γ∈Jλ ργ ∈[λγ ] Y ′ γ∈Jλ = ( X Y 1 l(ργ (c)) c∈Γ∗ c∈Γ∗ ζc ργ ∈OSP |λγ | (Γ∗ ) Q c∈Γ∗ Q Q · Y Y γ∈Jλ c∈Γ∗ ′ γ∈Jλ Q γ(c)2l(ργ (c)) · c∈Γ∗ zργ (c) 2 γ(c)2l(ργ (c)) ξλ2γ (tργ ) Q l(ρ (c)) 2l(ργ ) c∈Γ∗ ζc γ c∈Γ∗ γ(c)2l(ργ (c)) )· γ(c)2l(ργ (c)) ξλ2γ (tργ ) 2l(ργ ) Zργ )· 1 1 Y ⊗l(ργ ) ⊗l(ργ ) hγ ,γ iΓl(ργ ) = . 2 2 γ∈Jλ + + 1 ± We have known that hχ+ / [λγ ] for λ , χλ iSP 1n (Γ∗ ) = 2 , so χλ (Dρ ) = 0 if ργ ∈ γ ∈ Jλ and also Kρ = 1. ′ (2) If ργ ∈ / OSP |λγ | (Γ∗ ) for γ ∈ Jλ , then there exists one ργ not in ′ OP |λγ | (Γ∗ ) for γ ∈ Jλ . Meanwhile, since ξλγ is a double spin character when ′ γ ∈ Jλ , it is known that it only has nonzero values at even conjugacy classes ±  (i.e. in OP n (Γ∗ )). Hence we have ξλγ (tργ ) = 0, therefore χ+ λ (Dρ ) = 0. With this result we have determined all remaining character values of e n. the spin characters for HΓ References [1] G. E. Andrews, Number theory, Dover Publ. Inc., New York, 1994. [2] D. Benson, Spin modules for symmetric groups, J. London Math. Soc. 38 (1988), 250-262. [3] I. B. Frenkel, N. Jing and W. Wang. Twisted vertex representations via spin groups and the McKay correspondence. Duke Math. J. 111 (2002), 51–96. [4] X. Hu and N. Jing. Spin characters of generalized symmetric groups. Monatsh. Math. 173 (2014), 495–518. [5] X. Hu and N. Jing. Projective irreducible characters of spin wreath products. Proc. Amer. Math. Soc. 143 (2015), 1015–1026. [6] N. Jing. Vectex operators, symmetric functions, and the spin group Γn . J. Algebra 138, (1991), 340–398. SPIN CHARACTERS OF HYPEROCTAHEDRAL WREATH PRODUCTS 19 [7] N. Jing and W. Wang. Twisted vertex representations and spin characters. Math. Zeit. 239 (2002), 715–746. [8] T. Józefiak. Semisimple superalgebras. In Some Current Trends in Algebra Proc. of the Varna Conf. 1986, Lect. Notes in Math. vol. 1352 (Springer-Verlag, 1988), pp. 96–113. [9] T. Józefiak. A class of projective presentations of hyperoctahedral group and Schur Q-functions. In Topics in algebra, Banach Center Publication, vol 26 (1990), pp. 317–326. [10] T. Józefiak. Relating spin representations of symmetric and hyperoctahedal groups. J. Pure and Applied Alg. 7 (2000), 187–193. [11] I. G. Macdonald. Symmetric functions and Hall polynomials, 2nd ed. (Oxford, 1995). [12] A. O. Morris. The spin representation of the symmetric group. Proc. London. Math. Soc. 12 (1962), 55–76. [13] A. O. Morris. Projective representations of Weyl groups. J. London Math. Soc. 8 (2) (1974), 125–133. [14] A. O. Morris and H. I Jones. Projective representations of generalized symmetric groups. Sém. Lothar. Combin. 50 (2003) Art. B50b, 27 pp. (electronic). [15] M. Nazarov. Young’s symmetrizers for projective representations of the symmetric group. Adv. Math. 127 (1997), no. 2, 190–257. [16] A. N. Sergeeev. Tensor algebra of the identity representation as a module over Lie superalgebras GL(n, m) and Q(n). Math. USSR Sbornik 51 (1985), no. 2, 419–425. [17] I. Schur. Über die Darstellung der symmertrischen und der alternierenden Gruppe durch gebrochene lineare Substitutionen. J. Reine Angew. Math. 139 (1911), 155– 250. [18] J. R. Stembridge. The projective representations of the hyperoctahedral group. J. Algebra 145 (1992), 396–453. [19] M. Yamaguchi. A duality of the twisted group algebra of the symmetric group and a Lie superalgebra. J. Algebra 222 (1999), 301–327. [20] M. Yamaguchi. A duality of a twisted group algebra of the hyperoctahedral group and the queer Lie superalgebra. In Combinatorial methods in representation theory (Kyoto, 1998), Adv. Stud. Pure Math. vol. 28 (Kinokuniya, Tokyo, 2000), pp. 401– 422. Hu: School of Mathematics and Computer Science, Jianghan University, Wuhan, Hubei 430056, China E-mail address: [email protected] Jing: Department of Mathematics, North Carolina State University, Raleigh, NC 27695, USA E-mail address: [email protected]
4math.GR
Explicit linear kernels for packing problems∗ Valentin Garnero† Christophe Paul† Dimitrios M. Thilikos†‡ Ignasi Sau† arXiv:1610.06131v1 [cs.DS] 19 Oct 2016 Abstract During the last years, several algorithmic meta-theorems have appeared (Bodlaender et al. [FOCS 2009], Fomin et al. [SODA 2010], Kim et al. [ICALP 2013]) guaranteeing the existence of linear kernels on sparse graphs for problems satisfying some generic conditions. The drawback of such general results is that it is usually not clear how to derive from them constructive kernels with reasonably low explicit constants. To fill this gap, we recently presented [STACS 2014] a framework to obtain explicit linear kernels for some families of problems whose solutions can be certified by a subset of vertices. In this article we enhance our framework to deal with packing problems, that is, problems whose solutions can be certified by collections of subgraphs of the input graph satisfying certain properties. F-Packing is a typical example: for a family F of connected graphs that we assume to contain at least one planar graph, the task is to decide whether a graph G contains k vertex-disjoint subgraphs such that each of them contains a graph in F as a minor. We provide explicit linear kernels on sparse graphs for the following two orthogonal generalizations of F-Packing: for an integer ` > 1, one aims at finding either minor-models that are pairwise at distance at least ` in G (`-F-Packing), or such that each vertex in G belongs to at most ` minors-models (F-Packing with `-Membership). Finally, we also provide linear kernels for the versions of these problems where one wants to pack subgraphs instead of minors. Keywords: Parameterized complexity; linear kernels; packing problems; dynamic programming; protrusion replacement; graph minors. 1 Introduction Motivation. A fundamental notion in parameterized complexity (see [10] for a recent textbook) is that of kernelization, which asks for the existence of polynomial-time preprocessing algorithms producing equivalent instances whose size depends exclusively on the parameter k. Finding kernels of size polynomial or linear in k (called linear kernels) ∗ Emails: Valentin Garnero: [email protected], Christophe Paul: [email protected], Ignasi Sau: [email protected], Dimitrios M. Thilikos: [email protected]. † AlGCo project-team, CNRS, LIRMM, Université de Montpellier, Montpellier, France. ‡ Department of Mathematics, National and Kapodistrian University of Athens, Athens, Greece. 1 is one of the major goals of this area. A pioneering work in this direction was the linear kernel of Alber et al. [2] for Dominating Set on planar graphs, generalized by Guo and Niedermeier [24] to a family of problems on planar graphs. Several algorithmic metatheorems on kernelization have appeared in the last years, starting with the result of Bodlaender et al. [5] on graphs of bounded genus. It was followed-up by similar results on larger sparse graph classes, such as graphs excluding a minor [20] or a topological minor [26]. The above results guarantee the existence of linear kernels on sparse graph classes for problems satisfying some generic conditions, but it is hard to derive from them constructive kernels with explicit constants. We recently made in [22] a significant step toward a fully constructive meta-kernelization theory on sparse graphs with explicit constants. In a nutshell, the main idea is to substitute the algorithmic power of CMSO logic that was used in [5, 20, 26] with that of dynamic programming (DP for short) on graphs of bounded decomposability (i.e., bounded treewidth). We refer the reader to the introduction of [22] for more details. Our approach provides a DP framework able to construct linear kernels for families of problems on sparse graphs whose solutions can be certified by a subset of vertices of the input graph, such as r-Dominating Set or Planar-F-Deletion. Our contribution. In this article we make one more step in the direction of a fully constructive meta-kernelization theory on sparse graphs, by enhancing the existing framework [22] in order to deal with packing problems. These are problems whose solutions can be certified by collections of subgraphs of the input graph satisfying certain properties. We call these problems packing-certifiable, as opposed to vertex-certifiable ones. For instance, deciding whether a graph G contains at least k vertex-disjoint cycles is a typical packing-certifiable problem. This problem, called Cycle Packing, is FPT as it is minor-closed, but it is unlikely to admit polynomial kernels on general graphs [6]. As an illustrative example, for a family of connected graphs F containing at least one planar graph, we provide a linear kernel on sparse graphs for the F-Packing problem1 : decide whether a graph G contains at least k vertex-disjoint subgraphs such that each of them contains a graph in F as a minor, parameterized by k. We provide linear kernels as well for the following two orthogonal generalizations of F-Packing: for an integer ` > 1, one aims at finding either minor-models that are pairwise at distance at least ` in G (`-F-Packing), or such that each vertex in G belongs to at most ` minorsmodels (F-Packing with `-Membership). While only the existence of linear kernels for F-Packing was known [5], to the best of our knowledge no kernels were known for `-F-Packing and F-Packing with `-Membership, except for `-F-Packing when F 1 We would like to clarify here that in our original conference submission of [22] we claimed, among other results, a linear kernel for F-Packing on sparse graphs. Unfortunately, while preparing the camera-ready version, we realized that there was a bug in one of the proofs and we had to remove that result from the paper. It turned out that for fixing that bug, several new ideas and a generalization of the original framework seemed to be necessary; this was the starting point of the results presented in the current article. 2 consists only of a triangle and the maximum degree is also considered as a parameter [3]. We would like to note that the kernels for F-Packing and for F-Packing with `Membership apply to minor-free graphs, while those for `-F-Packing for ` > 2 apply to the smaller class of apex-minor-free graphs. We also provide linear kernels for the versions of the above problems where one wants to pack subgraphs instead of minors (as one could expect, the kernels for subgraphs are considerably simpler than those for minors). We call the respective problems `-FSubgraph-Packing and F-Subgraph-Packing with `-Membership. While the first problem can be seen as a broad generalization of `-Scattered Set (see for instance [5, 22]), the second one was recently defined by Fernau et al. [16], motivated by the problem of discovering overlapping communities (see also [32, 33] for related problems about detecting overlapping communities): the parameter ` bounds the number of communities that a member of a network can belong to. More precisely, the goal is to find in a graph G at least k subgraphs isomorphic to a member of F such that every vertex in V (G) belongs to at most ` subgraphs. This type of overlap was also studied by Fellows et al. [15] in the context of graph editing. Fernau et al. [16] proved, in particular, that the F-Subgraph-Packing with `-Membership problem is NP-hard for all values of ` > 1 when F = {F } and F is an arbitrary connected graph with at least three vertices, but polynomial-time solvable for smaller graphs. Note that F-Subgraph-Packing with `Membership generalizes the F-Subgraph-Packing problem, which consists in finding in a graph G at least k vertex-disjoint subgraphs isomorphic to a member of F. The smallest kernel for the F-Subgraph-Packing problem [29] has size O(k r−1 ), where F = {F } and F is an arbitrary graph on r vertices. A list of references of kernels for particular cases of the family F can be found in [16]. Concerning the kernelization of F-Subgraph-Packing with `-Membership, Fernau et al. [16] provided a kernel on general graphs with O((r +1)r k r ) vertices, where r is the maximum number of vertices of a graph in F. In this article we improve this result on graphs excluding a fixed graph as a minor, by providing a linear kernel for F-Subgraph-Packing with `-Membership when F is any family of (not necessarily planar) connected graphs. Our techniques: vertex-certifiable vs. packing-certifiable problems. It appears that packing-certifiable problems are intrinsically more involved than vertex-certifiable ones. This fact is well-known when speaking about FPT-algorithms on graphs of bounded treewidth [11, 28], but we need to be more precise with what we mean by being “more involved” in our setting of obtaining kernels via DP on a tree decomposition of the input graph. Loosely speaking, the framework that we presented in [22] and that we need to redefine and extend here, can be summarized as follows. First of all, we propose a general definition of a problem encoding for the tables of DP when solving parameterized problems on graphs of bounded treewidth. Under this setting, we provide three general conditions guaranteeing that such an encoding can yield a so-called protrusion replacer, which in short is a procedure that replaces large “protrusions” (i.e., subgraphs with small treewidth and small boundary) with “equivalent” subgraphs of constant size. Let us be more concrete on these three conditions that such an encoding E needs to satisfy 3 in order to obtain an explicit linear kernel for a parameterized problem Π. The first natural condition is that on a graph G without boundary, the optimal size of the objects satisfying the constraints imposed by E coincides with the optimal size of solutions of Π in G; in that case we say that E is a Π-encoder. On the other hand, we need that when performing DP using the encoding E, we can use tables such that the maximum difference among all the values that need to be stored is bounded by a function g of the treewidth; in that case we say that E is g-confined. Finally, the third condition requires that E is “suitable” for performing DP, in the sense that the tables at a given node of a tree decomposition can be computed using only the information stored in the tables of its children (as it is the case of practically all natural DP algorithms); in that case we say that E is DP-friendly. These two latter properties exhibit some fundamental differences when dealing with vertex-certifiable or packing-certifiable problems. Indeed, as discussed in more detail in Section 3, with an encoding E we associate a function f E that corresponds, roughly speaking, to the maximum size of a partial solution that satisfies the constraints defined by E. In order for an encoder to be gconfined for some function g(t) of the treewidth t, for some vertex-certifiable problems such as r-Scattered Set (see [22]) we need to “force” the confinement artificially, in the sense that we directly discard the entries in the tables whose associated values differ by more than g(t) from the maximum (or minimum) ones. Fortunately, we can prove that an encoder with this modified function is still DP-friendly. However, this is not the case for packing-certifiable problems such as F-Packing. Intuitively, the difference lies on the fact that in a packing-certifiable problem, a solution of size k can contain arbitrarily many vertices (for instance, if one wants to find k disjoint cycles in an n-vertex graph with girth Ω(log n)) and so it can as well contain arbitrarily many vertices from any subgraph corresponding to a rooted subtree of a tree decomposition of the input graph G. This possibility prevents us from being able to prove that an encoder is DP-friendly while still being g-confined for some function g, as in order to fill in the entries of the tables at a given node, one may need to retrieve information from the tables of other nodes different from its children. To circumvent this problem, we introduce another criterion to discard the entries in the tables of an encoder: we recursively discard the entries of the tables whose associated partial solutions induce partial solutions at some lower node of the rooted tree decomposition that need to be discarded. That is, if an entry of the table needs to be discarded at some node of a tree decomposition, we propagate this information to all the other nodes. Organization of the paper. Some basic preliminaries can be found in Section 2, including graph minors, parameterized problems, (rooted) tree decompositions, boundaried graphs, the canonical equivalence relation ≡Π,t for a problem Π and an integer t, FII, protrusions, and protrusion decompositions. The reader not familiar with the background used in previous work on this topic may see [5, 20, 22, 26]. In Section 3 we introduce the basic definitions of our framework and present an explicit protrusion replacer for packing-certifiable problems. Since many definitions and proofs in this section are quite similar to the ones we presented in [22], for better readability we moved the 4 proofs of the results marked with ‘[?]’ to Appendix A. Before moving to the details of each particular problem, in Section 4 we summarize the main ingredients that we use in our applications. The next sections are devoted to showing how to apply our methodology to various families of problems. More precisely, we start in Section 5 with the linear kernel for Connected-Planar-F-Packing. This problem is illustrative, as it contains most of the technical ingredients of our approach, and will be generalized later in the two orthogonal directions mentioned above. Namely, in Section 6 we deal with the variant in which the minor-models are pairwise at distance at least `, and in Section 7 with the version in which each vertex can belong to at most ` minor-models. In Section 8 we adapt the machinery developed for packing minors to packing subgraphs, considering both variants of the problem. For the sake of completeness, each of the considered problems will be redefined in the corresponding section. Finally, Section 9 concludes the article. 2 Preliminaries In our article graphs are undirected, simple, and without loops. We use standard graphtheoretic notation; see for instance [13]. We denote by dG (v, w) the distance in G between two vertices v and w and by dG (W1 , W2 ) = min{dG (w1 , w2 ) : w1 ∈ W1 , w2 ∈ W2 } the distance between two sets of vertices W1 and W2 of G. Given S ⊆ V (G), we denote by N (S) the set of vertices in V (G) \ S having at least one neighbor in S. Definition 1. A parameterized graph problem Π is called packing-certifiable if there exists a language LΠ (called certifying language for Π) defined on pairs (G, S), where G is a graph and S is a collection of subgraphs of G, such that (G, k) is a Yes-instance of Π if and only if there exists a collection S of subgraphs of G with |S| > k such that (G, S) ∈ LΠ . In the above definition, for the sake of generality we do not require the subgraphs in the collection S to be pairwise distinct. Also, note that the subclass of packing-certifiable problems where each subgraph in S is restricted to consist of a single vertex corresponds to the class of vertex-certifiable problems defined in [22]. For a class of graphs G, we denote by ΠG the problem Π where the instances are restricted to contain graphs belonging to G. With a packing-certifiable problem we can associate in a natural way an optimization function as follows. Definition 2. Given a packing-certifiable parameterized problem Π, the maximization function f Π : Γ∗ → N ∪ {−∞} is defined as  max{|S| : (G, S) ∈ LΠ } , if there exists such an S and Π f (G) = (1) −∞ , otherwise. Definition 3. A boundaried graph is a graph G with a set B ⊆ V (G) of distinguished vertices and an injective labeling λG : B → N. The set B is called the boundary of G 5 and it is denoted by ∂(G). The set of labels is denoted by Λ(G) = {λG (v) : v ∈ ∂(G)}. We say that a boundaried graph is a t-boundaried graph if Λ(G) ⊆ {1, . . . , t}. We denote by Bt the set of all t-boundaried graphs. Definition 4. Let G1 and G2 be two boundaried graphs. We denote by G1 ⊕G2 the graph obtained from G by taking the disjoint union of G1 and G2 and identifying vertices with the same label in the boundaries of G1 and G2 . In G1 ⊕ G2 there is an edge between two labeled vertices if there is an edge between them in G1 or in G2 . Given G = G1 ⊕ G2 and G02 , we say that G0 = G1 ⊕ G02 is the graph obtained from G by replacing G2 with G02 . The following notion was introduced by Bodlaender el al. [5]. Definition 5. Let Π be a parameterized problem and let t ∈ N. Given G1 , G2 ∈ Bt , we say that G1 ≡Π G2 if Λ(G1 ) = Λ(G2 ) and there exists a transposition constant ∆Π,t (G1 , G2 ) ∈ Z such that for every H ∈ Bt and every k ∈ Z, it holds that (G1 ⊕H, k) ∈ Π if and only if (G2 ⊕ H, k + ∆Π,t (G1 , G2 )) ∈ Π. Definition 6. A tree decomposition of a graph G is a couple (T, X = {Bx : x ∈ V (T )}), S where T is a tree and such that x∈V (T ) Bx = V (G), for every edge {u, v} ∈ E(G) there exists x ∈ V (T ) such that u, v ∈ Bx , and for every vertex u ∈ V (G) the set of nodes {x ∈ V (T ) : u ∈ Bx } induce a subtree of T . The vertices of T are referred to as nodes and the sets Bx are called bags. A rooted tree decomposition (T, X , r) is a tree decomposition with a distinguished node r selected as the root. A nice tree decomposition (T, X , r) (see [27]) is a rooted tree decomposition where T is binary and for each node x with two children y, z it holds Bx = By = Bz and for each node x with one child y it holds Bx = By ∪ {u} or Bx = By \ {u} for some u ∈ V (G). The width of a tree decomposition is the size of a largest bag minus one. The treewidth of a graph, denoted by tw(G), is the smallest width of a tree decomposition of G. A treewidth-modulator of a graph G is a set X ⊆ V (G) such that tw(G − X) 6 t, for some fixed constant t. Given a bag B (resp. a node x) of a rooted tree decomposition T , we denote by GB (resp. Gx ), the subgraph induced by the vertices appearing in the subtree of T rooted at the node corresponding to B (resp. the node x). We denote by Ft the set of all t-boundaried graphs that have a rooted tree decomposition of width t − 1 with all boundary vertices contained in the root-bag. Obviously Ft ⊆ Bt . (Note that graphs can be viewed as 0-boundaried graphs, hence we use a same alphabet Γ for describing graphs and boundaried graphs.) Definition 7. Let t, α be positive integers. A t-protrusion Y of a graph G is an induced subgraph of G with |∂(Y )| 6 t and tw(Y ) 6 t − 1, where ∂(Y ) is the set of vertices of Y having neighbors in V (G) \ V (Y ). An (α, t)-protrusion decomposition of a graph G is a partition P = Y0 ] Y1 ] · · · ] Y` of V (G) such that for every 1 6 i 6 `, N (Yi ) ⊆ Y0 , max{`, |Y0 |} 6 α, and for every 1 6 i 6 `, Yi ∪N (Yi ) is a t-protrusion of G. When (G, k) 6 is the input of a parameterized problem with parameter k, we say that an (α, t)-protrusion decomposition of G is linear whenever α = O(k). We say that a rooted tree decomposition of a protrusion G (resp. a boundaried graph G) is boundaried if the boundary ∂(G) is contained in the root bag. In the following we always consider boundaried nice tree decompositions of width t − 1, which can be computed in polynomial time for fixed t [4, 27]. 3 A framework to replace protrusions for packing problems In this section we restate and in many cases modify the definitions given in [22] in order to deal with packing-certifiable problems; we will point out the differences. As announced in the introduction, missing proofs can be found in Appendix A. Encoders. In the following we extend the definition of an encoder given in [22, Definition 3.2] so that it is able to deal with packing-certifiable problems. The main difference is that now the function f E is incorporated in the definition of an encoder, since as discussed in the introduction we need to consider an additional scenario where the entries of the table are discarded (technically, this is modeled by setting those entries to “−∞”) and for this we will have to deal with the partial solutions particular to each problem. In the applications of the next sections, we will call such functions that propagate the entries to be discarded relevant. We also need to add a condition about the computability of the function f E , so that encoders can indeed be used for performing dynamic programming. Definition 8. An encoder is a triple E = (C E , LE , f E ) where ∗ C E is a function in 2N → 2Υ that maps a finite subset of integers I ⊆ N to a set C E (I) of strings over some alphabet Υ. Each string R ∈ C E (I) is called an encoding. The size of the encoder is the function sE : N → N defined as sE (t) := max{|C E (I)| : I ⊆ {1, . . . , t}}, where |C E (I)| denotes the number of encodings in C E (I); LE is a computable language which accepts triples (G, S, R) ∈ Γ∗ × Σ∗ × Υ∗ , where G is a boundaried graph, S is a collection of subgraphs of G and R ∈ C E (Λ(G)) is an encoding. If (G, S, R) ∈ LE , we say that S satisfies the encoding R in G; and f E is a computable function in Γ∗ × Υ∗ → N ∪ {−∞} that maps a boundaried graph G and an encoding R ∈ C E (Λ(G)) to an integer or to −∞. As it will become clear with the applications described in the next sections, an encoder is a formalization of the tables used by an algorithm that solves a packingcertifiable problem Π by doing DP over a tree decomposition of the input graph. The encodings in C E (I) correspond to the entries of the DP-tables of graphs with boundary labeled by the set of integers I. The language LE identifies certificates which are partial solutions satisfying the boundary conditions imposed by an encoding. 7 The following definition differs from [22, Definition 3.3] as now the function f E is incorporated in the definition of an encoder E. Definition 9. Let Π be a packing-certifiable problem. An encoder E is a Π-encoder if C E (∅) is a singleton, denoted by {R∅ }, such that for any 0-boundaried graph G, f E (G, R∅ ) = f Π (G). The following definition allows to control the number of possible distinct values assigned to encodings and plays a similar role to FII or monotonicity in previous work [5, 20, 26]. Definition 10. An encoder E is g-confined if there exists a function g : N → N such that for any t-boundaried graph G with Λ(G) = I it holds that either {R ∈ C E (I) : f E (G, R) 6= −∞} = ∅ or maxR {f E (G, R) 6= −∞} − minR {f E (G, R) 6= −∞} 6 g(t). For an encoder E and a function g, in the next sections we will denote the relevant functions discussed before by f¯gE to distinguish them from other functions that we will need. Equivalence relations and representatives. We now define some equivalence relations on t-boundaried graphs. Definition 11. Let E be an encoder, let G1 , G2 ∈ Bt , and let G be a class of graphs. 1. G1 ∼∗E,t G2 if Λ(G1 ) = Λ(G2 ) =: I and there exists an integer ∆E,t (G1 , G2 ) (depending on G1 , G2 ) such that for any encoding R ∈ C E (I) we have f E (G1 , R) = f E (G2 , R) − ∆E,t (G1 , G2 ). 2. G1 ∼G,t G2 if either G1 ∈ / G and G2 ∈ / G, or G1 , G2 ∈ G and, for any H ∈ Bt , H ⊕ G1 ∈ G if and only if H ⊕ G2 ∈ G. 3. G1 ∼∗E,G,t G2 if G1 ∼∗E,t G2 and G1 ∼G,t G2 . 4. If we restrict the graphs G1 , G2 to be in Ft , then the corresponding equivalence relations, which are a restriction of ∼∗E,t and ∼∗E,G,t , are denoted by ∼E,t and ∼E,G,t , respectively. If for all encodings R, f E (G1 , R) = f E (G2 , R) = −∞, then we set ∆E,t (G1 , G2 ) := 0 (note that any fixed integer would satisfy the first condition in Definition 11). Following the notation of Bodlaender et al. [5], the function ∆E,t is called the transposition function for the equivalence relation ∼∗E,t . Note that we can use the restriction of ∆E,t to couples of graphs in Ft to define the equivalence relation ∼E,t . In the following we only consider classes of graphs whose membership can be expressed in Monadic Second Order (MSO) logic. Therefore, we know that the number of equivalence classes of ∼G,t is finite [7], say at most rG,t , and we can state the following lemma. 8 Lemma 1. [?] Let G be a class of graphs whose membership is expressible in MSO logic. For any encoder E, any function g : N → N and any integer t ∈ N, if E is g-confined then the equivalence relation ∼∗E,G,t has at most r(E, g, t, G) := (g(t) + 2)sE (t) · 2t · rG,t equivalence classes. In particular, the equivalence relation ∼E,G,t has at most r(E, g, t, G) equivalence classes as well. Definition 12. An equivalence relation ∼∗E,G,t is DP-friendly if, for any graph G ∈ Bt with ∂(G) = A and any two boundaried graphs H and GB with G = H ⊕ GB such that GB has boundary B ⊆ V (G) with |B| 6 t and A ∩ V (GB ) ⊆ B, the following holds. Let G0 ∈ Bt with ∂(G0 ) = A be the graph obtained from G by replacing the subgraph GB with some G0B ∈ Bt such that GB ∼∗E,G,t G0B . Then G ∼∗E,G,t G0 and ∆E,t (G, G0 ) = ∆E,t (GB , G0B ). The following useful fact states that for proving that ∼∗E,G,t is DP-friendly, it suffices to prove that G ∼∗E,t G0 instead of G ∼∗E,G,t G0 . Fact 1. [?] Let G ∈ Bt with a separator B, let GB ∼E,G,t G0B , and let G0 ∈ Bt as in Definition 12. If G ∼∗E,t G0 , then G ∼∗E,G,t G0 . In order to perform a protrusion replacement that does not modify the behavior of the graph with respect to a problem Π, we need the relation ∼∗E,t to be a refinement of the canonical equivalence relation ≡Π,t . Lemma 2. [?] Let Π be a packing-certifiable parameterized problem defined on a graph class G, let E be an encoder, let g : N → N, and let G1 , G2 ∈ Bt . If E is a g-confined Πencoder and ∼∗E,G,t is DP-friendly, then the fact that G1 ∼∗E,G,t G2 implies the following: • G1 ≡Π G2 ; and • ∆Π,t (G1 , G2 ) = ∆E,t (G1 , G2 ). In particular, this holds when G1 , G2 ∈ Ft and G1 ∼E,G,t G2 . Definition 13. Given an encoder E and an equivalence class C ⊆ Ft of ∼E,G,t , a graph G ∈ C is a progressive representative of C if for any G0 ∈ C, it holds that ∆E,t (G, G0 ) 6 0. Lemma 3. [?] Let G be a class of graphs whose membership is expressible in MSO logic. For any encoder E, any function g : N → N, and any t ∈ N, if E is g-confined and ∼∗E,G,t is DP-friendly, then any equivalence class of ∼E,G,t has a progressive representative of size at most b(E, g, t, G) := 2r(E,g,t,G)+1 · t, where r(E, g, t, G) is the function defined in Lemma 1. An explicit protrusion replacement. The next lemma specifies conditions under which, given an upper bound on the size of the representatives, a generic DP algorithm can provide in linear time an explicit protrusion replacer. 9 Lemma 4. [?] Let G be a class of graphs, let E be an encoder, let g : N → N, and let t ∈ N such that E is g-confined and ∼∗E,G,t is DP-friendly. Assume we are given an upper bound b > t on the size of a smallest progressive representative of any class of ∼E,G,t . Given a t-protrusion Y inside some graph, we can compute a t-protrusion Y 0 of size at most b such that Y ∼E,G,t Y 0 and ∆E,t (Y 0 , Y ) 6 0. Furthermore, such a protrusion can be computed in time O(|Y |), where the hidden constant depends only on E, g, b, G, and t. Let us now piece everything together to state the main result of [22] that we need to reprove here for packing-certifiable problems. For issues of constructibility, we restrict G to be the class of H-(topological)-minor-free graphs. Theorem 1. [?] Let G be the class of graphs excluding some fixed graph H as a (topological) minor and let Π be a parameterized packing-certifiable problem defined on G. Let E be an encoder, let g : N → N, and let t ∈ N such that E is a g-confined Π-encoder and ∼∗E,G,t is DP-friendly. Given an instance (G, k) of Π and a t-protrusion Y in G, we can compute in time O(|Y |) an equivalent instance (G − (Y − ∂(Y )) ⊕ Y 0 , k 0 ) where Y 0 is a t-protrusion with |Y 0 | 6 b(E, g, t, G) and k 0 6 k and where b(E, g, t, G) is the function defined in Lemma 3. Such a protrusion replacer can be used to obtain a kernel when, for instance, one is able to provide a protrusion decomposition of the instance. Corollary 1. [?] Let G be the class of graphs excluding some fixed graph H as a (topological) minor and let Π be a parameterized packing-certifiable problem defined on G. Let E be an encoder, let g : N → N, and let t ∈ N such that E is a g-confined Π-encoder and ∼∗E,G,t is DP-friendly. Given an instance (G, k) of Π and an (αk, t)-protrusion decomposition of G, we can construct a linear kernel for Π of size at most (1 + b(E, g, t, G)) · α · k, where b(E, g, t, G) is the function defined in Lemma 3. 4 Main ideas for the applications In this section by sketch the main ingredients that we use in our applications for obtaining the linear kernels, before going through the details for each problem in the next sections. General methodology. The next theorem will be fundamental in the applications. Theorem 2 (Kim et al. [26]). Let c, t be two positive integers, let H be an h-vertex graph, let G be an n-vertex H-topological-minor-free graph, and let k be a positive integer. If we are given a set X ⊆ V (G) with |X| 6 c · k such that tw(G − X) 6 t, then we can compute in time O(n) an ((αH · t · c) · k, 2t + h)-protrusion decomposition of G, where αH is a constant depending only on H, which is upper-bounded by 40h2 25h log h . A typical application of our framework for obtaining an explicit linear kernel for a packing-certifiable problem Π on a graph class G is as follows. The first task is to define an encoder E and to prove that for some function g : N → N, E is a g-confined 10 Π-encoder and ∼∗E,G,t is DP-friendly. The next ingredient is a polynomial-time algorithm that, given an instance (G, k) of Π, either reports that (G, k) is a Yes-instance (or a No-instance, depending on the problem), or finds a treewidth-modulator of G with size O(k). The way to obtain this algorithm depends on each particular problem and in our applications we will use a number of existing results in the literature in order to find it. Once we have such a linear treewidth-modulator, we can use Theorem 2 to find a linear protrusion decomposition of G. Finally, it just remains to apply Corollary 1 to obtain an explicit linear kernel for Π on G; see Figure 1 for a schematic illustration. Algorithm with two possible outputs given an instance (G, k) of a problem Π defined on a graph class G (G, k) is a Yes/No-instance Treewidth-modulator of size O(k) Π-encoder confined + DP-friendly Theo. 2 Linear protrusion decomposition Coro. 1 Linear kernel for Π on G Figure 1: Illustration of a typical application of the framework presented in this article. Let us provide here some generic intuition about the additional criterion mentioned in the introduction to discard the entries in the tables of an encoder. For an encoder E = (C E , LE , f E ) and a function g : N → N, we need some notation in order to define the relevant function f¯gE , which will be an appropriate modification of f E . Let G ∈ Bt with boundary A and let RA be an encoding. We (recursively) define RA to be irrelevant for f¯gE if there exists a certificate S such that (G, S, RA ) ∈ LE and |S| = f E (G, RA ) and a separator B ⊆ V (G) with |B| 6 t and B 6= A, such that S induces an encoding RB in the graph GB ∈ Bt with f¯gE (GB , RB ) = −∞. Here, by using the term “induces” we implicitly assume that S defines an encoding RB in the graph GB ; this will be the case in all the encoders used in our applications. To define f¯gE , we will always use the following natural function f E , which for each problem Π is meant to correspond to an extension to boundaried graphs of the maximization function f Π of Definition 2. For a graph G and an encoding R, this natural function is defined as f E (G, R) = max{k : ∃S, |S| > k, (G, S, R) ∈ LE }. Then we define the function f¯gE as follows: f¯gE (G, RA ) =    if f E (G, RA ) + g(t) < max{f E (G, R) : R ∈ C E (Λ(G))}, or if RA is irrelevant for f¯gE . f E (G, RA ), otherwise. −∞, That is, we will use the modified encoder (C E , LE , f¯gE ). We need to guarantee that the above function f¯gE is computable, as required2 in Definition 8. Indeed, from the definition it follows that an encoding RA defined at a node x of a given tree decomposition is The fact that the values of the function f¯gE can be calculated is important, in particular, in the proof of Lemma 4, since we need to be able to compute equivalence classes of the equivalence relation ∼E,G,t . 2 11 irrelevant if and only if RA can be obtained by combining encodings corresponding to the children of x, such that at least one of them is irrelevant. This latter property can be easily computed recursively on a tree decomposition, by performing standard dynamic programming. We will omit this computability issue in the applications, as the same argument sketched here applies to all of them. In order to obtain the linear treewidth-modulators mentioned before, we will use several results from [5, 19, 20], which in turn use the following two propositions. For an integer r > 2, let Γr be the graph obtained from the (r × r)-grid by triangulating internal faces such that all internal vertices become of degree 6, all non-corner external vertices are of degree 4, and one corner of degree 2 is made adjacent to all vertices of the external face (the corners are the vertices that in the underlying grid have degree 2). As an example, the graph Γ6 is shown in Figure 2. Figure 2: The graph Γ6 . Proposition 1 (Demaine and Hajiaghayi [12]). There is a function fm : N → N such that for every h-vertex graph H and every positive integer r, every H-minor-free graph with treewidth at least fm (h) · r, contains the (r × r)-grid as a minor. Proposition 2 (Fomin et al. [17]). There is a function fc : N → N such that for every h-vertex apex graph H and every positive integer r, every H-minor-free graph with treewidth at least fc (h) · r, contains the graph Γr as a contraction. 2 The current best upper bound [25] for the function fm is fm (h) = 2O(h log h) and, up to date, there is no explicit bound for the function fc . We would like to note that this non-existence of explicit bounds for fc is an issue that concerns the graph class of H-minor-free graphs and it is perfectly compatible with our objective of providing explicit constants for particular problems defined on that graph class, which will depend on the function fc . Let us now provide a sketch of the main basic ingredients used in each of the applications. 12 Packing minors. Let F be a fixed finite set of graphs. In the F-Packing problem, we are given a graph G and an integer parameter k and the question is whether G has k vertex-disjoint subgraphs G1 , . . . , Gk , each containing some graph in F as a minor. When all the graphs in F are connected and F contains at least one planar graph, we call the problem Connected-Planar-F-Packing. The encoder uses the notion of rooted packing introduced by Adler et al. [1], which we also used in [22] for ConnectedPlanar-F-Deletion. To obtain the treewidth-modulator, we use the Erdős-Pósa property for graph minors [8, 14, 30]. More precisely, we use that on minor-free graphs, as proved by Fomin et al. [21], if (G, k) is a No-instance of Connected-PlanarF-Packing, then (G, k 0 ) is a Yes-instance of Connected-Planar-F-Deletion for k 0 = O(k). Finally, we use a result of Fomin et al. [20] that provides a polynomial-time algorithm to find treewidth-modulators for Yes-instances of Connected-Planar-FDeletion. The obtained constants involve, in particular, the currently best known constant-factor approximation of treewidth on minor-free graphs. Packing scattered minors. Let F be a fixed finite set of graphs and let ` be a positive integer. In the `-F-Packing problem, we are given a graph G and an integer parameter k and the question is whether G has k subgraphs G1 , . . . , Gk pairwise at distance at least `, each containing some graph from F as a minor. The encoder for `-F-Packing is a combination of the encoder for F-Packing and the one for `-Scattered Set that we used in [22]. For obtaining the treewidth-modulator, unfortunately we cannot proceed as for packing minors, as up to date no linear Erdős-Pósa property √ for packing scattered planar minors is known; the best bound we are aware of is O(k k), which is not enough to obtain a linear kernel. To circumvent this problem, we use the following trick: we (artificially) formulate `-F-Packing as a vertex-certifiable problem and prove that it fits the conditions required by the framework of Fomin et al. [20] to produce a treewidth-modulator. (We would like to stress that this formulation of the problem as a vertex-certifiable one is not enough to apply the results of [22], as one has to further verify the necessary properties of the encoder are satisfied and it does not seem to be an easy task at all.) Once we have it, we consider the original formulation of the problem to define its encoder. As a drawback of resorting to the general results of [20] and, due to the fact that `-F-Packing is contraction-bidimensional, we provide linear kernels for the problem on the (smaller) class of apex-minor-free graphs. Packing overlapping minors. Let F be a fixed finite set of graphs and let ` be a positive integer. In the F-Packing with `-Membership problem, we are given a graph G and an integer parameter k and the question is whether G has k subgraphs G1 , . . . , Gk such that each subgraph contains some graph from F as a minor, and each vertex of G belongs to at most ` subgraphs. The encoder is an enhanced version of the one for packing minors, in which we allow a vertex to belong simultaneously to several minor-models. To obtain the treewidth-modulator, the situation is simpler than above, thanks to the fact that a packing of models is in particular a packing of models with `-membership. This allows us to use the linear Erdős-Pósa property that we described 13 for packing minors and therefore to construct linear kernels on minor-free graphs. Packing scattered and overlapping subgraphs. The definitions of the corresponding problems are similar to the ones above, just by replacing the minor by the subgraph relation. The encoders are simplified versions of those that we defined for packing scattered and overlapping minors, respectively. The idea for obtaining the treewidthmodulator is to apply a simple reduction rule that removes all vertices not belonging to any of the copies of the subgraphs we are looking for. It can be easily proved that if a reduced graph is a No-instance of the problem, then it is a Yes-instance of `0 Dominating Set, where `0 is a function of the integer ` corresponding to the problem and the largest diameter of a subgraph in the given family. We are now in position to use the machinery of [20] for `0 -Dominating Set and find a linear treewidth-modulator. 5 A linear kernel for Connected-Planar-F-Packing Let F be a finite set of graphs. We define the F-Packing problem as follows. F-Packing Instance: Parameter: Question: A graph G and a non-negative integer k. The integer k. Does G have k vertex-disjoint subgraphs G1 , . . . , Gk each containing some graph in F as a minor? In order to build a protrusion decomposition for instances of the above problem, we use a version of the Erdős-Pósa property (see Definition 16 and Theorem 3) that establishes a linear relation between No-instances of F-Packing and Yes-instances of F-Deletion, and then we apply tools of Bidimensionality theory on F-Deletion (see Corollary 2). Hence, we also need to define the F-Deletion problem. F-Deletion Instance: Parameter: Question: A graph G and a non-negative integer k. The integer k. Does G have a set S ⊆ V (G) such that |S| 6 k and G − S is H-minor-free for every H ∈ F? When all the graphs in F are connected, the corresponding problems are called Connected-F-Packing and Connected-F-Deletion, and when F contains at least one planar graph, we call them Planar-F-Packing and Planar-F-Deletion, respectively. When both conditions are satisfied, the problems are called ConnectedPlanar-F-Packing and Connected-Planar-F-Deletion (the parameterized versions of these problems are respectively denoted by cFP, cFD, pFP, pFD, cpFP, and cpFD). 14 In this section we present a linear kernel for Connected-Planar-F-Packing on the family of graphs excluding a fixed graph H as a minor. We need to define which kind of structure a certificate for F-Packing is. For an arbitrary graph, a solution will consist of a packing of models as defined below. We also recall the definition of model. Definition 14. A model of a graph F in a graph G is a mapping Φ that assigns to every vertex v ∈ V (F ) a non-empty connected subgraph Φ(v) of G, and to every edge e ∈ E(F ) an edge Φ(e) ∈ E(G), such that: • the graphs Φ(v) for v ∈ V (F ) are mutually vertex-disjoint and the edges Φ(e) for e ∈ E(F ) are pairwise distinct; • for {u, v} ∈ E(F ), Φ({u, v}) has one endpoint in V (Φ(u)) and the other in V (Φ(v)). We denote by Φ(F ) the subgraph of G obtained by the (disjoint) union of the subgraphs Φ(v) for v ∈ V (F ) plus the edges Φ(e) for e ∈ E(F ). Definition 15. Given a set F of minors and a graph G, a packing of models S is a set of vertex-disjoint models. That is, the graphs Φ(F ) for Φ ∈ S, F ∈ F are pairwise vertex-disjoint. 5.1 A protrusion decomposition for an instance of F-Packing In order to find a linear protrusion decomposition, we need some preliminaries. Definition 16. A class of graphs F satisfies the Erdős-Pósa property [14] if there exists a function f such that, for every integer k and every graph G, either G contains k vertexdisjoint subgraphs each isomorphic to a graph in F, or there is a set S ⊆ V (G) of at most f (k) vertices such that G − S has no subgraph in F. Given a connected graph F , let M(F ) be the class of graphs that can be contracted to F . Robertson and Seymour [30] proved that M(F ) satisfies the Erdős-Pósa property if and only if F is planar. A significant improvement on the function f (k) has been recently provided by Chekuri and Chuzhoy [8]. When G belongs to a proper minorclosed family, Fomin et al. [21] proved that f can be taken to be linear for any planar graph F . It is not difficult to see that these results also hold if instead of a connected planar graph F , we consider a finite family F of connected graphs containing at least one planar graph. This discussion can be summarized as follows, with a precise upper bound on the desired linear constant. Theorem 3 (Fomin et al. [21]). Let F be a finite family of connected graphs containing at least one planar graph on r vertices, let H be an h-vertex graph, and let G be the class of H-minor-free graphs. There exists a constant c such that if (G, k) ∈ / cpFPG , then (G, c · r · 215h+8h log h · k) ∈ cpFDG . 15 The next theorem provides a way to find a treewidth-modulator for an instance of a problem verifying the so-called bidimensionality and separability properties restricted to the class of (apex)-minor-free graphs. Loosely speaking, the algorithm consists in building a tree decomposition of the instance, then finding a bag that separates the instance in such a way that the solution is balanced, and finally finding recursively other bags in the two new tree decompositions. In order to make the algorithm constructive, we need to build a tree decomposition of the input graph whose width differs from the optimal one by a constant factor. To this aim, we use a (polynomial) approximation algorithm of treewidth on minor-free graphs, which is well-known to exist. Let us denote by τH this approximation ratio. To the best of our knowledge there is no explicit upper bound on this ratio, but one can be derived from the proofs of Demaine and Hajiaghayi [12]. We note that any improvement on this constant will directly translate to the size of our kernels. We also need to compute an initial solution of the problem under consideration. Fortunately, for all our applications, there is an EPTAS on minorfree graphs [19]. By choosing the approximation ratio of the solution to be 2, we can announce the following theorem adapted from Fomin et al. [20]. Theorem 4 (Fomin et al. [20]). For any real ε > 0 and any minor-bidimensional (resp. contraction-bidimensional) linear-separable problem Π on the class G of graphs that exclude a minor H (resp. an apex-minor H), there exists an integer t > 0 such that any graph G ∈ G has a treewidth-t-modulator of size at most ε · f Π (G). The impact of the tree decomposition approximation is hidden in the value of t, and the impact of the solution approximation will be hidden in the “O” notation. The parameters from the class of graphs or from the problem will affect the time complexity of the algorithm, and not the size of our kernel. In our applications we state corollaries of the above result (namely, Corollary 2 and Corollary 3) in which we choose ε = 1 and we provide an explicit bound on the value of t. We are in position to state the following corollary claiming that, given an instance of Planar-F-Deletion, in polynomial time we can either find a treewidth-modulator or report that is a No-instance. This is a corollary of the result of Fomin et al. [20] stated in Theorem 4, where ε is fixed to be 1. The bound on the treewidth is derived from the proof of Theorem 4 in [20]. Corollary 2. Let F be a finite set of graphs containing at least one r-vertex planar graph F , let H be an h-vertex graph, and let G be the class of H-minor-free graphs. If (G, k 0 ) ∈ pFDG , then there exists a set X ⊆ V (G) such that |X| = k 0 and tw(G − X) = √ 3 · f (h)3 ). Moreover, given an instance (G, k) with |V (G)| = n, there is an O(r r · τH m algorithm running in time O(n3 ) that either finds such a set X or correctly reports that (G, k) ∈ / pFDG . Note that since in Theorem 4 the value of ε can be chosen arbitrarily, we can state many variants of the above corollary. For instance, in our previous article [22], we used the particular case where |X| = O(r · fm (h) · k 0 ) and tw(G − X) = O(r · fm (h)2 ). We are now able to construct a linear protrusion decomposition. 16 Lemma 5. Let F be a finite set of graphs containing at least one r-vertex planar graph F , let H be an h-vertex graph, and let G be the class of H-minor-free graphs. Let (G, k) be an instance of Connected-Planar-F-Packing. If (G, k) ∈ / cpFPG , then we can construct in polynomial time a linear protrusion decomposition of G. Proof. Given an instance (G, k) of cpFPG , we run the algorithm given by Corollary 2 for the Connected-Planar-F-Deletion problem with input (G, k 0 = c·r·215h+8h log h ·k). If the algorithm is not able to find a treewidth-modulator X of size |X| = k 0 , then by Theorem 3 we can conclude that (G, k) ∈ cpFPG . Otherwise, we use the set X as input to the algorithm given by Theorem 2, which outputs in linear time an ((αH ·t)·k 0 , 2t+h)protrusion decomposition of G, where √ 3 · f (h)3 ) is provided by Corollary 2 (the bound on the treewidth); • t = O(r r · τH m • k 0 = O(r · 2O(h log h) · k) is provided by Theorem 3 (the parameter of F-Deletion); and • αH = O(h2 2O(h log h) ) is the constant provided by Theorem 2.  3 · f (h)3 ) · k, O(r √r · τ 3 · f (h)3 ) That is, we obtained an O(h2 2O(h log h) · r5/2 · τH m m H protrusion decomposition of G, as claimed. 5.2 An encoder for F-Packing Our encoder EFP for F-Packing uses the notion of rooted packing [1], and is inspired by results on the Cycle Packing problem [5]. Assume first for simplicity that F = {F } consists of a single connected graph F . Following [1], we introduce a combinatorial object called rooted packing. These objects are originally defined for branch decompositions, but can easily be translated to tree decompositions. Loosely speaking, rooted packings capture how potential models of F intersect the separator that the algorithm is processing. It is worth mentioning that the notion of rooted packing is related to the notion of folio introduced by Robertson and Seymour [31], but more suited to dynamic programming. Definition 17. Let F be a connected graph. Given a set B of boundary vertices of the input graph G, we define a rooted packing of B as a quintuple (A, SF∗ , SF , ψ, χ), where • SF ⊆ SF∗ are both subsets of V (F ); • A is a (possible empty) collection of mutually disjoint non-empty subsets of B; • ψ : A → SF is a surjective mapping assigning vertices of SF to the sets in A; and • χ : SF × SF → {0, 1} is a binary symmetric function between pairs of vertices in SF . 17 We also define a potential model of F in G matching with (A, SF∗ , SF , ψ, χ) as a partial mapping Φ, that assigns to every vertex v ∈ SF a non-empty subgraph Φ(v) ⊆ G such that {A ∈ A : ψ(A) = v} is the set of intersections of B with connected components of Φ(v); to every vertex v ∈ SF∗ \ SF a non-empty connected subgraph Φ(v) ⊆ G; and to every edge e ∈ {e ∈ E(F ) : χ(e) = 1 ∨ e ∈ SF∗ × SF∗ \ SF } an edge Φ(e) ∈ E(G), such that Φ satisfies the two following conditions (as in Definition 14): • the graphs Φ(v) for v ∈ V (F ) are mutually vertex-disjoint and the edges Φ(e) for e ∈ E(F ) are pairwise distinct; and • for {u, v} ∈ E(F ), Φ({u, v}) has one endpoint in V (Φ(u)) and the other in V (Φ(v)). ψ χ=1 χ=1 χ=0 SF SF∗ Figure 3: Example of a rooted packing (left) and a potential model matching with it (right). See Figure 3 for a schematic illustration of the above definition. The intended meaning of a rooted packing (A, SF∗ , SF , ψ, χ) on a separator B is as follows. The packing A represents the intersection of the connected components of the potential model with B. The subsets SF∗ , SF ⊆ V (F ) and the function χ indicate that we are looking in the graph G for a potential model of F [SF∗ ] containing the edges between vertices in SF given by the function χ. Namely, the function χ captures which edges of F [SF∗ ] have been realized so far in the processed graph. Since we allow the vertex-models intersecting B to be disconnected, we need to keep track of their connected components. The subset SF ⊆ SF∗ tells us which vertex-models intersect B (in other words, SF is the boundary of F [SF∗ ]), and the function ψ associates the sets in A with the vertices in SF . We can think of ψ as a coloring that colors the subsets in A with colors given by the vertices in SF . Note that several subsets in A can have the same color u ∈ SF , which means that 18 the vertex-model of u in G is not connected yet, but it may get connected in further steps of the dynamic programming. Again, see [1] for the details. It is proved in [1] that rooted packings allow to carry out dynamic programming in order to determine whether an input graph G contains a graph F as a minor. It is easy to see that the number of distinct rooted packings at a separator B is upper-bounded 2 by f (t, F ) := 2t log t · rt · 2r , where t > |B|. In particular, this proves that when G is the class of graphs excluding a fixed graph H on h vertices as a minor, then the index of the 2 equivalence relation ∼G,t is bounded by 2t log t · ht · 2h . The encodings generator C EFP . Let G ∈ Bt with boundary ∂(G) labeled with Λ(G). The function C EFP maps Λ(G) to a set C EFP (Λ(G)) of encodings. Each R ∈ C EFP (Λ(G)) is a set of at most |Λ(G)| rooted packings {(Ai , SF∗ i , SFi , ψi , χi ) | Fi ∈ F}, where each such rooted packing encodes a potential model of a minor Fi ∈ F (multiple models of the same graph are allowed). The language LEFP . For a packing of models S, we say that (G, S, R) belongs to the language LEFP (or that S is a packing of models satisfying R) if there is a packing of S potential models matching with the rooted packings of R in G \ Φ∈S Φ(F ). Note that we allow the entirely realized models of S to intersect ∂(G) arbitrarily, but they must not intersect potential models imposed by R. As mentioned in the introduction, the natural definition of the maximization function E does not provide a confined encoder, hence we need to use the relevant function f¯g FP . In order to define this function we note that, given a separator B and a subgraph GB , a (partial) solution naturally induces an encoding RB ∈ C EFP (Λ(GB )), where the rooted packings correspond to the intersection of models with B. Formally, let G be a t-boundaried graph with boundary A and let S be a partial solution satisfying some RA ∈ C EFP (Λ(G)). Let also P be the set of potential models matching with the rooted packings in RA . Given a separator B in G, we define the induced encoding RB = {(Ai , SF∗ i , SFi , ψi , χi ) | Φi ∈ S ∪ P} ∈ C EFP (Λ(GB )) such that for each (potential) model Φi ∈ S ∪ P of Fi ∈ F intersecting B, • Ai contains elements of the form B ∩ C, where C is a connected component of the graph induced by V (Φi (v)) ∩ V (GB ), with v ∈ V (Fi ); • ψi maps each element of Ai to its corresponding vertex in Fi ; and • SF∗ i , SFi , correspond to the vertices of Fi whose vertex models intersect GB and B, respectively. Clearly, the set of models of S entirely realized in GB is a partial solution satisfying RB . Provided with a formal definition of an induced encoding, and following the description given in Section 4, we can state the definition of an irrelevant encoding for our problem. Let G ∈ Bt with boundary A and let RA be an encoding. An encoding RA is 19 E irrelevant for f¯g FP if there exists a certificate S such that (G, S, RA ) ∈ LEFP and |S| = f EFP (G, RA ), and a separator B ⊆ V (G) with |B| 6 t and B 6= A, such that S induces E (as defined above) an encoding RB in the graph GB ∈ Bt with f¯g FP (GB , RB ) = −∞. E The function f¯g FP . Let G ∈ Bt with boundary A and let g(t) = t. We define the E function f¯g FP as   −∞, if f EFP (G, RA ) + g(t) <    max{f EFP (G, R) : R ∈ C EFP (Λ(G))} E f¯g FP (G, RA ) = (2) E  or if RA is irrelevant for f¯g FP .    f EFP (G, R ), otherwise. A In the above equation, f EFP is the natural maximization function associated with the encoder, that is, f EFP (G, R) is the maximal number of (entire) models in G which do not intersect potential models imposed by R. Formally, f EFP (G, R) = max{k : ∃S, |S| > k, (G, S, R) ∈ LEFP }. 2 The size of EFP . Recall that f (t, F ) := 2t log t · rt · 2r is the number of rooted packings for a minor F of size r on a boundary of size t. If we let r := maxF ∈F |V (F )| and J be P any set of positive integers such that j∈J j 6 t, by definition of EFP , it holds that X X 2 2 2 2j log j · rj · 2r ) 6 ( 2t log t · rt ) · 2r 6 t · 2t log t · rt · 2r . (3) sEFP (t) 6 ( j∈J j∈J Note that an encoding can also be seen as the rooted packing of the disjoint union of at most t minors of F. Fact 2. Let G ∈ Bt with boundary A, let Φ be a model (resp. a potential model matching with a rooted packing defined on A) of a graph F in G, let B be a separator of G, and let GB ∈ Bt be as in Definition 12. Let (A, SF∗ , SF , φ, χ) be the rooted packing induced by Φ (as defined above). Let G0B ∈ Bt with boundary B and let G0 be the graph obtained by replacing GB with G0B . If G0B has a potential model Φ0B matching with (A, SF∗ , SF , φ, χ), then G0 has a model (resp. a potential model) of F . Proof. Let us build a model (resp. a potential model) Φ0 of F in G0 . For every vertex v in V (F ) \ SF∗ , we set Φ0 (v) = Φ(v). For every vertex v in SF∗ \ SF , we set Φ0 (v) = Φ0B (v). For every vertex v in SF , we set Φ0 (v) = Φ(v)[V (G) \ V (GB )] ⊕ Φ0B (v). As Φ(v) is connected and the connected components in Φ0B (v) have the same boundaries than the ones in Φ(v)[V (GB )] (by definition of rooted packing), it follows that Φ0 (v) is connected. Note that Φ0 (v) do not intersect Φ0 (u), since Φ(v), Φ0B (v) do not intersect Φ0 (u) for any u ∈ V (F ). For every edge e in V (F ) × V (F ) \ SF∗ or such that χ(e) = 0 we set Φ0 (e) = Φ(e). For every edge e in SF∗ × SF∗ \ SF or such that χ(e) = 1 we set Φ0 (e) = Φ0B (e). Since B is a separator in G, SF is a separator in F and there is no edge in V (F ) \ SF∗ × SF∗ \ SF . Since Φ, Φ0B are (potential) models, the edges Φ0 (e), e ∈ E(F ) are obviously distinct and if e = {u, v}, then Φ0 (e) as one endpoint in Φ0 (u) and the other in Φ0 (v). 20 A A G0 G0 B B G0B GB Figure 4: Illustration of a protrusion replacement for F-Packing. See Figure 4 for an illustration of the scenario described in the statement of Fact 2. Lemma 6. The encoder EFP is a g-confined cFP-encoder for g(t) = t. Furthermore, if G is an arbitrary class of graphs, then the equivalence relation ∼∗E ,G,t is DP-friendly. FP Proof. Let us first show that the encoder EFP is a cFP-encoder. Indeed, if G is a 0boundaried graph, then C EFP (∅) consists of a single encoding R∅ (an empty set of rooted packings), and by definition of LEFP , any S such that (G, S, R∅ ) ∈ LEFP is a packing E of models. According to Equation (2), there are two possible values for f¯g FP (G, R∅ ): either f EFP (G, R∅ ), which by definition equals f Π (G), or −∞. Let S be a packing of E models of size f Π (G), and assume for contradiction that f¯g FP (G, R∅ ) = −∞. Then, by a recursive argument we can assume that there is a separator B of size at most t and a subgraph GB of G as in Definition 12, such that S induces RB and f EFP (GB , RB ) + t < max{f EFP (G, R) : R ∈ C EFP (I)}. Let M be the set of models entirely realized in GB . We have |M | = f EFP (GB , RB ), as otherwise S is not maximal. Let MB be the set of models intersecting B, so we have |MB | 6 t. Finally, let M0 be a packing of models in GB of size max{f EFP (G, R), R ∈ C EFP (I)}. Clearly, S \ (M ∪ MB ) ∪ M0 is a packing of models smaller than S (by optimality), that is, |M0 | 6 |M | + t, a contradiction with the E E definition of f¯g FP . Hence f¯g FP (G, R∅ ) = f Π (G). E By definition of the function f¯g FP , the encoder EFP is g-confined for g : t 7→ t. It remains to prove that the equivalence relation ∼∗E ,G,t is DP-friendly for g(t) = t. FP Due to Fact 1, it suffices to prove that ∼∗E ,t is DP-friendly. Let G ∈ Bt with boundary FP A, let B be any separator of G, and let GB be as in Definition 12. The subgraph GB can be viewed as a t-boundaried graph with boundary B. We define H ∈ Bt to be the 21 graph induced by V (G) \ (V (GB ) \ B), with boundary B (that is, we forget boundary A) labeled in the same way than GB . Let G0B ∈ Bt such that GB ∼∗E ,t G0B and let FP G0 = H ⊕ G0B , with boundary A. We have to prove that G ∼∗E ,t G0 and ∆EFP ,t (G, G0 ) = FP EFP EFP 0 0 ¯ ¯ ∆E ,t (GB , G ), that is, that fg (G, RA ) = fg (G , RA ) + ∆E ,t (GB , G0 ) for all RA ∈ FP B FP B C EFP (Λ(G)). E Let RA be an encoding defined on A. Assume first that f¯g FP (G, RA ) 6= −∞. Let E S = M ∪ MB ∪ MH be a packing of models satisfying RA with size f¯g FP (G, RA ) in G, with M being the set of models entirely contained in GB , MH the set of models entirely contained in V (H) \ B, and MB the set of models intersecting B and H. Notice that M, MB , MH is a partition of S. Let P be the set of potential models matching with the rooted packings in RA . Let also RB ∈ C EFP (Λ(GB )) be the encoding induced by S ∪ P. E Observe that f¯g FP (GB , RB ) 6= −∞, as otherwise, by definition of the relevant funcE E tion f¯g FP , we would have that f¯g FP (G, RA ) = −∞. Also, by construction of RB it E holds that |M | = f¯g FP (GB , RB ), as otherwise S would not be not maximum. Let M 0 be a packing of models of F in G0B such that (G0B , M 0 , R) ∈ LEFP and of maxiE mum cardinality, that is, such that |M 0 | = f¯g FP (G0B , RB ). Consider now the potential models matching with RB . There are two types of such potential models. The first ones match with rooted packings defined by the intersection of models in S and B; we glue them with the potential models defined by H ∩ MB to construct MB0 . The other ones match with rooted packings defined by the intersection of potential model in P and B; we glue them with the potential models defined by H ∩ P to construct E P 0 . Observe that |MB | = |MB0 |. As GB ∼∗E ,t G0B and f¯g FP (GB , RB ) 6= −∞, we FP E have that |M 0 | = f¯g FP (GB , RB ) + ∆E ,t (GB , G0 ), and therefore |M 0 ∪ M 0 ∪ MH | = B FP B E E f¯g FP (GB , RB ) + ∆EFP ,t (GB , G0B ) + |MB | + |MH | = f¯g FP (G, RA ) + ∆EFP ,t (GB , G0B ). By definition we have that MH and M 0 are packings of models. The set MB0 contains vertex-disjoint models by Fact 2. Note that models in MH ∪ M 0 are vertex-disjoint (because V (H) ∩ V (GB ) = ∅), models in MH ∪ MB0 are vertex-disjoint (because the ones in MH ∪ MB are vertex-disjoint), and models in M 0 ∪ MB0 are vertex-disjoint (because M 0 satisfies RB ). Hence MH ∪ M 0 ∪ MB0 is a packing of models. It remains to prove that MH ∪ M 0 ∪ MB0 satisfies RA . The set P 0 contains vertexdisjoint potential models by Fact 2. Models in P 0 ∪ M 0 are vertex-disjoint, as MB0 satisfies RB . Models in P 0 ∪ MB0 are vertex-disjoint by definition of RB . Finally, models in P 0 ∪ MH are vertex-disjoint since S satisfies RA . E It follows that G0 has a packing of models satisfying RA of size f¯g FP (G, RA ) + ∆EFP ,t (GB , G0B ), that is, G ∼∗E ,t G0 and ∆EFP ,t (G, G0 ) = ∆EFP ,t (GB , G0B ). FP E E Assume now that f¯g FP (G, RA ) = −∞. If f¯g FP (G0 , RA ) 6= −∞, then applying the E same arguments as above we would have that f¯g FP (G, RA ) 6= −∞, a contradiction. 22 5.3 A linear kernel for F-Packing We are now ready to provide a linear kernel for Connected-Planar-F-Packing. Theorem 5. Let F be a finite family of connected graphs containing at least one planar graph on r vertices, let H be an h-vertex graph, and let G be the class of H-minor-free graphs. Then cpFPG admits a constructive linear kernel of size at most f (r, h)·k, where f is an explicit function depending only on r and h, defined in Equation (4). Proof. By Lemma 5, given an instance (G, k) we can either conclude that (G, k) is a Yes-instance of cpFPG , or build in linear time an ((αH · t) · k 0 , 2t + h)-protrusion decomposition of G, where αH , t, k 0 are defined in the proof of Lemma 5. We now consider the encoder EFP defined in Subsection 5.2. By Lemma 6, EFP is a g-confined cpFPG -encoder and ∼∗E ,G,t is DP-friendly, where g(t) = t and G is the class FP of H-minor-free graphs. An upper bound on sEFP (t) is given in Equation (3). Therefore, we are in position to apply Corollary 1 and obtain a linear kernel for cpFPG of size at most (αH · t) · (b (EFP , g, t, G) + 1) · k 0 , where (4) • b (EFP , g, t, G) is the function defined in Lemma 3; • t is the bound on the treewidth provided by Corollary 2; • k 0 is the parameter of F-Deletion provided by Theorem 3; and • αH is the constant provided by Theorem 2. By using the recent results of Chekuri and Chuzhoy [9], it can be shown that the factor αH = O(h2 2O(h log h) ) in Theorem 3 can be replaced with hO(1) . However, in this case this would not directly translate into an improvement of the size of the kernel given in Equation (4), as the term hO(1) would be dominated by the term fm (h) = 2 2O(h log h) . 6 Application to `-F-Packing We now consider the scattered version of the packing problem. Given a finite set of graphs F and a positive integer `, the `-F-Packing problem is defined as follows. `-F-Packing Instance: Parameter: Question: A graph G and a non-negative integer k. The integer k. Does G have k subgraphs G1 , . . . , Gk pairwise at distance at least `, each containing some graph from F as a minor? 23 We again consider the version of the problem where all the graphs in F are connected and at least one is planar, called Connected-Planar-`-F-Packing (cp`FP). We obtain a linear kernel for Connected-Planar `-F-Packing on the family of graphs excluding a fixed apex graph H as a minor. We use again the notions of model, packing of models, and rooted packing. 6.1 A protrusion decomposition for an instance of `-F-Packing In order to obtain a linear protrusion decomposition for `-F-Packing, a natural idea could be to prove an Erdős-Pósa property at distance `, generalizing the approach for F-Packing described in Section 5. Unfortunately, the best known Erdős-Pósa relation between a maximum `-F-packing and a minimum `-F-deletion set is not linear. Indeed, by following and extending the ideas of Giannopoulou [23, Theorem √ 8.7 in Section 8.4] for the special case of cycles, it is possible to derive a bound of O(k k), which is superlinear, and therefore not enough for our purposes. Proving a linear bound for this Erdős-Pósa relation, or finding a counterexample, is an exciting topic for further research. We will use another trick to obtain the decomposition: we will (artificially) consider the `-F-Packing problem as a vertex-certifiable problem. Hence we propose the formulation described below, which is clearly equivalent to the previous one. Using such a formulation, a natural question is whether the `-F-Packing problem can fit into the framework for vertex-certifiable problems [22]. However, finding an appropriate encoder for this formulation does not seem an easy task, and it is more convenient to describe the encoder for `-F-Packing using the new framework designed for packing problems. `-F-Packing Instance: Parameter: Question: A graph G and a non-negative integer k. The integer k. Does G have a set {v1 , . . . , vk } of k vertices such that every vi belongs to a subgraph Gi of G with G1 , . . . , Gk pairwise at distance at least ` and each containing some graph from F as a minor? With such a formulation, we are in position to use some powerful results from Bidimensionality theory. It is not so difficult to see that the `-F-Packing problem is contraction-bidimensional [20]. Then we can use Theorem 4 and obtain the following corollary. Again, the bound on the treewidth is derived from the proof of Theorem 4 in [20]. Corollary 3. Let F be a finite set of graphs containing at least one r-vertex planar graph F , let H be an h-vertex apex graph, and let G be the class of H-minor-free graphs. If (G, k) ∈ p`FPG , then there exists a set X ⊆ V (G) such that |X| = k and tw(G − X) = 3 · f (h)3 ). Moreover, given an instance (G, k) with |V (G)| = n, there is O((2r + `)3/2 · τH c an algorithm running in time O(n3 ) that either finds such a set X or correctly reports 24 that (G, k) ∈ / p`FPG . We are now able to construct a linear protrusion decomposition. Lemma 7. Let F be a finite set of graphs containing at least one r-vertex planar graph F , let H be an h-vertex apex graph, and let G be the class of H-minor-free graphs. Let (G, k) be an instance of Connected Planar-`-F-Packing. If (G, k) ∈ cp`FPG , then we can construct in polynomial time a linear protrusion decomposition of G. Proof. Given an instance (G, k) of cp`FPG , we run the algorithm given by Corollary 3. If the algorithm is not able to find a treewidth-modulator X of size |X| = k, then we can conclude that (G, k) ∈ / cp`FPG . Otherwise, we use the set X as input to the algorithm given by Theorem 2, which outputs in linear time an ((αH · t) · k, 2t + h)-protrusion decomposition of G, where 3 · f (h)3 ) is provided by Corollary 3; and • t = O((r + `)3/2 · τH c • αH = O(h2 2O(h log h) ) is the constant provided by Theorem 2.  3 · f (h)3 · k, O((r + `)3/2 · τ 3 · f (h)3 ) -proThis is an h2 · 2O(h log h) · (r + `)3/2 · τH c c H trusion decomposition of G. 6.2 An encoder for `-F-Packing Our encoder E`FP for `-F-Packing is a combination of the encoder for F-Packing and the one for `-Scattered Set that we defined in [22]. The encodings generator C E`FP . Let G ∈ Bt with boundary ∂(G) labeled with Λ(G). The function C E`FP maps Λ(G) to a set C E`FP (Λ(G)) of encodings. Each R ∈ C E`FP (Λ(G)) is a pair (RP , RS ), where • RP is a set of at most |Λ(G)| rooted packings {(Ai , SF∗ i , SFi , φi , χi ) | i ∈ Λ(G), Fi ∈ F}, where each such rooted packing encodes a potential model of a minor Fi ∈ F (that is, RP is an encoding of F-Packing); and • RS maps label j ∈ Λ(G) to an |Λ(G)|-tuple (d, di , i ∈ Λ(G), i 6= j) ∈ [0, ` + 1]|Λ(G)| (that is, RS is an encoding of `-Scattered Set), for simplicity, since each label in Λ(G) is uniquely associated with a vertex in ∂(G), we denote by R(v) the vector assigned by RS to label λ(v). The language LE`FP . For a packing of models S, we say that (G, S, R) belongs to the language LE`FP (or that S is a packing of models satisfying R) if • the models are pairwise at distance at least `, that is, for each Φ1 , Φ2 ∈ S models of F1 , F2 ∈ F, respectively, dG (V (Φ1 (F1 )), V (Φ2 (F2 ))) > `; • there is a packing of potential models matching with the rooted packings of RP S pairwise at distance at least ` and at distance at least ` from Φ∈S Φ(F ); and 25 • for any vertex v ∈ ∂(G), if (d, di ) = R(v) then dG (v, S ∪ P) > d, and dG (v, w) > dλ(w) , for any w ∈ ∂(G). E Similarly to F-Packing, we need the relevant version of the function f¯g `FP . Let G ∈ Bt with boundary A and let S be a partial solution satisfying some RA ∈ C E`FP (Λ(G)). Let also P be the set of potential models matching with the rooted packings in RA . Given a separator B in G, and GB as in Definition 12, we define the induced encoding RB = (RP , RS ) as follows: • RP is defined by the intersection of B with models in S ∪ P, (as for F-Packing); and • RS maps each v ∈ B to R(v) = (dGB (v, S ∪ P), dGB (v, w), w ∈ B). The set of models of S entirely realized in GB is a partial solution satisfying RB . The definition of an irrelevant encoding is as described in Section 4. E E The function f¯g `FP . Let G ∈ Bt with boundary A and let g(t) = 2t. We define f¯g `FP as E f¯g `FP (G, RA ) =          if f E`FP (G, RA ) + 2t < max{f E`FP (G, R) : R ∈ C E`FP (Λ(G))}, E or if RA is irrelevant for f¯g `FP . f E`FP (G, RA ), otherwise. −∞, (5) In the above equation, f E`FP is the natural optimization function defined as f E`FP (G, R) = max{k : ∃S, |S| > k, (G, S, R) ∈ LE`FP }. (6) Size of E`FP . Since C E`FP (I) = C EFP × ([0, ` + 1]t )t , it holds that 2 sE`FP (t) 6 sĒFP (t) × (` + 2)t . (7) Lemma 8. The encoder E`FP is a g-confined c`FP-encoder for g(t) = 2t. Furthermore, if G is an arbitrary class of graphs, then the equivalence relation ∼∗E ,G,t is DP-friendly. `FP Proof. We first prove that E`FP is a c`FP-encoder. Obviously, {(G, S) : (G, S, R∅ ) ∈ LE`FP , R∅ ∈ C E`FP (∅)} = LΠ . As in the proof of Lemma 6, in order to show that E f E`FP (G, R∅ ) 6= −∞ we prove that the value computed by f¯g `FP has not been truncated. Let G, GB and S, M, MH , MB , M0 as in proof of Lemma 6, and let M0∗ = M0 \ {Φ(F ) : ∗ = M \ {Φ(F ) : Φ(F ) ∩ N Φ(F ) ∩ Nr/2 (B) 6= ∅, F ∈ F} and MH H r/2 (B) 6= ∅, F ∈ F}. ∗ ∗ M0 ∪ MH is a scattered packing of size at least |S| − 2t. E The encoder E`FP is g-confined for g : t 7→ 2t by definition of f¯g `FP . Following the proof of Lemma 6 again, let G, G0 ∈ Bt with boundary A and let E E GB , G0B , H ∈ Bt with boundary B. We have to prove that f¯g `FP (G, RA ) = f¯g `FP (G0 , RA )+ ∆E`FP ,t (GB , G0B ) for every RA ∈ C E`FP (Λ(G)). 26 E Let RA be an encoding defined on A. Assume that f¯g `FP (G, RA ) 6= −∞. Let S = E M ∪ MB ∪ MH be a packing of models satisfying RA with size f¯g `FP (G, RA ) in G, with M, MB , MH as in the proof of Lemma 6. Let also P be the set of potential models matching with RA and let RB ∈ C E`FP (Λ(GB )) be the encoding induced by S ∪ P. E Observe that, by definition, f¯g `FP (GB , RB ) 6= −∞. Hence there is a packing M 0 in G0B of maximum cardinality and such that (G0B , M 0 , R) ∈ LE`FP . As in the proof of Lemma 6, we can define MB0 to be the set of models obtained from the potential models defined by the intersection of models in MB with H, glued to the ones in G0B matching with RB . We can also define P 0 to be the set of potential models obtained from the potential models defined by the intersection of models in MB with H, glued to the ones in G0B matching with RB . As GB ∼∗E ,t G0B and following the argumentation in Lemma `FP E 6 we have that |M 0 ∪ M 0 ∪ MH | = f¯g `FP (G, RA ) + ∆E ,t (GB , G0 ). B `FP B We already have that S 0 = MH ∪ M 0 ∪ MB0 is a packing of models according to the proof of Lemma 6. It remains to prove that (potential) models in S 0 ∪ P 0 are pairwise at distance at least `. We follow the proof of [22, Lemma 6]. Let P be a shortest path between any two models in S 0 ∪ P 0 . We subdivide P into maximal subpaths in G0B and maximal subpaths in H. Clearly the length of a subpath in H does not change. Moreover, note that the length of a subpath in G0B with extremities v, w ∈ B is at least dGB (v, w), by definition of RB . Note also that the length of a subpath in G0B with an extremity in a model and the other v ∈ B is at least dGB (v, S), also by definition of RB . Therefore, the distance between any two models is indeed at least `. E It follows that G0 has a scattered packing of models satisfying RA of size f¯g `FP (G, RA )+ ∆E`FP ,t (GB , G0B ), that is, G ∼∗E ,t G0 and ∆E`FP ,t (G, G0 ) = ∆E`FP ,t (GB , G0B ). The case `FP E where f¯g `FP (G, RA ) = −∞ is easily handled as in Lemma 6. 6.3 A linear kernel for `-F-Packing We are now ready to provide a linear kernel for Connected-Planar-`-F-Packing. Theorem 6. Let F be a finite family of connected graphs containing at least one planar graph on r vertices, let H be an h-vertex apex graph, and let G be the class of H-minorfree graphs. Then cp`FPG admits a constructive linear kernel of size at most f (r, h, `)·k, where f is an explicit function depending only on r, h, and `, defined in Equation (8). Proof. By Lemma 7, given an instance (G, k) we can either report that (G, k) is a Yesinstance of cp`FPG , or build in linear time an ((αH ·t)·k, 2t+h)-protrusion decomposition of G, where αH and t are defined in the proof of Lemma 7. We now consider the encoder E`FP defined in Subsection 6.2. By Lemma 8, E`FP is a g-confined cp`FPG -encoder and ∼∗E ,G,t is DP-friendly, where g(t) = 2t and G is `FP the class of H-minor-free graphs. An upper bound on sE`FP (t) is given in Equation (7). Therefore, we are in position to apply Corollary 1 and obtain a linear kernel for cp`FPG of size at most (αH · t) · (b (E`FP , g, t, G) + 1) · k 0 , where (8) 27 • b (E`FP , g, t, G) is the function defined in Lemma 3; • t is the bound on the treewidth provided by Corollary 3; and • αH is the constant provided by Theorem 2. 7 Application to F-Packing with `-Membership Now we consider a generalization of the F-Packing problem that allows models to be close to each other (conversely to `-F-Packing, which asks for scattered models). That is, we consider the version for minors of the F-Subgraph-Packing with `Membership defined in [16]. Let F be a finite set of graphs. For every integer ` > 1, we define the F-Packing with `-Membership problem as follows. F-Packing with `-Membership Instance: A graph G and a non-negative integer k. Parameter: The integer k. Question: Does G have k subgraphs G1 , . . . , Gk such that each subgraph contains some graph from F as a minor, and each vertex of G belongs to at most ` subgraphs? We again consider the version of the problem where all the graphs in F are connected and at least one is planar, called Connected-Planar-F-Packing with `Membership (cpFP`M). We obtain a linear kernel for Connected-Planar-F-Packing with `-Membership on the family of graphs excluding a fixed graph H as a minor. We use again the notions of model, packing of models, and rooted packing. Now, for an arbitrary graph, a certificate for F-Packing with `-Membership is a packing of models with `-membership, defined as follows. Definition 18. Given a set F of minors and a graph G, a packing of models with `membership S is a set of models such that each vertex of G belongs to at most ` models, that is, to at most ` subgraphs Φ(F ) for Φ ∈ S, F ∈ F. Note that the above definition is equivalent to saying that each vertex of G belongs to at most ` vertex-models, since vertex-models of a model are vertex-disjoint. 7.1 A protrusion decomposition for an instance of F-Packing with `Membership In order to find a linear protrusion decomposition, we use again the Erdős-Pósa property, as we did in Subsection 5.1. The construction of a linear protrusion decomposition becomes straightforward from the fact that a packing of models is in particular a packing of models with `-membership for every integer ` > 1. 28 Lemma 9. Let F be a finite set of graphs containing at least one r-vertex planar graph F , let H be an h-vertex graph, and let G be the class of H-minor-free graphs. Let (G, k) be an instance of cpFP`MG . If (G, k) ∈ / cpFP`MG , then we can construct in polynomial time a linear protrusion decomposition of G. Proof. It suffices to note that if S is a packing of models of size k, then it is in particular a packing of models with `-membership for every integer ` > 1. Hence, if (G, k) ∈ / cpFPrMG then (G, k) ∈ / cpFPG and we can apply Lemma 5. 7.2 An encoder for F-Packing with `-Membership Our encoder EFP`M for F-Packing with `-Membership uses again the notion of rooted packing, but now we allow the rooted packings to intersect. The encodings generator C EFP`M . Let G ∈ Bt with boundary ∂(G) labeled with Λ(G). The function C EFP`M maps Λ(G) to a set C EFP`M (Λ(G)) of encodings. Each R ∈ C EFP`M (Λ(G)) is a set of at most ` · |Λ(G)| rooted packings{(Ai , SF∗ i , SFi , φi , χi ) | Fi ∈ F}, where each such rooted packing encodes a potential model of a minor Fi ∈ F (multiple models of the same graph are allowed). The language LEFP`M . For a packing of models with `-membership S, we say that (G, S, R) belongs to the language LEFP`M (or that S is a packing of models with `membership satisfying R) if there is a packing of potential models with `-membership matching with the rooted packings of R in G \ {u : u ∈ Φ1 (F1 ), . . . , u ∈ Φ` (F` ); Φi ∈ S, Fi ∈ F}, that is, such that each vertex belongs to at most ` models or potential models. E The function f¯g FP`M . Similarly to F-Packing, we need the relevant version of the E E function f¯g FP`M . The function f¯g FP`M is defined exactly as the one for F-Packing in Section 5 (in particular, the encoding induced by a partial solution is also the set of rooted packings defined by the intersection of the partial solution and the separator). The size of EFP`M . Note that the encoder contains at most `t rooted packings on a boundary of size t. Hence, if we let r := maxF ∈F |V (F )|, and J be any set such that P j∈J j 6 `t and ∀j ∈ J, j 6 t, by definition of EFP`M it holds that 2 sEFP`M (t) 6 `t · 2t log t · rt · 2r . It just remains to prove that the relation ∼∗E is DP-friendly. Note that in the FP`M ,G,t encoder, the only difference with respect to F-Packing is that rooted packings are now allowed to intersect. Namely, the constraint on the intersection is that each vertex belongs to at most ` models. This constraint can easily be verify locally, so no information has to be transmitted through the separator. Hence, the proof of the following lemma is exactly the same as the proof of Lemma 6, and we omit it. Lemma 10. The encoder EFP`M is a g-confined cFP`M-encoder for g(t) = t. Furthermore, if G is an arbitrary class of graphs, then the equivalence relation ∼∗E is FP`M ,G,t DP-friendly. 29 7.3 A linear kernel for F-Packing with `-Membership We are now ready to provide a linear kernel for Connected-Planar F-Packing with `-Membership. Theorem 7. Let F be a finite family of connected graphs containing at least one planar graph on r vertices, let H be an h-vertex graph, and let G be the class of H-minor-free graphs. Then cpFP`M admits a constructive linear kernel of size at most f (r, h, `) · k, where f is an explicit function depending only on r, h, and `. The proof of the above theorem is exactly the same as the one of Theorem 6, the only difference being in the size sEFP`M (t) of the encoder, and hence in the value of b (EFP`M , g, t, G). 8 Application to F-Subgraph-Packing In this section we apply our framework to problems where to objective is to pack subgraphs. The F-Subgraph-Packing problem consists in finding vertex-disjoint subgraphs (instead of minors) isomorphic to graphs in a given finite family F. Similarly to F-(Minor)-Packing, we study two more generalizations of the problem, namely the `-F-Subgraph-Packing, asking for subgraphs at distance ` from each other, and the F-Subgraph-Packing with `-Membership problem [16] that allows vertices to belong to at most ` subgraphs. Let F be a finite set of graphs and let ` > 1 be an integer. The F-Subgraph-Packing, the `-F-Subgraph-Packing, and the F-Subgraph-Packing with `-Membership problems are defined as follows. F-Subgraph-Packing Instance: A graph G and a non-negative integer k. Parameter: The integer k. Question: Does G have k vertex-disjoint subgraphs G1 , . . . , Gk , each isomorphic to a graph in F? `-F-Subgraph-Packing Instance: A graph G and two non-negative integers k and `. Parameter: The integer k. Question: Does G have k subgraphs G1 , . . . , Gk pairwise at distance at least ` and each isomorphic to a graph in F? 30 F-Subgraph-Packing with `-Membership Instance: A graph G and two non-negative integers k and `. Parameter: The integer k. Question: Does G have k subgraphs G1 , . . . , Gk , each isomorphic to in F, and a graph such that each vertex of G belongs to at most ` subgraphs? Again, for technical reasons, we consider the versions of the above problems where all the graphs in F are connected, called Connected F-Subgraph-Packing (cFSP), Connected`-F-Subgraph-Packing (c`FSP),and Connected F-Subgraph-Packing with `-Membership (cFSP`M), respectively. As in Section 5, connectivity is necessary to use the equivalent notion of rooted packings. Furthermore, in this section we also need connectivity to build the protrusion decomposition, whereas the presence of a planar graph in F is not mandatory anymore. Similarly to F-Packing, we establish a relation between instances of F-Subgraph -Packing (and its variants) and instances of d-Dominating Set for an appropriate value of d. Therefore we also define this problem. Note that here we do not use any Erdős-Pósa property to establish this relation. d-Dominating Instance: Parameter: Question: Set A graph G and two non-negative integers k and d. The integer k. Is there a set D of vertices in G with size at most k, such that for every vertex v ∈ V (G), Nd [v] ∩ D 6= ∅? In this section we obtain a linear kernel for Connected F-Subgraph-Packing, Connected `-F-Subgraph-Packing, and F-Subgraph-Packing with `-Membership on the families of graphs excluding respectively a fixed graph, a fixed apex graph, and a fixed graph, as a minor. For these three problems, the structure of a solution will be respectively a packing of subgraph models, a packing of subgraph models, and a packing of subgraph models with `-membership. In order to define a packing of subgraph models, we need the definition of a subgraph model of F in G, which is basically an isomorphism from a graph F to a subgraph of G. Definition 19. A subgraph model of a graph F in a graph G is a mapping Φ, that assigns to every vertex v ∈ V (F ) a vertex Φ(v) ∈ v(G), such that • the vertices Φ(v) for v ∈ V (F ) are distinct; and • if {u, v} ∈ E(F ), then {Φ(u), Φ(v)} ∈ E(G). We denote by Φ(F ) the subgraph of G with vertex set {Φ(v) : v ∈ V (F )} and edge set {{Φ(u), Φ(v)} : {u, v} ∈ E(F )}, which is obviously isomorphic to F . 31 Definition 20. Let F be a set of subgraphs and let G be a graph. A packing of subgraph models S is a set of vertex-disjoint subgraph models, that is, the graphs Φ(F ) for Φ ∈ S, F ∈ F are vertex-disjoint. A packing of subgraph models with `-membership S is a set of subgraph models such that every vertex v ∈ V (G) is the image of at most ` mappings Φ ∈ S. 8.1 A protrusion decomposition for an instance of F-Subgraph-Packing In order to find a linear protrusion decomposition, we first need a preprocessing reduction rule. This rule, which has also been used in previous work [5, 20], enables us to establish a relation between instances of F-Subgraph-Packing (and its variants) and d-Dominating Set. Then we will be able to apply Theorem 4 on d-Dominating Set to find a linear treewidth-modulator that allows to construct the decomposition. Rule 1. Let v be a vertex of G that does not belong to any subgraph of G isomorphic to a graph in F. Then remove v from G. Note that Rule 1 can be applied in time O(nr ), where n is the size of G and r is the maximum size of a graph in F. We call a graph reduced under Rule 1 if the rule cannot be applied anymore on G. The next proposition states a relation between an instance of `-F-Subgraph-Packing and d-Dominating Set. The relation with the two other problems are straightforward, as explained below. Proposition 3. Let G be a graph reduced under Rule 1. If (G, k) is a No-instance of Connected `-F-Subgraph-Packing, then (G, k) is a Yes-instance of (2d + `)Dominating Set, where d is the largest diameter of the graphs in F. Proof. Let (G, k) be a No-instance of `-F-Subgraph-Packing and let d be the largest diameter of a graph in F. Let us choose any vertex v ∈ V (G) and remove Nd+` (v) from G. We repeat this operation until there is no subgraph model of F in G. We call D the set of removed vertices. As (G, k) is a No-instance of F-Subgraph-Packing, |D| 6 k and as G is reduced under Rule 1 all vertices in V (G) \ Nd+` (D) belong to a (connected) subgraph model (which intersects Nd+` (D)), hence all vertices in V (G) \ Nd+` (D) are at distance at most 2d + ` from D. Therefore (G, k) is a Yes-instance of (2d + `)Dominating Set. Note that if (G, k) is a No-instance of F-Subgraph-Packing with `-Membership then it is a No-instance of F-Subgraph-Packing (that is, of 1-F-Subgraph-Packing) and then it is a No-instance of `-F-Subgraph-Packing for every integer ` > 1. According to Proposition 3, it follows that (G, k) is a Yes-instance of (2d+1)-Dominating Set. We now apply Theorem 4 in order to find a treewidth-modulator for a Yes-instance of (2d + 1)-Dominating Set. We now use the following corollary of Theorem 4. 32 Corollary 4. Let F be a finite set of connected graphs, let H be an h-vertex apex graph, and let G be the class of H-minor-free graphs. If (G, k) G , then there exists a set √ ∈ d-DS 3 · f (h)3 ). Moreover, given X ⊆ V (G) such that |X| = k and tw(G − X) = O(d d · τH c an instance (G, k) with |V (G)| = n, there is an algorithm running in time O(n3 ) that either finds such a set X or correctly reports that (G, k) ∈ / d-DSG . We are now able to construct a linear protrusion decomposition. Lemma 11. Let F be a finite set of connected graphs, let H be an h-vertex apex graph, and let G be the class of H-minor-free graphs. Let (G, k) be an instance of Connected-`-F-Subgraph-Packing (or of Connected-F-Subgraph-Packing, or of Connected-F-Subgraph-Packing with `-Membership). If (G, k) ∈ / cFSPG , then we can construct in polynomial time a linear protrusion decomposition of G. Proof. Given an instance (G, k) of cFSPG , we run the algorithm given by Corollary 4 for the Connected (2d + `)-Dominating Set problem, where d is the largest diameter of the graphs in F. If the algorithm is not able to find a treewidth-modulator X of size |X| = k, then by Proposition 3 we can conclude that (G, k) ∈ c`FSPG (resp. (G, k) ∈ cFSPG and (G, k) ∈ cFSP`MG ). Otherwise, we use the set X as input to the algorithm given by Theorem 2, which outputs in linear time an ((αH · t) · k, 2t + h)protrusion decomposition of G, where 3 · f (h)3 ) is provided by Corollary 4; and • t = O((2d + `)3/2 · τH c • αH = O(h2 2O(h log h) ) is the constant provided by Theorem 2.  3 · f (h)3 · k , O((2d + `)3/2 · τ 3 · f (h)3 ) -proThis is an h2 2O(h log h) · (2d + `)3/2 · τH c m H trusion decomposition of G. 8.2 An encoder for F-Subgraph-Packing Our encoder EFSP for F-Subgraph-Packing uses a simplified version of rooted packings. Definition 21. Let F be a connected graph and let G be a boundaried graph with boundary B. A rooted set of B is a quadruple (A, SF∗ , SF , ψ), where • SF ⊆ SF∗ are both subsets of V (F ); • A is a non-empty subset of B; and • ψ : A → SF is a bijective mapping assigning vertices of SF to the vertices in A. We also define a potential subgraph model of F in G matching with (A, SF∗ , SF , ψ) as a partial mapping Φ, that assigns to every vertex v ∈ SF a vertex Φ(v) ∈ A such that ψ(Φ(v)) = v, and to every vertex v ∈ SF∗ a vertex Φ(v) ∈ V (G) such that for all u, v ∈ SF∗ if {u, v} ∈ E(F ) then, {Φ(u), Φ(v)} ∈ E(G). Moreover, for every v ∈ SF∗ \ SF , it holds that Φ(v) ∈ V (G) \ B. 33 Intuitively, the rooted set is a simplification of the rooted packing defined in Section 5. The collection A of subsets of B is replaced with a subset A of B (since now the image of a vertex v ∈ V (F ) is a vertex of G). The sets SF∗ , SF still describe the subgraph of F which is realized in G and its vertices that lie in B. The function ψ plays the same role as in rooted packings: it can be viewed as the inverse of the potential subgraph model Φ restricted to B. Note that we do not need the function χ anymore because the edges cannot appear later (because now the image of a vertex v ∈ V (F ) is a vertex, and we are dealing with a tree decomposition). The number of distinct rooted sets at a separator B is upper-bounded by f (t, F ) := t 2 · rt · 22r , where t > |B| and r = |V (F )|. Here, we only describe the encoder for F-Subgraph-Packing. Similarly to Section 6, the encoder for `-F-Subgraph-Packing is obtained by a combination of the encoder for F-Subgraph-Packing and the one for `-Scattered Set. As in Section 7, the encoder for F-Subgraph-Packing with `-Membership is obtained by allowing intersections in the rooted set. The encodings generator C EFSP . Let G ∈ Bt with boundary ∂(G) labeled with Λ(G). The function C EFSP maps Λ(G) to a set C EFSP (Λ(G)) of encodings. Each R ∈ C EFSP (Λ(G)) is a set of at most |Λ(G)| rooted sets {(Ai , SF∗ i , SFi , ψi ) : Fi ∈ F}, where each such rooted set encodes a potential subgraph model of Fi ∈ F (multiple subgraphs models of the same graph are allowed), and where the sets Ai are pairwise disjoint. The language LEFSP . For a packing of subgraph models S, we say that (G, S, R) belongs to the language LEFSP (or that S is a packing of models satisfying R) if there is a packing of vertex-disjoint potential subgraph models matching with the rooted sets of S R in G \ Φ∈S Φ(F ). Note that we allow the entirely realized subgraph models of S to intersect ∂(G) arbitrarily, but they must not intersect potential subgraph models imposed by R. E As in the previous sections, we need to use the relevant function f¯g FSP . To this aim, we need to remark that, given a separator B and a subgraph GB , a (partial) solution naturally induces an encoding RB ∈ C EFSP (Λ(GB )) where the rooted sets correspond to the intersection of models with B. Formally, let G be a t-boundaried graph with boundary A and let S be a partial solution satisfying some RA ∈ C EFSP (Λ(G)). Let also P be the set of potential subgraph models matching with the rooted set in RA . Given a separator B in G, we define the induced encoding RB = {(Ai , SF∗ i , SFi , ψi ) : Φi ∈ S ∪ P} ∈ C EFSP (Λ(GB )) such that for each (potential) subgraph model Φi ∈ S ∪ P of Fi ∈ F intersecting B, • Ai contains vertices of Φi (Fi ) in B; • ψi maps each vertex of Ai to its corresponding vertex in Fi ; and • SF∗ i and SFi correspond to the vertices of Fi whose images by Φ belong to GB and B, respectively. 34 Clearly, the set of models of S entirely realized in GB is a partial solution satisfying RB . The definition of an irrelevant encoding is the same as in Section 4. E E The function f¯g FSP . Let G ∈ Bt with boundary A. We define the function f¯g FSP as E f¯g FSP (G, RA ) =          if f EFSP (G, RA ) + t < max{f EFSP (G, R) : R ∈ C EFSP (Λ(G))} E or if RA is irrelevant for f¯g FSP . f EFSP (G, R), otherwise. −∞, In the above equation, f EFSP is the natural maximization function, that is f EFSP (G, R) is the maximal number of (entirely realized) subgraph models in G which do not intersect potential subgraph models imposed by R. Formally, f EFSP (G, R) = max{k : ∃S, |S| > k, (G, S, R) ∈ LEFSP }. The size of EFSP . Recall that f (t, F ) := 2t · rt · 22r is the number of rooted sets for a subgraph F of size r on a boundary of size t. Our encoder contains at most t vertexdisjoint rooted sets, for subgraphs of size at most r := maxF ∈F |V (F )| and such that the sum of their boundary size is at most t. Hence we can bound the size of the encoder as X  sEFSP (t) 6 2j · rj · 22r 6 t · 2t · rt · 22r . j∈J Note that the encoder for `-F-Subgraph-Packing generates couples of encodings for F-Subgraph-Packing and `-Scattered Set, and therefore the size of the encoder can be bounded as 2 sE`FSP (t) 6 sEFSP (t) · (` + 2)t . Finally, note that the encoder for F-Subgraph-Packing with `-Membership contains at most `t rooted sets on a boundary of size t, and thus the size of the encoder can be bounded as sEFSP `M (t) 6 `t · 2t · rt · 22r . Similarly to Fact 2, the following fact claims that rooted sets allow us to glue and unglue boundaried graphs, preserving the existence of subgraphs. We omit the proof as it is very similar to the one of Fact 2. Fact 3. Let G ∈ Bt with boundary A, let Φ be a subgraph model (resp. a potential subgraph model matching with a rooted set defined on A) of a graph F in G, let B be a separator of G, and let GB ∈ Bt be as in Definition 12. Let (A, SF∗ , SF , ψ) be the rooted set induced by Φ (as defined above). Let G0B ∈ Bt with boundary B and let G0 be the graph obtained by replacing GB with G0B . If G0B has a potential subgraph model Φ0B matching with (A, SF∗ , SF , ψ), then G0 has a subgraph model (resp. a potential subgraph model) of F . 35 We now have to prove that the encoders EFSP , E`FSP , EFSP `M are confined and DPfriendly. The proofs are very similar to the proof of Lemma 6; the proofs for E`FSP and EFSP `M have to be adapted following Sections 6 and 7, respectively. This seems natural as the encoder EFSP is defined with rooted sets, which are simplifications of rooted packings. Lemma 12. The encoders EFSP , E`FSP , and EFSP `M are g-confined for g(t) = t, g(t) = 2t, and g(t) = t, respectively. They are respectively a cFSP-encoder, a c`FSP-encoder, and a cFSP`M -encoder. Furthermore, if G is an arbitrary class of graphs, then the equivalence relations ∼∗E ,G,t , ∼∗E`FSP ,G,t , and ∼∗EFSP `M ,G,t are DP-friendly. FSP 8.3 A linear kernel for F-Subgraph-Packing We are now ready to provide a linear kernel for Connected F-Subgraph-Packing, Connected `-F-Subgraph-Packing, and Connected F-Subgraph-Packing with `-membership. Theorem 8. Let F be a finite family of connected graphs with diameter at most d, let H be an h-vertex graph, and let G be the class of H-minor-free graphs. Then Connected F-Subgraph-Packing, Connected `-F-Subgraph-Packing, and Connected FSubgraph Packing with `-Membership admit constructive kernels of size O(k), where the constant hidden in the “O” notation depends on h, d, and `. The proof is similar to the ones in the previous sections. Using the protrusion decomposition given by Lemma 11 and the encoders described in Section 8.2, we have all the material to apply Corollary 1. The size of the kernel differs from the previous sections due to the size of the encoders and due to the bound on the treewidth of protrusions given by Lemma 11. To conclude, we would like to mention that Romero and López-Ortiz [32] introduced another problem allowing intersection of subgraph models, called F-(Subgraph)Packing with `-Overlap. In this problem, also studied in [16, 33], a subgraph model can intersect any number of other models, but they are allowed to pairwise intersect on at most ` vertices. It is easier to perform dynamic programming on the membership version than on the overlap version, since the intersection constraint is local for the first one (just on vertices) but global for the second one (on pairs of models). However, we think that it is possible to define an encoder (with all the required properties) for F-(Subgraph)-Packing with `-Overlaps using rooted sets and vectors of integers counting the overlaps (similarly to `-F-Subgraph-Packing). This would imply the existence of a linear kernel for the F-(Subgraph)-Packing with `-Overlap problem on sparse graphs. We leave it for further research. 9 Conclusions and further research In this article we generalized the framework introduced in [22] to deal with packingcertifiable problems. Our main result can be seen as a meta-theorem, in the sense that 36 as far a particular problem satisfies the generic conditions stated in Corollary 1, an explicit linear kernel on the corresponding graph class follows. Nevertheless, in order to verify these generic conditions and, in particular, to verify that the equivalence relation associated with an encoder is DP-friendly, the proofs are usually quite technical and one first needs to get familiar with several definitions. We think that it may be possible to simplify the general methodology, thus improving its applicability. Concerning the explicit bounds derived from our results, one natural direction is to reduce them as much as possible. These bounds depend on a number of intermediate results that we use along the way and improving any of them would result in an improvement on the overall kernel sizes. It is worth insisting here that some of the bounds involve the (currently) non-explicit function fc defined in Proposition 2, which depends exclusively on the considered graph class (and not on each particular problem). In order to find explicit bounds for this function fc , we leave as future work using the lineartime deterministic protrusion replacer recently introduced by Fomin et al. [18], partially inspired from [22]. Acknowledgement. We would like to thank Archontia C. Giannopoulou for insightful discussions about the Erdős-Pósa property for scattered planar minors. References [1] I. Adler, F. Dorn, F. V. Fomin, I. Sau, and D. M. Thilikos. Faster parameterized algorithms for minor containment. Theoretical Computer Science, 412(50):7018– 7028, 2011. [2] J. Alber, M. Fellows, and R. Niedermeier. Polynomial-Time Data Reduction for Dominating Set. Journal of the ACM, 51(3):363–384, 2004. [3] A. Atminas, M. Kaminski, and J.-F. Raymond. Scattered packings of cycles. Theoretical Computer Science, 647:33–42, 2016. [4] H. L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM Journal on Computing, 25(6):1305–1317, 1996. [5] H. L. Bodlaender, F. V. Fomin, D. Lokshtanov, E. Penninkx, S. Saurabh, and D. M. Thilikos. (Meta) Kernelization. In Proc. of the 50th IEEE Symposium on Foundations of Computer Science (FOCS), pages 629–638. IEEE Computer Society, 2009. [6] H. L. Bodlaender, S. Thomassé, and A. Yeo. Kernel bounds for disjoint cycles and disjoint paths. Theoretical Computer Science, 412(35):4570–4578, 2011. [7] J. R. Büchi. Weak second order arithmetic and finite automata. Zeitschrift für mathematische Logik und Grundlagen der Mathematik, 6:66–92, 1960. 37 [8] C. Chekuri and J. Chuzhoy. Large-treewidth graph decompositions and applications. In Proc. of the 45th Symposium on the Theory of Computing (STOC), pages 291–300, 2013. [9] C. Chekuri and J. Chuzhoy. Polynomial bounds for the grid-minor theorem. In Proc. of the 46th ACM Symposium on the Theory of Computing (STOC), pages 60–69, 2014. [10] M. Cygan, F. V. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh. Parameterized Algorithms. Springer, 2015. [11] M. Cygan, J. Nederlof, M. Pilipczuk, M. Pilipczuk, J. M. M. van Rooij, and J. O. Wojtaszczyk. Solving connectivity problems parameterized by treewidth in single exponential time. In Proc. of the 52nd IEEE Symposium on Foundations of Computer Science (FOCS), pages 150–159. IEEE Computer Society, 2011. [12] E. D. Demaine and M. Hajiaghayi. Linearity of grid minors in treewidth with applications through bidimensionality. Combinatorica, 28(1):19–36, 2008. [13] R. Diestel. Graph Theory, volume 173. Springer-Verlag, 4th edition, 2010. [14] P. Erdős and L. Pósa. On independent circuits contained in a graph. Canadian Journal of Mathematics, 17:347–352, 1965. [15] M. R. Fellows, J. Guo, C. Komusiewicz, R. Niedermeier, and J. Uhlmann. Graphbased data clustering with overlaps. Discrete Optimization, 8(1):2–17, 2011. [16] H. Fernau, A. López-Ortiz, and J. Romero. Kernelization algorithms for packing problems allowing overlaps. In Proc. of the 12th Annual Conference on Theory and Applications of Models of Computation, (TAMC), volume 9076 of LNCS, pages 415–427, 2015. [17] F. V. Fomin, P. A. Golovach, and D. M. Thilikos. Contraction obstructions for treewidth. Journal of Combinatorial Theory, Series B, 101(5):302–314, 2011. [18] F. V. Fomin, D. Lokshtanov, N. Misra, M. S. Ramanujan, and S. Saurabh. Solving dSAT via Backdoors to Small Treewidth. In Proc. of the 26th ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 630–641, 2015. [19] F. V. Fomin, D. Lokshtanov, V. Raman, and S. Saurabh. Bidimensionality and EPTAS. In Proc. of the 22nd ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 748–759, 2011. [20] F. V. Fomin, D. Lokshtanov, S. Saurabh, and D. M. Thilikos. Bidimensionality and kernels. In Proc. of the 21st ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 503–510, 2010. 38 [21] F. V. Fomin, S. Saurabh, and D. M. Thilikos. Strengthening Erdős-Pósa property for minor-closed graph classes. Journal of Graph Theory, 66(3):235–240, 2011. [22] V. Garnero, C. Paul, I. Sau, and D. M. Thilikos. Explicit linear kernels via dynamic programming. SIAM Journal on Discrete Mathematics, 29(4):1864–1894, 2015. [23] A. Giannopoulou. Partial Orderings and Algorithms on Graphs. PhD thesis, Department of Mathematics, University of Athens, Greece, 2012. [24] J. Guo and R. Niedermeier. Linear problem kernels for NP-hard problems on planar graphs. In Proc. of the 34th International Colloquium on Automata, Languages and Programming (ICALP), volume 4596 of LNCS, pages 375–386, 2007. [25] K. Kawarabayashi and Y. Kobayashi. Linear min-max relation between the treewidth of H-minor-free graphs and its largest grid. In Proc. of the 29th International Symposium on Theoretical Aspects of Computer Science (STACS), volume 14 of LIPIcs, pages 278–289, 2012. [26] E. J. Kim, A. Langer, C. Paul, F. Reidl, P. Rossmanith, I. Sau, and S. Sikdar. Linear kernels and single-exponential algorithms via protrusion decompositions. ACM Transactions on Algorithms, 12(2):21, 2016. [27] T. Kloks. Treewidth. Computations and Approximations. Springer-Verlag LNCS, 1994. [28] D. Lokshtanov, D. Marx, and S. Saurabh. Lower bounds based on the exponential time hypothesis. Bulletin of the EATCS, 105:41–72, 2011. [29] H. Moser. A problem kernelization for graph packing. In Proc. of the 35th International Conference on Current Trends in Theory and Practice of Computer Science (SOFSEM), volume 5404 of LNCS, pages 401–412, 2009. [30] N. Robertson and P. D. Seymour. Graph Minors. V. Excluding a Planar Graph. Journal of Combinatorial Theory, Series B, 41(1):92–114, 1986. [31] N. Robertson and P. D. Seymour. Graph Minors. XIII. The Disjoint Paths Problem. Journal of Combinatorial Theory, Series B, 63(1):65–110, 1995. [32] J. Romero and A. López-Ortiz. The G-packing with t-overlap problem. In Proc. of the 8th International Workshop on Algorithms and Computation (WALCOM), volume 8344 of LNCS, pages 114–124, 2014. [33] J. Romero and A. López-Ortiz. A parameterized algorithm for packing overlapping subgraphs. In Proc. of the 9th International Computer Science Symposium in Russia (CSR), volume 8476 of LNCS, pages 325–336, 2014. 39 A A.1 Deferred proofs in Section 3 Proof of Lemma 1 Let us first show that the equivalence relation ∼∗E ,t has finite index. Let I ⊆ {1, . . . , t}. FSP Since we assume that EFSP is g-confined, we have that for any G ∈ Bt with Λ(G) = I, the function f EFSP (G, · ) can take at most g(t) + 2 distinct values (g(t) + 1 finite values and possibly the value −∞). Therefore, it follows that the number of equivalence classes of E ∼∗E ,t containing all graphs G ∈ Bt with Λ(G) = I is at most (g(t) + 2)|C FSP (I)| . As the FSP number of subsets of {1, . . . , t} is 2t , we deduce that the overall number of equivalence s (t) classes of ∼∗E ,t is at most (g(t) + 2) EFSP · 2t . Finally, since the equivalence relation FSP ∼∗E ,G,t is the Cartesian product of the equivalence relations ∼∗E ,t and ∼G,t , the result FSP FSP follows from the fact that G can be expressed in MSO logic. A.2 Proof of Fact 1 Let G = G− ⊕ GB and let G0 = G− ⊕ G0B . Assume that G ∼∗E ,t G0 . In order to FSP deduce that G ∼∗E ,G,t G0 , it suffices to prove that G ∼G,t G0 . Let H ∈ Bt . We FSP need to show that G ⊕ H ∈ G if and only if G0 ⊕ H ∈ G. We have that G ⊕ H = (GB ⊕ G− ) ⊕ H = GB ⊕ (G− ⊕ H), and similarly for G0 . Since GB ∼G,t G0B , it follows that G ⊕ H = GB ⊕ (G− ⊕ H) ∈ G if and only if GB ⊕ (G− ⊕ H) = G ⊕ H ∈ G. A.3 Proof of Lemma 2 Let EFSP = (C EFSP , LEFSP , f EFSP ) be a Π-encoder and let G1 , G2 ∈ Bt such that G1 ∼EFSP ,t G2 . We need to prove that for any H ∈ Bt and any integer k, (G1 ⊕ H, k) ∈ Π if and only if (G2 ⊕ H, k + ∆EFSP ,t (G1 , G2 )) ∈ Π. Suppose that (G1 ⊕ H, k) ∈ Π (by symmetry the same arguments apply starting with G2 ). Since G1 ⊕ H is a 0-boundaried graph and EFSP is a Π-encoder, we have that f EFSP (G1 ⊕ H, R∅ ) = f Π (G1 ⊕ H) > k. (9) As ∼∗E ,G,t is DP-friendly and G1 ∼∗E ,G,t G2 , it follows that (G1 ⊕H) ∼∗E ,G,t (G2 ⊕H) FSP FSP FSP and that ∆EFSP ,t (G1 ⊕H, G2 ⊕H) = ∆EFSP ,t (G1 , G2 ). Since G2 ⊕H is also a 0-boundaried graph, the latter property and Equation (9) imply that f EFSP (G2 ⊕ H, R∅ ) = f EFSP (G1 ⊕ H, R∅ ) + ∆EFSP ,t (G1 , G2 ) > k + ∆EFSP ,t (G1 , G2 ). (10) Since EFSP is a Π-encoder, f Π (G2 ⊕ H) = f EFSP (G2 ⊕ H, R∅ ), and from Equation (10) it follows that (G2 ⊕ H, k + ∆EFSP ,t (G1 , G2 )) ∈ Π. A.4 Proof of Lemma 3 Let C be an arbitrary equivalence class of ∼EFSP ,G,t , and let G1 , G2 ∈ C. Let us first argue that C contains some progressive representative. Since ∆EFSP ,t (G1 , G2 ) = f EFSP (G1 , R) − 40 f EFSP (G2 , R) for every encoding R such that f EFSP (G1 , R), f EFSP (G2 , R) 6= −∞, G ∈ C is progressive if f EFSP (G, R) is minimal in f EFSP (C, R) = {f (G, R) : G ∈ C} for every encoding R (including those for which the value is −∞). Since f EFSP (C, R) is a subset of N ∪ {−∞}, it necessarily has a minimal element, hence there is a progressive representative in C (in other words, the order defined by G1 4 G2 if ∆EFSP ,t (G1 , G2 ) 6 0 is well-founded). Now let G ∈ G be a progressive representative of C with minimum number of vertices. We claim that G has size at most 2r(E,g,t,G)+1 · t (we would like to stress that at this stage we only need to care about the existence of such representative G, and not about how to compute it). Let (T, X ) be a boundaried nice tree decomposition of G of width at most t − 1 such that ∂(G) is contained in the root-bag (such a nice tree decomposition exists by [27]). We first claim that for any node x of T , the graph Gx is a progressive representative of its equivalence class with respect to ∼EFSP ,G,t , namely C0 . Indeed, assume for contradiction that Gx is not progressive, and therefore we know that there exists G0x ∈ C0 such that ∆EFSP ,t (G0x , Gx ) < 0. Let G0 be the graph obtained from G by replacing Gx with G0x . Since ∼∗E ,G,t is DP-friendly, it follows that G ∼EFSP ,G,t G0 and FSP that ∆EFSP ,t (G0 , G) = ∆EFSP ,t (G0x , Gx ) < 0, contradicting the fact that G is a progressive representative of the equivalence class C. We now claim that for any two nodes x, y ∈ V (T ) lying on a path from the root to a leaf of T , it holds that Gx EFSP ,G,t Gy . Indeed, assume for contradiction that there are two nodes x, y ∈ V (T ) lying on a path from the root to a leaf of T such that Gx ∼EFSP ,G,t Gy . Let C0 be the equivalence class of Gx and Gy with respect to ∼EFSP ,G,t . By the previous claim, it follows that both Gx and Gy are progressive representatives of C0 , and therefore it holds that ∆EFSP ,t (Gy , Gx ) = 0. Suppose without loss of generality that Gy ( Gx (that is, Gy is a strict subgraph of Gx ), and let G0 be the graph obtained from G by replacing Gx with Gy . Again, since ∼∗E ,G,t is DP-friendly, it follows FSP that G ∼EFSP ,G,t G0 and that ∆EFSP ,t (G0 , G) = ∆EFSP ,t (Gy , Gx ) = 0. Therefore, G0 is a progressive representative of C with |V (G0 )| < |V (G)|, contradicting the minimality of |V (G)|. Finally, since for any two nodes x, y ∈ V (T ) lying on a path from the root to a leaf of T we have that Gx EFSP ,G,t Gy , it follows that the height of T is at most the number of equivalence classes of ∼EFSP ,G,t , which is at most r(EFSP , g, t, G) by Lemma 1. Since T is a binary tree, we have that |V (T )| 6 2r(E,g,t,G)+1 − 1. Finally, since |V (G)| 6 |V (T )| · t, it follows that |V (G)| 6 2r(E,g,t,G)+1 · t, as we wanted to prove. A.5 Proof of Lemma 4 Let EFSP = (C EFSP , LEFSP , f EFSP ) be the given encoder. We start by generating a repository R containing all the graphs in Ft with at most b + 1 vertices. Such a set of graphs, as well as a boundaried nice tree decomposition of width at most t − 1 of each of them, can be clearly generated in time depending only on b and t. By assumption, the size of 41 a smallest progressive representative of any equivalence class of ∼EFSP ,G,t is at most b, so R contains a progressive representative of any equivalence class of ∼EFSP ,G,t with at most b vertices. We now partition the graphs in R into equivalence classes of ∼EFSP ,G,t as follows: for each graph G ∈ R and each encoding R ∈ C EFSP (Λ(G)), as LEFSP and f EFSP are computable, we can compute the value f EFSP (G, R) in time depending only on EFSP , g, t, and b. Therefore, for any two graphs G1 , G2 ∈ R, we can decide in time depending only on EFSP , g, t, b, and G whether G1 ∼EFSP ,G,t G2 , and if this is the case, we can compute the transposition constant ∆EFSP ,t (G1 , G2 ) within the same running time. Given a t-protrusion Y on n vertices with boundary ∂(Y ), we first compute a boundaried nice tree decomposition (T, X , r) of Y in time f (t) · n, by using the linear-time algorithm of Bodlaender [4, 27]. Such a t-protrusion Y equipped with a tree decomposition can be naturally seen as a t-boundaried graph by assigning distinct labels from {1, . . . , t} to the vertices in the root-bag. We can assume that Λ(Y ) = {1, . . . , t}. Note that the labels can be transferred to the vertices in all the bags of (T, X , r), by performing a standard shifting procedure when a vertex is introduced or removed from the nice tree decomposition [5]. Therefore, each node x ∈ V (T ) defines in a natural way a t-protrusion Yx ⊆ Y with its associated boundaried nice tree decomposition, with all the boundary vertices contained in the root bag. Let us now proceed to the description of the replacement algorithm. We process the bags of (T, X ) in a bottom-up way until we encounter the first node x in V (T ) such that |V (Yx )| = b + 1 (note that as (T, X ) is a nice tree decomposition, when processing the bags in a bottom-up way, at most one new vertex is introduced at every step, and recall that b > t, hence such an x exists). We compute the equivalence class C of Yx according to ∼EFSP ,G,t ; this corresponds to computing the set of encodings C EFSP (Λ(Yx )) and the associated values of f EFSP (Yx , ·) that, by definition of an encoder, can be calculated since f EFSP is a computable function. As |V (Yx )| = b + 1, the graph Yx is contained in the repository R, so in constant time we can find in R a progressive representative Yx0 of C with at most b vertices and the corresponding transposition constant ∆EFSP ,t (Yx0 , Yx ) 6 0, (the inequality holds because Yx0 is progressive). Let Z be the graph obtained from Y by replacing Yx with Yx0 , so we have that |V (Y )| < |V (Z)| (note that this replacement operation directly yields a boundaried nice tree decomposition of width at most t − 1 of Z). Since ∼∗E ,G,t is DP-friendly, it follows that Y ∼EFSP ,G,t Z FSP and that ∆EFSP ,t (Z, Y ) = ∆EFSP ,t (Yx0 , Yx ) 6 0. We recursively apply this replacement procedure on the resulting graph until we eventually obtain a t-protrusion Y 0 with at most b vertices such that Y ∼EFSP ,G,t Y 0 . The corresponding transposition constant ∆EFSP ,t (Y 0 , Y ) can be easily computed by summing up all the transposition constants given by each of the performed replacements. Since each of these replacements introduces a progressive representative, we have that ∆EFSP ,t (Y 0 , Y ) 6 0. As we can assume that the total number of nodes in a nice tree decomposition of Y is O(n) [27, Lemma 13.1.2], the overall running time of the algorithm is O(n) (the constant hidden in the “O” notation depends indeed exclusively on EFSP , g, b, G, and t). 42 A.6 Proof of Theorem 1 By Lemma 1, the number of equivalence classes of the equivalence relation ∼EFSP ,G,t is finite and by Lemma 3 the size of a smallest progressive representative of any equivalence class of ∼EFSP ,G,t is at most b(EFSP , g, t, G). Therefore, we can apply Lemma 4 and deduce that, in time O(|Y |), we can find a t-protrusion Y 0 of size at most b(EFSP , g, t, G) such that Y ∼EFSP ,G,t Y 0 and the corresponding transposition constant ∆EFSP ,t (Y 0 , Y ) with ∆EFSP ,t (Y 0 , Y ) 6 0. Since EFSP is a Π-encoder and ∼∗E ,G,t is DP-friendly, it follows FSP from Lemma 2 that Y ≡Π Y 0 and that ∆Π,t (Y 0 , Y ) = ∆EFSP ,t (Y 0 , Y ) 6 0. Therefore, if we set k 0 := k + ∆Π,t (Y 0 , Y ), it follows that (G, k) and ((G − (Y − ∂(Y ))) ⊕ Y 0 , k 0 ) are indeed equivalent instances of Π with k 0 6 k and |Y 0 | 6 b(EFSP , g, t, G). A.7 Proof of Corollary 1 For 1 6 i 6 `, where ` is the number of protrusions in the decomposition, we apply the polynomial-time algorithm given by Theorem 1 to replace each t-protrusion Yi with a graph Yi0 of size at most b(EFSP , g, t, G) and to update the parameter accordingly. In this way we obtain an equivalent instance (G0 , k 0 ) such that G0 ∈ G, k 0 6 k and |V (G0 )| 6 |Y0 | + ` · b(EFSP , g, t, G) 6 (1 + b(EFSP , g, t, G))α · k . 43
8cs.DS
1 Spectrum Access In Cognitive Radio Using A Two Stage Reinforcement Learning Approach Irene Dias Thulasi Tholeti Sheetal Kalyani Department of Electrical Engineering Indian Institute of Technology, Madras Chennai, India 600 036 {ee14d213,ee15m068,ee15d410,skalyani}@ee.iitm.ac.in arXiv:1707.09792v1 [cs.IT] 31 Jul 2017 Vishnu Raj Abstract—With the advent of the 5th generation of wireless standards and an increasing demand for higher throughput, methods to improve the spectral efficiency of wireless systems have become very important. In the context of cognitive radio, a substantial increase in throughput is possible if the secondary user can make smart decisions regarding which channel to sense and when or how often to sense. Here, we propose an algorithm to not only select a channel for data transmission but also to predict how long the channel will remain unoccupied so that the time spent on channel sensing can be minimized. Our algorithm learns in two stages - a reinforcement learning approach for channel selection and a Bayesian approach to determine the optimal duration for which sensing can be skipped. Comparisons with other learning methods are provided through extensive simulations. We show that the number of sensing is minimized with negligible increase in primary interference; this implies that lesser energy is spent by the secondary user in sensing and also higher throughput is achieved by saving on sensing. Index Terms—Cognitive Radio, Multi-armed Bandit, Opportunistic Spectrum Sensing, Reinforcement Learning, Bayesian Learning I. I NTRODUCTION Cognitive radio(CR) was one of the key ideas introduced to overcome spectrum scarcity, back in 1999 [1]. It has drawn a lot of attention ever since its inception as it promises a huge increase in spectrum utilization which is crucial for supporting higher data rates as well as hosting more number of users. Spectrum utilization gains more context now than ever with the advent of 5G wireless technology and Internet of Things. Maximizing spectrum utilization is imperative for satisfying the ambitious demands of 5G systems - immense capacity, high reliability and the perception of limitless connectivity. To achieve this, we need to leverage the information available in the network using algorithms that can learn from the available data. CR improves spectrum utilization by tapping into licensed spectrum when it is underutilized. Secondary users (SUs) attempt to transmit their data by sensing holes in the primary traffic. Each SU is required to sense the available channels, typically using an energy detector [2]– [5], to ensure that it is not occupied before transmitting so as to minimize the interference caused to the primary user (PU). Therefore, one of the crucial aspects of a cognitive radio system is to attain maximum secondary user throughput whilst keeping the interference caused to the PU below a pre- specified threshold. Often, strict constraints are imposed on the maximum interference that the primary user can tolerate. Initially, a SU needs to select a channel for transmission. Naively, the SU could pick a channel to sense at random and transmit data if it is found to be idle. On the other hand, multi-slot sensing can also be performed; if a channel sensed is busy, another channel is sensed until one is found to be idle. We make the observation that if a pattern could be associated with the primary traffic, the predictability of primary traffic is improved. Various methods based on learning, which keep track of the channel occupancy, have been proposed to ensure that the channel that is most likely to be idle is chosen. One of the methods of posing the optimal channel selection problem is as a multi-armed bandit(MAB) problem where the different channels to be picked act as arms of the bandit [6]. In [7], the authors use a dynamic programming approach to choose the optimal channel sensing order when adaptive modulation is employed. Reinforcement Learning (RL) algorithms like Q Learning [8] and Artificial Neural Networks [9] have also been shown to improve CR performance. Some of the other methods for spectrum sensing suggested in [10] include Multilayer Perceptron based neural networks, Bayesian inference methods, Auto-Regressive model based approach, static neighbour graphs and moving average based methods. In [11], a survey of various decision-theoretic approaches such as game theory, Markov Decision Processes, MABs, etc. for performing channel selection is given. From our survey of the papers that use learning in cognitive radio [12]–[14], we note that they typically address the effect of their algorithms on throughput and regret but do not focus on time spent on sensing. A quiet period is assumed in the beginning of every frame that is used for sensing the channel [15]. A recurrent sensing period for every frame not only affects the throughput and the energy efficiency (since the SU expends considerable energy in sensing the channel) of the SU but also results in the underutilization of the spectrum which is a major issue, with the ever-increasing demand for capacity. Judicious sensing is quite important for achieving maximum throughput as time utilized for channel sensing is time lost for data transmission. In other traditional cognitive radio papers like [16], the authors formulate an optimization problem to maximize throughput given a constraint on the probability of detection and prove that an optimal sensing time exists 2 for a fixed frame size. On the other hand, [17] considers a transmission scheme where the sensing duration is fixed, and an expression for the optimal frame size that maximizes normalizes throughput is derived; this determines how often sensing is carried out. While in [16], [17], the time spent on sensing is taken into consideration, the expressions for optimal frame size/sensing time depend on the parameters of the primary traffic which might not be available to SU or might be changing with time. Further, the above mentioned works assume that the ON/OFF times are sampled from an exponential distribution in both their derivations and simulations. Work in [18] does consider primary traffic with unknown parameters; however, this work again concentrates exclusively on channel selection and not on time spent on sensing. Summarizing, the works that adopt reinforcement learning techniques in cognitive radio to learn the primary traffic behaviour do not consider optimizing the sensing time; they assume a sensing period is available for every frame. The works that aim to optimize sensing time assume knowledge of the primary user statistics and mostly consider an Exponential PU traffic model. We believe that to maximize the throughput of the SU, algorithms that learn which channel to sense should also learn how often to sense. Addressing both issues simultaneously will lead to better performance of the cognitive radio system and this is the key focus of this work. It is obvious that if channel sensing can be skipped in a frame or more, the benefit in throughput and energy efficiency would be remarkable; but it might adversely affect the interference caused to the primary user. In that case, we raise the following question: how often should we sense? In our work, we introduce a novel method to skip sensing which is based on learning the behaviour of the primary traffic over time through a Bayesian approach. Our work proposes a novel algorithm to maximally exploit the spectrum by picking the channel to sense using a multi-armed bandit, and then sensing the selected channel at specific intervals using a Bayesian method to decide the interval duration between two sensing operations. We believe that introducing two layers of learning will ensure higher spectrum utilization than the existing methods. When compared to existing RL methods, our approach significantly reduces the amount of sensing required and leads to increase in both throughput and energy efficiency. We provide extensive comparison results with other existing learning algorithms through simulations and show that the proposed approach is superior in terms of its performance. Further, for simulations, we have considered the popular DTMC model for discrete time primary user traffic and both Generalized Pareto Model and Exponential model for continuous traffic since in [19] it has been shown that the generalized Pareto distribution captures the primary user traffic variations more accurately. This paper is organized as follows: Section II describes the system model that is considered for our experiments. Section III gives a brief overview of reinforcement learning algorithms. The proposed method for channel sensing is described in section IV. The simulations performed and the results observed therein are discussed in section V. Finally, section VI presents the concluding remarks. II. S YSTEM M ODEL In our system model, we consider N channels that can be accessed by the secondary user. The secondary user wishes to transmit data packets so as to maximize its own throughput whilst causing the least interference to the licensed users. The channel is sensed to check whether it is idle or busy before the data is sent, unless we are positive that the channel is available for transmission. This depends on the channel model that is used. We assume that the sensing operation is repeated until we find a channel that is idle or we exhaust all available channels. The aim is to reduce the number of sensing operations that need to be performed so that a larger part of the frame is available for data transmission. To do so, we employ learning algorithms that predict the current state of the channel based on the previously observed states. The learning algorithm returns a ranked list of channels in the order of estimated probability of occupancy. The sensor then senses the channels in that order. Once a channel is found to be idle, the secondary user transmits its data. Upon transmission, we encounter one of the two scenarios: the transmission is unsuccessful either due to collision or error in the channel, or the packet is delivered successfully. If a packet drop/collision occurs, we achieve a zero throughput at the receiver end, else, high throughput is achieved. In the rest of the section, we focus on describing the frame structure used by the secondary users and the primary user traffic model. The data is transmitted by the secondary user in frames of fixed size, T . Each frame that is transmitted has a sensing duration and a transmission duration. During the sensing duration the secondary user senses the channels either randomly or based on input from the learning algorithms. It is assumed that each channel sensing takes time τ . Once a channel is sensed to be free, then data is transmitted for the rest of the frame. The sensing in each frame can be done in two ways: single slot sensing and multi-slot sensing as shown in Figures 1 and 2. In the first frame type, only one channel is sensed in each frame(for a duration τ ) and if this channel is found to be vacant, the user transmits for a duration of T − τ ; else, transmission does not happen for that frame. But this method denies the secondary user a chance to find another free channel that might have been vacant during that time. τ T −τ Sensing T ransmission Fig. 1: Single slot sensing frame T − k1 τ k1 τ S1S2 Sk 1 Sensing T − k2 τ k2 τ S1S2 Sk 2 T ransmission Fig. 2: Multi slot sensing frame In the multi-slot sensing frames the secondary user keeps on sensing the channels till it finds a vacant channel to 3 where pij represents the probability that the system transitions from state si to sj . The discrete formulation of the primary traffic is also adopted in [18], [21], [22]. Duty Cycle(Ψ) is defined as the probability that the channel is busy and can be written as P (S = s0 ) = 1 − Ψ and P (S = s1 ) = Ψ. The DTMC model can be used to reproduce any arbitrary DC, Ψ, by selecting the transition probabilities as p01 = p11 = Ψ and p00 = p10 = 1 − Ψ, which yields,   1−Ψ Ψ P = (2) 1−Ψ Ψ For channels with varying load, the P matrix will also vary with time and the duty cycle will become a time varying quantity, Ψ(t). The channel load under this model is considered to be a random variable, which can be characterised by its PDF. The empirical PDFs of Ψ in real systems can be accurately fitted with the Beta distribution(Eqn.3) or the Kumaraswamy distribution(Eqn.4) as suggested by [19]. The Beta distribution is given by B fX (x; α, β) = 1 xα−1 (1 − x)β−1 , B(α, β) x ∈ (0, 1) (3) where α > 0, β > 0 and B(α, β) is the Beta function. The Kumaraswamy distribution is given by K fX (x; a, b) = abxa−1 (1 − xa )b−1 , x ∈ (0, 1), a, b > 0 (4) The work in [23] which studies modelling the spectrum opportunities suggests that Generalized Pareto Distribution(GPD) is a good approximation to the observed measurements. In the continuous time model, GPD is a heavy-tailed distribution that allows us to model a wider range of traffic when compared with an exponential distribution. Hence, for the continuoustime model, we assume that the on and off times are distributed 0.5 Channel number transmit. Assume that for the ith frame, ki channels are sensed. Therefore, the total sensing time is ki τ . Data is transmitted for T − ki τ . In case sensing is entirely skipped for a frame i, ki = 0; data is transmitted for the entire frame duration T . Multi-slot sensing allows the secondary user to transmit its data more often than the single-slot scheme as the SU can sense different channels until an idle channel is found. We now move on to another important component of the system model: the structure of the primary traffic. The primary user traffic on N channels is modeled to be independent. We take two approaches to modeling the primary traffic: the discrete-time model and the continuous-time model. This is done to show that the proposed algorithm performs well in a wide range of primary traffic scenarios. In the Discrete-Time Markov Chain(DTMC) model, the time index set is discrete. [20] model their primary traffic as a Markov chain with 2N states and show that we can consider a simplified 2-state (idle and busy) for a given channel that evolves independently. The behaviour of the channel can be expressed by a transition probability matrix as given below.   p00 p01 P = (1) p10 p11 Generalized Pareto Distributed model with randomly selected parameters 1 1 0.9 1.5 0.8 2 0.7 2.5 0.6 3 0.5 3.5 0.4 4 0.3 4.5 0.2 5 0.1 5.5 0 0.5 1 1.5 2 2.5 3 Time (in ms) 3.5 4 #10 4 Fig. 3: Generalized Pareto distributed primary traffic according to GPD. The probability density function of a GPD is given by  −1− k1 1 x−θ f (x|k, σ, θ) = 1+k θ < x; k > 0 (5) σ σ where k, σ and θ are the shape, scale and location parameters respectively. Varying traffic load can be generated by varying the parameters of GPD. For example, fast-varying traffic can be modelled by increasing the scale parameter whereas percentage of occupancy can be modelled by varying the location parameter of the ON and OFF times. Figure 3 shows the evolution of primary traffic modeled as GPD over 40 seconds for 5 independent channels. We can see that there are large blocks of time for which some of the channels are in the OFF state. From the figure, it is apparent that we need not spend time sensing the channel in every frame. In fact, one can save significant amount of sensing time and energy if one could learn the average on/off behaviour of the channels. We aim to exploit this in our proposed approach. To maximally utilize these gaps in the spectrum, we propose a two-stage reinforcement learning technique. Before describing our proposed method, we first briefly summarize key ideas and popular methods in reinforcement learning in the succeeding section. III. R EINFORCEMENT L EARNING Learning can be broadly categorized as supervised, unsupervised and reinforcement learning. In Reinforcement Learning(RL), the agent learns to act appropriately by interacting with the environment [24]. With each action, a reward is obtained which is the only mode of feedback for the learning agent. RL is attractive as it does not require a dataset for training; it learns from data and hence, can be used in realtime applications; this is why RL has also been applied in cognitive radio to find which channel to sense. In general, an RL problem is modelled as a Markov Decision Process in which there are S states and A possible actions that can be taken from each state. A multi-armed bandit(MAB) problem is the simplest form(single state) of an RL problem in which the agent learns to choose the most optimal option among available options so as to maximize the cumulative reward by sampling one option at a time. A learning agent chooses one of the N actions 4 available to it and updates the value of the action according to the reward it obtains. The next action chosen is a function of the learnt values. In the cognitive radio setting, the different channels to be sensed by a SU act as the arms of the bandit. On pulling an arm, that is, picking a channel to sense, we obtain a reward which can be the SU throughput achieved or an indicator which gives us information on whether a collision with the primary user had occurred or not. A standard phenomenon in the bandit setting is the exploration exploitation trade-off. The algorithm needs to optimally balance utilizing the action that has performed the best so far, and looking for new options that can be potentially better. Various algorithms have been proposed to address this trade-off: the classic Thompson sampling algorithm for Bernoulli arms [25], -greedy algorithm, Upper confidence bound algorithms [26], EXP3 for the case of adversarial bandits [27], etc. Two of the RL algorithms which have been used in the cognitive radio context are briefly explained below. We will use these two algorithms for comparison against our proposed approach in section V. success of each arm, which is the parameter of the Bernoulli distribution. Here α and β correspond to the number of successes and failures observed respectively. The Beta distribution peaks at the actual Bernoulli parameter when one has observed sufficient number of samples. This algorithm was first introduced in [30] and was further analyzed by [31]. The work in [32] and [33] use ideas from Thompson sampling to propose an algorithm for channel selection in CR. In [32], a Weibull likelihood and a inverse gamma conjugate prior is assumed for performing the Bayesian update instead of the Bernoulli- Beta distribution used in TS. In [33], the authors propose TS for multislot sensing by listing the channels in the descending order of their preference. Algorithm 2 Thompson Sampling [31] 1: 2: 3: 4: 5: 6: A. Algorithms 1) Q Learning (Algorithm 1): The Q Learning Algorithm is a widely used reinforcement learning algorithm in wireless communication introduced in 1989 by Watkins [28] . It works on a Markov model with multiple states and actions. The algorithm selects the optimal action in each state by learning Q-values associated with each action. It also incorporates an exploration strategy like -greedy or softmax in its framework. The Q Learning algorithm has been shown to converge to the optimal action for each state. 7: 8: Initialization: α0i = 2, β0i = 2 ∀ i = 1, . . . , K for dot = 1, 2, 3, . . . i i Sample θi from Beta(αt−1 , βt−1 ) for all arms Select arm with highest value of θi Pull that arm It and receive reward xIt ,t It + xIt ,t αtIt ← αt−1 It It βt ← βt−1 + (1 − xIt ,t ) end for These RL algorithms can be used to suggest which channel to select at the start of every frame, when used in the cognitive radio context. However, we can see that, when a channel is unoccupied, it is highly likely to be unoccupied in the next instant as well. Our approach additionally exploits this behavior of the primary traffic. IV. P ROPOSED A PPROACH A. Motivation for the Proposed Approach Algorithm 1 Q Learning 1: 2: 3: 4: 5: Initialization: Q(s, a) = 0, ∀ a ∈ A, A is set of all possible actions and ∀ s ∈ S, S is set of all states for t do = 1, 2, 3, . . . Select the action based on the exploration strategy and Q values in state s Take action selected and obtain reward r, s0 is new state reached Update the Q value for arm selected in state s as Qt+1 (s, a) ← (1−α)Qt (s, a)+α∗(r+γ∗ max0 Qt (s0 , b)) b∈A(s ) 6: where α is the learning rate, γ is the discount factor end for The stateless Q Learning variant [29] assumes a single state with multiple actions. The update equation for stateless Q Learning is obtained by setting the discounting parameter, γ, to zero. Q-learning is also employed for channel selection in cognitive radio by [8]. 2) Thompson Sampling (Algorithm 2): Thompson Sampling comes from a family of randomized probability matching algorithms. It is proposed for Bernoulli arms; therefore, the rewards are binary in nature. A prior Beta distribution Beta(α, β) - is maintained which tracks the probability of Most of the work in CR literature focuses on finding the optimal channel to sense. However, they do not address how often to sense the channel after selection. It is apparent from Figure 3 that SU can forgo sensing the selected channel for some duration depending on the channel traffic. Hence, we propose an algorithm that incorporates two stages of learning. Learning to pick the right channel through an MAB formulation and learning an appropriate strategy for sensing that channel. We believe that our work is the first to suggest a two-stage learning algorithm so that time and energy spent in sensing can be minimized. In the first stage of learning, a metric known as value is maintained for all the arms which quantitatively indicates how beneficial it is to pick that channel. In the context of cognitive radio, this is an indicator of whether a channel is likely to be idle or vacant. When an arm is played, i.e., when a channel is chosen for sensing, the energy detector that indicates whether the channel is busy or available. The value of the arm is penalized if it found to be busy by the energy detector. When a vacant channel is found, we also obtain a reward from the environment based on whether the frame was transmitted successfully. This reward is also used to update the value of the arm. At any instant, the SU can decide to exploit - pick the channel with the maximum value, or 5 explore - pick among other channels so as to learn more about their behaviour. We illustrate our algorithm using an optimistic variant of the Thompson sampling algorithm, although any of the other bandit or RL algorithms can be employed. To determine the strategy to skip sensing, one possible approach is to have the secondary user transmit on a channel until it encounters a collision from the primary data. However, this implies that sending on a channel is interrupted only when a collision occurs. Depending on the primary user traffic, this can lead to significant interference to the PU and one needs a more conservative approach. Hence, we propose the following approach. Ideally, we should skip a few frames and stop transmitting before a collision occurs. To do so, we need to estimate the underlying traffic distribution of the primary user. A prior distribution for a parameter of the estimated primary traffic is maintained; it is updated when a data sample is observed. In practical situations, secondary users do not have exact knowledge about the primary traffic; hence, in our algorithm, SU assumes that the primary traffic follows exponential on/off model and maintains a prior for the exponential parameter, θ. The conjugate prior for an exponential distribution is a gamma distribution whose parameters we update to estimate θ. The Generalized Pareto Distribution has a heavier tail when compared to the exponential model; hence, assuming an exponential distribution is justified as it prepares the SU for shorter idle times than the actual traffic and hence leads to lesser probability of interference with the PU. The OFF time of the channel is assumed to be a sample from an exponential distribution with parameter θ, i.e., TOF F ∼ Exp(θ) = θe−θtOF F The mean of the distribution is 1/θ and this corresponds to the mean OFF time. Therefore, to determine the number of steps for which sensing can be skipped(tskip ), we consider the inverse of the sample obtained from the prior distribution. Physically, 1/θ signifies the mean time duration for which the channel stays idle. Let the SU assume that the primary traffic OFF time, tOF F , is exponential with parameter θ for a specific channel; let the conjugate gamma prior be parameterized by α and β, i.e., θ ∼ G(α, β). β α α−1 −βθ θ e (6) p(θ) = Γ(α) In the cognitive radio context we get a data sample x which denotes the duration for which data is transmitted without experiencing a collision from the time that channel was selected. It is essentially a sample quantized to the frame size T as we assume that we do not have information of any collisions that occur is less than one frame duration. The posterior distribution of θ is given by p(θ|x) ∝ p(θ)l(θ|x) β α α−1 −βθ −θx θ e θe ∝ Γ(α) ∝ θα+1−1 e−(β+x)θ p(θ|x) ∼ G(α + 1, β + x) When we have n samples, the posterior is given by p(θ|x1 , ...xn ) ∼ G(α + n, β + n X xi ) (7) i=1 Note that in Equation (7), xi s play the role of realizations of the OFF time of the primary traffic. As we observe more and more samples of xi , p(θ|x1 , ..xn ) becomes more and more concentrated around its mean. However, we make the following observation. x is not a sample of the entire OFF time; it is a sample of the OFF time observed after the secondary user selects the channel. Let Y and V denote the random variables for the exponential OFF time and the time at which an empty channel is selected by the SU respectively. In the absence of prior information, we can assume that V is a uniform distribution, i.e., a SU is likely to occupy an idle channel anytime during the OFF period. As V is assumed to be uniform, i.e., V ∼ U [0, y] where y is a realization of Y , the actual OFF time. Hence, we have E[Y − V ] = E[Y ] − E[V ] y 1 = − EY [ ] θ 2 1 = 2θ On an average, the mean OFF time observed after SU selects the channel is half the actual OFF time. Therefore, we incorporate a correcting factor in the posterior update. p(θ|x) ∼ G(α + 1, β + 2x) (8) The gamma distribution is hence updated by the above equation. The number of frames to be skipped is then obtained as a function of inverse of the sample from this posterior. As Equation (8) refers to the posterior of the PU OFF time, the inverse of a sample from p(θ|x) is indicative of the entire OFF time. Note that, just as the SU could have begun sensing anywhere during the PU OFF time, SU transmission could also start anywhere in that PU OFF period; the entire OFF period may not be available for SU transmission. Hence, the average time for which sensing should be skipped is typically half the inverse of a sample from p(θ|x). The step-wise description of the algorithm is given in Section IV-B and the intuition behind its working is described in Section IV-C. B. Algorithm Description In the classic multi-armed bandit problem, the Thompson sampling algorithm suggests one arm to be played out of the available options as illustrated in Algorithm 2. However, when applied to channel selection in cognitive radio using multislot sensing, we require a list of channels to sense. In [34], Thompson sampling is implemented to return a ranked list of channels so as to perform multi-slot sensing. We further modify this algorithm using a recent work [35] to obtain an optimistic variant. The Optimistic Thompson Sampling (OTS) algorithm modified to return a ranked list of channels instead of a single channel is given by Algorithm 3. Channel sensing is performed in the order indicated by the list until a vacant 6 Update αct and βct of gamma prior of channel ct as given below. channel is found. Following this, the optimal number of frames to skip for the chosen channel is chosen. The algorithm operates in two states: the SENSE state and the SKIP state. • • SENSE state: In this state, the algorithm always asks for a ranked list of preferred channels from the OTS algorithm (Algorithm 3). Then, it follows the multi-slot sensing policy to sense the channels until a vacant channel is found. Only on finding a vacant channel, will it transmit the data. Also, the number of frames to skip, tskip , is calculated. SKIP state: In this state the algorithm, primary channel sensing is not performed. The data to be transmitted is sent on the channel which was previously found to be vacant. Nskip , a counter for number of skips performed, is also incremented. The detailed algorithm is as given below: Step 1: Initialization - Set the parameters of the gamma prior for all channels to αi = 1 and βi = f rameLength . Also, set the algorithm in the SENSE state and Nskip to 0. Step 2: Channel Selection - If in the SENSE state then call GetRankedList() of Algorithm 3 to obtain a ranked list of preferred channels. Sense the channels sequentially to find a vacant channel to transmit, say ct at time t. A sample θ̂ is drawn from G(αct , βct ) and tskip is calculated as   1 1 , max θ̂ αct /βct tskip = 2 Note that αct /βct is the mean of the gamma distribution. Else, if the algorithm is in the SKIP state, then transmit on channel used in the previous time step and increment Nskip . Step 3: Obtain feedback - After frame transmission, a reward is obtained in the form of a collision indicator which is also used to update the OTS algorithm. (The collision indicator is nothing but the ACK or NACK from the device to which data was transmitted by the SU. Let z denote the collision indicator.) Step 4: Prior and OTS Updation - Three cases can occur here as given below: 1) Successful transmission and Nskip < tskip : Call UpdateObservation(ct , z = 0) then continue in SKIP state. 2) Successful transmission and Nskip = tskip : Reset Nskip and call UpdateObservation(ct , z = 0). Go to SENSE state.The parameters of the gamma prior are not updated until ct+1 is picked. Only if the next channel chosen by OTS is not the same as the current channel (ct+1 6= ct ), αct and βct are updated as given below αct ← αct + 1 βct ← βct + 2 ∗ t̂skip ∗ f rameLength where t̂skip indicates the number of frames skipped successfully in the same channel consecutively. 3) Unsuccessful transmission: Reset Nskip and call UpdateObservation(ct , z = 1). Go to SENSE state. αct ← αct + 1 βct ← βct + 2 ∗ t̂skip ∗ f rameLength Step 5: Go to Step 2 Algorithm 3 Optimistic Thompson Sampling (OTS) functions 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: Parameters Si = 1, Fi = 1 ∀ i ∈ {1, . . . , N } function G E T R A N K E D L I S T () di ∼ Beta(Si , Fi ) dˆi = max(di , E[Beta(Si , Fi )]) Sort dˆi in descending order Return the index of sorted order end function function U P D A T E O B S E R V A T I O N (ct ,collision) if collision then Fct ← Fct + 1 else Sct ← Sct + 1 end if end function C. Working of the algorithm We first explain the SENSE state of the algorithm. The OTS algorithm maintains a Beta distribution with success and failure parameters as Si and Fi for each of the N channels which are updated after every frame transmission. To obtain a priority list, an optimistic sample is drawn from each of the N Beta distributions i.e., the maximum of the mean and the sample is picked as the optimistic sample. This is done so that the samples obtained are atleast as much as the mean of the corresponding Beta distributions. The samples that are drawn are then arranged in descending order and their indexes are returned. This is the order in which sensing should be done. Now moving on to the SKIP state of the algorithm, we aim to estimate the idle time of the primary user on each of the channels using a Bayesian approach. The duration for which we can forgo sensing a channel is found by drawing a sample from the conjugate posterior distribution of θ and taking the inverse. The motivation behind drawing a sample from the gamma distribution rather than using the mean of the posterior is that drawing a sample from a distribution holds the possibility of exploring both lower and higher value for time duration to skip sensing which will help to converge to the best possible skip duration. As we observe higher number of samples, the variance of the gamma distribution, α/β 2 , decreases anyway. This implies that with more number of samples, picking a sample from the gamma distribution is very close to picking its mean value α/β. In other words, though we start with picking a sample from the posterior distribution instead of its mean, as we observe more samples, the picked sample θ̂ becomes close to the mean. (Also note that α/β is the MMSE estimate of θ.) Furthermore, inspired by the idea behind the optimistic variant of Thompson sampling, we wish to be more optimistic 7 in our estimation initially and hence favour the higher values for the number of frames to be skipped, i.e., we wish to pick a sample, tOF F , that corresponds to atmost the mean of the gamma distribution in the worst case. Therefore, tskip = tOF F /2 corresponds to half of either the sample from the gamma distribution or the mean of the distribution, whichever is lower.   1 1 max , θ̂ αct /βct tskip = (9) 2 Note that the factor of 2 in the denominator is because the entire OFF period may not be available to the SU for transmission. Please see Section IV-A for detailed explanation. The α parameter accounts for the number of OFF period samples observed. It is incremented by 1 every time a collision occurs. If there is no collision at the end of tskip , then the OFF period is ongoing. As α corresponds to an entire OFF period, one cannot just update α at the end of tskip . Hence, α is not updated if the same channel is picked again for transmission as it would indicate that the same OFF period is ongoing. It is updated only when a different channel is picked at the end of tskip , i.e., ct 6= ct+1 or when a collision occurs in the current channel. The β parameter is updated with twice the duration upto which data was successfully transmitted on the same channel. As mentioned earlier, a factor of 2 is incorporated so that the gamma distribution is indicative of the entire OFF period. As mentioned in Section IV-A, the number of frames (OFF duration of primary traffic) that can be skipped is inversely proportional to θ. When no collision occurs, we update β with a higher value; this reduces the mean of the posterior, which implies longer OFF times. When collision occurs, β is updated with a comparatively lower value. On performing this update with each sample, we arrive at an appropriate duration to skip as the posterior mean converges to the mean OFF time as number of samples increases. Note that the Thompson sampling algorithm is also updated in parallel to keep track of the channel occupancy every time a frame is transmitted. We increment the success parameter Sct if the transmission is successful; if a collision is encountered, the failure parameter Fct is incremented. In our proposed algorithm, even when the frames are skipped without encountering a collision, we go back to the sensing phase after tskip frames. This is done to ensure that we skip conservatively instead of waiting for a collision. Instead, if we choose to transmit on the same channel even after tskip frames, we may obtain a better throughput at the cost of higher interference in heavy traffic scenarios. However, this will increase the number of collisions, while we want to keep the number of collisions to be similar to what is seen when only RL algorithms are used. literature for channel selection. Most of the papers that use learning techniques in CR networks assume either a Discrete Time Markov model or a channel model based on a Bernoulli Distribution [13]. Hence we also consider a primary user traffic model based on Discrete Time Markov Chain (DTMC) model. However it has been pointed out in [19] that a continuous time model based on GPD can capture traffic characteristics better. Therefore, we also consider a continuous time primary user traffic model based on GPD model. For DTMC traffic model, we provide results for low, medium and high traffic models. For GPD and exponential models, the parameters are set to mimic medium traffic in channels. The traffic on each channel is modeled independently by assuming different parameters for different channels in the ranges specified in Table I. We employ an energy detector to sense the presence of any primary traffic in available channels [3] during the sensing phase. The number of samples for the energy detector is calculated using the formula given in [16] for a given value of probability of false alarm (Pf ) and probability of detection(Pd ). For the values of Pf and Pd provided in Table I, the number of samples required are 1180. Note that while [2]–[4] implement an energy detector, most of the work that uses RL algorithms assume perfect sensing [15], i.e., Pf = 0 and Pd = 1. We evaluate the performance of the proposed algorithm in terms of three metrics: 1) Normalized Average Achievable Throughput: This metric corresponds to the average observed throughput normalized to maximum throughput achievable. 2) Average Number of frame collisions: Average number of frame collisions incurred with primary user traffic. 3) Average Number of sensing per frame: Number of sensing operations done at the beginning of each frame until a vacant channel is found. Parameter DTMC Model Low Traffice (L-I) Medium Traffic (M-I) High Traffic (H-I) Continuous Traffic Model-GPD Exponential Traffic Model Pd Pf Frame duration Sensing duration SNR of SU at SU receiver SNR of PU at SU receiver Channel Error TABLE I: Parameters used for simulation The throughput is calculated as in [16], [36] using the formula given below. T Pachievable = V. S IMULATION R ESULTS A. Simulation Setup In this section, we present simulation results to evaluate the performance of our proposed approach with three other learning based algorithms that have been employed in CR Value α ∈ (0, 1], β ∈ [1, 5] α ∈ (0, 1], β ∈ (0, 1] α ∈ [1, 5], β ∈ [1, 5] σ = 500,k ∈ [0, 0.5],θ ∈ [50, 100] θ−1 = (0, 500] 0.95 0.05 50ms 3ms 20dB −10dB 5% ( C= log2 (1 + SN Rsec ) 0 T − kτ ·C T (10) ; on successful transmission ; on frame loss Here, T is the frame duration and τ is the sensing duration. k denotes the number of channels sensed before finding a 8 Proposed OTS Q-Learning Traditional SBLA 1.5 1 0.5 0 1 2 3 Time(ms) 4 5 0.84 0.82 0.8 0.78 0.76 0.74 6 ×10 0.1 Proposed OTS Q-Learning Traditional SBLA Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 2 0 1 2 4 3 Time(ms) 4 5 ×10 0.09 0.085 0.08 0.075 0.07 0.065 6 Proposed OTS Q-Learning Traditional SBLA 0.095 0 2 3 Time(ms) 4 5 6 ×10 4 (c) Avg. Frame Collision (b) Avg. Achievable Throughput (a) Avg. No.of Sensing per frame 1 4 Fig. 4: Results for GPD Model for frame size 50ms for 5 channels. Proposed OTS Q-Learning Traditional SBLA 1.2 1 0.8 0.6 0.4 0.2 0 0 1 2 3 Time(ms) 4 5 0.92 0.9 0.88 0.86 0.84 0.82 6 ×10 0.045 Proposed OTS Q-Learning Traditional SBLA Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 1.4 0 1 2 4 3 Time(ms) 4 5 ×10 0.035 0.03 0.025 0.02 0.015 6 Proposed OTS Q-Learning Traditional SBLA 0.04 0 2 3 Time(ms) 4 5 6 ×10 4 (c) Avg. Frame Collision (b) Avg. Achievable Throughput (a) Avg. No.of Sensing per frame 1 4 Fig. 5: Results for DTMC Low Traffic Model (DTMC L-I) for frame size 50ms for 5 channels. Proposed OTS Q-Learning Traditional SBLA 1.5 1 0.5 0 1 2 3 Time(ms) 4 5 6 ×10 (a) Avg. No.of Sensing per frame 0.13 0.84 Proposed OTS Q-Learning Traditional SBLA 0.82 0.8 0.78 0.76 0.74 0.72 0.7 0 1 4 2 3 Time(ms) 4 5 (b) Avg. Achievable Throughput 6 ×10 4 Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 2 Proposed OTS Q-Learning Traditional SBLA 0.12 0.11 0.1 0.09 0.08 0.07 0 1 2 3 Time(ms) 4 5 6 ×10 4 (c) Avg. Frame Collision Fig. 6: Results for DTMC Medium Traffic Model (DTMC M-I) for frame size 50ms for 5 channels. vacant channel and can take values between 1 and N , which is the total number of channels. The SNR of the secondary user (SN Rsec ) at the SU receiver is taken to be 20dB. To report the results, we normalize the achieved throughput to maximum throughput that can be achieved. This metric can vary between [0, 1] with 1 indicating maximum usage of spectrum for data transmission. Normalized throughput is calculated as T Pnormlaized = 1 · T Pachievable Cmax where Cmax = log2 (1 + SN Rsec ). (11) We have also taken into account a possibility of channel error. To the best of our knowledge, existing literature in CR applying learning techniques does not consider channel error. Channel error causes the frame to be lost even when the channel was not actually occupied by the primary user. In all the simulation results provided below, the probability of channel error is taken to be 0.05. This was done to simulate a more realistic environment. All the results reported are plotted for values averaged over 1000 independent runs for a time duration of 60s. The proposed algorithms are compared with Q-Learning (QL) [8], Switchable Bayesian Learning Automata 9 Proposed OTS Q-Learning Traditional SBLA 3.4 3.2 3 2.8 2.6 2.4 0 1 2 3 Time(ms) 4 5 0.43 0.42 0.41 0.4 0.39 0.38 0.37 0.36 0.35 6 ×10 0.21 Proposed OTS Q-Learning Traditional SBLA Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 3.6 0 1 2 4 3 Time(ms) 4 5 ×10 0.205 0.2 0.195 0.19 6 Proposed OTS Q-Learning Traditional SBLA 0 2 3 Time(ms) 4 5 6 ×10 4 (c) Avg. Frame Collision (b) Avg. Achievable Throughput (a) Avg. No.of Sensing per frame 1 4 Fig. 7: Results for DTMC High Traffic Model (DTMC H-I) for frame size 50ms for 5 channels. Proposed OTS Q-Learning Traditional SBLA 1.8 1.6 1.4 1.2 1 0.8 0.6 0 1 2 3 Time(ms) 4 5 6 ×10 (a) Avg. No.of Sensing per frame 4 0.76 0.22 Proposed OTS Q-Learning Traditional SBLA 0.74 0.72 Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 2 0.7 0.68 0.66 0.64 0.62 0 1 2 3 Time(ms) 4 5 (b) Avg. Achievable Throughput 6 ×10 4 Proposed OTS Q-Learning Traditional SBLA 0.21 0.2 0.19 0.18 0.17 0.16 0.15 0 1 2 3 Time(ms) 4 5 6 ×10 4 (c) Avg. Frame Collision Fig. 8: Results for Exponential Traffic Model for frame size 50ms for 5 channels. (SBLA) [33], Optimistic Thompson Sampling (OTS) [37] and a traditional method (RAND) [36]. The traditional method is the method where we pick the channel to sense randomly till we find a vacant channel or till all channels are sensed. For all the metrics i.e., throughput, number of sensing and frame collisions, we plot the cumulative values normalized to the number of frames the SU attempts to transmit till time t, say Ft . That is, for a metric X, we plot yt = t X 1 · Xn Ft n=1 (12) This metric is akin to the sample-averaged reward definition popularly used to evaluate reinforcement learning algorithms. The aim of this work is to maximize the achievable throughput of secondary user while minimizing number of sensing required by secondary user and keeping the collisions with PU to be comparable to that of the existing RL algorithms in literature which sense the the channel in every frame. B. Learning over time In this section, we present the results of how each of the methods perform over time. We consider a 5 channel system (N = 5) with a channel error of 5%. Figure 4 shows the results for GPD traffic model. From the figures, we can see that the proposed method is able to provide a 10% improvement in throughput and is able to reduce the number of sensing significantly. While the comparing algorithms require to do 1.5 sensing to transmit one frame on an average, the proposed method requires only 1/3rd of that. The proposed approach causes only a 0.5% increase in frame collision as compared to the the best performing method (QLearning), which is negligible considering the improvements in other metrics. Figures 5-7 show the results for the DTMC model for three different intensities of traffic. In all the traffic intensities that were considered, we can see that the proposed method is able to attain a gain of approximately 8% in throughput while creating only around 0.5% increase in frame collision when compared to the best performing alternative while significantly reducing the number of sensing required. In case of high traffic intensity, we can see that the proposed method is able to achieve considerable improvement in terms of number of sensing required and achievable throughput with only marginal increase in frame collision to PU. Overall, we can conclude that, the proposed method shows improvement in the popular DTMC traffic model in all traffic intensities when compared to other methods. We also evaluate the proposed method in the Exponential traffic model which is capable of capturing bursts in traffic in a realistic fashion. Figure 8 provides the results of the experiment. One immediate inference from the plots is that, due to the burstiness in traffic, the frame collisions is high when 10 Proposed OTS SBLA Q-Learning Traditional 1.6 1.4 1.2 1 0.8 0.6 0.4 3 4 5 6 7 8 No.of PU channels 9 0.9 0.1 Proposed OTS SBLA Q-Learning Traditional 0.85 Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 2 1.8 0.8 0.75 0.7 0.65 10 3 4 5 6 7 8 No.of PU channels 9 0.09 0.085 0.08 0.075 0.07 0.065 0.06 10 Proposed OTS SBLA Q-Learning Traditional 0.095 3 5 6 7 8 No.of PU channels 9 10 (c) Avg. Frame Collision (b) Avg. Achievable Throughput (a) Avg. No.of Sensing per frame 4 Fig. 9: Results for GPD Traffic Model with varying number of channels for frame size 50ms. Proposed OTS SBLA Q-Learning Traditional 1.2 1 0.8 0.6 0.4 0.2 0 3 4 5 6 7 8 No.of PU channels 9 0.94 0.045 Proposed OTS SBLA Q-Learning Traditional 0.92 0.9 Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 1.4 0.88 0.86 0.84 0.82 10 3 4 5 6 7 8 No.of PU channels 9 0.035 0.03 0.025 0.02 0.015 10 Proposed OTS SBLA Q-Learning Traditional 0.04 3 5 6 7 8 No.of PU channels 9 10 (c) Avg. Frame Collision (b) Avg. Achievable Throughput (a) Avg. No.of Sensing per frame 4 Fig. 10: Results for DTMC Low Traffic Model with varying number of channels for frame size 50ms. Proposed OTS SBLA Q-Learning Traditional 2 1.5 1 0.5 0 3 4 5 6 7 8 No.of PU channels 9 (a) Avg. No.of Sensing per frame 10 0.9 0.13 Proposed OTS SBLA Q-Learning Traditional 0.85 Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 2.5 0.8 0.75 0.7 0.65 3 4 5 6 7 8 No.of PU channels 9 (b) Avg. Achievable Throughput 10 Proposed OTS SBLA Q-Learning Traditional 0.12 0.11 0.1 0.09 0.08 0.07 0.06 0.05 3 4 5 6 7 8 No.of PU channels 9 10 (c) Avg. Frame Collision Fig. 11: Results for DTMC Medium Traffic Model with varying number of channels for frame size 50ms. compared to the GPD and DTMC L-I and M-I models. This often presents a challenge to CR channel access algorithms as the channel can be occupied by a PU at the time of SU transmission even though it is recently sensed to be vacant. Due to our two-tier learning strategy we see that, the proposed algorithm is able to perform better in all the evaluation metrics. The proposed algorithm is able to cut-down the number of sensings required by more than half and is able to provide a 5% improvement in throughput when compared to the best performing method in comparison. Interestingly, the frame collisions caused while following the proposed method is very close to the best algorithm in comparison. This improvement can be attributed to the design of the second layer of algorithm which assumed an exponential model of PU traffic. C. Effect of number of channels In this section, we provide results for how each of the algorithms perform with varying number of available channels. In all the results provided below, we consider a system with a frame size of 50ms and a sensing period of 3ms. Experiments were run for 60s and the reported values are the metrics measured at the end of the simulation time. 11 Proposed OTS SBLA Q-Learning Traditional 2 1.5 1 0.5 3 4 5 6 7 8 No.of PU channels 9 (a) Avg. No.of Sensing per frame 10 0.8 0.22 Proposed OTS SBLA Q-Learning Traditional 0.75 Avg. No.of Frame Collisions Normalized Avg. Achievable Throughput Avg. No.of Sensing per frame 2.5 0.7 0.65 0.6 0.55 3 4 5 6 7 8 No.of PU channels 9 (b) Avg. Achievable Throughput 10 Proposed OTS SBLA Q-Learning Traditional 0.2 0.18 0.16 0.14 0.12 3 4 5 6 7 8 No.of PU channels 9 10 (c) Avg. Frame Collision Fig. 12: Results for Exponential Traffic Model with varying number of channels for frame size 50ms. Figure 9 shows the effect of increasing the number of channels in GPD traffic model. We can observe that the proposed method is able to reduce the number of sensings required atleast by 50% and increase the throughput by atleast 5% with only a negligible (∼ 0.05%) increase in PU traffic collision. Also we can observe that, as the number of available channel increases, all the methods are able to reduce the number of sensing required and increase the throughput with reduction in PU traffic collision. However, the proposed method still remains superior. Figures 10-11 show the results in a DTMC traffic model of two different traffic intensities with varying the number of channels. In both the cases, the proposed method is able to show a clear improvement in number of sensings required and throughput with negligible increase in PU collision compared to other RL techniques. Figure 12 shows the result of varying the number of channels in Exponential PU traffic model. In this model, again, the proposed method shows a clear improvement in number of sensings and throughput varying with number of channels. One of the important observations is that the frame collision with PU of the proposed method is almost same as the other best performing RL algorithms, even though the proposed method provides a clear improvement in other evaluation metrics. From all the simulation results provided, we can conclude that the proposed method is able to improve the throughput and number of sensings required by the SU with negligible increase in PU traffic collision. Although the second stage of our algorithm (estimating the number of frame periods to skip) assumes an exponential model for PU traffic, it performs well in other models also. Maybe one can further improve the performance with assumed model knowledge. VI. C ONCLUSIONS A two stage reinforcement learning approach is proposed for channel sensing and selection in cognitive radio networks. While the available RL literature in cognitive radio focuses on only deciding which channel to sense, we also try to learn how often to sense the selected channels. Judicious sensing as suggested by our approach leads to higher throughput, lower energy consumption (due to significant reduction in sensing) and better spectrum utilization with negligible increase in primary interference as compared to methods that employ sensing in every frame. Further, the focus of this work has been to reduce sensing, while keeping the interference to PU comparable to the existing algorithms. An interesting extension could be to incorporate a constraint on the amount of interference allowed to PU in our learning algorithm, so that SU can keep PU collisions at a fixed level. While our work considers a single user scenario, recently there has been significant interest in multi-user setting where a combinatorial bandit approach is employed. In this setting, the possible combination of channel allocations are considered as the arms of the bandit. However, to the best of our knowledge, the prospect of not sensing a frame altogether, when the PU statistics are known, is not considered. Another extension would be to propose a variation of our algorithm for the combinatorial bandit setting. We believe that even greater gains can be obtained by judicious sensing in the multi-user setting. R EFERENCES [1] J. Mitola and G. Q. Maguire, “Cognitive radio: making software radios more personal,” IEEE Personal Communications, vol. 6, no. 4, pp. 13– 18, 1999. [2] F. F. Digham, M.-S. Alouini, and M. K. Simon, “On the energy detection of unknown signals over fading channels,” IEEE Transactions on communications, vol. 55, no. 1, pp. 21–24, 2007. [3] S. Atapattu, C. Tellambura, and H. Jiang, “Energy detection based cooperative spectrum sensing in cognitive radio networks,” IEEE Transactions on Wireless Communications, vol. 10, no. 4, pp. 1232–1241, 2011. [4] A. Ghasemi and E. S. Sousa, “Optimization of spectrum sensing for opportunistic spectrum access in cognitive radio networks,” in Consumer Communications and Networking Conference, 2007. CCNC 2007. 4th IEEE. IEEE, 2007, pp. 1022–1026. [5] X. Liu and N. S. Shankar, “Sensing-based opportunistic channel access,” Mobile Networks and Applications, vol. 11, no. 4, pp. 577–591, 2006. [6] W. Jouini, D. Ernst, C. Moy, and J. Palicot, “Multi-armed bandit based policies for cognitive radio’s decision making issues,” 3rd International Conference on Signals, Circuits and Systems, SCS 2009, pp. 1–6, 2009. [7] H. Jiang, L. Lai, R. Fan, and H. V. Poor, “Optimal selection of channel sensing order in cognitive radio,” IEEE Transactions on Wireless Communications, vol. 8, no. 1, pp. 297–307, 2009. [8] H. Li, “Multi-agent q-learning of channel selection in multi-user cognitive radio systems: a two by two case,” in Systems, Man and Cybernetics, 2009. SMC 2009. IEEE International Conference on. IEEE, 2009, pp. 1893–1898. [9] F. Hou, X. Chen, H. Huang, and X. Jing, “Throughput performance improvement in cognitive radio networks based on spectrum prediction,” in Communications and Information Technologies (ISCIT), 2016 16th International Symposium on. IEEE, 2016, pp. 655–658. 12 [10] X. Xing, T. Jing, W. Cheng, Y. Huo, and X. Cheng, “Spectrum prediction in cognitive radio networks,” IEEE Wireless Communications, vol. 20, no. 2, pp. 90–96, 2013. [11] Y. Xu, A. Anpalagan, Q. Wu, L. Shen, Z. Gao, and J. Wang, “DecisionTheoretic Distributed Channel Selection for Opportunistic Spectrum Access: Strategies, Challenges and Solutions,” IEEE Communications Surveys & Tutorials, vol. 15, no. 4, pp. 1689–1713, 2013. [12] A. Anandkumar, N. Michael, A. K. Tang, and A. Swami, “Distributed algorithms for learning and cognitive medium access with logarithmic regret,” IEEE Journal on Selected Areas in Communications, vol. 29, no. 4, pp. 731–745, 2011. [13] J. Zhu, Y. Song, D. Jiang, and H. Song, “Multi-armed bandit channel access scheme with cognitive radio technology in wireless sensor networks for the internet of things,” IEEE Access, vol. 4, pp. 4609– 4617, 2016. [14] Y. Gai, B. Krishnamachari, and R. Jain, “Learning multiuser channel allocations in cognitive radio networks: a combinatorial multi-armed bandit formulation,” 2010 IEEE Symposium on New Frontiers in Dynamic Spectrum, DySPAN 2010, 2010. [15] K. Liu and Q. Zhao, “Distributed learning in cognitive radio networks: Multi-armed bandit with distributed multiple players,” ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing Proceedings, pp. 3010–3013, 2010. [16] Y.-C. Liang, Y. Zeng, E. C. Peh, and A. T. Hoang, “Sensing-throughput tradeoff for cognitive radio networks,” IEEE transactions on Wireless Communications, vol. 7, no. 4, pp. 1326–1337, 2008. [17] Y. Pei, A. T. Hoang, and Y.-C. Liang, “Sensing-throughput tradeoff in cognitive radio networks: How frequently should spectrum sensing be carried out?” in Personal, Indoor and Mobile Radio Communications, 2007. PIMRC 2007. IEEE 18th International Symposium on. IEEE, 2007, pp. 1–5. [18] J. Oksanen and V. Koivunen, “An order optimal policy for exploiting idle spectrum in cognitive radio networks,” IEEE Transactions on Signal Processing, vol. 63, no. 5, pp. 1214–1227, 2015. [19] M. López-Benı́tez and F. Casadevall, “Spectrum usage models for the analysis, design and simulation of cognitive radio networks,” in Cognitive radio and its application for next generation cellular and wireless networks. Springer, 2012, pp. 27–73. [20] Q. Zhao, L. Tong, A. Swami, and Y. Chen, “Decentralized cognitive mac for opportunistic spectrum access in ad hoc networks: A pomdp framework,” IEEE Journal on selected areas in communications, vol. 25, no. 3, 2007. [21] S. Filippi, O. Cappé, and A. Garivier, “Optimally sensing a single channel without prior information: The Tiling Algorithm and regret bounds,” IEEE Journal on Selected Topics in Signal Processing, vol. 5, no. 1, pp. 68–76, 2011. [22] U. G and A. P. Kannu, “Throughput optimal multi-slot sensing procedure for a cognitive radio,” IEEE Communications Letters, vol. 17, no. 12, pp. 2292–2295, 2013. [23] L. Stabellini, “Quantifying and modeling spectrum opportunities in a real wireless environment,” in Wireless Communications and Networking Conference (WCNC), 2010 IEEE. IEEE, 2010, pp. 1–6. [24] R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction. MIT press Cambridge, 1998, vol. 1, no. 1. [25] W. R. Thompson, “On the likelihood that one unknown probability exceeds another in view of the evidence of two samples,” Biometrika, vol. 25, no. 3/4, pp. 285–294, 1933. [26] P. Auer, N. Cesa-Bianchi, and P. Fischer, “Finite-time analysis of the multiarmed bandit problem,” Machine learning, vol. 47, no. 2-3, pp. 235–256, 2002. [27] P. Auer, N. Cesa-Bianchi, Y. Freund, and R. E. Schapire, “The nonstochastic multiarmed bandit problem,” SIAM journal on computing, vol. 32, no. 1, pp. 48–77, 2002. [28] C. J. C. H. Watkins and P. Dayan, “Technical Note: Q-Learning,” Machine Learning, vol. 8, no. 3, pp. 279–292, 1992. [29] C. Claus and C. Boutilier, “The dynamics of reinforcement learning in cooperative multiagent systems,” AAAI/IAAI, vol. 1998, pp. 746–752, 1998. [30] W. R. Thompson, “On the Likelihood that One Unknown Probability Exceeds Another in View of the Evidence of Two Samples,” Biometrika, vol. 25, no. 3, pp. 285–294, 1933. [31] S. Agrawal and N. Goyal, “Analysis of thompson sampling for the multiarmed bandit problem.” in COLT, 2012, pp. 39–1. [32] Y. Gwon, S. Dastangoo, and H. Kung, “Optimizing media access strategy for competing cognitive radio networks,” in Global Communications Conference (GLOBECOM), 2013 IEEE. IEEE, 2013, pp. 1215–1220. [33] X. Zhang, L. Jiao, O.-c. Granmo, and B. J. Oommen, “Channel Selection in Cognitive Radio Networks : A Switchable Bayesian Learning Automata Approach,” in Personal Indoor and Mobile Radio Communications (PIMRC), 2013 IEEE 24th International Symposium on. IEEE, 2013, pp. 2362–2367. [34] X. Zhang, L. Jiao, O.-C. Granmo, and B. J. Oommen, “Channel selection in cognitive radio networks: A switchable bayesian learning automata approach,” in Personal Indoor and Mobile Radio Communications (PIMRC), 2013 IEEE 24th International Symposium on. IEEE, 2013, pp. 2362–2367. [35] B. C. May, N. Korda, A. Lee, and D. S. Leslie, “Optimistic bayesian sampling in contextual-bandit problems,” Journal of Machine Learning Research, vol. 13, no. Jun, pp. 2069–2106, 2012. [36] J. Yang and H. Zhao, “Enhanced Throughput of Cognitive Radio Networks by Imperfect Spectrum Prediction,” IEEE Communications Letters, vol. 19, no. 10, pp. 1738–1741, 2015. [37] B. C. May, N. Korda, A. Lee, and D. S. Leslie, “Optimistic bayesian sampling in contextual-bandit problems,” Journal of Machine Learning Research, vol. 13, pp. 2069–2106, 2012.
7cs.IT
Control Flow Analysis for SF Combinator Calculus Martin Lester Department of Computer Science, University of Oxford, Oxford, UK [email protected] Programs that transform other programs often require access to the internal structure of the program to be transformed. This is at odds with the usual extensional view of functional programming, as embodied by the lambda calculus and SK combinator calculus. The recently-developed SF combinator calculus offers an alternative, intensional model of computation that may serve as a foundation for developing principled languages in which to express intensional computation, including program transformation. Until now there have been no static analyses for reasoning about or verifying programs written in SF-calculus. We take the first step towards remedying this by developing a formulation of the popular control flow analysis 0CFA for SK-calculus and extending it to support SF-calculus. We prove its correctness and demonstrate that the analysis is invariant under the usual translation from SK-calculus into SF-calculus. Keywords: control flow analysis; SF-calculus; static analysis; intensional metaprogramming 1 Introduction In order to reason formally about the behaviour of program transformations, we must simultaneously consider the semantics of both the program being transformed and the program performing the transformation. In most languages, program code is not a first-class citizen: typically, the code and its manipulation and execution are encoded in an ad-hoc manner using the standard datatypes of the language. Consequently, whenever we want to reason formally about program transformation, we must first formalise the link between the encoding of the code and its semantics. This is unsatisfying and it would be desirable to develop better techniques for reasoning about program transformation in a more general way. In order to do this, we must develop techniques for reasoning about programs that manipulate other programs. That is, we need to develop techniques for reasoning about and verifying uses of metaprogramming. Metaprogramming can be split into extensional and intensional uses: extensional metaprogramming involves joining together pieces of program code, treating the code as a “black box”; intensional metaprogramming allows inspection and manipulation of the internal structure of code values. Unfortunately, as support for metaprogramming is relatively poor in most programming languages, its study and verification is often not a priority. In particular, the λ -calculus, which is often thought of as the theoretical foundation of functional programming languages, does not allow one to express programs that can distinguish between two extensionally equal expressions with different implementations, or indeed to manipulate the internal structure of expressions in any way. However, the SF combinatory calculus [6] does allow one to express such programs. SF-calculus is a formalism similar to the familiar SK combinatory calculus, which is itself similar to λ -calculus, but avoids the use of variables and hence the complications of substitution and renaming. SF-calculus replaces the K of SK-calculus with a factorisation combinator F that allows one to deconstruct or factorise program terms in certain normal forms. Thus it may be a suitable theoretical foundation for programming languages that support intensional metaprogramming. A. Lisitsa, A.P. Nemytykh, A. Pettorossi (Eds.): 3rd International Workshop on Verification and Program Transformation (VPT 2015) EPTCS 199, 2015, pp. 51–67, doi:10.4204/EPTCS.199.4 c M. M. Lester This work is licensed under the Creative Commons Attribution License. CFA for SF-Calculus 52 There has been some recent work on verification of programs using extensional metaprogramming, mainly in languages that only allow the composition and execution of well-formed code templates [1, 4]. In contrast, verification of intensional metaprogramming has been comparatively neglected. There do not yet appear to be any static analyses for verifying properties of SF-calculus programs. We rectify this by formulating the popular analysis 0CFA [20] for SF-calculus. We prove its correctness and argue, with reference to a new formulation of 0CFA for SK-calculus, why it is appropriate to call the analysis 0CFA. This provides the groundwork for more expressive analyses of programs that manipulate programs. We begin in Section 2 by reviewing SK-calculus and 0CFA for λ -calculus; we also present a summary of SF-calculus. In Section 3, we reformulate 0CFA for SK-calculus and prove its correctness; this guides our formulation and proof of 0CFA for SF-calculus in Section 4. We discuss the precision of our analysis in Section 5 and compare it with some related work in Section 6. We conclude by suggesting some future research directions in Section 7. 2 Preliminaries 2.1 0CFA for Lambda Calculus 0CFA [20] is a popular form of Control Flow Analysis. It is flow insensitive and context insensitive, but precise enough to be useful for many applications, including guiding compiler optimisations [17, 2], providing autocompletion hints in IDEs and noninterference analysis [14]. It is perhaps the simplest static analysis that handles higher order functions, which are a staple of functional programming. Let us consider 0CFA for the λ -calculus. 0CFA can be formulated in many ways. Following Nielson and others, we present it as a system of constraints [18]. Suppose we wish to analyse a program e. We begin by assigning a unique label l (drawn from a set Label) to every subexpression (variable, application or λ -abstraction) in e. (Reusing labels does not invalidate the analysis, and indeed this is done deliberately in proving its correctness, but it does reduce its precision.) We write el to make explicit reference to the label l on e. We often write applications infix as e1 @l e2 rather than (e1 e2 )l to make reference to their labels clearer. We follow the usual convention that application associates to the left, so f g x (or f @g@x) means ( f g) x and not f (g x). Next, we generate constraints on a function Γ by recursing over the structure of e, applying the rules shown in Figure 1. Finally, we solve the constraints to produce Γ : Label ⊎ Var → P(Abs) that indicates, for each position indicated by a subexpression label l or variable x, an over-approximation of all possible expressions that may occur in that position during evaluation. Abstractly represented values v have the form FUN(x, l), indicating any expression λ x.el that binds the variable x to a body with label l. We say that Γ |= e if Γ is a solution for the constraints generated over e. The intuition behind the rules for Γ |= e is as follows: • If e = xl : Γ(x) must over-approximate the values that can be bound to x. • If e = λ l1 x.e′ l2 : A λ -expression is represented abstractly as FUN(x, l2 ) by the variable it binds and the label on its body. Furthermore, its subexpressions must be analysed. • If e = el11 @l el22 : For any application, consider all the functions that may occur on the left and all the arguments that may occur on the right. Each argument may be bound to any of the variables in the functions. The result of the application may be the result of any of the function bodies. Again, all subexpressions of the application must be analysed. M. M. Lester 53 Labels Label ∋ l Variables Var ∋ x Labelled Expressions e ::= xl | e1 @l e2 | λ l x.e Abstract Values Abs ∋ v ::= FUN(x, l) Abstract Environment Γ : Label ⊎ Var → P(Abs) Γ |= xl Γ |= λ l1 x.el2 Γ |= el11 @l el22 ⇐⇒ ⇐⇒ ⇐⇒ Γ(x) ⊆ Γ(l) Γ |= el2 ∧ FUN(x, l2 ) ∈ Γ(l1 ) Γ |= el11 ∧ Γ |= el22 ∧ (∀FUN(x, l3 ) ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(x) ∧ Γ(l3 ) ⊆ Γ(l)) Figure 1: 0CFA for λ -calculus In order to argue about the soundness of the analysis, we must first formalise what Γ means. We can do this via a labelled semantics for λ -calculus that extends the usual rules for evaluating λ -calculus expressions to labelled expressions. We can then prove a coherence theorem [24]: if Γ |= el and (in ′ ′ the labelled semantics) el → e′ l , then Γ |= e′ l and Γ(l ′ ) ⊆ Γ(l). In fact, by induction on the length of ′ derivations of →∗ , this is also true for el →∗ e′ l . Note in particular that, as Γ(l ′ ) ⊆ Γ(l), Γ(l) gives a sound over-approximation to the subexpressions that may occur at the top level at any point during evaluation. As a concrete example, consider the λ -expression (λ 1 x.x0 )@4 (λ 3 y.y2 ), which applies the identity function to itself. We have chosen Label to be the natural numbers N. A solution for Γ is: Γ(x) = Γ(0) = Γ(3) = Γ(4) = {FUN(y, 2)} Γ(1) = {FUN(x, 0)} Γ(y) = {} In particular, this correctly tells us that the result of evaluating the expression is abstracted by FUN(y, 2); that is, the identity function with body labelled 2 that binds y. Note that the constraints on Γ may easily be solved by: initialising every Γ(l) to be empty; iteratively considering each unsatisfied constraint in turn and enlarging some Γ(l) in order to satisfy it; stopping when a fixed point is reached and all constraints are satisfied. Done naively, this takes time O(n5 ) for a program of size n [18]. With careful ordering of the consideration of constraints, this improves to O(n3 ). The best known algorithm for 0CFA uses an efficient representation of the sets in Γ to achieve O(n3 / log n) complexity [3]. Van Horn and Mairson showed that, for linear programs (in which each bound variable occurs exactly once), 0CFA gives the same result as actually evaluating the program; hence it is PTIME-complete [10]. 0CFA has been the inspiration for many other analyses. For example, k-CFA adds k levels of context to distinguish between uses of the same function from different points within a program. This improves precision, but at the cost of making the analysis EXPTIME-complete, even for k = 1 [9]. CFA2 similarly tries to use context to improve precision, but via a pushdown abstraction, which remains practical [23]. 2.2 SK Combinatory Calculus Combinatory logic is a Turing-powerful formalism for computation that is similar in style to the λ calculus, but without bound variables and the associated complications of capture-avoiding substitution and α -conversion [8]. From the perspective of term rewriting systems, a combinator is a named constant CFA for SF-Calculus 54 C with an associated rewrite rule C x → t(x), where x is a sequence of variables of fixed length and t(x) is term built from the variables in x using application; that is, t(x) is an applicative term. The SK Combinatory Calculus (or just SK-calculus) is the rewrite system involving terms built from just two atomic combinators, S and K: S f gx → Kxy → f x (g x) x A combinator can also be viewed as a function acting on terms; hence applicative terms t built from combinators are also functions. Using just S and K, it is possible to express all functions encodable in the λ -calculus. For example, S K K encodes the identity function. Figure 2 shows the rewrite rules and the evaluation of the identity with terms depicted as trees. From a λ -calculus perspective, a combinator can be viewed as a closed λ -term built by wrapping a purely applicative term in λ -abstractions: S ≡ λ f .λ g.λ x. f x (g x) K ≡ λ x.λ y.x This leads to an obvious translation lambda(t) from SK-calculus into λ -calculus: lambda(S) lambda(K) lambda(t1 t2 ) def = λ f .λ g.λ x. f x (g x) def λ x.λ y.x = def = lambda(t1 ) lambda(t2 ) There are a number of translations unlambda(e) from λ -calculus into SK-calculus, including the following [8]: unlambda(x) unlambda(e1 e2 ) unlambda(λ x.e) unlambdax (x) unlambdax (e) unlambdax (e x) unlambdax (e1 e2 ) unlambdax (λ y.e) = = = = = = = = x unlambda(e1 ) unlambda(e2 ) unlambdax (e) SKK K unlambda(e) if x does not occur free in e unlambda(e) if x does not occur free in e S unlambdax (e1 ) unlambdax (e2 ) if neither of the above applies unlambdax (unlambda(λ y.e)) This translation is left-inverse to the λ -translation; that is unlambda(lambda(t)) = t. However, it is not right-inverse. The rewrite rules of combinatory calculus are very simple to implement, as: there is no need to track bound variables; the number of rewrite rules is small and fixed; and all transformations are local. Here “local” means that, viewing a term as a graph, each transformation involves only a small, bounded number of edge additions and deletions, all affecting nodes that are either within a bounded distance of the combinator or are newly created (with the number of new nodes also being bounded). Because of this simplicity, combinators have frequently been considered as a basis for hardware or virtual machines for executing functional programs [22, 5]. Combinators can be thought of as an assembly language for functional programs (although often an expanded set of combinators [21] is used to avoid a combinatorial explosion in the size of the compiled program). M. M. Lester 55 → x @ @ → @ y @ K x @ @ x g @ @ f x g x S f → @ @ x @ @ K @ → x @ K x K x S K Figure 2: Terms of SK-calculus viewed as trees. Above: the reduction rules for S and K. Below: evaluation of the identity function S K K. → x @ @ @ @ y y @ y @ F F F S → @ x @ x → x @ @ @ v y u x @ F u v → @ x @ @ S @ → x @ @ @ @ F F F F @ x @ x F F F F Figure 3: Terms of SF-calculus treated as trees. Above: the reduction rules for F on atoms and compound terms. Below: evaluation of the identity function S (F F) (F F). CFA for SF-Calculus 56 2.3 SF Combinatory Calculus The SF Combinatory Calculus is a recently-developed system of combinators for expressing computation that manipulates the internal structure of programs [6]. It consists of just two combinators: S and F. S is the same as in SK-calculus. F is a factorisation combinator that allows non-atomic expressions to be split up into their component parts; it has two reduction rules (also depicted in Figure 3): F f xy → x if f = S or f = F F (u v) x y → y u v if u v is a factorable form A factorable form is a term of the form S, S u, S u v, F, F u or F u v, for any terms u and v; that is, a term cannot be factorised if it could be reduced at the outermost level. This ensures that reduction is globally confluent, regardless of the reduction order chosen. It also means that the usual notion of (weak) head reduction is not sufficient for evaluating programs in this system: if a term is of the form F f x y, then f must be head reduced (if possible) before applying the reduction rule for F. F stretches our usual notion of what constitutes a combinator slightly, as it has two rewrite rules, with the conclusion of the second not being built from application of its arguments, as it deconstructs the application u v. Nonetheless, it is still fair to call SF-calculus a combinatory calculus, as terms in the calculus are still built solely from application of its atoms S and F. Confluence and the theory of weak equality. Confluence means that, for any terms u, v and v′ , if u →∗ v and u →∗ v′ , it follows that there is a term w with v →∗ w and v′ →∗ w. This property can be proved for SF-calculus using the standard technique of parallel reductions. The weak equality relation =w is the symmetric, reflexive, transitive closure of the reduction relation →. From confluence and the fact that the terms S and F are irreducible, we can conclude that there are terms u and v such that u 6=w v. That is, the equational theory of =w for SF-calculus is consistent. The obvious way of adding a factorisation operator to λ -calculus has no restriction to factorable forms equivalent to that for F. Consequently, adding this operator breaks confluence, so the resulting theory of weak equality is not consistent. Extensional equality. Two terms are extensionally equal if they compute the same function, perhaps in different ways. Within the SF-calculus, it is possible to distinguish between two such terms. Consequently, SF-calculus cannot be translated into λ -calculus. For example, consider t1 = F F S and t2 = F S S. For any term u, we have t1 u = F F S u →∗ S and t2 u = F S S u →∗ S, so t1 and t2 are extensionally equal (and behave like the term K S of SK-calculus). In SK-calculus or λ -calculus, if two terms t1 and t2 are extensionally equal, then we can replace one with the other without changing the result of a computation. However, this is not the case in SF-calculus, as we can use F to construct a term v (schematically v = λ t.F t (λ u.λ v.F u (λ x.λ y.y))) such that v t1 →∗ F and v t2 →∗ S. In SK-calculus, it is possible to extend the theory of weak equality =w with a rule corresponding to η -reduction, yielding a theory of extensional equality =ext such that t1 =ext t2 if and only if t1 and t2 are extensionally equal [8]. Clearly, any reasonable attempt to extend the theory of weak equality for SF-calculus to an extensional theory of equality will be inconsistent, as it will equate S with F. This is in direct and deliberate contrast to SK-calculus. Expressivity of SF-calculus. There is a translation from SK-calculus into SF-calculus: K can be expressed as F F. Hence all functions expressible in SK-calculus and thus λ -calculus are expressible in SF-calculus. M. M. Lester 57 SF-calculus is structure complete, in the sense that it can pattern match over normal forms of terms (those having no redexes) and distinguish between any two different terms in normal form. In particular, for any two such terms t1 and t2 , there is a term e such that we have e t1 →∗ S and e t2 →∗ F. Adding System F types to SF-calculus (and giving names to some other combinators), the resulting calculus can encode and type an interpreter for its own language [12]. Thus it presents a promising theoretical foundation for reasoning about programs that transform other programs, for example by means of partial evaluation. As a more concrete example of the sorts of programs we might write in SF-calculus, suppose we have an expression f x y and we want to flip its arguments to give f y x [7]. For example, perhaps we are writing an optimising compiler, f is a commutative function that is not strict in both arguments and we expect f y x to execute faster than f x y. Schematically, we could write a program performing this transformation as: λ a.F a (λ b.λ y.F b (λ f .λ x. f y x)) where is any dummy value. Expressed purely in terms of S and F, this can be written as: (SF(FFS))(FF(S(S(F F(S(FFS)(FF)))(SF(FFS)))(F F(S(FF(S(S(FF)(FF))))(F F))))) Obviously, because of its lack of readability, SF-calculus (like SK-calculus and λ -calculus) is not suitable for use directly by human programmers. 3 0CFA for SK-Calculus Before we can formulate 0CFA for SF-calculus, we must first consider what it means for SK-calculus. A central idea in 0CFA for λ -calculus is that the analysis computes an over-approximation of the expressions that may be bound to a variable. It seems a little perverse to apply this to SK-calculus, where there are deliberately no variables. As SK-calculus can be translated into λ -calculus, it is easy enough to translate a term t of SKcalculus into an equivalent λ -expression lambda(t) = e and analyse that. We could define our analysis by Γ |=SK t ⇐⇒ Γ |=λ lambda(t). Furthermore, any SK-calculus reduction t → t ′ corresponds to a sequence of 2 (for K) or 3 (for S) λ -calculus β -reductions. So for lambda(t ′ ) = e′ we have e →∗ e′ . Then, as 0CFA is coherent with evaluation following an arbitrary β -reduction strategy, we would have Γ |=λ e′ and hence Γ |=SK t ′ , showing the coherence of our combinatory 0CFA with evaluation. But what then is the meaning of the resulting analysis? We can answer this by reversing the translation (for example, using unlambda) to produce a labelled semantics for SK-calculus and 0CFA rules that apply directly to SK combinatory terms. 3.1 Labelled Semantics First we will look at the result of β -reducing expressions lambda(S f g x) and lambda(K x y) using the labelled semantics of λ -calculus. We begin by extending lambda to produce labelled expressions, as shown in Figure 4. Here we have extended Label to give an easy, syntactic way of associating a fixed set of “sublabels” with each ordinary label. The choice of names for the sublabels is somewhat arbitrary, although we have chosen them to match the structure of the expressions. It is important at this stage that the label on each CFA for SF-Calculus 58 λ l.S.LF fl λ l.K.LX xl λ l.S.LG gl λ l.K.LY yl λ l.S.LX xl xll.K.X @l.S.3 @l.S.L @l.S.R xll.S.X2 fll.S.F xll.S.X1 gl.S.G l lambda(Sl ) def = λ l.S.LF fl .λ l.S.LG gl .λ l.S.LX xl . fll.S.F @l.S.L xll.S.X1 @l.S.3 (gl.S.G @l.S.R xll.S.X2 ) l lambda(K l ) def = λ l.K.LX xl .λ l.K.LY yl .xll.K.X lambda(t1 @l t2 ) def lambda(t1 )@l lambda(t2 ) = Figure 4: The labelled λ -calculus translation lambda(t) (below), with lambda(Sl ) (upper-left) and lambda(K l ) (upper-right) illustrated as trees. expression remains distinct, so that we do not lose precision in formulating our analysis. We can now use lambda to produce labelled reduction rules for SK-calculus: K l2 @l3 xl1 @l4 yl0 Sl3 @l4 f l2 @l5 gl1 @l6 xl0 → xl1 → ( f l2 @l3 .S.L xl0 )@l3 .S.3 (gl1 @l3 .S.R xl0 ) Note that in the conclusion of the reduction of S, there are new labels that were not present in the original program. These are the sublabels from the applications introduced by lambda. In the λ -calculus formulation, these are present inside the λ -expression before reduction; the reduction exposes them. A consequence of this is that, in analysing a term of SK-calculus, we will need to consider labels that do not occur in the term. If the set of labels were infinite, this might pose a problem for an analysis. However, this is not the case, as the names of the labels are syntactically derived from the label on S; only a finite, statically derivable set of labels may arise during the execution of a term. 3.2 Analysis Rules We are now able to translate the rules of 0CFA for λ -calculus into new rules for SK-calculus, as shown in Figure 5. Note that a label is now either a base label (as before, taken from N) or a base label suffixed with a sublabel name (taken from a fixed, finite set). In performing the translation, we have eliminated some unnecessary or trivial constraints, such as those for tracking the 2nd argument to K, which is never used. We have restricted the grammar of abstract values to just instances of S and K with different numbers of arguments applied. We have also made a small change from 0CFA for λ -calculus. The constraints that express the result of reducing an S are only activated if it is possible for that S to be reduced. This may improve precision slightly, but would be unsound in the λ -calculus setting, where we can reduce M. M. Lester 59 Base Labels N ∋ n Sublabel Names s Labels Label ∋ l Labelled Terms t Abstract Values Abs ∋ v Abstract Environment Γ Abstract Activation ϕ Γ, ϕ |= Sn Γ, ϕ |= K n Γ, ϕ |= t1l1 @l3 t2l2 ⇐⇒ ⇐⇒ ⇐⇒ Γ, ϕ |= hxil ⇐⇒ ::= ::= ::= ::= : : S.0 | S.1 | S.2 | S.3 | S.L | S.R | K.0 n | n.s Sn | K n | t1 @l t2 | hxil S0n | S1n | S2n | K0n | K1n Label → P(Abs) Label → Bool S0n ∈ Γ(n) ∧ (ϕ (n) ⇒ Γ, ϕ |= tSn ) K0n ∈ Γ(n) Γ, ϕ |= t1 ∧ Γ, ϕ |= t2 ∧ ∀S0n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.S.0) ∧ S1n ∈ Γ(l3 ) ∧ ∀S1n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.S.1) ∧ S2n ∈ Γ(l3 ) ∧ ∀S2n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.S.2) ∧ Γ(n.S.3) ⊆ Γ(l3 ) ∧ ϕ (n) ∧ ∀K0n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.K.0) ∧ K1n ∈ Γ(l3 ) ∧ ∀K1n ∈ Γ(l1 ).Γ(n.K.0) ⊆ Γ(l3 ) true def tSn = (h f in.S.0 @n.S.L hxin.S.2 )@n.S.3 (hgin.S.1 @n.S.R hxin.S.2 ) Figure 5: 0CFA for SK-calculus the expression corresponding to S even if it only has 1 or 2 arguments. It will be more important for SFcalculus. In order to track whether constraints for an instance have been activated, we introduce a new component ϕ : Label → Bool to the solution of the constraints, with ϕ (n) being true when the constraints for Sn are active. The intuitive meaning of S0n ∈ Γ(l) is that Sn may occur at the point labelled l, hence the rule for Γ, ϕ |= Sn . The meaning of S1n ∈ Γ(l) is that a term built from applying 1 argument to Sn may occur at l, or that Sn may occur as the 1st left child of the term tree node labelled l. The meaning of S2n is analogous (but for 2 arguments or the 2nd left child), as is that of K0n and K1n (but for K, not S). The abstract values in Γ(n.S.0) are meant to over-approximate the values that may occur as the 1st argument to Sn ; similarly for Γ(n.S.1) and the 2nd argument, and analogously for n.S.2 and n.K.0. This leads to the explanation of the conjunction of conditions for Γ, ϕ |= t1l1 @l3 t2l2 . For example, the condition involving ∀S0n ensures that, if Sn may occur in function position, then: the abstraction Γ(n.S.0) of the 1st argument of Sn over-approximates the arguments that may be supplied by t2 ; and the result of the application needs only 2 more arguments for a reduction to occur. The condition involving ∀S1n and the first part of the condition with ∀S2n are similar. The condition on ∀K0n is analogous to that for ∀S0n . The condition with ∀K1n simply says that the result of reducing K may be anything that occurs as its 1st argument. The second part of the condition on ∀S2n is more complicated. In the event that Sn may receive 3 arguments and hence be reduced, it introduces constraints for the conclusion of the reduction, which are those generated by analysis of the constant applicative term tSn . It also says that the result of the reduction may be anything that occurs at the root of that term, which has label n.S.3. The introduction of the constraints for tSn is forced by asserting ϕ (n), which produces the corresponding constraints in the rule for Γ, ϕ |= Sn . The use of ϕ avoids the introduction of a recursive loop CFA for SF-Calculus 60 Γ(0) Γ(2.S.1) Γ(5.K.0) Γ(7.S.0) Γ(7.S.L) Γ(10) = = = = = = {K00 } {K00 } {S22 } {K06 } {K16 } {S22 } Γ(1) Γ(3) Γ(6) Γ(7.S.1) Γ(7.S.R) ϕ (7) = = = = = = {K01 } {S12 } {K06 } {K05 } {K15 } true Γ(2) Γ(4) Γ(6.K.0) Γ(7.S.2) Γ(8) {S02 } {S22 } {S22 } {S22 } {S17 } = = = = = Γ(2.S.0) Γ(5) Γ(7) Γ(7.S.3) Γ(9) = = = = = {K01 } {K05 } {S07 } {S22 } {S27 } Γ, ϕ |= (S7 @8 K 6 @9 K 5 )@10 (S2 @3 K 1 @4 K 0 ) Figure 6: Solution of the analysis for application of identity to itself in SK-calculus. in the constraint rules; an alternative method would be to use a coinductive definition of |=. Within tSn we use dummy terms of the form hxil to give the leaf node of the term tree a label; here f , g and x have no meaning (other than to make reading the rules easier) and play no role in the analysis. This analysis may seem like a step backwards, as we have replaced a small set of general rules for λ -calculus with a larger, more specific set of rules for SK-calculus. However, there are a number of benefits. Firstly, the rules for S can be used directly in 0CFA for SF-calculus. Secondly, they reveal the meaning of 0CFA in SK-calculus: the abstract values at a labelled point tell us which combinators may occur at that point and locally at its left branches. This insight will be key in both producing an accurate analysis for F and for justifying why it is reasonable to call that analysis 0CFA. Finally, because SK-calculus does not have to deal with arbitrary substitution or the intricacies of name-binding, the proof of correctness for this system is considerably simpler than that for λ -calculus. Recall the example of 0CFA for λ -calculus involving applying the identity function to itself. The corresponding SK-calculus term and a solution for its analysis are shown in Figure 6. Note that Γ(10) = Γ(4) = {S22 }, indicating that the result of evaluation has S2 as its second left child; that is, it is the second identity function (S2 @3 K 1 @4 K 0 ). 3.3 Correctness We now prove the correctness of this analysis for SK-calculus. First we make some observations about the satisfaction of constraints: ′ ′ Lemma 1 (SK Substitution). If Γ, ϕ |= t1l1 @l3 t2l2 , as well as Γ, ϕ |= t1′ l1 and Γ, ϕ |= t2′ l2 , with Γ(l1′ ) ⊆ Γ(l1 ), ′ ′ ′ Γ(l2′ ) ⊆ Γ(l2 ) and Γ(l3′ ) ⊇ Γ(l3 ) then Γ, ϕ |= t1′ l1 @l3 t2′ l2 . Proof. Trivial by inspection of the constraints generated by @. ′ Lemma 2 (SK Reduction Coherence). For any top-level reduction t l → t ′ l , if Γ, ϕ |= t l then 1) Γ, ϕ |= t ′ l and 2) Γ(l ′ ) ⊆ Γ(l). ′ Proof. Case split on the two kinds of top-level reduction (S and K). ′ Case S: We have t l = Sl3 @l4 f l2 @l5 gl1 @l6 xl0 and t ′l = ( f l2 @l3 .S.L xl0 )@l3 .S.3 (gl1 @l3 .S.R xl0 ). Expanding the constraints for Γ, ϕ |= t l , we have: S0l3 ∈ Γ(l3 ); S1l3 ∈ Γ(l4 ); S2l3 ∈ Γ(l5 ); hence Γ(l3 .S.3) ⊆ Γ(l6 ) (proving Condition 2) and ϕ (l3 ) is true. As Γ, ϕ |= S0l3 and ϕ (l3 ), we have Γ, ϕ |= tSl3 . But tSl3 can be turned into t ′ by substituting f , g and x at its leaves. So to prove Condition 1, we just need to show that we can use the Substitution Lemma. Now as Γ, ϕ |= t l , we get: Γ, ϕ |= f l2 ; Γ, ϕ |= gl1 ; and Γ, ϕ |= xl0 . M. M. Lester 61 Furthermore: from S0l3 ∈ Γ(l3 ) we get Γ(l2 ) ⊆ Γ(l3 .S.0); from S1l3 ∈ Γ(l4 ) we get Γ(l1 ) ⊆ Γ(l3 .S.1); and from S2l3 ∈ Γ(l3 ) we get Γ(l0 ) ⊆ Γ(l3 .S.2). So the Substitution Lemma can be used to prove Condition 1. ′ Case K: We have t l = K l2 @l3 xl1 @l4 yl0 and t l = xl1 . From Γ, ϕ |= t l we have Γ, ϕ |= xl1 , showing Condition 1. Expanding the constraints for Γ, ϕ |= t l further, we get: K0l2 ∈ Γ(l2 ); hence Γ(l1 ) ⊆ Γ(l2 .K.0) and K1l2 ∈ Γ(l3 ); thus Γ(l2 .K.0) ⊆ Γ(l4 ). Combining these gives Γ(l1 ) ⊆ Γ(l4 ), proving Condition 2. ′ ′ Theorem 1 (SK Evaluation Coherence). For any reduction in context C[t l1 ]l2 → C[t ′l1 ]l2 , if Γ, ϕ |= C[t l1 ]l2 ′ ′ then 1) Γ, ϕ |= C[t ′l1 ]l2 and 2) Γ(l2′ ) ⊆ Γ(l2 ). Proof. For the empty context, this follows immediately from the Reduction Coherence Lemma. For a non-empty context C, Condition 2 is trivially true as l2′ = l2 . For Condition 1, the reduction occurs at either the left child or right child of an application node in the term tree (as all other nodes are leaves). Any constraints generated by the context are unchanged and hence remain satisfied. For the hole in the ′ context, from Γ, ϕ |= C[t l1 ]l2 we have Γ, ϕ |= t l1 , so by Reduction Coherence we get Γ, ϕ |= t ′ l1 with ′ Γ(l1′ ) ⊆ Γ(l1 ). Hence any constraints within t ′ l1 are satisfied. That just leaves the constraints generated by the interaction between the application at the hole of the context and t ′ . We can apply the Substitution Lemma to the application node to show that they are satisfied, which gives Condition 1 as required. ′ Corollary 1 (SK Soundness). If Γ, ϕ |= t l and t →∗ t ′ then Γ, ϕ |= t ′ l . Proof. By induction over the length of the derivation of →∗ and application of the Evaluation Coherence Theorem. 4 0CFA for SF-Calculus We now turn our attention to formulation of 0CFA for SF-calculus. As F is not encodable in λ -calculus, we cannot argue for the correctness of our analysis by appeal to the translation lambda. Instead, we must follow the style of our formulation for SK-calculus. 4.1 Labelled Semantics Following the labelled reduction for S, we introduce the following labelled reductions for F: F l3 @l4 f l2 @l5 xl1 @l6 yl0 F l3 @l4 (ul7 @l2 vl8 )@l5 xl1 @l6 yl0 → xl1 → (yl0 @l3 .F.M ul7 )@l3 .F.3 vl8 if f = S or f = K if u v is a factorable form 4.2 Analysis Rules There are two main problems to consider in analysing F: how to determine whether the 1st argument is a factorable form and, when that argument is a factorable form, how to deconstruct its abstract representation. Concerning the first problem, if we think back to our analysis for SK-calculus, a term t l might evaluate to an atom Sn or F n if (for some n) S0n ∈ Γ(l) or K0n ∈ Γ(l). Its normal form might be a nonatomic term if Γ(l) contains any other abstract values. We can use the same idea for SF-calculus, except with F0n in place of K0n . CFA for SF-Calculus 62 N ∋ Base Labels Sublabel Names n s ::= S.0 | S.1 | S.2 | S.3 | S.L | S.R | F.0 | F.1 | F.2 | F.3 | F.L | F.R | F.M Labels Label ∋ l ::= n | n.s Labelled Terms t ::= Sn | F n | t1 @l t2 | hxil Abstract Values Abs ∋ v ::= S0n | S1n | S2n | F0n | F1n | F2n | @(l1 ,l2 ) Abstract Environment Γ : Label → P(Abs) Abstract Activation ϕ : Label → Bool Γ, ϕ |= Sn Γ, ϕ |= F n ⇐⇒ ⇐⇒ Γ, ϕ |= t1l1 @l3 t2l2 ⇐⇒ Γ, ϕ |= hxil ⇐⇒ tSn tF n S0n ∈ Γ(n) ∧ (ϕ (n) ⇒ Γ, ϕ |= tSn ) F0n ∈ Γ(n) ∧ ϕ (n) ⇒ (∃n0 .S0n0 ∈ Γ(n.F.0) ∨ F0n0 ∈ Γ(n.F.0)) ⇒ Γ(n.F.1) ⊆ Γ(n.F.3) ∧ ϕ (n) ⇒ (∃n0 .S1n0 ∈ Γ(n.F.0) ∨ S2n0 ∈ Γ(n.F.0) ∨ F1n0 ∈ Γ(n.F.0) ∨ F2n0 ∈ Γ(n.F.0)) ⇒ Γ, ϕ |= tF n ∧ ∀@l1 ,l2 ∈ Γ(n.F.0).Γ(l1 ) ⊆ Γ(n.F.L) ∧ Γ(l2 ) ⊆ Γ(n.F.R) Γ, ϕ |= t1 ∧ Γ, ϕ |= t2 ∧ ∃@l4 ,l5 ∈ Γ(l3 ).Γ(l1 ) ⊆ Γ(l4 ) ∧ Γ(l2 ) ⊆ Γ(l5 ) ∧ ∀S0n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.S.0) ∧ S1n ∈ Γ(l3 ) ∧ ∀S1n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.S.1) ∧ S2n ∈ Γ(l3 ) ∧ ∀S2n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.S.2) ∧ Γ(n.S.3) ⊆ Γ(l3 ) ∧ ϕ (n) ∧ ∀F0n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.F.0) ∧ F1n ∈ Γ(l3 ) ∧ ∀F1n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.F.1) ∧ F2n ∈ Γ(l3 ) ∧ ∀F2n ∈ Γ(l1 ).Γ(l2 ) ⊆ Γ(n.F.2) ∧ Γ(n.F.3) ⊆ Γ(l3 ) ∧ ϕ (n) true def = (h f in.S.0 @n.S.L hxin.S.2 )@n.S.3 (hgin.S.1 @n.S.R hxin.S.2 ) def (hyin.F.2 @n.F.M huin.F.L )@n.F.3 hvin.F.R = Figure 7: 0CFA for SF-calculus As for the second problem, in order to deconstruct abstract values, we introduce a new type of abstract value @l1 ,l2 . Intuitively, the abstract value indicates that any concrete value was produced by applying a term approximated by Γ(l1 ) to a term approximated by Γ(l2 ). The resulting analysis is shown in Figure 7. We have reused the analysis rules for S. The rules for F are mostly very similar. This is to be expected, as they both take 3 arguments. In the rule for Γ, ϕ |= F n , there are two separate sets of constraints that can be activated by ϕ (n), corresponding to the two reduction rules. Both involve a further condition that corresponds to testing whether the 1st argument may be atomic or a factorable form. The conclusion to the first, corresponding to the atomic case, is similar to the last rule for K in Γ, ϕ |= t1l1 @l3 t2l2 of the analysis for SK-calculus. The conclusion to the second, which handles factorisation, introduces the constraints generated by the applicative term tF n in a similar style to the case for S and tSn . However, it also adds new constraints to tF n corresponding to the factorisation of the 1st argument. There is also a new constraint for Γ, ϕ |= t1l1 @l3 t2l2 that introduces abstract values of the form @l1 ,l2 . When analysing a term, this is easily satisfied by setting @l1 ,l2 ∈ Γ(l3 ). The slightly more complicated constraint here is necessary to ensure coherence of the analysis with evaluation. A term t l can be analysed by finding a Γ and ϕ such that Γ, ϕ |= t l . This is done by solving the M. M. Lester Γ(0) Γ(1.F.0) Γ(3) Γ(4.F.0) Γ(6) Γ(6.S.1) Γ(8) Γ(10) Γ(10.F.1) Γ(12) Γ(13.F.0) Γ(13.F.3) Γ(14) Γ(15.S.0) Γ(15.S.2) Γ(15.S.L) Γ(15.S.R) Γ(18) ϕ (13) 63 = = = = = = = = = = = = = = = = = = = {F00 } Γ(1) {F00 } Γ(2) 3 {F0 } Γ(4) {F03 } Γ(5) 6 {S0 } Γ(6.S.0) {F11 , @(1,0) } Γ(7) 6 (7,2) {S2 , @ } Γ(9) {F010 } Γ(10.F.0) {S26 , @(7,2) } Γ(11) {F012 } Γ(13) {F012 } Γ(13.F.1) 6 (7,2) {S2 , @ } Γ(13.F.2) 13 (13,12) {F1 , @ } Γ(15) {F113 , @(13,12) } Γ(15.S.1) {S26 , @(7,2) } Γ(15.S.3) 13 (15.S.0,15.S.2) {F2 , @ } Γ(16) 10 (15.S.1,15.S.2) {F2 , @ } Γ(17) {S26 , @(15.S.L,15.S.R) , @(17,8) , @(7,2) } true ϕ (15) = = = = = = = = = = = = = = = = = {F01 } {F11 , @(1,0) } {F04 } {F14 , @(4,3) } {F14 , @(4,3) } {S16 , @(6,5) } {F09 } {F09 } {F110 , @(10,9) } {F013 } {S26 , @(7,2) } {F210 , @(15.S.1,15.S.2) } {S015 } {F110 , @(10,9) } {S26 , @(15.S.L,15.S.R) , @(7,2) } {S115 , @(15,14) } {S215 , @(16,11) } = true Γ, ϕ |= (S15 @16 (F 13 @14 F 12 )@17 (F 10 @11 F 9 ))@18 (S6 @7 (F 4 @5 F 3 )@8 (F 1 @2 F 0 )) Figure 8: Solution of the analysis for application of identity to itself in SF-calculus. constraints using a fixed point process, much as with 0CFA for λ -calculus. We need only consider O(n) abstract values (corresponding to nodes in the term tree of t), so we retain the polynomial time complexity of 0CFA. Consider once again the example of applying the identity function to itself. The corresponding SFcalculus term and its analysis are shown in Figure 8; note that S26 ∈ Γ(18), indicating the result correctly. 4.3 Correctness Correctness of the analysis follows by the same sequence of results as for SK-calculus. ′ ′ Lemma 3 (SF Substitution). If Γ, ϕ |= t1l1 @l3 t2l2 , as well as Γ, ϕ |= t1′ l1 and Γ, ϕ |= t2′ l2 , with Γ(l1′ ) ⊆ Γ(l1 ), ′ ′ ′ Γ(l2′ ) ⊆ Γ(l2 ) and Γ(l3′ ) ⊇ Γ(l3 ) then Γ, ϕ |= t1′ l1 @l3 t2′ l2 . Proof. Again, trivial by inspection of the constraints generated by @. It is at this point that the correct formulation of the constraint ∃@l4 ,l5 ∈ Γ(l3 ).Γ(l1 ) ⊆ Γ(l4 ) ∧ Γ(l2 ) ⊆ Γ(l5 ) is important; the lemma does not hold if we use the simpler constraint @l1 ,l2 ∈ Γ(l3 ). ′ Lemma 4 (SF Reduction Coherence). For any top-level reduction t l → t ′ l , if Γ, ϕ |= t l then 1) Γ, ϕ |= t ′ l and 2) Γ(l ′ ) ⊆ Γ(l). ′ Proof. Case split on the two kinds of top-level reduction (S and F). Case S: Largely as for SK-calculus. The only new point is that we must check the constraints on the abstract @ values generated by @l3 .S.L and @l3 .S.R still hold. CFA for SF-Calculus 64 Case F: We have t l = F l3 @l4 f l2 @l5 xl1 @l6 yl0 . We begin as for S by expanding the constraints for Γ, ϕ |= t l . We get F0l3 ∈ Γ(l3 ), F1l3 ∈ Γ(l4 ) and F2l3 ∈ Γ(l5 ); also Γ(l2 ) ⊆ Γ(l3 .F.0), Γ(l1 ) ⊆ Γ(l3 .F.1) and Γ(l0 ) ⊆ Γ(l3 .F.2); as well as Γ(l3 .F.3) ⊆ Γ(l6 ) and ϕ (l3 ). Now there are two subcases depending on whether f is factorable. ′ Subcase f is not factorable: We have t ′l = xl1 . From Γ, ϕ |= t l we get Γ, ϕ |= xl1 , proving Condition 1. As f l2 is not factorable, either f = F l2 and F0l2 ∈ Γ(l2 ) ⊆ Γ(l3 .F.0) or f = Sl2 and S0l2 ∈ Γ(l2 ) ⊆ Γ(l3 .F.0). In either case, noting we already have Γ, ϕ |= F l3 and ϕ (l3 ), we get Γ(l3 .F.1) ⊆ Γ(l3 .F.3). Combining this with Γ(l1 ) ⊆ Γ(l3 .F.1) and Γ(l3 .F.3) ⊆ Γ(l6 ) gives Γ(l1 ) ⊆ Γ(l6 ), proving Condition 2. ′ Subcase f is factorable: We have f l2 = ul7 @l2 vl8 and t ′l = (yl0 @l3 .F.M ul7 )@l3 .F.3 vl8 . Condition 2 now follows immediately from Γ(l3 .F.3) ⊆ Γ(l6 ). As f is factorable, either ul7 or its left child wl9 (if it has one) is S or F. Hence one of F1l7 , S1l7 , F2l9 and F2l9 must be in Γ(l3 .F.0). Noting Γ, ϕ |= F l3 and ϕ (l3 ), we now have Γ, ϕ |= tF n , as well as a constraint relating abstract @ values in Γ(l3 .F.0) with Γ(l3 .F.L) and ′ Γ(l3 .F.R). Similarly to the case for S, in order to prove Condition 1, we note that we can obtain t ′l by substituting yl0 , ul7 and vl8 into tF n , so we need to show that the Substitution Lemma is applicable. For yl0 this is easy, as we already have Γ(l0 ) ⊆ Γ(l3 .F.2). For ul7 and vl8 , there must exist some @lA ,lB ∈ Γ(l2 ) with Γ(l7 ) ⊆ Γ(lA ) and Γ(l8 ) ⊆ Γ(lB ). But Γ(l2 ) ⊆ Γ(l3 .F.0), so @lA ,lB ∈ Γ(l3 .F.0). Then, using the above constraint on abstract @ values, Γ(lA ) ⊆ Γ(l3 .F.L) and Γ(lB ) ⊆ Γ(l3 .F.R). Hence Γ(l7 ) ⊆ Γ(l3 .F.L) and Γ(l8 ) ⊆ Γ(l3 .F.R), so we can apply the Substitution Lemma to prove Condition 1. ′ ′ Theorem 2 (SF Evaluation Coherence). For any reduction in context C[t l1 ]l2 → C[t ′l1 ]l2 , if Γ, ϕ |= C[t l1 ]l2 ′ ′ then 1) Γ, ϕ |= C[t ′l1 ]l2 and 2) Γ(l2′ ) ⊆ Γ(l2 ). Proof. The proof is as for SK-calculus. The only point of note is that the constraints between the application at the hole of the context and t ′ now include a constraint on an abstract @ value. However, this is still handled by using the Substitution Lemma. ′ Corollary 2 (SF Soundness). If Γ, ϕ |= t l and t →∗ t ′ then Γ, ϕ |= t ′ l . Proof. As for SK-calculus. 5 Evaluation It is currently difficult to evaluate meaningfully the usefulness of this analysis. If one wishes to evaluate an analysis for untyped λ -calculus, then by using the usual Church encodings for numbers, lists and other datatypes, one can easily test it against examples from any textbook on functional programming. Similarly, using the translation unlambda, it is not much harder to evaluate an analysis for SK-calculus in this way. There is a straightforward translation from SK-calculus to SF-calculus: simply replace K with FF. It is easy for our analysis to determine that the only possible first argument to the first F is just F, and hence that it will never be factorable. This activates constraints that are very similar to those for K in the analysis for SK-calculus. Thus it makes no difference to the precision of 0CFA whether it is done on a term of SK-calculus or the same term translated into SF-calculus. While this is encouraging in that it suggests it is reasonable to refer to our analysis as 0CFA, it does not really tell us anything interesting about the precision of the analysis. The translated program does not use the power of factorisation in a meaningful way, or indeed (considering that only one reduction of F is used) at all. There is no interesting suite of programs written in SF-calculus against which to test the analysis; nor is there any existing idiomatic translation from any higher level language to SF-calculus. M. M. Lester 65 If we consider only programs that do not deconstruct code (such as straightforward translations of SK-calculus programs), our analysis has the same strengths and weaknesses as other forms of 0CFA: it can analyse some higher order control flow within a program, but loses precision when the same function is used in two different contexts. If we consider programs that do inspect and manipulate the internal structure of code, there are three further places where we can lose precision. Firstly, we cannot always tell whether an argument to F will be factorable or not and in this case, we over-approximate its behaviour to cover both cases. Our technique essentially works by tracking how many arguments a combinator has been given. This is unlikely to work well when a term is simultaneously used recursively and partially applied. Secondly, when we abstractly factorise a term, we lack any contextual information, so if two applications flow into the same factorisation, we will conflate their factors. This is similar to the imprecision introduced by lack of context when using the same function in two different places in ordinary 0CFA. Finally, while we make a reasonable attempt to track reduction of a term for the purpose of determining whether its normal form is an atom, we have no way of discarding non-normal forms when we factorise abstractly, so we may consider the factorisation of terms that are not factorable forms. 6 Related Work 0CFA and other forms of control flow analysis have been widely studied; see the work of Midtgaard [17] for a detailed survey. To our knowledge, this is the first static analysis for SF-calculus. There has been some work on analysing other styles of metaprogramming. For example, Choi and others [4] consider how to analyse a form of extensional metaprogramming called staged metaprogramming, which captures the composition of code templates. They suggest using an unstaging translation that turns the metaprogramming constructs into function abstraction and record lookup, then using other existing analyses. Our own work considers how to formulate 0CFA in a dynamically typed language with staged metaprogramming and variable capture [14], with a view to analysing JavaScript’s eval construct [15]. In a statically typed setting, Berger and Tratt develop a Hoare-style logic [1] for a language with staged metaprogramming. Intensional metaprogramming has often been ignored because of its semantic difficulties, or because of the dominance of the idea that extensionally equal programs ought to be indistinguishable [11]. ReFLect [7], a functional programming language for hardware design and theorem proving, allows deconstruction of code values, but this causes difficulties for its type system, even in a combinatory fragment of the language [16]. The idea that program code can be deconstructed and that its structure can influence the control flow of a program is conceptually similar to the functional programming idiom of defining functions by pattern-matching over algebraic datatypes. There has been some work on analysing functional programs from this perspective. For example, Jones and Andersen present an analysis that uses tree grammars to over-approximate the structure of data values that may be produced by a program [13]. Ong and Ramsay suggest a formalism called Pattern Matching Recursion Schemes that captures the idea in a typed setting and develop a powerful analysis for it [19]. 7 Future Work and Conclusions We have presented the first static analysis for SF-calculus, a formalism which presents a promising foundation for writing programs that transform other programs. We have proved correctness of the 66 CFA for SF-Calculus analysis and shown that is comparable to standard 0CFA for programs that do not rely on the ability of F to factor terms, such as those translated directly from SK-calculus. From here, there are a number of obvious directions in which to proceed. Firstly, in order to evaluate the usefulness of the analysis and to advance our understanding of program transformation, it would be good to develop a translation from a higher level language that supports intensional metaprogramming into SF-calculus. The translation should map code deconstruction to factorisation using F. Secondly, there is scope to improve the precision of the analysis. For standard 0CFA, tracking context in the style of k-CFA or a pushdown analysis in the style of CFA2 can improve precision significantly. The same techniques may be applicable here. It may also be possible to use techniques from analysing pattern matching and tree datatypes in functional programming languages to analyse the term trees that constitute programs in SF-calculus and their pattern-matching and deconstruction with F. However, an important consideration in applying any such technique to SF-calculus would be the need to distinguish between a non-factorable term t and the factorable term t ′ to which it may reduce. Finally, 0CFA is often useful not as an end to itself, but because it can be combined with other analysis techniques, for example drawn from abstract interpretation, in order to improve their precision by reducing the number of execution paths or reduction sequences that must be considered to overapproximate the behaviour of a program. It would be interesting to see if, combined with such techniques, this analysis can actually be used to verify properties of programs that perform program transformations. References [1] Martin Berger & Laurence Tratt (2010): Program Logics for Homogeneous Meta-programming. In Edmund M. Clarke & Andrei Voronkov, editors: Logic for Programming, Artificial Intelligence, and Reasoning - 16th International Conference, LPAR-16, Dakar, Senegal, April 25-May 1, 2010, Revised Selected Papers, Lecture Notes in Computer Science 6355, Springer, pp. 64–81, doi:10.1007/978-3-642-17511-4_5. [2] Lars Bergstrom, Matthew Fluet, Matthew Le, John H. Reppy & Nora Sandler (2014): Practical and effective higher-order optimizations. In Johan Jeuring & Manuel M. T. Chakravarty, editors: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, Gothenburg, Sweden, September 1-3, 2014, ACM, pp. 81–93, doi:10.1145/2628136.2628153. [3] Swarat Chaudhuri (2008): Subcubic algorithms for recursive state machines. In George C. Necula & Philip Wadler, editors: Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, San Francisco, California, USA, January 7-12, 2008, ACM, pp. 159–169, doi:10.1145/1328438.1328460. [4] Wontae Choi, Baris Aktemur, Kwangkeun Yi & Makoto Tatsuta (2011): Static analysis of multi-staged programs via unstaging translation. In: Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2011, Austin, TX, USA, January 26-28, 2011, pp. 81–92, doi:10.1145/1926385.1926397. [5] T. J.W. Clarke, P. J.S. Gladstone, C. D. MacLean & A. C. Norman (1980): SKIM - The S, K, I Reduction Machine. In: Proceedings of the 1980 ACM Conference on LISP and Functional Programming, LFP ’80, ACM, New York, NY, USA, pp. 128–135, doi:10.1145/800087.802798. [6] Thomas Given-Wilson & Barry Jay (2011): A combinatory account of internal structure. J. Symb. Log. 76(3), pp. 807–826, doi:10.2178/jsl/1309952521. [7] Jim Grundy, Thomas F. Melham & John W. O’Leary (2006): A reflective functional language for hardware design and theorem proving. J. Funct. Program. 16(2), pp. 157–196, doi:10.1017/S0956796805005757. [8] J. Roger Hindley & Jonathan P. Seldin (2008): Lambda-Calculus and Combinators: An Introduction, 2nd edition. Cambridge University Press, New York, NY, USA, doi:10.1017/CBO9780511809835. M. M. Lester 67 [9] David Van Horn & Harry G. Mairson (2008): Deciding kCFA is complete for EXPTIME. In James Hook & Peter Thiemann, editors: Proceeding of the 13th ACM SIGPLAN international conference on Functional programming, ICFP 2008, Victoria, BC, Canada, September 20-28, 2008, ACM, pp. 275–282, doi:10.1145/ 1411204.1411243. [10] David Van Horn & Harry G. Mairson (2008): Flow Analysis, Linearity, and PTIME. In Marı́a Alpuente & Germán Vidal, editors: Static Analysis, 15th International Symposium, SAS 2008, Valencia, Spain, July 16-18, 2008. Proceedings, Lecture Notes in Computer Science 5079, Springer, pp. 255–269, doi:10.1007/ 978-3-540-69166-2_17. [11] Barry Jay & Jose Vergara (2014): Confusion in the Church-Turing Thesis. CoRR abs/1410.7103. Available at http://arxiv.org/abs/1410.7103. [12] C. Barry Jay & Jens Palsberg (2011): Typed self-interpretation by pattern matching. In Manuel M. T. Chakravarty, Zhenjiang Hu & Olivier Danvy, editors: Proceeding of the 16th ACM SIGPLAN international conference on Functional Programming, ICFP 2011, Tokyo, Japan, September 19-21, 2011, ACM, pp. 247– 258, doi:10.1145/2034773.2034808. [13] Neil D. Jones & Nils Andersen (2007): Flow analysis of lazy higher-order functional programs. Theor. Comput. Sci. 375(1-3), pp. 120–136, doi:10.1016/j.tcs.2006.12.030. [14] Martin Lester, Luke Ong & Max Schäfer (2013): Information Flow Analysis for a Dynamically Typed Language with Staged Metaprogramming. In: 2013 IEEE 26th Computer Security Foundations Symposium, New Orleans, LA, USA, June 26-28, 2013, IEEE, pp. 209–223, doi:10.1109/CSF.2013.21. [15] Martin Mariusz Lester (2013): Position paper: the science of boxing. In Prasad Naldurg & Nikhil Swamy, editors: Proceedings of the 2013 ACM SIGPLAN Workshop on Programming Languages and Analysis for Security, PLAS 2013, Seattle, WA, USA, June 20, 2013, ACM, pp. 83–88, doi:10.1145/2465106.2465120. [16] Tom Melham, Raphael Cohn & Ian Childs (2013): On the Semantics of ReFLect as a Basis for a Reflective Theorem Prover. CoRR abs/1309.5742. Available at http://arxiv.org/abs/1309.5742. [17] Jan Midtgaard (2012): Control-flow analysis of functional programs. ACM Comput. Surv. 44(3), p. 10, doi:10.1145/2187671.2187672. [18] Flemming Nielson, Hanne Riis Nielson & Chris Hankin (1999): Principles of program analysis. Springer, doi:10.1007/978-3-662-03811-6. [19] C.-H. Luke Ong & Steven J. Ramsay (2011): Verifying higher-order functional programs with patternmatching algebraic data types. In: Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2011, Austin, TX, USA, January 26-28, 2011, pp. 587–598, doi:10. 1145/1926385.1926453. [20] Olin Shivers (1988): Control-Flow Analysis in Scheme. In Richard L. Wexelblat, editor: Proceedings of the ACM SIGPLAN’88 Conference on Programming Language Design and Implementation (PLDI), Atlanta, Georgia, USA, June 22-24, 1988, ACM, pp. 164–174, doi:10.1145/53990.54007. [21] David A Turner (1979): Another algorithm for bracket abstraction. The Journal of Symbolic Logic 44(02), pp. 267–270, doi:10.2307/2273733. [22] David A Turner (1979): A new implementation technique for applicative languages. Software: Practice and Experience 9(1), pp. 31–49, doi:10.1002/spe.4380090105. [23] Dimitrios Vardoulakis & Olin Shivers (2011): CFA2: a Context-Free Approach to Control-Flow Analysis. Logical Methods in Computer Science 7(2), doi:10.2168/LMCS-7(2:3)2011. [24] Mitchell Wand & Galen B. Williamson (2002): A Modular, Extensible Proof Method for Small-Step Flow Analyses. In Daniel Le Métayer, editor: Programming Languages and Systems, 11th European Symposium on Programming, ESOP 2002, held as Part of the Joint European Conference on Theory and Practice of Software, ETAPS 2002, Grenoble, France, April 8-12, 2002, Proceedings, Lecture Notes in Computer Science 2305, Springer, pp. 213–227, doi:10.1007/3-540-45927-8_16.
6cs.PL
On Asynchrony and Choreographies Luı́s Cruz-Filipe Fabrizio Montesi Department of Mathematics and Computer Science University of Southern Denmark Odense, Denmark [email protected] Department of Mathematics and Computer Science University of Southern Denmark Odense, Denmark [email protected] Choreographic Programming is a paradigm for the development of concurrent software, where deadlocks are prevented syntactically. However, choreography languages are typically synchronous, whereas many real-world systems have asynchronous communications. Previous attempts at enriching choreographies with asynchrony rely on ad-hoc constructions, whose adequacy is only argued informally. In this work, we formalise the properties that an asynchronous semantics for choreographies should have: messages can be sent without the intended receiver being ready, and all sent messages are eventually received. We explore how out-of-order execution, used in choreographies for modelling concurrency, can be exploited to endow choreographies with an asynchronous semantics. Our approach satisfies the properties we identified. We show how our development yields a pleasant correspondence with FIFO-based asynchronous messaging, modelled in a process calculus, and discuss how it can be adopted in more complex choreography models. 1 Introduction Choreographic Programming [18] is a paradigm for developing concurrent software, where an “Alice and Bob” notation is used to prevent mismatched I/O actions syntactically. An EndPoint Projection (EPP) can then be used to synthesise correct-by-construction process implementations [4, 8, 21]. Choreographies are used in different settings, including standards [2, 23], languages [5, 14, 20, 22], specification models [3, 4, 16], and design tools [2, 20, 22, 23]. The key to preventing mismatched I/O actions in choreographies is that interactions between two (or more) processes are specified atomically, using terms such as p.e -> q;C – read “process p sends the evaluation of expression e to process q, and then we proceed as the choreography C”. Giving a semantics to such terms is relatively easy if we assume that communications are synchronous: we can just reduce p.e -> q;C to C in a single step (and update q’s state with the received value, but this is orthogonal to this discussion). For this reason, most research on choreographic programming focused on systems with a synchronous communications semantics. However, many real-world systems use asynchronous communications. This motivated the introduction of an ad-hoc reduction rule for modelling asynchrony in choreographies (Rule bC|Asynce in [4]). As an example, consider the choreography p.1 -> q; p.2 -> r (where 1 and 2 are just constants). The special rule would allow for consuming the second communication immediately, thus reducing the choreography to p.1 -> q. In general, roughly, this rule allows a choreography of the form p.e -> q;C to execute an action in C if this action involves p but not q (sends are non-blocking, receives are blocking). This approach was later adopted in other works (see Section 5). Unfortunately, it also comes with a serious problem: it yields an unintuitive semantics, since a choreography can now reduce to a state that would normally not be reachable in the real world. In our example, specifically, in the real world p would have to send its first message to q before it could proceed to sending its other message to r. This information is lost in the choreography reduction, where it appears that p can just send its messages in any order. M. Bartoletti, L. Bocchi, L. Henrio, S. Knight (Eds.): 10th Interaction and Concurrency Experience (ICE 2017) EPTCS 261, 2017, pp. 76–90, doi:10.4204/EPTCS.261.8 c L. Cruz-Filipe & F. Montesi This work is licensed under the Creative Commons Attribution License. L. Cruz-Filipe & F. Montesi 77 In [4], this also translates to a misalignment between the structures of choreographies and their process implementations generated by EPP, since the latter use a standard asynchronous semantics with message buffers; see Section 5 for a detailed discussion of this aspect. Previous work [11] uses intermediate runtime terms in choreographies to represent asynchronous messages in transit, in an attempt at overcoming this problem. However, the adequacy of this approach has never been formally demonstrated. In this paper, we are interested in studying asynchrony for choreographies in a systematic way. Thus, we first analyse the properties that an asynchronous choreography semantics should have (assuming standard FIFO duplex channels between each pair of processes) – messages can be sent without the intended receiver being ready, and all sent messages are eventually received – and afterwards formulate them precisely in a representative choreography language. Our study leads naturally to the construction of a new choreography model that supports asynchronous communications, by capitalising on the characteristic feature of out-of-order execution found in choreographic programming. We formally establish the adequacy of our asynchronous model, by proving that it respects the formal definitions of our properties. Then, we define an EPP from our new model to an asynchronous process calculus. Thanks to the accurate asynchronous semantics of our choreography model, we prove that the code generated by our EPP and the originating choreography are lockstep operationally equivalent. As a corollary, our generated processes are deadlock-free by construction. Our development also has the pleasant property that programmers do not need to reason about asynchrony: they can just program thinking in the usual terms of synchronous communications, and assume that adopting asynchronous communications will not lead to errors. We conclude by discussing how our construction can be systematically extended to more complex choreography models. Contribution. The contribution of this article is threefold. First, we give an abstract characterisation of asynchronous semantics for choreography languages, which is formalised for a minimal choreography calculus. Secondly, we propose an asynchronous semantics for this minimal language, show that it is an instance of our characterisation, and discuss how it can be applied to other choreography calculi. Finally, we prove a lockstep operational correspondence between choreographies and their process implementations, when asynchronous semantics for both systems are considered. Structure. We present the representative choreography language in which we develop our work, together with its associated process calculus and EPP, in Section 2. In Section 3, we motivate and introduce the properties we would expect of an asynchronous choreography semantics, and introduce a semantics that satisfies these properties. We show that we can define an asynchronous variant of the target process calculus in Section 4, and extend the definition of EPP towards it, preserving the precise operational correspondence from the synchronous case. We relate our development to other approaches for asynchrony in choreographies in Section 5, before concluding in Section 6 with a discussion on the implications of our work and possible future directions. 2 Minimal Choreographies and Stateful Processes We review the choreography model of Minimal Choreographies (MC) and its target calculus of Stateful Processes (SP), originally introduced in [8]. 78 On Asynchrony and Choreographies 2.1 Minimal Choreographies The language of MC is defined inductively in Figure 1. Processes, ranged over by p, q, r, . . ., are assumed C ::= p.e -> q;C | if p.e thenC1 elseC2 | def X = C2 inC1 | X | 0 Figure 1: Minimal Choreographies, syntax. to run concurrently. Processes interact through value communications p.e -> q, which we also denote as η. Here, process p evaluates expression e and sends the result to q. The precise syntax of expressions is immaterial for our presentation; in particular, expressions can access values stored in p’s memory. The remaining choreography terms denote conditionals, recursion, and termination. In the conditional if p.e thenC1 elseC2 , process p evaluates expression e to decide whether the choreography should proceed as C1 or as C2 . In def X = C2 inC1 , we define variable X to be the choreography term C2 , which then can be called (as X) inside both C1 and C2 . Term 0 is the terminated choreography, which we sometimes omit. For a more detailed discussion of these primitives, we refer the reader to [8].1 The (synchronous) semantics of MC is a reduction semantics that uses a total state function σ to represent the memory state at each process p. Since our development is orthogonal to the details of the memory implementation, we say that σ (p) is a representation of the memory state of p (left unspecified) and write upd(σ , p, v) to denote the (uniquely defined) updated memory state of p after receiving a value v. Term e ↓σ (p) v denotes that locally evaluating expression e at p, with memory state σ , evaluates to v. We assume that expression evaluation is deterministic and always terminates. (This formulation captures the essence of previous memory models for choreographies, cf. [4, 7].) Transitions are defined over pairs hC, σ i, given by the rules in Figure 2. As usual, we omit the angular brackets in transitions. These rules are mostly standard, and we summarise their intuition. In bC|Come, e ↓σ (p) v p.e -> q;C, σ → C, upd(σ , q, v) bC|Come C1 , σ → C10 , σ 0 bC|Ctxe def X = C2 inC1 , σ → def X = C2 inC10 , σ 0 e ↓σ (p) true bC|Thene if p.e thenC1 elseC2 , σ → C1 , σ C1  C2 C2 , σ → C20 , σ 0 C1 , σ → C10 , σ 0 e ↓σ (p) false bC|Elsee if p.e thenC1 elseC2 , σ → C2 , σ C20  C10 bC|Structe Figure 2: Minimal Choreographies, synchronous semantics. the state of q is updated with the value received from p (which results from the evaluation of expression e at that process). Rules bC|Thene and bC|Elsee are as expected, while rule bC|Ctxe allows reductions under recursive definitions. Finally, rule bC|Structe uses a structural precongruence , defined in Figure 3, which essentially allows (i) independent communications to be swapped (rule bC|Eta-Etae), (ii) recursive definitions to be unfolded (rule bC|Unfolde), and (iii) garbage collection (rule bC|ProcEnde). The 1 We relaxed the syntax of MC slightly with respect to [8] by leaving the syntax of expressions unspecified, which allows for the simpler conditional if p.e thenC1 elseC2 in line with typical choreography languages. This minor change simplifies our presentation. L. Cruz-Filipe & F. Montesi 79 pn(η) ∩ pn(η 0 ) = 0/ bC|Eta-Etae η; η 0 ≡ η 0 ; η pn(Ci ) ∩ pn(η) = 0/ bC|Eta-Rece def X = C2 in (η;C1 ) ≡ η; def X = C2 inC1 def X = C2 inC1  def X = C2 inC1 [C2 /X] bC|Unfolde def X = C in 0  0 bC|ProcEnde {p, q} ∩ pn(η) = 0/ bC|Eta-Conde if p.e then (η;C1 ) else (η;C2 ) ≡ η; if p.e thenC1 elseC2 p 6= q if p.e then (if q.e0 thenC1 elseC2 ) else (if q.e0 thenC10 elseC20 ) bC|Cond-Conde ≡ if q.e0 then (if p.e thenC1 elseC10 ) else (if p.e thenC2 elseC20 ) Figure 3: Minimal Choreographies, structural precongruence. remaining rules are additional rules allowing communications to swap with other constructs, required for achieving (i). These rules, taken together, endow the semantics of MC with out-of-order execution: interactions not at the top level may be brought to the top and executed if they do not interfere with other interactions that precede them in the choreography’s abstract syntax tree. We write C ≡ C0 for C  C0 and C0  C, and denote the set of process names in a choreography C by pn(C). Unsurprisingly, choreographies in MC are always deadlock-free. We use this property later on, to prove that the process code generated from choreographies is also deadlock-free. Theorem 1 (Deadlock-freedom). Given a choreography C, either C  0 (termination) or, for every σ , there exist C0 and σ 0 such that C, σ → C0 , σ 0 . 2.2 Stateful Processes and EndPoint Projection Minimal Choreographies are meant to be implemented in a minimalistic process calculus, also introduced in [8], called Stateful Processes (SP). We summarize this calculus, noting that we make the same conventions and changes regarding expressions, labels, and states as above. The syntax of SP is reported in Figure 4. A term p .σp B is a process with name p, memory state σp B ::= q!e; B | p?; B | if e then B1 else B2 ; B | def X = B2 in B1 | X | 0 N, M ::= p .σ p B | (N | M) | 0 Figure 4: Stateful Processes, syntax. and behaviour B. Networks, ranged over by N, M, are parallel compositions of processes, with 0 being the inactive network. Behaviours correspond to the local views of choreography actions. The process executing a send term q!e; B evaluates expression e and sends the result to process q, proceeding as B. The dual receiving behaviour p?; B expects a value from process p, stores it in its memory and proceeds as B. The other terms are as in MC. These intuitions are formalized in the synchronous semantics of SP, which is defined by the rules in Figure 5. Rule bP|Come models synchronous value communication: a process p wishing to send a value 80 On Asynchrony and Choreographies e ↓ σp v p .σp q!e; B1 | q .σq p?; B2 → p .σp B1 | q .upd(σq ,v) B2 e ↓σp true bP|Thene p .σp if e then P1 else P2 → p .σp P1 e ↓σp false bP|Elsee p .σp if e then P1 else P2 → p .σp P2 p .σp P | N → p .σp P0 | N 0 p .σp def X = Q in P | N → p .σp def X = Q in P0 | N 0 NM M → M0 N → N0 M0  N 0 bP|Come bP|Structe bP|Ctxe N → N0 bP|Pare N | M → N0 | M Figure 5: Stateful Processes, synchronous semantics. to q can synchronise with a receive-from-p action at q, and the state of q is updated accordingly. The remaining rules are standard. This calculus once again includes a structural precongruence relation , defined in Figure 6, which allows unfolding of recursive definition and garbage collection (removal of terminated processes). def X = B2 in B1  def X = B2 in B1 [B2 /X] p .σp 0  0 bS|PZeroe N|0N bS|NZeroe bS|Unfolde def X = B in 0  0 bS|ProcEnde Figure 6: Stateful Processes, structural precongruence. Networks in SP do not enjoy a counterpart to Theorem 1, as send/receive actions may be unmatched or wrongly ordered. To avoid this happening, we focus on networks that are generated automatically from choreographies in a faithful way, by EndPoint Projection (EPP). EPP is defined first at the process level, by means of a partial function [[C]]p . The rules defining behaviour projection are given in Figure 7. Each choreography term is projected to the local action of   q!e; [[C]]r if r = p [[p.e -> q;C]]r = p?; [[C]]r if r = q   [[C]]r otherwise ( if e then [[C1 ]]r else [[C2 ]]r ; [[C]]r if r = p [[if p.e thenC1 elseC2 ;C]]r = [[C1 ]]r ; [[C]]r if r 6= p and [[C1 ]]r = [[C2 ]]r [[def X = C2 inC1 ]]r = def X = [[C2 ]]r in [[C1 ]]r [[0]]r = 0 [[X]]r = X Figure 7: Minimal Choreographies, behaviour projection. L. Cruz-Filipe & F. Montesi 81 the process that we are projecting. For example, a communication term p.e -> q is projected into a send action for the sender process p, a receive action for the receiver process q, or nothing otherwise. The rule for projecting a conditional requires that the behaviours of processes not aware of the choice are independent of that choice (see [8] for details). Definition 1 (EPP from MC to SP). Given a choreography C and a state σ , the endpoint projection [[C, σ ]] is the parallel composition of the EPPs of C wrt all processes in pn(C): [[C, σ ]] = ∏p∈pn(C) p .σ (p) [[C]]p . Given any two states σ and σ 0 , [[C, σ ]] is defined iff [[C, σ 0 ]] is defined. If this is the case, we say that C is projectable and that N is the projection of C, σ . Theorem 2 (EPP Theorem). If C is projectable, then, for any σ : • (Completeness) if C, σ → C0 , σ 0 , then [[C, σ ]] → [[C0 , σ 0 ]]; • (Soundness) if [[C, σ ]] → N, then C, σ → C0 , σ 0 for some C0 and σ 0 such that [[C0 , σ 0 ]]  N. Combining Theorem 2 with Theorem 1 we get that the projections of choreographies never deadlock. Corollary 1 (Deadlock-freedom by construction). Let N = [[C, σ ]] for some C and σ . Then either N  0 (termination) or there exists N 0 such that N → N 0 . 3 Asynchronous Choreographies In order to define an asynchronous semantics for MC and prove their equivalence to the synchronous semantics, we need to define precisely what we understand by “asynchronous semantics” and by “equivalence”. Intuitively, communications from p to q are asynchronous if: they occur in two steps (send and receive), the send step does not require q to be ready, and if the send step is executed, then the corresponding receive step is also eventually executed. We begin by defining asynchrony in MC. We define the syntactic category of contexts, which can contain holes denoted as •, formally defined in Figure 8. Structural precongruence is defined for contexts C[•] ::= •;C | η; C[•] | if p.e then C1 [•] else C2 [•] | def X = C in C[•] | X | 0 Figure 8: Contexts for asynchrony. as for choreographies. We do not consider holes to be interactions, so they cannot be swapped with any other action. Using contexts, we can define a function that identifies the type of the next action in context C[•] involving a process r: a communication (comm), a conditional (cond), or dependent on how • is instantiated (•). This function is partial – in particular, it is undefined if C[•] does not contain either r or •. 82 On Asynchrony and Choreographies Definition 2. The next action for r in a context C[•], denoted nextr (C[•]), is defined as follows. nextr (•;C) = • nextr (0) = nextr (X) = undefined ( comm if r ∈ pn(η) nextr (η; C[•]) = nextr (C[•]) otherwise   if p = r cond nextr (if p.e then C1 [•] else C2 [•]) = nextr (C1 [•]) if nextr (C1 [•]) = nextr (C2 [•])   undefined otherwise nextr (def X = C in C[•]) = nextr ((C[•])[C/X]) The proviso in the second case of the definition of nextr (if p.e then C1 [•] else C2 [•]) ensures that the enabled action for r is uniquely defined. Note that recursive definitions only need to be unfolded once. This notion is well-defined, since structural precongruence cannot swap actions involving the same process. We denote by C[η] the result of replacing every occurrence of • in C[•] by η. Since we expect asynchronous communications to occur in two steps, it is reasonable to expect MC to be extended with additional actions. By an extension of MC, we understand a choreography language that has all the primitives of MC, an arbitrarily larger set of interaction statements η, and an adequately extended function pn. Our definitions of contexts and next extend automatically to these languages. We can now formalise the intuition given at the beginning of this section. Definition 3. A semantics →a for an extension of MC is asynchronous if the following conditions hold for any state σ . (We assume that 0;C stands for C.) • If nextp (C[•]) = •, then C[p.e -> q], σ →a C[∗vq ], σ , where e ↓σ (p) v and ∗vq is a statement that depends on v and q. • If nextq (C[•]) = •, then C[∗vq ], σ →a C[0], upd(σ , q, v). The second ingredient we need is a formal definition of equivalence. Our notion is similar to the standard notion of operational correspondence from [13], but stronger, since we require that any additional term introduced by asynchronous reductions can always be consumed. Definition 4. An asynchronous semantics →a for an extension of MC is asynchronously equivalent to the semantics → of MC if: • if C, σ → C0 , σ 0 , then C, σ →∗a C0 , σ 0 ; • if C, σ →∗a C0 , σ 0 , then there exist C00 and σ 00 such that C, σ →∗ C00 , σ 00 and C0 , σ 0 →∗a C00 , σ 00 . Note that, in the last point of the above definition, the choreography C0 might include terms from the extended choreography language. Now we are ready to present our extension of MC and define its asynchronous semantics. We extend the syntax of choreographies with the runtime terms in Figure 9. We call the resulting calculus aMC (for asynchronous MC). The key idea is that, at runtime, a communication is expanded into multiple actions. η ::= . . . | p.e -> x | v̂ -> q v̂ ::= x | v Figure 9: Asynchronous Minimal Choreographies, runtime terms. For example, a communication p.e -> q expands in p.e -> x – a send action from p – and x -> q – a receive L. Cruz-Filipe & F. Montesi 83 action by q. The variable x is used to specify that the original intention by the programmer was for that message from p to reach that receive action at q. Thus, executing p.e -> x replaces x in the corresponding receive action with the actual value v computed from e at p, yielding v -> q. Finally, executing v -> q updates the state of q. Process names for the new runtime terms are defined in the obvious way. The semantics for aMC includes: • the rules from Figure 10, replacing bC|Come, and from Figure 11, extending ; • rules bC|Thene, bC|Elsee and bC|Structe from Figure 2; • the rules defining  (Figure 2), with η now ranging also over the new runtime terms. e ↓σ (p) v p.e -> x;C, σ →a C[v/x], σ bC|Com-Se v -> q;C, σ →a C, upd(σ , q, v) bC|Com-Re Figure 10: Asynchronous Minimal Choreographies, semantics (runtime terms). p.e -> q  p.e -> x; x -> q bC|Com-Unfolde Figure 11: Asynchronous Minimal Choreographies, new rule for structural precongruence. By the Barendregt convention, the variables introduced by unfolding a value communication are globally fresh. (We assume that their scope is global.) This allows us to use these variables to maintain the correspondence between the value being sent and that being received. The key to the asynchronous semantics of aMC lies in the new swaps allowed by , due to the definition of pn for the new terms. ∆ Example 1. Let C = p.e -> q; p.e0 -> r. To execute C asynchronously, we must expand it: C  p.e -> x; x -> q; p.e0 -> y; y -> r Using , we can swap the second term to the end: C  p.e -> x; p.e0 -> y; y -> r; x -> q So p can send both messages immediately, and r can receive its message before q. The semantics of aMC also enjoys deadlock-freedom. Theorem 3 (Deadlock-freedom). Given a choreography C, either C  0 (termination) or, for every σ , there exist C0 and σ 0 such that C, σ →a C0 , σ 0 . Theorem 4. The relation →a is an asynchronous semantics for aMC. Proof (Sketch). By induction on the definition of next. For the first point, observe that the only process name in p.e -> x is p, and therefore we can expand p.e -> q and use swapping () to rewrite C[p.e -> q] as p.e -> x; C[x -> q], if nextp (C[•]) = •. The second point follows from a similar observation for v -> q. 84 On Asynchrony and Choreographies Theorem 5. The semantics →a is asynchronously equivalent to the semantics of MC. Proof (Sketch). Proving the first property is straightforward. The only non-trivial case is when the transition C, σ → C0 , σ 0 uses rule bC|Come, and in this case in the asynchronous semantics we can unfold the corresponding communication and reduce twice using bC|Com-Se and bC|Com-Re. For the second property, we make two observations. (1) The relation →a has the diamond property, namely: if C, σ →a C0 , σ 0 and C, σ →a C00 , σ 00 , then there exist C000 and σ 000 such that C0 , σ 0 →a C000 , σ 000 and C00 , σ 00 →a C000 , σ 000 (see Figure 12, left). This is directly proven by case analysis on the structure of a choreography C with two distinct possible transitions. (2) If C, σ →a C0 , σ 0 , then there exist C00 and σ 00 such that C, σ →∗ C00 , σ 00 and C0 , σ 0 →∗a C00 , σ 00 . This is similar to the proof for the first property. If the transition uses rule bC|Com-Se, then the choreography C00 is obtained by firing rule bC|Com-Re, but it might be necessary to execute additional actions in case the receiver is not ready for that transition yet. This is always possible due to Theorem 3. The property now follows by induction on the length of the reduction chain C, σ →∗a C0 , σ 0 . When this length is 0, the result is trivial, and when the length is 1, the result is simply (2) above. Otherwise, we follow the reasoning displayed in Figure 12, right. By assumption, we have that C, σ →∗a C1 , σ1 →a C0 , σ 0 (top of the picture). By induction hypothesis, there exist C10 and σ10 such that C, σ →∗ C10 , σ10 and C1 , σ1 →∗a C10 , σ10 (left triangle). By iterated application of (1) above, there exist C100 and σ100 such that C10 , σ10 →?a C100 , σ100 and C0 , σ 0 →∗a C100 , σ100 (right square). The reduction C10 , σ10 →?a C100 , σ100 is optional because it may be the case that the action in the reduction C1 , σ1 →a C0 , σ 0 is already included in the reduction chain C1 , σ1 →∗a C10 , σ10 . In this case, the thesis follows, taking C00 = C10 and σ 00 = σ10 . Otherwise, we apply (2) above (lower right triangle) to obtain C00 and σ 00 such that C10 , σ10 →∗ C00 , σ 00 and C100 , σ100 →∗a C00 , σ 00 , and the thesis follows. C, σ / C0 , σ 0 C, σ ∗/ a C1 , σ1 C10 , σ10 / C0 , σ 0 a ?/ a  ∗ a ∗  ∗ a  / C000 , σ 000 a a a  C00 , σ 00 a C100 , σ100  ∗ a ∗ C00 , σ 00 Figure 12: The diamond property for →a (left) and the reasoning in the proof of the second property in Theorem 5 (right). Remark 1. Reasoning on asynchronous behaviour is known to be hard for programmers. That is why our terms for modelling asynchronous communications are runtime terms: they are not intended to be part of the source language used by developers to program. In general, programmers do not need to be aware of the development in this section, thanks to Theorem 5. Instead, they can just write a choreography thinking in terms of synchronous communications as usual (syntax and semantics), and then just assume that adopting an asynchronous communications will not lead to any bad behaviour. In the next section, L. Cruz-Filipe & F. Montesi 85 we show that this abstraction carries over to asynchronous process code generated by EPP. Since EPP is automatic, developers do not need to worry about asynchrony in process code either. 4 Asynchronous Processes In the previous section, we characterized asynchrony at an abstract level, and showed that our choreography model satisfies the properties we identified. In this section, we take a more down-to-earth approach: we define directly an asynchronous variant for SP, extend EPP to the runtime terms introduced earlier, and show that the asynchronous semantics for both calculi again satisfy the EPP Theorem (Theorem 2). 4.1 Asynchronous Stateful Processes Syntactically, we need to make a slight change to our processes: each process is now also equipped with a queue of incoming messages. We name this version of the calculus aSP. So actors in the asynchronous ρ model have the form p .σ B, where ρ is a queue of incoming messages. We sometimes omit ρ when it is empty; in particular, this allows us to view SP networks as special cases of aSP networks. A message is a pair hq, mi, where q is the sender process and m is a value, label, or process identifier. The semantics of aSP consists of rules bP|Thene, bP|Elsee, bP|Pare, bP|Ctxe and bP|Structe from SP (Figure 5) together with the new rules given in Figure 13. Structural precongruence for aSP is defined exactly as for SP. We write ρ · hq, mi to denote the queue obtained by appending message hq, mi to ρ, ρq0 = ρq · hp, vi e ↓σp v ρ ρ ρ ρ0 p .σpp q!e; Bp | q .σqq Bq → p .σpp Bp | q .σqq Bq ρq  hp, vi · ρq0 bP|Com-Se ρ ρ0 bP|Com-Re q q .σqq p?; B → q .upd(σ B q ,v) Figure 13: Asynchronous Stateful Processes, semantics (new rules). and hq, mi · ρ for the queue with hq, mi at the head and ρ as tail. We simulate having one separate FIFO queue for each other process by allowing incoming messages from different senders to be exchanged, which we represent using the congruence ρ  ρ 0 defined by the rule hp, mi · hq, m0 i  hq, m0 i · hp, mi if p 6= q. All behaviours of SP are valid also in aSP. Theorem 6. Let N be an SP network. If N → N 0 (in SP), then N[] →∗ N[]0 (in aSP), where N[] denotes the asynchronous network obtained by adding an empty queue to each process. Proof. Straightforward by case analysis: the only reduction rule in SP that is not present in aSP is that for communications, which can be simulated by applying rules bP|Com-Se and bP|Com-Re in sequence. The converse is not true, so the relation between SP and aSP is not so strong as that between MC and aMC (stated in Theorem 5). This is because of deadlocks: in SP, a communication action can only take place when the sender and receiver are ready to synchronize; in aSP, a process can send a message to another process, even though the intended recipient is not yet able to receive it. For example, the network p.σp q!1 | q.σq 0 is deadlocked in SP, but its counterpart in aSP (obtained by adding empty queues at each hp,1i process) reduces to q .σq 0. (This network is not equivalent to 0, since there is a non-empty queue.) 86 On Asynchrony and Choreographies More interestingly, the network p .σp q!e1 ; r? | q .σq r!e2 ; p? | r .σr p!e3 ; q? (1) is deadlocked in SP, but reduces to 0 in aSP (all queues are eventually emptied). It is possible to extend MC with communication primitives that capture this type of behaviour, as discussed in [6]; we briefly discuss this point in Section 6. 4.2 Asynchronous EndPoint Projection Defining an EPP from aMC to aSP requires extending the previous definition with clauses for the new runtime terms, which populate the local queues in the projections. Intuitively, when compiling, e.g., v -> q, we add a message containing v at the top of q’s queue. There are two problems with this approach. The first is a syntactic issue: each message in the queues of aSP processes must include the name of its sender, but that information is not present in the runtime term v -> q. This is a minor issue that can be dealt with by annotating send and receive actions with the name of the process sending them – writing, e.g., hp, xi -> q and hp, vi -> q. Changing the syntax of runtime terms and rule bC|Com-Unfolde in this way is trivial, and we assume this annotated terms in the remainder of this session.2 The second problem arises because we can write choreographies that use runtime terms in a “wrong” way, for which Theorem 2 no longer holds. Example 2. Consider the choreography C = p.1 -> q; hp, 2i -> q. If we naively project it as described hp,2i [] informally, we obtain p .σ (p) q!1 | q .σ (q) p?; p? , where [] is the empty queue, and q will receive 2 before it receives 1. To avoid this undesired behaviour, we restrict ourselves to well-formed choreographies: those that can arise from executing a choreography that does not contain runtime terms (i.e., a program). Since runtime terms are supposed to be hidden from the programmer anyway, this restriction does not make us lose any generality in practice. Definition 5 (Well-formedness). A choreography C in aMC containing runtime terms is well-formed if η1 ; . . . ; ηn ;CMC − C, where: • − is structural precongruence without rule bC|Unfolde; • each ηi is an instantiated receive action of the form hpi , vi i -> qi ; • CMC is an MC choreography (i.e., a choreography without runtime terms). Well-formedness is decidable, since the set of choreographies equivalent up to − is decidable. More efficiently, one can check that C is well-formed by swapping all runtime actions to the beginning and folding all paired send/receive terms. Furthermore, choreography execution preserves well-formedness; in particular, the problematic choreography from Example 2 is not well-formed. More generally, we can use well-formedness in the remainder of this section to reason about EPP. 2 We could have defined the runtime terms for aMC annotated from the start. However, we felt that it would be unnatural to include them in a choreographic presentation, as they are only needed for projecting runtime terms – a feature that is a technicality required for the proof of Theorem 7 below, since the programmer should not write runtime terms anyway. L. Cruz-Filipe & F. Montesi 87 Definition 6 (Asynchronous EPP from aMC to aSP). Let C be a well-formed aMC choreography and σ be a state. Without loss of generality, we assume that C does not contain p.e -> x actions.3 The EPP of C and σ is defined as (|C|) [[C, σ ]] = ∏p∈pn(C) p .σ (p)p [[C]]p where [[C]]p is defined as in Figure 7 with the extra rule in Figure 14 and (|C|)p is defined by the rules in Figure 15. ( p?; [[C]]r [[hp, vi -> q;C]]r = [[C]]r if r = q otherwise Figure 14: Minimal Choreographies, asynchronous behaviour projection (new rule). ( hp, vi · (|C|)r (|hp, vi -> q;C|)r = (|C|)r if r = q otherwise (|if p.e thenC1 elseC2 ;C|)r = (|C1 |)r · (|C|)r (|η;C|)r = (|C|)r Figure 15: Minimal Choreographies, projection of messages in transit. In the last case of the definition of (|C|)p (bottom-right), η ranges over all cases that are not covered previously. The rule for the conditional may seem a bit surprising: projectability of choreographies implies that unmatched receive actions at a process must occur in the same order in both branches. We could alternatively define projection only for well-formed choreographies in the “canonical form” implicit in the definition of well-formedness. With this definition, we can state an asynchronous variant of Theorem 2. Theorem 7 (Asynchronous EPP Theorem). If C is a projectable and well-formed MC choreography, then, for all σ : • (Completeness) if C, σ → C0 , σ 0 , then [[C, σ ]] → [[C0 , σ 0 ]]; • (Soundness) if [[C, σ ]] → N, then C, σ → C0 , σ 0 for some C0 and σ 0 such that [[C0 , σ 0 ]]  N. As a consequence, Corollary 1 applies also to the asynchronous case: the processes projected from MC into aSP are deadlock-free, even when they contain runtime terms. As usual, the hypotheses in Theorem 7 are not necessary, and this result also holds for some choreographies that are not well-formed. For example, the network in (1) can be written as the projection of a choreography with runtime terms, but this choreography is not structurally precongruent to any choreography obtained from execution of an MC choreography. 5 Related Work The first work introducing an asynchronous semantics to choreographies is [4], as described in the introduction. The same approach was later adapted to compositional choreographies [19] and multiparty 3 By well-formedness, we can always rewrite C to an equivalent choreography satisfying this condition; such a choreography is also guaranteed not to contain x -> q actions. 88 On Asynchrony and Choreographies session types [15]. The models presented in these works all suffer from the shortcoming discussed in the introduction: choreographies can reduce to states that would normally not be reachable in the real world. We can now give a formal example of the consequences of this discrepancy. ∆ Example 3. Let C be the choreography from the introduction: C = p.1 -> q; p.2 -> r. If we adopted the asynchronous semantics from [4], then the reduction C, σ → p.1 -> q, upd(σ , r, 2) would be possible for any σ . This shows that Theorem 7 (the completeness direction) does not hold in this semantics, since [[C, σ ]] cannot reduce to any N such that [[p.1 -> q, upd(σ , r, 2)]]  N (we have to consume the first output by p first). Therefore, if we want to formalise the correspondence between a choreography and its EPP in this setting, we need to consider multiple steps. In this example, specifically, we can observe that p.1 -> q, upd(σ , r, 2) → 0, upd(upd(σ , r, 2), q, 1) →∗ and that [[C, σ ]] [[0, upd(upd(σ , r, 2), q, 1)]]. In general, the EPP Theorem with this kind of asynchronous semantics is weaker and more complicated. We report it here by adapting the formulation from [18, Chapter 2] (the full version of [4]) to our notation: Theorem 8. If C is a projectable choreography, then, for all σ : • (Completeness) if C, σ → C0 , σ 0 , then C0 , σ 0 →∗ C00 , σ 00 for some C00 , σ 00 and [[C, σ ]] →∗ [[C00 , σ 00 ]]; • (Soundness) if [[C, σ ]] →∗ N, then N →∗ N 0 for some N 0 , and C, σ →∗ C0 , σ 0 for some σ 0 and C0 such that [[C0 , σ 0 ]]  N 0 . Compared to our Theorem 7 above, Theorem 8 is missing the step-by-step correspondence between choreographies and their projections, and therefore does not say much about the intermediate steps. In [11], multiparty session types are equipped with runtime terms that represent messages in transit in asynchronous communications, similarly to our approach. Differently from our model, the semantics in [11] uses a labelled transition system (instead of out-of-order execution) to identify when a communication can be executed asynchronously. The difference between these two systems seems to be mostly a matter of presentation, but their expressive powers are difficult to compare formally because a counterpart to Theorem 5 is not provided for the model of [11]. A more recent development that is nearer to ours is the model of Applied Choreographies [12], where out-of-order execution (modelled as structural equivalences) is used to swap independent partial choreographic actions, which contain terms that are similar to our runtime asynchronous terms. However, the asynchronous terms in Applied Choreographies are not enough to ensure that the semantics is sound; therefore, these choreographies also need to include queues to store messages in transit. This makes their development substantially more complicated than the one we propose. Furthermore, the work in [12] focuses on implementation models, and does not provide a formal definition of asynchrony for choreographies as in this paper. There is also no correspondence result relating Applied Choreographies to a standard synchronous choreography semantics, although we conjecture that it is possible to map a fragment of that language into an asynchronous extension of MC in the sense of our definition. Our approach relies on out-of-order execution for choreographic interactions, which was first introduced in [4] to capture parallel execution. We extended it to support the swapping of interactions supported by asynchronous message passing. Out-of-order execution does not introduce any burden on the programmer, since only non-interfering interactions can be swapped and all swappings are thus safe by design (more precisely, swaps correspond to the parallel semantics of typical process calculi [18]); instead, they just model different safe ways of executing the same choreography. L. Cruz-Filipe & F. Montesi 6 89 Conclusions and Future Work We presented a definition of asynchrony in the minimal choreography language MC and showed that we can define an asynchronous semantics for an extension of MC (aMC) that respects this definition. This construction was deliberately made in a modular way (it changes only the rules for communications, leaving the rest untouched), so that it can be easily applied to more expressive languages. We discuss a few relevant cases. The first case regards label selection, usually written p -> q[`], which is a widespread primitive in choreographies [3]. In a selection, the sender informs the receiver of a local choice, and the receiver can use this information to change its behaviour. Selections are mostly relevant for extending the domain of EPP, which is orthogonal to this work. Our approach applies directly also to selections, by adding asynchronous runtime terms that are similar to the ones for value communications but carry selection labels instead of values. Name mobility [4, 9] can also be treated in a similar way. Instead of out-of-order execution, some choreography models also include explicit parallel composition, e.g., C | C0 [3, 21]. Most behaviours of C | C0 are captured by out-of-order execution, for example p.e -> q | r.e0 -> s is equivalent to p.e -> q; r.e0 -> s in MC (due to rule bC|Eta-Etae in Figure 2) – see [4] for a deeper discussion. Generalising our construction to supporting also an explicit parallel operator is straightforward (structural precongruence is extended homomorphically without surprises). A more interesting extension is multicom [6], a primitive that considerably extends the expressivity of choreographies by allowing for general criss-cross communications. A prime example is the asynchronous exchange {p.e -> q, q.e0 -> p}, which allows two processes to exchange message without waiting for each other (this is the building block, e.g., of the alternating 2-bit protocol given in [6]). Multicoms crucially depend on asynchrony, making them an interesting case study in our context. Our development applies immediately to multicoms, since we can just apply the expansion rule bC|Com-Unfolde to all communications in a multicom simultaneously. Likewise, we conjecture that our development is applicable to the models in [10, 17]. Acknowledgements. This work was supported by CRC (Choreographies for Reliable and efficient Communication software), grant no. DFF–4005-00304 from the Danish Council for Independent Research, by grant DFF-1323-00247 from the Danish Council for Independent Research, Natural Sciences, and by the Open Data Framework project at the University of Southern Denmark. References [1] Elvira Albert & Ivan Lanese, editors (2016): Formal Techniques for Distributed Objects, Components, and Systems – 36th IFIP WG 6.1 International Conference, FORTE 2016. LNCS 9688, Springer, doi:10.1007/978-3-319-39570-8. [2] Business Process Model and Notation. http://www.omg.org/spec/BPMN/2.0/. [3] Marco Carbone, Kohei Honda & Nobuko Yoshida (2012): Structured Communication-Centered Programming for Web Services. ACM Trans. Program. Lang. Syst. 34(2), pp. 8:1–8:78, doi:10.1145/2220365.2220367. [4] Marco Carbone & Fabrizio Montesi (2013): Deadlock-freedom-by-design: multiparty asynchronous global programming. In Roberto Giacobazzi & Radhia Cousot, editors: POPL, ACM, pp. 263–274. Available at http://doi.acm.org/10.1145/2429069.2429101. [5] Chor: Programming Language. http://www.chor-lang.org/. 90 On Asynchrony and Choreographies [6] Luı́s Cruz-Filipe, Kim S. Larsen & Fabrizio Montesi (2017): The Paths to Choreography Extraction. In Javier Esparza & Andrzej S. Murawski, editors: FoSSaCS, LNCS 10203, Springer, pp. 424–440, doi:10.1007/9783-662-54458-7 25. [7] Luı́s Cruz-Filipe & Fabrizio Montesi (2016): Choreographies in Practice. In Albert & Lanese [1], pp. 114– 123, doi:10.1007/978-3-319-39570-8 8. [8] Luı́s Cruz-Filipe & Fabrizio Montesi (2017): A Core Model for Choreographic Programming. In Olga Kouchnarenko & Ramtin Khosravi, editors: FACS, LNCS 10231, Springer, pp. 17–35, doi:10.1007/978-3319-57666-4 3. [9] Luı́s Cruz-Filipe & Fabrizio Montesi (2017): Procedural Choreographic Programming. In Ahmed Bouajjani & Alexandra Silva, editors: FORTE 2017, LNCS 10321, Springer, pp. 92–107, doi:10.1007/978-3-31960225-7 7. [10] Mila Dalla Preda, Maurizio Gabbrielli, Saverio Giallorenzo, Ivan Lanese & Jacopo Mauro (2015): Dynamic Choreographies – Safe Runtime Updates of Distributed Applications. In Tom Holvoet & Mirko Viroli, editors: COORDINATION, LNCS 9037, Springer, pp. 67–82, doi:10.1007/978-3-319-19282-6 5. [11] Pierre-Malo Deniélou & Nobuko Yoshida (2013): Multiparty Compatibility in Communicating Automata: Characterisation and Synthesis of Global Session Types. In Fedor V. Fomin, Rusins Freivalds, Marta Z. Kwiatkowska & David Peleg, editors: ICALP (2), LNCS 7966, Springer, pp. 174–186, doi:10.1007/978-3642-39212-2 18. [12] Maurizio Gabbrielli, Saverio Giallorenzo & Fabrizio Montesi (2015): Applied Choreographies. CoRR abs/1510.03637. Available at http://arxiv.org/abs/1510.03637. [13] Daniele Gorla (2010): Towards a unified approach to encodability and separation results for process calculi. Inf. Comput. 208(9), pp. 1031–1053, doi:10.1016/j.ic.2010.05.002. [14] Kohei Honda, A. Mukhamedov, G. Brown, T.-C. Chen & Nobuko Yoshida (2011): Scribbling Interactions with a Formal Foundation. In Raja Natarajan & Adegboyega K. Ojo, editors: ICDCIT, LNCS 6536, Springer, pp. 55–75, doi:10.1007/978-3-642-19056-8 4. [15] Kohei Honda, Nobuko Yoshida & Marco Carbone (2016): Multiparty Asynchronous Session Types. J. ACM 63(1), pp. 9:1–9:67, doi:10.1145/2827695. [16] Ivan Lanese, Claudio Guidi, Fabrizio Montesi & Gianluigi Zavattaro (2008): Bridging the Gap between Interaction- and Process-Oriented Choreographies. In Antonio Cerone & Stefan Gruner, editors: SEFM, IEEE, pp. 323–332, doi:10.1109/SEFM.2008.11. [17] Hugo A. López, Flemming Nielson & Hanne Riis Nielson (2016): Enforcing Availability in Failure-Aware Communicating Systems. In Albert & Lanese [1], pp. 195–211, doi:10.1007/978-3-319-39570-8 13. [18] Fabrizio Montesi (2013): Choreographic Programming. Ph.D. Thesis, IT University of Copenhagen. http://fabriziomontesi.com/files/choreographic programming.pdf . [19] Fabrizio Montesi & Nobuko Yoshida (2013): Compositional Choreographies. In Pedro R. D’Argenio & Hernán C. Melgratti, editors: CONCUR, LNCS 8052, Springer, pp. 425–439, doi:10.1007/978-3-642-401848 30. [20] (2008): PI4SOA. http://www.pi4soa.org. [21] Zongyan Qiu, Xiangpeng Zhao, Chao Cai & Hongli Yang (2007): Towards the theoretical foundation of choreography. In Carey L. Williamson, Mary Ellen Zurko, Peter F. Patel-Schneider & Prashant J. Shenoy, editors: WWW, ACM, pp. 973–982, doi:10.1145/1242572.1242704. [22] Savara: JBoss Community. http://www.jboss.org/savara/. [23] W3C WS-CDL Working Group (2004): Web Services Choreography Description Language Version 1.0. http://www.w3.org/TR/2004/WD-ws-cdl-10-20040427/.
6cs.PL
1 Video Object Segmentation Without Temporal Information arXiv:1709.06031v1 [cs.CV] 18 Sep 2017 K.-K. Maninis*, S. Caelles*, Y. Chen, J. Pont-Tuset, L. Leal-Taixé, D. Cremers, and L. Van Gool Abstract—Video Object Segmentation, and video processing in general, has been historically dominated by methods that rely on the temporal consistency and redundancy in consecutive video frames. When the temporal smoothness is suddenly broken, such as when an object is occluded, or some frames are missing in a sequence; the result of these methods can deteriorate significantly or they may not even produce any result at all. This paper explores the orthogonal approach of processing each frame independently, i.e. disregarding the temporal information. In particular, it tackles the task of semi-supervised video object segmentation: the separation of an object from the background in a video, given its mask in the first frame. We present Semantic One-Shot Video Object Segmentation (OSVOSS ), based on a fully-convolutional neural network architecture that is able to successively transfer generic semantic information, learned on ImageNet, to the task of foreground segmentation, and finally to learning the appearance of a single annotated object of the test sequence (hence one shot). We show that instance level semantic information, when combined effectively, can dramatically improve the results of our previous method, OSVOS. We perform experiments on two recent video segmentation databases, which show that OSVOSS is both the fastest and most accurate method in the state of the art. Index Terms—Video Object Segmentation, Convolutional Neural Networks, Semantic Segmentation, Instance Segmentation. F 1 I NTRODUCTION A video is a temporal sequence of static images that give the impression of continuous motion when played consecutively and rapidly. The illusion of motion pictures is due to the persistence of human vision [23], [61], [66]: the fact that it cannot perceive very high frequency changes [66] because of the temporal integration of incoming light into the retina [61]. This property has been exploited since the appearance of the phenakistoscope [59] or the zoetrope [23], which displayed a sequence of drawings creating the illusion of continuous movement. In order to achieve the high frequency to produce the video illusion, consecutive images vary very smoothly and slowly: the information in a video is very redundant and neighboring frames carry very similar information. In video coding, for instance, this is the key idea behind video compression algorithms such as motion-compensated coding [61], where instead of storing each frame independently, one picks a certain image and only codes the modifications to be done to it to generate the next frame. Video processing in general, and video segmentation in particular, is also dominated by this idea, where motion estimation has emerged as a key ingredient for some of the state-of-the-art video segmentation algorithms [17], [28], [46], [53], [63]. Exploiting it is not a trivial task however, as one e.g. has to compute temporal matches in the form of optical flow or dense trajectories [4], which can be an even harder problem to solve. On the other hand, processing each frame independently would allow us to easily parallelize the computation, and to not be affected by sequence interruptions, to process the frames at any desire rate, etc. This paper explores how to segment objects in videos when processing each frame independently, that is, by • • • K.-K. Maninis, S. Caelles, Y. Chen, J. Pont-Tuset, and L. Van Gool are with the ETHZ, Zürich. First two authors contributed equally. L. Leal-Taixé and D. Cremers are with the TUM, München. Contacts in http://www.vision.ee.ethz.ch/˜cvlsegmentation/ ignoring the temporal information and redundancy. In other words, we cast video object segmentation as a per-frame segmentation problem given the model of the object from one (or various) manually-segmented frames. This stands in contrast to the dominant approach where temporal consistency plays the central role, assuming that objects do not change too much between one frame and the next. Such methods adapt their single-frame models smoothly throughout the video, looking for targets whose shape and appearance vary gradually in consecutive frames, but fail when those constraints do not apply, unable to recover from relatively common situations such as occlusions and abrupt motion. We argue that temporal consistency was needed in the past, as one had to overcome major drawbacks of the then inaccurate shape or appearance models. On the other hand, in this paper deep learning will be shown to provide a sufficiently accurate model of the target object to produce very accurate results even when processing each frame independently. This has some natural advantages: OSVOSS is able to segment objects throughout occlusions, it is not limited to certain ranges of motion, it does not need to process frames sequentially, and errors are not temporally propagated. In practice, this allows OSVOSS to handle e.g. interlaced videos of surveillance scenarios, where cameras can go blind for a while before coming back on again. Given the first frame, we create an appearance model of the object of interest and then look for the pixels that better match this model in the rest of the frames. To do so, we will make use of Convolutional Neural Networks (CNNs), which are revolutionizing many fields of computer vision. For instance, they have dramatically boosted the performance for problems like image classification [22], [32], [58] and object detection [15], [16], [37]. Image segmentation has also been taken over by CNNs recently [2], [3], [31], [39], [67], with deep architectures pretrained on the weakly related task of image classification on 2 Fig. 1. Example result of our technique: The segmentation of the first frame (red) is used to learn the model of the specific object to track, which is segmented in the rest of the frames independently (green). One every 10 frames shown of 90 in total. ImageNet [57]. One of the major downsides of deep network approaches, however, is their hunger for training data. Yet, with various pre-trained network architectures one may ask how much training data do we really need for the specific problem at hand? This paper investigates segmenting an object along an entire video, when we only have one single labeled training example, e.g. the first frame. Figure 1 shows an example result of OSVOSS , where the input is the segmentation of the first frame (in red), and the output is the mask of the object in the 90 frames of the sequence (in green). The first contribution of the paper is to adapt the CNN to a particular object instance given a single annotated image. To do so, we gradually adapt a CNN pre-trained on image recognition [57] to video object segmentation. This is achieved by training it on a set of videos with manually segmented objects. Finally, it is finetuned at test time on a specific object that is manually segmented in a single frame. Figure 2 shows the overview of the method. Our proposal tallies with the observation that leveraging these different levels of information to perform object segmentation would stand to reason: from generic information of a large amount of categories, passing through the knowledge of the usual shapes of objects in videos, down to the specific properties of a particular object we are interested in segmenting. Our second contribution is to extend the model of the object with explicit semantic information. In the example of Figure 1, for instance, we would like to leverage the fact that we are segmenting an object of the category person and that there is a single instance of it. In particular, we will use an instanceaware semantic segmentation algorithm [9], [21], [34] to extract a list of proposal of object masks in each frame, along with their categories. Given the first annotated frame, we will infer the categories of the objects of interest by finding the best-overlapping masks. We refer to this step as “semantic selection.” Our method uses the extracted semantic information from the first frame to segment the rest of the video. It enforces the resulting masks to align well with the same categories selected in the first frame. If we were segmenting a person on a motorbike, then this information should be kept throughout the video. In particular, we find instances extracted from the semantic instance segmentation algorithm that best match the model of the object, and we effectively combine them with the appearance model of the object, using a conditional classifier. We call this step “semantic propagation.” Our third contribution is that OSVOSS can work at various points of the trade-off between speed and accuracy. In this sense, given one annotated frame, the user can choose the level of fine-tuning performed on it, giving them the freedom between a faster method or more accurate results. Experimentally, we show that OSVOSS can run at 300 miliseconds per frame and 75.1% accuracy, and up to 86.0% when processing each frame in 4.5 seconds, for an image of 480×854 pixels. Technically, we adopt the architecture of Fully Convolutional Networks (FCN) [14], [38], suitable for dense predictions. FCNs have recently become popular due to their performance both in terms of accuracy and computational efficiency [7], [10], [38]. Arguably, the Achilles’ heel of FCNs when it comes to segmentation is the coarse scale of the deeper layers, which leads to inaccurately localized predictions. To overcome this, a large variety of works from different fields use skip connections of larger feature maps [20], [38], [41], [67], or learnable filters to improve upscaling [44], [69]. We perform experiments on two video object segmentation datasets (DAVIS [47] and Youtube-Objects [25], [52]) and show that OSVOSS significantly improves the state of the art in them, both in terms of accuracy and speed. All resources of this paper, including training and testing code, pre-computed results, and pre-trained models will be made publicly available. 2 R ELATED W ORK Semi-supervised Video Object Segmentation: Most of the current literature on semi-supervised video object segmentation enforces temporal consistency in video sequences to propagate the initial mask into the following frames. The most recent works heavily rely on optical flow, and make use of CNNs to learn to refine the mask of the object at frame n to frame n + 1 [29], [46] or combine the training of a CNN with ideas of bilateral filtering between consecutive frames [27]. Also, [65] follows up with the idea introduced in OSVOS and uses the result on the the predicted frames on the whole sequence to further train the network at test time. Previously, and in order to reduce the computational complexity, some works make use of superpixels [6], [17], patches [13], [53], object proposals [48], or the bilateral space [43]. After that, an optimization using one of the previous aggregations of pixels is usually performed; which can consider the full video sequence [43], [48], a subset of frames [17], or only the results in frame n to obtain the mask in n+1 [6], [13], [53]. As part of their pipeline, some of the methods include the computation of optical flow [17], [46], [53], or/and Conditional Random Fields (CRFs) [46] which can considerably reduce their speed. Different from those approaches, OSVOSS is a simpler 3 pipeline which segments each frame independently, and produces more accurate results, while also being significantly faster. FCNs for Segmentation: Segmentation research has closely followed the innovative ideas of CNNs in the last few years. The advances observed in image recognition [22], [32], [58] have been beneficial to segmentation in many forms (semantic [38], [44], instance-level [7], [15], [49], biomedical [56], generic [39], etc.). Many of the current best performing methods are based on a deep CNN architecture, usually pre-trained on ImageNet [57], trainable end-to-end. The idea of dense predictions with CNNs was pioneered by [14] and formulated by [38] in the form of Fully Convolutional Networks (FCNs) for semantic segmentation. The authors noticed that by changing the last fully connected layers to 1 × 1 convolutions it is possible to train on images of arbitrary size, by predicting correspondinglysized outputs. Their approach boosts efficiency over patch-based approaches where one needs to perform redundant computations in overlapping patches. More importantly, by removing the parameter-intensive fully connected layers, the number of trainable parameters drops significantly, facilitating training with relatively fewer labeled data. In most CNN architectures [22], [32], [58], activations of the intermediate layers gradually decrease in size, because of spatial pooling operations or convolutions with a stride. Making dense predictions from downsampled activations results in coarsely localized outputs [38]. Deconvolutional layers that learn how to upsample are used in [44], [69] to recover accurately localized predictions. In [49], activations from shallow layers are gradually injected into the prediction to favor localization. However, these architectures come with many more trainable parameters and their use is limited to cases with sufficient data. Following the ideas of FCNs, Xie and Tu [68] separately supervised the intermediate layers of a deep network for contour detection. The duality between multiscale contours and hierarchical segmentation [1], [50] was further studied by Maninis et al. [40] by bringing CNNs to the field of generic image segmentation. In this work we explore how to train an FCN for accurately localized dense prediction based on very limited annotation: a single segmented frame. Semantic Instance Segmentation: Semantic instance segmentation is a relatively new computer vision task which has recently gained increasing attention. In contrast to semantic segmentation or object detection, the goal of instance segmentation is to provide a segmentation mask for each individual instance. The task was first introduced in [19], where they extract both region and foreground features using the R-CNN [16] framework and region proposals. Then, the features are concatenated and classified by an SVM. Several works [8], [9], [70] following that path have been proposed in recent years. There also exist some approaches based on iteration [33], and recurrent neural networks [55]. The recent best-performing methods use fully convolutional position sensitive architectures [34], or a modified Faster-RCNN [54] pipeline, extended to instance segmentation [21]. In contrast to such class-sensitive methods, in which unseen classes are treated as background, our method is class agnostic, and is able to segment generic objects, given only one annotated example. Using Semantic Information to Aid Other Computer Vision Tasks: Semantic information is a very relevant cue for the human vision system, and some computer vision algorithms leverage it to aid various tasks. [18] improves reconstruction quality by jointly reasoning about class segmentation and 3D reconstruction. Using a similar philosophy, [36] estimates the depth of each pixel in a scene from a single monocular image guided by semantic segmentation, and improves the results significantly. To the best of our knowledge, we are the first ones to apply instance semantic information to the task of object segmentation in videos. Conditional Models: Conditional models prove to be a very powerful tool when the feature statistics are complex. In this way, prior knowledge can be introduced by incorporating a dependency to it. [11] builds a conditional random forest to estimate face landmarks whose classifier is dependent on the pose of head. Similarly, [60] proposes to estimate human pose dependent on torso orientation, or human height, which can be a useful cue for the task of pose estimation. The same also applies to boundary detection, [64] proposes to train a series of conditional boundary detectors, and the detectors are weighted differently during test based on the global context of the test image. In this work, we argue that the feature distribution of foreground and background pixels are essentially different, and so a monolithic classifier for the whole image is bound to be suboptimal. Thus, we utilize the conditional classifier to better model the different distributions. 3 O NE -S HOT V IDEO O BJECT S EGMENTATION (OSVOS) This section describes our algorithm to gradually fine-tune the CNN in order to build a strong appearance model for video object segmentation given the first annotated frame. This was presented in our conference contribution [5]. We will refer to the method as OSVOS, to differentiate it from OSVOSS (Section 4), in which we use semantic instance segmentation as further guiding signal. Let us assume that one would like to segment an object in a video, for which the only available piece of information is its foreground/background segmentation in one frame. Intuitively, one could analyze the entity, create a model, and search for it in the rest of the frames. For humans, this very limited amount of information is more than enough, and changes in appearance, shape, occlusions, etc. do not pose a significant challenge, because we leverage strong priors: first “It is an object,” and then “It is this particular object.” Our method is inspired by this gradual refinement. We train a Fully Convolutional Neural Network (FCN) for the binary classification task of separating the foreground object from the background. We use two successive training steps: First we train on a large variety of objects, offline, to construct a model that is able to discriminate the general notion of a foreground object, i.e. , “It is an object.” Then, at test time, we fine-tune the network for a small number of iterations on the particular instance that we aim to segment, i.e. , “It is this particular object.” The overview of our method is illustrated in Figure 2. 3.1 End-to-end trainable foreground FCN Ideally, we would like our CNN architecture to satisfy the following criteria: (i) Accurately localized segmentation output, as discussed in Section 2, (ii) relatively small number of parameters to train from a limited amount of annotated data, and (iii) relatively fast testing times. We draw inspiration from the CNN architecture of [41], originally used for biomedical image segmentation. It is based on the VGG [58] network, modified for accurately localized 4 1 2 3 Parent Network Pre-trained on ImageNet Trained on DAVIS training set Test Network Fine-tuned on frame 1 of test sequence Results on frame N of test sequence Base Network Fig. 2. Overview of OSVOS: (1) We start with a pre-trained base CNN for image labeling on ImageNet; its results in terms of segmentation, although conform with some image features, are not useful. (2) We then train a parent network on the training set of DAVIS; the segmentation results improve but are not focused on an specific object yet. (3) By fine-tuning on a segmentation example for the specific target object in a single frame, the network rapidly focuses on that target. pixels. P (·) is obtained by applying a sigmoid to the activation of the final layer. In order to handle the imbalance between the two binary classes, Xie and Tu [67] proposed a modified version of the cost function, originally used for contour detection (we drop W for the sake of readability): 1 Foreground Branch Specific object - Less accurate contours 3 Boundary Snapping Snap the foreground mask to accurate contours 2 Lmod = −β Contour Branch X logP (yj =1|X) − (1−β) j∈Y+ Accurate contours - Generic objects X logP (yj =0|X) (1) j∈Y− where β = |Y− |/|Y |. Equation 1 allows training for imbalanced binary tasks [31], [40], [41], [67]. 3.2 Fig. 3. Two-stream FCN architecture: The main foreground branch (1) is complemented by a contour branch (2) which improves the localization of the boundaries (3). dense prediction (Point i). The fully-connected layers needed for classification are removed (Point ii), and efficient image-to-image inference is performed (Point iii). The VGG architecture consists of groups of convolutional plus Rectified Linear Units (ReLU) [?] layers grouped into 5 stages. Between the stages, pooling operations downscale the feature maps as we go deeper into the network. We connect convolutional layers to form separate skip paths from the last layer of each stage (before pooling). Upscaling operations take place wherever necessary, and feature maps from the separate paths are concatenated to construct a volume with information from different levels of detail. We linearly fuse the feature maps to a single output which has the same dimensions as the image, and we assign a loss function to it. The proposed architecture is shown in Figure 3 (1), foreground branch. The pixel-wise cross-entropy loss for binary classification (we keep the notation of Xie and Tu [67]) is in this case defined as: X L (W) = − yj logP (yj =1|X;W)+(1−yj )log (1−P (yj =1|X;W)) j =− X logP (yj =1|X;W) − j∈Y+ X logP (yj =0|X; W) j∈Y− where W are the standard trainable parameters of a CNN, X is the input image, yj ∈ {0, 1}, j = 1, . . . , |X| is the pixel-wise binary label of X , and Y+ and Y− are the positive and negative labeled Training details Offline training: The base CNN of our architecture [58] is pre-trained on ImageNet [57] for image labeling, which has proven to be a very good initialization to other tasks [20], [31], [38], [40], [67], [69]. Without further training, the network is not capable of performing segmentation, as illustrated in Figure 2 (1). We refer to this network as the “base network.” We therefore further train the network on the binary masks of the training set of DAVIS, to learn a generic notion of how to segment objects from their background, their usual shapes, etc. We use Stochastic Gradient Descent (SGD) with momentum 0.9 for 50000 iterations. We augment the data by mirroring and zooming in. The learning rate is set to 10−8 , and is gradually decreased. After offline training, the network learns to segment foreground objects from the background, as illustrated in Figure 2 (2). We refer to this network as the “parent network.” Online training/testing: With the parent network available, we can proceed to our main task (“test network” in Figure 2): Segmenting a particular entity in a video, given the image and the segmentation of the first frame. We proceed by further training (fine-tuning) the parent network for the particular image/groundtruth pair, and then testing on the entire sequence, using the new weights. The timing of our method is therefore affected by two times: the fine-tuning time (once per annotated mask) and the segmentation of all frames (once per frame). In the former we have a trade-off between quality and time: the more iterations we allow the technique to learn, the better results but the longer the user will have to wait for results. The latter does not depend on the training time: OSVOSS is able to segment each 480p frame (480 × 854) in 130 ms. Regarding the fine-tuning time, we present two different modes: One can either need to fine-tune online, by segmenting a 5 Fig. 4. Qualitative evolution of the fine tuning: Results at 10 seconds and 1 minute per sequence. frame and waiting for the results in the entire sequence, or offline, having access to the object to segment beforehand. Especially in the former mode, there is the need to control the amount of time dedicated to training: the more time allocated for finetuning, the more the user waits and the better the results are. In order to explore this trade-off, in our experiments we train for a period between 10 seconds and 10 minutes per sequence. Figure 4 shows a qualitative example of the evolution of the results quality depending on the time allowed for fine-tuning. In the experimental evaluation, Figure 12 quantifies this evolution. Ablation analysis shows that both offline and online training are crucial for good performance: If we perform our online training directly from the base network (ImageNet model), the performance drops significantly. Only dropping the online training for a specific object (using the parent network directly) also yields a significantly worse performance, as already transpired from Figure 2. 3.3 Contour snapping In the field of image classification [22], [32], [58], where our base network was designed and trained, spatial invariance is a design choice: no matter where an object appears in the image, the classification result should be the same. This is in contrast to the accurate localization of the object contours that we expect in (video) object segmentation. Despite the use of skip connections [20], [38], [41], [68] to minimize the loss of spatial accuracy, we observe that OSVOS’ segmentations have some room for improvement in terms of contour localization. To overcome this limitation, we propose a complementary CNN in a second branch that is trained to detect object contours. Figure 3 shows the global architecture: (1) shows the main foreground branch, where the foreground pixels are estimated; (2) shows the contour branch, which detects all contours in the scene (not only those of the foreground object). This allows us to train offline, without the need to fine-tune on a specific example. We used the exact same architecture in the two branches, but training for different losses. We noticed that jointly training a network with shared layers for both tasks rather degrades the results thus we kept the computations for the two objectives uncorrelated. This allows us to train the contour branch only offline and thus it does not affect the online timing. Since there is need for high recall in the contours, we train on the PASCAL-Context [42] database, which provides contour annotations for the full scene of an image. Once we have the estimated object contours, the boundary snapping step (Figure 3 (3), consists of two different steps: a) Superpixel snapping: It computes superpixels that align to the computed contours (branch 2) by means of an Ultrametric Contour Map (UCM) [1], [50], which we threshold at a low strength. We then take a foreground mask (branch 1) and we select superpixels via majority voting (those that overlap with the foreground mask over 50%) to form the final foreground segmentation. b) Contour recovery: It recovers the very thin structures that are lost when snapping to superpixels. It enumerates the connected components of the foreground mask (branch 1), and then matches their contours to the detected contours in branch (2). The connected components whose contour matches the generic contours (branch 2) above a certain tolerance are added to the final result mask. This refinement process results in a further boost in performance, and is fully modular, meaning that depending on the timing requirements one can choose not to use them, sacrificing accuracy for execution time; since the module comes with a small, yet avoidable computational overhead. Please refer to the timing experiments (Figure 12) for a quantitative evaluation of this trade off: at which range of desired speeds one can afford to use contour snapping. 4 S EMANTIC G UIDANCE (OSVOS S ) The motivation behind semantic guidance is to improve the model we construct from the first frame with information about the category of the object and the number of instances, e.g. we track two people and a motorbike. We extract the semantic instance information from instance-aware semantic segmentation algorithms (we experiment with two top-performing methods: MNC [9] and the most recent FCIS [34]). We modify the algorithm and the network architecture to select and propagate the specific instances we are interested in (Section 4.2), and then we adapt the network architecture to include these instance inside the CNN (Section 4.3). The global network overview is first presented in Section 4.1. 4.1 Network Overview Figure 5 illustrates the structure and workflow of the proposed semantic-aware network. Sharing the common base network (VGG) as the feature extractor, three pixel-wise classifiers are jointly learned. The first classifier, First-Round Foreground Estimation, is the original OSVOS head, which is purely appearance based, with no knowledge about the semantic segmentation source and produces the first foreground estimation. The result of that classifier and the information from an external semantic instance segmentation system are combined in the semantic selection and propagation steps (Section 4.2) to produce the top matching instances that we refer to as the semantic prior. The two other classifiers inside the conditional classifier operate on both the features of the common base network and the semantic prior, and are dependent on each other: one is responsible for the pixels with a foreground prior, whereas the other for the background ones. Finally, the two sets of predictions are fused into the final prediction. See Section 4.3. 4.2 Semantic Selection and Semantic Propagation We leverage a semantic instance segmentation algorithm as an input to estimate the semantics of the object to be segmented. Specifically, we choose MNC [9] or FCIS [34] as our input instance segmentation algorithms, and we use their publicly available implementations. We show that using the newest and better performing FCIS over MNC gives a significant boost for the task 6 Classifier Fig. 5. Network architecture overview: Our network is composed of three major components: a base network as the feature extractor, and three classifiers built on top with shared features: a first-round foreground estimator to produce the semantic prior, and two conditional classifiers to model the appearance likelihood. Ground Truth Selected Instances: Person and Motorbike Frame 0 Top Person and Motorbike Instance Segmentation Proposals Semantic Propagation First-Round Instance Segmentation Foreground Estimation Proposals Semantic Selection Frame 18 Frame 24 Frame 30 Frame 36 Fig. 6. Semantic selection and propagation: Illustrative example of the estimation of the semantics of the object from the first frame (semantic selection) and its propagation to the following frames (semantic propagation). of video object segmentation, which suggests that our method is transparent to future improvements in the field. Both MNC and FCIS are multi-stage networks that consist of three major components: shared convolutional layers, region proposal network (RPN), and region-of-interest(ROI)-wise classifiers. We use the available models for both algorithms, which are pre-trained on PASCAL and COCO, respectively. We note that our method is class agnostic, and the objects to segment do not necessarily need to be part of the PASCAL/COCO class vocabulary, as it will be shown in the experiments. The output of the instance segmentation algorithm is given as a set of binary masks, together with their category, and their confidence of being a true object. We search for the object of interest inside the pool of most confident masks: our objective is to find a subset of masks with consistent semantics throughout the video as our semantic prior. The process can be divided into two stages, namely semantic selection and semantic propagation. Semantic selection happens in the first frame, where we select the masks that match the object according to the given ground-truth mask (please note that we are in a semi-supervised framework where the true mask of the first frame is given as input). The number of instances and their categories are what we enforce to be consistent throughout the entire video Figure 6 depicts an example of both steps. Semantic selection, on the left in green, finds that we are interested in a motorbike plus a person (bottom), by overlapping the ground truth (middle) to the instance segmentation proposals (top). There are two cases where semantic selection may fail: a) the objects of interest are not part of the semantic vocabulary of the instance segmenter, and b) the wrong instances are selected by this step. Results show that our classifiers are robust to such failures, preserving high quality outputs in both cases. Thus, a fast greedy search for selecting the instances is sufficient to preserve high performance. The semantic propagation stage (in orange) occurs at the following frames, where we propagate the semantic prior we estimated in the first frame to the following ones. The instance segmentation masks (first row), are filtered using the first-round foreground estimation from the OSVOS head (middle row), and the top matching person and motorbike from the pool are selected (bottom row). In cases that an instance of the selected classes does not overlap with the output of OSVOS, as in cases of occlusions and moving camera, we exclude the particular instance from the semantic prior, for the specific frame. 7 Appearance Likelihood Semantic Prior Result . Foreground classifier Instance foreground . Background classifier Instance backgound Image Fig. 7. Forward pass of the conditional classifier layer: Red denotes foreground probability, and blue background probability. The output is the weighted sum of the two conditional classifier. 4.3 input element is multiplied by its corresponding weight from the weight map, then summed with the corresponding element in the other map:  fout (x, y) = w(x, y) f1 (x, y) + 1−w(x, y) f2 (x, y). (2) Conditional Classifier Dense labeling using fully convolutional networks is commonly formulated as a per-pixel classification problem. It can be therefore understood as a global classifier sliding over the whole image, and assigning either the foreground or background label to each pixel according to a monolithic appearance model. In this work, we want to incorporate the semantic prior to the final classification, which will be given as a mask of the most promising instance (or set of instances) in the current frame. If semantic instance segmentation worked perfectly, we could directly select the best-matching instance to the appearance model, but in reality the results are far from perfect (as we will show in the experiments). We can only, therefore, use the instance segmentation mask as a guidance, or a guess, of what the limits of that instance are, but we still need to perform a refinement step. Our proposed solution to incorporate this mask but still keep the per-pixel classification is to train two classifiers and weigh them according to the confidence we have in that pixel being part of the instance or not. We argue that using a single set of parameters for the whole image is suboptimal. Formally, for each pixel i, we estimate its probability of being a foreground pixel given the image: p(i|I). The probability can be decomposed into the sum of k conditional probabilities weighted by the prior: K X p(i|I) = p(i|I, k) p(k|I). k=1 In our experiments, we use K = 2, and we build two conditional classifiers, one focusing on the instance foreground pixels, and the other focusing on the instance background pixels. The prior term p(k|I) is estimated based on the instance segmentation output. Specifically, a pixel relies more on the instance foreground classifier if it is located within the instance segmentation mask; and more importance is given to the instance background classifier if it falls out of the instance segmentation mask. In our experiments, we apply a Gaussian filter to spatially smooth the selected masks as our semantic prior. The conditional classifier is implemented as a layer which can be easily integrated in the network in a end-to-end trainable manner. The layer takes two prediction maps f1 and f2 and the weight maps p(k|I) which come from the semantic selection. Without loss of generality, we will assume that k = 1 corresponds to the foreground of the semantic prior. For convenience, we set w = p(k = 1|I), and in our case 1−w = p(k = 2|I) (background prior). The inference process is illustrated in Figure 7, where each Equation 2 suggest that the decision for the pixels near the selected instances are made by the instance foreground classifier (f1 (x, y)), whereas the instance background classifier (f2 (x, y)) decides for the rest of the pixels. Similarly, in the back-propagation step, the gradient from the top gtop is propagated to the two parts according to the weight map: g1 (x, y) = w(x, y) gtop (x, y)  g2 (x, y) = 1 − w(x, y) gtop (x, y). The conditional classifier is necessary to incorporate the semantic prior information, in order to make softer decisions. Techniques that can be used as alternatives incorporating only a single classifier, such as masking of the features by the semantic prior, lead to hard decisions guided by the semantics, unable to recover in regions where they are wrong. For example, in Figure 7, the left hand of the dancer is not detected by the semantic prior, and it will be immediately classified as background in the case of feature masking. The background classifier of our proposed method, however, is able to recover the region, correctly classifying it as a foreground. 4.4 Training and Inference We follow the same ideas as OSVOS to train and test the network, every step enriched with the semantic selection and propagation steps. The parent network is trained using semantic instances that overlap with the ground-truth masks of the DAVIS training set. Similarly, during online fine-tuning we use the label of the first frame, as well as the outputs of the OSVOS head for the next ones. As was done before, each frame is processed independently of the others. As shown in the experiments, the plug-in of the instance segmentation module dramatically improves the quality of the final segmentation. 5 E XPERIMENTAL VALIDATION Experimental Setup: We will mainly work on the DAVIS database [47], using their proposed metrics: region similarity (intersection over union J ), contour accuracy (F measure), and temporal instability (T ). The dataset contains 50 full-HD annotated video sequences, 30 in the training set and 20 in the validation set. All our results will be trained on the former, evaluated on the latter. As a global comparison metric we will use the mean between J and F , as proposed in the DAVIS 2017 challenge [51]. We compare against a large body of very recent semisupervised state-of-the-art techniques (OnAVOS [65], MSK [46], CTN [29], VPN [27], OFL [63], BVS [43], and FCP [48]) using the pre-computed results provided by the respective authors. For context, we also add the results of the latest unsupervised techniques (ARP [30], FSEG [24], LMP [62], FST [45], NLC [12], MSG [4]). For completeness, we also experiment on the Youtube-objects dataset [25], [52] against those techniques with public segmentation results (OnAVOS [65], OSVOS [5], MSK [46], OFL [63], BVS [43]). We do not take pre-computed evaluation results directly from the paper tables because the benchmarking algorithm is not consistent among the different authors. 8 (a) Cow (b) Dog (c) Person, bicycle (d) Person, surfboard (e) Person, backpack (f) Person, horse (g) Horse (h) Cow (i) Person, person, bench (j) Person, person Fig. 8. Semantic selection evaluation: Semantic instances selected by the semantic selection step, with its category overlaid. We observe that in some cases either the semantic labels (h-i) or the number of instances (j) is incorrect. The final results, however, are robust to such mistakes. Measure J F T Mean M ↑ Recall O ↑ Decay D ↓ Mean M ↑ Recall O ↑ Decay D ↓ Mean M ↓ ImageNet +OneShot 17.6 2.3 1.8 20.3 2.4 2.4 46.0 64.6 70.5 27.8 66.7 74.4 26.4 60.9 47.0 68.2 26.0 46.4 72.0 24.0 14.9 +Parent +Semantics +Superpixels +Contours 77.4 91.0 17.4 78.1 92.0 19.4 33.5 84.4 96.4 7.5 85.8 95.7 10.2 23.3 12.8 20.5 10.4 11.4 17.6 7.0 27.4 7.0 5.4 9.9 7.7 3.7 9.2 10.2 85.3 96.5 5.5 84.4 93.7 6.8 26.6 0.9 0.0 2.0 1.4 2.0 3.4 3.3 85.6 96.8 5.4 86.4 96.1 8.3 24.6 0.2 0.3 0.1 1.9 2.4 1.5 2.0 TABLE 1 Ablation study on DAVIS: From a network pretrained on ImageNet, all improvement steps to the proposed OSVOSS (right-most column). Numbers in italics show how much the results improve (in blue) or worsen (in red) in that metric with respect to the previous column. Ablation Study: Table 1 shows how much each of the improvements presented builds up to the final result. We start by evaluating the network using only ImageNet pre-trained weights, before including any further training to the pipeline. The results in terms of segmentation (J = 17.6%) are completely random (as visually shown in Figure 2). Fine-tuning on the mask of the first frame already boosts the results to competitive levels (+OneShot). By pre-training the parent model, we allow finetuning to start from a much more meaningful set of weights, from a problem closer to the final one, so performance increases by 12% (+Parent). Adding semantics and the conditional classifier (+Semantics) plays an important role both in terms of regions and contours (J and F ), but especially on temporal stability (T ). Snapping to superpixels (+Superpixels) and recovering the contours (+Contours) improves the results around a point overall, the former especially in terms of J , the latter in terms of F , as it stands to reason. Semantic Selection and Propagation: Figure 8 qualitatively evaluates the semantic-selection algorithm: it displays the selected semantic instances on the first frame of eight example videos. Examples (a) and (b) show correct detections in terms of category when a single instance is present. Results (c) to (f) show that the algorithm works also in terms of the quantity of instances when more than one of them is needed. Images (g) to (i) display cases where the category of the object is not present in MS COCO [35] (on which the instance segmentation algorithm was trained), so the closest semantic match is used instead. Please note that the precise category is not needed for our algorithm to work, as long as that category is consistent throughout the video (e.g. as long as the camel is always detected as a cow). Last image (j) shows a failure case where two persons are detected when just a single one (albeit upside down) is present, but the algorithm is afterwards robust to this mistake. Measure Mean M ↑ J Recall O ↑ Decay D ↓ Mean M ↑ F Recall O ↑ Decay D ↓ T Mean M ↓ Semantic-MNC Automatic Oracle 68.9 85.5 3.3 58.5 63.0 3.0 30.5 70.1 87.8 3.5 59.5 66.2 4.2 33.0 Semantic-FCIS Automatic Oracle 74.3 88.4 1.9 71.9 82.8 3.0 24.8 76.4 92.0 1.8 73.7 87.2 3.2 23.9 OSVOSS 85.6 96.8 5.4 86.4 96.1 8.3 24.6 TABLE 2 Semantic propagation: Comparing the automatic selection of instances against an oracle and our final result. Once the semantic selection is done, this information is propagated throughout the video. Table 2 quantitatively evaluates this step by comparing our automatic selection of instances against an oracle that selects the best instance in each frame independently. We use two different instance segmentation algorithms (MNC [9] and FCIS [7]). The results show that in both cases our automatic selection gets very close to the oracle selection (best possible instance), so we are not losing much quality in this step; and this is so in both instance segmentation algorithms, showing that we are robust to the particular algorithm used and so we will be able to incorporate future improvements in this front. The last column shows our final result, which significantly improves the oracle selection, so instance segmentation alone is not enough, as already pointed out in previous sections. Comparison to State of the Art in DAVIS: Table 3 shows the comparison of OSVOSS and OSVOS against a large set of very recent video segmentation algorithms, semi-supervised (using the first segmented frame as input) and unsupervised (only the raw video as input). Apart from the standard metrics of DAVIS [47], 9 Semi-Supervised OSVOSS Measure J &F J F T Mean M ↑ Mean M ↑ Recall O ↑ Decay D ↓ Mean M ↑ Recall O ↑ Decay D ↓ Mean M ↓ OnAVOS OSVOS 86.0 85.6 96.8 5.4 86.4 96.1 8.3 24.6 85.5 86.1 96.1 5.2 84.9 89.7 5.8 19.0 80.2 79.8 93.6 14.9 80.6 92.6 15.0 37.8 Unsupervised MSK CTN VPN OFL BVS 77.5 79.7 93.1 8.9 75.4 87.1 9.0 21.8 65.7 68.0 75.6 26.4 63.4 70.4 27.2 22.2 71.4 73.5 87.4 15.6 69.3 79.6 12.9 22.0 67.8 70.2 82.3 12.4 65.5 69.0 14.4 32.4 FCP 59.4 53.8 60.0 58.4 66.9 71.5 28.9 −2.0 58.8 49.2 67.9 49.5 21.3 −1.1 34.7 30.6 Bound ARP FSEG LMP NLC FST MSG COB|SP 73.4 76.2 91.1 7.0 70.6 83.5 7.9 39.3 53.4 55.8 64.9 0.0 51.1 51.6 2.9 36.6 52.1 53.3 61.6 2.4 50.8 60.0 5.1 30.1 86.8 86.5 96.5 2.8 87.1 92.4 2.3 27.9 68.0 70.7 83.5 1.5 65.3 73.8 1.8 32.8 67.9 70.0 85.0 1.3 65.9 79.2 2.5 57.2 53.7 55.1 55.8 12.6 52.3 51.9 11.4 42.5 TABLE 3 DAVIS Validation: OSVOSS versus the state of the art (both semi- and un-supervised, and a practical bound. 1 .9 OSVOSS (Ours) OnAVOS [65] OSVOS (Ours) MSK [46] CTN [29] VPN [27] OFL [63] BVS [43] FCP [48] .8 .7 .6 .5 .4 .3 .2 .1 0 S Car- w ut an hado undabo lacksw B Ro Car- Cow s el Cam Dog our ight Park ift-Stra Dr t e h Goa Hig ican mpt-Ch seju Drif Hor k y ce wirl oapbox ite-Surf ump x-Trees Launch Libb ter-Blac kdan ss-J ce-T S K o Bm ingBrea otocro Dan Sco glid M Para Fig. 9. DAVIS Validation: Per-sequence results of mean region similarity (J ) and contour accuracy (F ). we also add the most recent mean between J and F , as used in the 2017 DAVIS Challenge [51]. OSVOSS is the best performing technique overall, half point above the second semi-supervised technique and 12.6 points above the best unsupervised one. Last column shows the best result one could obtain from picking superpixels from COB [39], [40], a state-of-the-art generic image segmentation algorithm, at a very fine scale. OSVOSS is only 0.8 points below this value, further highlighting the outstanding quality of our results. Next we break down the performance on DAVIS per sequence. Figure 9 shows the previous state-of-the-art techniques in bars, and OSVOSS result using a line; sorted by the difficulty of the sequence for our technique. We see that we outperform the majority of algorithms in the majority of sequences, especially so in the more challenging ones (e.g. Kite-Surf, Bmx-Trees). Please also note that OSVOSS results are above 75% in all but one sequence (BmxTrees at 50%), which highlights the robustness of the approach. Table 4 shows the per-attribute comparison in DAVIS, that is, the mean results on a subset of sequences where a certain challenging attribute is present (e.g. camera shake or occlusions). The increase of performance when each attribute is not present (small numbers in italics) is significantly low, which shows that OSVOSS is very also robust to the different challenges. Number of training images (parent network): To evaluate how many annotated data are needed to retrain a parent network, Table 5 shows the performance of OSVOSS when using a subset of the DAVIS training set. We directly used the output of the CNN, without snapping, for efficiency. We randomly selected a fixed percentage of the annotated frames in each video, and evaluated using the Region Similarity (J ) metric. We conclude that by using only ~200 annotated frames, we are able to reach almost the same performance than when using the full DAVIS training split. Thus, we therefore do not require full video annotations for the training procedure, that are often expensive to acquire. Even more, since our method is by definition disregarding temporal information, it is natural that the training data do not require to Attr OSVOSS OnAVOS OSVOS LR SV FM CS DB MB OCC OV 84.9 82.3 83.6 87.1 78.0 81.4 81.9 84.2 86.4 83.3 83.4 86.4 76.4 81.3 82.4 83.0 77.2 74.3 76.5 78.4 74.3 73.7 77.2 71.7 0.8 5.4 3.0 −2.4 8.9 7.6 5.2 1.7 −0.4 4.8 4.2 −0.4 11.5 8.8 5.3 3.9 MSK 3.5 9.1 5.1 2.2 6.5 11.0 3.7 10.0 76.3 73.6 74.8 77.4 74.1 73.4 75.5 71.3 4.6 10.2 7.6 3.6 6.6 11.4 6.0 10.5 CTN 66.8 63.7 65.1 72.4 62.7 67.6 70.2 67.4 9.0 16.3 12.9 1.7 12.7 10.7 4.7 7.7 VPN 57.9 60.6 59.4 70.8 44.4 64.8 71.2 61.3 16.4 16.0 16.5 −1.0 30.4 9.8 −1.5 11.1 OFL 45.9 53.2 49.6 65.2 44.3 55.5 67.3 50.1 29.5 24.7 28.2 4.3 27.9 22.8 1.0 22.3 TABLE 4 Attribute-based performance: Impact of the attributes of the sequences on the results. For each attribute, results on the sequences with that particular feature and the gain with respect to those on the set of sequences without the attribute. LR stands for low resolution, SV for scale variation, FM for fast motion, CS for camera shake, DB for dynamic background, MB for motion blur, OCC for occlusions, and OV for object out of view. Training data 100 200 600 1000 2079 Quality (J ) 81.3 83.8 84.2 84.3 84.4 TABLE 5 Amount of training data: Region similarity (J ) as a function of the number of training images for the parent network of OSVOSS . Full DAVIS training set is 2079 training data. be temporally coherent. Misclassified-Pixels Analysis: Figure 10 shows the error analysis of our method. We divide the misclassified pixels in three categories: Close False Positives (FP-Close), Far False Positives (FP-Far) and False Negatives (FN): (i) FP-Close are those near the contour of the object of interest, so contour inaccuracies, (ii) FP-Far reveal if the method detects other objects or blobs apart from the object of interest, and (iii) FN tell us if we miss a part of the object during the sequence. The measure in the plot is the percentage of pixels in a sequence that fall in a certain category. The main strength of OSVOSS compared to OSVOS and MSK is considerably reducing the number of false negatives. We believe 10 0.9 MSK OSVOS Mean J OSVOSS OnAVOS 0 0.5 FP-Close 1 1.5 FP-Far 0.8 2 OSVOSS OnAVOS OSVOS MSK FN 0.7 Fig. 10. Error analysis of our method: Errors divided into False Positives (FP-Close and FP-Far) and False Negatives (FN). Values are percentage (%) of FP-Close, FP-Far or FN pixels in a sequence. 10 20 30 40 50 60 70 80 Percentage of the sequence frames (%) 90 100 Fig. 11. Decay of the quality with time: Performance of various methods with respect to the time axis. Performance (J &F ) this is due to OSVOSS ’s ability to complete the object of interest when parts that were occluded in the first frame become visible, thanks to the semantic concept of instance. On the other hand, the output of the instance segmentation network that we are currently using, FCIS [7], is not very precise on the boundaries of the objects, and even though our conditional classifier is able to recover in part, FP-Close is slightly worse than that of the competition. On the plus side, since the instance segmentation is an independent input to our algorithm, we will probably directly benefit from better instance segmentation algorithms. Performance Decay: As indicated by the J -Decay and F -Decay values in Table 3, OSVOSS exhibits a better ability than OSVOS and MSK to maintain performance as frames evolve, and we interpret that this is so thanks to the injected semantic prior. The performance decay is similar to that of OnAVOS, even though it performs a costly iterative algorithm which fine-tunes the result to various frames of the sequence. Our method, on the other hand, uses the information of the first frame only, and keeps the quality throughout the sequence. To further highlight this result and analyze it more in detail, Figure 11 shows the evolution of J as the sequence advances, to examine how the performance drops over time. Since the videos in DAVIS are of different length, we normalize them to [0, 100] as a percentage of the sequence length. We then compute the mean J curve among all video sequences. As it can be seen from Figure 11, our method is significantly more stable in terms of performance drop compared to OSVOS and MSK, and has a similar curve than OnAVOS. We also report the lowest point of the curve which indicates the worst performance across the video. Based on this metrics, OSVOSS is at 82.0, while for semantic-blind methods, the numbers are 81.0, 73.7, and 69.8. The results therefore confirm that the semantic prior we introduce can mitigate the performance drop caused by appearance change, while maintaining high fidelity in details. The semantic information is particularly helpful in the later stage of videos where dramatic appearance changes with respect to the first frame are more probable. Speed: The computational efficiency of video object segmentation is crucial for the algorithms to be usable in practice. OSVOSS can adapt to different timing requirements, providing progressively better results the more time we can afford, by letting the fine-tuning algorithm at test time do more or fewer iterations. As introduced before, OSVOSS ’s time can be divided into the fine-tuning time plus the time to process each frame 0 OSVOSS No Snapping No Semantic OnAVOS [65] MSK [46] VPN [27] CTN [29] OFL [63] BVS [43] .8 .7 .6 .1 1 Time per frame (s) 10 Fig. 12. Quality versus timing: J &F with respect to the processing time per frame. independently. To compare to other techniques, we will evaluate the mean computing time per frame: fine-tuning time (done once per sequence) averaged over the length of that sequence, plus the forward pass on each frame. Figure 12 shows the quality of the result with respect to the time it takes to process each 480p frame. Our techniques ), without boundary are represented by curves: OSVOSS ( snapping ( ), and without semantics ( ), which show the gain in quality with respect to the fine-tuning time. The best results come at the price of adding the semantics or the snapping cost, so depending on the needed speed, one of the three modes can be chosen. Dashed lines represent the regimes of each technique that are not in the Pareto front, i.e. where it is better to choose another mode within our techniques (faster for the same quality or best quality for the same speed). Since OSVOSS processes frames independently, one could also perform the fine-tuning offline, by training on a picture of the object to be segmented beforehand (e.g. take a picture of a sports player before a match). In this scenario, OSVOSS can process each frame by one forward pass of the CNN ( | | ), and so be considerably fast. Compared to other techniques, our techniques are faster and/or more accurate at all regimes, from fast modes: 74.7 versus 59.4 of BVS ( ) at 400 miliseconds, to high-quality regimes: same performance than OnAVOS ( ) but an order of magnitude faster (2.5 versus 12 seconds). The trade-off between performance and speed in video object segmentation has been largely ignored 11 Category OSVOS S OnAVOS OSVOS MSK OFL BVS Aeroplane Bird Boat Car Cat Cow Dog Horse Motorbike Train 91.1 88.0 82.6 87.1 81.6 78.3 83.0 71.6 76.3 85.8 87.7 85.7 78.5 86.1 80.5 77.9 80.8 72.1 72.0 84.0 88.2 85.7 77.5 79.6 70.8 77.8 81.3 72.8 73.5 75.7 86.0 85.6 78.8 78.8 70.1 77.7 79.2 71.7 65.6 83.5 89.9 84.2 74.0 80.9 68.3 79.8 76.6 72.6 73.7 76.3 86.8 80.9 65.1 68.3 55.8 69.9 68.0 58.9 60.5 65.2 Mean 82.5 80.5 78.3 77.7 77.6 67.9 TABLE 6 Youtube-Objects evaluation: Per-category and overall mean intersection over union (J ). changes of the object and in practice helps in keeping the quality throughout a longer period of the video. The appearance model is combined with the semantic prior by means of a new conditional classifier as a trainable module in a CNN. ACKNOWLEDGMENTS Research funded by the EU Framework Programme for Research and Innovation Horizon 2020 (Grant No. 645331, EurEyeCase), and by the Swiss Commission for Technology and Innovation (CTI, Grant No. 19015.1 PFES-ES, NeGeVA). The authors gratefully acknowledge support by armasuisse and thank NVidia Corporation for donating the GPUs used in this project. R EFERENCES (or purposely hidden) in the literature although we believe it is of critical importance, and so we encourage future research to evaluate their methods in this performance-vs-speed plane. Comparison to State of the Art in Youtube-Objects: For completeness, we also do experiments on Youtube-objects [25], [52], without changing any parameter from our algorithm nor retraining the parent network. Table 6 shows the results of the quantitative evaluation against the rest of techniques. OSVOSS obtains the best results overall, being two points better than the runner up; and having the best results in eight out of ten categories. These experiments show the robustness and generality of our approach even to domain (dataset) shifts. Qualitative Results: Figure 13 and Figure 14 show some qualitative results of OSVOSS in DAVIS and Youtube-Objects, respectively. The first column shows the ground-truth mask used as input to our algorithm (in red). The rest of the columns show our segmented results in the following frames. These visual results qualitatively corroborate the robustness of our approach to occlusions, dynamic background, change of appearance, etc. 6 C ONCLUSIONS This paper presents Semantic One-Shot Video Object Segmentation (OSVOSS ), a semi-supervised video object segmentation technique that processes each frame independently and thus ignores the temporal information and redundancy of a video sequence. This has the inherent advantage of being robust to object occlusions, lost frames, etc, while keeping execution speed low. OSVOSS shows state-of-the-art results in both DAVIS and Youtube-Objects at the whole range of operating speeds. It is significantly faster and/or better performing than the competition: 74.7 versus 59.4 at 400 miliseconds per frame, or 2.5 versus 12 seconds at the best performance (86 vs 85.5). To do so, we build a powerful appearance model of the object from a single segmented frame. In contrast to most deep learning approaches, that often require a huge amount of training data in order to solve a specific problem, and in line with humans, that can solve similar challenges with only a single training example; we demonstrate that OSVOSS can reproduce this capacity of oneshot learning in a machine: Based on a parent network architecture pre-trained on a generic video segmentation dataset, we fine-tune it on merely one training sample. OSVOSS also leverages an instance segmentation algorithm that provides a semantic prior to guide the appearance model computed on the first frame. This adds robustness to appearance [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] P. Arbeláez, M. Maire, C. Fowlkes, and J. Malik. Contour detection and hierarchical image segmentation. TPAMI, 33(5):898–916, 2011. 3, 5 G. Bertasius, J. Shi, and L. Torresani. High-for-low and low-forhigh: Efficient boundary detection from deep object features and its applications to high-level vision. In ICCV, 2015. 1 G. Bertasius, J. Shi, and L. Torresani. Semantic segmentation with boundary neural fields. In CVPR, 2016. 1 T. Brox and J. Malik. Object segmentation by long term analysis of point trajectories. In ECCV, 2010. 1, 7 S. Caelles, K.-K. Maninis, J. Pont-Tuset, L. Leal-Taixé, D. Cremers, and L. Van Gool. One-shot video object segmentation. In CVPR, 2017. 3, 7 J. Chang, D. Wei, and J. W. Fisher III. A video representation using temporal superpixels. In CVPR, 2013. 2 J. Dai, K. He, Y. Li, S. Ren, and J. Sun. Instance-sensitive fully convolutional networks. In ECCV, 2016. 2, 3, 8, 10 J. Dai, K. He, and J. Sun. Convolutional feature masking for joint object and stuff segmentation. In CVPR, 2015. 3 J. Dai, K. He, and J. Sun. Instance-aware semantic segmentation via multi-task network cascades. In CVPR, 2016. 2, 3, 5, 8 J. Dai, Y. Li, K. He, and J. Sun. R-FCN: Object detection via regionbased fully convolutional networks. In NIPS, 2016. 2 M. Dantone, J. Gall, G. Fanelli, and L. Van Gool. Real-time facial feature detection using conditional regression forests. In CVPR, 2012. 3 A. Faktor and M. Irani. Video segmentation by non-local consensus voting. In BMVC, 2014. 7 Q. Fan, F. Zhong, D. Lischinski, D. Cohen-Or, and B. Chen. Jumpcut: Non-successive mask transfer and interpolation for video cutout. ACM Trans. Graph., 34(6), 2015. 2 C. Farabet, C. Couprie, L. Najman, and Y. LeCun. Learning hierarchical features for scene labeling. TPAMI, 35(8):1915–1929, 2013. 2, 3 R. Girshick. Fast R-CNN. In ICCV, 2015. 1, 3 R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. 1, 3 M. Grundmann, V. Kwatra, M. Han, and I. A. Essa. Efficient hierarchical graph-based video segmentation. In CVPR, 2010. 1, 2 C. Hane, C. Zach, A. Cohen, R. Angst, and M. Pollefeys. Joint 3d scene reconstruction and class segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 97–104, 2013. 3 B. Hariharan, P. Arbeláez, R. Girshick, and J. Malik. Simultaneous detection and segmentation. In ECCV, 2014. 3 B. Hariharan, P. Arbeláez, R. Girshick, and J. Malik. Hypercolumns for object segmentation and fine-grained localization. In CVPR, 2015. 2, 4, 5 K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask R-CNN. In ICCV, 2017. 2, 3 K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. 1, 3, 5 H. V. Hopwood. Living Pictures: Their History, Photo-Production and Practical Working. Optician & Photographic Trades Review, 1899. 1 S. Jain, B. Xiong, and K. Grauman. Fusionseg: Learning to combine motion and appearance for fully automatic segmentation of generic objects in videos. In CVPR, 2017. 7 S. D. Jain and K. Grauman. Supervoxel-consistent foreground propagation in video. In ECCV, 2014. 2, 7, 11 V. Jampani, R. Gadde, and P. V. Gehler. Video propagation networks. In CVPR, 2017. V. Jampani, R. Gadde, and P. V. Gehler. Video propagation networks. In CVPR, 2017. 2, 7, 9, 10 Bmx-Trees Breakdance Soapbox Camel Car-Roundabout Horsejump-High Libby Kite-Surf Motocross-Jump Drift-Chicane 12 Fig. 13. Qualitative results on DAVIS: OSVOSS results on a variety of representatives sequences. The input to our algorithm is the ground truth of the first frame (red). Outputs of all frames (green) are produced independent of each other. Motorbike Boat Cow Aeroplane Cat Car 13 Fig. 14. Qualitative results on Youtube-Objects: OSVOSS results on a variety of representatives sequences. The input to our algorithm is the ground truth of the first frame (red). Outputs of all frames (green) are produced independent of each other. [28] W.-D. Jang and C.-S. Kim. Online video object segmentation via convolutional trident network. In CVPR, 2017. 1 [29] W.-D. Jang and C.-S. Kim. Online video object segmentation via convolutional trident network. In CVPR, 2017. 2, 7, 9, 10 [30] Y. Koh and C.-S. Kim. Primary object segmentation in videos based on region augmentation and reduction. In CVPR, 2017. 7 [31] I. Kokkinos. Pushing the boundaries of boundary detection using deep learning. In ICLR, 2016. 1, 4 [32] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. 1, 3, 5 [33] K. Li, B. Hariharan, and J. Malik. Iterative instance segmentation. In CVPR, pages 3659–3667, 2016. 3 [34] Y. Li, H. Qi, J. Dai, X. Ji, and Y. Wei. Fully convolutional instance-aware semantic segmentation. In CVPR, 2017. 2, 3, 5 [35] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. Zitnick. Microsoft COCO: Common Objects in Context. In ECCV, 2014. 8 [36] B. Liu, S. Gould, and D. Koller. Single image depth estimation from predicted semantic labels. In CVPR, 2010. 3 [37] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, and S. Reed. SSD: Single shot multibox detector. In ECCV, 2016. 1 [38] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. 2, 3, 4, 5 [39] K. Maninis, J. Pont-Tuset, P. Arbeláez, and L. V. Gool. Convolutional oriented boundaries: From image segmentation to high-level tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2017. 1, 3, 9 [40] K. Maninis, J. Pont-Tuset, P. Arbeláez, and L. Van Gool. Convolutional oriented boundaries. In ECCV, 2016. 3, 4, 9 [41] K. Maninis, J. Pont-Tuset, P. Arbeláez, and L. Van Gool. Deep retinal image understanding. In MICCAI, 2016. 2, 3, 4, 5 [42] R. Mottaghi, X. Chen, X. Liu, N.-G. Cho, S.-W. Lee, S. Fidler, R. Urtasun, and A. Yuille. The role of context for object detection and semantic segmentation in the wild. In CVPR, 2014. 5 [43] N. Nicolas Märki, F. Perazzi, O. Wang, and A. Sorkine-Hornung. Bilateral space video segmentation. In CVPR, 2016. 2, 7, 9, 10 [44] H. Noh, S. Hong, and B. Han. Learning deconvolution network for semantic segmentation. In ICCV, 2015. 2, 3 [45] A. Papazoglou and V. Ferrari. Fast object segmentation in unconstrained video. In ICCV, 2013. 7 [46] F. Perazzi, A. Khoreva, R. Benenson, B. Schiele, and A.SorkineHornung. Learning video object segmentation from static images. In CVPR, 2017. 1, 2, 7, 9, 10 [47] F. Perazzi, J. Pont-Tuset, B. McWilliams, L. Van Gool, M. Gross, and A. Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In CVPR, 2016. 2, 7, 8 [48] F. Perazzi, O. Wang, M. Gross, and A. Sorkine-Hornung. Fully connected object proposals for video segmentation. In ICCV, 2015. 2, 7, 9 [49] P. O. Pinheiro, T.-Y. Lin, R. Collobert, and P. Dollár. Learning to refine object segments. In ECCV, 2016. 3 [50] J. Pont-Tuset, P. Arbeláez, J. T. Barron, F. Marques, and J. Malik. Multiscale combinatorial grouping for image segmentation and object proposal generation. TPAMI, 2017. 3, 5 [51] J. Pont-Tuset, F. Perazzi, S. Caelles, P. Arbeláez, A. Sorkine-Hornung, and L. Van Gool. The 2017 DAVIS challenge on video object segmentation. arXiv:1704.00675, 2017. 7, 9 [52] A. Prest, C. Leistner, J. Civera, C. Schmid, and V. Ferrari. Learning object class detectors from weakly annotated video. In CVPR, 2012. 2, 7, 11 [53] S. A. Ramakanth and R. V. Babu. Seamseg: Video object segmentation using patch seams. In CVPR, 2014. 1, 2 [54] S. Ren, K. He, R. Girshick, and J. Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In NIPS, 2015. 3 [55] B. Romera-Paredes and P. H. S. Torr. Recurrent instance segmentation. In ECCV, 2016. 3 [56] O. Ronneberger, P. Fischer, and T. Brox. U-Net: Convolutional networks 14 for biomedical image segmentation. In MICCAI, 2015. 3 [57] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. IJCV, 2015. 2, 3, 4 [58] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. 1, 3, 4, 5 [59] S. Stampfer. Die stroboscopischen Scheiben; oder, Optischen Zauberscheiben: Deren Theorie und wissenschaftliche Anwendung. 1833. 1 [60] M. Sun, P. Kohli, and J. Shotton. Conditional regression forests for human pose estimation. In CVPR, 2012. 3 [61] A. M. Tekalp. Digital video processing. Prentice Hall Press, 2015. 1 [62] P. Tokmakov, K. Alahari, and C. Schmid. Learning motion patterns in videos. In CVPR, 2017. 7 [63] Y.-H. Tsai, M.-H. Yang, and M. J. Black. Video segmentation via object flow. In CVPR, 2016. 1, 7, 9, 10 [64] J. R. Uijlings and V. Ferrari. Situational object boundary detection. In CVPR, 2015. 3 [65] P. Voigtlaender and B. Leibe. Online adaptation of convolutional neural networks for video object segmentation. In BMVC, 2017. 2, 7, 9, 10 [66] Y. Wang, Y.-q. Zhang, and J. Ostermann. Video Processing and Communications. Prentice Hall PTR, Upper Saddle River, NJ, USA, 1st edition, 2001. 1 [67] S. Xie and Z. Tu. Holistically-nested edge detection. In ICCV, 2015. 1, 2, 4 [68] S. Xie and Z. Tu. Holistically-nested edge detection. International Journal of Computer Vision, pages 1–16, 2017. 3, 5 [69] J. Yang, B. Price, S. Cohen, H. Lee, and M.-H. Yang. Object contour detection with a fully convolutional encoder-decoder network. In CVPR, 2016. 2, 3, 4 [70] S. Zagoruyko, A. Lerer, T.-Y. Lin, P. O. Pinheiro, S. Gross, S. Chintala, and P. Dollár. A multipath network for object detection. arXiv preprint arXiv:1604.02135, 2016. 3
1cs.CV
arXiv:1607.07380v2 [math.AC] 27 Jul 2016 POWERS OF SUMS AND THEIR HOMOLOGICAL INVARIANTS HOP D. NGUYEN AND THANH VU Dedicated to the memory of Diana Taylor (1941–2016) Abstract. Let R and S be standard graded algebras over a field k, and I ⊆ R and J ⊆ S homogeneous ideals. Denote by P the sum of the extensions of I and J to R ⊗k S. We investigate several important homological invariants of powers of P based on the information about I and J, with focus on finding the exact formulas for these invariants. Our investigation exploits certain Tor vanishing property of natural inclusion maps between consecutive powers of I and J. As a consequence, we provide fairly complete information about the depth and regularity of powers of P given that R and S are polynomial rings and either char k = 0 or I and J are generated by monomials. 1. Introduction Let R be a standard graded algebra over a field k, i.e. R is a noetherian N-graded ring with R0 = k and R is generated as an algebra over k by elements of degree 1. Let m be the unique graded maximal ideal of R and I ⊆ m a homogeneous ideal of R. Studying the asymptotic behavior of the algebraic invariants associated to I has been an important problem and has attracted much attention of commutative algebraists and algebraic geometers. A classical result states that the Hilbert–Samuel function associated to any m-primary ideal is eventually a polynomial function. Another well–known result due to Brodmann [6] establishes, for s ≫ 0, that depth I s is a constant depending only on I. In another direction, by results due to Cutkosky, Herzog, Kodiyalam, N.V. Trung and Wang [16, 38, 49], the Castelnuovo–Mumford regularity reg I s is a linear function of s for s ≫ 0. By definition, for a finitely generated graded R-module M , i its Castelnuovo–Mumford regularity is reg M = sup{i + j : Hm (M )j 6= 0} where i Hm (M ) denotes the ith local cohomology of M with support in m. For more information on asymptotic properties of powers of ideals, see, e.g., [5, 9, 10, 11, 20, 21, 27, 39, 46] and their references. In this paper, we study several homological invariants of powers of sums of ideals. In detail, let R and S be standard graded k-algebras, I and J non-zero, proper homogeneous ideals of R and S, respectively. Denote by P the sum I + J ⊆ T = R ⊗k S, where I and J are regarded as ideals of T . To avoid lengthy phrases later on, we call P the mixed sum of I and J. We consider the problem of characterizing (asymptotically) the homological invariants of powers of P , including the projective dimension, regularity, in terms of the data of I and J. Besides the 2010 Mathematics Subject Classification. 13D02, 13C05, 13D05, 13H99. Key words and phrases. Powers of ideals; sum of ideals; depth; regularity; Castelnuovo– Mumford regularity, linearity defect. This work is partially supported by the NSF grant DMS-1103176. 1 2 HOP D. NGUYEN AND THANH VU theory of asymptotic homological algebras of powers of ideals, another source of our motivation comes from recent work of Hà, N.V. Trung and T.N. Trung [25] on the depth and regularity of powers of P in the case R and S are polynomial rings. While influenced by the last paper, the method of this paper is conceptually more transparent and yields more precise results under reasonable assumptions. Our method makes substantial use of Betti splittings, first introduced by Francisco, Hà and Van Tuyl [23] in their study of free resolutions of monomial ideals. One of the main findings of this paper is that Betti splittings are ubiquitous and most relevant to study all the powers of mixed sums. The decomposition of P as I + J is probably the easiest example of a Betti splitting: letting βi (I) = dimk TorR i (k, I) be the ith Betti number of I, then the formula βi (P ) = βi (I) + βi (J) + βi−1 (I ∩ J) holds for any i ≥ 0. These equations define Betti splittings in general and allow us to give a fairly complete understanding of the depth and regularity of the powers of P . We can prove, rather surprisingly, that the inequalities for depth T /P s and reg T /P s in [25, Theorem 2.4] are both equalities under certain conditions. Theorem 1.1. Let R and S be polynomial rings over k. Suppose that either char k = 0 or I and J are monomial ideals. Then for any s ≥ 1, there are equalities (i) depth T /P s =  min depth R/I s−i + depth S/J i + 1, depth R/I s−j+1 + depth S/J j , i∈[1,s−1],j∈[1,s] (ii) reg T /P s = max i∈[1,s−1],j∈[1,s]  reg R/I s−i + reg S/J i + 1, reg R/I s−j+1 + reg S/J j . Theorem 1.1 is surprising since normally we only expect to get hold of information about large enough powers of an ideal. Prior to this result, the authors of [25] expressed in page 820 the view that“...there are no general formulae” for the depth and regularity of T /P s (even when R and S are polynomial rings). Thanks to Theorem 1.1, we can also provide an upper bound for the stability index of depth of powers of P , and study when P has a constant depth function (Section 5.3). Our results generalize or strengthen previous work of Hà–Trung–Trung [25], Herzog–Vladoiu [34]. We expect Theorem 1.1 to hold in positive characteristics as well (but by Example 5.3 it does not hold over all non-polynomial base rings). We do not restrict our considerations of mixed sums to the setting of polynomial base rings. To study Betti splittings of higher powers of P , we introduce in Section 4 the following notion. Definition 1.2. We say I is an ideal of small type if for all s ≥ 1 and all i ≥ 0, R s s−1 the map TorR ) induced by the natural inclusion I s → I s−1 i (k, I ) → Tori (k, I is zero. One of the main results of Section 4 is Theorem 4.10: if I and J are of small type then the powers of P admit natural Betti splittings. While simple, Theorem 4.10 is enough to produce the formulas of Theorem 1.1 since if R and S are polynomial rings then I and J are of small type if either char k = 0 (Ahangari Maleki [1, Theorem 2.5(i)]) or I and J are monomial ideals (Theorem 4.5). Another goal of this paper is to study the linearity defect of powers of mixed sums. The linearity defect, introduced by Herzog and Iyengar [32] measures the failure of minimal free resolutions to be linear (see Section 2 for more details). From POWERS OF SUMS 3 the theory of componentwise linear ideals initiated by Herzog and Hibi [26], linearity defect is a natural invariant: over a polynomial ring, componentwise linear ideals are exactly ideals with linearity defect zero (see [45, Section 3.2]). The linearity defect, as can be expected, behaves well asymptotically. Denote by ldR M the linearity defect of a finitely generated graded R-module M . We prove in [42, Theorem 1.1] that if R is a polynomial ring, then the sequence (ldR I s )s≥1 is eventually constant. To understand the meaning of the limit lims→∞ ldR I s , one should naturally look for some computations of the asymptotic linearity defect. This is the original motivation of this paper which led to the discovery of Betti splittings of powers of mixed sums. The main results of Section 6 yield the following computational statement. Theorem 1.3 (Corollary 6.7). Let (R, m) and (S, n) be polynomial rings over k, (0) 6= I ⊆ m2 and (0) 6= J ⊆ n2 homogeneous ideals. Suppose that one of the following conditions holds: (i) char k = 0 and I and J are non-trivial powers of some homogeneous ideals of R and S, resp. (ii) I and J are non-trivial powers of some monomial ideals of R and S, resp. (iii) All the powers of I and J are componentwise linear. Then for all s ≫ 0, we have an equality   s i j i j ldT P = max lim ldR I + max ldS J + 1, max ldR I + lim ldS J + 1 . i→∞ j≥1 i≥1 j→∞ We believe that Theorem 1.3 is still true without the extra assumptions (i), (ii) and (iii). The paper is organized as follows. Section 2 is devoted to the necessary background and useful facts. In Section 3, we introduce Betti splittings and the closely related notion of Tor-vanishing morphisms between modules. Our study of powers of mixed sums rests on the fact that several homological invariants behave well with respect to Betti splittings and Tor-vanishing morphisms. In Section 4, we study ideals of small type and the subclass of ideals of doubly small type. Theorem 1.3 is available thanks to the formula for ldT P s when I and J are of doubly small type (Theorem 6.1(ii)). The first main result of Section 4 is Theorem 4.5 establishing that any proper monomial ideal of a polynomial ring is of small type. The second main result of this section is Theorem 4.10 which, among other things, establishes Betti splittings for powers of mixed sums whose summands are of small type. We study in Sections 5 and 6 the homological invariants, including projective dimension, regularity and linearity defect, of powers of mixed sums. The main focus in both sections is to provide exact formulas for these invariants. We also compute the asymptotic values of these invariants whenever possible. Some applications to the theory of ideals with constant depth functions and the index of depth stability are given at the end of Section 5. Remark. Some materials of this paper originally belong to a preprint titled “‘Linearity defects of powers are eventually constant” [41]. After further thoughts, we split the last preprint into three parts. The first part establishes the asymptotic constancy of the linearity defect of powers [42]. This paper is the second part, which contains Section 4 of [41] but goes significantly beyond that. A third part which contains the results in the last section of [41] is in preparation. 4 HOP D. NGUYEN AND THANH VU 2. Background We begin with some basic notions and facts that will be used later. Standard knowledge of commutative algebra may be found in [8], [17]. For the theory of free resolutions, we refer to [4] and [44]. 2.1. Linearity defect. Let (R, m, k) be a noetherian ring which is one of the following: (i) a local ring with the maximal ideal m and the residue field k = R/m, (ii) a standard graded algebra over a field k with the graded maximal ideal m. We usually omit k and write simply (R, m). Let M be a finitely generated Rmodule. If R is a graded algebra, then the R-modules that we will study are assumed to be graded, and various structures concerning them, e.g. their minimal free resolutions are also taken in the category of graded R-modules and degree preserving homomorphisms. Let F be the minimal free resolution of M : F : · · · −→ Fi −→ Fi−1 −→ · · · −→ F1 −→ F0 −→ 0. For each i ≥ 0, the minimality of F gives rise to the following subcomplex of F : F iF : · · · −→ Fi+1 −→ Fi −→ mFi−1 −→ · · · −→ mi−j Fj −→ · · · . Following Herzog and Iyengar [32], we define the so-called linear part of F by the formula ∞ M F iF linR F := . F i+1 F i=0 Prior to the work of Herzog and Iyengar, the linear part was also studied by Eisenbud et. al [18] in the graded setting. Observe that (linR F )i = (grm Fi )(−i) for L every i ≥ 0, where grm M = i≥0 mi M/(mi+1 M ). Note that linR F is a complex of graded modules over grm R. The construction of linR F has a simple interpretation in the graded case. For each i ≥ 1, apply the following rule to all entries in the matrix representing the map Fi → Fi−1 : keep it if it is a linear form, and replace it by 0 otherwise. Then the resulting complex is linR F . Following [32], the linearity defect of M is ldR M := sup{i : Hi (linR F ) 6= 0}. If M ∼ = 0, we set ldR M = 0. Most results on the linearity defect of the present paper are built upon the following theorem. Theorem 2.1 (Şega, [47, Theorem 2.2]). Let d ≥ 0 be an integer. The following statements are equivalent: (i) ldR M ≤ d; q+1 q (ii) The natural morphism TorR , M ) −→ TorR i (R/m i (R/m , M ) is zero for every i > d and every q ≥ 0. If a module has linearity defect 0, then as in [32], we also say that it is a Koszul module. Note that by our convention, the trivial module (0) is a Koszul module. The ring R is called Koszul if ldR k = 0. In the graded case, R is said to be a Koszul algebra if regR k = 0. These two notions are compatible in the graded case by [32, POWERS OF SUMS 5 Proposition 1.13]. Moreover by [32, Remark 1.10], a noetherian local ring (R, m) is Koszul if and only if grm R is a Koszul algebra. 2.2. Regularity. Let R be a standard graded k-algebra, M a finitely generated graded R-module. The number βi,j (M ) = dimk TorR i (k, M )j is called the (i, j) graded Betti number of M and βi (M ) = dimk TorR i (k, M ) its ith Betti number. We define the regularity of M over R as follows regR M = sup{j − i : βi,j (M ) 6= 0}. If ldR M < ∞ then by [2, Proposition 3.5], there is an equality regR M = sup 0≤i≤ldR M {j − i : TorR i (k, M )j 6= 0}. In particular, if M is a Koszul module then regR M equals the maximal degree of a minimal homogeneous generator of M . Recall that M is said to have a d-linear resolution (where d ∈ Z), if for all i ∈ Z and all j 6= d, it holds that TorR i (k, M )i+j = 0. If M has a d-linear resolution, then necessarily M is generated in degree d and regR M = d. Following Herzog and Hibi [26], M is said to be componentwise linear if for each d, the submodule generated by homogeneous elements of degree d in M has a dlinear resolution. If R is a Koszul algebra, then we have the following implications, with the first one being strict in general: M has a linear resolution ⇒ M is componentwise linear ⇔ M is Koszul. The equivalence is due to Römer [45, Theorem 3.2.8]. Throughout, we use the term “Koszul module” instead of “componentwise linear module” to streamline the exposition. The Castelnuovo–Mumford regularity of M measures the degree of vanishing of i i its local cohomology modules: reg M = sup{i + j : Hm (M )j 6= 0}, where Hm (M ) denotes the ith local cohomology module of M . 2.3. Elementary lemmas. The identities in the next lemma extend [35, Lemma 1.1] and [25, Proposition 3.2]. They are the basis of most discussions about mixed sums in this paper. Note that the proof of [25, Proposition 3.2] is defective since the authors assume following false claim: Let M1 , . . . , Mp , N are submodules of an ambient module M0 over a ring R (where p ≥ 1) such that Mi ∩ Mj ⊆ N for all i 6= j. Denote M = M1 + · · · + Mp .L Then the module (M + N )/N admits a direct p sum decomposition (M + N )/N = i=1 (Mi + N )/N . Lemma 2.2. Let R, S be affine k-algebras. Let I, J be ideals of R, S, resp., and P = I + J ⊆ T = R ⊗k S. Then for all p, q, r, s ≥ 0, there are identities: I p+r J q ∩ I r J s+q = I p+r P q ∩ I r J s+q = I p+r J s+q ,  s  IrP s ∼ M I r+i J s−i . ⊗ = k I r P s+1 I r+i+1 J s−i+1 i=0 (2.1) (2.2) Proof. (2.1) First we treat the case p = s = 1, r = q = 0. Since k is a field, we have the following identities I ∩ J = (I ⊗k S) ∩ (R ⊗k J) = (I ∩ R) ⊗k (S ∩ J) = I ⊗k J = IJ. 6 HOP D. NGUYEN AND THANH VU Now for arbitrary 0 ≤ r ≤ p, 0 ≤ q ≤ s, we have I p+r J s+q ⊆ I p+r J q ∩ I r J s+q ⊆ I p+r P q ∩ I r J s+q ⊆ I p+r ∩ J s+q = I p+r J s+q . The last equality in the display follows from the case treated above. Hence all the inclusions are in fact equalities. Ps (2.2) We have I r P s = i=0 I r+i J s−i . We claim that for 0 ≤ i ≤ s, the following inclusion holds   \ X I r+i J s−i  I r+j J s−j + I r P s+1  ⊆ I r P s+1 . (2.3) 0≤j≤s,j6=i Note that P s+1 ⊆ I i+1 + J s−i+1 , so I r P s+1 ⊆ I r+i+1 + J s−i+1 . Moreover J ⊆ J s−i+1 , I r+t ⊆ I r+i+1 if j < i < t. Hence   X I r+i J s−i ∩  I r+j J s−j + I r P s+1  s−j 0≤j≤s,j6=i  = I r+i J s−i ∩  ⊆I r+i s−i J X ∩ I I r+j J s−j + j>i j<i r+i+1 X +J s−i+1  .  I r+j J s−j + I r P s+1  (2.4) Generally for all ideals I1 , I2 , I3 in a common ring, we have I1 ∩ (I2 + I3 ) ⊆ (I2 ∩ (I1 + I3 )) + (I3 ∩ (I1 + I2 )) . Take I1 = I r+i J s−i , I2 = I r+i+1 , I3 = J s−i+1 in T . Then as I1 +I3 ⊆ J s−i , I1 +I2 ⊆ I r+i , the last display implies the inclusion in the following chain I r+i J s−i ∩ (I r+i+1 + J s−i+1 ) ⊆ I r+i+1 ∩ J s−i + J s−i+1 ∩ I r+i = I r+i+1 J s−i + I r+i J s−i+1 . (2.5) The equality holds because of (2.1). Note that the last chain also yields I r+i J s−i ∩ I r P s+1 = I r+i+1 J s−i + I r+i J s−i+1 . (2.6) Indeed, the right-hand side is trivially contained in the left-hand one. For the reverse inclusion, we only need to recall that I r P s+1 ⊆ I r+i+1 + J s−i+1 . The chain (2.5) takes care of the rest. The combination of (2.4) with (2.5) and (2.6) yields the desired inclusion (2.3). So we have the first equality in the following chain s s M M I r+i J s−i + I r P s+1 I r+i J s−i IrP s ∼ = = I r P s+1 I r P s+1 I r+i J s−i ∩ I r P s+1 i=0 i=0  s s  M M I r+i J s−i I r+i J s−i ∼ = . ⊗ = k I r+i+1 J s−i + I r+i J s−i+1 I r+i+1 J s−i+1 i=0 i=0 The second equality is (2.6), the last isomorphism is standard. This finishes the proof.  POWERS OF SUMS 7 Lemma 2.3. Let R, S be standard graded k-algebras, and M, N be non-zero finitely generated graded modules over R, S, resp. Then denoting T = R ⊗k S, there are equalities pdT (M ⊗k N ) = pdR M + pdS N, regT (M ⊗k N ) = regR M + regS N, ldT (M ⊗k N ) = ldR M + ldS N. Proof. Let F, G be the minimal graded free resolutions of M, N over R, S, resp. Then F ⊗k G is a minimal graded free resolution of M ⊗k N over T . A simple accounting then yields the first two equalities. We immediately have linT (F ⊗k G) = linR F ⊗k linS G. Hence using the Künneth’s formula, we get ldT (M ⊗k N ) = ldR M + ldS N .  Recall that a map of noetherian local rings θ : (R, m) −→ (S, n) is called an algebra retract if there exists a local homomorphism φ : S → R such that the composition φ ◦ θ is the identity of R. In such a situation, we call the map φ the retraction map of θ. Lemma 2.4. Let θ : (R, m) → (S, n) be an algebra retract of noetherian local rings with the retract map φ : S → R. Let I ⊆ m be an ideal of R. Let J ⊆ n be an ideal containing θ(I)S such that φ(J)R = I. Then there are inequalities ldR (R/I) ≤ ldS (S/J), ldR I ≤ ldS J. θ Proof. The hypothesis implies that there is an induced algebra retract R/I − → S/J. For each i ≥ 0, q ≥ 0, there is a commutative diagram of R-modules q+1 TorR , R/I) i (R/m ιq+1 µq  R R Tori (R/mq , R/I) / TorSi (S/nq+1 , S/J) µq ι q  S / TorSi (S/nq , S/J) q+1 / TorR , R/I) i (R/m  q / TorR i (R/m , R/I) By functoriality, the composition of the horizontal maps on the second row is the q q identity map of TorR i (R/m , R/I). From this, we deduce that ι is injective. q Take i > ldS (S/J), then from Theorem 2.1, µS is trivial for all q ≥ 0. Since ιq is injective, we also have µqR is trivial for all q ≥ 0. Using Theorem 2.1, this implies that ldR (R/I) ≤ ldR (S/J). The remaining inequality is immediate.  3. Maps of Tor and algebraic invariants This section makes the preparation for Section 4. We will introduce the notion of Tor-vanishing and doubly Tor-vanishing homomorphisms. Morphisms of both type are well-suited to study the linearity defect but the latter yields more precise information. We also recall some results from [40], [43], which will be used frequently later. 3.1. Tor-vanishing morphisms. Let (R, m) be a noetherian local ring. Let φ : M → P be a morphism of finitely generated R-modules. We say that φ is Torvanishing if for all i ≥ 0, we have TorR i (k, φ) = 0. We say that φ is doubly Torvanishing if there exist (possibly non-minimal) free resolutions F and G of M and P , resp., and a lifting ϕ : F → G of φ such that ϕ(F ) ⊆ m2 G. 8 HOP D. NGUYEN AND THANH VU We use the same terminology for the setting of standard graded algebras over a field and graded modules. Clearly, if φ is doubly Tor-vanishing then it is Torvanishing, but not vice versa: For example, take R = k[[x]] and let φ be the map ·x R −→ R. Remark 3.1. Let F, G be the minimal free resolutions of M, P , resp. (1) The following statements are equivalent: (i) φ is Tor-vanishing; (ii) There exists a lifting ϕ : F → G of φ such that ϕ(F ) ⊆ mG; (iii) For any lifting ϕ : F → G of φ, we have ϕ(F ) ⊆ mG. (2) The following statements are equivalent: (i) φ is doubly Tor-vanishing; (ii) There exists a lifting ϕ : F → G of φ such that ϕ(F ) ⊆ m2 G; (iii) For any lifting ϕ : F → G of φ, we have ϕ(F ) ⊆ m2 G. Compositing Tor-vanishing morphisms produce doubly Tor-vanishing ones. φ ψ Lemma 3.2. Let M − → P and P − → Q be Tor-vanishing morphisms. Then ψ ◦ φ is doubly Tor-vanishing. Proof. Let F, G, H be the minimal free resolutions of M, P, Q, resp. Since φ is Tor-vanishing, it admits a lifting ϕ : F → G such that ϕ(F ) ⊆ mG. Similarly, there exists a lifting Ψ : G → H of ψ such that Ψ(G) ⊆ mH. The composition Ψ ◦ ϕ : F → H yields a lifting of ψ ◦ φ such that (Ψ ◦ ϕ)(F ) ⊆ m2 H.  The following result illustrates the utility of (doubly) Tor-vanishing morphisms. φ Lemma 3.3. Let 0 → M − → P → N → 0 be an exact sequence of non-zero finitely generated R-modules. (i) Assume that φ is Tor-vanishing. Then pdR N = max{pdR P, pdR M + 1}. If moreover R is a standard graded algebra and M, P, N are graded modules, then regR N = max{regR P, regR M − 1}. (ii) Assume that φ is doubly Tor-vanishing. Then ldR N = max{ldR P, ldR M + 1}. Proof. (i) The long exact sequence of Tor yields βi (N ) = βi (P ) + βi−1 (M ) for all i ≥ 0. Hence the equality for the projective dimension follows. Similar arguments for the regularity. (ii) follows by using Remark 3.1(2) and [42, Lemma 3.5].  3.2. Betti splittings. Betti splittings were first introduced by Francisco, Hà, and Van Tuyl [23] for monomial ideals. A motivation for this notion comes from work of Eliahou and Kervaire [22]. Let (R, m) be a noetherian local ring (or a standard graded k-algebra) and P, I, J 6= (0) be proper (homogeneous) ideals of R such that P = I + J. Definition 3.4. The decomposition of P as I + J is called a Betti splitting if for all i ≥ 0, the following equality of Betti numbers holds: βi (P ) = βi (I) + βi (J) + βi−1 (I ∩ J). POWERS OF SUMS 9 The lemma below is a straightforward generalization of [23, Proposition 2.1] and admits the same proof. We will frequently use the characterization (ii) of Betti splittings in the next sections. Lemma 3.5. The following are equivalent: (i) The decomposition P = I + J is a Betti splitting; (ii) The morphisms I ∩ J → I and I ∩ J → J are Tor-vanishing; (iii) The mapping cone construction for the map I ∩ J → I ⊕ J yields a minimal free resolution of P . Most results of this paper are motivated by the next simple observation, presented in [43, Example 4.7]. Example 3.6. Let R, S be standard graded k-algebras and I, J be non-zero, proper homogeneous ideals of R, S, resp. Let P = I + J ⊆ T = R ⊗k S, then the decomposition P = I + J is a Betti splitting. The following result signifies the utility of Betti splittings. The case when R is a polynomial ring is well-known [23, Corollary 2.2]. Lemma 3.7. Let R be a standard graded k-algebra and P a homogeneous ideal with a Betti splitting P = I + J. Then there are equalities pdR P = max{pdR I, pdR J, pdR (I ∩ J) + 1}, regR P = max{regR I, regR J, regR (I ∩ J) − 1}. Proof. Looking at the long exact sequence of TorR (k, −), we see that the second equality is always true and the first one is true if I ∩ J 6= (0). If I ∩ J = (0), then P = I ⊕ J so pdR P = max{pdR I, pdR J}. If max{pdR I, pdR J} ≥ 1 then the first equality is again true. If pdR I = pdR J = 0 then I and J are free R-modules. Hence there are non-zero divisors x ∈ I, y ∈ J. But then 0 6= xy ∈ I ∩ J, a contradiction. This finishes the proof of the first equality.  3.3. Exact sequence estimates. Let (R, m) be a noetherian local ring and 0 −→ φ λ M −→ P −→ N −→ 0 be an exact sequence of finitely generated R-modules. From Şega’s Theorem 2.1, it follows that the vanishing of TorR . (k, φ), TorR . (k, λ) and the connecting map TorR . +1 (k, N ) → TorR . (k, M ) are useful for comparing the numbers ldR M, ldR P and ldR N . For example, we have Proposition 3.8 ([43, Proposition 4.3]). With the notations as above, assume that φ is Tor-vanishing. Then there are inequalities ldR N ≤ max{ldR P, ldR M + 1}, ldR P ≤ max{ldR M, ldR N }, ldR M ≤ max{ldR P, ldR N − 1}. Using Lemma 3.5 and Proposition 3.8 for the short exact sequence 0 −→ I∩J −→ I ⊕ J −→ P −→ 0, we get Proposition 3.9 ([43, Theorem 4.9]). Let P = I +J be a Betti splitting of non-zero proper ideals of R. Then there are inequalities ldR P ≤ max{ldR I, ldR J, ldR (I ∩ J) + 1}, max{ldR I, ldR J} ≤ max{ldR (I ∩ J), ldR P }, ldR (I ∩ J) ≤ max{ldR I, ldR J, ldR P − 1}. 10 HOP D. NGUYEN AND THANH VU The following result will be invoked several times. Note that, compared with the original statements in [40], below we additionally allow trivial modules. No contradiction arises in doing so because of the convention that the trivial module is Koszul. φ Theorem 3.10 (Nguyen [40, Theorem 3.5 and its proof]). Let 0 −→ M −→ P −→ N −→ 0 be a short exact sequence of finitely generated R-modules such that: (i) P is a Koszul module, (ii) M ⊆ mP . Then φ is Tor-vanishing, and ldR N − 1 ≤ ldR M ≤ max{0, ldR N − 1}. Furthermore, ldR N = 0 if and only if ldR M = 0 and M ∩ ms+1 P = ms M for all s ≥ 0. 3.4. Invariants of mixed sums. Let (R, m) and (S, n) be standard graded kalgebras, I ⊆ m and J ⊆ n be non-zero homogeneous ideals of R and S, resp. In the sequel, modules over R or S are identified with their extensions to T (via the obvious faithfully flat maps). For simplicity, we will call P = I +J the mixed sum of I and J. More generally, if R1 , . . . , Rc are standard graded k-algebras (where c ≥ 2) and Ii ⊆ Ri is a homogeneous ideal for 1 ≤ i ≤ c, we call I1 +· · ·+Ic ⊆ R1 ⊗k · · ·⊗k Rc the mixed sum of I1 , . . . , Ic . Part (i) of the following result is folkloric and is a consequence of Example 3.6 and Lemma 3.7. Proposition 3.11. The following statements hold. (i) There are equalities pdT P = pdR I + pdS J + 1, regT P = regR I + regS J − 1. (ii) If R/I is a Koszul R-module then ldT P = ldS J. If ldR (R/I) and ldS (S/J) are ≥ 1 then ldT P = ldR I + ldS J + 1. Proof. (i) The proof was mentioned above. (ii) Applying Lemma 2.3 for the modules R/I and S/J, we have ldT (T /P ) = ldR (R/I) + ldS (S/J). This implies the first part of (ii). For the second part, note that ldR (R/I) ≥ 1, hence ldR I = ldR (R/I) − 1. Similar equalities hold for J and P , and the conclusion follows.  Remark 3.12. If R is a Koszul algebra, then by Subsection 2.2, R/I is a Koszul module ⇐⇒ R/I has a linear resolution over R ⇐⇒ I has a 1-linear resolution over R. In any case, if I is not generated by linear forms then ldR (R/I) ≥ 1. Hence the hypotheses of Proposition 3.11(ii) are satisfied if I ⊆ m2 , J ⊆ n2 . Later on, we will have different kinds of results about ldT P s , s ≥ 2 according to whether I is generated by linear forms or I ⊆ m2 (compare for example Corollary 6.7 and Theorem 6.8). 4. Ideals of (doubly) small type Let (R, m) be a noetherian local ring (or a standard graded k-algebra), and I a proper (homogeneous) ideal. We say that I is of small type (of doubly small type) if for all r ≥ 1, the natural map I r → I r−1 is Tor-vanishing (doubly Tor-vanishing, POWERS OF SUMS 11 resp.). Ideals which are not of small type abound: Let R be a non-Koszul algebra. Then by [32, Proposition 1.13], ldR m = ∞, hence by Theorem 2.1, m is not of small type. Moreover, even over some Koszul complete intersections of codimension 2 ideals not of small type exist, e.g. consider the ideal (x + y) of k[x, y, z]/(x2 , yz) in Example 6.2. In this section, we provide diverse classes of ideals of small or doubly small type. An important result in the current section is Theorem 4.10 relating ideals of small type and Betti splittings of powers of their mixed sums. This will be useful to studying invariants of powers of mixed sums in Sections 5 and 6. 4.1. Differential criteria. In this subsection, let R = k[x1 , . . . , xm ] (where m ≥ 0) be a polynomial ring, m its graded maximal ideal, and (0) 6= I ⊆ m a homogeneous ideal. We denote by ∂(I) the ideal generated by elements of the form ∂f /∂xi , where f ∈ I, i = 1, . . . , m. In the proof of Proposition 4.8, we will make use of the following criterion for detecting Tor-vanishing homomorphisms. Lemma 4.1 (Ahangari Maleki [1, Theorem 2.5 and its proof]). Assume that char k = 0. (i) Let I1 and I2 be homogeneous ideals of R such that ∂(I1 ) ⊆ I2 . Then I1 ⊆ mI2 and the map I1 → I2 is Tor-vanishing. (ii) In particular, any homogeneous ideal I of R is of small type. The only new statement in Lemma 4.1 is the inclusion I1 ⊆ mI2 , which results from Euler’s identity for homogeneous polynomials. We wish to prove that every proper monomial ideal of a polynomial ring is of small type. For this, we record the following simple but very useful lemma. It is an application of the Taylor’s resolution [48]; see [28, Section 7.1]. Below, for a set G′ of polynomials in R, denote lcm G′ = lcm(x : x ∈ G′ ). If I is a monomial ideal, let G(I) denote the set of its minimal monomial generators. Lemma 4.2 (Eliahou and Kervaire [22, Proof of Proposition 3.1]). Let (0) 6= I1 ⊆ I2 be monomial ideals of R. Assume that there exists a function φ : G(I1 ) → G(I2 ) with the following property: (LCM) For any non-empty subset G′ of G(I1 ), lcm G′ belongs to (lcm φ(G′ ))m. Then the inclusion map I1 → I2 is Tor-vanishing. For I being a monomial ideal of R, we denote by ∂ ∗ (I) the ideal generated by elements of the form f /xi , where f is a minimal monomial generator of I and xi is a variable dividing f . The following lemma is straightforward so we leave the detailed proof to the interested reader. Lemma 4.3. Let I1 , I2 , L be monomial ideals of R where L ⊆ I1 . Then the following statements hold: (i) ∂ ∗ (I1 ) is a monomial ideal and ∂(I1 ) ⊆ ∂ ∗ (I1 ). (ii) I1 ⊆ m∂ ∗ (I1 ). (iii) Let g ≥ 1 be maximal such that there exists a variable xi of R with the property that xgi divides an element of G(I1 ). If char k = 0 or char k > g then ∂ ∗ (I1 ) = ∂(I1 ). In particular, if I1 is squarefree then ∂ ∗ (I1 ) = ∂(I1 ). (iv) ∂ ∗ (L) ⊆ ∂ ∗ (I1 ). (v) ∂ ∗ (I1 I2 ) = ∂ ∗ (I1 )I2 + I1 ∂ ∗ (I2 ). (vi) ∂ ∗ (I s ) = ∂ ∗ (I)I s−1 for all s ≥ 1. 12 HOP D. NGUYEN AND THANH VU We have the following criterion for maps between sets of minimal generators of monomial ideals to have the (LCM) property. Proposition 4.4. Let I1 , I2 be non-zero proper monomial ideals of R such that ∂ ∗ (I1 ) ⊆ I2 . Then I1 ⊆ mI2 and there exists a map φ : G(I1 ) → G(I2 ) having the property (LCM) of Lemma 4.2. Proof. From Lemma 4.3(ii), we have I1 ⊆ m∂ ∗ (I1 ) ⊆ mI2 . For the remaining statement, we use induction on the number of generators of I1 . For a monomial f ∈ R, denote by supp(f ) the set of variables dividing f . If I1 is a principal ideal (f ), then ∂ ∗ (I1 ) = (f /xi : xi ∈ supp(f )). By the hypothesis, f /xi ∈ I2 for some xi ∈ supp(f ), so there exists g ∈ G(I2 ) dividing f /xi . We define φ by φ(f ) = g, then clearly f ∈ gm. Assume that |G(I1 )| ≥ 2. Let x be a variable which divides a minimal monomial generator of I1 . We can write in a unique way I1 = xK + L, where L is generated by the elements of G(I1 ) which are not divisible by x and xK is generated by the remaining elements. Observe that G(xK) ∩ G(L) = ∅, and G(I1 ) = G(xK) ∪ G(L). Furthermore K ⊆ ∂ ∗ (I1 ) ⊆ I2 . Firstly, assume that L 6= (0). Since |G(L)| < |G(I1 )| and ∂ ∗ (L) ⊆ ∂ ∗ (I1 ) ⊆ I2 thanks to Lemma 4.3(iv), by induction hypothesis, there exists a function ψ : G(L) → G(I2 ) which has the property (LCM). We define φ : G(I1 ) → G(I2 ) as follows: if y ∈ G(xK), since K ⊆ I2 , for a choice of monomials f ∈ R, g ∈ G(I2 ) such that y = xf g, we let φ(y) = g. If y ∈ G(L) then we set φ(y) = ψ(y). We verify that φ has the property (LCM). Consider a set G′ = {y1 , . . . , yr , z1 , . . . , zs } ⊆ G(I1 ) where yi ∈ G(xK) and zj ∈ G(L). We write yi = xfi gi where gi = φ(yi ) ∈ G(I2 ). If r = 0 then lcm G′ = lcm{z1 , . . . , zq } is strictly divisible by lcm φ(G′ ) = lcm ψ(G′ ) by the choice of ψ. If r ≥ 1, denote g = lcm(φ(y1 ), . . . , φ(yr )) = lcm(g1 , . . . , gr ). Denote b = lcm(z1 , . . . , zs ), b′ = lcm(ψ(z1 ), . . . , ψ(zs )) then b′ divides b. Now lcm φ(G′ ) = lcm(g, b′ ) and lcm G′ is divisible by lcm(xg1 , . . . , xgr , z1 , . . . , zs ) = lcm(xg, b) = x lcm(g, b), where the second equality holds since gcd(x, b) = 1. Since b′ divides b, we conclude that lcm φ(G′ ) strictly divides lcm G′ , as desired. It remains to consider the case L = 0. In this case I1 = xK, so K ⊆ ∂ ∗ (I1 ) ⊆ I2 . Define φ in the same way as above, we get the desired conclusion.  An immediate consequence of Proposition 4.4 is the following. Theorem 4.5. Any proper monomial ideal of R is of small type. Proof of Theorem 4.5. Let I ⊆ m be a monomial ideal. There is nothing to do if I = (0), so we assume that I 6= (0). By Lemma 4.2, it suffices to prove that for any s ≥ 1, there exists a map G(I s ) → G(I s−1 ) with the (LCM) property. Thanks to Proposition 4.4, we only need to check that ∂ ∗ (I s ) ⊆ I s−1 , but this follows from Lemma 4.3(vi).  4.2. A catalog. We provide in this section more classes of ideals which are of small or doubly small type. For some classes of ideals satisfying the hypothesis of the next result, see, e.g., [7], [29], [30]. POWERS OF SUMS 13 Proposition 4.6. Assume that all the powers of I are Koszul. Then: (i) I is of small type. (ii) If moreover R is a Koszul algebra and I ⊆ m2 , then I is of doubly small type. Proof. Take r ≥ 1. Since I r ⊆ mI r−1 and I r−1 is Koszul, the map I r → I r−1 is Tor-vanishing, thanks to Theorem 3.10. Now assume further that R is a Koszul algebra and I ⊆ m2 . For r ≥ 1, consider the chain I r ⊆ mI r−1 ⊆ I r−1 . Since I r−1 is Koszul and R is a Koszul algebra, we obtain by [40, Corollary 3.8] that mI r−1 is Koszul. From the inclusion I r ⊆ m2 I r−1 and Theorem 3.10, the map I r → mI r−1 is Tor-vanishing. As seen above, the map mI r−1 → I r−1 is Tor-vanishing as well, so Lemma 3.2 implies that I r → I r−1 is doubly Tor-vanishing for all r ≥ 1. In other words, I is of doubly small type.  Proposition 4.7. Let (R, m) be a noetherian local ring and I a proper ideal generated by a regular sequence. Then: (i) The ideal I is of small type. (ii) If moreover I is contained in m2 then it is of doubly small type. Proof. (i) We can use the Eagon–Northcott resolution to directly construct a suitable lifting of the map I r → I r−1 . Here is an alternative argument. By assumption I = (f1 , . . . , fp ) where p ≥ 1 and f1 , . . . , fp is a regular sequence of elements in m. We use induction on p ≥ 1 and r ≥ 1 that there exists a lifting on the level of minimal free resolutions of the map I r → I r−1 which induces the zero map after tensoring with k. If p = 1 or r = 1 then the conclusion is clear. Assume that p ≥ 2 and r ≥ 2. Denote K = (f2 , . . . , fp ) and f = f1 . We have I r = f I r−1 + K r . Since f is R/K r -regular (see [8, Page 6]), we have f I r−1 ∩ K r = f K r . Let A, B be the minimal free resolution of K r , I r−1 , resp. Using the induction hypothesis, the map K r → K r−1 is Tor-vanishing, hence so is K r → I r−1 . Since ·f f is R/K r -regular, a lifting of the map f K r → K r is given by A −→ A. Therefore a minimal free resolution of I r is obtained from the mapping cone construction for the map f K r → f I r−1 ⊕ K r . 0 / f Kr / f I r−1 ⊕ K r / Ir /0  I r−1 Let ε be a lifting of the map K r → I r−1 such that ε ⊗R k = 0. We have the following lifting diagram. A  f Kr (ε,·f ) a7→(a,a) / B⊕A  / f I r−1 ⊕ K r (·f )|B −ε|A (b,c)7→b−c /B  / I r−1 Specifically, a lifting Λ : A → B ⊕ A of the map f K r → f I r−1 ⊕ K r is given by A ∋ x 7→ (ε(x), f x) ∈ B ⊕ A. A lifting Φ : B ⊕ A → B of the map f I r−1 ⊕ K r → I r−1 is given by B ⊕ A ∋ (y, z) 7→ f y − ε(z) ∈ B. 14 HOP D. NGUYEN AND THANH VU The composition Φ ◦ Λ is zero, hence we can extend Φ to a map from the mapping cone of Λ to B by setting it to be zero on A. The extended map is a lifting of the map I r → I r−1 which is zero after tensoring with k. Hence I r → I r−1 is Tor-vanishing. The induction and hence the proof is finished. (ii) Argue similarly as for (i).  Assume that R = k[x1 , . . . , xm ] is a polynomial ring over k (where m ≥ 0) and (0) 6= I ⊆ R is a proper homogeneous ideal. Following Herzog and Huneke [31], if char k = 0 we say that a homogeneous (but possibly non-monomial) ideal I is strongly Golod if ∂(I)2 ⊆ I. Independently of char k, we say that an ideal I is ∗ strongly Golod if I is a monomial ideal and ∂ ∗ (I)2 ⊆ I. The two notions are compatible when char k = 0: I is ∗strongly Golod if and only if I is strongly Golod S in the sense of Herzog and Huneke. Below, let Ie = s≥1 (I : ms ) be the saturation of I. Let I, the integral closure of I, be the set of x ∈ R which satisfies a relation xn + a1 xn−1 + · · · + an−1 x + an = 0 where n ≥ 1, ai ∈ I i for 1 ≤ i ≤ n. The integral closure is an ideal containing I, and if I is a monomial ideal then so is I: In fact, by Proposition 1.4.2 and the discussion preceding it in [36], I is generated r r by monomials f ∈ R such that some r ≥ 1. T f ∈ I for (s) For each s ≥ 1, let I = P ∈Min(I) I s RP ∩ R be the s-th symbolic power of I, where Min(I) denotes the set of minimal primes of I. Proposition 4.8. Assume that either char k = 0 or I is a monomial ideal. (i) If I is strongly Golod or ∗strongly Golod then it is of doubly small type. (ii) For all s ≥ 2, the ideals I s , Ies , I (s) are of doubly small type. (iii) If I is monomial then for all s ≥ 2, I s is of doubly small type. First, we establish the following lemma, which is inspired by [31, Theorem 2.3 and Proposition 3.1]. The proof of [31, Proposition 3.1] in page 96–97 contains several problems/mistakes, e.g., in p. 97, line 5, the best one can say is (w/xk )r ∈ I a I ⌊(b−a)/2⌋ . In p. 97, line 7, the equality r = d + b is generally false, one can only say r ≤ d + b. The crucial claim in the proof is nevertheless correct. We salvage the above problems and mistakes in the proof of part (i) of Lemma 4.9. Lemma 4.9. Let I be a monomial ideal. (i) If I is ∗strongly Golod, then so is I. (ii) Let I be ∗strongly Golod, and L a monomial ideal such that I : L = I : L2 . Then I : L is also ∗strongly Golod. (iii) For all s ≥ 2, I s is ∗strongly Golod. (iv) For all s ≥ 2, I s , I (s) , Ies are ∗strongly Golod. Proof. (i) Let f be a monomial such that f r ∈ I r for some r ≥ 1 and xi ∈ supp(f ). We claim that (f /xi )r ∈ I ⌊r/2⌋ . Write f r = m1 · · · mr where for each 1 ≤ j ≤ r, mj is a monomial in I. For d 1 ≤ j ≤ r, let dj be maximal so that xi j divides mj . By permuting the indices, we can assume that d1 = · · · = da = 0 and 1 ≤ da+1 ≤ · · · ≤ dr . Clearly xri |f r , hence da+1 + · · · + dr ≥ r. If a ≥ ⌊r/2⌋, then r (f /xi )r = (m1 · · · ma ) ((ma+1 · · · mr )/xri ) ∈ I a ⊆ I ⌊ 2 ⌋ . Consider the case a < ⌊r/2⌋. Observation: It holds that dr−a+1 + · · · + dr ≥ 2a. POWERS OF SUMS 15 Indeed, assume that dr−a+1 + · · · + dr < 2a, then since dr−a+1 ≤ · · · ≤ dr , we get dr−a+1 < 2. In particular, da+1 = · · · = dr−a = 1. This yields da+1 + · · · + dr = r − 2a + (dr−a+1 + · · · + dr ) < r, which is a contradiction. Hence the observation is true. Since I is ∗strongly Golod and xi divides ma+1 , . . . , mr−a , we have an inclusion (ma+1 /xi ) · · · (mr−a /xi ) ∈ I ⌊(r−2a)/2⌋ . Together with the observation, we get the inclusion in the following chain  r   r−2a r mr−a mr−a+1 · · · mr f ma+1 ··· ∈ I aI ⌊ 2 ⌋ = I ⌊ 2 ⌋. = (m1 · · · ma ) xi xi xi x2a i This finishes the proof of the claim. Now take f, g ∈ I and xi ∈ supp(f ), xj ∈ supp(g). There exist r, s ≥ 1 such that f r ∈ I r , g s ∈ I s . Note that f 2rs , g 2rs ∈ I 2rs , hence by the above claim we obtain (f g/(xi xj ))2rs = (f /xi )2rs (g/xj )2rs ∈ I rs I rs = I 2rs . Hence (f /xi )(g/xj ) ∈ I. This implies that I is ∗strongly Golod. (ii) Take f, g ∈ I : L and xi ∈ supp(f ), xj ∈ supp(g). Take any h1 , h2 ∈ L. Then f h1 , gh2 ∈ I, so (f /xi )h1 , (g/xj )h2 ∈ ∂ ∗ (I). In particular (f /xi )(g/xj )h1 h2 ∈ ∂ ∗ (I)2 ⊆ I. The last chain together with the hypothesis yields (f /xi )(g/xj ) ∈ I : L2 = I : L. This implies that ∂ ∗ (I : L)2 ⊆ I : L, namely I : L is ∗strongly Golod. (iii) By Lemma 4.3(vi), ∂ ∗ (I s ) = ∂ ∗ (I)I s−1 . Hence ∂ ∗ (I s )2 ⊆ (I s−1 )2 ⊆ I s , proving that I s is ∗strongly Golod. (iv) By (i) and (iii), we have that I s is ∗strongly Golod. Let J be the intersection of all the associated, non-minimal prime ideals of I s . Then I (s) = ∪i≥1 (I s : J i ). Since R is noetherian, for large enough i, I (s) = I s : J i . Set L = J i , then I (s) = I s : L = I s : L2 . Hence by (ii) and (iii), I (s) is ∗strongly Golod. Similarly from (ii) and (iii), we deduce that Ies is ∗strongly Golod. The proof is concluded.  Proof of Proposition 4.8. (i) First, consider the case char k = 0. Let P = ∂(I)I r then I r+1 ⊆ P ⊆ I r by Euler’s identity for homogeneous polynomials. By Lemma 3.2, it suffices to show that the inclusion maps I r+1 ⊆ P and P ⊆ I r are Torvanishing. For this, we wish to apply Lemma 4.1, so we claim that ∂(I r+1 ) ⊆ P and ∂(P ) ⊆ I r . The first inclusion is clear. Now ∂(P ) ⊆ ∂(∂(I))I r + ∂(I)2 I r−1 ⊆ I r , where the second inclusion follows from the hypothesis. The case I is ∗strongly Golod is proved similarly, where ∂ ∗ (I) and Proposition 4.4 are used in places of ∂(I) and Lemma 4.1. (ii) If char k = 0, by [31, Theorem 2.3], for any s ≥ 2, the ideals I s , Ies , I (s) are strongly Golod. If I is monomial, by Lemma 4.9, the same ideals are ∗strongly Golod. Together with part (i) we get that such ideals are of doubly small type. (iii) This follows by combining Lemma 4.9(iv) and part (i).  4.3. Powers of mixed sums. The original purpose of introducing ideals of small type is contained in part (i) of the following result. The purpose of introducing ideals of doubly small type is contained in Theorem 6.1(ii). 16 HOP D. NGUYEN AND THANH VU Theorem 4.10. Let (R, m) and (S, n) be standard graded algebras over k. Let I ⊆ R, J ⊆ S be non-zero proper homogeneous ideals. Denote T = R ⊗k S and P = I + J ⊆ T. (i) Assume that I and J are of small type. Then for all r ≥ 0 and all s ≥ 1, we have a Betti splitting I r P s = I r+1 P s−1 + I r J s . Furthermore, P is also of small type. (ii) Assume that I and J are of doubly small type. Then for all r ≥ 0 and all s ≥ 1, the maps I r+1 J s → I r J s and I r+1 J s → I r+1 P s−1 are doubly Tor-vanishing, and the ideal P is of doubly small type. Proof. (i) By Lemma 2.2 we have I r+1 P s−1 ∩ I r J s = I r+1 J s . By Lemma 3.5, it suffices to check that the maps I r+1 J s → I r J s and I r+1 J s → I r+1 P s−1 are Torvanishing. Since I is of small type, the map I r+1 → I r is Tor-vanishing. Tensoring over k with J s is an exact functor, so the map I r+1 J s → I r J s is Tor-vanishing. The same holds for the map I r+1 J s → I r+1 J s−1 , and hence also for I r+1 J s → I r+1 P s−1 which factors through the previous map. We prove that for every s ≥ 1, the map I r P s → I r P s−1 is Tor-vanishing for all r ≥ 0. This clearly implies that P is of small type. Induct on s. Step 1: If s = 1, using I r P = I r+1 + I r J and Lemma 2.2, we have the exactness of the first row in the following diagram 0 / I r+1 J / I r+1 ⊕ I r J / IrP /0  Ir Let rF, rG, rH be the minimal graded free resolutions of I r , J r , P r over R, S, T , resp. Then minimal graded free resolutions over T of I r+1 J, I r+1 ⊕ I r J and I r are given by A = r+1F ⊗k 1G, B ⊕ B = (r+1F ⊗k S) ⊕ (rF ⊗k 1G) and C = rF ⊗k S, resp. Let ϕ : r+1F → rF be a lifting of the map I r+1 → I r . Since I is of small type, we can choose ϕ such that ϕ ⊗R k = 0. Let ε : 1G → S be a lifting of the map J → S given by εi = 0 for i ≥ 1. Choose bases for r+1F, rF, 1G. We have a lifting diagram as follows. A  I r+1 J (id ⊗ε,ϕ⊗id) a7→(a,a) / B⊕B  / I r+1 ⊕ I r J (ϕ⊗id)|B −(id ⊗ε)|B (b,c)7→b−c /C  / Ir In other words, a lifting of Λ : A → B ⊕ B of the map I r+1 J → I r+1 ⊕ I r J is given on the basis elements by A ∋ x ⊗ y 7→ (x ⊗ ε(y), ϕ(x) ⊗ y) ∈ B ⊕ B. A lifting Π : B ⊕ B → C of the map I r+1 ⊕ I r J → I r is given on the basis elements by B ⊕ B ∋ (z ⊗ 1, u ⊗ v) 7→ ϕ(z) ⊗ 1 − u ⊗ ε(v) ∈ C. In particular, the composition map A → C is zero. Therefore we can extend Π : B ⊕ B → C to a map on the mapping cone of Λ by setting Π|A = 0. By the choice of ϕ and ε, we have Π ⊗T k = 0. Hence I r P → I r is Tor-vanishing. POWERS OF SUMS 17 Step 2: Now assume that s ≥ 2. Thanks to the argument for the Betti splitting I r P s = I r+1 P s−1 + I r J s from above, we have a commutative diagram with exact rows. α / I r+1 J s 0 γ 0  / I r+1 J s−1 β / I r+1 P s−1 ⊕ I r J s δ / I r+1 P s−2 ⊕ I r J s−1 / IrP s /0  / I r P s−1 /0 Let 1A, 1B, and 1C be the minimal graded free resolutions of I r+1 J s , I r+1 P s−1 , and I r J s , resp. Let 2A, 2B, and 2C be the minimal graded free resolution of I r+1 J s−1 , I r+1 P s−2 , and I r J s−1 , resp. With the notations as above, we can choose 1A = r+1 F ⊗k sG, 1C = rF ⊗k sG, 2A = r+1F ⊗k s−1G and finally 2C = rF ⊗k s−1G. Step 2a: We show that there exist liftings Φ, Π, Ψ, Ω of α, β, γ, δ such that the following two maps 1A → 2B ⊕ 2C are equal: Ω ◦ Φ = Π ◦ Ψ. Φ 1 A ◗◗◗ ◗◗◗ ◗◗◗ ( / 1B ⊕ 1C γ Ψ  J r+1 s−1 I ♠♠6 ♠ ♠ ♠  ♠♠♠♠ 2 ♠ A  / I r+1 P s−1 ⊕ I r J s α I r+1 J s β / IrP s δ / I r+1 P s−2 ⊕ I r J s−1 Π / 1D ♥♥ ♥ ♥ ♥♥ w ♥♥ ♥  / I r P s−1 gPPP PPP PPP  P / 2D / 2B ⊕ 2C Let p be the graded maximal ideal of T . Since J is of small type, there is a lifting Ψ : 1A → 2A of γ such that Ψ(1A) ⊆ p(2A). In more details, choose a lifting ηs : sG → s−1G of J s → J s−1 so that ηs ⊗S k = 0 and choose Ψ = id ⊗k ηs . We will define Φ, Ω, Π componentwise; see the next two diagrams. Let α1 : I r+1 J s → I r+1 P s−1 , α2 : I r+1 J s → I r J s be the restrictions of α to the first and second component of the image, resp. Similarly define β1 , β2 . Let δ1 : I r+1 P s−1 → I r+1 P s−2 , δ2 : I r J s → I r J s−1 be the components of δ. By the induction hypothesis, δ1 is also Tor-vanishing, hence there is a lifting Ω1 : 1B → 2B of it such that Ω1 (1B) ⊆ p(2B). Let ∆ be a lifting of the map θ : I r+1 J s−1 → I r+1 P s−1 , then we have liftings Φ1 = ∆ ◦ Ψ of α1 and Π1 = Ω1 ◦ ∆ of β1 . Moreover, Π1 ◦ Ψ = Ω1 ◦ Φ1 . I r+1 J s γ  I r+1 J s−1 α1 / I r+1 P s−1 ❦5 ❦ ❦ ❦ θ❦❦❦❦ δ1 ❦❦❦  ❦❦❦ β 1 / I r+1 P s−2 Since I is of small type, for each r, we can choose a lifting ρr : rF → r−1F of I r → I r−1 such that ρr ⊗R k = 0. Let Φ2 = ρr+1 ⊗k id : 1A → 1C, Ω2 = id ⊗k ηs : 1C → 2C and Π2 = ρr+1 ⊗k id : 2A → 2C, which are liftings of α2 , δ2 and β2 , resp. It is immediate that Π2 ◦ Ψ = Ω2 ◦ Φ2 . I r+1 J s α2 / IrJ s γ  I r+1 J s−1 δ2 β2  / I r J s−1 18 HOP D. NGUYEN AND THANH VU Define Φ by Φ1 and Φ2 , Ω by Ω1 and Ω2 , Π = (Π1 , Π2 ). Then one has Π◦Ψ = Ω◦Φ, as desired. Step 2b: Let 1D, 2D be the mapping cones of α, β, resp. By the construction of α and β, 1D, 2D are the minimal graded free resolutions of I r P s , I r P s−1 , resp. The liftings Ψ and Ω together with the commutativity relation Π ◦ Ψ = Ω ◦ Φ yields a lifting χ : 1D → 2D for I r P s → I r P s−1 . Since Ψ ⊗T k = 0 and Ω ⊗T k = 0, we deduce that χ ⊗T k = 0. Hence I r P s → I r P s−1 is Tor-vanishing, as desired. This finishes the induction and the proof of part (i). (ii) can be proved similarly as (i).  5. Projective dimension and regularity From now on, unless stated otherwise, we fix the following notations: Let (R, m) and (S, n) be standard graded algebras over k. Let I ⊆ R, J ⊆ S be non-zero proper homogeneous ideals. Denote T = R ⊗k S and let P = I + J ⊆ T be the mixed sum of I and J. The main technical result of this section is Proposition 5.1. We will deduce easily from Proposition 5.1 the asymptotic formulas for the projective dimension and the (Castelnuovo–Mumford) regularity of P s for s ≫ 0, recovering in part results of [25] (see Theorems 5.6 and 5.7). 5.1. Formulas. Proposition 5.1. Assume that I and J are of small type. Assume further that I i , J i 6= 0 for all i ≥ 1, e.g., R and S are reduced. Then for all s ≥ 1, we have  pdT P s = max pdR I s−i + pdS J i , pdR I s−j+1 + pdS J j + 1 , i∈[1,s−1],j∈[1,s]  regR I s−i + regS J i , regR I s−j+1 + regS J j − 1 . regT P s = max i∈[1,s−1],j∈[1,s] Proof. By the proof of Theorem 4.10, the decomposition I r P s = I r+1 P s−1 + I r J s is a Betti splitting and I r+1 P s−1 ∩ I r J s = I r+1 J s . Hence by Lemma 3.7 pdT (I r P s ) = max{pdT (I r+1 P s−1 ), pdT (I r J s ), pdT (I r+1 J s ) + 1}. Together with the isomorphism IJ ∼ = I ⊗k J and Lemma 2.3, we conclude that pdT (I r P s ) = max{pdT (I r+1 P s−1 ), pdR (I r ) + pdS (J s ), pdR (I r+1 ) + pdS (J s ) + 1}. By induction on s ≥ 1, we get  pdT (I r P s ) = max pdR I r+s−i + pdS J i , pdR I r+s−j+1 + pdS J j + 1 . i∈[0,s],j∈[1,s] Setting r = 0, we reduce to pdT P s = max i∈[0,s],j∈[1,s]  pdR I s−i + pdS J i , pdR I s−j+1 + pdS J j + 1 . The term corresponding to i = s can be omitted since it is smaller than the term corresponding to j = s. Similarly we can omit the term corresponding to i = 0, since it is smaller than the term corresponding to j = 1. Hence we receive the desired formula for pdT P s . The formula for regT P s is proved similarly.  Example 5.2. The following example shows that the equality for regularity in Proposition 5.1 does not hold without the condition I and J are of small type. We take a cue from the example in [12, Remark 2.7]. Take R = k[a, b, c, d]/(a2 − bc, ab, b2, c2 , ad, bd, cd), I = (a, d) and S = k[x, y, z, t]/(x2 − yz, xy, y 2 , z 2 , xt, yt, zt), POWERS OF SUMS 19 J = (x, t). (By abuse of notations, we denote the residue class of a in R by a itself, and so on.) We will show that the following hold: (i) Both I and J are neither of small type nor nilpotent. (ii) regR I, regS J ≥ 2. (iii) regT P 2 = 3 < 4 ≤ max{regR I + regS J, regR I 2 + regS J − 1, regR I + regS J 2 − 1}. (i) Clearly I n = (dn ) for n ≥ 3, hence I is not nilpotent. By computation with Macaulay2 [24], β1,3 (I) 6= 0 while β1,3 (I/I 2 ) = 0, so the map TorR 1 (k, I) → 2 TorR 1 (k, I/I ) is not injective. This shows that I is not of small type. By symmetry, J is also neither nilpotent nor of small type. (ii) As mentioned above, β1,3 (I) 6= 0, hence regR I ≥ 2. Similarly regS J ≥ 2. (iii) Denote U = P 2 + (d) = (d, t2 , ta, ax, a2 , x2 ), V = U + (t) = (d, t, ax, a2 , x2 ). By direct computations, P 2 : d = (a, b, c, d, x, t) and U : t = (a, d, x, y, z, z). Hence there are exact sequences   (d) T ∼ 0 → P 2 → P 2 + (d) = U → (−1) → 0. = (d) ∩ P 2 a, b, c, d, x, t) and   (t) ∼ T (−1) → 0. = (t) ∩ U (a, d, x, y, z, t) By elementary arguments, for our purpose, it suffices to show that (a) regT (a, b, c, d, x, t) = 2, regT (a, d, x, y, z, t) = 2, (b) regT V = 3. The following is a Koszul filtration for R (see [15] for more details on Koszul filtrations): {(0), (c), (c, d), (c, b), (c, b, a), (c, b, a, d)}. Hence R is a Koszul algebra by [15, Proposition 1.2], and by symmetry, the same is true for S. Letting p = m + n, we then obtain the following Koszul filtration for T : 0 → U → U + (t) = V → F = {(0), (c), (c, d), (c, b), (c, b, a), m, (c, b, a, d, z), (c, b, a, d, t), (c, b, a, d, z, t), (c, b, a, d, z, y), (c, b, , a, d, z, y, x), p} . Enlarging the filtration F by adding the ideals (d), (d, t), (d, z), (d, t, z), (d, z, y), (d, z, y, x), (d, z, y, x, t), we get a larger Koszul filtration of T . In particular, regT T /(d, t) = 0. By [13, Section 3.2, Proposition 3], this implies that regT M = regT ′ M for any finitely generated graded T -module M with (d, t)M = 0. Replacing R, S, T by R′ = R/(d), S ′ = S/(t), T ′ = R′ ⊗k S ′ , we reduce (a) and (b) to the following statements (c) regT ′ (a, b, c, x) = 2, regT ′ (a, x, y, z) = 2. (d) regT ′ (a, x)2 = 3. (c) By symmetry, it suffices to prove the second equality, which is equivalent to 1 = regT ′ (T ′ /(a, x, y, z)) = regT ′ ((R′ /(a)) ⊗k (S ′ /(x, y, z)) . Using Lemma 2.3 and the Koszulness of S ′ , this reduces to regR′ (a) = 2. Thanks to (a) ∼ = (R′ /(b, ac))(−1), we will finish the proof of (c) by showing that regR′ (b, ac) = 2. Note that R′ admits the following Koszul filtration {(0), (b), (b, a), (b, a, c)}. Moreover, (0) : b = (b, a), (b) : (ac) = (b, a, c). Hence (b, ac) is a Koszul module by [40, Proposition 5.11] and as R′ is a Koszul algebra, Subsection 2.2 yields regR′ (b, ac) = 2. Therefore regT ′ (a, x, y, z) = 2, as desired. 20 HOP D. NGUYEN AND THANH VU (d) Denote V ′ = (a, x)2 , W = (a2 ) then V ′ = W + (ax, x2 ). Since W ∼ = (T /(a, b, c))(−2), we have that regT ′ W = 2. We show next that regT ′ (W +(ax)) = 3. For this, look at the exact sequence     T′ T′ (−2) = (−2) → 0. 0 → W → W + (ax) → W : ax (b, a, y, xz) ′ It remains to show that regT ′ (b, a, y, xz) = 2. Arguing similarly as above, we obtain regR′ (b, a) = 1 and regS ′ (y, xz) = 2, hence Proposition 3.11 yields regT ′ (b, a, y, xz) = 2. The last exact sequence implies regT ′ (W + (ax)) ≤ 3 and the reverse inequality holds by direct inspection, so regT ′ (W + (ax)) = 3. Finally, since V ′ = W + (ax, x2 ), to prove regT ′ V ′ = 3, we look at     T′ T′ ′ (−2) → 0. (−2) = 0 → W + (ax) → V → (W + (ax)) : x2 (a, x, y, z) By (c), the last term in the above exact sequence has regularity 3 over T ′ , therefore regT ′ V ′ ≤ 3. The reverse inequality is true by direct inspection, hence regT ′ V ′ = 3. The proof is completed. Unfortunately, we could not find an example showing that the condition I and J are of small type is necessary for the equality of projective dimension in Proposition 5.1. We are now able to deliver the Proof of Theorem 1.1. Since char k = 0 or I and J are monomial, by Lemma 4.1(ii) and Theorem 4.5, I and J are of small type. Using the Auslander–Buchsbaum’s formula, Proposition 5.1, and the equality dim T = dim R + dim S, we see that  depth I s−i + depth J i , depth I s−j+1 + depth J j − 1 . depth P s = min i∈[1,s−1],j∈[1,s] Since I, J, P 6= (0), we can use the equality depth R/I = depth I − 1 to obtain (i). As R is a polynomial ring, for any finitely generated graded R-module M , reg M = regR M [19, Proposition, Page 89]. Arguing similarly as for the equality of depth, using the equality reg R/I = reg I − 1 and Proposition 5.1, we get (ii).  Example 5.3. It is natural to ask whether Theorem 1.1 is still true if R and S are not polynomial rings. The answer is no, even if char k = 0 and I i , J i 6= 0 for all i ≥ 1. Consider R = Q[a, b, c, d, e]/(a2 , ab, bc, d2 , de), I = (a − b, b + d), S = Q[x, y, z]/(x2 , xz, yz) and J = (x + z). Computations with Macaulay2 [24] show that: (1) depth(T /P 2 ) = 1 > 0 = depth(R/I) + depth(S/J 2 ). Hence the equality (i) for depth of Theorem 1.1 does not hold. (2) reg(T /P 2 ) = 2 < 3 = reg(R/I) + reg(S/J) + 1. Hence the equality (ii) for Castelnuovo–Mumford regularity of Theorem 1.1 does not hold. On the other hands, both equalities of Proposition 5.1 are true, thanks to Proposition 5.4 below. Indeed, since J n = ((x + z)n ) and x + z is a zero-divisor, pdS J n = pdS J = ∞ for all n ≥ 1. Furthermore, observe that 0 : (x + z) = (x) and 0 : (x + z)n = 0 : z n = (x, y) for n ≥ 2. Since the collection of ideals generated by residue classes of variables forms a Koszul filtration for S, regS J n = n for all n ≥ 1. POWERS OF SUMS 21 We may see from this example why Proposition 5.1, which deals with projective dimension and regularity over T , is a natural generalization of Theorem 1.1. In some special cases, the formulas of Proposition 5.1 hold with the assumption that only one of I and J is of small type. The following result is a generalization of [25, Proposition 2.9]; the proof of the latter cannot be adapted to our situation. Proposition 5.4. Assume that I i 6= 0 for all i ≥ 1. (i) Assume that J is of small type and pdS J i = pdS J for all i ≥ 1. Then for all s ≥ 1, there is an equality pdT P s = maxi∈[1,s] pdR I i + pdS J + 1. (ii) Assume that regS J i = i forall i ≥ 1. Then for all s ≥ 1, there is an equality regT P s = maxi∈[1,s] regR I i − i + s. φ Proof. Following [3, Page 450], we say that a map of graded R-modules M − →P is small if TorR (k, φ) is injective for all i ≥ 0. First we claim that if J is of i small type then for all r ≥ 0, s ≥ 1, the inclusion map I r+1 P s−1 → I r P s is small. Consider the following diagram with exact rows and denote U = (I r J s )/(I r+1 J s ) ∼ = (I r /I r+1 ) ⊗k J s . 0 / I r+1 J s 0  / I r+1 P s−1 / IrJ s / IrJs I r+1 J s γ /0   / IrP s / IrJs I r+1 J s /0 The long exact sequence of homology induces the following commutative rectangle. TorTi+1 (k, U )  = TorTi+1 (k, U ) / TorT (k, I r+1 J s ) i  / TorTi (k, I r+1 P s−1 ) Since J is of small type, similarly to the proof of Theorem 4.10, the map I r+1 J s → I r+1 P s−1 is Tor-vanishing, hence the diagram yields that the connecting map on the second row is zero. In other words, I r+1 P s−1 → I r P s is small, as claimed. (i) Since J is of small type, by the claim, we deduce pdT (I r P s ) = max{pdT (I r+1 P s−1 ), pdT U }  = max pdT (I r+1 P s−1 ), pdR (I r /I r+1 ) + pdS J s ,  = max pdT (I r+1 P s−1 ), pdR (I r /I r+1 ) + pdS J . The second equality follows from Lemma 2.3. The last one follows from the hypothesis. Using induction on s ≥ 1, we then get  pdT (I r P s ) = max pdR (I r+i−1 /I r+i ) + pdS J, pdR I r+s . i∈[1,s]  Setting r = 0, we obtain pdT P s = maxi∈[1,s] pdR (I i−1 /I i ) + pdS J, pdR I s . For the desired equality, it remains to show that   max pdR (I i−1 /I i ), pdR I s − pdS J = max pdR I i + 1 . i∈[1,s] i∈[1,s] i−1 i Using pdR (R/I) = pdR I + 1 and pdR (I /I ) ≤ max{pdT I i−1 , pdR I i + 1} for 2 ≤ i ≤ s, we see that the left-hand side is ≤ the right-hand side. 22 HOP D. NGUYEN AND THANH VU Conversely, using pdR I i + 1 ≤ max{pdR I i−1 + 1, pdR (I i−1 /I i )} for 2 ≤ i ≤ s, we get the reverse inequality. This finishes the proof of (i). (ii) By Proposition 4.6, J is of small type. Take r ≥ 0. By the claim from above, we again have the map I r+1 P s−1 → I r P s is small, so there is a chain regT (I r P s ) = max{regT (I r+1 P s−1 ), regT U }  = max regT (I r+1 P s−1 ), regR (I r /I r+1 ) + regS J s ,  = max regT (I r+1 P s−1 ), regR (I r /I r+1 ) + s . By induction on s ≥ 1, we obtain  regT (I r P s ) = max regT I r+s , regR (I r+i /I r+i+1 ) + s − i i∈[0,s−1]  Setting r = 0, we have regT P s = maxi∈[0,s−1] regT I s , regR (I i /I i+1 ) + s − i . For the desired conclusion, it remains to show   max regT I s − s, regR (I i /I i+1 ) − i = max regR I i − i . i∈[1,s] i∈[0,s−1] This is standard: for ≤, we note that regR (I i /I i+1 ) ≤ max{regR I i , regR I i+1 − 1} for 0 ≤ i ≤ s − 1. For ≥, we use the inequality max{regR I i−1 , regR (I i−1 /I i ) + 1} ≥ regR I i for 2 ≤ i ≤ s and the equality regR I − 1 = regR (R/I). The proof is concluded.  5.2. Asymptotes. Define the index of projective dimension stability of I to be pstab(I) = min{r ≥ 1 : pdR I i = lims→∞ pdR I s for all i ≥ r}. This is a welldefined finite number, e.g. by a result of Kodiyalam [37, Corollary 8]. Theorem 5.5. Assume that I and J are of small type and I i , J i 6= 0 for all i ≥ 1. Then for all s ≥ pstab(I) + pstab(J), we have   s i j i j pdT P = max lim pdR I + max pdS J + 1, max pdR I + lim pdS J + 1 . i→∞ j≥1 j→∞ i≥1 Proof. By Proposition 5.1 and its proof, we have  pdT P s = max pdR I s−i + pdS J i , pdR I s−j+1 + pdS J j + 1 . i∈[1,s],j∈[1,s]  First we determine maxi=1,...,s pdR I s−i + pdS J i . If pstab(J) ≤ i ≤ s then pdS J i = limj→∞ pdS J j . For every such i, 0 ≤ s − i ≤ s − pstab(J) and s − pstab(J) ≥ pstab(I), hence max pstab(J)≤i≤s pdR I s−i = max i=0,...,pstab(I) pdR I i = max pdR I i . i≥1 So we obtain max i=pstab(J),...,s  pdR I s−i + pdS J i = max pdR I i + lim pdS J j . j→∞ i≥1 If 1 ≤ i ≤ pstab(J) then s − i ≥ pstab(I), hence pdR I s−i = limi→∞ pdR I i . Thus  max pdS J j max pdR I s−i + pdS J i = lim pdR I i + i=1,...,pstab(J) i→∞ j=1,...,pstab(J) i = lim pdR I + max pdS J j . i→∞ j≥1 POWERS OF SUMS 23 Summing up  max pdR I s−i + pdS J i = i=1,...,s   max max pdR I i + lim pdS J j , lim pdR I i + max pdS J j . j→∞ i≥1 i→∞ j≥1 Similarly, we have  max pdR I s−j+1 + pdS J j + 1 = j=1,...,s   i j i j max max pdR I + lim pdS J + 1, lim pdR I + max pdS J + 1 . j→∞ i≥1 i→∞ j≥1 s This yields the desired equality for pdT P .  The index of depth stability of I, denoted by dstab(I), is the least number r such that depth I i = lim depth I s for all i ≥ r. The next theorem recovers partly s→∞ [25, Theorem 4.6] with an easier argument. Theorem 5.6. Assume that R and S are polynomial rings over k, and either char k = 0 or I and J are monomial ideals. Then for all s ≥ dstab(I) + dstab(J), we have   pdT P s = max lim pdR I i + max pdS J j + 1, max pdR I i + lim pdS J j + 1 . i→∞ j≥1 i≥1 j→∞ Proof. Since R, S, T are regular rings, by the Auslander–Buchsbaum’s formula, we have equalities pstab(I) = dstab(I), pstab(J) = dstab(J). Moreover, by Lemma 4.1(ii) and Theorem 4.5, I and J are of small type. Hence the result follows from  Theorem 5.5. Assume that R and S are polynomial rings over k. By the result due of Kodiyalam [38] and Cutkosky–Herzog–N.V. Trung [16], we can define the regularity stabilization index of I, denoted rstab(I), as follows min{r ≥ 1 : there exist constants a and g such that reg I s = as + g for all s ≥ r}. Note that in [25], the notation lin(I) was used in place of rstab(I). The next result is a special case of [25, Proposition 5.7] but its proof is easier. Theorem 5.7. Assume that R and S are polynomial rings over k. Assume in addition that either char k = 0 or I and J are monomial ideals. Suppose that reg I r = ar+g for all r ≥ rstab(I) and reg J s = bs+h for all s ≥ rstab(J), and moreover a ≥ b. Denote g ∗ = maxi=1,...,rstab(I) (reg I i − bi) and h∗ = maxj=1,...,rstab(J) (reg J j − aj). Then for all s ≥ rstab(I) + rstab(J), we have reg P s = max {a(s + 1) + g + h∗ , b(s + 1) + g ∗ + h} − 1. Sketch of proof. By Lemma 4.1(ii) and Theorem 4.5, I and J are of small type. Hence applying Proposition 5.1 and its proof, we have  reg I s−i + reg J i , reg I s−j+1 + reg J j − 1 . (5.1) reg P s = max i∈[1,s],j∈[1,s] First we show that  max reg I s−i + reg J i = max {as + g + h∗ , bs + g ∗ + h} . i=1,...,s (5.2) 24 HOP D. NGUYEN AND THANH VU The argument runs along the line of the proof of Theorem 5.5. Similarly to (5.2), we have  max reg I s−i+1 + reg J i − 1 = i=1,...,s max {a(s + 1) + g + h∗ − 1, b(s + 1) + g ∗ + h − 1} . Combining Equalities (5.1), (5.2) and (5.3), we get the desired equality. (5.3)  5.3. Applications. In this subsection, assume that R and S are polynomial rings over k. Recall that the depth function of I is given by r 7→ depth(R/I r ) for r ≥ 1. By Brodmann’s theorem [6], the sequence of values of any depth function is eventually constant. We say that I has a constant depth function if (depth(R/I r ))r≥1 is a constant sequence. One of the main applications of [25] is the following Proposition 5.8 (Hà, Trung and Trung, [25, Proposition 4.7]). Let I and J be squarefree monomial ideals of R and S, resp. Then I + J has a constant depth function if and only if both I and J do. For squarefree monomial ideals, the last result simplifies significantly the equivalence (i) ⇔ (ii) of [34, Theorem 1.1], which has to require that the Rees algebras of I and J are Cohen–Macaulay. Thanks to Theorem 1.1, we obtain the following improvement of (the “if” part of) Proposition 5.8. Corollary 5.9. If either char k = 0, or I and J are (possibly non-squarefree) monomial ideals, then I + J has a constant depth function if I and J do. If I and J are squarefree monomial ideals, then conversely, if I + J has a constant depth function then both I and J do. Our proof of the second part of this result is more straightforward than the original proof of [25, Proposition 4.7]. As noted in [25, Example 4.8], the second statement of Corollary 5.9 does not hold if I and J are non-squarefree monomial ideals, even in characteristic zero. Proof of Corollary 5.9. The first statement is immediate from√Theorem 1.1(i). For the second statement, we use the inequality depth R/ L ≥ depth R/L for L being a monomial ideal of R [33, Proof of Theorem 2.6]. In particular, since I and J are squarefree monomial ideals, depth R/I ≥ depth R/I s and depth S/J ≥ depth S/J s for all s ≥ 1. By Theorem 1.1(i), depth T /P = depth R/I + depth S/J and for all n ≥ 2, depth T /P s =  min depth R/I i + depth S/J s−i+1 + 1, depth R/I j + depth S/J s−j i∈[1,s−1],j∈[1,s] ≤ min {depth R/I j + depth S/J s−j } j∈[1,s] ≤ depth R/I + depth S/J = depth T /P. Since P = I +J has a constant depth function, we conclude that depth I s = depth I and depth J s = depth J for all s ≥ 1. The proof is finished.  The authors of [25] could not provide an upper bound for the index of depth stability of P in terms of those of I and J (see page 821 of loc. cit.). With the assumptions of Theorem 1.1, we can easily provide a reasonable bound. Theorems 5.6 and 5.7 yield the following inequalities. The second of these inequalities provides a slightly better upper bound for rstab(I + J) than [25, Corollary 5.8]. POWERS OF SUMS 25 Corollary 5.10. Assume that either char k = 0 or I and J are monomial ideals. Then dstab(I + J) ≤ dstab(I) + dstab(J). If furthermore, in the notations of Theorem 5.7, we have a = b, then rstab(I + J) ≤ rstab(I) + rstab(J). The following statement is possibly of independent interest. Corollary 5.11. Assume that either char k = 0 or I is a monomial ideal. Then for R s s−1 all s ≥ 1, the map TorR ) is zero for every i ≥ 0. Moreover, i (k, I ) → Tori (k, I there are equalities depth(I s−1 /I s ) = min{depth I s−1 , depth I s − 1}, reg(I s−1 /I s ) = max{reg I s−1 , reg I s − 1}. Proof. The first statement follows from combining Lemma 4.1(ii) and Theorem 4.5. The equalities follow from Lemma 3.3 and the Auslander–Buchsbaum’s formula.  Remark 5.12. The authors of [25] expressed in page 832 their feeling that “In general, there seems to be no relationships between the stability indices of the functions depth R/I n and depth I n−1 /I n ”. Corollary 5.11 renders this opinion disputable: the stability index of the function depth I s−1 /I s is at most the stability index of the function depth R/I s , at least if char k = 0 or I is monomial. 6. Linearity defect In this section, we characterize the (asymptotic) linearity defect of powers of P in terms of the data of I and J. The goal is to find formulas similar to those of Proposition 5.1 and Theorem 5.5. If I and J are of small type, using Betti splittings, we get similar upper bounds which in many situations are actual values for ldT P s : In fact the equality occurs if I and J are of doubly small type. There is a lower bound max{ldR I s , ldS J s } ≤ ldT P s following from Lemma 2.4, but this is far from sharp even for the starting case s = 1, as seen from Proposition 3.11(ii). 6.1. Upper bounds and formulas. The first main result of this section is the following. Part (ii) of the next result is the motive for introducing ideals of doubly small type. Theorem 6.1. Let I and J be ideals of small type. Assume that I i 6= 0, J i 6= 0 for all i ≥ 1, e.g. R and S are reduced. Then the following statements hold: (i) For all s ≥ 1, we have an inequality  ldT P s ≤ max ldR I s−i + ldS J i , ldR I s−j+1 + ldS J j + 1 . i∈[1,s−1],j∈[1,s] (ii) Assume further that both I and J are of doubly small type. Then the inequality in (i) is an equality for all s ≥ 1. Proof. (i) By Theorem 4.10, the decomposition I r P s = I r+1 P s−1 + I r J s is a Betti splitting. Hence by Proposition 3.9 and Lemma 2.2, we obtain ldT (I r P s ) ≤ max{ldT (I r+1 P s−1 ), ldT (I r J s ), ldT (I r+1 J s ) + 1}. (6.1) Using Lemma 2.3, we then get ldT (I r P s ) ≤ max{ldT (I r+1 P s−1 ), ldR I r + ldS J s , ldR I r+1 + ldS J s + 1}. Using induction on s, we infer that  ldT (I r P s ) ≤ max ldR I r+s−i + ldS J i , ldR I r+s−j+1 + ldS J j + 1 . (6.2) i∈[0,s],j∈[1,s] 26 HOP D. NGUYEN AND THANH VU Setting r = 0 in (i), the conclusion is  ldR I s−i + ldS J i , ldR I s−j+1 + ldS J j + 1 . ldT P s ≤ max i∈[0,s],j∈[1,s] The term on the right-hand side corresponding to i = 0 can be omitted, since it is smaller than the term corresponding to j = 1. Similarly, the term on the righthand side corresponding to i = s can be omitted, since it is smaller than the term corresponding to j = s. Hence the desired inequality follows. (ii) Since I and J are of doubly small type, by Theorem 4.10, the maps I r+1 J s → r s I J and I r+1 J s → I r+1 P s−1 are doubly Tor-vanishing. Consider the exact sequence 0 −→ I r+1 J s −→ I r J s ⊕ I r+1 P s−1 −→ I r P s −→ 0. As all the powers of I and J are non-trivial, we also have I i J j ∼ = I i ⊗k J j 6= 0 for all i, j ≥ 0. Applying Lemma 3.3, we see that (6.1) is now an equality. Hence so is (6.2), giving the desired conclusion.  Example 6.2. The following example shows that the condition I and J are of small type is necessary for the conclusion of Theorem 6.1. Consider the rings and ideals R = k[a, b, c]/(a2 , bc), I = (a + b) and S = k[x, y, z]/(x2 , yz), J = (x + y). We will show that (i) I and J are neither of small type nor nilpotent, (ii) ldR I = ldS J = 1, ldR I 2 = ldS J 2 = 0, (iii) ldT P 2 ≥ 4 > 2 = max{ldR I + ldS J, ldR I 2 + ldS J + 1, ldR I + ldS J 2 + 1}. (i) We have I n = (a + b)bn−1 for n ≥ 2, hence I is not nilpotent. By direct inspection, 0 : (a + b) = (ac), hence β1,3 (I) 6= 0. On the other hand, (a + b)2 : R 2 (a + b) = (a + b), hence β1,3 (I/I 2 ) = 0. The map TorR 1 (k, I) → Tor1 (k, I/I ) being not injective, so I is not of small type. By symmetry, J is neither nilpotent nor of small type. (ii) Since R is Koszul and regR I ≥ 2, ldR I ≥ 1. On the other hand, 0 : (a + b) = (ac) and as R is defined a by quadratic monomial ideal, 0 : (ac) = (a, b) has a 1-linear resolution over R. This implies that ldR I = 1. Observe that I 2 = (ab + b2 ) and 0 : (ab + b2 ) = (c) has a 1-linear resolution over R, so ldR I 2 = 0. By symmetry, we also have ldS J = 1, ldS J 2 = 0. (iii) By computations with Macaulay2 [24], β4,8 (P 2 ) 6= 0 while β3,i = 0 for i ≥ 7. Let F be the minimal graded free resolution of P 2 over T . Then in linT F , the map (linT F )4 → (linT F )3 has non-trivial kernel. This implies that ldT P 2 ≥ 4, as desired. The second main result of this section is an analog of Proposition 5.4(ii). We were benefited by the method of [25] in Step 2 of the proof. Theorem 6.3. Assume that J is of small type and I is an ideal generated by linear forms of R such that all the powers of I are Koszul. Assume further that I i , J i 6= 0 for all i ≥ 1. Then for all s ≥ 1, we have ldT P s = maxi∈[1,s] {ldS J i }. Proof. We prove more generally for all r ≥ 0, s ≥ 1 the equality ldT (I r P s ) = maxi∈[1,s] {ldS J i }. Step 1: Consider the following exact sequence 0 −→ I r+1 P s−1 −→ I r P s −→ I r J s /(I r+1 J s ) ∼ = (I r /I r+1 ) ⊗k J s −→ 0. POWERS OF SUMS 27 Since J is of small type, by the claim in the proof of Proposition 5.4, the map r s r+1 s r+1 s−1 TorR J )) → TorR P ) is zero for all i ≥ 0. By [40, Propoi+1 (k, I J /(I i (k, I sition 2.5(ii)], there is an inequality   ldT (I r P s ) ≤ max ldT (I r+1 P s−1 ), ldT (I r /I r+1 ) ⊗k J s . (6.3) Using Theorem 3.10, we prove that I r /I r+1 is a Koszul R-module. For this, we need to check that (a) I r and I r+1 are Koszul, and (b) I r+1 ∩ ms+1 I r = ms I r+1 for all s ≥ 0. The hypothesis guarantees (a), while (b) holds true by degree reason and the fact that I is generated by linear forms. Hence by Theorem 3.10, Ir /I r+1 is Koszul. Together with Lemma 2.3, we conclude that ldT (I r /I r+1 ) ⊗k J s = ldS J s . Hence from (6.3), we get the inequality ldT (I r P s ) ≤ max{ldT (I r+1 P s−1 ), ldS J s }. Using induction on s ≥ 1 and the fact that the powers of I are Koszul, we get ldT (I r P s ) ≤ maxi∈[1,s] {ldS J i }. Step 2: It remains to show that ldT (I r P s ) ≥ maxi∈[1,s] {ldS J i } for all r ≥ 0, s ≥ 1. There is nothing to do if the right-hand side is 0, hence we will assume its positivity. By Lemmas 2.2 and 2.3, there is an equality   ldT I r P s−1 /I r P s = max ldR (I r+i /I r+i+1 ) + ldS (J s−i−1 /J s−i ) . i∈[0,s−1] As proved in (i), I r /I r+1 is Koszul for all r. So we get   ldT I r P s−1 /I r P s = max ldS (J i−1 /J i ) . i∈[1,s] i Claim: Given maxi∈[1,s] {ldS J } ≥ 1, it holds that  max ldS (J i−1 /J i ) = max {ldS J i } + 1. i∈[1,s] i∈[1,s] (6.4) Proof of the claim. Since J is of small type, Proposition 3.8 yields ldS (J i−1 /J i ) ≤ max{ldS J i−1 , ldS J i + 1} for 1 ≤ i ≤ s. These inequalities imply that the left-hand side of (6.4) is ≤ the right-hand side. For the reverse inequality, again using Proposition 3.8, we have ldS J i ≤ max{ldS J i−1 , ldS (J i−1 /J i ) − 1} for 2 ≤ i ≤ s. Hence it suffices to show that ldS J +1 ≤ the left-hand side of (6.4). If ldS (S/J) ≥ 1, we have ldS J + 1 = ldS (S/J) and we are done. If ldS (S/J) = 0 then also ldS J = 0 and the desired inequality holds unless the left-hand side of (6.4) is zero. But if that happens then by induction on i and Proposition 3.8, we have ldS J i = 0 for 1 ≤ i ≤ s. This contradicts the assumption maxi∈[1,s] {ldS J i } ≥ 1. So ldS J + 1 ≤ the left-hand side of (6.4) and the claim follows. The previous discussions show that  ldT I r P s−1 /I r P s = max {ldS J i } + 1. i∈[1,s] By the proof of Theorem 4.10, the map I r P s → I r P s−1 is Tor-vanishing. Hence by Proposition 3.8, there is an inequality  ldT I r P s−1 /I r P s ≤ max{ldT (I r P s−1 ), ldT (I r P s ) + 1}. Putting everything together, we obtain max {ldS J i } + 1 ≤ max{ldT (I r P s−1 ), ldT (I r P s ) + 1}. i∈[1,s] 28 HOP D. NGUYEN AND THANH VU Recall that from Step 1, ldT (I r P s−1 ) ≤ maxi∈[1,s−1] {ldS J i }, hence ldT (I r P s ) ≥ maxi∈[1,s] {ldS J i }, as desired. The proof is concluded.  Example 6.4. The conclusion of Theorem 6.3 does not hold if J is not of small type. Consider R = k[a], I = (a), S = k[x, y, z]/(x2 , yz) and J = (x + y). By Example 6.2, J is not of small type. We claim that in T = R ⊗k S, ldT P 2 ≥ 2 > 1 = max{ldS J, ldS J 2 }. Indeed, by computations with Macaulay2 [24], β2,5 (P 2 ) 6= 0 while β1,j (P 2 ) = 0 for j ≥ 4. Similarly to Example 6.2, ldT P 2 ≥ 2. 6.2. Asymptotes. Denote by gl ld R = sup{ldR M : M is a finitely generated graded R-module} the so-called global linearity defect of R. For example, if R is a regular ring or more generally a quadratic hypersurface then gl ld R = dim R; see [14, Corollary 6.4]. Let the index of linearity defect stability of I, lstab(I), to be the least positive integer r such that for all i ≥ r, ldR I i is a constant depending only on I. By [43, Theorem 1.1], if gl ld R < ∞ then lstab(J) is well-defined and finite for every I. The third main result of Section 6 is Theorem 6.5. Assume that R and S have finite global linearity defect and I i 6= 0, J i 6= 0 for all i ≥ 1. Assume further that I and J are of doubly small type. Then for all s ≥ lstab(I) + lstab(J), we have   ldT P s = max lim ldR I i + max ldS J j + 1, max ldR I i + lim ldS J j + 1 . i→∞ j≥1 i≥1 j→∞ Proof. The proof is parallel to that of Theorem 5.5, taking Theorem 6.1(iii) into account.  Corollary 6.6. With the notations and assumptions of Theorem 6.5, there is an inequality lstab(I + J) ≤ lstab(I) + lstab(J). We are able to compute ldT P s , s large enough, in some fairly general cases. Corollary 6.7. Let (R, m), (S, n) be polynomial rings over k. Let (0) 6= I ⊆ m2 , (0) 6= J ⊆ n2 be homogeneous ideals of R, S, resp. Assume that one of the following conditions holds: (i) char k = 0 and I = U p and J = V q where p, q ≥ 2 and U, V are homogeneous ideals of R, S, resp. (ii) I = U p and J = V q where p, q ≥ 2 and U, V are monomial ideals of R, S, resp. (iii) All of the powers of I and J are Koszul. Then for all s ≥ lstab(I) + lstab(J), there is an equality   s i j i j ldT P = max lim ldR I + max ldS J + 1, max ldR I + lim ldS J + 1 . i→∞ j≥1 i≥1 j→∞ Proof. This follows by combining Propositions 4.6, 4.8 and Theorem 6.5.  If additionally, one of I and J is generated by linear forms, we have a nicer asymptotic statement. Theorem 6.8. Let R, S be polynomial rings over k. Let I be generated by linear forms. Assume further that one of the following conditions holds: (i) char k = 0. POWERS OF SUMS 29 (ii) J is a monomial ideal of S. (iii) All the powers of J are Koszul. Then for all s ≥ 1, there is an equality ldT P s = maxi∈[1,s] {ldS J i }. Moreover, if 1 ≤ p ≤ lstab(J) be minimal such that ldS J p = maxi≥1 {ldS J i } then ldT P s = maxi≥1 {ldS J i } for all s ≥ p and lstab(I + J) = p. Proof. By Lemma 4.1(ii), Theorem 4.5 and Proposition 4.6, J is of small type. As all the powers of I have a linear resolution, the result is immediate from Theorem 6.3.  6.3. Ideals with Koszul powers. Corollary 6.9. Assume that R and S are reduced and I is generated by linear forms. The following statements are equivalent: (i) All the powers of I and J are Koszul ideals; (ii) All the powers of P are Koszul ideals. Proof. For (ii) =⇒ (i): Take s ≥ 1. Since ldT P s = 0, using Lemma 2.4, we get ldR I s ≤ ldT P s = 0. Hence I have Koszul powers. Similar arguments work for J. For (i) =⇒ (ii): Applying Proposition 4.6, we see that J is of small type. By Theorem 6.3, we conclude the proof.  The following result supplies computation of the linearity defect of powers for a non-trivial class of ideals. Theorem 6.10. Let (R1 , m1 ), . . . , (Rc , mc ) be Koszul, reduced k-algebras, where c ≥ 1. For each i = 1, . . . , c, let (0) 6= Ii ⊆ m2i be a homogeneous ideal of Ri such that all the powers of Ii are Koszul. Denote P = I1 + I2 + · · · + Ic ⊆ T = R1 ⊗k · · · ⊗k Rc the mixed sum of I1 , . . . , Ic . Then ldT P s = c − 1 for all s ≥ 1. Proof. We proceed by induction on c ≥ 1. The case c = 1 is a tautology. Assume that c ≥ 2. By the hypothesis and Proposition 4.6, Ii is of doubly small type for all 1 ≤ i ≤ c. Denote J = I2 + · · · + Ic ⊆ S = R2 ⊗k · · · ⊗k Rc , then by Theorem 4.10(ii), J is of doubly small type. By the induction hypothesis, ldS J s = c − 2 for all s ≥ 1. Note that all the powers of J are non-zero, since all the powers of I2 , . . . , Ic are so. Hence applying Theorem 6.1(ii) to the sum P = I1 + J, we get that for any s ≥ 1, ldT P s = max i∈[1,s−1],j∈[1,s] {ldR1 I1s−i + ldS J i , ldR1 I1s−j+1 + ldS J j + 1} = c − 1. This concludes the induction and the proof.  Acknowledgments. This project was completed in part thanks to our visits to the University of Nebraska – Lincoln in March 2015 and the Vietnam Institute for Advanced Study in Mathematics (VIASM) in April and May 2016. We are grateful to the highly efficient staff and the inspiring working environment at the VIASM, which made our stay an enjoyable experience. We are grateful to Ngô Viêt Trung, Trân Nam Trung for many useful suggestions related to this paper. Thanks are also due to Luchezar Avramov, Hailong Dao and Jeff Mermin for some useful discussions on the terminology. The first author was a Marie Curie fellow of the Istituto Nazionale di Alta Matematica. 30 HOP D. NGUYEN AND THANH VU References [1] R. Ahangari Maleki, Golod property of powers of ideals and ideals with linear resolutions. Preprint (2015), http://arxiv.org/abs/1510.04435. [2] R. Ahangari Maleki and M.E. Rossi, Regularity and linearity defect of modules over local rings. J. Commut. Algebra 6, no. 4 (2014), 485–504. [3] L.L. Avramov, Small homomorphisms of local rings. J. Algebra 50, vol. 2, (1978), 400–453. [4] L.L. Avramov, Infinite free resolution. in Six lectures on Commutative Algebra (Bellaterra, 1996), 1–118, Progr. Math., 166, Birkhäuser (1998). [5] S. Bandari, J. Herzog, and T. Hibi, Monomial ideals whose depth function has any given number of strict local maxima. Ark. Mat. 52 (2014), 11–19. [6] M. Brodmann, The asymptotic nature of the analytic spread. Math. Proc. Cambridge Philos. Soc. 86 (1979), no. 1, 35–39. [7] W. Bruns and A. Conca, Linear resolutions of powers and products. Preprint (2016), available online at http://arxiv.org/abs/1602.07996. [8] W. Bruns and J. Herzog, Cohen-Macaulay rings. Rev. ed.. Cambridge Studies in Advanced Mathematics 39, Cambridge University Press (1998). [9] M. Chardin, Powers of ideals and the cohomology of stalks and fibers of morphisms. Algebra Number Theory 7 (2013), no. 1, 1–18. [10] M. Chardin, Powers of ideals: Betti numers, cohomology and regularity. in (I. Peeva, ed.), Commutative algebra: expository papers dedicated to David Eisenbud on the occasion of his 65th birthday, pp. 317–333, Springer, New York (2013). [11] M. Chardin, J.-P. Jouanolou, and A. Rahimi, The eventual stability of depth, associated primes and cohomology of a graded module. J. Commut. Algebra 5, no. 1 (2013), 63–92. [12] A. Conca, Universally Koszul algebras. Math. Ann. 317 (2000), 329–346. [13] A. Conca, E. De Negri and M.E. Rossi, Koszul algebra and regularity. in Commutative Algebra: expository papers dedicated to David Eisenbud on the occasion of his 65th birthday, I. Peeva (ed.), Springer (2013), 285–315. [14] A. Conca, S.B. Iyengar, H.D. Nguyen and T. Römer, Absolutely Koszul algebras and the Backelin-Roos property. Acta Math. Vietnam. 40 (2015), 353–374. [15] A. Conca, N.V. Trung and G. Valla, Koszul property for points in projective space. Math. Scand. 89 (2001), 201–216. [16] S.D. Cutkosky, J. Herzog and N.V. Trung, Asymptotic behaviour of the Castelnuovo– Mumford regularity. Compositio Math. 118 (1999), no. 3, 243–261. [17] D. Eisenbud, Commutative algebra. With a view toward algebraic geometry. Graduate Texts in Mathematics 150. Springer-Verlag, New York (1995). [18] D. Eisenbud, G. Fløystad and F. -O. Schreyer, Sheaf cohomology and free resolutions over exterior algebras. Trans. Amer. Math. Soc. 355 (2003), 4397–4426. [19] D. Eisenbud and S. Goto, Linear free resolutions and minimal multiplicity. J. Algebra 88 (1984), 89–133. [20] D. Eisenbud and J. Harris, Powers of ideals and fibers of morphisms. Math. Res. Lett. 17 (2010), no. 2, 267–273. [21] D. Eisenbud and B. Ulrich, Notes on regularity stabilization. Proc. Amer. Math. Soc. 140 (2012), no. 4, 1221–1232. [22] S. Eliahou and M. Kervaire, Minimal resolutions of some monomial ideals. J. Algebra 129 (1990), no. 1, 1–25. [23] C. Francisco, H.T. Hà, and A. Van Tuyl, Splittings of monomial ideals. Proc. Amer. Math. Soc. 137 (2009), 3271–3282. [24] D. Grayson and M. Stillman, Macaulay2, a software system for research in algebraic geometry. Available at http://www.math.uiuc.edu/Macaulay2. [25] H.T. Hà, N.V. Trung and T.N. Trung, Depth and regularity of powers of sums of ideals. Math. Z. 282 (2016), no. 3–4, 819–838. [26] J. Herzog and T. Hibi, Componentwise linear ideals. Nagoya Math. J. 153 (1999), 141–153. [27] J. Herzog and T. Hibi, The depth of powers of an ideal. J. Algebra 291 (2005), no. 2, 534–550. [28] J. Herzog and T. Hibi, Monomial ideals. Graduate Texts in Mathematics 260, Springer (2011). [29] J. Herzog, T. Hibi and H. Ohsugi, Powers of componentwise linear ideals. Abel Symp. 6, Springer, Berlin (2011). POWERS OF SUMS 31 [30] J. Herzog, T. Hibi and X. Zheng, Monomial ideals whose powers have a linear resolution. Math. Scand. 95 (2004), 23–32. [31] J. Herzog and C. Huneke, Ordinary and symbolic powers are Golod. Adv. Math. 246 (2013), 89–99. [32] J. Herzog and S.B. Iyengar, Koszul modules. J. Pure Appl. Algebra 201 (2005), 154–188. [33] J. Herzog, Y. Takayama, and N. Terai, On the radical of a monomial ideal. Arch. Math. 85 (2005), 397–408. [34] J. Herzog and M. Vladiou, Squarefree monomial ideals with constant depth function. J. Pure Appl. Algebra 217 (2013), no. 9, 1764–1772. [35] L.T. Hoa and N.D. Tam, On some invariants of a mixed product of ideals. Arch. Math. 94 (2010), 327–337. [36] C. Huneke and I. Swanson, Integral closure of ideals, rings, and modules. Cambridge University Press (2006). [37] V. Kodiyalam, Homological invariants of powers of an ideal. Proc. Amer. Math. Soc. 118 (1993), 757–764. [38] V. Kodiyalam, Asymptotic behaviour of Castelnuovo–Mumford regularity. Proc. Amer. Math. Soc. 128 (2000), no. 2, 407–411. [39] L.D. Nam and M. Varbaro, When does depth stabilizes early on? J. Algebra 445 (2016), 181–192. [40] H.D. Nguyen, Notes on the linearity defect and applications. To appear in Ill. J. Math., available online at http://arxiv.org/abs/1411.0261. [41] H.D. Nguyen and T.Vu, Linearity defects of powers are eventually constant. Preprint (2015), available online at http://arxiv.org/abs/1504.04853v1. [42] H.D. Nguyen and T. Vu, On the asymptotic behavior of the linearity defect. Preprint (2016), available online at http://arxiv.org/abs/1504.04853v3. [43] H.D. Nguyen and T. Vu, Linearity defect of edge ideals and Fröberg’s theorem. J. Algebr. Combin. 44 (2016), 165–199. [44] I. Peeva, Graded syzygies. Algebra and Applications. Volume 14, Springer, London (2011). [45] T. Römer, On minimal graded free resolutions. Ph.D. dissertation, University of Essen (2001). [46] T. Römer, Homological properties of bigraded algebras. Ill. J. Math. 45, no. 4 (2001), 1361– 1376. [47] L.M. Şega, On the linearity defect of the residue field. J. Algebra 384 (2013), 276–290. [48] D. Taylor, Ideals generated by monomials in an R-sequence. Ph.D. thesis, University of Chicago (1960). [49] N.V. Trung and H.-J. Wang, On the asymptotic linearity of Castelnuovo–Mumford regularity. J. Pure Appl. Algebra 201 (2005) 42–48. Dipartimento di Matematica, Università di Genova, Via Dodecaneso 35, 16146 Genoa, Italy E-mail address: [email protected] Department of Mathematics, University of Nebraska-Lincoln, Lincoln, NE 68588, USA E-mail address: [email protected]
0math.AC
Densely Connected Convolutional Networks and Signal Quality Analysis to Detect Atrial Fibrillation Using Short Single-Lead ECG Recordings Jonathan Rubin1*, Saman Parvaneh1*, Asif Rahman1, Bryan Conroy1, Saeed Babaeizadeh2 1 2 Philips Research North America, Cambridge, MA, USA Advanced Algorithm Research Center, Philips Healthcare, Andover, MA, USA Abstract The development of new technology such as wearables that record high-quality single channel ECG, provides an opportunity for ECG screening in a larger population, especially for atrial fibrillation screening. The main goal of this study is to develop an automatic classification algorithm for normal sinus rhythm (NSR), atrial fibrillation (AF), other rhythms (O), and noise from a single channel short ECG segment (9-60 seconds). For this purpose, signal quality index (SQI) along with dense convolutional neural networks was used. Two convolutional neural network (CNN) models (main model that accepts 15 seconds ECG and secondary model that processes 9 seconds shorter ECG) were trained using the training data set. If the recording is determined to be of low quality by SQI, it is immediately classified as noisy. Otherwise, it is transformed to a time-frequency representation and classified with the CNN as NSR, AF, O, or noise. At the final step, a feature-based post-processing algorithm classifies the rhythm as either NSR or O in case the CNN model’s discrimination between the two is indeterminate. The best result achieved at the official phase of the PhysioNet/CinC challenge on the blind test set was 0.80 (F1 for NSR, AF, and O were 0.90, 0.80, and 0.70, respectively). 1. Introduction Atrial Fibrillation (AF) is the most common heart arrhythmia and its incidence in the United States alone is estimated to be 2.7-6.1 million people [1]. As such, AF screening using handheld easy-to-use devices has received a lot of attention in recent years. The goal of the 2017 PhysioNet/CinC Challenge is the development of algorithms to classify normal sinus rhythm (NSR), AF, other rhythm (O), and noisy recordings from a short singlechannel ECG recording (9-60 seconds). In light of the successful utilization of deep neural networks for * Authors contributed equally classification of biomedical time series (e.g., heart sounds) [2-5], a signal quality index (SQI) technique along with dense convolutional neural networks (CNN) trained with spectrogram representations were used for classification of ECG recordings. 2. Method and Material A block diagram of our proposed method is shown in Figure 1. Given an ECG recording, first QRS detection takes place, followed by signal quality analysis. If the recording is judged to be of low quality (further details in Section 2.2), it is immediately classified as noisy (noise detected by SQI in Figure 1). If the recording quality is determined to be reasonable (SQI>0.5), the ECG is transformed from a one-dimensional time-series to a timefrequency representation and consecutively evaluated using one of two CNNs, depending on the signal recording length. The first model accepts as input 15-second ECG segments. However, if the input recording is shorter than 15 seconds, a secondary model that processes 9-second ECG segments is used. Both models employ the Densely Connected Convolutional Network (DenseNet) architecture [6]. Compared to a standard CNN architecture, each layer within a DenseNet architecture concatenates all preceding layer feature-maps as input. Figure 2 illustrates this concept, where arrows indicate reused feature-maps from previous layers in a five-layer dense block. Each DenseNet model accepts as input a spectrogram segment computed by consecutive Fourier transforms (details could be found in section 2.4). The original DenseNet architecture was modified to ensure batch normalization [7] could be performed row-wise (i.e. normalizing over frequency bins per batch). This modification resulted in networks that outperformed standard channel-wide batch normalization. If the input ECG was labelled as NSR or O by the DenseNet model, an additional check was performed by a post-processing unit (further details in Section 2.5). Figure 1. Block diagram of the proposed algorithm. 2.1. Data Splitting and Augmentation The training set for the challenge included 8,528 singlechannel ECG recordings (NSR: 5050, AF: 738, other rhythm: 2456, and noisy: 284). Details about the challenge dataset can be found in [8]. A 5-fold stratified split was applied to the 8,528 ECG recordings made available by the challenge organizers. Stratified splitting was used to maintain class prevalence between the data splits. Recordings from four of the splits were used to construct a training/validation set (6821 ECG recordings) made up of the QRS aligned spectrogram segments. The training set included 80% of the above recordings. The other 20% were used as a validation set during model training. The remaining stratified split, consisting of 1,707 ECG recordings, was kept as an in-house test-set for assessing algorithm performance, independent from the blind challenge test dataset. A further 6,312 30-second ECG segments representing atrial fibrillation were collected from various sources (including ambulatory recordings from Holter monitors) and used to augment the training and validation sets. Baseline wander was removed from each AF segment and was up-sampled from 250 to 300 samples-per-second in order to match the sampling rate of the challenge dataset. 2.2. QRS Detection and Signal Quality Assessment After removing baseline wander using a moving average filter, QRS complexes were detected using gqrs algorithm, publicly available in WFDB toolbox [9]. After aligning by the detected QRS peaks, average template matching correlation coefficient [10] with the threshold of 0.5 was used as SQI to identify noisy data. This measure had the highest area under the receiver operating characteristic (ROC) curve for discriminating between artefacts and arrhythmic ECG [11]. 2.4. Dense Convolutional Neural Networks If the quality of ECG recording was reasonable (SQI> 0.5) by the SQI module, rhythm classification took place using a dense convolutional neural network. Recordings processed by CNNs were classified as NSR, AF, O, as well as noisy. Recall that, at first, an attempt is made to use a CNN model that processes 15-second segments. However, if the input recording length is not long enough, a secondary model that processes 9-second segments is used. 2.4.1. Main and Secondary Models Main model: The 15-second model is made up of 3 dense blocks consisting total of 40 layers. Each layer involves applying a convolutional filter, followed by ReLU activation and row-wise batch normalization. A growth rate of 6 feature-maps was used for each layer. Model input dimensions were a single channel of 20 frequency bins by 375 time segments. The first 20 frequency bins from the computed spectrogram captures a frequency range of up to approximately 50 Hz. In total, the model consisted of 262,344 trainable parameters. Secondary Model: The architecture used for the secondary model was similar to the main model, however, a smaller growth rate of 4 feature-maps was used per layer. Model input dimensions were a single channel of 20 frequency bins by 225 time segments, height and width. The lower width resulting from the shorter 9-second segment size. In total, the secondary model consisted of 119,458 trainable parameters. 2.3. Spectrogram For each recording, a spectrogram was constructed using an FFT applied on a moving window with the length of 75 samples and overlap of 50%. Segments with the length of 15 and 9 seconds were extracted from the spectrogram beginning at each of the detected QRS peaks. Figure 2. Five layers of a DenseNet block with a growth rate of 4 feature-maps per layer (source [6]). 2.4.2. Model Training 2.6. Algorithm Evaluation Both the main and secondary models were trained as four class classification models using standard softmax cross-entropy loss. Models were typically trained for no more than 15 epochs. Once a model was sufficiently trained, in-house testing was performed on the left-out stratified split, as previously described. Models that achieved desirable performance were further trained before submission to the challenge server. In particular, the full five splits of challenge data were used to train a final model, where 95% of the data was used for training and the remaining 5% for validation. Final model training did not occur from scratch, but rather weights from the previously learned model were used to pre-initialize the dense CNN for continued training using the updated, full dataset. Performance of the algorithm was evaluated using an average of three F1 values for classification of NSR, AF, and O (F1n, F1a, and F1o, respectively). In-house test set was used for algorithm evaluation independent from the blind challenge test dataset. Also, performance was tested on a random subset of blind hidden test during official phase and final score was created using the whole blind test set. 2.5. Post Processing If the ECG is labelled as NSR or O by the CNN and the probability of being NSR and O are close to each other (absolute difference between probability of NSR and O < 0.4), a feature-based post-processing step is performed to cast the final decision. For NSR/O post-processing, an AdaBoost-abstain classifier [12] was trained using the NSR and O recordings in the in-house training set. Its performance was tested on the in-house test set. A total of 437 features were extracted from five different categories to train the model: - Signal quality (2 features): average template matching correlation coefficient [10] and bSQI [13] based on the output of gqrs and Pan-Tompkins [14] QRS detection algorithms. - Frequency content (10 features): median power across nine frequency bands (1-15, 15-30, 30-45, 45-60, 60-75, 75-90, 90-150, 5-14, and 5-50Hz) as well as ratio of power in 5-14Hz band to power in 5-50Hz. The power spectrum of the ECG record was estimated using discrete-time Fourier transform. - Beat to beat interval (11 features): number, minimum, maximum, and median of RR intervals, SDNN, RMSSD, average heart rate, and different heart rate asymmetry measures (PI, GI, SI) - ECG-based reconstructed phase space (401 features): normalized ECG reconstructed phase space (RPS) was created with dimension 2 and delay equal to 4 samples [15]. Then, the RPS was divided into small square areas (grid of 20×20). Normalized number of points in each square was considered a feature. In addition, spatial filling index was calculated [16]. - Poincare section from ECG (13 features): using RPS reconstructed from ECG, as described above, 13 different features from Poincare section with unity line were extracted. More details about the method and features can be found in [15, 17]. 3. Results Area under the ROC curve for AdaBoost–abstain classifier in NSR/O post-processing step was 0.86 on the in-house test set. Only 58 features were selected by the classifier, the top 10 were from beat to beat interval (n=5), ECG-based reconstructed phase space (n=2), and Poincare section from ECG (n=3). The best result achieved of the proposed algorithm at the official phase of the challenge on the in-house test set was 0.82 (F1 for NSR, AF, and other rhythm were 0.91, 0.80, and 0.76, respectively). Final result on the whole challenge blind test dataset was 0.80 (F1 for NSR, AF, and other rhythm were 0.90, 0.80, and 0.70, respectively). Table 1. Algorithm performance on in-house test set and whole blind test set. F1n, F1a, and F1o are F1 values for classification of NSR, AF, and O. Dataset In-house test set Whole blind test set F1n F1a F1o F1 0.91 0.80 0.76 0.82 0.90 0.80 0.70 0.80 4. Discussion This work led to the development and evaluation of several model types, not all of which are fully described in this paper. Here we discuss some of the findings of this effort, as well as alternative approaches investigated during the CinC challenge.  One of the findings of this work was that for CNNs that process spectrograms as input, row-wise batch normalization (i.e. normalizing over frequency bins per batch) is preferable to a typical channel-wide application of batch normalization. This modification to our CNN models consistently resulted in considerable performance gains.  Significant experimentation was performed using so called wide and deep networks [18], where activations from later convolutional layers (deep features) are combined with variables that capture information  5. using domain knowledge (wide features). The wide features that were considered included well-known HRV measurements (e.g. SDNN, RMSSD, pNN50), entropy measure (e.g. SampleEn) and morphological features (e.g. P-wave duration, PR interval, QTinterval). However, the addition of wide features typically resulted in approximately a 2% drop in overall performance. It is possible that additional wide features, not presently included within our experimentation, would result in performance improvement. Lastly, the model presented here achieved its current performance using only time-frequency inputs encoded as spectrograms. A further model type was tested that accepted time-frequency inputs (as described), as well as a parallel CNN architecture that accepted the raw ECG waveform as input to automatically capture morphological information. These two parallel models were combined to make a final classification. This dual network that captured frequency and morphology information showed promise on our in-house test set results – producing F1 scores that outperformed all other network architectures that were evaluated. However, these networks resulted in computational requirements that were beyond the restrictions imposed by the challenge server, hence we were not able to assess their overall performance on the hidden challenge test dataset. Conclusion In this article, a SQI technique was combined with dense convolutional neural networks following by a postprocessing feature-based classifier to find the best method for distinguishing atrial fibrillation from normal sinus rhythm, other rhythms, and noise. The promising performance of the algorithm makes us hopeful that with further enhancement this technique may be suitable for practical clinical use. References [1] C. T. January, L. S. Wann, J. S. Alpert, H. Calkins, J. C. Cleveland, J. E. Cigarroa, et al., "2014 AHA/ACC/HRS guideline for the management of patients with atrial fibrillation," Circulation, p. CIR. 0000000000000041, 2014. [2] C. Potes, S. Parvaneh, A. Rahman, and B. Conroy, "Classifier ensemble for detection of abnormal heart sounds," 2016. [3] J. Rubin, R. Abreu, A. Ganguli, S. Nelaturi, I. Matei, and K. Sricharan, "Recognizing Abnormal Heart Sounds Using Deep Learning," arXiv preprint arXiv:1707.04642, 2017. [4] J. Rubin, R. Abreu, A. Ganguli, S. Nelaturi, I. Matei, and K. Sricharan, "Classifying heart sound recordings using deep convolutional neural networks and mel-frequency cepstral coefficients," in Computing in Cardiology Conference (CinC), 2016, 2016, pp. 813-816. [5] C. Potes, S. Parvaneh, A. Rahman, and B. Conroy, "Ensemble of feature-based and deep learning-based classifiers for detection of abnormal heart sounds," in Computing in Cardiology Conference (CinC), 2016, 2016, pp. 621-624. [6] G. Huang, Z. Liu, K. Q. Weinberger, and L. van der Maaten, "Densely connected convolutional networks," arXiv preprint arXiv:1608.06993, 2016. [7] S. Ioffe and C. Szegedy, "Batch normalization: Accelerating deep network training by reducing internal covariate shift," in International Conference on Machine Learning, 2015, pp. 448456. [8] G. Clifford, C. Liu, B. Moody, I. Silva, Q. Li, A. Johnson, et al., "AF Classification from a Short Single Lead ECG Recording: the PhysioNet Computing in Cardiology Challenge 2017," presented at the Computing in Cardiology Rennes-France, 2017. [9] I. Silva and G. B. Moody, "An open-source toolbox for analysing and processing physionet databases in matlab and octave," Journal of open research software, vol. 2, 2014. [10] C. Orphanidou, T. Bonnici, P. Charlton, D. Clifton, D. Vallance, and L. Tarassenko, "Signal-quality indices for the electrocardiogram and photoplethysmogram: derivation and applications to wireless monitoring," IEEE journal of biomedical and health informatics, vol. 19, pp. 832-838, 2015. [11] C. Daluwatte, L. Johannesen, L. Galeotti, J. Vicente, D. Strauss, and C. Scully, "Assessing ECG signal quality indices to discriminate ECGs with artefacts from pathologically different arrhythmic ECGs," Physiological measurement, vol. 37, p. 1370, 2016. [12] B. Conroy, L. Eshelman, C. Potes, and M. Xu-Wilson, "A dynamic ensemble approach to robust classification in the presence of missing data," Machine Learning, vol. 102, pp. 443463, 2016. [13] J. Behar, J. Oster, Q. Li, and G. D. Clifford, "ECG signal quality during arrhythmia and its application to false alarm reduction," IEEE transactions on biomedical engineering, vol. 60, pp. 1660-1666, 2013. [14] J. Pan and W. J. Tompkins, "A real-time QRS detection algorithm," IEEE transactions on biomedical engineering, pp. 230-236, 1985. [15] S. Parvaneh, M. R. Hashemi Golpayegani, M. Firoozabadi, and M. Haghjoo, "Predicting the spontaneous termination of atrial fibrillation based on Poincare section in the electrocardiogram phase space," Proceedings of the Institution of Mechanical Engineers, Part H: Journal of Engineering in Medicine, vol. 226, pp. 3-20, 2012. [16] O. Faust, R. Acharya, S. Krishnan, and L. C. Min, "Analysis of cardiac signals using spatial filling index and time-frequency domain," BioMedical Engineering OnLine, vol. 3, p. 30, 2004. [17] S. Parvaneh, M. R. H. Golpaygani, M. Firoozabadi, and M. Haghjoo, "Analysis of Ecg In Phase Space for the Prediction of Spontaneous Atrial Fibrillation Termination," Journal of electrocardiology, vol. 49, pp. 936-937, 2016. [18] H.-T. Cheng, L. Koc, J. Harmsen, T. Shaked, T. Chandra, H. Aradhye, et al., "Wide & deep learning for recommender systems," in Proceedings of the 1st Workshop on Deep Learning for Recommender Systems, 2016, pp. 7-10. Address for correspondence. Jonathan Rubin / Saman Parvaneh 2 Canal Park, 3rd floor, Cambridge, MA 02141. [email protected] / [email protected]
1cs.CV
Published as a conference paper at ICLR 2018 arXiv:1705.07904v3 [cs.LG] 22 Feb 2018 S EMANTICALLY D ECOMPOSING THE L ATENT S PACES OF G ENERATIVE A DVERSARIAL N ETWORKS Chris Donahue Department of Music University of California, San Diego [email protected] Zachary C. Lipton Carnegie Mellon University Amazon AI [email protected] Akshay Balsubramani Department of Genetics Stanford University [email protected] Julian McAuley Department of Computer Science University of California, San Diego [email protected] A BSTRACT We propose a new algorithm for training generative adversarial networks that jointly learns latent codes for both identities (e.g. individual humans) and observations (e.g. specific photographs). By fixing the identity portion of the latent codes, we can generate diverse images of the same subject, and by fixing the observation portion, we can traverse the manifold of subjects while maintaining contingent aspects such as lighting and pose. Our algorithm features a pairwise training scheme in which each sample from the generator consists of two images with a common identity code. Corresponding samples from the real dataset consist of two distinct photographs of the same subject. In order to fool the discriminator, the generator must produce pairs that are photorealistic, distinct, and appear to depict the same individual. We augment both the DCGAN and BEGAN approaches with Siamese discriminators to facilitate pairwise training. Experiments with human judges and an off-the-shelf face verification system demonstrate our algorithm’s ability to generate convincing, identity-matched photographs. 1 I NTRODUCTION In many domains, a suitable generative process might consist of several stages. To generate a photograph of a product, we might wish to first sample from the space of products, and then from the space of photographs of that product. Given such disentangled representations in a multistage generative process, an online retailer might diversify its catalog, depicting products in a wider variety of settings. A retailer could also flip the process, imagining new products in a fixed setting. Datasets for such domains often contain many labeled identities with fewer observations of each (e.g. a collection of face portraits with thousands of people and ten photos of each). While we may know the identity of the subject in each photograph, we may not know the contingent aspects of the observation (such as lighting, pose and background). This kind of data is ubiquitous; given a set of commonalities, we might want to incorporate this structure into our latent representations. Generative adversarial networks (GANs) learn mappings from latent codes z in some low-dimensional space Z to points in the space of natural data X (Goodfellow et al., 2014). They achieve this power through an adversarial training scheme pitting a generative model G : Z 7→ X against a discriminative model D : X 7→ [0, 1] in a minimax game. While GANs are popular, owing to their ability to generate high-fidelity images, they do not, in their original form, explicitly disentangle the latent factors according to known commonalities. In this paper, we propose Semantically Decomposed GANs (SD-GANs), which encourage a specified portion of the latent space to correspond to a known source of variation.1,2 The technique 1 2 Web demo: https://chrisdonahue.github.io/sdgan Source code: https://github.com/chrisdonahue/sdgan 1 Published as a conference paper at ICLR 2018 Figure 1: Generated samples from SD-BEGAN. Each of the four rows has the same identity code zI and each of the fourteen columns has the same observation code zO . decomposes the latent code Z into one portion ZI corresponding to identity, and the remaining portion ZO corresponding to the other contingent aspects of observations. SD-GANs learn through a pairwise training scheme in which each sample from the real dataset consists of two distinct images with a common identity. Each sample from the generator consists of a pair of images with common zI ∈ ZI but differing zO ∈ ZO . In order to fool the discriminator, the generator must not only produce diverse and photorealistic images, but also images that depict the same identity when zI is fixed. For SD-GANs, we modify the discriminator so that it can determine whether a pair of samples constitutes a match. As a case study, we experiment with a dataset of face photographs, demonstrating that SD-GANs can generate contrasting images of the same subject (Figure 1; interactive web demo in footnote on previous page). The generator learns that certain properties are free to vary across observations but not identity. For example, SD-GANs learn that pose, facial expression, hirsuteness, grayscale vs. color, and lighting can all vary across different photographs of the same individual. On the other hand, the aspects that are more salient for facial verification remain consistent as we vary the observation code zO . We also train SD-GANs on a dataset of product images, containing multiple photographs of each product from various perspectives (Figure 4). We demonstrate that SD-GANs trained on faces generate stylistically-contrasting, identity-matched image pairs that human annotators and a state-of-the-art face verification algorithm recognize as depicting the same subject. On measures of identity coherence and image diversity, SD-GANs perform comparably to a recent conditional GAN method (Odena et al., 2017); SD-GANs can also imagine new identities, while conditional GANs are limited to generating existing identities from the training data. 2 S EMANTICALLY D ECOMPOSED G ENERATIVE A DVERSARIAL N ETWORKS Before introducing our algorithm, we briefly review the prerequisite concepts. 2.1 GAN PRELIMINARIES GANs leverage the discriminative power of neural networks to learn generative models. The generative model G ingests latent codes z, sampled from some known prior PZ , and produces G(z), a sample of an implicit distribution PG . The learning process consists of a minimax game between G, parameterized by θG , and a discriminative model D, parameterized by θD . In the original formulation, the discriminative model tries to maximize log likelihood, yielding min max V (G, D) = Ex∼PR [log D(x)] + Ez∼PZ [log(1 − D(G(z)))]. G D (1) Training proceeds as follows: For k iterations, sample one minibatch from the real distribution PR and one from the distribution of generated images PG , updating discriminator weights θD to increase V (G, D) by stochastic gradient ascent. Then sample a minibatch from PZ , updating θG to decrease V (G, D) by stochastic gradient descent. 2 Published as a conference paper at ICLR 2018 Algorithm 1 Semantically Decomposed GAN Training 1: for n in 1:NumberOfIterations do 2: for m in 1:MinibatchSize do 3: Sample one identity vector zI ∼ Uniform([−1, 1]dI ). 4: Sample two observation vectors z1O , z2O ∼ Uniform([−1, 1]dO ). 5: z1 ← [zI ; z1O ], z2 ← [zI ; z2O ]. 6: Generate pair of images G(z1 ), G(z2 ), adding them to the minibatch with label 0 (fake). 7: 8: 9: 10: 11: 12: 13: for m in 1:MinibatchSize do Sample one identity i ∈ I uniformly at random from the real data set. Sample two images of i without replacement x1 , x2 ∼ PR (x|I = i). Add the pair to the minibatch, assigning label 1 (real). Update discriminator weights by θD ← θD + ∇θD V (G, D) using its stochastic gradient. Sample another minibatch of identity-matched latent vectors z1 , z2 . Update generator weights by stochastic gradient descent θG ← θG − ∇θG V (G, D). Zhao et al. (2017b) propose energy-based GANs (EBGANs), in which the discriminator can be viewed as an energy function. Specifically, they devise a discriminator consisting of an autoencoder: D(x) = Dd (De (x)). In the minimax game, the discriminator’s weights are updated to minimize the reconstruction error L(x) = ||x − D(x)|| for real data, while maximizing the error L(G(z)) for the generator. More recently, Berthelot et al. (2017) extend this work, introducing Boundary Equilibrium GANs (BEGANs), which optimize the Wasserstein distance (reminiscent of Wasserstein GANs (Arjovsky et al., 2017)) between autoencoder loss distributions, yielding the formulation: VBEGAN (G, D) = L(x) − L(G(z)). (2) Additionally, they introduce a method for stabilizing training. Positing that training becomes unstable when the discriminator cannot distinguish between real and generated images, they introduce a new hyperparameter γ, updating the value function on each iteration to maintain a desired ratio between the two reconstruction errors: E[L(G(z))] = γ E[L(x)]. The BEGAN model produces what appear to us, subjectively, to be the sharpest images of faces yet generated by a GAN. In this work, we adapt both the DCGAN (Radford et al., 2016) and BEGAN algorithms to the SD-GAN training scheme. 2.2 SD-GAN FORMULATION Consider the data’s identity as a random variable I in a discrete index set I. We seek to learn a latent representation that conveniently decomposes the variation in the real data into two parts: 1) due to I, and 2) due to the other factors of variation in the data, packaged as a random variable O. Ideally, the decomposition of the variation in the data into I and O should correspond exactly to a decomposition of the latent space Z = ZI × ZO . This would permit convenient interpolation and other operations on the inferred subspaces ZI and ZO . A conventional GAN samples I, O from their joint distribution. Such a GAN’s generative model samples directly from an unstructured prior over the latent space. It does not disentangle the variation in O and I, for instance by modeling conditional distributions PG (O | I = i), but only models their average with respect to the prior on I. Our SD-GAN method learns such a latent space decomposition, partitioning the coordinates of Z into two parts representing the subspaces, so that any z ∈ Z can be written as the concatenation [zI ; zO ] of its identity representation zI ∈ RdI = ZI and its contingent aspect representation zO ∈ RdO = ZO . SD-GANs achieve this through a pairwise training scheme in which each sample from the real data consists of x1 , x2 ∼ PR (x | I = i), a pair of images with a common identity i ∈ I. Each sample from the generator consists of G(z1 ), G(z2 ) ∼ PG (z | ZI = zI ), a pair of images generated from a common identity vector zI ∈ ZI but i.i.d. observation vectors z1O , z2O ∈ ZO . We assign identity-matched pairs from PR the label 1 and zI -matched pairs from PG the label 0. The discriminator can thus learn to reject pairs for either of two primary reasons: 1) not photorealistic or 2) not plausibly depicting the same subject. See Algorithm 1 for SD-GAN training pseudocode. 3 Published as a conference paper at ICLR 2018 (a) DCGAN (b) SD-DCGAN (c) BEGAN (d) SD-BEGAN Figure 2: SD-GAN architectures and vanilla counterparts. Our SD-GAN models incorporate a decomposed latent space and Siamese discriminators. Dashed lines indicate shared weights. Discriminators also observe real samples in addition to those from the generator (not pictured for simplicity). 2.3 SD-GAN DISCRIMINATOR ARCHITECTURE With SD-GANs, there is no need to alter the architecture of the generator. However, the discriminator must now act upon two images, producing a single output. Moreover, the effects of the two input images x1 , x2 on the output score are not independent. Two images might be otherwise photorealistic but deserve rejection because they clearly depict different identities. To this end, we devise two novel discriminator architectures to adapt DCGAN and BEGAN respectively. In both cases, we first separately encode each image using the same convolutional neural network De (Figure 2). We choose this Siamese setup (Bromley, 1994; Chopra et al., 2005) as our problem is symmetrical in the images, and thus it’s sensible to share weights between the encoders. To adapt DCGAN, we stack the feature maps De (x1 ) and De (x2 ) along the channel axis, applying one additional strided convolution. This allows the network to further aggregate information from the two images before flattening and fully connecting to a sigmoid output. For BEGAN, because the discriminator is an autoencoder, our architecture is more complicated. After encoding each image, we concatenate the representations [De (x1 ); De (x2 )] ∈ R2(dI +dO ) and apply one fully connected bottleneck layer R2(dI +dO ) ⇒ RdI +2dO with linear activation. In alignment with BEGAN, the SD-BEGAN bottleneck has the same dimensionality as the tuple of latent codes (zI , z1O , z2O ) that generated the pair of images. Following the bottleneck, we apply a second FC layer RdI +2dO ⇒ R2(dI +dO ) , taking the first dI + dO components of its output to be the input to the first decoder and the second dI + dO components to be the input to the second decoder. The shared intermediate layer gives SD-BEGAN a mechanism to push apart matched and unmatched pairs. We specify our exact architectures in full detail in Appendix E. 3 E XPERIMENTS We experimentally validate SD-GANs using two datasets: 1) the MS-Celeb-1M dataset of celebrity face images (Guo et al., 2016) and 2) a dataset of shoe images collected from Amazon (McAuley et al., 2015). Both datasets contain a large number of identities (people and shoes, respectively) with multiple observations of each. The “in-the-wild” nature of the celebrity face images offers a richer test bed for our method as both identities and contingent factors are significant sources of variation. In contrast, Amazon’s shoe images tend to vary only with camera perspective for a given product, making this data useful for sanity-checking our approach. Faces From the aligned face images in the MS-Celeb-1M dataset, we select 12,500 celebrities at random and 8 associated images of each, resizing them to 64x64 pixels. We split the celebrities into subsets of 10,000 (training), 1,250 (validation) and 1,250 (test). The dataset has a small number of duplicate images and some label noise (images matched to the wrong celebrity). We detect and 4 Published as a conference paper at ICLR 2018 Figure 3: Generated samples SD-DCGAN model trained on faces. from Figure 4: Generated samples from SD-DCGAN model trained on shoes. remove duplicates by hashing the images, but we do not rid the data of label noise. We scale the pixel values to [−1, 1], performing no additional preprocessing or data augmentation. Shoes Synthesizing novel product images is another promising domain for our method. In our shoes dataset, product photographs are captured against white backgrounds and primarily differ in orientation and distance. Accordingly, we expect that SD-GAN training will allocate the observation latent space to capture these aspects. We choose to study shoes as a prototypical example of a category of product images. The Amazon dataset contains around 3,000 unique products with the category “Shoe” and multiple product images. We use the same 80%, 10%, 10% split and again hash the images to ensure that the splits are disjoint. There are 6.2 photos of each product on average. 3.1 T RAINING DETAILS We train SD-DCGANs on both of our datasets for 500,000 iterations using batches of 16 identitymatched pairs. To optimize SD-DCGAN, we use the Adam optimizer (Kingma & Ba, 2015) with hyperparameters α = 2e−4, β1 = 0.5, β2 = 0.999 as recommended by Radford et al. (2016). We also consider a non-Siamese discriminator that simply stacks the channels of the pair of real or fake images before encoding (SD-DCGAN-SC). As in (Radford et al., 2016), we sample latent vectors z ∼ Uniform([−1, 1]100 ). For SD-GANs, we partition the latent codes according to zI ∈ RdI , zO ∈ R100−dI using values of dI = [25, 50, 75]. Our algorithm can be trivially applied with k-wise training (vs. pairwise). To explore the effects of using k > 2, we also experiment with an SD-DCGAN where we sample k = 4 instances each from PG (z | ZI = zI ) for some zI ∈ ZI and from PR (x | I = i) for some i ∈ I. For all experiments, unless otherwise stated, we use dI = 50 and k = 2. We also train an SD-BEGAN on both of our datasets. The increased complexity of the SD-BEGAN model significantly increases training time, limiting our ability to perform more-exhaustive hyperparameter validation (as we do for SD-DCGAN). We use the Adam optimizer with the default hyperparameters from (Kingma & Ba, 2015) for our SD-BEGAN experiments. While results from our SD-DCGAN k = 4 model are compelling, an experiment with a k = 4 variant of SD-BEGAN resulted in early mode collapse (Appendix F); hence, we excluded SD-BEGAN k = 4 from our evaluation. We also compare to a DCGAN architecture trained using the auxiliary classifier GAN (AC-GAN) method (Odena et al., 2017). AC-GAN differs from SD-GAN in two key ways: 1) random identity codes zI are replaced by a one-hot embedding over all the identities in the training set (matrix of size 10000x50); 2) the AC-GAN method encourages that generated photos depict the proper identity by tasking its discriminator with predicting the identity of the generated or real image. Unlike SD-GANs, the AC-DCGAN model cannot imagine new identities; when generating from AC-DCGAN (for our quantitative comparisons to SD-GANs), we must sample a random identity from those existing in the training data. 5 Published as a conference paper at ICLR 2018 Table 1: Evaluation of 10k pairs from MS-Celeb-1M (real data) and generative models; half have matched identities, half do not. The identity verification metrics demonstrate that FaceNet (FN) and human annotators on Mechanical Turk (MT) verify generated data similarly to real data. The sample diversity metrics ensure that generated samples are statistically distinct in pixel space. Data generated by our best model (SD-BEGAN) performs comparably to real data. * 1k pairs, † 200 pairs. Identity Verification Dataset 3.2 Mem Sample Diversity Judge AUC Acc. FAR ID-Div All-Div MS-Celeb-1M AC-DCGAN SD-DCGAN SD-DCGAN-SC SD-DCGAN k=4 SD-DCGAN dI =25 SD-DCGAN dI =75 SD-BEGAN 131 MB 57 MB 47 MB 75 MB 57 MB 57 MB 68 MB FN FN FN FN FN FN FN FN .913 .927 .823 .831 .852 .835 .816 .928 .867 .851 .749 .757 .776 .764 .743 .857 .045 .083 .201 .180 .227 .222 .268 .110 .621 .497 .521 .560 .523 .526 .517 .588 .699 .666 .609 .637 .614 .615 .601 .673 †MS-Celeb-1M *MS-Celeb-1M *AC-DCGAN *SD-DCGAN k=4 *SD-BEGAN 131 MB 75 MB 68 MB Us MT MT MT MT - .850 .759 .765 .688 .723 .110 .035 .090 .147 .096 .621 .621 .497 .523 .588 .699 .699 .666 .614 .673 E VALUATION The evaluation of generative models is a fraught topic. Quantitative measures of sample quality can be poorly correlated with each other (Theis et al., 2016). Accordingly, we design an evaluation to match conceivable uses of our algorithm. Because we hope to produce diverse samples that humans deem to depict the same person, we evaluate the identity coherence of SD-GANs and baselines using both a pretrained face verification model and crowd-sourced human judgments obtained through Amazon’s Mechanical Turk platform. 3.2.1 Q UANTITATIVE Recent advancements in face verification using deep convolutional neural networks (Schroff et al., 2015; Parkhi et al., 2015; Wen et al., 2016) have yielded accuracy rivaling humans. For our evaluation, we procure FaceNet, a publicly-available face verifier based on the Inception-ResNet architecture (Szegedy et al., 2017). The FaceNet model was pretrained on the CASIA-WebFace dataset (Yi et al., 2014) and achieves 98.6% accuracy on the LFW benchmark (Huang et al., 2012).3 FaceNet ingests normalized, 160x160 color images and produces an embedding f (x) ∈ R128 . The training objective for FaceNet is to learn embeddings that minimize the L2 distance between matched pairs of faces and maximize the distance for mismatched pairs. Accordingly, the embedding space yields a function for measuring the similarity between two faces x1 and x2 : D(x1 , x2 ) = ||f (x1 ) − f (x2 )||22 . Given two images, x1 and x2 , we label them as a match if D(x1 , x2 ) ≤ τv where τv is the accuracy-maximizing threshold on a class-balanced set of pairs from MS-Celeb-1M validation data. We use the same threshold for evaluating both real and synthetic data with FaceNet. We compare the performance of FaceNet on pairs of images from the MS-Celeb-1M test set against generated samples from our trained SD-GAN models and AC-DCGAN baseline. To match FaceNet’s training data, we preprocess all images by resizing from 64x64 to 160x160, normalizing each image individually. We prepare 10,000 pairs from MS-Celeb-1M, half identity-matched and half unmatched. From each generative model, we generate 5,000 pairs each with z1I = z2I and 5,000 pairs with z1I 6= z2I . For each sample, we draw observation vectors zO randomly. We also want to ensure that identity-matched images produced by the generative models are diverse. To this end, we propose an intra-identity sample diversity (ID-Div) metric. The multi-scale structural similarity (MS-SSIM) (Wang et al., 2004) metric reports the similarity of two images on a scale from 0 (no resemblance) to 1 (identical images). We report 1 minus the mean MS-SSIM for all pairs 3 “20170214-092102” pretrained model from https://github.com/davidsandberg/facenet 6 Published as a conference paper at ICLR 2018 of identity-matched images as ID-Div. To measure the overall sample diversity (All-Div), we also compute 1 minus the mean similarity of 10k pairs with random identities. In Table 1, we report the area under the receiver operating characteristic curve (AUC), accuracy, and false accept rate (FAR) of FaceNet (at threshold τv ) on the real and generated data. We also report our proposed diversity statistics. FaceNet verifies pairs from the real data with 87% accuracy compared to 86% on pairs from our SD-BEGAN model. Though this is comparable to the accuracy achieved on pairs from the AC-DCGAN baseline, our model produces samples that are more diverse in pixel space (as measured by ID-Div and All-Div). FaceNet has a higher but comparable FAR for pairs from SD-GANs than those from AC-DCGAN; this indicates that SD-GANs may produce images that are less semantically diverse on average than AC-DCGAN. We also report the combined memory footprint of G and D for all methods in Table 1. For conditional GAN approaches, the number of parameters grows linearly with the number of identities in the training data. Especially in the case of the AC-GAN, where the discriminator computes a softmax over all identities, linear scaling may be prohibitive. While our 10k-identity subset of MS-Celeb-1M requires a 131MB AC-DCGAN model, an AC-DCGAN for all 1M identities would be over 8GB, with more than 97% of the parameters devoted to the weights in the discriminator’s softmax layer. In contrast, the complexity of SD-GAN is constant in the number of identities. 3.2.2 Q UALITATIVE In addition to validating that identity-matched SD-GAN samples are verified by FaceNet, we also demonstrate that humans are similarly convinced through experiments using Mechanical Turk. For these experiments, we use balanced subsets of 1,000 pairs from MS-Celeb-1M and the most promising generative methods from our FaceNet evaluation. We ask human annotators to determine if each pair depicts the “same person” or “different people”. Annotators are presented with batches of ten pairs at a time. Each pair is presented to three distinct annotators and predictions are determined by majority vote. Additionally, to provide a benchmark for assessing the quality of the Mechanical Turk ensembles, we (the authors) manually judged 200 pairs from MS-Celeb-1M. Results are in Table 1. For all datasets, human annotators on Mechanical Turk answered “same person” less frequently than FaceNet when the latter uses the accuracy-maximizing threshold τv . Even on real data, balanced so that 50% of pairs are identity-matched, annotators report “same person” only 28% of the time (compared to the 41% of FaceNet). While annotators achieve higher accuracy on pairs from ACDCGAN than pairs from SD-BEGAN, they also answer “same person” 16% more often for ACDCGAN pairs than real data. In contrast, annotators answer “same person” at the same rate for SD-BEGAN pairs as real data. This may be attributable to the lower sample diversity produced by AC-DCGAN. Samples from SD-DCGAN and SD-BEGAN are shown in Figures 3 and 1 respectively. 4 R ELATED WORK Style transfer and novel view synthesis are active research areas. Early attempts to disentangle style and content manifolds used factored tensor representations (Tenenbaum & Freeman, 1997; Vasilescu & Terzopoulos, 2002; Elgammal & Lee, 2004; Tang et al., 2013), applying their results to face image synthesis. More recent work focuses on learning hierarchical feature representations using deep convolutional neural networks to separate identity and pose manifolds for faces (Zhu et al., 2013; Reed et al., 2014; Zhu et al., 2014; Yang et al., 2015; Kulkarni et al., 2015; Oord et al., 2016; Yan et al., 2016) and products (Dosovitskiy et al., 2015). Gatys et al. (2016) use features of a convolutional network, pretrained for image recognition, as a means for discovering content and style vectors. Since their introduction (Goodfellow et al., 2014), GANs have been used to generate increasingly highquality images (Radford et al., 2016; Zhao et al., 2017b; Berthelot et al., 2017). Conditional GANs (cGANs), introduced by Mirza & Osindero (2014), extend GANs to generate class-conditional data. Odena et al. (2017) propose auxiliary classifier GANs, combining cGANs with a semi-supervised discriminator (Springenberg, 2015). Recently, cGANs have been used to ingest text (Reed et al., 2016) and full-resolution images (Isola et al., 2017; Liu et al., 2017; Zhu et al., 2017) as conditioning information, addressing a variety of image-to-image translation and style transfer tasks. Chen et al. (2016) devise an information-theoretic extension to GANs in which they maximize the mutual information between a subset of latent variables and the generated data. Their unsupervised method 7 Published as a conference paper at ICLR 2018 Figure 5: Linear interpolation of zI (identity) and zO (observation) for three pairs using SD-BEGAN generator. In each matrix, rows share zI and columns share zO . appears to disentangle some intuitive factors of variation, but these factors may not correspond to those explicitly disentangled by SD-GANs. Several related papers use GANs for novel view synthesis of faces. Tran et al. (2017); Huang et al. (2017); Yin et al. (2017a;b); Zhao et al. (2017a) all address synthesis of different body/facial poses conditioned on an input image (representing identity) and a fixed number of pose labels. Antipov et al. (2017) propose conditional GANs for synthesizing artificially-aged faces conditioned on both a face image and an age vector. These approaches all require explicit conditioning on the relevant factor (such as rotation, lighting and age) in addition to an identity image. In contrast, SD-GANs can model these contingent factors implicitly (without supervision). Mathieu et al. (2016) combine GANs with a traditional reconstruction loss to disentangle identity. While their approach trains with an encoder-decoder generator, they enforce a variational bound on the encoder embedding, enabling them to sample from the decoder without an input image. Experiments with their method only address small (28x28) grayscale face images, and their training procedure is complex to reproduce. In contrast, our work offers a simpler approach and can synthesize higher-resolution, color photographs. One might think of our work as offering the generative view of the Siamese networks often favored for learning similarity metrics (Bromley, 1994; Chopra et al., 2005). Such approaches are used for discriminative tasks like face or signature verification that share the many classes with few examples structure that we study here. In our work, we adopt a Siamese architecture in order to enable the discriminator to differentiate between matched and unmatched pairs. Recent work by Liu & Tuzel (2016) propose a GAN architecture with weight sharing across multiple generators and discriminators, but with a different problem formulation and objective from ours. 5 D ISCUSSION Our evaluation demonstrates that SD-GANs can disentangle those factors of variation corresponding to identity from the rest. Moreover, with SD-GANs we can sample never-before-seen identities, a benefit not shared by conditional GANs. In Figure 3, we demonstrate that by varying the observation vector zO , SD-GANs can change the color of clothing, add or remove sunnies, or change facial pose. They can also perturb the lighting, color saturation, and contrast of an image, all while keeping the apparent identity fixed. We note, subjectively, that samples from SD-DCGAN tend to appear less photorealistic than those from SD-BEGAN. Given a generator trained with SD-GAN, we can independently interpolate along the identity and observation manifolds (Figure 5). On the shoe dataset, we find that the SD-DCGAN model produces convincing results. As desired, manipulating zI while keeping zO fixed yields distinct shoes in consistent poses (Figure 4). The identity code zI appears to capture the broad categories of shoes (sneakers, flip-flops, boots, etc.). Surprisingly, neither original BEGAN nor SD-BEGAN can produce diverse shoe images (Appendix G). In this paper, we presented SD-GANs, a new algorithm capable of disentangling factors of variation according to known commonalities. We see several promising directions for future work. One logical extension is to disentangle latent factors corresponding to more than one known commonality. We also plan to apply our approach in other domains such as identity-conditioned speech synthesis. 8 Published as a conference paper at ICLR 2018 ACKNOWLEDGEMENTS The authors would like to thank Anima Anandkumar, John Berkowitz and Miller Puckette for their helpful feedback on this work. This work used the Extreme Science and Engineering Discovery Environment (XSEDE), which is supported by National Science Foundation grant number ACI1053575 (Towns et al., 2014). GPUs used in this research were donated by the NVIDIA Corporation. R EFERENCES Grigory Antipov, Moez Baccouche, and Jean-Luc Dugelay. Face aging with conditional generative adversarial networks. In ICIP, 2017. Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. In ICML, 2017. David Berthelot, Tom Schumm, and Luke Metz. BEGAN: Boundary equilibrium generative adversarial networks. arXiv:1703.10717, 2017. Jane Bromley. Signature verification using a "Siamese" time delay neural network. In NIPS, 1994. Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. In NIPS, 2016. Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In CVPR, 2005. Alexey Dosovitskiy, Jost Tobias Springenberg, and Thomas Brox. Learning to generate chairs with convolutional neural networks. In CVPR, 2015. Ahmed Elgammal and Chan-Su Lee. Separating style and content on a nonlinear manifold. In CVPR, 2004. Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. In NIPS, 2014. Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. MS-Celeb-1M: A dataset and benchmark for large scale face recognition. In ECCV, 2016. Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Neural networks for machine learning lecture 6a: Overview of mini–batch gradient descent. Gary B. Huang, Marwan Mattar, Honglak Lee, and Erik Learned-Miller. Learning to align from scratch. In NIPS, 2012. Rui Huang, Shu Zhang, Tianyu Li, and Ran He. Beyond face rotation: Global and local perception gan for photorealistic and identity preserving frontal view synthesis. In ICCV, 2017. Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In NIPS, 2015. Zachary C Lipton and Subarna Tripathi. Precise recovery of latent vectors from generative adversarial networks. ICLR Workshop Track, 2017. Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In NIPS, 2016. Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In ICML, 2017. 9 Published as a conference paper at ICLR 2018 Michael F Mathieu, Junbo Jake Zhao, Junbo Zhao, Aditya Ramesh, Pablo Sprechmann, and Yann LeCun. Disentangling factors of variation in deep representation using adversarial training. In NIPS, 2016. Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton Van Den Hengel. Image-based recommendations on styles and substitutes. In SIGIR, 2015. Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv:1411.1784, 2014. Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional image synthesis with auxiliary classifier GANs. In ICML, 2017. Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders. In NIPS, 2016. Omkar M Parkhi, Andrea Vedaldi, and Andrew Zisserman. Deep face recognition. In BMVC, 2015. Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In CVPR, 2016. Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016. Scott Reed, Kihyuk Sohn, Yuting Zhang, and Honglak Lee. Learning to disentangle factors of variation with manifold interaction. In ICML, 2014. Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In ICML, 2016. Florian Schroff, Dmitry Kalenichenko, and James Philbin. FaceNet: A unified embedding for face recognition and clustering. In CVPR, 2015. Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. In ICLR, 2015. Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alex Alemi. Inception-v4, Inception-ResNet and the impact of residual connections on learning. In AAAI, 2017. Yichuan Tang, Ruslan Salakhutdinov, and Geoffrey Hinton. Tensor analyzers. In ICML, 2013. Joshua B Tenenbaum and William T Freeman. Separating style and content. In NIPS, 1997. Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. In ICLR, 2016. John Towns, Timothy Cockerill, Maytal Dahan, Ian Foster, Kelly Gaither, Andrew Grimshaw, Victor Hazlewood, Scott Lathrop, Dave Lifka, Gregory D Peterson, et al. XSEDE: Accelerating scientific discovery. Computing in Science & Engineering, 2014. Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning GAN for pose-invariant face recognition. In CVPR, 2017. M Vasilescu and Demetri Terzopoulos. Multilinear analysis of image ensembles: Tensorfaces. In ECCV, 2002. Zhou Wang, Eero P Simoncelli, and Alan C Bovik. Multiscale structural similarity for image quality assessment. In Asilomar Conference on Signals, Systems and Computers, 2004. Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In ECCV, 2016. Xinchen Yan, Jimei Yang, Kihyuk Sohn, and Honglak Lee. Attribute2Image: Conditional image generation from visual attributes. In ECCV, 2016. Jimei Yang, Scott E Reed, Ming-Hsuan Yang, and Honglak Lee. Weakly-supervised disentangling with recurrent transformations for 3D view synthesis. In NIPS, 2015. 10 Published as a conference paper at ICLR 2018 Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z Li. Learning face representation from scratch. arXiv:1411.7923, 2014. Weidong Yin, Yanwei Fu, Leonid Sigal, and Xiangyang Xue. Semi-latent GAN: Learning to generate and modify facial images from attributes. arXiv:1704.02166, 2017a. Xi Yin, Xiang Yu, Kihyuk Sohn, Xiaoming Liu, and Manmohan Chandraker. Towards large-pose face frontalization in the wild. In ICCV, 2017b. Bo Zhao, Xiao Wu, Zhi-Qi Cheng, Hao Liu, and Jiashi Feng. Multi-view image generation from a single-view. arXiv:1704.04886, 2017a. Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. In ICLR, 2017b. Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. Zhenyao Zhu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning identity-preserving face space. In ICCV, 2013. Zhenyao Zhu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Multi-view perceptron: a deep model for learning face identity and view representations. In NIPS, 2014. 11 Published as a conference paper at ICLR 2018 A E STIMATING LATENT CODES Figure 6: Linear interpolation of both identity (vertical) and observation (horizontal) on latent codes recovered for unseen images. All rows have the same identity vector (zI ) and all columns have the same observation vector (zO ). We estimate latent vectors for unseen images and demonstrate that the disentangled representations of SD-GANs can be used to depict the estimated identity with different contingent factors. In order to find a latent vector ẑ such that G(ẑ) (pretrained G) is similar to an unseen image x, we can minimize the distance between x and G(ẑ): minẑ ||G(ẑ) − x||22 (Lipton & Tripathi, 2017). In Figure 6, we depict estimation and linear interpolation across both subspaces for two pairs of images using SD-BEGAN. We also display the corresponding source images being estimated. For both pairs, ẑI (identity) is consistent in each row and ẑO (observation) is consistent in each column. B PAIRWISE DISCRIMINATION OF EMBEDDINGS AND ENCODINGS In Section 3.1, we describe an AC-GAN (Odena et al., 2017) baseline which uses an embedding matrix over real identities as latent identity codes (G : i, zO 7→ x̂). In place of random identity vectors, we tried combining this identity representation with pairwise discrimination (in the style of SD-GAN). In this experiment, the discriminator receives either either two real images with the same identity (x1i , x2i ), or a real image with label i and synthetic image with label i (x1i , G(i, zO )). All other hyperparameters are the same as in our SD-DCGAN experiment (Section 3.1). We show results in Figure 7. Figure 7: Generator with a one-hot identity embedding trained against a pairwise discriminator. Each row shares an identity vector and each column shares an observation vector. Random sample of 4 real images of the corresponding identity on the right. In Appendix C, we detail a modification of the DR-GAN (Tran et al., 2017) method which uses an encoding network Ge to transform images to identity representations (Gd : Ge (x), zO 7→ x̂). We also tried combining this encoder-decoder approach with pairwise discrimination. The discriminator 12 Published as a conference paper at ICLR 2018 receives either two real images with the same identity (x1i , x2i ), or (x1i , Gd (Ge (x1i ), zO ). We show results in Figure 8. Figure 8: Generator with an encoder-decoder architecture trained against a pairwise discriminator. Each row shares an identity vector and each column shares an observation vector. Input image on the right. While these experiments are exploratory and not part of our principle investigation, we find the results to be qualitatively promising. We are not the first to propose pairwise discrimination with pairs of (real, real) or (real, fake) images in GANs (Pathak et al., 2016; Isola et al., 2017). C E XPLORATORY EXPERIMENT WITH DR-GAN S Tran et al. (2017) propose Disentangled Representation learning-GAN (DR-GAN), an approach to face frontalization with similar setup to our SD-GAN algorithm. The (single-image) DR-GAN generator G (composition of Ge and Gd ) accepts an input image x, a pose code c, and a noise vector z. The DR-GAN discriminator receives either x or x̂ = Gd (Ge (x), c, z). In the style of (Springenberg, 2015), the discriminator is tasked with determining not only if the image is real or fake, but also classifying the pose c, suggesting a disentangled representation to the generator. Through their experiments, they demonstrate that DR-GAN can explicitly disentangle pose and illumination (c) from the rest of the latent space (Ge (x); z). Figure 9: Generated samples from cGAN trained only to disentangle identity. Each row shares an identity vector and each column shares an observation vector; input image on the right. In addition to our AC-DCGAN baseline (Odena et al., 2017), we tried modifying DR-GAN to only disentangle identity (rather than both identity and pose in the original paper). We used the DCGAN (Radford et al., 2016) discriminator architecture (Table 4) as Ge , linearly projecting the final convolutional layer to Ge (x) ∈ R50 (in alignment with our SD-GAN experiments). We altered the discriminator to predict the identity of x or x̂, rather than pose information (which is unknown in our experimental setup). With these modifications, Ge (x) is analogous to zI in the SD-GAN generator, and z is analogous to zO . Furthermore, this setup is identical to the AC-DCGAN baseline 13 Published as a conference paper at ICLR 2018 except that the embedding matrix is replaced by an encoding network Ge . Unfortunately, we found that the generator quickly learned to produce a single output image x̂ for each input x regardless of observation code z (Figure 9). Accordingly, we excluded this experiment from our evaluation (Section 3.2). D I MAGINING IDENTITIES WITH AC-GAN Figure 10: AC-DCGAN generation with random identity vectors that sum to one. Each row shares an identity vector and each column shares an observation vector. Figure 11: AC-DCGAN generation with one-hot identity vectors. Each row shares an identity vector and each column shares an observation vector. As stated in Section 3.1, AC-GANs Odena et al. (2017) provide no obvious way to imagine new identities. For our evaluation (Section 3.2), the AC-GAN generator receives identity input zI ∈ [0, 1]10000 : a one-hot over all identities. One possible approach to imagining new identities would be to query a P10000 trained AC-GAN generator with a random vector zI such that i=1 zI [i] = 1. We found that this strategy produced little identity variety (Figure 10) compared to the normal one-hot strategy (Figure 11) and excluded it from our evaluation. E A RCHITECTURE D ESCRIPTIONS We list here the full architectural details for our SD-DCGAN and SD-BEGAN models. In these descriptions, k is the number of images that the generator produces and discriminator observes per identity (usually 2 for pairwise training), and dI is the number of dimensions in the latent space ZI (identity). In our experiments, dimensionality of ZO is always 100 − dI . As a concrete example, the bottleneck layer of the SD-BEGAN discriminator autoencoder (“fc2” in Table 6) with k = 2, dI = 50 has output dimensionality 150. We emphasize that generators are parameterized by k in the tables only for clarity and symmetry with the discriminators. Implementations need not modify the generator; instead, k can be collapsed into the batch size. For the stacked-channels versions of these discriminators, we simply change the number of input image channels from 3 to 3k and set k = 1 wherever k appears in the table. 14 Published as a conference paper at ICLR 2018 Table 2: Input abstraction for both SD-DCGAN and SD-BEGAN generators during training (where zO is always different for every pair or set of k) Operation [zi ; zo ] dup zi concat Input Shape [(dI ,);(k,100-dI )] [(dI ,);(k,100-dI )] [(k,dI );(k,100-dI )] Kernel Size Output Shape [(dI ,);(k,100-dI )] [(k,dI );(k,100-dI )] (k,100) Table 3: SD-DCGAN generator architecture Operation z fc1 reshape bnorm relu upconv1 bnorm relu upconv2 bnorm relu upconv3 bnorm relu upconv4 tanh Input Shape (k,100) (k,8192) (k,8192) (k,4,4,512) (k,4,4,512) (k,4,4,512) (k,8,8,256) (k,8,8,256) (k,8,8,256) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,32,32,64) (k,32,32,64) (k,32,32,64) (k,64,64,3) Kernel Size (100,8192) (5,5,512,256) (5,5,256,128) (5,5,128,64) (5,5,64,3) Output Shape (k,100) (k,8192) (k,4,4,512) (k,4,4,512) (k,4,4,512) (k,8,8,256) (k,8,8,256) (k,8,8,256) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,32,32,64) (k,32,32,64) (k,32,32,64) (k,64,64,3) (k,64,64,3) Table 4: SD-DCGAN discriminator architecture Operation x or G(z) downconv1 lrelu(a=0.2) downconv2 bnorm lrelu(a=0.2) downconv3 bnorm lrelu(a=0.2) downconv4 stackchannels downconv5 flatten fc1 sigmoid Input Shape (k,64,64,3) (k,64,64,3) (k,32,32,64) (k,32,32,64) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,8,8,256) (k,8,8,256) (k,8,8,256) (k,4,4,512) (4,4,512k) (2,2,512) (2048,) (1,) Kernel Size (5,5,3,64) (5,5,64,128) (5,5,128,256) (5,5,256,512) (3,3,512k,512) (2048,1) 15 Output Shape (k,64,64,3) (k,32,32,64) (k,32,32,64) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,8,8,256) (k,8,8,256) (k,8,8,256) (k,4,4,512) (4,4,512k) (2,2,512) (2048,) (1,) (1,) Published as a conference paper at ICLR 2018 Table 5: SD-BEGAN generator architecture Operation z fc1 reshape conv2d elu conv2d elu upsample2 conv2d elu conv2d elu upsample2 conv2d elu conv2d elu upsample2 conv2d elu conv2d elu conv2d Input Shape (k,100) (k,100,) (k,100,8192) (k,8,8,128) (k,8,8,128) (k,8,8,128) (k,8,8,128) (k,8,8,128) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,32,32,128) (k,32,32,128) (k,32,32,128) (k,32,32,128) (k,32,32,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) Kernel Size (100,8192) (3,3,128,128) (3,3,128,128) (3,3,128,128) (3,3,128,128) (3,3,128,128) (3,3,128,128) (3,3,128,128) (3,3,128,128) (3,3,128,3) Output Shape (k,100) (k,100,8192) (k,8,8,128) (k,8,8,128) (k,8,8,128) (k,8,8,128) (k,8,8,128) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,16,16,128) (k,32,32,128) (k,32,32,128) (k,32,32,128) (k,32,32,128) (k,32,32,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,3) Table 6: SD-BEGAN discriminator autoencoder architecture. The decoder portion is equivalent to, but does not share weights with, the SD-BEGAN generator architecture (Table 5). Operation x or G(z) conv2d elu conv2d elu conv2d elu downconv2d elu conv2d elu conv2d elu downconv2d elu conv2d elu conv2d elu downconv2d elu conv2d elu conv2d elu flatten fc1 concat fc2 fc3 split G (Table 5) Input Shape (k,64,64,3) (k,64,64,3) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,32768) (k,100) (100k,) (dI +(100-dI )k,) (100k,) (k,100) Kernel Size (3,3,3,128) (3,3,128,128) (3,3,128,128) (3,3,128,256) (3,3,256,256) (3,3,256,256) (3,3,256,384) (3,3,384,384) (3,3,384,384) (3,3,384,512) (3,3,512,512) (3,3,512,512) (32768,100) (100k,dI +(100-dI )k,) (dI +(100-dI )k,100k,) 16 Output Shape (k,64,64,3) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,64,64,128) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,32,32,256) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,16,16,384) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,8,8,512) (k,32768) (k,100) (100k,) (dI +(100-dI )k,) (100k,) (k,100) (k,64,64,3) Published as a conference paper at ICLR 2018 F FACE S AMPLES We present samples from each model reported in Table 1 for qualitative comparison. In each matrix, zI is the same across all images in a row and zO is the same across all images in a column. We draw identity and observation vectors randomly for these samples. Figure 12: Generated samples from AC-DCGAN (four sample of real photos of ID on right) Figure 13: Generated samples from SD-DCGAN Figure 14: Generated samples from SD-DCGAN with stacked-channel discriminator 17 Published as a conference paper at ICLR 2018 Figure 15: Generated samples from SD-DCGAN with k = 4 Figure 16: Generated samples from SD-DCGAN with dI = 25 Figure 17: Generated samples from SD-DCGAN with dI = 75 Figure 18: Generated samples from SD-DCGAN trained with the Wasserstein GAN loss (Arjovsky et al., 2017). This model was optimized using RMS-prop (Hinton et al.) with α = 5e−5. In our evaluation (Section 3.2), FaceNet had an AUC of .770 and an accuracy of 68.5% (at τv ) on data generated by this model. We excluded it from Table 1 for brevity. 18 Published as a conference paper at ICLR 2018 Figure 19: Generated samples from SD-BEGAN Figure 20: Generated samples from SD-BEGAN with k = 4, demonstrating mode collapse G S HOE S AMPLES We present samples from an SD-DCGAN and SD-BEGAN trained on our shoes dataset. Figure 21: Generated samples from SD-DCGAN Figure 22: Generated samples from SD-BEGAN 19
9cs.NE
Deep clustering: Discriminative embeddings for segmentation and separation Zhuo Chen Columbia University New York, NY [email protected] arXiv:1508.04306v1 [cs.NE] 18 Aug 2015 John R. Hershey MERL Cambridge, MA [email protected] Jonathan Le Roux MERL Cambridge, MA [email protected] Shinji Watanabe MERL Cambridge, MA [email protected] Abstract We address the problem of acoustic source separation in a deep learning framework we call “deep clustering”. Rather than directly estimating signals or masking functions, we train a deep network to produce spectrogram embeddings that are discriminative for partition labels given in training data. Previous deep network approaches provide great advantages in terms of learning power and speed, but previously it has been unclear how to use them to separate signals in a classindependent way. In contrast, spectral clustering approaches are flexible with respect to the classes and number of items to be segmented, but it has been unclear how to leverage the learning power and speed of deep networks. To obtain the best of both worlds, we use an objective function that to train embeddings that yield a low-rank approximation to an ideal pairwise affinity matrix, in a classindependent way. This avoids the high cost of spectral factorization and instead produces compact clusters that are amenable to simple clustering methods. The segmentations are therefore implicitly encoded in the embeddings, and can be ”decoded” by clustering. Preliminary experiments show that the proposed method can separate speech: when trained on spectrogram features containing mixtures of two speakers, and tested on mixtures of a held-out set of speakers, it can infer masking functions that improve signal quality by around 6dB. We show that the model can generalize to three-speaker mixtures despite training only on twospeaker mixtures. The framework can be used without class labels, and therefore has the potential to be trained on a diverse set of sound types, and to generalize to novel sources. We hope that future work will lead to segmentation of arbitrary sounds, with extensions to microphone array methods as well as image segmentation and other domains. 1 Introduction In real world perception, we are often confronted with the problem of selectively attending to objects whose features are intermingled with one another in the incoming sensory signal. In computer vision, the problem of scene analysis is to partition an image or video into regions attributed to the visible objects present in the scene. In audio there is a corresponding problem known as auditory scene analysis [1, 2], which seeks to identify the components of audio signals corresponding to individual sound sources in a mixture signal. Both of these problems can be approached as segmentation problems, where we formulate a set of “elements” in the signal via an indexed set of features, each of 1 which carries (typically multi-dimensional) information about part of the signal. For images, these elements are typically defined spatially in terms of pixels, whereas for audio signals they may be defined in terms of time-frequency coordinates. The segmentation problem is then solved by segmenting elements into groups or partitions, for example by assigning a group label to each element. Note that although clustering methods can be applied to segmentation problems, the segmentation problem is technically different in that clustering is classically formulated as a domain-independent problem based on simple objective functions defined on pairwise point relations, whereas partitioning may depend on complex processing of the whole input, and the task objective may be arbitrarily defined via training examples with given segment labels. Segmentation problems can be broadly categorized into class-based segmentation problems where the goal is to learn from training class labels to label known object classes, versus more general partition-based segmentation problems where the task is to learn from labels of partitions, without requiring object class labels, to segment the input. Solving the partition-based problem has the advantage that unknown objects could then be segmented. In this paper, we propose a new partitionbased approach which learns embeddings for each input elements, such that the correct labeling can be determined by simple clustering methods. We focus on the single-channel audio domain, although our methods are applicable to other domains such as images and multi-channel audio. The motivation for segmenting in this domain, as we shall describe later, is that using the segmentation as a mask, we can extract parts of the target signals that are not corrupted by other signals. Since class-based approaches are relatively straightforward, and have been tremendously successful at their task, we first briefly mention this general approach. In class based vision models, such as [3–5], a hierarchical classification scheme is trained to estimate the class label of each pixel or superpixel region. In the audio domain, single-channel speech separation methods, for example, segment the time-frequency elements of the spectrogram into regions dominated by a target speaker, either based on classifiers [6–8], or generative models [9–11]. In recent years, the success of deep neural networks for classification problems has naturally inspired their use in class-based segmentation problems [4, 12], where they have proven very successful. However class-based approaches have some important limitations. First, of course, the assumed task of labeling known classes fundamentally does not address the general problem in real world signals that there may be a large number of possible classes, and many objects may not have a well-defined class. It is also not clear how to directly apply current class-based approaches to the more general problem. Class-based deep network models for separating sources require explicitly representing output classes and object instances in the output nodes, which leads to complexities in the general case. Although generative model-based methods can in theory be flexible with respect to the number of model types and instances after training, inference typically cannot scale computationally to the potentially larger problem posed by more general segmentation tasks. In contrast, humans seem to solve the partition-based problem, since they can apparently segment well even with novel objects and sounds. This observation is the basis of Gestalt theories of perception, which attempt to explain perceptual grouping in terms of features such as proximity and similarity [13]. The partition-based segmentation task is closely related, and follows from a tradition of work in image segmentation and audio separation. Application of the perceptual grouping theory to audio segmentation is generally known as computational auditory scene analysis (CASA) [14, 15]. Spectral clustering is an active area of machine learning research with application to both image and audio segmentation. It uses local affinity measures between features of elements of the signal, and optimizes various objective functions using spectral decomposition of the normalized affinity matrix [16]. In contrast to conventional central clustering algorithms such as k-means, spectral clustering has the advantage that it does not require points to be tightly clustered around a central prototype, and can find clusters of arbitrary topology, provided that they form a connected sub-graph. Because of the local form of the pairwise kernel functions used, in difficult spectral clustering problems the affinity matrix has a sparse block-diagonal structure that is not directly amenable to central clustering, which works well when the block diagonal affinity structure is dense. The powerful but computationally expensive eigenspace transformation step of spectral clustering addresses this, in effect, by ”fattening” the block structure, so that connected components become dense blocks, prior to central clustering [17]. 2 Although affinity-based methods were originally unsupervised inference methods, multiple-kernel learning methods such as [17, 18] were later introduced to train weights used to combine separate affinity measures. This allows us to consider using them for partition-based segmentation tasks in which partition labels are available, but without requiring specific class labels. In [17], this was applied to speech separation by including a variety of complex features developed to implement various auditory scene analysis grouping principles, such as similarity of onset/offset, pitch, spectral envelope, and so on, as affinities between time-frequency regions of the spectrogram. The input features included a dual pitch-tracking model in order to improve upon the relative simplicity of kernel-based features, at the expense of generality. Rather than using specially designed features and relying on the strength of the spectral clustering framework to find clusters, we propose to use deep learning to derive embedding features that make the segmentation problem amenable to simple and computationally efficient clustering algorithms such as k-means, using the partition-based training approach. Learned feature transformations known as embeddings have recently been gaining significant interest in many fields. Unsupervised embeddings obtained by auto-associative deep networks, used with relatively simple clustering algorithms, have recently been shown to outperform spectral clustering methods [19, 20] in some cases. Embeddings trained using pairwise metric learning, such as word2vec [21] using neighborhood-based partition labels, have also been shown to have interesting invariance properties. We present below an objective function that minimizes the distances between embeddings of elements within a partition, while maximizing the distances between embeddings for elements in different partitions. This appears to be an appropriate criterion for central clustering methods. The proposed embedding approach has the attractive property that all partitions and their permutations can be represented implicitly using the fixed-dimensional output of the network. The experiments described below show that the proposed method can separate speech using a speaker-independent model with an open set of speakers at test time. As in [17], we derive partition labels by mixing signals together and observing their spectral dominance patterns. After training on a database of mixtures of speakers trained in this way, we show that without any modification the model shows a promising ability to separate three-speaker mixtures despite training only on two-speaker mixtures. Although results are preliminary, the hope is that this work leads to methods that can achieve class-independent segmentation of arbitrary sounds, with additional application to image segmentation and other domains. 2 Learning deep embeddings for clustering We define as x a raw input signal, such as an image or a time-domain waveform, and as Xn = gn (x), n ∈ {1, . . . , N }, a feature vector indexed by an element n. In the case of images, n typically may be a superpixel index and Xn some vector-valued features of that superpixel; in the case of audio signals, n may be a time-frequency index (t, f ), where t indexes frames of the signal and f frequencies, and Xn = Xt,f the value of the complex spectrogram at the corresponding timefrequency bin. We assume that there exists a reasonable partition of the elements n into regions, which we would like to find, for example to further process the features Xn separately for each region. In the case of audio source separation, for example, these regions could be defined as the sets of time-frequency bins in which each source dominates, and estimating such a partition would enable us to build time-frequency masks to be applied to Xn , leading to time-frequency representations that can be inverted to obtain isolated sources. To estimate the partition, we seek a K-dimensional embedding V = fθ (x) ∈ RN ×K , parameterized by θ, such that performing some simple clustering in the embedding space will likely lead to a partition of {1, . . . , N } that is close to the target one. In this work, V = fθ (x) is based on a deep neural network that is a global function of the entire input signal x (we allow for a feature extraction step to create the network input; in general, the input features may be completely different from Xn ). Thus our transformation can take into account global properties of the input, and the embedding can be considered a permutation- and cardinality-independent encoding of the network’s P 2 estimate of the signal partition. Here we consider a unit-norm embedding, so that |vn |2 = k vn,k = 1, ∀n, where vn = {vn,k } and vn,k is the value of the k-th dimension of the embedding for element n. We omit the dependency of V on θ to simplify notations. 3 The partition-based training requires a reference label indicator Y = {yn,c }, mapping each element n to each of c arbitrary partition classes, so that yn,c = 1 if element n is in partition c. For a training objective, we seek embeddings that enable accurate clustering according to the partition labels. To do this, we need a convenient expression that is invariant to the number and permutations of the partition labels from one training example to the next. One such objective for minimization is X (hvi , vj i − 1)2 X (hvi , vj i − 0)2 p C(θ) = |V V T − Y Y T |2W = + , (1) di di dj i,j:yi =yj i,j:yi 6=yj  X |vi − vj |2 X |vi − vj |2 − 2 2 p + − N, (2) = di 4 di dj i,j i,j:y =y i j 1 T −2 − 2 2 where = d , where di = i,j wi,j ai,j is a weighted Frobenius norm, with W = d Y Y T 1 is an (N × 1) vector of partition sizes: that is, di = |{j : yi = yj }|. In the above we use the fact that |vn |2 = 1, ∀n. Intuitively, this objective pushes the inner product hvi , vj i to 1 when i and j are in the same partition, and to 0 when they are in different partitions. Alternately, we see from (2) that it pulls the squared distance |vi − vj |2 to 0 for elements within the same partition, while preventing the embeddings from trivially collapsing into the same point. Note that the first term is the objective function minimized by k-means, as a function of cluster assignments, and in this context the second term is a constant. So the objective reasonably tries to lower the k-means score for the labeled cluster assignments at training time. |A|2W P This formulation can be related to spectral clustering as follows. We can define an ideal affinity matrix A∗ = Y Y T , that is block diagonal up to permutation and use an inner-product kernel, so that A = V V T is our affinity matrix. Our objective becomes C = |A − A∗ |2F , which measures the deviation of the model’s affinity matrix from the ideal affinity. Note that although this function ostensibly sums over all pairs of data points i, j, the low-rank nature of the objective leads to an efficient implementation, defining D = diag(Y Y T 1): 1 1 1 C = |V V T − Y Y T |2W = |V T D− 2 V |2F − 2|V T D− 2 Y |2F + |Y T D− 2 Y |2F , (3) which avoids explicitly constructing the N ×N affinity matrix. In practice, N is orders of magnitude greater than K, leading to a significant speedup. To optimize a deep network, we typically need to use first-order methods. Fortunately derivatives of our objective function with respect to V are also efficiently obtained due to the low-rank structure: 1 1 1 1 ∂C = 4D− 2 V V T D− 2 V − 4D− 2 Y Y T D− 2 V. T ∂V (4) This low-rank formulation also relates to spectral clustering in that the latter typically requires the Nyström low-rank approximation to the affinity matrix, [22] for efficiency, so that the singular value decomposition (SVD) of an N × K matrix can be substituted for the much more expensive eigenvalue decomposition of the K × K normalized affinity matrix. Rather than following spectral clustering in making a low-rank approximation of a full-rank model, our method can be thought of as directly optimizing a low-rank affinity matrix so that processing is more efficient and parameters are tuned to the low-rank structure. At test time, we compute the embeddings V on the test signal, and cluster the rows vi ∈ RK , for example using k-means. We also alternately perform a spectral-clustering style dimensionality reduction before clustering, starting with a singular value decomposition (SVD), Ṽ = U SRT , of 1 normalized Ṽ = D− 2 V , where D = V V T 1N , sorted by decreasing eigenvalue, and clustering the normalized rows of the matrix of m principal left singular vectors, with the i’th row given by pP m 0 ũi,r = ui,r / r 0 =1 ui,r : r ∈ [1, m], similar to [23]. 3 3.1 Speech separation experiments Experimental setup We evaluate the proposed model on a speech separation task: the goal is to separate each speech signal from a mixture of multiple speakers. While separating speech from non-stationary noise is 4 in general considered to be a difficult problem, separating speech from other speech signals is particularly challenging because all sources belong to the same class, and share similar characteristics. Mixtures involving speech from same gender speakers are the most difficult since the pitch of the voice is in the same range. We here consider mixtures of two speakers and three speakers (the latter always containing at least two speakers of the same gender). However, our method is not limited in the number of sources it can handle or the vocabulary and discourse style of the speakers. To investigate the effectiveness of our proposed model, we built a new dataset of speech mixtures based on the Wall Street Journal (WSJ0) corpus, leading to a more challenging task than in existing datasets. Existing datasets are too limited for evaluation of our model because, for example, the speech separation challenge [24] only contains a mixture of two speakers, with a limited vocabulary and insufficient training data. The SISEC challenge (e.g., [25]) is limited in size and designed for the evaluation of multi-channel separation, which can be easier than single-channel separation in general. A training set consisting of 30 hours of two-speaker mixtures was generated by randomly selecting utterances by different speakers from the WSJ0 training set si_tr_s, and by mixing them at various signal-to-noise ratios (SNR) between 0 dB and 5 dB. We also designed the two training subsets from the above whole training set (whole), one considered the balance of the mixture of the genders (balanced, 22.5 hours), and the other only used the mixture of female speakers (female, 7.5 hours). 10 hours of cross validation set were generated similarly from the WSJ0 training set, which is used to optimize some tuning parameters, and to evaluate the source separation performance of the closed speaker experiments (closed speaker set). 5 hours of evaluation data was generated similarly using utterances from sixteen speakers from the WSJ0 development set si_dt_05 and evaluation set si_et_05, which are based on the different speakers from our training and closed speaker sets (open speaker set). Note that many existing speech separation methods (e.g., [5, 26]) cannot handle the open speaker problem without special adaptation procedures, and generally require knowledge of the speakers in the evaluation. For the evaluation data, we also created 100 utterances of three-speaker mixtures for each closed and open speaker set as an advanced setup. All data were downsampled to 8 kHz before processing to reduce computational and memory costs. The input features X were the log short-time Fourier spectral magnitudes of the mixture speech, computed with a 32 ms window length, 8 ms window shift, and the square root of the hann window. To ensure the local coherency, the mixture speech was segmented with the length of 100 frames, roughly the length of one word in speech, and processed separately to output embedding V based on the proposed model. The ideal binary mask was used to build the target Y when training our network. The ideal binary mask gives ownership of a time-frequency bin to the source whose magnitude is maximum among all sources in that bin. The mask values were assigned with 1 for active and 0 otherwise (binary), making Y Y T as the ideal affinity matrix for the mixture. To avoid problems due to the silence regions during separation, a binary weight for each timefrequency bin was used during the training process, only retaining those bins such that each source’s magnitude at that bin is greater than some ratio (arbitrarily set to -40 dB) of the source’s maximum magnitude. Intuitively, this binary weight guides the neural network to ignore bins that are not important to all sources. 3.2 Training procedure Networks in the proposed model were trained given the above input X and the ideal affinity matrix Y Y T . The network structure used in our experiments has two bi-directional long short-term memory (BLSTM) layers, followed with one feedforward layer. Each BLSTM layer has 600 hidden cells and the feedforward layer corresponds with the embedding dimension (i.e., K). Stochastic gradient descent with momentum 0.9 and fixed learning rate 10− 5 was used for training. In each updating step, a Gaussian noise with zero mean and 0.6 variance was added to the weight. We prepared several networks used in the speech separation experiments using different embedding dimensions from 5 to 60. In addition, two different activation functions (logistic and tanh) were explored to form the embedding V with different ranges of vn,k . For each embedding dimension, the weights for the corresponding network were initialized randomly from the scratch according to a normal distribution with zero mean and 0.1 variance with the tanh activation and whole training set. In the experiments of a different activation (logistic) and different training subsets (balanced and female), the network was initialized with the one with the tanh activation and whole training set. The implementation was 5 Table 1: SDR improvements (in dB) for different clustering methods. method oracle NMF DC oracle k-means DC oracle spectral DC global k-means closed speaker set 5.06 6.54 6.35 5.87 open speaker set 6.45 6.26 5.81 Table 2: SDR improvements (in dB) for different embedding dimensions K and activation functions model K=5 K = 10 K = 20 K = 40 K = 60 K = 40 logistic closed speaker set DC oracle DC global -0.77 -0.96 5.15 4.52 6.25 5.56 6.54 5.87 6.00 5.19 6.59 5.86 open speaker set DC oracle DC global -0.74 -1.07 5.29 4.64 6.38 5.69 6.45 5.81 6.08 5.28 6.61 5.95 based on CURRENNT, a publicly available training software for DNN and (B)LSTM networks with GPU support (https://sourceforge.net/p/currennt). 3.3 Speech separation procedure In the test stage, the speech separation was performed by constructing a time-domain speech signal based on time-frequency masks for each speaker. The time-frequency masks for each source speaker were obtained by clustering the row vectors of embedding V , where V was outputted from the proposed model for each segment (100 frames), similarly to the training stage. The number of clusters corresponds to the number of speakers in the mixture. We evaluated various types of clustering methods: k-means on the whole utterance by concatenating the embeddings V for all segments; k-means clustering within each segment; spectral clustering within each segment. For the withinsegment clusterings, one needs to solve a permutation problem, as clusters are not guaranteed to be consistent across segments. For those cases, we report oracle permutation results (i.e., permutations that minimize the L2 distance between the masked mixture and each source’s complex spectrogram) as an upper bound on performance. One interesting property of the proposed model is that it can potentially generalize to the case of three-speaker mixtures without changing the training procedure in Section 3.2. To verify this, speech separation experiments on three-speaker mixtures were conducted using the network trained with two speaker mixtures, simply changing the above clustering step from 2 to 3 clusters. Of course, training the network including mixtures involving more than two speakers should improve performance further, but we shall see that the method does surprisingly well even without retraining. As a standard speech separation method, supervised sparse non-negative matrix factorization (SNMF) was used as a baseline [26]. While SNMF may stand a chance separating speakers in male-female mixtures when using a concatenation of bases trained separately on speech by other speakers of each gender, it would not make sense to use it in the case of same-gender mixtures. To give SNMF the best possible advantage, we use an oracle: at test time we give it the basis functions trained on the actual speaker in the mixture. For each speaker, 256 bases were learned on the clean training utterances of that speaker. Magnitude spectra with 8 consecutive frames of left context were used as input features. At test time, the basis functions for the two speakers in the test mixture were concatenated, and their corresponding activations computed on the mixture. The estimated models for each speaker were then used to build a Wiener-filter like mask applied to the mixture, and the corresponding signals reconstructed by inverse STFT. For all the experiment, performance was evaluated in terms of averaged signal-to-distortion ratio (SDR) using the bss_eval toolbox [27]. The initial SDR averaged over the mixtures was 0.16 dB for two speaker mixtures and −2.95 dB for three speaker mixtures. 6 Table 3: SDR improvement (in dB) for each type of mixture. Scores averaged over male-male (m+m), female-female (f+f), female-male (f+m), or all mixtures. method oracle NMF DC oracle permute DC global k-means training gender distribution speaker dependent whole balanced female whole balanced female closed speaker set m+m f+f f+m all 3.25 3.31 6.53 4.90 3.79 4.29 9.04 6.54 3.89 4.35 8.74 6.42 5.03 2.54 2.85 9.07 5.87 2.78 2.87 8.63 5.72 3.88 - m+m 4.49 4.61 3.51 3.89 - open speaker set f+f f+m 3.21 8.69 3.49 8.27 4.04 1.42 8.57 1.74 8.27 2.56 - all 6.45 6.41 5.80 5.83 - Table 4: SDR improvement (in dB) for three speaker mixture method oracle NMF DC oracle DC global 4 closed speaker set 4.42 3.50 2.74 open speaker set 2.81 2.22 Results and discussion As shown in Table 1, both the oracle and non-oracle clustering methods for proposed system significantly outperform the oracle NMF baseline, even though the oracle NMF is a strong model with the important advantage of knowing the speaker identity and has speaker-dependent models. For the proposed system the open speaker performance is similar to the closed speaker results, indicating that the system can generalize well to unknown speakers, without any explicit adaptation methods. For different clustering methods, the oracle k-means outperforms the oracle ”spectral clustering” by 0.19 dB showing that the embedding represents centralized clusters. To be fair, what we call spectral clustering here is using our outer product kernel instead of a local kernel function such as a Gaussian, as commonly used in spectral clustering. However a Gaussian kernel could not be used here due to computational complexity. Also note that the oracle clustering method in our experiment resolves the permutation of two (or three in Table 4) speakers in each segment. In the dataset, each utterance usually contains 6∼8 segments so the permutation search space is relatively small for each utterance. Hence this problem may have an easy solution to be explored in future work. For the non-oracle experiments, the whole utterance clustering also performs relatively well compared to baseline. Given the fact that the system was only trained with individual segments, the effectiveness of the whole utterance clustering suggests that the network learns features that are globally important, such us pitch, timbre etc. In Table 2, the K = 5 system completely fails, either because optimization of the current network architecture fails, or the embedding fundamentally requires more dimensions. The performance of K = 20, K = 40, K = 60 are similar, showing that the system can operate in a wide range of parameter values. We arbitrarily used tanh networks in most of the experiments because the tanh network has larger embedding space than logistic network. However, in Table 2, we show that in retrospect the logistic network performs slightly better than the tanh one. In Table 3, since the female and male mixture is an intrinsically easier segmentation problem, the performance of mixture between female and male is significantly better than the same gender mixtures for all situations. As mentioned in Section 3, the random selection of speaker would also be a factor for the large gap. With more balanced training data, the system has better performance for the same gender separation with a sacrifice of its performance for different gender mixture. If we only focus on female mixtures, the performance is still better. Figure 2 shows an example of embeddings for two different mixtures (female-female and malefemale), in which a few embedding dimensions are plotted for each time-frequency bin in order to show how they are sensitive to different aspects of each signal. In Table 4, the proposed system can also separate the mixture of three speakers, even though it is only trained on two-speaker mixtures. As discussed in previous sections, unlike many separation algorithms, deep clustering can naturally scale up to more sources, and thus make it suitable for many real world tasks when the number of sources is not available or fixed. Figure 1 shows one 7 Frequency (kHz) 4 3 2 1 Frequency (kHz) 0 4 3 2 1 Frequency (kHz) 0 4 3 2 1 0 1 2 3 4 5 Time (s) Figure 1: An example of three-speaker separation. Top: log spectrogram of the input mixture. Middle: ideal binary mask for three speakers. The dark blue shows the silence part of the mixture. Bottom: output mask from the proposed system trained on two-speaker mixtures. example of the separation for three speaker mixture in the open speaker set case. Note that we also did experiments with mixtures of three fixed speakers for the training and testing data, and the SDR improvement of the proposed system is 6.15. Deep clustering has been evaluated in a variety of conditions and parameter regimes, on a challenging speech separation problem. Since these are just preliminary results, we expect that further refinement of the model will lead to significant improvement. For example, by combining the clustering step into the embedding BLSTM network using the deep unfolding technique [28], the separation could be jointly trained with embedding and lead to potential better result. Also in this work, the BLSTM network has a relatively uniform structure. Alternative architectures with different time and frequency dependencies, such as deep convolutional neural networks [3], or hierarchical recursive embedding networks [4], could also be helpful in terms of learning and regularization. Finally, scaling up training on databases of more disparate audio types, as well as applications to other domains such as image segmentation, would be prime candidates for future work. 8 Frequency (kHz) 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0 0 1 2 30 Time (s) 1 2 3 Time (s) Figure 2: Examples of embeddings for two mixtures: f+f (left) and f+m (right). 1st row: spectrogram; 2nd row: ideal binary mask; 3rd-5th row: embeddings. 9 References [1] A. S. Bregman, Auditory scene analysis: The perceptual organization of sound, MIT press, 1994. [2] C. J. Darwin and R. P. Carlyon, “Auditory grouping,” in Hearing, B. Moore, Ed. Elsevier, 1995. [3] C. Farabet, C. Couprie, L. Najman, and Y. LeCun, “Learning hierarchical features for scene labeling,” IEEE Trans. PAMI, vol. 35, no. 8, pp. 1915–1929, 2013. [4] A. Sharma, O. Tuzel, and M.-Y. Liu, “Recursive context propagation network for semantic scene labeling,” in Proc. NIPS, 2014, pp. 2447–2455. [5] P. Smaragdis, “Convolutive speech bases and their application to supervised speech separation,” IEEE Trans. Audio, Speech, Language Process., vol. 15, no. 1, pp. 1–12, 2007. [6] R. J. Weiss and D. P. Ellis, “Estimating single-channel source separation masks: Relevance vector machine classifiers vs. pitch-based masking,” in Proc. SAPA, 2006, pp. 31–36. [7] G. Kim, Y. Lu, Y. Hu, and P. C. Loizou, “An algorithm that improves speech intelligibility in noise for normal-hearing listeners,” J. Acoust. Soc. Am., vol. 126, no. 3, pp. 1486–1494, 2009. [8] Y. Wang, K. Han, and D. Wang, “Exploring monaural features for classification-based speech segregation,” IEEE Trans. Audio, Speech, Language Process., vol. 21, no. 2, pp. 270–279, 2013. [9] S. T. Roweis, “Factorial models and refiltering for speech separation and denoising,” in Proc. Eurospeech, 2003, pp. 1009–1012. [10] M. Schmidt and R. Olsson, “Single-channel speech separation using sparse non-negative matrix factorization,” in Proc. Interspeech, 2006, pp. 3111–3119. [11] J. R. Hershey, S. J. Rennie, P. A. Olsen, and T. T. Kristjansson, “Super-human multi-talker speech recognition: A graphical modeling approach,” Comput. Speech Lang., vol. 24, no. 1, pp. 45–66, 2010. [12] Y. Wang and D. Wang, “Towards scaling up classification-based speech separation,” IEEE Trans. Audio, Speech, Language Process., vol. 21, no. 7, pp. 1381–1390, 2013. [13] M. Wertheimer, “Laws of organization in perceptual forms,” in A Source book of Gestalt psychology, W. A. Ellis, Ed., pp. 71–88. Routledge and Kegan Paul, 1938. [14] M. P. Cooke, Modelling auditory processing and organisation, Ph.D. thesis, Univ. of Sheffield, 1991. [15] D. P. W. Ellis, Prediction-Driven Computational Auditory Scene Analysis, Ph.D. thesis, MIT, 1996. [16] J. Shi and J. Malik, “Normalized cuts and image segmentation,” IEEE Trans. PAMI, vol. 22, no. 8, pp. 888–905, 2000. [17] F. R. Bach and M. I. Jordan, “Learning spectral clustering, with application to speech separation,” JMLR, vol. 7, pp. 1963–2001, 2006. [18] C. Fowlkes, D. Martin, and J. Malik, “Learning affinity functions for image segmentation: Combining patch-based and gradient-based approaches,” in Proc. CVPR, 2003, vol. 2, pp. 54–61. [19] F. Tian, B. Gao, Q. Cui, E. Chen, and T.-Y. Liu, “Learning deep representations for graph clustering,” in Proc. AAAI, 2014. [20] P. Huang, Y. Huang, W. Wang, and L. Wang, “Deep embedding network for clustering,” in Proc. ICPR, 2014, pp. 1532–1537. [21] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean, “Distributed representations of words and phrases and their compositionality,” in Proc. NIPS, 2013, pp. 3111–3119. [22] C. Fowlkes, S. Belongie, F. Chung, and J. Malik, “Spectral grouping using the nyström method,” IEEE Trans. PAMI, vol. 26, no. 2, pp. 214–225, 2004. [23] A. Y. Ng, M. I. Jordan, Y. Weiss, et al., “On spectral clustering: Analysis and an algorithm,” in Proc. NIPS, 2002, pp. 849–856. [24] M. Cooke, J. R. Hershey, and S. J. Rennie, “Monaural speech separation and recognition challenge,” Computer Speech & Language, vol. 24, no. 1, pp. 1–15, 2010. [25] E. Vincent, S. Araki, F. Theis, G. Nolte, P. Bofill, H. Sawada, A. Ozerov, V. Gowreesunker, D. Lutter, and N. Q. Duong, “The signal separation evaluation campaign (2007–2010): Achievements and remaining challenges,” Signal Processing, vol. 92, no. 8, pp. 1928–1936, 2012. [26] J. Le Roux, F. J. Weninger, and J. R. Hershey, “Sparse NMF – half-baked or well done?,” Tech. Rep. TR2015-023, MERL, Cambridge, MA, USA, Mar. 2015. [27] E. Vincent, R. Gribonval, and C. Févotte, “Performance measurement in blind audio source separation,” IEEE Trans. Audio, Speech, Language Process., vol. 14, no. 4, pp. 1462–1469, 2006. [28] J. R. Hershey, J. Le Roux, and F. Weninger, “Deep unfolding: Model-based inspiration of novel deep architectures,” Sep. 2014, arXiv:1409.2574. 10
9cs.NE
arXiv:1307.6380v1 [math.AC] 24 Jul 2013 CODES OVER A WEIGHTED TORUS EDUARDO DIAS AND JORGE NEVES Abstract. We define weighted projective Reed–Muller codes over a subset X ⊂ P(w1 , . . . , ws ) in weighted projective space over a finite field. We focus on the case when the set X is a projective weighted torus. We show that the vanishing ideal of X is a lattice ideal and relate it with the lattice ideal of a minimal presentation of the semigroup algebra of the numerical semigroup Q = hw1 , . . . , ws i ⊂ N. We compute the index of regularity of the vanishing ideal as function of the weights of the projective space and the Frobenius number of Q. We compute the basic parameters of weighted projective Reed–Muller codes over a 1-dimensional weighted torus and prove they are maximum distance separable codes. 1. Introduction A standard projective Reed–Muller code, CX (d), is the image of the degree d homogeneous component of a standard polynomial ring K[t1 , . . . , ts ] over a finite field K by a homomorphism defined by evaluation of forms of degree d on the points of and arbitrary subset X ⊂ Ps . In this work we define the notion of weighted projective Reed–Muller code (see Definition 3.1). This notion differs from the standard definition in that the grading of K[t1 , . . . , ts ], which is given by deg(ti ) = wi ≥ 1, for coprime integers wi , is not necessarily the standard one. We focus on the family of codes CT (d) associated to a weighted (s−1)-dimensional projective torus T(w1 , . . . , ws ) (see Definition 2.4). Standard projective Reed–Muller codes of order d ≤ q were defined and studied by Lachaud in [16, 17] and, for all d ≥ 0, by Sørensen in [29]. Much of the recent research on projective Reed–Muller codes over an arbitrary subset of X ⊂ Ps focuses on the computation of their basic parameters: length, dimension and minimum distance (see Definition 3.3). When X = Ps all the basic parameters are known (cf. [17, 29]); in particular, projective Reed–Muller codes over P1 are maximum distance separable codes. In general, an approach to this computation 2010 Mathematics Subject Classification. Primary 13P25; Secondary 14G50, 14G15, 11T71, 94B27, 94B05. The second author was partially funded by CMUC, through European program COMPETE/FEDER and FCT project PEst-C/MAT/UI0324/2011. Part of work was developed during a research visit of the second author to CINVESTAV of the IPN, México, under the financial support of a research grant from Santander Totta Bank (Portugal). 1 2 EDUARDO DIAS AND JORGE NEVES using commutative algebra (as in [24]) relies on a good understanding of IX ⊂ K[t1 , . . . , ts ], the vanishing ideal of X. Many authors have studied projective Reed–Muller codes over a subset X ⊂ Ps for which the ideal IX is well understood; e.g., when X is the set of rational points of a complete intersection, cf. [1, 4, 5, 7, 10, 14, 27, 28], when X is the Segre embedding of the product of two projective spaces, cf. [11], when X is the Veronese variety cf. [12], when X is an affine cartesian product cf. [3, 18], or when X is the projective torus in Ps , or an algebraic toric subset, cf. [20, 21, 23, 26, 27]. The advantage of working with subsets of the torus is that for a certain subclass of these subsets (consisting of algebraic toric subsets, as defined by Villarreal et al. in [25, 23]) the ideal IX is a lattice ideal. Like in the standard case, IT , the vanishing ideal of the weighted torus T(w1 , . . . , ws ), is also a lattice ideal. Indeed, we show that IT is Cohen–Macaulay, 1-dimensional and can be obtained from the lattice ideal of a minimal presentation of the semigroup algebra of the numerical semigroup Q = hw1 , . . . , ws i ⊂ N (cf. Theorem 2.8). The lattice ideal of a minimal presentation of the semigroup algebra was first studied by Herzog in [15]. He gives a sufficient condition for this ideal to be a complete intersection (see Remark 2.12), which, combined with our results, is also a sufficient condition for IT to be a complete intersection. The relation between IT and the lattice ideal of a minimal presentation of Q enables the computation of the Hilbert Series and the index of regularity of K[t1 , . . . , ts ]/IT in terms of w1 , . . . , ws and the Frobenius number of Q (cf. Theorem 3.8 and Corollary 3.9). The importance, from a coding theory point of view, of the knowledge of the index of regularity is clearer in the case of standard projective Reed–Muller codes. Here, the function dimK CX (d) is strictly increasing and the value of d for which dimK CX (d) becomes constant and equal to the dimension of the ambient space (thus, for which CX (d) becomes the trivial code) is precisely given by the index of regularity. In the weighted case dimK CX (d) is not necessarily an increasing function and we may get some trivial codes CX (d) before d reaches the index of regularity (cf. Example 3.10). However for d greater than or equal to index of regularity CX (d) is always a trivial code. The structure of the article is as follows. In Section 2 we study the vanishing ideal of a weighted projective torus. The basic definitions are recalled. We show that IT is a 1-dimensional, CohenMacaulay lattice ideal and relate it to the lattice ideal of a minimal presentation of the semigroup algebra of Q = hw1 , . . . , ws i. In Section 3 we define weighted projective Reed-Muller codes. We compute the length of the weighted projective Reed–Muller codes over the weighted torus (cf. Proposition 3.5) and we compute the Hilbert Series and the index of regularity of K[t1 , . . . , ts ]/IT (cf. Theorem 3.8 and Corollary 3.9). In Section 4 we study projective Reed–Muller codes over a CODES OVER A WEIGHTED TORUS 3 1-dimensional weighted torus T(w1 , w2 ). We compute their dimensions and minimum distances (cf. Proposition 4.1 and Theorem 4.4) and we show they are maximum distance separable codes. 2. Vanishing ideal of a weighted torus Let K be a finite field with q elements. We denote by K ∗ the cyclic group of invertible elements of K. Given two s-tuples v = (n1 , . . . , ns ) ∈ Ns and u = (u1 , . . . , us ) ∈ Rs , where R is a commutative ring with identity, uv denotes un1 1 · · · uns s ∈ R. We will use this notation for vectors of variables t = (t1 , . . . , ts ) or y = (y1 , . . . , ys ). We reserve boldface for vectors of integers. Definition 2.1. An ideal I ⊂ K[t1 , . . . , ts ] generated by binomials, i.e. polynomials of the form αta − βtb , for some α, β ∈ K and a, b ∈ Ns , is called a binomial ideal. We will only deal with pure binomials, i.e., binomials for which α = β = 1. Definition 2.2. Let L ⊂ Zs be a lattice. The lattice ideal IL ⊂ K[t1 , . . . , ts ] is the ideal generated by ta − tb for all a, b ∈ Ns such that a − b ∈ L. Definition 2.3. Let w1 , . . . , ws be a set of positive integers satisfying gcd(w1 , . . . , ws ) = 1. The weighted projective space, that we denote by P(w1 , . . . , ws ), is the quotient (K s \ 0)/K ∗ , where λ ∈ K ∗ acts by λ(x1 , . . . , xs ) = (λw1 x1 , . . . , λws xs ). Let K[t1 , . . . , ts ] be the coordinate ring of P(w1 , . . . , ws ), endowed with the grading given by deg(ti ) = wi , for all 1 ≤ i ≤ s. Set w = (w1 , . . . , ws ). We remark that a binomial ta − tb , with a, b ∈ Ns is homogeneous if and only if ha − b, wi = 0. Definition 2.4. The weighted projective torus, T(w1 , . . . , ws ) ⊂ P(w1 , . . . , ws ) is the set: T(w1 , . . . , ws ) := {(x1 , . . . , xs ) ∈ P(w1 , . . . , wx ) : x1 · · · xs 6= 0} . Definition 2.5. For a set X ⊂ P(w1 , . . . , ws ) the ideal of K[t1 , . . . , ts ] generated by all homogeneous polynomials that vanish on X is called the vanishing ideal of X and is denoted by IX . We denote the vanishing ideal of T(w1 , . . . , ws ) by IT . Over an infinite field IT = (0). However given that K has q elements and its multiplicative group is cyclic of order q − 1, we get w (q−1) w (q−1) w (q−1)  1 (q−1) t2 1 − t1 2 , . . . , tw − t1 s ⊂ IT . s For general w1 , . . . , ws this inclusion is strict. The precise structure of a minimal generating set of IT is closely related with the numerical semigroup Q = hw1 , . . . , ws i ⊂ N, cf. Remark 2.12. The proof of the next lemma follows closely that of Theorem 2.1 in [23]. 4 EDUARDO DIAS AND JORGE NEVES Lemma 2.6. In the polynomial ring extension K[t1 , . . . , ts ] ⊂ K[t1 , . . . , ts , y1 , . . . , ys , z], IT = ({ti − yi z wi }si=1 ∪ {yiq−1 − 1}si=1 ) ∩ K[t1 , . . . , ts ]. (2.1) In particular, IT is generated by homogeneous pure binomials. Proof. Let J denote the ideal on the right hand side of (2.1). We start by showing that IT ⊂ J. P Let f = rj=1 αj tvj , for some αj ∈ K and vj ∈ Ns be a homogeneous polynomial of degree d. Let u = (u1 , . . . , us ) ∈ Ns , then u t = tu1 1 · · · tus s = (t1 − y1 z w1 w 1 u1 + y1 z ) · · · (ts − ys z ws w s us + ys z ) = s X (ti − yi z wi )gu,i + z d y u , i=1 Ps where gu,j ∈ K[t1 , . . . , ts , y1 , . . . , ys , z] and d = i=1 ui wi . Notice that since f is homogeneous of degree d, this sum with u replaced by vj equals d. Expanding each tvj in this way, we get f= s X wi (ti − yi z )gi + z i=1 d r X αj y v j , j=1 Pr Pr vj by the set {yiq−1 − 1}si=1 in the where gi = j=1 αj y j=1 gvj ,i . Dividing the polynomial polynomial ring K[y1 , . . . , ys ], we deduce that there exist hi , g ∈ K[y1 , . . . , ys ], with g of degree < q − 1 in each variable such that (2.2) f= s X wi (ti − yi z )gi + z d i=1 s X (yiq−1 − 1)hi + z d g. i=1 Let us show that g(x1 , . . . , xs ) = 0 for all (x1 , . . . , xs ) ∈ (K ∗ )s , since, by the Combinatorial Nullstellensatz, this implies that g = 0. Regarding (x1 , . . . , xs ) ∈ (K ∗ )s as a system of homogeneous coordinates of a point in T(w1 , . . . , ws ) we get, by assumption, f (x1 , . . . , xs ) = 0. Hence, setting ti = yi = xi and z = 1 in (2.2): 0= s X (xiq−1 − 1)hi (x1 , . . . , xs ) + g(x1 , . . . , xs ) = g(x1 , . . . , xs ). i=1 To show the reverse inclusion we start by remarking that J, being an elimination of an ideal generated by pure binomials, is itself generated by pure binomials (cf. [8]). It suffices to show that any pure binomial in J is also in IT . In passing we will show that such a binomial is homogeneous. This will imply the assertion that IT is generated by homogeneous pure binomials. Let ta − tb ∈ J, for some a, b ∈ Ns . Then there exist gi , hi ∈ K[t1 , . . . , ts , y1, . . . , ys , z] such that (2.3) a b t −t = s X i=1 wi (ti − yi z )gi + s X i=1 (yiq−1 − 1)hi . CODES OVER A WEIGHTED TORUS 5 Substituting in (2.3) 1 for yi and z wi for ti we get z a1 w1 · · · z as ws −z b1 w1 · · · z bs ws = 0 and therefore ha, wi = hb, wi, i.e., ta − tb is homogeneous. Finally, to show that it vanishes on an arbitrary point (x1 , . . . , xs ) of the weighted torus, we use (2.3) but this time substituting ti and yi by xi and z by 1.  Remark 2.7. More generally, it can be shown that Lemma 2.6 holds for the vanishing ideal of a weighted toric subset X ⊂ T(w1 , . . . , ws ) parameterized by v1 , . . . , vs ∈ Nn , for some integer n > 0. More precisely, by analogy with the standard case (cf. [23, §2]), when X the subset defined by: X = {(xv1 , . . . , xvs ) ∈ P(w1 , . . . , ws ) : x ∈ (K ∗ )n } , P P P where wi = 1d nj=1(vi )j , with d = gcd{ nj=1 (v1 )j , . . . , nj=1 (vs )j }. In the case when v1 , . . . , vs coincide with the incidence vectors of a uniform clutter (and, in particular, of a graph), this notion coincides with the notion of toric subset parameterized by v1 , . . . , vs , as defined in [23, 26]. We denote by w⊥ the orthogonal in Rs of hwi, with respect to the canonical inner product.  Theorem 2.8. Let L = (q − 1) w⊥ ∩ Zs . Then IT = IL and, in particular, IT is 1-dimensional and Cohen–Macaulay. Proof. To prove the equality we need to show the inclusion IT ⊂ IL . Let ta −tb ∈ K[t1 , . . . , ts ] be a homogeneous binomial vanishing on T(w1 , . . . , ws ). Fix i ∈ {1, . . . , s} and let α be a generator of K ∗ . Consider (1, . . . , 1, α, 1, . . . , 1) ∈ T(w1 , . . . , ws ), with α in the i-th position. Evaluating ta − tb at this point we obtain αai − αbi = 0 ⇐⇒ αai −bi = 1 ⇐⇒ ai − bi ≡ 0 (mod q − 1). Since this holds for any i ∈ {1, . . . , s} we obtain a − b ∈ (q − 1)Ns . As ta − tb is homogeneous we get ha − b, wi = 0 and hence a − b ∈ L. This proves that IT = IL Since the rank of L is s − 1 we deduce that IT is 1-dimensional (cf. [19, Proposition 7.5]). Furthermore, since w (q−1) w (q−1) w (q−1)  1 (q−1) (2.4) t2 1 − t1 2 , . . . , tw − t1 s ⊂ IT s and consequentially V (IT , ti ) = {0}, by [22, Proposition 5.3], IT is Cohen–Macaulay.  Definition 2.9. Let Q ⊂ N denote the submonoid of N generated by w1 , . . . , ws ∈ N. Since gcd(w1 , . . . , ws ) = 1, Q is a numerical semigroup, i.e., it has finite complement. The semigroup algebra, denoted by K[Q] is the subalgebra of the polynomial ring K[z] given by K[z w1 , . . . , z ws ]. Lemma 2.10. Let L♭ = w⊥ ∩ Zs and consider IL♭ ⊂ K[t1 , . . . , ts ] the corresponding lattice ideal. Then IL♭ is a homogeneous ideal and K[t1 , . . . , ts ]/IL♭ ≃ K[Q]. 6 EDUARDO DIAS AND JORGE NEVES Proof. See [19, Theorem 7.3] and also [15, Proposition 1.4].  The following lemma yields a relation between IT and IL♭ is given by the following lemma. Lemma 2.11. Let L♭ = w⊥ ∩ Zs . Suppose that IL♭ = (ta1 − tb1 , . . . , tar − tbr ), for some ai , bi ∈ Ns . Then IT = (t(q−1)a1 − t(q−1)b1 , . . . , t(q−1)ar − t(q−1)br ). Proof. Let J = (t(q−1)a1 − t(q−1)b1 , . . . , t(q−1)ar − t(q−1)br ). Since (q − 1)ai − (q − 1)bi ∈ L, the inclusion J ⊂ IT is clear. Conversely, let ta − tb ∈ IT . Then there exist c+ , c− ∈ Ns such that + − c+ − c− ∈ L♭ and a − b = (q − 1)(c+ − c− ). Since tc − tc ∈ IL♭ there exist hi ∈ K[t1 , . . . , ts ] P + − r aj such that tc − tc = − tbj )hj . Substituting in this equality tiq−1 for ti , for every j=1 (t i = 1, . . . , s, we deduce that ta − tb ∈ J. Hence IT ⊂ J.  Remark 2.12. In [15], Herzog shows that if the condition (2.5) lcm(gcd {w1 , . . . , wi−1 } , wi ) ∈ hw1 , . . . , wi−1 i Q rij is satisfied, for every i = 2, . . . , s, then IL♭ is generated by the binomials tci i − i−1 j=1 tj , where, for i = 2, . . . , s, ci = gcd {w1 , . . . , wi−1 } / gcd {w1 , . . . , wi }, and rij ∈ N are nonnegative integers P such that lcm(gcd {w1 , . . . , wi−1} , wi ) = ci wi = i−1 j=1 rij wj . In particular, in this situation, IL♭ is a complete intersection and, by Lemma 2.11, IT is also a complete intersection. It can be checked that (2.5) is satisfied for s = 2 or if w1 = 1 or 2. The case when wi = 1, for all i = 1, . . . , s, is worth highlighting, for these wi (2.4) is an equality. If s = 3 then (2.5) is also a necessary condition for IL♭ to be a complete intersection (cf. [15, Theorem 3.10]). This condition is no longer necessary when s = 4; it can be shown (cf. [9, Example 3.9]) that if w = (20, 30, 33, 44) then IL♭ is a complete intersection, despite the fact that no ordering of 20, 30, 22, 44 satisfies (2.5). A recursive method for deciding whether, for a given w, the ideal IL♭ is a complete intersection is given by Delorme in [6]. 3. Weighted projective Reed–Muller codes Definition 3.1. Let X ⊂ P(w1 , . . . , ws ) and set m = |X|. Fix x1 , . . . , xm ∈ K s systems of homogeneous coordinates for the points of X. Given d ≥ 0, let evd : K[t1 , . . . , ts ]d → K m be the map defined by f 7→ (f (x1 ), . . . , f (xm )) for all f ∈ K[t1 , . . . , ts ]d . The image of evd , denoted by CX (d), is called the weighted projective Reed–Muller code over X (or, if the context is clear, simply the code over X) of order d. ′ be a different choice of homogeneous coordinates of the points Remark 3.2. Let x′1 , . . . , xm ′ of X. Denote by evd the corresponding evaluation map. Then, there exist λ1 , . . . , λm ∈ K ∗ CODES OVER A WEIGHTED TORUS 7 such that ev′d (K[t1 , . . . , ts ]d ) is the image of evd (K[t1 , . . . , ts ]d ) by the linear map defined by (y1 , . . . , ym ) 7→ (λ1 y1 , . . . , λm ym ), for every (y1 , . . . , ym ) ∈ K m . I.e., the 2 codes are equivalent. Definition 3.3. The basic parameters of a linear code 0 6= C ⊂ K m are the length, the dimension and the minimum distance. The length is m, the dimension of the ambient vector space; the dimension is its dimension as a vector space and the minimum distance, that is denoted by δC , is given by min {kxk : x ∈ C \ 0} where kxk is the Hamming weight of x, i.e., the number of nonzero components of x. A code is said maximum distance separable if the singleton bound : δC ≤ length(C) − dimK C + 1, which is always satisfied for a linear code, is an equality. Remark 3.4. If C = CX (d) is a weighted projective Reed–Muller code over X ⊂ P(w1 , . . . , ws ) of order d, the length is equal to |X| (thus is independent of d) and the minimum distance can be computed as m minus the maximum number of zeros a homogeneous polynomial of degree d can attain on X without belonging to IX . Maximum distance separable codes are codes that, for their length and dimension, maximize minimum distance, in other words, have maximum error-correcting capability. In this work we shall focus on the codes over X = T(w1 , . . . , ws ). We abbreviate the notation for the codes to CT (d) and for their minimum distance to δT (d). Proposition 3.5. The length of CT (d) is (q − 1)s−1. Proof. The length of CT (d) coincides with the cardinality of the set of K-points of X. Since this set can be seen as the quotient (K ∗ )s /K ∗ by the induced action of K ∗ , all we need to check is that the orbits have cardinality q − 1. Assume that λ(x1 , . . . , xs ) = µ(x1 , . . . , xs ) for some λ, µ ∈ K ∗ . Then λwi xi = µwi xi ⇐⇒ (λ/µ)wi = 1, hence ord(λ/µ) divides wi , for all i. Since, by assumption, gcd {a1 , . . . , as } = 1 we deduce that λ = µ.  Let M be a finitely generated graded K[t1 , . . . , ts ]-module. The Hilbert function of M is the function ϕM : Z → Z defined by ϕM (d) = dimK Md . This function is quasi-polynomial of degree dim M − 1, i.e., there exist a positive integer g (the period) and P0 , . . . , Pg−1 , polynomials of same leading term and of degree dim M − 1, such that, for d ≫ 0, ϕM (d) = Pi (d), where d ≡ i (mod g) (cf. Serre’s Theorem [2, Theorem 4.4.3]). 8 EDUARDO DIAS AND JORGE NEVES Definition 3.6. The index of regularity of M is the least r ≥ 0 such that for d ≥ r, d≡i (mod g) =⇒ ϕM (d) = Pi (d). P d The Hilbert series of M is given by HM (t) = ∞ d=0 ϕM (d)t . HM (t) is a rational function (cf. [30, Proposition 4.1.3] or [2, Proposition 4.4.1]) and its degree is called the a-invariant of M. By Serre’s theorem the index of regularity of M is equal to deg HM (t) + 1. When M = K[t1 , . . . , ts ]/IT , we abbreviate the notation for its Hilbert function and Hilbert series to ϕT and HT (T ), respectively. We remark that dimK CT (d) = ϕT (d). Further, since IT is 1-dimensional, ϕT becomes constant, equal to m = (q − 1)s−1, the number of points of T(w1 , . . . , ws ), for d greater than or equal to the index of regularity of K[t1 , . . . , ts ]/IT . For such d, CX (d) is a trivial code. Remark 3.7. If one of the weights is equal to 1, say w1 = 1, then multiplication by t1 induces a monomorphism CT (d) ֒→ CX (d + 1). Moreover, one can also check that δT (d) ≥ δT (d + 1). In the standard case (i.e. when all wi = 1), for d up to the index of regularity minus 1, the inclusion is proper and the inequality is strict, implying that dimK CX (d) is strictly increasing and δCX (d) is strictly decreasing. Let G := N \ Q denote the set of gaps of the numerical semigoup Q and denote by gQ := max G the Frobenius number of Q. Theorem 3.8. The Hilbert series of K[t1 , . . . , ts ]/IT is given by  Qs P 1 wi (q−1) − a∈G ta(q−1) ) i=1 (1 − t 1−tq−1 Q · (3.1) HT (t) = s wi i=1 (1 − t ) Proof. Let M = K[t1 , . . . , ts ]/IL♭ . By Lemma 2.10, M ≃ K[Q], hence  Qs P 1 a wi − t P P a∈G i=1 (1 − t ) 1−t 1 a a Qs (3.2) HM = a∈Q t = 1−t − a∈G t = · wi i=1 (1 − t ) Notice that, since (1 − tw1 )/(1 − t) is a polynomial, the numerator of (3.2) is a polynomial. Let IL♭ = (ta1 − tb1 , . . . , tar − tbr ), for some ai , bi ∈ Ns . Then, by Lemma 2.11, IT = (t(q−1)a1 − t(q−1)b1 , . . . , t(q−1)ar − t(q−1)br ) and by [20, Lemma 3.7] we get (3.1). Corollary 3.9. The index of regularity of K[t1 , . . . , ts ]/IT is (q − 2)  Ps i=1  wi + gQ + gQ + 1. CODES OVER A WEIGHTED TORUS 9 Example 3.10. Suppose K = GF(4), X = T(3, 4, 5) and consider the corresponding family of codes CT (d). By Proposition 3.5 these are codes of length 9. Using [13], we can check that the ideal IT is minimally generated by the binomials t62 + t31 t33 , t91 + t32 t33 , t61 t32 + t63 and thus is not a complete intersection. From Theorem 3.8, HT (t) = 1 − t24 − t27 − t30 + t39 + t42 · (1 − t5 )(1 − t4 )(1 − t3 ) Hence the index of regularity of K[t1 , . . . , ts ]/IT is 42 − 12 + 1 = 31. This number can also be computed using Corollary 3.9. Table 1. Parameters of CT (d), with w = (3, 4, 5) and K = GF(4) d 0 1 2 3 4 5 6 7 8 9 10 11 12 13 dim 1 0 0 1 1 1 1 1 2 2 2 2 3 3 δ 9 – – 9 9 9 9 9 6 6 6 6 6 6 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3 4 4 4 5 5 6 6 6 7 7 8 8 7 9 9 8 6 3 3 4 3 3 3 3 3 2 2 2 2 2 1 1 2 Table 1 shows the dimension and minimum distance of CT (d), for d = 0, . . . , 30, computed using [13]. One feature to bear in mind is that, unlike standard projective Reed–Muller codes, dimK CT (d) is not strictly increasing and δT (d) is not strictly decreasing. Nevertheless, this family of codes is not necessarily redundant. For example, the two 4-dimensional codes with equal minimum distance (d = 15 and 16) are not equivalent. Indeed, these codes have generating matrices in standard form (I4 |A) and (I4 |B) where A, B ∈ M4×5 GF(4) are given by:     α+1 α+1 α+1 1 1 1 1 0 0 0 0 1 0 1  1 0   0  0 0 1  1 α α α + 1 α + 1  and  α α + 1 α + 1 1 1 . 0 1 0 1 0 1 α α α+1 α 4. Codes over T(w1 , w2 ) In this section we study the weighted projective Reed–Muller codes over a 1-dimensional torus T(w1 , w2). In this case IT is always a complete intersection (cf. Remark 2.12): (q−1)w2 (q−1)w1  IT = t1 − t2 . 10 EDUARDO DIAS AND JORGE NEVES By a classical result of Sylvester, the Frobenius number of Q = hw1 , w2 i is gQ = w1 w2 − w1 − w2 . According to Corollary 3.9, the index of regularity of K[t1 , . . . , ts ]/IT is (q −1)w1 w2 −w1 −w2 +1. Hence, we restrict to the range 1 ≤ d ≤ (q − 1)w1 w1 − w1 − w2 . We will show below in Corollary 4.5 that all weighted projective Reed–Muller codes over a 1-dimensional (weighted) torus are maximum distance separable codes. Given a semigroup Q ⊂ N, let us denote by χQ : N → {0, 1} the characteristic function of Q ⊂ N, i.e., the function given by χQ (d) = 1 if and only if d ∈ Q and χQ (d) = 0 otherwise. We use this function for the semigroup Q = hw1 , w2 i only; to ease notation we will write simply χ. Proposition 4.1. Let 0 ≤ d ≤ w1 w2 (q − 1) − w1 − w2 . Write d = kw1 w2 + l, where k ≥ 0 and 0 ≤ l < w1 w2 . Then, dimK CT (d) = k + χ(l). Proof. The Hilbert series of IT is HT (t) =   1 − t(q−1)w1 w2 w1 (q−1)w1 w2 −w1 w2 2w2 = 1 + t + · · · + t 1 + t + t + · · · . (1 − tw1 )(1 − tw2 ) Hence, the dimension of CT (d) coincides with the coefficient of the monomial in td on the right hand side of the above equation. Suppose that a, b ∈ N are such that d = aw1 + bw2 . Then aw1 ≤ aw1 + bw2 < (q − 1)w1 w2 implies that a ≤ (q − 1)w2 − 1. Hence the coefficient of td on the right hand side of the equation, is the number of pairs (a, b) ∈ N2 such that d = aw1 + bw2 , or, in the context of numerical semigroups, the number of factorizations of d in Q = hw1 , w2 i. Let us compute this number. Since gQ = w1 w2 − w1 − w2 , we see that l + (1 − χ(l))w1 w2 ∈ Q. Let a, b ∈ N be such that l + (1 − χ(l))w1 w2 = aw1 + bw2 . Then d = kw1 w2 + l = (a + iw2 )w1 + (b + (k − 1 + χ(l) − i)w1 )w2 for i = 0, . . . , k − 1 + χ(l), yields k + χ(l) distinct factorizations of d. Consider {ai w1 + bi w2 }ri=1 the set of all factorizations of d. We may assume ar > ar−1 > · · · > a1 ≥ 0. Since the difference ai − ai−1 must be divisible by w2 we get ar ≥ (r − 1)w2 . Therefore (4.1) d − (r − 1)w1 w2 = (ar − (r − 1)w2)w1 + br w2 ∈ Q = hw1 , w2 i . Additionally, (r − 1)w1 w2 ≤ ar w1 ≤ d = kw1 w2 + l ≤ kw1 w2 , hence r ≤ k + 1. Now, if r = k + 1, then, by (4.1), l ∈ Q. This shows that r ≤ k + χ(l).  Let us denote by α ∈ K ∗ a choice of generator of the cyclic group K ∗ . Given a homogeneous f ∈ K[t1 , . . . , ts ], we denote by V (f ) its set of zeros in P(w1 , . . . , ws ). r w1 2 Lemma 4.2. For each 0 ≤ r ≤ q − 2, V (tw 1 − α t2 ) ⊂ T(w1 , w2 ) consists of a single point. Moreover, as r varies in {0, . . . , q − 2}, every point of T(w1 , w2 ) is obtained in this way. CODES OVER A WEIGHTED TORUS 11 r w1 2 Proof. Fix a, b ∈ Z such that aw1 + bw2 = 1. Clearly (αrb , α−ra) ∈ V (tw 1 − α t2 ). Suppose w2 r w1 r w1 2 (x1 , x2 ) ∈ T(w1 , w2 ) belongs to V (tw 1 − α t2 ), i.e., x1 = α x2 . Then: bw2 −bw1 −b w1 −a −b w2 2 aw1 (x1 , x2 ) = (x1 (x−a , x−aw x2 ) = (αrb , α−ra). 1 1 x2 ) , x2 (x1 x2 ) ) = (x1 x2  rb −ra r w1 2 Hence V (tw ) . To show that every point in (x1 , x2 ) ∈ T(w1 , w2 ) is the 1 − α t2 ) = (α , α w1 r 2 zero of one such polynomial it suffices to notice that xw 1 /x2 = α , for some 0 ≤ r ≤ q − 2.  Proposition 4.3. Let f ∈ K[t1 , t2 ] be nonzero, homogeneous of degree d. Write d = kw1 w2 + l, where k ≥ 0 and 0 ≤ l < w1 w2 . Then |V (f ) ∩ T(w1 , w2 )| ≤ k − 1 + χ(l). Proof. We argue by induction on k. Suppose that k = 0. Then d < w1 w2 and, by an argument similar to the one used in the proof of Proposition 4.1, we deduce that there is only one factorization of d in Q, hence f is a monomial and thus |V (f ) ∩ T(w1 , w2 )| = 0. Additionally, if k = 0 then l = d ∈ Q and so χ(l) = 1 and the inequality of the statement holds. Suppose k ≥ 1. Let us write f = gta1 tb2 , for some g ∈ K[t1 , t2 ], such that neither t1 nor t2 divides g. Let d′ = d − aw1 − bw2 , be the degree of g. If d′ < w1 w2 then g = 1. In this situation V (f ) ∩ T(w1 , w2 ) is empty and there is nothing to show. Suppose d′ ≥ w1 w2 . Let us write d′ = k ′ w1 w2 + l′ for 1 ≤ k ′ ≤ k and 0 ≤ l′ < w1 w2 . If k ′ < k, by induction we get: (4.2) |V (f ) ∩ T(w1 , w2 )| = |V (g) ∩ T(w1 , w2 )| ≤ k ′ − 1 + χ(l′ ) ≤ k − 1 + χ(l). If k = k ′ then l = l′ + aw1 + bw2 and thus χ(l′ ) ≤ χ(l). We may assume there exists (x1 , x2 ) ∈ P V (f ) ∩ T(w1 , w2 ). Let us write g = ri=0 αi ta1i tb2i , with r ≥ 1 and, without loss in generality, 0 = a0 ≤ a1 ≤ · · · ≤ ar . Since w1 ai + w2 bi = d′ = w2 b0 , we deduce that there exist mi ≥ 0 such that ai = mi w2 and bi = b0 − mi w1 . Hence, we may write in Frac K[t1 , t2 ]:  w2 mi r X  t1 b0 b0 w2 w1 g = t2 αi w = t G t /t , 2 1 2 t2 1 i=0 P w1 2 where G(z) = ri=0 αi z mi ∈ K[z] has degree mr = ar /w2 . We see that xw 1 /x2 is a zero of G. w1 r 2 Let 0 ≤ r ≤ q − 2 be such that αr = xw 1 /x1 . Then G(z) = H(z)(z − α ), for some H ∈ K[z],   w1 w1 r 2 2 of degree ar /w2 − 1. Accordingly, g = tb20 H tw tw 1 /t2 1 /t2 − α . Since b0 − w1 ≥ w1 (ar /w2 − 1) ⇐⇒ b0 w2 ≥ w1 ar ⇐⇒ d′ ≥ w1 ar , clearing denominators, we conclude that there exists h ∈ K[t1 , t2 ], homogeneous, such that r w1 ′ ′ 2 g = (tw 1 − α t2 )h. Since the degree of h is (k − 1)w1 w2 + l , by induction and Lemma 4.2 |V (f ) ∩ T(w1 , w2 )| = |V (h) ∩ T(w1 , w2 )| + 1 ≤ (k ′ − 1) − 1 + χ(l′ ) + 1 ≤ k − 1 + χ(l).  12 EDUARDO DIAS AND JORGE NEVES We now address the computation of the minimum distance of the weighted projective Reed– Muller codes over a weighted torus. Recall that the minimum distance is defined for a nonzero code. For this, the assumption that d ∈ Q, equivalent to dimK CT (d) 6= 0, is necessary in the statement of the theorem. Theorem 4.4. If 0 ≤ d ≤ w1 w2 (q−1)−w1 −w2 and d ∈ Q. Write d = kw1 w2 +l with k ≥ 0 and 0 ≤ l < w1 w2 . Then the minimum distance of the evaluation code CT (d) is (q − 1) − k + 1 − χ(l). Proof. Let f ∈ K[t1 , t2 ] be a homogeneous polynomial of degree d. Then, by Proposition 4.3, f has at most k − 1 + χ(l) zeros on T (w1 , w2 ). Since, by Proposition 3.5, the length of CT (d) is q − 1 we get δT (d) ≥ (q − 1) − k + 1 − χ(l). To prove the reverse inequality, we split the proof into 2 cases. If χ(l) = 1, let a, b ∈ N be such that l = aw1 + bw2 . Then, the polynomial Q i w1 2 f = ta1 tb2 ki=1 (tw 1 − α t2 ) has degree d and, since d ≤ w1 w2 (q − 1) − w1 − w2 implies that 0 ≤ k ≤ q − 2, by Lemma 4.2, has exactly k = k − 1 + χ(l) zeros on T(w1 , w2 ). If χ(l) = 0 then, since d = kw1 w2 + l ∈ Q we must have k > 0. Additionally, since d − w1 w2 (k − 1) ≥ w1 w2 > gQ , there exist a, b ∈ N such Qk−1 w2 1 (t1 − αi tw that aw1 + bw2 = d − w1 w2 (k − 1). Then the polynomial f = ta1 tb2 i=1 2 ) has degree d and has exactly k − 1 = k − 1 + χ(l) zeros on T(w1 , w2 ).  Corollary 4.5. The weighted projective Reed–Muller codes CT (d) over a (weighted) torus are maximum distance separable codes, i.e., for d ∈ Q, δT (d) = (q − 1) − dim CT (d) + 1. References [1] E. Ballico, C. Fontanari, The Horace method for error-correcting codes, Appl. Algebra Engrg. Comm. Comput. 17 (2006), no. 2, 135–139. [2] W. Bruns and J. Herzog, Cohen-Macaulay rings. Cambridge Studies in Advanced Mathematics, 39. Cambridge University Press, Cambridge, 1993. [3] C. Carvalho, On the second Hamming weight of some Reed-Muller type codes, Finite Fields Appl. 24 (2013), 88–94. [4] A. Couvreur, The dual minimum distance of arbitrary-dimensional algebraic-geometric codes, J. Algebra 350 (2012), 84–107. [5] A. Couvreur and I. Duursma Evaluation codes from smooth quadric surfaces and twisted Segre varieties, Des. Codes Cryptogr. 66 (2013), no. 1-3, 291–303. [6] C. Delorme, Sous-monoı̈des d’intersection complète de N. Ann. Sci. École Norm. Sup. (4) 9 (1976), no. 1, 145–154. [7] I. Dursma, C. Rentera and H. Tapia-Recillas, Reed-Muller codes on complete intersections. Appl. Algebra Engrg. Comm. Comput. 11 (2001), no. 6, 455–462. [8] D. Eisenbud and B. Sturmfels, Binomial ideals, Duke Math. J. 84 (1996), no. 1, 1–45. CODES OVER A WEIGHTED TORUS 13 [9] K. G. Fischer and J. Shapiro, Mixed matrices and binomial ideals. J. Pure Appl. Algebra 113 (1996), no. 1, 39–54. [10] L. Gold, J. Little, H. Schenck, Cayley-Bacharach and evaluation codes on complete intersections. J. Pure Appl. Algebra 196 (2005), no. 1, 91–99. [11] M. González-Sarabia, C. Renterı́a and H. Tapia-Recillas, Reed-Muller-type codes over the Segre variety, Finite Fields Appl. 8 (2002), no. 4, 511–518. [12] C. Renterı́a and H. Tapia-Recillas, ReedMuller type codes on the Veronese variety over finite fields, in Coding Theory, Cryptography and Related Areas (J. Buchmann, T. Hoholdt, H. Stichtenoth, and H. Tapia-Recillas, Eds.), pp. 237–243, Springer-Verlag, Berlin, 2000, [13] D. R. Grayson and M. E. Stillman, Macaulay2, a software system for research in algebraic geometry, Available at http://www.math.uiuc.edu/Macaulay2/. [14] J. P. Hansen, Linkage and codes on complete intersections Appl. Algebra Engrg. Comm. Comput. 14 (2003), no. 3, 175–185. [15] J. Herzog, Generators and relations of abelian semigroups and semigroup rings Manuscripta Math. 3 (1970), 17–193. [16] G. Lachaud, Projective Reed-Muller codes, Coding theory and applications (Cachan, 1986), 125–129, Lecture Notes in Comput. Sci., 311, Springer, Berlin, 1988. [17] G. Lachaud, The parameters of projective Reed-Muller codes, Discrete Math. 81 (1990), no. 2, 217–221. [18] H. H. López, C. Renteria-Márquez, R. H. Villarreal, Affine cartesian codes, Des. Codes Cryptogr., (2012) DOI 10.1007/s10623-012-9714-2 [19] E. Miller and B. Sturmfels, Combinatorial Commutative Algebra, Graduate Texts in Mathematics 227, Springer-Verlag, New York, 2005. [20] J. Neves, M. Vaz Pinto and R. H. Villarreal Regularity and algebraic properties of certain lattice ideals, arXiv:1301.4249, Preprint 2013 [21] J. Neves, M. Vaz Pinto and R. H. Villarreal Vanishing ideals over graphs and even cycles, Comm. Algebra (in press). [22] L. O’Carroll, F. Planas-Vilanova and R. H. Villarreal, Degree and algebraic properties of lattice and matrix ideals, arXiv:1303.5382, Preprint 2013 [23] C. Renterı́a, A. Simis and R. H. Villarreal, Algebraic methods for parameterized codes and invariants of vanishing ideals over finite fields, Finite Fields Appl. 17 (2011), no. 1, 81–104. [24] C. Renterı́a, H. Tapia-Recillas, Reed-Muller codes: an ideal theory approach Comm. Algebra 25 (1997), no. 2, 401–413. [25] E. Reyes, R. H. Villarreal, L. Zárate, A note on affine toric varieties, Linear Algebra Appl. 318 (2000), no. 1-3, 173–179. [26] E. Sarmiento, M. Vaz Pinto and R. H. Villarreal, The minimum distance of parameterized codes on projective tori, Appl. Algebra Engrg. Comm. Comput. 22 (2011), no. 4, 249–264. [27] E. Sarmiento, M. Vaz Pinto and R. H. Villarreal, On the vanishing ideal of an algebraic toric set and its parametrized linear codes. J. Algebra Appl. 11 (2012), no. 4, 1250072, 16 pp. [28] I. Soprunov, Toric complete intersection codes J. Symbolic Comput. 50 (2013), 374–385. [29] A. B. Sørensen, Projective Reed-Muller codes, IEEE Trans. Inform. Theory 37 (1991), no. 6, 1567–1576. 14 EDUARDO DIAS AND JORGE NEVES [30] R. H. Villarreal, Monomial Algebras, Monographs and Textbooks in Pure and Applied Mathematics 238, Marcel Dekker, New York, 2001. Mathematics Institute, Zeeman Building, University of Warwick, Coventry CV4 7AL, U.K. E-mail address: [email protected] CMUC, Department of Mathematics, University of Coimbra 3001-454 Coimbra, Portugal. E-mail address: [email protected]
0math.AC
arXiv:1203.6796v3 [math.AC] 22 Oct 2013 REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO Abstract. Reflexive functors of modules naturally appear in Algebraic Geometry, mainly in the theory of linear representations of group schemes, and in “duality theories”. In this paper we study and determine reflexive functors of modules and we give many properties of reflexive functors of modules, of algebras and of bialgebras. 1. Introduction Let X = Spec A be an affine scheme over a field K. We can regard X as a covariant functor of sets over the category of commutative K-algebras through its functor of points X · , defined by X · (S) := HomK−alg (A, S), for all commutative K-algebras S. If X = Spec K[x1 , . . . , xn ]/(p1 , . . . , pm ) then X · (S) := {s ∈ S n : p1 (s) = · · · = pm (s) = 0} By the Yoneda Lemma, HomK−sch (X, Y ) = Homf unct. (X · , Y · ), and it is well known that X is an affine group K-scheme if and only if X · is a functor of groups. We can regard K as functor of rings K, by defining K(S) := S, for all commutative K-algebras S. Let V be a K-vector space. We can regard V as a covariant functor of K-modules, V, by defining V(S) := V ⊗K S. We will say that V is the K-quasi-coherent module associated with V . If V = ⊕I K then V(S) = ⊕I S. It holds that the category of K-vector spaces, CK-vect , is equivalent to the category of quasi-coherent K-modules, Cqs-coh K-mod : the functors CK-vect Cqs-coh K-mod , V V and Cqs-coh K-mod CK-vect , V V(K) give the equivalence. It is well known that the theory of linear representations of a group scheme G = Spec A can be developed, via their associated functors, as a theory of an abstract group and its linear representations. That is, the category of linear representations of a group scheme G is equivalent to the category of quasi-coherent G· -modules. Given a functor of K-modules, M (that is, a covariant functor from the category of commutative K-algebras to the category of abelian groups, with a structure of K-module), we denote M∗ := HomK (M, K). We say that M is a reflexive functor of modules if M = M∗∗ . Reflexive functors of modules naturally appear in Algebraic Geometry, mainly in the theory of linear representations of group schemes, and in “duality theories”: Quasi-coherent modules are reflexive (surprisingly even when K is a commutative ring and V is a non finitely generated K-module, see [2]). Let X be a functor of sets and AX := Homf unct. (X, K). We say that X is an affine functor if AX is reflexive and X = Spec AX := HomK−alg (AX , K), see [8] for details (we warn the reader that Date: April 12, 2012. Corresponding Author: Pedro Sancho. 1 2 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO in the literature affine functors are sometimes defined to be functors of points of affine schemes). In [8], we prove that (functors of points of) affine schemes, formal schemes and the completion of an affine scheme along a closed set are affine functors. Let G be an affine functor of monoids. A∗G is a functor of algebras and the category of G-modules is equivalent to the category of A∗G -modules. Applications of these results include Cartier duality, neutral Tannakian duality for affine group schemes and the equivalence between formal groups and Lie algebras in characteristic zero (see [8]). In order to prove these results it is necessary to study and to determine reflexive functors of modules, algebras and bialgebras. Some natural questions emerge: Is the family of reflexive functors a monster family? Is this family closed under tensor products? Is this family closed under homomorphisms? In this paper we prove: (1) Each reflexive Q functor of K-modules is a functor of K-submodules of a funtor of K-modules I K, for a certain set I (see 4.2). (2) A functor of K-modules is reflexive if and only if it is the inverse limit of its quasi-coherent quotients (see 4.4). (3) If I is a totally ordered set and {fij : Vi → Vj }i≥j∈I is an inverse system of quasi-coherent K-modules, then lim Vi is a reflexive functor of K-modules. ← i∈I We do not know if arbitrary inverse limits of quasi-coherent modules are reflexive, that is, if proquasi-coherent modules are reflexive. (4) If M and M′ are reflexive functors of K-modules, then HomK (M, M′ ) ⊆ HomK (M(K), M′ (K)) (see 3.15). If A is a reflexive functor and a functor of K-algebras and M, M′ are reflexive functors of A-modules, then a morphism of K-modules M → M′ is a morphism of A-modules if and only if M(K) → M′ (K) is a morphism of A(K)-modules. Let V be a vector space. If V is an A-module, then the set of all quasi-coherent A-submodules of V is equal to the set of all A(K)-submodules of V (see 3.17 and 4.13). Now assume K = R is a commutative ring. In section 5, we define a wide family F of reflexive functors of R-modules satisfying: Q (1) Each M ∈ F is a functor of R-submodules of a funtor of R-modules I R, for a certain set I. (2) If M and N are free R-modules, then M, M∗ , HomR (M, N ) ∈ F. (3) Every functor of R-modules M ∈ F is proquasi-coherent. (4) If M, M′ ∈ F, then HomR (M, M′ ) ∈ F and (M ⊗R M′ )∗∗ ∈ F, which satisfies HomR ((M ⊗R M′ )∗∗ , M′′ ) = HomR (M ⊗R M′ , M′′ ) for every reflexive functor of R-modules, M′′ . (5) If A, B ∈ F are functors of proquasi-coherent algebras, then (A∗ ⊗R B∗ )∗ ∈ F and it is a functor of proquasi-coherent algebras, which satisfies HomR−alg ((A∗ ⊗R B∗ )∗ , C) = HomR−alg (A ⊗R B, C) for every functor of proquasi-coherent algebras, C. (6) The functor CF−bialg CF−bialg , B B∗ is a categorical anti-equivalence, where CF−bialg is the category of functors of proquasi-coherent bialgebras (that is, B ∈ CF−bialg if B ∈ F, B and B∗ are functors of proquasi-coherent REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 3 algebras and the dual morphisms of the multiplication morphism and unit morphism of B∗ are morphisms of functors of algebras). Let A be a free R-module, then A ∈ F. A is an R-bialgebra if and only if A is a functor of proquasi-coherent bialgebras (see Proposition 6.3). In the literature, there have been many attempts to obtain a well-behaved duality for non finite dimensional bialgebras (see [9] and references therein). One of them, for example, states that the functor that associates with each bialgebra A over a field K the so-called dual bialgebra A◦ is auto-adjoint (A◦ := lim (A/I)∗ , where J is the set of bilateral ideals I ⊂ A such that → I∈J dimK A/I < ∞, see [1]). Another one associates with each bialgebra A over a pseudocompact ring R the bialgebra A∗ endowed with a certain topology (see [4, Exposé VIIB 2.2.1]). (7) If M, M′ ∈ F, then HomR (M, M′ ) ⊆ HomR (M(R), M′ (R)). If A ∈ F is a functor of R-algebras and M, M′ ∈ F are functors of A-modules, then a morphism of R-modules M → M′ is a morphism of A-modules if and only if M(R) → M′ (R) is a morphism of A(R)-modules. Let M be an R-module. If M is an A-module, then the set of all quasi-coherent A-submodules of M is equal to the set of all A(R)-submodules of M . This paper completes [2] and it is essentially self contained. 2. Preliminaries Let R be a commutative ring (associative with a unit). All functors considered in this paper are covariant functors over the category of commutative R-algebras (always assumed to be associative with a unit). A functor X is said to be a functor of sets (resp. monoids, etc.) if X is a functor from the category of commutative R-algebras to the category of sets (resp. monoids, etc.). Notation 2.1. For simplicity, given a functor of sets X, we sometimes use x ∈ X to denote x ∈ X(S). Given x ∈ X(S) and a morphism of commutative R-algebras S → S ′ , we still denote by x its image by the morphism X(S) → X(S ′ ). Let R be the functor of rings defined by R(S) := S, for all commutative Ralgebras S. A functor of sets M is said to be a functor of R-modules if we have morphisms of functors of sets, M × M → M and R × M → M, so that M(S) is an S-module, for every commutative R-algebra S. A functor of rings (associative with a unit), A, is said to be a functor of R-algebras if we have a morphism of functors of rings R → A (and R(S) = S commutes with all the elements of A(S), for every commutative R-algebra S). Given a commutative R-algebra S, we denote by M|S the functor M restricted to the category of commutative S-algebras. Let M and M′ be functors of R-modules. A morphism of functors of R-modules f : M → M′ is a morphism of functors such that the defined morphisms fS : M(S) → M′ (S) are morphisms of S-modules, for all commutative R-algebras S. We will denote by HomR (M, M′ ) the set (see footnote) of all morphisms of R-modules from M to M′ . QN QN Example 2.2. HomR ( R, R) = ⊕N R: Let w : R → R be an R-linear morphism. Let us consider the polynomial ring S := R[x1 , . . . , xn , . . .]. Since 4 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO wS ((x1 , . . . , xn , . . .)) ∈ S, for some m ∈ N, wS ((x1 , . . . , xn , . . .)) ∈ R[x1 , . . . , xm ]. Let φ(x1 , . . . , xm ) := wS ((x1 , . . . , xn , . . .)). Let S ′ be a commutative R-algebra and s′1 , . . . , s′n , . . . ∈ S ′ . Let us consider the morphism of R-algebras S → S ′ , xi 7→ s′i (for all i). By functoriality, wS ′ ((s′1 , . . . , s′n , · · · )) = φ(s′1 , . . . , s′m ). Hence, w is determined by φ(x1 , . . . , xm ). Finally, φ(x1 , . . . , xm ) = λ1 x1 + · · · + λm xm , for certain λ1 , . . . , λm ∈ R, because φ(x · x1 , . . . , x · xm ) = x · φ(x1 , . . . , xm ) ∈ R[x, x1 , . . . , xm ] =: T since wT is T -linear. We will denote by HomR (M, M′ )1 the functor of R-modules HomR (M, M′ )(S) := HomS (M|S , M′|S ) Obviously, (HomR (M, M′ ))|S = HomS (M|S , M′|S ) Notation 2.3. We denote M∗ = HomR (M, R). QN ∗ Example 2.4. (⊕N R)∗∗ = ( R) = ⊕N R. 2.2 Notation 2.5. Tensor products, direct limits, inverse limits, etc., of functors of R-modules and kernels, cokernels, images, etc., of morphisms of functors of Rmodules are regarded in the category of functors of R-modules. It holds that (M ⊗R M′ )(S) = M(S) ⊗S M′ (S), (Ker f )(S) = Ker fS , (Coker f )(S) = Coker fS , (Im f )(S) = Im fS , ( lim Mi )(S) = lim (Mi (S)), ( lim Mi )(S) = lim (Mi (S)) → i∈I → i∈I ← i∈I ← i∈I Definition 2.6. Given an R-module M (resp. N , etc.), M (resp. N , etc.) will denote the functor of R-modules defined by M(S) := M ⊗R S (resp. N (S) := N ⊗R S, etc.). M will be called quasi-coherent R-module (associated with M ). Proposition 2.7. [2, 1.3] For every functor of R-modules M and every R-module M , it holds that HomR (M, M) = HomR (M, M(R)) Proof. Given an R-linear morphism f : M → M, we have for every R-algebra S a morphism of S-modules fS : M ⊗R S → M(S) and a commutative diagram M ⊗R S ↑ M fS −→ M(S) ↑ fR −→ M(R) Hence, the morphism of S-modules fS is determined by fR .  1In this paper, we will only consider well defined functors Hom (M, M′ ), that is to say, functors R such that HomS (M|S , M′ |S ) is a set, for all S. REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 5 The functors M M, M M(R) = M establish an equivalence between the category of R-modules and the category of quasi-coherent R-modules ([2, 1.12]). In particular, HomR (M, M′ ) = HomR (M, M ′ ). For any pair of R-modules M and N , the quasi-coherent module associated with M ⊗R N is M ⊗R N . M|S is the quasi-coherent S-module associated with M ⊗R S Definition 2.8. The functor M∗ = HomR (M, R) is called an R-module scheme. M∗ (S) = HomS (M ⊗R S, S) = HomR (M, S) and it is easy to check that (M∗ )|S is an S-module scheme. Definition 2.9. Given a commutative R-algebra A, let (Spec A)· be the functor defined by (Spec A)· (S) := HomR−alg (A, S), for each commutative R-algebra S. This functor will be called the functor of points of Spec A. By Yoneda’s lemma (see [7, Appendix A5.3]), Homfunc ((Spec A)· , X) = X(A). · Given an R-module M , we will denote by SR M the symmetric algebra of M . Let us recall the next well-known lemma (see [5, II, §1, 2.1] or [4, Exposé VIIB , 1.2.4]). · Lemma 2.10. [2, 1.6] If M is an R-module, then M∗ = (Spec SR M )· as functors of R-modules. Proof. For every commutative R-algebra S, it holds that · · M∗ (S) = HomR (M, S) = HomR−alg (SR M, S) = (Spec SR M )· (S)  Proposition 2.11. [2, 1.8] Let M , M ′ be R-modules. Then HomR (M∗ , M′ ) = M ⊗R M′ Proof. Note first that 2.10 · · · Homfunc (M∗ , M′ ) = Homfunc ((Spec SR M )· , M′ ) = M′ (SR M ) = SR M ⊗R M ′ . n Specifically, f = m1 · · · mn ⊗ m′ ∈ SR M ⊗ M ′ defines the morphism of functors ∗ ′ f : M → M , f (w) := w(m1 ) · · · w(mn ) · m′ , for all w ∈ M∗ . · ′ In order for f ∈ SR M ⊗R M morphism of functors, it must P to define a R-linear n ′ M ⊗R M ′ . Let S be a commutative be f ∈ M ⊗R M : Write f = n fn ∈ ⊕n∈N SR R-algebra and let w ∈ M∗ (S). Let S ′ = S[x] and consider the natural injective morphism M ′ ⊗R S ֒→ M ′ ⊗R S ′ as an inclusion of sets. Then, X X x· (fn )S (w) = x · fS (w) = x · fS ′ (w) = fS ′ (x · w) = (fn )S ′ (x · w) n = X n n x · (fn )S ′ (w) = X n x · (fn )S (w) ∈ M ′ ⊗R S ′ n n Hence (fn )S (w) = 0, for all n 6= 1, and then f ∈ M ⊗ M ′ . We have proved that HomR (M∗ , M′ ) = M ⊗R M ′ . For every R-algebra S, HomR (M∗ , M′ )(S) = HomS (M∗ |S , M′ |S ) = HomS ((M ⊗R S)∗ , M′ ⊗R S) = (M ⊗R S) ⊗S (M ′ ⊗R S) = (M ⊗R M′ )(S)  6 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO If M′ = R, in the previous proposition, we obtain the following theorem. Theorem 2.12. [2, 1.10] Let M be an R-module. Then M∗∗ = M The functors M M∗ and M∗ M∗∗ = M establish an anti-equivalence between the categories of quasi-coherent modules and module schemes. An Rmodule scheme M∗ is a quasi-coherent R-module if and only if M is a projective finitely generated R-module (see [3]). Let us recall the Formula of adjoint functors. Notation 2.13. Let i : R → S be a commutative R-algebra. Given a functor of R-modules, M, let i∗ M be the functor of S-modules defined by (i∗ M)(S ′ ) := M(S ′ ). Given a functor of S-modules, M′ , let i∗ M′ be the functor of R-modules defined by (i∗ M′ )(R′ ) := M(S ⊗R R′ ). Formula of adjoint functors 2.14. [2, 1.12] Let M be a functor of R-modules and let M′ be a functor of S-modules. Then, it holds that HomS (i∗ M, M′ ) = HomR (M, i∗ M′ ) Proof. Given a w ∈ HomS (i∗ M, M′ ), we have morphisms wS⊗R′ : M(S ⊗ R′ ) → M′ (S⊗R′ ) for each commutative R-algebra R′ . By composition with the morphisms M(R′ ) → M(S⊗R′ ), we have the morphisms φR′ : M(R′ ) → M′ (S⊗R′ ) = i∗ M′ (R′ ), which in their turn define φ ∈ HomR (M, i∗ M′ ). Given a φ ∈ HomR (M, i∗ M′ ), we have morphisms φS ′ : M(S ′ ) → i∗ M′ (S ′ ) = ′ M (S ⊗S ′ ) for each S-algebra S ′ . By composition with the morphisms M′ (S ⊗S ′ ) → M′ (S ′ ), we have the morphisms wS ′ : M(S ′ ) → M′ (S ′ ), which in their turn define w ∈ HomS (i∗ M, M′ ). Now we shall show that the assignments w 7→ φ and φ 7→ w are mutually inverse. Given w ∈ HomS (i∗ M, M′ ) we have φ ∈ HomR (M, i∗ M′ ). Let us prove that the latter defines w again. We have the following diagram, where S ′ is a commutative S-algebra and q, p the obvious morphisms, q / M(S ⊗ S ′ ) M(S ′ ) ▲▲▲▲▲ ▲▲▲▲▲ ▲▲▲▲ ▲▲  M(S ′ ) wS⊗S ′ / M′ (S ⊗ S ′ ) p wS ′  / M′ (S ′ ) The composite morphism p ◦ wS⊗S ′ ◦ q = p ◦ φS ′ is that assigned to φ, and coincides with wS ′ since the whole diagram is commutative. Given φ ∈ HomR (M, i∗ M′ ) we have w ∈ HomS (i∗ M, M′ ). Let us see that the latter defines φ. We have the following diagram, where R′ is a commutative Ralgebra and r, j, p the obvious morphisms, M(R′ ) r φS⊗R′ φR ′  (i∗ M′ )(R′ ) / M(S ⊗ R′ ) j  / (i∗ M′ )(S ⊗ R′ ) wS⊗R′ / M′ (S ⊗ R′ ) O p M′ (S ⊗ S ⊗ R′ ) The composite morphism wS⊗R′ ◦r assigned to w agrees with φR′ , since p◦j = Id and the whole diagram is commutative. REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 7  Corollary 2.15. Let M be a functor of R-modules. Then M∗ (S) = HomR (M, S) for all commutative R-algebras S. 2.14 Proof. M∗ (S) = HomS (M|S , S) = HomR (M, S).  Definition 2.16. Let M be a functor of R-modules. We will say that M∗ is a dual functor. We will say that a functor of R-modules M is reflexive if M = M∗∗ . Examples 2.17. Quasi-coherent modules and module schemes are reflexive functors of R-modules. Proposition 2.18. Let M be a functor of R-modules such that M∗ is a reflexive functor. The closure of dual functors of R-modules of M is M∗∗ , that is, it holds the functorial equality HomR (M, M′ ) = HomR (M∗∗ , M′ ) for every dual functor of R-modules M′ . Proof. Write M′ = N∗ . Then, HomR (M, M′ ) = HomR (M⊗N, R) = HomR (N, M∗ ) = HomR (N ⊗ M∗∗ , R) = HomR (M∗∗ , M′ ).  Proposition 2.19. Let A be a functor of R-algebras such that A∗ is a reflexive functor of R-modules. The closure of dual functors of R-algebras of A is A∗∗ , that is, it holds the functorial equality HomR−alg (A, B) = HomR−alg (A∗∗ , B) for every dual functor of R-algebras B. As a consequence, the category of dual functors of A-modules is equal to the category of dual functors of A∗∗ -modules. Proof. Given a dual functor of R-modules M∗ , by induction on n HomR (A ⊗ . n. . ⊗ A, M∗ ) = HomR (A ⊗ n−1 . . . ⊗ A, HomR (A, M∗ )) 2.18 = HomR (A ⊗ n−1 . . . ⊗ A, HomR (A∗∗ , M∗ )) Ind.Hyp. = HomR (A∗∗ ⊗ n−1 . . . ⊗ A∗∗ , HomR (A∗∗ , M∗ )) = HomR (A∗∗ ⊗ . . . ⊗ A∗∗ , M∗ ). Let i : A → A∗∗ be the natural morphism. The multiplication morphism m : A ⊗ A → A defines a unique morphism m′ : A∗∗ ⊗ A∗∗ → A∗∗ such that the diagram A⊗A i⊗i / A∗∗ ⊗ A∗∗ m′ m  A i  / A∗∗ is commutative, because HomR (A ⊗ A, A∗∗ ) = HomR (A∗∗ ⊗ A∗∗ , A∗∗ ). It follows easily that the algebra structure of A defines an algebra structure on A∗∗ . Let us 8 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO only check that m′ satisfies the associative property: The morphisms m′ ◦ (m′ ⊗ Id), m′ ◦ (Id ⊗ m′ ) : A∗∗ ⊗ A∗∗ ⊗ A∗∗ → A∗∗ are equal because (m′ ◦ (m′ ⊗ Id)) ◦ (i ⊗ i ⊗ i) = m′ ◦ (i ⊗ i) ◦ (m ⊗ Id) = i ◦ m ◦ (m ⊗ Id) = i ◦ m ◦ (Id ⊗ m) = m′ ◦ (i ⊗ i) ◦ (Id ⊗ m) = (m′ ◦ (Id ⊗ m′ )) ◦ (i ⊗ i ⊗ i) The kernel of the morphism HomR (A, B) → HomR (A ⊗R A, B), f 7→ f ◦ m − m ◦ (f ⊗ f ), coincides with the kernel of the morphism HomR (A∗∗ , B) → HomR (A∗∗ ⊗R A∗∗ , B), f 7→ f ◦ m′ − m ◦ (f ⊗ f ). Then, HomR−alg (A, B) = HomR−alg (A∗∗ , B). Finally, given a dual functor of R-modules M∗ , then EndR M∗ = (M∗ ⊗ M)∗ is a dual functor of R-algebras and HomR−alg (A, EndR M∗ ) = HomR−alg (A∗∗ , EndR M∗ ) Given two A∗∗ -modules, N and M∗ , and a morphism f : N → M∗ of A-modules, then f is a morphism of A∗∗ -modules because given n ∈ N, the morphism A∗∗ → M∗ , a 7→ f (an) − af (n) is zero because A → M∗ , a 7→ f (an) − af (n) is zero. Then, the category of dual functors of A-modules is equal to the category of dual functors of A∗∗ -modules.  Example 2.20. Let G = Spec A be an R-group scheme and let R[G· ] be the functor defined by R[G· ](S) = {formal sums s1 g1 + · · · + sn gn , n ∈ N, si ∈ S and gi ∈ G· (S)}. It is easy to prove that R[G· ]∗ = A and R[G· ]∗∗ = A∗ (see [3]). Then, the category of (rational) G-modules is equivalent to the category of quasi-coherent R[G· ]-modules, which is equivalent to the category of quasi-coherent A∗ -modules. 3. D-proquasi-coherent modules Notation 3.1. Let us denote M(R) the quasi-coherent module associated with the R-module M(R), that is, M(R)(S) := M(R) ⊗R S. There exists a natural morphism M(R) → M, m ⊗ s 7→ s · m. Observe that HomR (N , M) = HomR (N, M(R)) = HomR (N , M(R)) for all quasi-coherent modules N . Definition 3.2. We will say that a functor of R-modules M is a D-proquasicoherent module if the natural morphism M∗ → M(R)∗ is injective. Example 3.3. Quasi-coherent modules are D-proquasi-coherent modules, because M(R) = M. Example 3.4. If M = ⊕I R is a Q free R-module, then M∗ is D-proquasi-coherent: via M∗ (R). Dually, the The obvious morphism ⊕I R → I R = M∗ , factors Q ∗∗ ∗ ∗ composite morphism M = M → M (R) → I R is injective, then M∗∗ → M∗ (R)∗ is injective. Note 3.5. The direct limit of a direct system of functors of D-proquasi-coherent modules is D-proquasi-coherent. Every quotient of a D-proquasi-coherent module is D-proquasi-coherent. REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 9 Theorem 3.6. A functor of R-modules M D-proquasi-coherent if and only if for every R-module N the map HomR (M, N ) → HomR (M(R), N ), f 7→ fR is injective. Proof. If the natural morphism M∗ → M(R)∗ is injective, then HomR (M, S) ⊆ HomR (M(R), S) for all commutative R-algebras S. Given an R-module N , consider the R-algebra S := R ⊕ N , with the multiplication operation (r, n) · (r′ , n′ ) := (rr′ , rn′ + r′ n). Then, HomR (M, R ⊕ N ) = HomR (M, S) ⊆ HomR (M(R), S) = HomR (M(R), R ⊕ N ) Hence, HomR (M, N ) ⊆ HomR (M(R), N ) Reciprocally, M∗ (S) = HomR (M, S) ֒→ HomR (M(R), S) = M(R)∗ (S) is injective for all commutative R-algebras S, hence the morphism M∗ ֒→ M(R)∗ is injective.  Corollary 3.7. Let R = K be a field. A functor of K-modules M is D-proquasicoherent if and only if the natural morphism M∗ (K) → M(K)∗ := HomK (M(K), K), w 7→ wK is injective. Proof. We only have to prove the sufficiency. Let N = ⊕I K be a K-vector space. The diagram HomK (M,  _ N)  I Q HomK (M, K) / HomK (M(K), N ) _ I Q I  Q HomK (M, K) / HomK (M(K), K)  HomK (M(K), I Q K) is commutative. Then, the morphism HomK (M, N ) → HomK (M(K), N ) is injective and M is D-proquasi-coherent.  Proposition 3.8. If M is a D-proquasi-coherent R-module and S is a commutative R-algebra, then the functor of S-modules M|S is a D-proquasi-coherent S-module. Proof. Let S be a commutative R-algebra and let N be an S-module. The diagram HomS (M|S , N ) 2.14 HomR (M,  _ N) 3.6  HomS (M(S), N )  / HomR (M(R), N ) is commutative, then the morphism HomS (M|S , N ) → HomS (M(S), N ) is injective and M|S is D-proquasi-coherent.  Lemma 3.9. A functor of R-modules M is D-proquasi-coherent if and only if the cokernel of every R-module morphism from M to a quasi-coherent module is quasicoherent, that is, the cokernel of any morphism f : M → N is the quasi-coherent module associated with Coker fR . 10 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO Proof. ⇒) Let f : M → N be a morphism of R-modules. Let N ′ = Coker fR and let π : N → N ′ be the natural epimorphism. As (π ◦ f )R = 0, π ◦ f = 0 by Theorem 3.6. Then, Coker f = N ′ . ⇐) Let f : M → N be a morphism of R-modules. If fR = 0 then Coker f = N and f = 0. Therefore, M is D-proquasi-coherent, by Theorem 3.6.  Note 3.10. If R = K is a field, the kernel of every morphism between quasicoherent modules is quasi-coherent. Then, M is D-proquasi-coherent if and only if the image of every morphism f : M → N for every quasi-coherent module N , which is the kernel of the morphism N → Coker f , is a quasi-coherent module. Theorem 3.11. Let R = K be a field and let M be a D-proquasi-coherent functor of K-modules. Let {Mi }i∈I be the set of all quasi-coherent quotients of M. Then, M∗ = lim M∗i → i∈I Proof. Let S be a commutative K-algebra. M∗ (S) = HomK (M, S), by Corollary 2.15. The morphism lim M∗i (S) → HomK (M, S) = M∗ (S) is obviously injective, → i∈I and it is surjective by Note 3.10. Hence, M∗ = lim M∗i . → i∈I  Corollary 3.12. Let R = K be a field. If M is D-proquasi-coherent, then M∗ is D-proquasi-coherent. Proof. It is a consequence of Theorem 3.11, Example 3.4 and Note 3.5.  Definition 3.13. A functor of modules M is said to be (linearly) separated if for each commutative R-algebra S and m ∈ M(S) there exist a commutative S-algebra T and a w ∈ M∗ (T ) such that w(m) 6= 0 (that is, the natural morphism M → M∗∗ , m 7→ m̃, where m̃(w) := w(m) for all w ∈ M∗ , is injective). Every functor of submodules of a separated functor of modules is separated. Example 3.14. If M is a dual functor of modules, then it is separated: Given 0 6= w ∈ M = N∗ , there exists an n ∈ N such that w(n) 6= 0. Let ñ ∈ M∗ be defined by ñ(w′ ) := w′ (n), for all w′ ∈ M. Then ñ(w) 6= 0. Theorem 3.15. Let M be a functor of R-modules. M is D-proquasi-coherent if and only if the morphism HomR (M, M′ ) → HomR (M(R), M′ (R)), ′ f 7→ fR ′∗ is injective, for all separated R-modules, M (such that M tors). are well defined func- Proof. By Theorem 3.6, we only have to prove the necessity. The morphism HomR (M, M′ ) → HomR (M′∗ , M∗ ), f 7→ f ∗ is injective: If f 6= 0 there exists ∗ an m ∈ M such that f (m) 6= 0. Then, there exists a w′ ∈ M′ such that ′ ∗ ′ ∗ ′ ∗ 0 6= w (f (m)) = f (w )(m). Therefore, f (w ) 6= 0 and f 6= 0. REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 11 From the diagram HomR (M, M′ )    HomR (M(R), M′ (R)) / HomR (M′∗ , M∗ )   3.2 / HomR (M′∗ , M(R)∗ ) ❥❥5 ❥❥❥❥ ❥ ❥ ❥ ❥❥ ❥❥❥❥ ′ HomR (M(R), M ) one deduces that the morphism HomR (M, M′ ) → HomR (M(R), M′ (R)) is injective.  Corollary 3.16. Let R = K be a field and let M, M′ be D-proquasi-coherent modules, then M ⊗K M′ is D-proquasi-coherent. Proof. It is due to the inclusion (M⊗K M′ )∗ (K) = HomK (M⊗M′ , K) = HomK (M, M′ ∗ ) 3.15 ∗ ֒→ HomK (M(K), M′ (K)) ֒→ HomK (M(K), M′ (K)∗ ) = HomK (M(K)⊗M′ (K), K) = (M ⊗K M′ )(K)∗ .  Proposition 3.17. Let A be a functor of K-algebras and a D-proquasi-coherent module, let M and N be functors of A-modules and let M ′ ⊂ M be a K-vector subspace. Then, (1) M′ is a quasi-coherent A-submodule of M if and only if M ′ is an A(K)submodule of M . (2) A morphism f : M → N of functors of K-modules is a morphism of Amodules if and only if fK : M → N is a morphism of A(K)-modules. Proof. (1) Obviously, if M′ is an A-submodule of M then M ′ is an A(K)-submodule of M . Inversely, let us assume M ′ is an A(K)-submodule of M and let us consider the natural morphism of multiplication A ⊗K M′ → M. The morphisms A → M, a 7→ a · m′ , for each m′ ∈ M ′ , factors via M′ , then A ⊗K M′ → M factors via M′ . Therefore, M′ is a functor of A-submodules of M. (2) The morphism f is a morphism of A-modules if and only if F : A ⊗ M → N , F (a ⊗ m) := f (am) − af (m) is the zero morphism. Likewise, fK is a morphism of A(K)-modules if and only if FK : A(K) ⊗ M → N , FK (a ⊗ m) = fK (am) − afK (m) is the zero morphism. Now, the proposition is a consequence of the inclusions, HomK (A ⊗ M, N ) = HomK (A, HomK (M, N )) ⊆ HomK (A(K), HomK (M, N )) 3.15 ⊆ HomK (A(K), HomK (M, N )) = HomK (A(K) ⊗ M, N )  Definition 3.18. Let A be an R-algebra. The associated functor A is obviously a functor of R-algebras. We will say that A is a quasi-coherent R-algebra. Proposition 3.19. Let A be a functor of K-algebras and a D-proquasi-coherent module, and let B be a K-algebra. Every morphism of K-algebras φ : A → B uniquely factors through an epimorphism of functors of algebras onto the quasicoherent algebra associated with Im φK . Proof. By Note 3.10, the morphism φ : A → B uniquely factors through an epimorphism φ′ : A → B ′ , where B ′ := Im φK . Obviously B ′ is a K-subalgebra of B and φ′ is a morphism of functors of algebras.  12 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO 4. Proquasi-coherent modules Definition 4.1. A functor of R-modules is said to be a proquasi-coherent module if it is an inverse limit of quasi-coherent modules. In this section, R = K will be a field. Proposition 4.2. Let R = K be a field and let M be a K-module such that M∗ is well defined. M is separated if and only if the morphism M → M̄ := (M∗ (K))∗ is injective. Therefore, M is separated if and only if it is a K-submodule of a K-module scheme. Proof. Assume M is separated. Let m ∈ M(S) be such that m = 0 in M̄(S). M̄(S) = M∗ (K)∗ (S)=HomK (M∗ (K), S), then m(w) := w(m) = 0 for all w ∈ M∗ (K). Given a commutative S-algebra T , if one writes T = ⊕i∈I K · ei , one notices that Y 2.15 M∗ (T ) = HomK (M, T ) = HomK (M, ⊕I K) ⊂ HomK (M, K) Q ∗ I ∗ which assigns to every P wT ∈ M (T ) a (wi ) ∈ M (K). Explicitly, given m′ ∈ ′ ′ M(T ), then wT (m ) = i wi (m ) · ei . Therefore, wT (m) = 0 for all wT ∈ M∗ (T ). As M is separated, this means that m = 0, i.e., the morphism M → M̄ is injective. Now, assume M → M̄ is injective. Observe that M̄ is separated because is reflexive. Then M is separated. Finally, the second statement of the proposition is obvious.  Proposition 4.3. If M is a proquasi-coherent K-module then it is a dual K-module and it is a direct limit of K-shemes of modules. In particular, proquasi-coherent modules are D-proquasi-coherent modules. Proof. M = lim Mi = ( lim M∗i )∗ . As lim M∗i is D-proquasi-coherent, its dual, ← → → which is M, is a direct limit of K-module schemes, by Theorem 3.11.  Theorem 4.4. Let R = K be a field. M is a reflexive functor of K-modules if and only if M is equal to the inverse limit of its quasi-coherent quotients. In particular, reflexive functors of K-modules are proquasi-coherent. Proof. Suppose that M is reflexive. M∗ is separated, because it is a dual functor of modules. By Proposition 4.2, the morphism M∗ → M(K)∗ is injective. Then, M is D-proquasi-coherent. Let {Mi }i∈I be the set of all quasi-coherent quotients of M. Then, M∗ = lim M∗i , by Theorem 3.11. Therefore, M = M∗∗ = lim Mi . → i∈I ← i∈I Suppose now that M is equal to the inverse limit of its quasi-coherent quotients. By Proposition 4.3, M is D-proquasi-coherent. By Theorem 3.11, M = M∗∗ .  Let R = Z and M = Z/2Z. Then, M := M∗ is reflexive but it is not D-proquasicoherent, because M(R)∗ = 0, since M(R) = 0. Proposition 4.5. Let f : P → M be a morphism of functors of K-modules. If P is proquasi-coherent and M is separated then Ker f is proquasi-coherent. REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 13 Proof. Let V be a K-vector space such Q that there exists an injective morphism M ֒→ V ∗ . We can assume M = V ∗Q= I K.QGiven I ′ ⊂ I, let fI ′ be the composition of f with the obvious projection I K → I ′ K. Then Ker f = lim ← I ′ ⊂I, #I ′ <∞ Ker fI ′ It is sufficient to prove that Ker fI ′ is proquasi-coherent, since the inverse limit of proquasi-coherent modules is proquasi-coherent. As #I ′ < ∞ it is sufficient to prove that the kernel of every morphism f : P → K is proquasi-coherent. If f : P → K is the zero morphism the proposition is obvious. Assume f 6= 0. Then, f is surjective. Let us write P = lim Vi and let v = (vi ) ∈ lim Vi = P(K) ← i ← i be a vector such that fK ((vi )) 6= 0. Then P = Ker f ⊕ K · v. Let V̄i := Vi /hvi i. Let us prove that Ker f = lim V̄i : Let i′ be such that vi′ 6= 0. Consider the exact ← i sequences 0 → K · vi → Vi → V̄i → 0, Dually, we have the exact sequences (i > i′ ) 0 → V̄i∗ → Vi∗ → K → 0 Taking the direct limit we have the split exact sequence 0 → lim (V̄i∗ ) → lim (Vi∗ ) → K → 0 → i → i Dually, we have the exact sequence 0 → K · v → P → lim V̄i → 0 ← i Then, Ker f → lim V̄i , (vi )i 7→ (v̄i )i is an isomorphism. ← i  Corollary 4.6. Every direct summand of a proquasi-coherent module is proquasicoherent. Theorem 4.7. Let M be a functor of K-modules. M is proquasi-coherent if and only if M is a dual functor of K-modules and it is D-proquasi-coherent. Proof. By Proposition 4.3, we only have to prove the sufficiency. Let us write M = N∗ . The dual morphism of the natural morphism N → N∗∗ is a retraction of the natural morphism M → M∗∗ . Then, M∗∗ = M ⊕ M′ . M is proquasi-coherent, because M∗∗ is proquasi-coherent, by Theorem 3.11.  Corollary 4.8. A functor of K-modules is proquasi-coherent if and only if it is the dual functor of K-modules of a D-proquasi-coherent module. Proof. If M = lim Mi is proquasi-coherent, then M = ( lim M∗i )∗ . lim M∗i is D← i proquasi-coherent and M = ( lim M∗i )∗ . → i ′ → i → i If M is D-proquasi-coherent, then M′∗ is D-proquasi-coherent, by Corollary 3.12. By Theorem 4.7, M′∗ is proquasi-coherent.  14 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO Proposition 4.9. Let M be an R-module. Then, Y HomR ( R, M) = ⊕I HomR (R, M) = ⊕I M I Q 2.11 Proof. HomR ( I R, M) = HomR ((⊕I R)∗ , M) = (⊕I R) ⊗ M = ⊕I M.  Proposition 4.10. Let I be a totally ordered set and {fij : Mi → Mj }i≥j∈I an inverse system of K-modules. Then, lim Mi is reflexive. ← i Proof. lim Mi is a direct limit of submodule schemes Vj∗ , by 3.11 and 4.8. If all ← i the vector spaces Vj are finite dimensional then lim Mi is quasi-coherent, then it ← i is reflexive. In other case, there exists an injective morphism f : r Q Let πj : lim Mi → Mj be the natural morphisms. Let gr : K ֒→ ← i N K ֒→ lim Mi . Q K be defined N ← i by gr (λ1 , · · · , λr ) := (λ1 , · · · , λr , 0, · · · , 0, · · · ). Let i1 ∈ I be such that πi1 ◦ f ◦ g1 ◦ gn is injective. If there is injective. Recursively, let in > in−1 be such that πin ◦ fQ exists a j > in for all n, the composite Q morphism ⊕N K ⊂ N K → Mj is injective, and by Proposition 4.9 the morphism N K → Mj factors through the projection onto a Kr , which is contradictory. In conclusion, lim Mi = lim Min . Let Hn := M′ir ← i be the image of lim Min in Mir . Then, Ker[Mi′n → Mi′n−1 ]. ← n Then, lim Min ≃ ← n reflexive. Q n ← n∈N lim M′in ← n = lim Min . Let ← n Hn . By Lemma 5.1, lim Min is ← n  Note 4.11. We do not know if every proquasi-coherent functor of K-modules is reflexive. Proposition 4.12. If P, P′ are proquasi-coherent K-modules, then HomK (P, P′ ) is proquasi-coherent. In particular, P∗ and (P ⊗ P′ )∗ are proquasi-coherent. Proof. Let us write P = lim Vi∗ and P′ = lim Vj′ . Then, → i ← j HomK (P, P′ ) = HomK ( lim Vi∗ , lim Vj′ ) = lim HomK (Vi∗ , Vj′ ) = lim (Vi ⊗ Vj′ ) → i ← j ← i,j ← i,j Hence, Hom(P, P′ ) is proquasi-coherent.  Proposition 4.13. Let A be a functor of K-algebras and a D-proquasi-coherent module, and let P, P′ be proquasi-coherent K-modules and A-modules. Then, a morphism of K-modules, f : P → P′ , is a morphism of A-modules if and only if fK : P(K) → P′ (K) is a morphism of A(K)-modules. Proof. Proceed as in the proof of Proposition 3.17 (2).  REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 15 5. A family F of reflexive functors of R-modules Q Consider j∈J R as a functor of R-algebras ((λj )j · (µj )j := (λj · µj )j ). If Q {Mj }j∈J is a set of R-modules, then ⊕j∈J Mj and j∈J Mj are naturally functors Q of j∈J R-modules. Q Lemma 5.1. Let M be a dual functor of R-modules and a functor of j∈J Rmodules. If there exist a set of reflexive functors of R-modules, {Mj }j∈J , and Q inclusions of j∈J R-modules Y ⊕j∈J Mj ⊆ M ⊆ Mj (where ⊕j∈J Mj ⊆ Q j∈J j∈J Mj is the obvious inclusion) then, (1) M is a reflexive functor of R-modules. (2) For every R-module N we have ⊕j∈J HomR (Mj , N ) ⊆ HomR (M, N ) ⊆ Y HomR (Mj , N ) j∈J Proof. Given wQ∈ HomR (M, N ), let wj := w|Mj , for all j ∈ J. Given m = (mj )j ∈ M ⊂ j Mj , then wj (mj ) = 0 for all j ∈ J, except for a finite subset Q P I ⊂ J, and w(m) = i∈I wi (mi ): Let W : j R → N be defined by W ((λj )j ) := w((λj mj )j ). By Proposition 4.9, there exists a finite subset I ⊂ J such that W ((λj )j ) = W ((λi )i∈I ). Hence, P wj (mj ) = w(mj ) = 0 for all j ∈ J\I, and w(m) = w((mj )j ) = w((mi )i∈I ) = i∈I wi (mi ). Q Then, ⊕j∈J HomR (Mj , N ) ⊆ HomR (M, N ) ⊆ j∈J HomR (Mj , N ). In particular, we have Y M∗j ⊕j M∗j ⊆ M∗ ⊆ ∗ M is a Q j j R-module and again ⊕j Mj ⊆ M∗∗ ⊆ Y Mj j Q Q We have ⊕j Mj ⊆ M ⊆ M∗∗ ⊆ j Mj , and again (M∗∗ )∗ ⊆ M∗ ⊆ j M∗j . The natural morphism (M∗∗ )∗ → M∗ is an epimorphism, because the natural morphism M∗ → (M∗ )∗∗ is a section. Therefore, M∗ = M∗∗∗ . The inclusion M ⊆ M∗∗ has a retraction, because M = M′∗ is a dual functor ∗∗ and the natural morphism M′∗ → (M′∗ )∗∗ has a retraction. Then, MQ = M ⊕ M′′ . ∗ ∗∗∗ ′′ ∗ ′′ ′′ Dually, M = M , so M = 0. Hence, M = 0, because M ⊂ j Mj and for Q any 0 6= (mj ) ∈ j Mj there exist a j ∈ J and a wj ∈ M∗j such that wj (mj ) 6= 0 (recall that the functor of modules Mj are reflexive). Therefore, M = M∗∗ .  Definition 5.2. Let F be the family of dual functors of R-modules,QM, such that there exist a set J (which depends on Q M), a structure of functor of J R-modules on M and inclusions of functors of J R-modules Y ⊕J R ⊆ M ⊆ R (where ⊕j∈J Mj ⊆ Q j∈J J Mj is the obvious inclusion). 16 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO Note 5.3. Every M ∈ F is reflexive, by Lemma 5.1. ∗ Examples 5.4. Q If V is a free R-module, V, V ∈ F. If we have a set {Mi ∈ F}i∈I , then ⊕i∈I Mi , i∈I Mi ∈ F, as it is easy to check. Let V = ⊕I R and W = ⊕J R be freeQR-modules, then HomR (V, W) ∈ F: we have the of functors of I×J R-modules, ⊕I×J R ⊆ HomR (V, W) = Q obvious inclusions Q I (⊕J R) ⊆ I×J R. This example has motivated Definition 5.2. Note 5.5. A quasi-coherent Q module M ∈ F if and only if M is a free R-module: Let us write ⊕J R ⊆ M ⊆ J R. Let N = M/ ⊕J R and let π : M → N be the quotient morphism. By Lemma 5.1, the morphism HomR (M, N ) → HomR (⊕J R, N ) is injective. As π 7→ 0, then π = 0 and M = ⊕J R. Let F′ be the family of functors of R-modules, M, such that M is a direct summand of some functor of R-modules of F. Obviously, M ∈ F′ if M is a projective R-module. All other results obtained in this section for F remain valid for F′ . Proposition 5.6. If M′ is a reflexive functor of R-modules and M ∈ F, then HomR (M′ , M) is reflexive. ′ ∗ ∗ Proof. HomR (M′ , M) Q = (M ⊗M ) is a dual functor. Following previous notations, since ⊕J R ⊆ M ⊆ J R, we have the inclusions Y Y (1) ⊕J M′∗ ⊆ HomR (M′ , ⊕J R) ⊆ HomR (M′ , M) ⊆ HomR (M′ , R) = M′∗ J ′ Therefore, by Lemma 5.1, HomR (M , M) is reflexive. J  Proposition 5.7. If M′ is a reflexive functor of R-modules and M ∈ F, then HomR (M, M′ ) is reflexive. Proof. HomR (M, M′ ) = (M ⊗ M′∗ )∗ is a dual functor. Let 0 6= f ∈ HomR (M, M′ ). There exists w ∈ M′∗ such that w ◦ f 6= 0. Let us follow previous notations. By ′ Lemma 5.1, (w ◦ f )|⊕J R 6= 0, then f|⊕J R 6= 0. Therefore, Q HomR′ (⊕J R, M ) ⊇ ′ ′ HomR (M, M ) and, likewise, HomR (⊕J R, M ) ⊇ HomR ( J R, M ). Hence, we have the inclusions Y Y M′ = HomR (⊕J R, M′ ) ⊇ HomR (M, M′ ) ⊇ HomR ( R, M′ ) ⊇ ⊕J M′ J J Therefore, by Lemma 5.1, HomR (M, M′ ) is reflexive.  Theorem 5.8. If M′ , M ∈ F, then HomR (M′ , M) ∈ F. Q Q Proof. Let us write ⊕I R ⊆ M′ ⊆ I R and ⊕J R ⊆ M ⊆ J R. By Lemma 5.1, Q ⊕I R ⊆ M′∗ ⊆ I R, then by Equation 1, Y Y (2) ⊕I×J R ⊆ ⊕J M′∗ ⊆ HomR (M′ , M) ⊆ M′∗ ⊆ R J I×J Observe that Y Y Y Y Y 2.11 ( R⊗ R)∗ = HomR ( R⊗ R, R) = HomR ( R, ⊕J R) = (⊕I R)⊗(⊕J R) I J I J I Q Q ′ ∗ ∗ HomR (M′Q , M) = (M then by Proposition Q Q ⊗ M∗∗) is a I R ⊗ J∗R-module, 2.19, it is a ( I R ⊗R J R) = (⊕I R ⊗R ⊕J R) = I×J R-module. Finally, by Equation 2, HomR (M′ , M) ∈ F.  REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 17 Theorem 5.9. If M, M′ ∈ F, then (M′ ⊗ M)∗∗ ∈ F and it is the closure of dual functors of R-modules of M′ ⊗ M. Proof. As M∗ ∈ F, we have (M′ ⊗ M)∗ = HomR (M′ , M∗ ) ∈ F. Hence, firstly (M′ ⊗ M)∗ is reflexive and by Proposition 2.18 the closure of dual functors of M′ ⊗ M is (M′ ⊗ M)∗∗ , secondly (M′ ⊗ M)∗∗ ∈ F.  Proposition 5.10. Let R = K be a field. Let I be a totally ordered set and {fij : Mi → Mj }i≥j∈I be an inverse system of morphisms of K-modules. Then, lim Mi ∈ F. ← i∈I Proof. lim Mi is a direct product of K-quasi-coherent modules, by the proof of ← i∈I Proposition 4.10. Hence, lim Mi ∈ F.  ← i∈I Proposition 5.11. If M ∈ F, then M is D-proquasi-coherent. Proof. We have to prove that the morphism HomR (M, N ) ⊆ HomR (M(R), N ), w 7→ wR is injective, for all R-modules N . Let us follow previous notations. By Lemma 5.1, w ∈ HomR (M, N ) is determined by w|⊕J R , and this one is determined by (w|⊕J R )R . As ⊕J R ⊆ M(R), w is determined by wR .  Lemma 5.12. Let M ∈ F and let N be an R-module. Then, every morphism of R-modules φ : M → N uniquely factors through an epimorphism onto the quasicoherent module associated with the R-submodule of N , Im φR ⊆ N . Q Proof. Let us follows previous notations. Consider ⊕J R ⊆ M ⊆ J R. By Lemma Q 5.1, M∗ ⊆ (⊕J R)∗ = J R. The morphism φ|⊕J R : ⊕J R → N factors via the quasi-coherent module associated with N ′ := Im(φ|⊕J R )R . Then, the dual morQ phism φ∗ : N ∗ → M∗ ⊆ J R, factors via, N ′ ∗ . Hence, φ factors via a morphism φ′ : M → N ′ . In particular, φ′ is an epimorphism and N ′ = Im φR . Uniqueness: Assume φ factors through an epimorphism φ′′ : M → N ′ . The morphisms φ′ , φ′′ are determined by φ′ R , φ′′ R . Then, φ′ = φ′′ , because φ′ R = φ′′ R .  Theorem 5.13. Let M ∈ F. Let {Mi }i∈I be the set of all quasi-coherent quotients of M. Then, M∗ = lim M∗i . Therefore, → i∈I M = lim Mi . ← i∈I Proof. Proceed as in the proof of Theorem 3.11.  Proposition 5.14. Let A ∈ F be a functor of R-algebras and let M, M′ ∈ F be functors of A-modules. Then, a morphism of R-modules, f : M → M′ , is a morphism of A-modules if and only if fR : M(R) → M′ (R) is a morphism of A(R)modules. Proof. Proceed as in Proposition 4.13.  18 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO Notation 5.15. Let M be an R-module and let M ′ ⊆ M be an R-submodule. By abuse of notation we will say that M′ is a quasi-coherent submodule of M. Proposition 5.16. Let A ∈ F be a functor of R-algebras, let M be an A-module and let M ′ ⊂ M be an R-submodule. Then, M′ is a quasi-coherent A-submodule of M if and only if M ′ is an A(R)-submodule of M . Proof. Obviously, if M′ is an A-submodule of M then M ′ is an A(R)-submodule of M . Inversely, let us assume M ′ is an A(R)-submodule of M and let us consider the natural morphism of multiplication A ⊗R M′ → M. By Lemma 5.12, the morphisms A → M, a 7→ a · m′ , for each m′ ∈ M ′ , uniquely factors via M′ . Let q p ⊕I R → ⊕J R → M ′ → 0 be an exact sequence. Let i be the morphism M′ → M. There exists a (unique) morphism f ′ such that the diagram A ⊗R (⊕I R) Id⊗q / A ⊗R (⊕J R) Id⊗p / A ⊗ R M′ /0 f′  M′  /M i ′ is commutative. Since i ◦ f ◦ (Id ⊗ q) = 0, then f ′ ◦ (Id ⊗ q) = 0. Hence, A ⊗R M′ → M factors through M′ . F : A ⊗R A → M′ , F (a ⊗ a′ ) := a(a′ m′ ) − (aa′ )m′ (for any m′ ∈ M′ ) is the zero morphism: F lifts to a (unique) morphism F̄ : (A ⊗R A)∗∗ → M′ . Observe that i ◦ F̄ = 0 because i ◦ F = 0, then F̄R = 0 because iR is injective. Finally, F̄ = 0 because it is determined by F̄R ; and F = 0. Likewise, 1 · m′ = m′ , for all m′ ∈ M′ . In conclusion, M′ is a quasi-coherent A-submodule of M.  Proposition 5.17. Let A ∈ F and B be functors of R-algebras and assume that there exists an injective morphism of R modules B ֒→ N . Then, any morphism of R-algebras φ : A → B uniquely factors through an epimorphism of algebras onto the quasi-coherent algebra associated with Im φR , that is to say, (Im φ)(R). Proof. By Lemma 5.12, the morphism φ : A → B uniquely factors through an epimorphism φ′ : A → B ′ , where B ′ := Im φR . Obviously B ′ is an R-subalgebra of B(R). We have to check that φ′ is a morphism of functors of algebras. Observe that if a morphism f : A ⊗ A → N factors through an epimorphism onto a quasi-coherent submodule N ′ of N then uniquely factors through N ′ , because f and any morphism on N ′ uniquely factors through (A ⊗ A)∗∗ ∈ F. Consider the diagram A⊗A mA φ′ ⊗φ′ / B′ ⊗ B′ mB ′ i⊗i / B⊗B mB     φ′ i / B′ / B / N, A where mA , mB′ and mB are the multiplication morphisms and i is the morphism induced by the morphism B ′ → B(R). We know mB ◦ (i ⊗ i) ◦ (φ′ ⊗ φ′ ) = i ◦ φ′ ◦ mA . The morphism mB ◦ (i ⊗ i) ◦ (φ′ ⊗ φ′ ) uniquely factors onto B ′ , more concretely, through mB′ ◦(φ′ ⊗φ′ ). The morphism i◦φ′ ◦mA uniquely factors onto B ′ , effectively, through φ′ ◦mA . Then, mB′ ◦(φ′ ⊗φ′ ) = φ′ ◦mA and φ′ is a morphism of R-algebras.  REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 19 Definition 5.18. We will say that a functor of R-algebras is a functor of proquasicoherent algebras if it is the inverse limit of its quasi-coherent algebra quotients. Examples 5.19. Quasi-coherent algebras are proquasi-coherent. Let R = K be a field, A be a commutative K-algebra and I ⊆ A be an ideal. Then, B = lim A/I n ∈ F (by 5.10) and it is a proquasi-coherent algebra: B ≃ Q n ← n∈N n I /I n+1 . Then, B∗ = ⊕n (I n /I n+1 )∗ = lim (A/I n )∗ . Therefore, B∗ is equal → n to the direct limit of the dual of the quasi-coherent algebra quotients of B. Dually, B is a proquasi-coherent algebra. Proposition 5.20. Let C ∗ ∈ F be a functor of R-algebras (i.e., a scheme of Ralgebras). Then, C ∗ is a functor of proquasi-coherent algebras. Proof. 1. If M∗ ∈ F and f : M∗ → N is a morphism of functors of R-modules, then N ′ := Im fR is a finitely generated R-module: By Lemma 5.12, f factors via ′ an epimorphism f ′ : M∗ → N ′ . HomR (M∗ , N ′ ) = M ⊗ N ′ , then P f = m1 ⊗ n 1 + ′ · · · + mr ⊗ nr , for some mi ∈ M and ni ∈ N . Hence, f (w) = i w(mi ) · ni , for all w ∈ M∗ . Therefore, N ′ = hn1 , . . . , nr i. 2. C ∗ is a left and right C ∗ -module, then C is a right and left C ∗ -module. Given c ∈ C, the dual morphism of the morphism C ∗ → C, w 7→ w · c is the morphism C ∗ → C, w 7→ c · w. 3. C is the direct limit of its finitely generated R-submodules. Let N = hn1 , . . . , nr i ⊂ C be P a finitely generated R-module and let f : C ∗r → N be de′ fined by f ((wi )) := i wi · ni . Then, N := Im fR is a finitely generated R′ module. By Proposition 5.16, N is a quasi-coherent C ∗ -submodule of C. Write N ′ = hn1 , . . . , ns i. The morphism EndR (N ′ ) → ⊕s N ′ , g 7→ (g(ni ))i is injective. By Proposition 5.17, the morphism of functors of R-algebras C ∗ → EndR (N ′ ) w 7→ w· factors through an epimorphism onto a quasi-coherent algebra, B ′ . The dual morphism of the composite morphism πi /C / EndR (N ′ )   / ⊕s N ′ / ⊕s C / / B′ C∗ / w · ni w ∗ ∗ is C ∗ → B ′ ֒→ C, w 7→ ni · w. Hence, ni ∈ B ′ , for all i, and N ′ ⊆ B ′∗ . Therefore, C is equal to the direct limit of the dual functors of the quasi-coherent algebra quotients of C ∗ . Dually, C ∗ is a functor of proquasi-coherent algebras.  Lemma 5.21. Let M1 , . . . , Mn ∈ F and let us consider the natural morphism M1 ⊗ · · · ⊗ Mn → (M∗1 ⊗ · · · ⊗ M∗n )∗ . Then, the induced morphism (M1 ⊗ · · · ⊗ Mn )∗∗ → (M∗1 ⊗ · · · ⊗ M∗n )∗ is injective. Q Proof. Let us follow the notations ⊕Ji R ⊆ Mi ⊆ Ji R. By Lemma 5.1, ⊕Ji R ⊆ Q M∗i ⊆ Ji R. By induction hypothesis, ⊕J1 ×···×Jn−1 R ⊆ (M1 ⊗ · · · ⊗ Mn−1 )∗ ⊆ Q J1 ×···×Jn−1 R. Since (M1 ⊗· · ·⊗Mn )∗ = HomR (M1 ⊗· · ·⊗Mn−1 , M∗n ) = HomR ((M1 ⊗· · ·⊗Mn−1 )∗∗ , M∗n ), 20 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO Q by Equation 2, ⊕J1 ×···×Jn R ⊆ (M1 ⊗ · · · ⊗ Mn )∗ ⊆ J1 ×···×Jn R. Hence, firstly Q ∗ ∗ ∗ ∗∗ (M Q 1 ⊗ · · · ⊗ Mn ) ⊆ J1 ×···×Jn R, by Lemma 5.1, secondly (M1 ⊗ · · · ⊗ Mn ) ⊆ J1 ×···×Jn R. As a consequence, the natural morphism (M1 ⊗ · · · ⊗ Mn )∗∗ → (M∗1 ⊗ · · · ⊗ M∗n )∗ is injective.  Theorem 5.22. Let A, B ∈ F be two functors of proquasi-coherent algebras. Then, (A∗ ⊗ B∗ )∗ ∈ F is a functor of proquasi-coherent algebras and it holds HomR−alg (A ⊗ B, C) = HomR−alg ((A∗ ⊗ B∗ )∗ , C) for every functor of proquasi-coherent algebras C. Proof. Write A = lim Ai and B = lim Bj . Observe that ← i ← j 2.18 (A∗ ⊗ B∗ )∗ = HomR (A∗ , B) = HomR ( lim A∗i , B) = HomR ( lim A∗i , lim Bj ) → i → i ← j = lim HomR (A∗i , Bj ) = lim (Ai ⊗ Bj ) ← i,j ← i,j Then, (A∗ ⊗ B∗ )∗ is a functor of algebras and the natural morphism A ⊗ B → (A∗ ⊗ B∗ )∗ is a morphism of functors of algebras. Given a morphism of functor of R-algebras φ : A ⊗ B → C, let φ1 = φ|A⊗1 and φ2 = φ|1⊗B . Then, φ1 factors through an epimorphism onto a quasi-coherent algebra quotient Ai of A, and φ2 factors through an epimorphism onto a quasicoherent algebra quotient Bj of B. Then, φ factors through Ai ⊗ Bj , and φ factors through (A∗ ⊗ B∗ )∗ . Then, HomR−alg ((A∗ ⊗ B∗ )∗ , C) → HomR−alg (A ⊗ B, C) is surjective. It is also injective, because HomR ((A∗ ⊗ B∗ )∗ , C) = HomR (C ∗ , (A∗ ⊗ B∗ )∗∗ ) 5.21 ⊆ HomR (C ∗ , (A ⊗ B)∗ ) = HomR (A ⊗ B, C) Then, HomR−alg (A ⊗ B, C) = HomR−alg ((A∗ ⊗ B∗ )∗ , C) for every proquasicoherent algebra C. A morphism of functors of algebras f : (A∗ ⊗ B∗ )∗ → C factors through some Ai ⊗ Bj because f|A⊗B factors through some Ai ⊗ Bj . Then, the inverse limit of the quasi-coherent algebra quotients of (A∗ ⊗B∗ )∗ is equal to lim (Ai ⊗Bj ) = (A∗ ⊗B∗ )∗ , ← i,j ∗ ∗ ∗ that is, (A ⊗ B ) is a proquasi-coherent algebra.  Notation 5.23. Let A1 , . . . , An ∈ F be functors of proquasi-coherent R-algebras. ˜ · · · ⊗A ˜ n := (A∗1 ⊗ · · · ⊗ A∗n )∗ , which is the closure of functors of We denote A1 ⊗ proquasi-coherent algebras of A1 ⊗ · · · ⊗ An . ˜ 2⊗ ˜ · · · ⊗A ˜ n ) = A1 ⊗ ˜ · · · ⊗A ˜ n. Observe that A1 ⊗(A REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 21 6. Functors of bialgebras Definition 6.1. A functor B ∈ F is said to be a functor of proquasi-coherent bialgebras when B and B∗ are functors of proquasi-coherent R-algebras such that the dual morphisms of the multiplication morphism m : B∗ ⊗ B∗ → B∗ and the unit morphism u : R → B∗ are morphisms of functors of R-algebras. Let B, B′ be two functors of proquasi-coherent bialgebras. We will say that a morphism of R-modules, f : B → B′ is a morphism of functors of bialgebras if f ∗ and f ∗ : B′ → B∗ are morphisms of functors of R-algebras. Note 6.2. Let B ∈ F be a functor of proquasi-coherent algebras. Defining a multiplication morphism B∗ ⊗ B∗ → B∗ (associative and with a unit) is equivalent to ˜ (coassociative and with a counit), defining a comultiplication morphism B → B⊗B because n n n ˜ · · ·⊗B) ˜ HomR (B∗ ⊗ · · · ⊗ B∗ , B∗ ) = HomR (B, (B∗ ⊗ · · · ⊗ B∗ )∗ ) = HomR (B, B⊗ In the literature, an R-algebra A is said to be a bialgebra if it is a coalgebra (with counit) and the comultiplication c : A → A ⊗R A and the counit e : A → R are morphisms of R-algebras. We will say that a bialgebra A is a free R-bialgebra if A is a free R-module. We will say that a functor of proquasi-coherent bialgebras B ∈ F is a functor of quasi-coherent bialgebras if B is a quasi-coherent R-module. Observe that if A∗ ∈ F is a functor of R-algebras then it is a proquasi-coherent algebra, by Proposition 5.20. Proposition 6.3. The functors A A and A A(R) establish an equivalence between the category of free R-bialgebras and the category of functors of R-quasicoherent bialgebras. Theorem 6.4. Let CF−Bialg. be the category of functors B ∈ F of proquasi-coherent bialgebras. The functor CF−Bialg. CF−Bialg. , B B∗ is a categorical antiequivalence. Proof. Let {B, m, u; B∗ , m′ , u′ } be a functor of bialgebras. Let us only check that ˜ ∗ is a morphism of functors of algebras. By hypothesis, m∗ : B∗ → (B ⊗ B)∗ = B∗ ⊗B ∗ ˜ is a morphism of functors of algebras. We have the m′ : B → (B∗ ⊗ B∗ )∗ = B⊗B commutative square: BO m′ ∗ / B⊗B ˜ O m⊗m m B⊗B ∗ ∗ ′∗ m′∗ 13 ⊗m 24 ∗ / B⊗B ˜ ⊗B ˜ ⊗B ˜ ∗ where (m′ 13 ⊗ m′ 24 )(b1 ⊗ b2 ) := σ(m′ (b1 ) ⊗ m′ (b2 )) and σ(b1 ⊗ b2 ⊗ b3 ⊗ b4 ) := b1 ⊗ b3 ⊗ b2 ⊗ b4 , for all bi ∈ B. Taking duals, we obtain the commutative diagram: 22 JOSÉ NAVARRO, CARLOS SANCHO, AND PEDRO SANCHO ′ ❵ ❵ ❴m ❴ ❴ ❫ ❫ ❪ ❪ ❪ ❭ ❭ ❬ ❬ ❝ ❝ ❜ ❜ ❛ ❛ ❛ ❬ ❩ ❩ ❝ ❞ ❞ ❡ (B∗ ⊗ B∗ )∗∗ o❴ ❴ ❴ ❴ ❴ B∗ ⊗ B∗ B∗ ❡or ✄ m∗ (m⊗m)∗ ⑧   ⑤ ˜ ∗o B∗ ⊗B (B∗ ⊗ B∗ ⊗ B∗ ⊗ B∗ )∗∗ ① g❖ ❖ ❥ t m ⊗m′ ❖′ 13 ❥ ❥ ❖ ❖ 24 q ❥ ❥ ♥ ❥ ❖ u❥ ❦ m∗ ⊗m∗ ˜ ∗ ⊗B ˜ ∗ ⊗B ˜ ∗n ❴ ❛ ❞ ❢ ✐ B∗ ⊗B which says that m∗ is a morphism of functors of R-algebras.  In [6, Ch. I, §2, 13], Dieudonné proves the anti-equivalence between the category of commutative K-bialgebras and the category of linearly compact cocommutative K-bialgebras (where K is a field). Let C be a R-module. C is a R-coalgebra (coassociative with counit) if and only if C ∗ is a functor of algebras: Observe that n n n−1 (C ∗ ⊗ · · · ⊗ C ∗ )∗ = HomR (C ∗ ⊗ · · · ⊗ C ∗ , R) = HomR (C ∗ ⊗ · · · ⊗ C ∗ , C) n−2 n = HomR (C ∗ ⊗ · · · ⊗ C ∗ , C ⊗ C) = · · · = C ⊗ · · · ⊗ C 2.11 Definition 6.5. The functor of algebras C ∗ is called algebra scheme. If C ∗ ∈ F is a functor of bialgebras then it is called bialgebra scheme. Notation 6.6. Let A be a reflexive functor of K-algebras and let {Ai } be the set of quasi-coherent quotients of A such that dimK Ai < ∞. We denote Ā := lim Ai which is an algebra scheme because A∗i is quasi-coherent and lim Ai = ← i ∗ Note 6.7. Given a functor of algebras C ∈ F, then sition 5.20). C¯∗ ← i ( lim A∗i )∗ . → i ∗ = C (see proof of Propo- Proposition 6.8. [2, 5.9] Let A be a reflexive functor of K-algebras. Then, HomK−alg (A, C ∗ ) = HomK−alg (Ā, C ∗ ) for all algebra schemes C ∗ . Theorem 6.9. Let B ∈ F be a functor of proquasi-coherent K-bialgebras. Then, B̄ is a scheme of bialgebras and HomK−bialg (B, C ∗ ) = HomK−bialg (B̄, C ∗ ) for all bialgebra schemes C ∗ . ˜ . . . ⊗A ˜ n= Proof. Given any A1 , . . . , An ∈ F proquasi-coherent algebras then A1 ⊗ ˜ ...⊗ ˜ A¯n , by Proposition 6.8. Then, the comultiplication morphism B → B⊗B ˜ Ā1 ⊗ ˜ B̄, and B̄ is a scheme of bialgebras. defines a comultiplication morphism B̄ → B̄⊗ REFLEXIVE FUNCTORS OF MODULES IN COMMUTATIVE ALGEBRA 23 Given a morphism of functors of bialgebras f : B → C ∗ , that is, a morphism of functors of algebras such that the diagram B f  C∗ / B⊗B ˜ f ⊗f  / C ∗ ⊗C ˜ ∗ is commutative, the induced morphism of functors algebras B̄ → C ∗ is a morphism of functors of bialgebras. Reciprocally, given a morphism of bialgebras B̄ → C ∗ , the composition morphism B → B̄ → C ∗ is a mosphism of functors of bialgebras.  Corollary 6.10. Let A and B be K-bialgebras. Then, HomK−bialg (Ā, B ∗ ) = HomK−bialg (B̄, A∗ ) Proof. It holds that HomK−bialg (Ā, B ∗ ) = HomK−bialg (A, B ∗ ) = HomK−bialg (B, A∗ ) = HomK−bialg (B̄, A∗ ).  Note 6.11. The bialgebra A◦ := HomK (Ā, K) is sometimes known as the “dual bialgebra” of A and Corollary 6.10 says (dually) that the functor assigning to each bialgebra its dual bialgebra is autoadjoint (see [1, 3.5]). References [1] Abe, E., Hopf Algebras, Cambridge University Press, Cambridge, 1980. [2] Álvarez, A., Sancho, C., Sancho, P.,Algebra schemes and their representations, J. Algebra 296/1 (2006) 110-144. [3] Álvarez, A., Sancho, C., Sancho, P., Characterization of Quasi-Coherent Modules that are Module Schemes, Communications in Algebra (2009),37:5,1619 — 1621. [4] Demazure, M.; Grothendieck, A., SGA 3 Tome I, Lecture Notes in Mathematics 151, Springer-Verlag, 1970. [5] Demazure, M.; Gabriel, P., Introduction to Algebraic Geometry and Algebraic Groups, Mathematics Studies 39, North-Holland, 1980. [6] Dieudonné, J., Introduction to the Theory of Formal Groups, Pure and Applied Mathematics, vol. 20, Dekker, New York, 1973. [7] Eisenbud, D., Commutative Algebra with a View Toward Algebraic Geometry, GTM 150, Springer-Verlag, 1995. [8] Navarro, J., Sancho, C., Sancho, P. Affine Functors and Duality, arXiv:0904.2158v4 [9] Timmerman, T., An invitation to quantum groups and duality, EMS Textbooks in Mathematics, Zurich (2008). (José Navarro) Departamento de Matemáticas, Universidad de Extremadura, Avenida de Elvas s/n, 06071 Badajoz, Spain E-mail address: [email protected] (Carlos Sancho) Departamento de Matemáticas, Universidad de Salamanca, Plaza de la Merced 1-4, 37008 Salamanca, Spain E-mail address: [email protected] (Pedro Sancho) Departamento de Matemáticas, Universidad de Extremadura, Avenida de Elvas s/n, 06071 Badajoz, Spain E-mail address: [email protected]
0math.AC
Inversion of Separable Kernel Operators in Coupled Differential-Functional Equations and Application to Controller Synthesis ⋆ Guoying Miao ∗ Matthew M. Peet ∗∗ Keqin Gu ∗∗∗ arXiv:1703.10253v1 [cs.SY] 29 Mar 2017 ∗ School of Information and Control, Nanjing University of Information Science and Technology, Nanjing 210044, PR China. (e-mail: [email protected]). ∗∗ School of Matter, Transport and Energy, Arizona State University, Tempe, AZ 85287, USA. (e-mail: [email protected]) ∗∗∗ Department of Mechanical and Industrial Engineering, Southern Illinois University, Edwardsville, IL 62026, USA. (e-mail: [email protected]) Abstract: This article presents the inverse of the kernel operator associated with the complete quadratic Lyapunov-Krasovskii functional for coupled differential-functional equations when the kernel operator is separable. Similar to the case of time-delay systems of retarded type, the inverse operator is instrumental in control synthesis. Unlike the power series expansion approach used in the previous literature, a direct algebraic method is used here. It is shown that the domain of definition of the infinitesimal generator is an invariant subspace of the inverse operator if it is an invariant subspace of the kernel operator. The process of control synthesis using the inverse operator is described, and a numerical example is presented using the sum-of-square formulation. Keywords: Lyapunov-Krasovskii functional, linear operator, time delay, sum-of-square. 1. INTRODUCTION It is known that an accurate stability analysis using the Lyapunov approach requires a complete quadratic Lyapunov-Krasovskii functional. Such an approach was first implemented in the form of the discretized LyapunovKrasovskii functional method in Gu (1997), and a refined version was presented in Gu (2001). In this method, the kernel of the Lyapunov-Krasovskii functional is piecewise linear. An alternative approach is the Sum-Of-Squares (SOS) method presented in Peet et al. (2009). In the SOS method, the kernel is polynomial. In both approaches, the stability problem is reduced to a semi-definite programming problem, or more specifically, a linear matrix inequality problem. For many practical systems, the number of state variables with delays is very small compared with the total number of state variables. For such systems, a special form of the coupled differential-difference equation formulation, or its generalized counterpart, the coupled differential-functional equation formulation proves to be much more efficient in numerical computation. The differential-difference formulations can also model systems of neutral type. The discretized Lyapunov-Krasovskii functional approach to stability of differential-difference equations is documented ⋆ This work was supported by National Natural Science Foundation of PR China under Grant 61374090, 61503189, the Natural Science Foundation of Jiangsu Province under Grant BK20150926. This work was also supported by NSF Grants 1538374, 1301660, 1301851 in Gu and Liu (2009), Gu (2010) and Li (2012), and the SOS formulation can be found in Zhang et al. (2011). Control synthesis based on complete quadratic LyapunovKrasovskii functional stability conditions is still rare. An early example is Fridman (2002), in which a more limited class of Lyapunov-Krasovskii functional is used, and some parameter constraints are imposed. Recently, a synthesis based on the inverse of kernel operator associated with the Lyapunov-Krasovskii functional for time-delay systems of retarded type in the SOS formulation was developed in Peet and Papachristodoulou (2009b) and Peet (2013). This paper extends the method by Peet et al. to coupled differential-functional equations. The inverse operator is derived using direct algebraic approach rather than the series expansion approach. The basic idea of such synthesis is outlined as follows. Consider the coupled differential functional equations ẋ(t) = Ax(t) + By(t − r) + Z 0 H(θ)y(t + θ)dθ, (1) −r y(t) = Cx(t) + Dy(t − r), n×n n×m (2) m×n n×m where A ∈ R ,B∈R ,C ∈R , H(θ) ∈ R , D ∈ Rm×n , and r > 0 is time delay, Rn and Rm×n denote the set of real vectors and matrices with m×n dimensions, respectively. The initial conditions are defined as x(0) = ψ ∈ Rn y0 = φ ∈ PC(r, m), where yτ represents a shift and restriction of y(t) defined by yτ (θ) = y(τ + θ),−r ≤ θ ≤ 0, PC(r, m) represents the set of piecewise continuous functions from [−r, 0] to Rm . Let Z := Rn × PC(r, m). (3) The solutions to the system described by (1) and (2) may be represented by a strongly continuous semigroup(C0 semigroup) S : Z → Z, z(t) = S(t − τ )z(τ ). (4) System (1)-(2) may be written as an abstract differential equation on Z, ż = Az, (5) where A is the infinitesimal generator of the C0 -semigroup S. Then the stability of the system can be investigated using a quadratic Lyapunov-Krasovskii functional V (z) =< z, Pz >, (6) where P is a self-adjoint operator, and h·, ·i represents inner product. The system is stable if V (z) is positive definite in some sense, and its derivative along the system trajectory V̇ (z) =< z, (PA + A∗ P)z > is negative definite in some sense, where A∗ is the adjoint operator of A. Thus testing the stability of the system can be accomplished by searching for a P which satisfies the above conditions, and the problem can be reduced to a semi-definite programming problem when the kernel of the integral operator which defines P is restricted to be either piecewise linear or polynomial because the operator P appears linearly in V (z) and V̇ (z). However, the situation is quite different for control synthesis. Consider a system with input described by the abstract differential equation ż = Az + F u. (7) If we want to design a linear feedback control in the form of u = Kx, (8) so that the closed-loop system is stable, and use the Lyapunov-Krasovskii functional given in (6), then the derivative becomes V̇ (z) =< z, (PA + A∗ P + PF K + (PF K)∗ )z > . (9) Because we need to determine the feedback gain K in addition to the operator P, V̇ (z) becomes a bilinear function of the parameters. Determining the existence of parameters to make V (z) positive definite and V̇ (z) negative definite poses a formidable numerical problem, for which there is not yet any established reliable method to implement. One solution to this difficulty is to make a variable transformation ẑ = Pz, (10) and use new parameters Q = P −1 , (11) K̂ = KP −1 (12) instead of P and K to express V and V̇ . It can be easily obtained that V (z) = < ẑ, Qẑ >, (13) ∗ ∗ ∗ V̇ (z) = < ẑ, (AQ + QA + F K̂ + K̂ F )ẑ >, (14) which are linear with respect to the new parameters. Once Q and K̂ have been determined, the original parameters P and K may be obtained by solving (11) and (12), at least symbolically. Critical to implementing the above idea is the inversion of the linear operator P. Unfortunately, such an inversion is not easy in general. It turns out that a relatively simple expression for P −1 is possible when P is separable, as is utilized in (Peet and Papachristodoulou , 2009b) to carry out control synthesis for time-delay systems of retarded type. In this paper, we present the inversion of P for coupled differential-functional equations. Unlike the series expansion method used in (Peet, 2013), a direct algebraic approach is used here. Control synthesis is also described, and a numerical example is presented to illustrate the method. 2. PRELIMINARIES Consider the coupled differential functional equations given in (1) and (2). Stability of such a system may be verified using a complete Lyapunov-Krasovskii functional of the following form, V (ψ, φ) = rψ T P ψ + 2rψ T Z 0 Q(η)φ(η)dη −r + + Z 0 −r Z 0 0 Z φT (ξ)R(ξ, η)φ(η)dξdη −r φT (η)S(η)φ(η)dη, (15) −r where P = P T ∈ Rn×n , Q(η) ∈ R n×m (17) , T R(ξ, η) = R (η, ξ) ∈ R T (16) m×m , n S(η) = S (η) ∈ S , n (18) (19) and S represents the set of symmetric matrices, the superscript T denotes the transpose of a matrix or vector. Lemma 1. (Gu and Liu, 2009; Li, 2012) System (1)-(2) with ρ(D) < 1 is exponentially stable if there exists a quadratic Lyapunov-Krasovskii functional from (15)-(19), such that ǫ||ψ||2 ≤ V (ψ, φ), for some ǫ > 0, and its derivative along the system trajectory V̇ (ψ, φ) , lim sup t→0+ V (t, x(t, ψ, φ), yt (ψ, φ)) − V (ψ, φ) t satisfies V̇ (ψ, φ) ≤ −ǫ||ψ||2 , where, ||ψ|| denotes 2-norm. Cg + Dh(−r) Z 0 = CP ψ + CQ(s)φ(s)ds + rDQT (−r)ψ Define inner product on Z given in (3),     Z 0 ψ1 ψ2 T , = rψ1 ψ2 + φT1 (s)φ2 (s)ds. φ1 φ2 −r −r For matrix P and matrix functions Q, R, S that satisfy (16)-(19), we define the linear operator P : Z → Z   Z 0   ψ Q(s)φ(s)ds P ψ + , = P (20) −r φ Π where Z 0 Π = rQT (s)ψ + R(s, θ)φ(θ)dθ + S(s)φ(s). −r Obviously, P is a bounded and self-adjoint linear operator in view of (16)-(19), and the Lyapunov-Krasovskii functional may be expressed as     ψ ψ . ,P V (ψ, φ) = φ φ As mentioned in Section 1, system (1)-(2) define a strongly C0 -semigroup S : Z → Z that satisfies (4). System (1)-(2) may also be written as an abstract differential equation (5) on Z. Let the domain of definition of A be X. Then,    ψ ∈ Z φ̇(s) ∈ C, φ(0) = Cψ + Dφ(−r) , X := φ where C represents the set of continuous functions. It is of interest in some cases to restrict P so that X is invariant subspace of P, PX ∈ X. (21) The specific conditions for such a P to satisfy is given in the following. Lemma 2. P satisfies (21) if and only if the following conditions are satisfied, rQT (0) + S(0)C = CP + rDQT (−r), (22) R(0, s) = CQ(s) + DR(−r, s), ∀s, (23) DS(−r) = S(0)D. (24) R0 Proof. Define h(s) = rQT (s)ψ + −r R(s, θ)φ(θ)dθ + R0 S(s)φ(s) and g = P ψ + −r Q(s)φ(s)ds. Then, PX ∈ X is equivalent to h(0) = Cg + Dh(−r), (25)   ψ ∈ X, or for arbitrary φ φ(0) = Cψ + Dφ(−r). Using (26), we have h(0) = rQT (0)ψ + S(0)φ(0) + T = rQ (0)ψ + S(0)Cψ + +S(0)Dφ(−r) = (rQT (0) + S(0)C)ψ + Z Z (26) 0 R(0, θ)φ(θ)dθ −r 0 R(0, θ)φ(θ)dθ and DR(−r, s)φ(s)ds + DS(−r)φ(−r) −r = (CP + rDQT (−r))ψ + DS(−r)φ(−r) Z 0 + (CQ(s) + DR(−r, s))φ(s)ds (28) −r The right sides of (27)-(28) are equal for arbitrary ψ and φ if and only if (22)-(24) are satisfied. Obviously, the above is generalization of Theorem 3 in Peet (2016). 3. INVERSE OPERATOR In this section, we will present an analytical expression for the inverse of the operator P when it is separable. Similar to Peet (2013), such an analytic expression for the inverse operator can be used to expedite the construction of the stabilizing controller in the controller synthesis problem. Definition 1: An operator P defined in (20) is said to be separable if R(s, θ) = Z T (s)ΓZ(θ), (29) Q(s) = HZ(s), (30) T for some constant matrices Γ = Γ and H, and column vector function Z(s). Theorem 3. Assume P in (20) is separable. Then, provided that all the inverse matrices below are well defined, its inverse may be expressed as   ψ (s) P −1 φ Z 0   P̂ ψ + Q̂(θ)φ(θ)dθ   −r  , (31) Z 0 =   T rQ̂ (s)ψ + Ŝ(s)φ(s) + R̂(s, θ)φ(θ)dθ −r where R̂(s, θ) = Ẑ T (s)Γ̂Ẑ(θ), Q̂(θ) = Ĥ Ẑ(θ), Ŝ(s) = S −1 (s), (32) (33) (34) Ẑ(s) = Z(s)S −1 (s), Ĥ = −P −1 HT, T = (I + KΓ − rKH T P −1 H)−1 , P̂ = [I + rP −1 HT KH T ]P −1 , (35) (36) (37) (38) Γ̂ = [rT T H T P −1 H − Γ](I + KΓ)−1 , Z 0 K= Z(s)S −1 (s)Z T (s)ds, (39) (40) and I denotes the identity matrix with appropriate dimension. 0 R(0, θ)φ(θ)dθ −r +S(0)Dφ(−r) 0 −r −r Z + Z (27) Proof. Let the operator defined by the right hand side of (31) be denoted as P̂, then     Λ1 ψ (s) = P̂P , φ Λ2 where  Z 0 0  P̂ Q(θ) + Q̂(θ)S(θ) + Q̂(ξ)R(ξ, θ)dξ Λ1 = −r −r   Z 0 T ·φ(θ)dθ + P̂ P + rQ̂(θ)Q (θ)dθ ψ, −r   Z 0 Λ2 = r Q̂T (s)P + Ŝ(s)QT (s) + R̂(s, θ)QT (θ)dθ ψ −r Z 0 +Ŝ(s)S(s)φ(s) + rQ̂T (s)Q(θ) + Ŝ(s)R(s, θ) −r  Z 0 +R̂(s, θ)S(θ) + R̂(s, ξ)R(ξ, θ)dξ φ(θ)dθ. Z P P̂ ψ φ  =   ψ . φ (42) From (41) and (42), we conclude that P̂ = P −1 . Theorem 4. If the separable operator P satisfies PX ∈ X, Then, P −1 X ∈ X holds. Proof. Let the linear operator P satisfy PX ∈ X. By Lemma 2, this is equivalent to (22)-(24), from which, we obtain CP −1 = rS −1 (0)(DZ T (−r) − Z T (0))H T P −1 −r Using (29)-(30) and (32)-(40), we obtain Z 0 P̂ P + r Q̂(θ)QT (θ)dθ  +S −1 (0)C, T (43) T CH = (Z (0) − DZ (−r))Γ, S −1 (0)D = DS −1 (−r). (44) (45) −r T = P̂ P + rĤKH = [I + rP −1 H(I + KΓ − rKH T P −1 H)−1 KH T ] −rP −1 HT KH T = I, Z 0 P̂ Q(θ) + Q̂(θ)S(θ) + Q̂(ξ)R(ξ, θ)dξ −r  = P̂ H + Ĥ + ĤKΓ)Z(θ) = [I + rP −1 HT KH T ]P −1 H − P −1 HT −1 Z(θ) −P−1 HT KΓ  −1 = P H + P HT (rKH T P −1 H − I − KΓ) Z(θ)  = P −1 H − P −1 H Z(θ) = 0, Z 0 T T Q̂ (s)P + Ŝ(s)Q (s) + R̂(s, θ)QT (θ)dθ −1 Applying (43)-(45) to the operator P defined in (31), after tedious calculations, we can obtain the following equation, Z 0 T rQ̂ (0)ψ + Ŝ(0)φ(0) + R̂(0, θ)φ(θ)dθ −r   Z 0  = C P̂ ψ + Q̂(θ)φ(θ)dθ + D rQ̂T (−r)ψ −r  Z 0 +Ŝ(−r)φ(−r) + R̂(−r, θ)φ(θ)dθ , −r from which, we conclude that P −1 X ∈ X. 4. CONTROLLER SYNTHESIS In this section, we consider a control system as follows −r = Ẑ T (s)(Ĥ T P + H T + Γ̂KH T ) = Ẑ T (s) −T T H T P −1 P + H T +[rT TH T P −1 H − Γ](I + KΓ)−1 KH T = Ẑ T (s) I − T T (I − rH T P −1 H(I + KΓ)−1 K) −1 T −Γ(I +  KΓ) T K H T −1 T = Ẑ (s) I − T (I − rH P HK(I + ΓK)−1 ) −ΓK(I + ΓK)−1 H T = Ẑ T (s) I − T T (I + ΓK − rH T P −1 HK)(I + ΓK)−1 −ΓK(I + ΓK)−1 H T = Ẑ T (s)[I − (I + ΓK)−1 − ΓK(I + ΓK)−1 ]H T = 0, rQ̂T (s)Q(θ) + Ŝ(s)R(s, θ) + R̂(s, θ)S(θ) Z 0 + R̂(s, ξ)R(ξ, θ)dξ −r T = Ẑ T (s)(r + Γ + Γ̂ + Γ̂KΓ)Z(θ)  Ĥ H T = Ẑ (s) −rT T H T P −1 H + Γ +[rT T H T P −1 H − Γ](I + KΓ)−1 (I + KΓ) Z(θ) = Ẑ T (s) −rT T H T P −1 H + Γ + rT T H T P −1 H −Γ) Z(θ) = 0. Thus, we have shown     ψ ψ , (41) = P̂P φ φ   ψ ∈ Z. Similarly, we can show for all φ ẋ = Ax + By(t − r) + F u(t), y(t) = Cx(t) + Dy(t − τ ). (46) (47) Define the infinitesimal generator A as follows. " #    Ax + By(t − r) x d A (s) = . yt yt (s) ds Likewise, we define the input operator F : Rq → X as   Fu . (F u)(s) := 0 We define the controller synthesis problem as the search for matrices K0 , K1 and matrix-valued function K2 (s) such that the System of Equations (46)- (47) is stable if   x , (48) u(t) = K yt where we define K : X → Rq as    x K (s) yt = K0 x(t) + K1 y(t − r) + Z 0 K2 (s)y(t + s)ds. (49) −r Before we give the main result of the section, we briefly address SOS methods for enforcing joint positivity of coupled multiplier and integral operators using positive matrices. These methods have been developed in a series of papers, a summary of which can be found in the survey paper Peet (2014). Specifically, for matrix-valued functions M (s), N (s, θ), we say that {M, N } ∈ Ξ if M and N satisfy the conditions of Theorem 8 in Peet (2014). The constraint {M, N } ∈ Ξ can be cast as an LMI using SOSTOOLS as described in Peet (2014) and this constraint ensures that the operator P, defined as Z 0     M (s)φ(s)ds M ψ + 12 11   ψ  Z 0 −r = P   φ T N (s, θ)φ(θ)dθ + M22 (s)φ(s) rM21 (s)ψ + −r is positive on X. Furthermore, we note that R {M, N } ∈ Ξ implies that P is separable and P = M11 (s)ds and S = M22 are invertible. We now state the main result. Proposition 1: Let Z : R → Rq×n be an arbitrary continuously differentiable function. Suppose there exist matrices M0 , M1 , P = P T , matrix-valued functions M2 (s), Q(s), R(s, θ), S(s) = S T (s) ∈ Sn , and scalar ǫ > 0 such that (22)-(24) are satisfied and the following conditions hold {T, R} ∈ Ξ, {−U, −V } ∈ Ξ, where   P rQ(s) − ǫI, (50) T (s) = rQT (s) S(s)   1 Γ + ǫI BS(−r) + F M1 + C T S(0)D Υ r    −1 U (s) =   ∗ (S(−r) − DT S(0)D) 0 , r ∗ ∗ Ṡ(s) (51) d d V (s, θ) = R(s, θ) + R(s, θ), (52) ds dθ and ∗ denotes the corresponding symmetric part, Γ = AP + P AT + r(BQT (−r) + Q(−r)B T ) 1 + C T S(0)C + F M0 + M0T F, r Υ = r[Q̇(s) + BR(−r, s) + AQ(s) + F M2 (s)]. Then System (46)-(47) is stabilizable with a controller of the form (48). Furthermore, let P̂ , Q̂, R̂ and Ŝ be as defined in Theorem 3. Then if Z 0 u(t) = K0 x(t) + K1 y(t − r) + K2 (s)y(t + s)ds, −r where K0 = M0 P̂ + rM1 Q̂T (−r) + r Z 0 Next, we note that if we define K as    x K yt = K0 x(t) + K1 y(t − r) + Z 0 Z 0 K2 (s)y(t + s)ds, −r and M as    x M yt = M0 x(t) + M1 y(t − r) + M2 (s)y(t + s)ds, −r then K := MP −1 . We construct the controller   x y  Z = M0 P̂ x + MP −1 0 Q̂(θ)y(θ)dθ −r   Z T +M1 rQ̂ (−r)x + Ŝ(−r)y(−r) + 0 R̂(−r, θ)y(θ)dθ −r M2 (s)Q̂T (s)ds, −r (53) (54) K1 = M1 Ŝ(−r), K2 (s) = M0 Q̂(s) + M1 R̂(−r, s) + M2 (s)Ŝ(s) Z 0 + M2 (θ)R̂(θ, s)dθ, + Z 0 −r 0 + Z  M2 (s) rQ̂T (s)x + Ŝ(s)y(s)  R̂(s, θ)y(θ)dθ ds −r (55) −r then the System (46)-(47) is stable. Proof. Define   Z 0   P ψ + Q(s)φ(s)ds   ψ . Z 0 −r = P   φ T rQ (s)ψ + R(s, θ)φ(θ)dθ + S(s)φ(s) −r Then as per Lemma 2, P = P ∗ , P : X → X and P ≥ ǫI. Furthermore, P is bounded and as per Theorem 3, the inverse P −1 is defined as in (31) and is likewise bounded and coercive with P −1 ≥ ǫ′ I. Furthermore, from Theorem 4, P −1 : X → X and P −1 = P −∗ . Now define the Lyapunov functional     2 ψ ψ ψ ≥ ǫ′ , P −1 V = φ(s) φ(s) φ(s)   ψ ∈ X. Since P −1 = P −∗ , for φ(s)     ψ ψ , P −1 A φ(s)    φ(s)  ψ ψ −1 ,P + A φ(s)    φ(s)   ψ ψ −1 −1 , APP = P φ(s) φ(s)     ψ ψ −1 −1 . ,P + APP φ(s) φ(s)  Z = M0 P̂ + rM1 Q̂T (−r) + r 0 T M2 (s)Q̂ (s)ds x −r +M1 Ŝ(−r)y(−r) + Z 0 −r +M2 (s)Ŝ(s) +   x . =K y Z 0 −r   M0 Q̂(s) + M1 R̂(−r, s)  M2 (θ)R̂(θ, s)dθ y(s)ds     ψ̂ ψ ∈ = P −1 φ(s)     φ̂(s) x x = = KPP −1 X. Continuing, if u = K yt yt   x MP −1 , then the closed-loop system is stable if V̇ < yt 0, where     ψ̂ ψ̂ V̇ = , AP φ̂(s)   φ̂(s)   ψ̂ ψ̂ + AP ,  φ̂(s)  φ̂(s)  ψ̂ ψ̂ + FM , φ̂(s) φ̂(s)     ψ̂ ψ̂ + , FM . φ̂(s) φ̂(s) Now we define a new state  To show that V̇ < 0, we examine AP and F M separately. First, we have     ψ̂ Ψ AP , = Φ(s) φ̂(s) where Z 0 Ψ = AP ψ̂ + AQ(s)φ̂(s)ds + BrQT (−r)ψ̂ −r Z 0 BR(−r, θ)φ̂(θ)dθ, +BS(−r)φ̂(−r) + −r ˙ Φ(s) = rQ̇T (s)ψ̂ + Ṡ(s)φ̂(s) + S(s)φ̂(s) Z 0 d R(s, θ)φ̂(θ)dθ. + ds −r Then,     ψ̂ ψ̂ , AP φ̂(s) φ̂(s) Z 0 Z 0 φ̂T (s)Φ(s)ds ψ̂ T Ψds + = −r −r Z 0 = rψ̂ T AP ψ̂ + r ψ̂ T AQ(s)φ̂(s)ds + rψ̂ T BrQT (−r)ψ̂ −r Z 0 T ψ̂ T BR(−r, θ)φ̂(θ)dθ +rψ̂ BS(−r)φ̂(−r) + r −r Z 0 Z 0 + rφ̂T (s)Q̇T (s)ψ̂ds + φ̂T (s)Ṡ(s)φ̂(s)ds −r −r Z 0Z 0 d φ̂T (s) R(s, θ)φ̂(θ)dsdθ + ds −r Z−r 0 ˙ + φ̂T (s)S(s)φ̂(s)ds −r  T   Z 0 ψ̂ ψ̂  φ̂(−r)  Σ  φ̂(−r)  ds = −r φ̂(s) φ̂(s) Z 0Z 0 d T φ̂ (s) R(s, θ)φ̂(θ)dsdθ + ds −r Z−r 0 ˙ + φ̂T (s)S(s)φ̂(s)ds, Since   ψ̂ ∈ X, we have φ̂(0) = C ψ̂ + Dφ̂(−r). Then, φ̂(s) Z 0 ˙ φ̂T (s)S(s)φ̂(s)ds −r = φ̂T (0)S(0)φ̂(0) − φ̂T (−r)S(−r)φ̂(−r) Z 0 Z 0 ˙ T φ̂T (s)S(s)φ̂(s)ds φ̂ (s)Ṡ(s)φ̂(s)ds − − −r −r  1 T = φ̂ (0)S(0)φ̂(0) − φ̂T (−r)S(−r)φ̂(−r) 2 Z 0 1 − φ̂T (s)Ṡ(s)φ̂(s)ds 2 −r  T   Z 0 ψ̂ ψ̂ 1  φ̂(−r)  Ω  φ̂(−r)  ds. = 2 −r φ̂(s) φ̂(s) where  1  1 T C T S(0)C (C S(0)D) 0 r  r   1 1 T Ω=  (D S(0)C) − (S(−r) − DT S(0)D) 0  . r r 0 0 −Ṡ(s) Thus,     ψ̂ ψ̂ V̇ = , AP φ̂(s)   φ̂(s)   ψ̂ ψ̂ + AP ,  φ̂(s)  φ̂(s)  ψ̂ ψ̂ + FM , φ̂(s) φ̂(s)     ψ̂ ψ̂ , FM + φ̂(s) φ̂(s)   T  Z 0 ψ̂ ψ̂  φ̂(−r)  ∆  φ̂(−r)  ds = −r φ̂(s)  φ̂(s) Z 0Z 0 d φ̂T (s) R(s, θ) + ds −r −r  d + R(s, θ) φ̂(θ)dsdθ, dθ where   1 Γ BS(−r) + F M1 + (C T S(0)D) Υ r    1 ∆= ∗ 0 . − (S(−r) − DT S(0)D) r ∗ ∗ Ṡ(s) From conditions (51)-(52), we have V̇ < 0. Therefore, the closed-loop System (46)-(47) is stable. Remark 5. When F = 0 in System (46)-(47), we recover the standard delay-differential framework studied in Peet (2016) and Peet (2013): −r where  T  AP + rBQ (−r) BS(−r) Θ 0 0 0 , T rQ̇ (s) 0 Ṡ(s) where Θ = r(AQ(s) + BR(−r, s)). Σ= ẋ(t) = A0 x(t) + l X Ai x(t − ri ) i=1 x(t) = φ(t). The primary computational advantage of the differentialdifference framework over control of System (46)-(47) is In the following, we present a numerical example to illustrate the controller obtained from the condition in Proposition 1. We consider the following system with a feedback controller as follows   0 0.5 0 0 0 0  −0.5 −0.5 0 0 0 0    1 0.1 1 0 0   0 x(t) ẋ(t) =  0 −2 0.2 0 0    0   0 0 0 1 −2 0 0 0 0 0 0 −0.9     1 0.5 0 0  0 0     0  0 0 (56) y(t − r) +   u(t), +  0  0 0 0  0 0 1 0 1   −0.2 0 0 0 0 0 x(t), (57) y(t) = 0 00 0 01 3 2 1 0 x (t) that we can replace Ai ∈ Rn×n with BC where B ∈ Rn×m and C ∈ Rm×n and m is typically strictly less than n. Because the dimension of the decision variables in the optimization problem defined in this paper scale as n+ 2m as opposed to 3n using the framework in Peet (2016) and Peet (2013), the complexity of the resulting algorithm is significantly reduced. Remark 6. The feedback controller in (48) does not include delay in the input. However, the case of delay in the input can also be treated using a different form of F . This is left for future work. Remark 7. Although not explicitly stated, in order to use SOS to enforce the conditions of Theorem 3 and Proposition 1, we choose our decision variables to be polynomial and use SOSTOOLS and the Positivstellensatz to enforce positivity/negativity on the interval [−r, 0]. This approach is described in more detail in Peet (2016) and Peet (2013). −1 −2 −3 −4 0 20 40 60 80 100 t/s Fig. 1. States of System (56)-(57) coupled with stabilizing Controller from Prop. 1 operators as defined in Peet (2016). This formulation has the advantage that it eliminates the need for either individual positivity of the multiplier and integral operators or the need to use a series expansion to find the inverse. This inversion formula is applied to controller synthesis of coupled differential-difference equations. The use of the differential-difference formulation has the advantage that the size of the resulting decision variables is reduced, thereby allowing for control of systems with larger numbers of states. These methods are illustrated by designing a stabilizing controller for a system with 6 states and 2 delay channels.. REFERENCES K. Gu. Discretized LMI set in the stability problem of linear uncertain time-delay systems. Int. J. Control, 68: 923–934, 1997. K. Gu. A further refinement of discretized Lyapunov funcwhere r = 1.6s. By using Proposition 1, together with tional method for the stability of time-delay systems. the tools of MuPad, Matlab, SOSTOOLS and polynomials Int. J. Control, 74:967–976, 2001. with degree 2, we obtain the controller M.M. Peet, A. Papachristodoulou, and S. Lall. Positive T  forms and stability of linear time-delay systems. SIAM −1.874 J. Control Optim, 47:3237–3258, 2009.  2.232  T    K. Gu and Y. Liu. Lyapunov-Krasovskii functional for −0.239  −0.830  uniform stability of coupled differential-functional equay(t − r) u(t) =   x(t) + −0.343  3.099  tions. Automatica, 45:798–804, 2009.  0.030  K. Gu. Stability problem of systems with multiple delay −1.033 channels. Automatica, 46:743–751, 2010. Z 0 Y. Zhang, M.M. Peet, and K. Gu. Reducing the complexity + K2 y(t + s)ds, (58) of the sum-of-square test for stability of delay linear −1.6 systems.IEEE Transactions Automatic Control, 56:229– where 234, 2011.   T −0.246 + 0.221s + 0.122s2 − 0.012s3 − 0.032s4 M.M. Peet. SOS methods for multi-delay systems: a dual K2 = . 0.238 − 0.398s + +0.007s2 + 0.037s3 + 0.010s4, form of Lyapunov-krasovskii functional. IEEE Transactions on Automatic Control, submitted, 2016. Using Controller (58) coupled with System (56)-(57) we simulate the closed-loop system, which is illustrated in E. Fridman and U. Shaked. An improved stabilization method for linear time-delay systems. IEEE TransacFig.1. tions on Automatic Control, 47:253–270, 2002. M.M. Peet and A. Papachristodoulou. Inverse of positive 5. CONCLUSIONS linear operator and state feedback design for time-delay In this paper, we have obtained an analytic formulation system. In 8th IFAC Workshop on Time-delay System, for the inverse of jointly positive multiplier and integral pages 278–283, 2009b. M.M. Peet. Full state Feedback of delayed systems using SOS: a new theory of duality. IFAC Proceedings Volumes, pages 24–29, February 2013. M.M. Peet. LMI Parameterization of Lyapunov Functions for Infinite-Dimensional Systems: A Toolbox. I Proceedings of the American Control Conference, June 4-6, 2014. H. Li. Discretized LKF method for stability of coupled differential-difference equations with multiple discrete and distributed delays. International Journal of Robust and Nonlinear Control, 22:875–891, 2012.
3cs.SY
GAUSSIAN MIXTURES: ENTROPY AND GEOMETRIC INEQUALITIES arXiv:1611.04921v2 [math.PR] 8 Jun 2017 ALEXANDROS ESKENAZIS, PIOTR NAYAR, AND TOMASZ TKOCZ Abstract. A symmetric random variable is called a Gaussian mixture if it has the same distribution as the product of two independent random variables, one being positive and the other a standard Gaussian random variable. Examples of Gaussian mixtures include random variables p with densities proportional to e−|t| and symmetric p-stable random variables, where p ∈ (0, 2]. We obtain various sharp moment and entropy comparison estimates for weighted sums of independent Gaussian mixtures and investigate extensions of the B-inequality and the Gaussian correlation inequality in the context of Gaussian mixtures. We also obtain a correlation inequality for symmetric geodesically convex sets in the unit sphere equipped with the normalized surface area measure. We then apply these results to derive sharp constants in Khintchine inequalities for vectors uniformly distributed on the unit balls with respect to p-norms and provide short proofs to new and old comparison estimates for geometric parameters of sections and projections of such balls. 1. Introduction Gaussian random variables and processes have always been of central importance in probability theory and have numerous applications in various areas of mathematics. Recall that the measure P − n x2j /2 n −n/2 j=1 γn on R with density dγn (x) = (2π) e dx is called the standard Gaussian measure and a random vector distributed according to γn is called a standard Gaussian random vector. A centered Gaussian measure on Rn is defined to be a linear image of standard Gaussian measure. In the past four decades intensive research has been devoted to geometric properties related to Gaussian measures (see, e.g., the survey [Lat02]), which have provided indispensable tools for questions in convex geometry and the local theory of Banach spaces. In many cases, however, it still remains a challenging open problem to determine whether such properties are Gaussian per se or, in fact, more general. The main purpose of the present article is to investigate properties of mixtures of Gaussian measures and demonstrate that they are of use to concrete geometric questions. Definition 1. A random variable X is called a (centered) Gaussian mixture if there exists a positive random variable Y and a standard Gaussian random variable Z, independent of Y , such that X has the same distribution as the product Y Z. For example, a random variable X with density of the form x2 m X − 2 1 f (x) = pj √ e 2σj , 2πσj j=1 P where pj , σj > 0 are such that m j=1 pj = 1, is a Gaussian mixture corresponding to the discrete random variable Y with P(Y = σj ) = pj . Finite weighted averages of non-centered Gaussian measures are ubiquitous in information theory and theoretical computer science (see, for instance, 2010 Mathematics Subject Classification. Primary: 60E15; Secondary: 52A20, 52A40, 94A17. Key words and phrases. Gaussian measure, Gaussian mixture, Khintchine inequality, entropy, B-inequality, correlation inequalities, extremal sections and projections of `p -balls. The authors were supported in part by the Simons Foundation. P. N. was supported in part by NCN grant DEC-2012/05/B/ST1/00412. 1 [Das99], [AK01] for relevant results in learning theory) and are often referred in the literature as Gaussian mixtures. In this paper, we shall reserve this term for centered Gaussian mixtures in the sense of Definition 1. Observe that Gaussian mixtures are necessarily symmetric and continuous. We shall now discuss a simple analytic characterization of Gaussian mixtures in terms of their probability density functions. Recall that an infinitely differentiable function g : (0, ∞) → R is called completely monotonic if (−1)n g (n) (x) > 0 for all x > 0 and n > 0, where for n > 1 we denote by g (n) the n-th derivative of g and g (0) = g. A classical theorem of Bernstein (see, e.g., [Fel71]) asserts that g is completely monotonic if and only if it is the Laplace transform of some measure, i.e. there exists a non-negative Borel measure µ on [0, ∞) such that Z ∞ e−tx dµ(t), for every x > 0. (1) f (x) = 0 Bernstein’s theorem implies the following equivalence. Theorem 2. A symmetric random variable X with density f is a Gaussian mixture if and only if √ the function x 7→ f ( x) is completely monotonic for x > 0. Theorem 2 will be proven in Section 2. It readily implies that for every p ∈ (0, 2] the random p variable with density cp e−|x| is a Gaussian mixture; we denote its law by µp and by µnp = µ⊗n p the corresponding product measure. Another example of Gaussian mixtures are symmetric p-stable random variables, where p ∈ (0, 2] (see Lemma 21 in Section 2). Recall that a symmetric p-stable p random variable X is a random variable whose characteristic function is EeitX = e−c|t| , for t ∈ R and some c > 0. Standard symmetric p-stable random variables correspond to c = 1. In the consecutive subsections we shall describe our main results on Gaussian mixtures. 1.1. Sharp Khintchine-type inequalities. The classical Khintchine inequality asserts that for every p ∈ (0, ∞) there exist positive constants Ap , Bp such that for every real numbers a1 , . . . , an we have n n n X 1/2  X X 1/2 p 1/p Ap a2i 6 E ai εi 6 Bp a2i , (2) i=1 i=1 i=1 where ε1 , . . . , εn ∈ {−1, 1} are independent symmetric random signs. Whittle discovered the best constants in (2) for p > 3 (see [Whi60]), Szarek treated the case p = 1 (see [Sza76]) and finally Haagerup completed this line of research determining the optimal values of Ap , Bp for any p > 0 (see [Haa81]). Following Haagerup’s results, sharp Khintchine inequalities for other random variables have also been investigated extensively (see, for example, [LO95], [BC02], [Kön14]). In particular, in [LO95], Latala and Oleszkiewicz treated the case of i.i.d. random variables uniformly distributed on [−1, 1] and proved a comparison result in the sense of majorization that we shall now describe. We say that a vector a = (a1 , . . . , an ) is majorized by a vector b = (b1 , . . . , bn ), denoted a  b, if the nonincreasing rearrangements a∗1 > . . . > a∗n and b∗1 > . . . > b∗n of the coordinates of a and b, respectively, satisfy the inequalities k X j=1 a∗j 6 k X b∗j for each k ∈ {1, . . . , n − 1} and j=1 n X j=1 aj = n X bj . j=1 For a general reference on properties and applications Pof the majorization ordering see [MO79]. For instance, every vector (a1 , . . . , an ) with ai > 0 and ni=1 ai = 1 satisfies 1 1 ,...,  (a1 , . . . , an )  (1, 0, . . . , 0). (3) n n 2 A real-valued function which preserves (respectively reverses) the ordering  is called Schur convex (respectively Schur concave). The main result of [LO95] reads as follows. Let U1 , . . . , Un be i.i.d. random variables, uniformly distributed on [−1, 1]. For p > 2 and (a1 , . . . , an ), (b1 , . . . , bn ) ∈ Rn we have (a21 , . . . , a2n )  (b21 , . . . , b2n ) n X =⇒ E n X p ai Ui >E i=1 p (4) bi Ui i=1 and for p ∈ [1, 2) the second inequality is reversed. In particular, combining (3) and (4), for any p > 2 and a unit vector (a1 , . . . , an ) we get p E|U1 | 6 E n X p ai Ui 6E i=1 U1 + · · · + Un p √ , n (5) whereas for p ∈ [1, 2) the reverse inequalities hold. Inequality (5) along with the central limit theorem implies that the sharp constants in the Khintchine inequality n n n  X  X  X 2 1/2 p 1/p 2 1/2 ai Ui 6 E ai Ui 6 Bp E a i Ui (6) Ap E i=1 i=1 i=1 are precisely Ap = where γp = √  2 ( γp , Γ( p+1 ) √2 π p ∈ [1, 2) 31/2 , p ∈ [2, ∞) (p+1)1/p 31/2 , (p+1)1/p p ∈ [1, 2) γp , p ∈ [2, ∞) ( and Bp = , (7) 1/p is the p-th moment of a standard Gaussian random variable. Our main result for moments is an analogue of the Schur monotonicity statement (4) for Gaussian mixtures. Recall that for a random variable Y and p 6= 0 we denote by kY kp = (E|Y |p )1/p its p-th moment and kY k0 = exp(E log |Y |). Notice that since a standard Gaussian random variable Z satisfies E|Z|p = ∞ for every p 6 −1, a moment comparison result for Gaussian mixtures can only make sense for p-th moments, where p > −1. Theorem 3. Let X be a Gaussian mixture and X1 , . . . , Xn be independent copies of X. For two vectors (a1 , . . . , an ), (b1 , . . . , bn ) in Rn and p > 2 we have (a21 , . . . , a2n )  (b21 , . . . , b2n ) =⇒ n X i=1 ai Xi p 6 n X i=1 bi Xi p , (8) whereas for p ∈ (−1, 2) the second inequality is reversed, provided that E|X|p < ∞. The proof of Theorem 3 and the straightforward derivation of sharp constants for the corresponding Khintchine inequalities (Corollary 23) will be provided in Section 3. As an application we derive similar Schur monotonicity properties for vectors uniformly distributed on the unit ball of `nq for q ∈ (0, 2], which were first considered by Barthe, Guédon, Mendelson and Naor in [BGMN05]. Recall that for a vector x = (x1 , . . . , xn ) ∈ Rn and q > 0 we  Pn q 1/q and kxk n denote kxkq = ∞ = max16i6n |xi |. We also write `q for the quasi-normed i=1 |xi | space (Rn , k · kq ) and Bqn = {x ∈ Rn : kxkq 6 1} for its closed unit ball. In [BGMN05], the authors discovered a representation for the uniform measure on Bqn , relating it to the product measures µnq defined after Theorem 2, and used it to determine the sharp constants in Khintchine inequalities on Bqn up to a constant factor. Using their representation along with Theorem 3 we deduce the following comparison result. 3 Corollary 4. Fix q ∈ (0, 2] and let X = (X1 , . . . , Xn ) be a random vector uniformly distributed on Bqn . For two vectors (a1 , . . . , an ), (b1 , . . . , bn ) in Rn and p > 2 we have (a21 , . . . , a2n )  (b21 , . . . , b2n ) =⇒ n X i=1 ai Xi p 6 n X i=1 bi Xi p , (9) whereas for p ∈ (−1, 2) the second inequality is reversed. The derivation of the sharp constants in the corresponding Khintchine inequality is postponed to Corollary 24. Given Corollary 4 and the result of [LO95], which corresponds to the unit cube n , the following question seems natural. B∞ Question 5. Let X = (X1 , . . . , Xn ) be a random vector uniformly distributed on Bqn for some q ∈ (2, ∞). What are the sharp constants in the Khintchine inequalities for X? It will be evident from the proof of Corollary 4 that Question 5 is equivalent to finding the sharp Khintchine constants for µnq , where q ∈ (2, ∞). We conjecture that there exists a Schur monotonicity result, identical to the one in (4). 1.2. Entropy comparison. For a random variable X with density function f : R → R+ the Shannon entropy of X is a fundamental quantity in information theory, defined as Z Ent(X) = − f (x) log f (x) dx = E[− log f (X)], R provided that the integral exists. Jensen’s inequality yields that among random variables with a fixed variance, the Gaussian random variable maximizes the entropy. Moreover, Pinsker’s inequality (see, e.g., [GL10, Theorem 1.1]) asserts that if a random variable X has variance one and G is a standard Gaussian random variable, then the entropy gap Ent(G) − Ent(X) dominates the total variation distance between the laws of X and G. Consequently, the entropy can be interpreted as a measure of closeness to Gaussianity. The following question seems natural. Question 6. Fix n > 2 and suppose that X1 , . . . , Xn are P i.i.d. random variables with finite variance. For which unit vectors (a1 , . . . , an ) is the entropy of ni=1 ai Xi maximized? P P The constraint ni=1 a2i = 1 on (a1 , . . . , an ) plainly fixes the variance of the weighted sum ni=1 ai Xi and the answer would give the corresponding most Gaussian weights. The first result concerning the entropy of weighted sums of i.i.d. random variables was the celebrated entropy power inequality, first stated by Shannon in [SW49] and rigorously proven by Stam in [Sta59]. An equivalent formulation of the Shannon-Stam inequality (see [Lie78]) reads as follows. For every λ ∈ [0, 1] and independent random variables X, Y we have √ √ Ent( λX + 1 − λY ) > λEnt(X) + (1 − λ)Ent(Y ), (10) provided that all the entropies exist. It immediately follows from (10) that if X1 , . . . , Xn are i.i.d. random variables with finite variance and (a1 , . . . , an ) is a unit vector, then we have n X  Ent ai Xi > Ent(X1 ). (11) i=1 In other words, the corresponding minimum in Question 6 is achieved at the direction vectors ei . Moreover, a deep monotonicity result for Shannon entropy was obtained in the work of ArtsteinAvidan, Ball, Barthe and Naor [ABBN04]. The authors proved that for any random variable X with finite variance and any n > 1 we have n X   n+1  X 1 1 √ Xi 6 Ent √ Ent Xi , (12) n n+1 i=1 i=1 4 where X1 , X2 , . . . are independent copies of X.  Given inequality (12), a natural guess for Question 6 would be that the vector √1n , . . . , √1n is a maximizer for any n > 2 and for any square-integrable random variable X. However, this is not correct in general. In [BNT16, Proposition 2], the authors showed that for a symmetric random variable distributed on the union of two intervals the Shannon entropy of the weighted √ X uniformly √ sum λX1 + 1 − λX2 is not maximized at λ = 12 . Nonetheless, for Gaussian mixtures it is possible to obtain the comparison for Rényi entropies which confirms the natural guess. Recall that for a random variable X with density f : R → R+ and α > 0, α 6= 1, the Rényi entropy of order α of X is defined as Z  1 f α (x) dx . log hα (X) = 1−α R Note that if for some α > 1 the integral of f α is finite, then hα (X) tends to Ent(X) as α → 1+ (see [BC15, Lemma V.3]), which we shall also denote by h1 (X) for convenience. Theorem 7. Let X1 , . . . , Xn be i.i.d. Gaussian mixtures and α > 1. Then for two vectors (a1 , . . . , an ), (b1 , . . . , bn ) in Rn we have n n X  X  (a21 , . . . , a2n )  (b21 , . . . , b2n ) =⇒ hα ai Xi > hα bi Xi , (13) i=1 i=1 provided that all the entropies are finite. In particular, for every unit vector (a1 , . . . , an ) n X  X + · · · + X  1 n √ Ent(X1 ) 6 Ent . ai Xi 6 Ent n (14) i=1 Extensions of inequality (14), even for the uniform measure on the cube, appear to be unknown. Question 8. Let U1 , . . . , Un be i.i.d. random variables, each uniformly distributed on [−1, 1]. Is it correct that for every unit vector (a1 , . . . , an ) n X  U + · · · + U  1 n √ Ent ai Ui 6 Ent ? (15) n i=1 Geometrically, this would mean that, in the entropy sense, the most Gaussian direction of the n is the main diagonal. unit cube B∞ We close this subsection with an intriguing question in the spirit of the well known fact that a Gaussian random variable has maximum entropy among all random variables with a specified variance. Note that Theorem 7 along with  1 1   1 1 (1, 1, 0, . . . , 0)  1, , , 0, . . . , 0  · · ·  1, , . . . , 2 2 n n  √ n+1 , imply that for every i.i.d. Gaussian mixtures X1 , X2 , . . . the sequence Ent X1 + X2 +···+X n n = 1, 2, . . . is increasing and in particular  X2 + · · · + Xn+1  √ Ent(X1 + X2 ) 6 Ent X1 + . n Thus, the following result should not be surprising. Proposition 9. Let X1 , X2 be independent Gaussian mixtures with finite variance. Then Ent(X1 + X2 ) 6 Ent(X1 + G), where G is a Gaussian random variable independent of X1 having the same variance as X2 . 5 (16) We pose a question as to whether this is true in general, under the additional assumption that X1 , X2 are identically distributed. Question 10. Let X1 , X2 be i.i.d. continuous random variables with finite variance. Is it true that Ent(X1 + X2 ) 6 Ent(X1 + G), (17) where G is a Gaussian random variable independent of X1 having the same variance as X2 ? The preceding entropy comparison results will be proven in Section 3. 1.3. Geometric properties of Gaussian mixtures. Recall that a function ϕ : Rn → R+ is called log-concave if ϕ = e−V for some convex function V : Rn → (−∞, ∞]. A measure µ on Rn is called log-concave if for every Borel sets A, B ⊆ Rn and λ ∈ (0, 1) we have µ(λA + (1 − λ)B) > µ(A)λ µ(B)1−λ . (18) A random vector is called log-concave if it is distributed according to a log-concave measure. Two important examples of log-concave measures on Rn are Gaussian measures and uniform measures supported on convex bodies. The geometry of log-concave measures, in analogy with the asymptotic theory of convex bodies, has been intensively studied and many major results are known (see, for example, the monograph [AAGM15]). The Gaussian measure, however, possesses many delicate properties which are either wrong or whose validity is still unknown for other log-concave measures. In what follows, we will explain how to extend, in the context of Gaussian mixtures, two such properties: the B-inequality, proven by Cordero-Erausquin, Fradelizi and Maurey in [CEFM04], and the Gaussian correlation inequality, recently proven by Royen in [Roy14]. Choosing the sets A, B in (18) to be dilations of a fixed convex set K ⊆ Rn we deduce that for every a, b > 0 and λ ∈ (0, 1)  µ (λa + (1 − λ)b)K > µ(aK)λ µ(bK)1−λ . (19) The B-inequality provides a substantial strengthening of (19) for Gaussian measure, under an additional symmetry assumption: for any origin symmetric convex set K ⊆ Rn , a, b > 0 and λ ∈ (0, 1) γn (aλ b1−λ K) > γn (aK)λ γn (bK)1−λ , (20) or, in other words, the function t 7→ γn (et K) is log-concave on R. In fact, in [CEFM04] the following strong form of the above inequality was proven. Theorem 11 (B-inequality, [CEFM04]). Let K be a symmetric convex set in Rn . Then, the function  Rn 3 (t1 , . . . , tn ) 7−→ γn ∆(et1 , . . . , etn )K (21) is log-concave on Rn , where ∆(s1 , . . . , sn ) is the diagonal n × n matrix with entries s1 , . . . , sn . The authors also proved that the same conclusion holds for an arbitrary unconditional logconcave measure, provided that the convex set K is unconditional as well (see [CEFM04, Section 5] for further details). Furthermore, they asked whether the B-inequality holds for any symmetric log-concave measure and symmetric convex set K; this is currently known as the B-conjecture. We note that in [Sar16], Saroglou confirmed the B-conjecture on the plane (the case of uniform measures on convex planar sets had previously been treated in [LBo14]). Our result in this direction is the following theorem. Theorem 12. Let X1 , . . . , Xn be Gaussian mixtures such that Xi has the same distribution as Yi Zi , where Yi is positive and Zi is a standard Gaussian random variable independent of Yi . Denote by 6 µi the law of Xi and by µ the product measure µ1 × · · · × µn . If, additionally, log Yi is log-concave for each i, then for every symmetric convex set K in Rn the function Rn 3 (t1 , . . . , tn ) 7−→ µ(∆(et1 , . . . , etn )K) is log-concave on (22) Rn . We do not know whether the additional assumption on the Yi can be omitted, but we verified p (Corollary 28) that both the measure with density proportional to e−|t| and the symmetric pstable measure have this property for p ∈ (0, 1], whereas they do not for p ∈ (1, 2). Notice that the corresponding product measures, apart from µn1 , are not log-concave. We note that extending the B-inequality to µnp , where p > 2, is of importance. For instance, it has been proven by Saroglou n ) would [Sar15] that the B-inequality for µn∞ (that is, the uniform measure on the unit cube B∞ imply the conjectured logarithmic Brunn-Minkowski inequality (see [BLYZ12]) in its full generality. The proof of Theorem 12 will be given in Section 4. An application of the B-inequality for Gaussian measure is a small ball probability estimate due to Latala and Oleszkiewicz [LO05]. For a symmetric convex set K denote by r(K) its inradius, i.e. the largest r > 0 such that rB2n ⊆ K. In [LO05], the authors used Theorem 11 along with the Gaussian isoperimetric inequality (see, e.g., [AAGM15, Theorem 3.1.9]) to prove that if K ⊆ Rn is a symmetric convex set with γn (K) 6 1/2, then γn (tK) 6 (2t) r(K)2 4 γn (K), for every t ∈ [0, 1]. (23) Using Theorem 12 and an isoperimetric-type estimate of Bobkov and Houdré from [BH97] we deduce the following corollary. Corollary 13. Let K be a symmetric convex set in Rn such that µn1 (K) 6 1/2. Then r(K) √ 6 µn1 (tK) 6 t 2 µn1 (K), for every t ∈ [0, 1]. (24) Our next result is an extension of the Gaussian correlation inequality, which was recently proven by Royen in [Roy14] (see also [LM15] for a very clear exposition of Royen’s proof and the references therein for the history of the problem). Theorem 14 (Gaussian correlation inequality, [Roy14]). For any centered Gaussian measure γ on Rn and symmetric convex sets K, L in Rn we have γ(K ∩ L) > γ(K)γ(L). (25) This inequality admits a straightforward extension to products of laws of Gaussian mixtures. Theorem 15. Let X1 , . . . , Xn be Gaussian mixtures and denote by µi the law of Xi . Then, for µ = µ1 × · · · × µn and any symmetric convex sets K, L in Rn we have µ(K ∩ L) > µ(K)µ(L). (26) This theorem implies that the correlation inequality (26) holds for the product measure µnp as well as for all symmetric p-stable laws on Rn , where p ∈ (0, 2) (Corollary 33). In particular, the multivariate Cauchy distribution, which is a rotationally invariant 1-stable distribution on Rn n+1 defined as dµ(x) = cn (1+kxk22 )− 2 dx, satisfies the inequality (26). In [Mem15], Memarian proved partial results in this direction and noticed that such inequalities are equivalent to correlation-type n−1 inequalities on the unit sphere S n−1 . We will recap his argument in Section 5. Let S+ ⊆ S n−1 n−1 n−1 n be the open upper hemisphere, i.e. S+ = S ∩ {x ∈ R : xn > 0} whose pole is the point n−1 p = (0, . . . , 0, 1). A subset A ⊆ S+ is called geodesically convex if for any two points x, y ∈ A the shortest arc of the great circle joining x, y is contained in A. Furthermore, A is called symmetric (with respect to the pole p) if for any x ∈ A, the point x∗ 6= x which lies on the great circle joining 7 x and p and satisfies dS n−1 (x, p) = dS n−1 (p, x∗ ), also belongs in A. Here dS n−1 denotes the geodesic distance on the sphere. n−1 Corollary 16. Let S+ ⊆ S n−1 be the open upper hemisphere. Then for every symmetric geodesin−1 cally convex sets K, L in S+ we have n−1 |K ∩ L| · |S+ | > |K| · |L|, (27) where | · | denotes the surface area measure on S n−1 . Finally, we want to stress that one cannot expect that all geometric properties of the Gaussian measure will extend mutatis mutandis to Gaussian mixtures. For example, it has been proven by Bobkov and Houdré in [BH96] that the Gaussian isoperimetric inequality actually characterizes Gaussian measures. Nevertheless, it might be the case that there are many more that admit such an extension. 1.4. Sections and projections of Bqn . The study of quantitative parameters of sections and projections of convex bodies is a classical topic in convex geometry (for example, see the monograph [Kol05]). As a first application, we revisit two well known theorems and reprove them using some relevant Gaussian mixture representations. Denote by H1 the hyperplane (1, 0, . . . , 0)⊥ and by Hn the hyperplane (1, . . . , 1)⊥ . It has been proven by Barthe and Naor in [BN02] that for any q ∈ (2, ∞] and any hyperplane H ⊆ Rn we have |ProjH1 Bqn | 6 |ProjH Bqn | 6 |ProjHn Bqn |, (28) where | · | denotes Lebesgue measure. To deduce this, they proved that for any q ∈ [1, ∞], if X1 , . . . , Xn are i.i.d. random variables with density 2−q fq (t) = cq |t| q−1 e−|t| then the volume of hyperplane projections of Bqn q q−1 , t ∈ R, (29) can be expressed as |Proja⊥ Bqn | = αq,n E n X ai Xi , (30) i=1 where a = (a1 , . . . , an ) is a unit vector and αq,n is a positive constant. It immediately follows from the characterization given in Theorem 2 that for q > 2 the random variables Xi are Gaussian mixtures and thus, from Theorem 3 (with p = 1), we deduce the following strengthening of (28). Corollary 17. Fix q ∈ (2, ∞]. For two unit vectors a = (a1 , . . . , an ), b = (b1 , . . . , bn ) in Rn we have (a21 , . . . , a2n )  (b21 , . . . , b2n ) =⇒ |Proja⊥ Bqn | > |Projb⊥ Bqn |. (31) We now turn to the dual question for sections. Meyer and Pajor and later Koldobsky (see [MP88], [Kol98]) proved that for any q ∈ (0, 2) and any hyperplane H ⊆ Rn |Bqn ∩ Hn | 6 |Bqn ∩ H| 6 |Bqn ∩ H1 |. (32) More precisely, in [MP88] the authors proved the upper bound of (32) for q ∈ [1, 2) and the lower bound for q = 1 and posed a conjecture that would imply (32) for any q ∈ (0, 2); this was later confirmed in [Kol98]. The main ingredients in Koldobsky’s proof of (32) were a general representation of the volume of hyperplane sections of a convex body in terms of the Fourier transform of the underlying norm and an elegant lemma about symmetric q-stable densities. Using a different approach, we prove the analogue of Corollary 17 for sections. Corollary 18. Fix q ∈ (0, 2). For two unit vectors a = (a1 , . . . , an ), b = (b1 , . . . , bn ) in Rn we have (a21 , . . . , a2n )  (b21 , . . . , b2n ) =⇒ |Bqn ∩ a⊥ | 6 |Bqn ∩ b⊥ |. 8 (33) In fact, Corollary 18 will follow from a more general comparison of Gaussian parameters of sections which is in the spirit of [BGMN05]. For a hyperplane H ⊆ Rn and a convex body K ⊆ Rn denote by k · kK∩H the norm on H associated with the convex body K ∩ H. Theorem 19. Fix q ∈ (0, 2). For a unit vector θ ∈ Rn let Gθ be a standard Gaussian random vector on the hyperplane θ⊥ . Then for every λ > 0 and unit vectors a = (a1 , . . . , an ), b = (b1 , . . . , bn ) in Rn we have q q −λkGa k (a21 , . . . , a2n )  (b21 , . . . , b2n ) =⇒ Ee n ∩a⊥ Bq −λkGb k 6 Ee n ∩b⊥ Bq . (34) In [BGMN05], the authors used a different method to prove that for any q ∈ (0, 2) and λ > 0 the Gaussian parameters appearing in (34) are maximized when a = e1 . As explained there, such inequalities imply the comparison of various other parameters of sections and projections of Bqn , most notably the volume (Corollary 18) and the mean width. Recall that for a symmetric convex body K in Rn the support function hK : S n−1 → R+ is defined as hK (θ) = maxx∈K hx, θi and the mean width is Z w(K) = hK (θ) dσ(θ), S n−1 where σ is the rotationally invariant probability measure on the unit sphere S n−1 . Exploiting the duality between sections and projections we deduce the following corollary. Corollary 20. Fix q ∈ (2, ∞] and let H ⊆ Rn be a hyperplane. Then w(ProjH1 Bqn ) 6 w(ProjH Bqn ) 6 w(ProjHn Bqn ). (35) The lower bound in (35) was first obtained in [BGMN05], where the authors also proved that for any q ∈ (0, 2) and any hyperplane H ⊆ Rn w(ProjH Bqn ) 6 w(ProjH1 Bqn ). (36) Given this result and Corollary 20, what remains to be understood is which hyperplane projections of Bqn have minimal mean width for q ∈ (0, 2), similarly to the study of volume. We will provide the proof of Theorem 19 and its consequences in Section 6. 2. Proof of Theorem 2 and examples Here we establish some initial facts about Gaussian mixtures, prove the characterization presented in the introduction and use it to provide relevant examples. Let X be a Gaussian mixture with the same distribution as Y Z, where Y is positive and Z is an independent standard Gaussian random variable; denote by ν the law of Y . Clearly X is symmetric. Furthermore, for a Borel set A ⊆ R we have Z ∞ Z Z ∞ 2 1 −x √ e 2y2 dν(y) dx, (37) P(X ∈ A) = P(Y Z ∈ A) = P(yZ ∈ A) dν(y) = 2πy 0 A 0 which immediately implies that X has a density Z ∞ 2 1 − x dν(y) f (x) = √ e 2y2 . (38) y 2π 0 We now proceed with the proof of Theorem 2. Proof of√Theorem 2. Let X be a symmetric random variable with density f such that the function x 7→ f ( x) is completely monotonic. By Bernstein’s theorem, there exists a non-negative Borel measure µ supported on [0, ∞) such that Z ∞ √ f ( x) = e−tx dµ(t), for every x > 0 (39) 0 9 R∞ 2 or, equivalently, f (x) = 0 e−tx dµ(t) for every x ∈ R. Notice that µ({0}) = 0, because otherwise f would not be integrable. Now, for a subset A ⊆ R we have Z ∞Z Z Z ∞ 2 2 e−tx dx dµ(t) e−tx dµ(t) dx = P(X ∈ A) = 0 A A 0 r (40) Z ∞Z Z ∞ √ 1 −x2 /2 π √ e γn ( 2tA) dν(t), = dx dµ(t) = √ t 2π 0 0 2tA p where dν(t) = πt dµ(t). In particular, choosing A = R, we deduce that ν is a probability measure, supported on (0, ∞). Let V be a random variable distributed according to ν; clearly V is positive almost surely. Define Y = √12V and let Z be a standard Gaussian random variable, independent of Y . Then (40) implies that   Z ∞ √ 1 √ γn ( 2tA) dν(t) = P(X ∈ A), P(Y Z ∈ A) = P ·Z ∈A = 2V 0 that is, X has the same distribution as the product Y Z. The converse implication readily follows from (38) and Bernstein’s theorem after a change of variables.  Before applying Theorem 2 we first provide some examples of completely monotonic functions. Direct differentiation shows that the functions e−αx , x−α and (1+x)−α , where α > 0, are completely β monotonic on (0, ∞) and a straightforward induction proves that the same holds for e−x , where β ∈ (0, 1]. The same argument implies that if g is a completely monotonic function on (0, ∞) and h is positive and has a completely monotonic derivative on (0, ∞), then g ◦ h is also completely monotonic on (0, ∞). Moreover, one can easily see that products of completely monotonic functions themselves are completely monotonic. Combining the last example with Theorem 2, we get that for every p ∈ (0, 2] the random p variable with density proportional to e−|t| is a Gaussian mixture. Recall that we denote by µp p the probability measure with density cp e−|t| , p > 0, where cp = (2Γ(1 + 1/p))−1 , and µnp = µ⊗n p . Furthermore, it is a classical fact that symmetric p-stable random variables, where p ∈ (0, 2], are Gaussian mixtures. For these measures we can describe the positive factor in their Gaussian mixture α representation. Recall that a positive random variable W with Laplace transform Ee−tW = e−ct , where α ∈ (0, 1) and c > 0, is called a positive α-stable random variable. Standard positive α-stable random variables correspond to c = 1; we denote their density by gα . Lemma 21. Fix p ∈ (0, 2) and let Z be a standard Gaussian random variable. (i) If Vp/2 has density proportional to t−1/2 gp/2 (t) and is independent of Z, then (2Vp/2 )−1/2 Z p has density cp e−|t| . (ii) If Wp/2 is a standard positive p/2-stable random variable and is independent of Z, then (2Wp/2 )1/2 Z is a standard symmetric p-stable random variable. p Proof. To show (i), we shall decompose a symmetric random variable with density cp e−|x| into a product of two independent random variables: a positive one and a standard Gaussian. To this p end, denote by µ the measure in the representation (39) written for the density cp e−|x| , that is Z ∞ −xp/2 cp e = e−tx dµ(t), x > 0. 0 p/2 −x Therefore, the Laplace transform of c−1 , which implies that c−1 p µ is e p µ is a standard positive p/2-stable measure with density gp/2 . Now, an inspection of the proof of Theorem 2, reveals that the (2V )−1/2 , where V has law p π positive factor Y in the Gaussian mixture representation is Y =−1/2 gp/2 (t), as required. t dµ(t), so in this case the density of V is indeed proportional to t 10 On the other hand, (ii) is a straightforward characteristic function computation. Using the independence of Wp/2 and Z we get Ee √ 1/2 i 2tWp/2 Z √ 1/2 i 2tWp/2 Z = EWp/2 EZ e 2W = Ee−t p/2 p = e−t , which concludes the proof of the lemma.  Lemma 21 will be useful in Section 4. For instance, a direct computation shows that these Gaussian mixture representations have the following explicit forms when p = 1. (i) Let E be an exponential random variable (that is, a random variable with density√e−t 1t>0 ) and Z a standard Gaussian random variable, independent of E. Then the product 2EZ has density 21 e−|t| , t ∈ R (symmetric exponential density). (ii) Let Z1 , Z2 be independent standard Gaussian random variables. Then the quotient Z1 /|Z2 | is 1 distributed according to the Cauchy distribution with density π(1+x 2 ) , which is the symmetric 1-stable distribution. Remark 22. It was noted in [BN02, p. 8] that for an infinitely differentiable integrable function √ √ f : (0, ∞) → R, the function x 7→ f ( x) is completely monotonic if and only if x 7→ fb( x) is p completely monotonic, where fb is the Fourier transform of f . Applying this to the density cp e−|t| and then using Theorem 2 yields that symmetric p-stable random variables are Gaussian mixtures, as was also proven above. 3. Moment and entropy comparison For the proofs of this section, we will use an elementary result of Marshall and Proschan from [MP65] which reads as follows. Let φ : Rn → R be a convex function, symmetric under permutations of its n arguments. Let X1 , . . . , Xn be interchangeable random variables, that is, random variables whose joint distribution is invariant under permutations of its coordinates. Then for two vectors (a1 , . . . , an ), (b1 , . . . , bn ) ∈ Rn we have (a1 , . . . , an )  (b1 , . . . , bn ) =⇒ Eφ(a1 X1 , . . . , an Xn ) 6 Eφ(b1 X1 , . . . , bn Xn ) (41) Rn or, in other words, the function 3 (a1 , . . . , an ) 7→ Eφ(a1 X1 , . . . , an Xn ) is Schur convex. If φ is concave, then the second inequality in (41) is reversed, i.e. the function above is Schur concave. This result follows directly from the fact that a convex (respectively concave) function that is symmetric under permutations of its arguments is Schur convex (respectively concave), which, in turn, is a consequence of the following simple property. If a = (a1 , . . . , an ), b = (b1 , . . . , bn ) ∈ Rn then  a  b ⇐⇒ a ∈ conv (bσ(1) , . . . , bσ(n) ) : σ is a permutation of {1, . . . , n} , where conv(A) denotes the convex hull of a set A ⊆ Rn (for details, see [MO79]). We start with the comparison of moments of Gaussian mixtures. Proof of Theorem 3. Fix p > −1, p 6= 0. Let X be a Gaussian mixture and X1 , . . . , Xn be independent copies of X. Since each Xi is a Gaussian mixture, there exist i.i.d. positive random variables Y1 , . . . , Yn and independent standard Gaussian random variables Z1 , . . . , Zn such that Xi has the same distribution as the product Yi Zi . For a1 , . . . , an ∈ R the joint independence of the Yi , Zj implies that n n n n X 1/2 p X X X p p p/2 E ai Xi = E ai Yi Zi = E a2i Yi2 Z = γpp · E a2i Yi2 , i=1 i=1 i=1 i=1 where Z is a standard Gaussian random variable independent of all the Yi and γp = (E|Z|p )1/p . The conclusion now follows directly from Marshall and Proschan’s result (41) since t 7→ tp/2 is 11 convex for p ∈ (−1, 0) ∪ [2, ∞) and concave for p ∈ (0, 2). Notice that when the exponent 1/p is negative, the resulting norm becomes Schur concave. The result for p = 0 is proven similarly.  The derivation of sharp constants in the corresponding Khintchine inequalities is now straightforward. Corollary 23. Let X be a Gaussian mixture and X1 , . . . , Xn be independent copies of X. Then, for every p ∈ (−1, ∞) and a1 , . . . , an in R we have n n n X X X Ap ai Xi 6 (42) ai Xi , ai Xi 6 Bp 2 i=1 where ( kXk p Ap = p i=1 kXk2 , p ∈ (−1, 2) γp , p ∈ [2, ∞) and i=1 Bp = √ provided that all the moments exist. Here γp = 2  ( γp , Γ( p+1 ) √2 π kXkp kXk2 , 1/p 2 p ∈ (−1, 2) , p ∈ [2, ∞) (43) is the p-th moment of a standard Gaussian random variable. These constants are sharp. Proof. We can clearly assume that (a1 , . . . , an ) is a unit vector. We will prove the statement for p > 2; the case p ∈ (−1, 2) is identical. The Schur convexity statement of Theorem 3 along with (3) implies that n X X1 + · · · + Xn √ 6 ai Xi 6 kX1 kp . (44) n p p i=1 Applying this for a1 = · · · = an−1 = (n − 1)−1/2 and an = 0, where n > 2, shows that the quantity on the left-hand side is decreasing in n and the central limit theorem implies that n X γp kXk2 6 ai Xi 6 kXkp , p i=1 which is equivalent to γp n X i=1 ai Xi 2 6 n X ai Xi i=1 The sharpness of the constants is evident. p 6 n kXkp X ai Xi kXk2 i=1 2 .  For the proof of Corollary 4 we need to exploit two results about the geometry of Bqn which are probabilistic in nature. Let Y1 , . . . , Yn be i.i.d. random variables distributed according to µq and write Y = (Y1 , . . . , Yn ).  Pn q 1/q . As explained in the introduction, the main We denote by S the random variable i=1 |Yi | ingredient of the proof of Corollary 4 is a representation for the uniform measure on Bqn discovered in [BGMN05] that reads as follows. Let E be an exponential random variable (that is, the density of E is e−t 1t>0 ) independent of the Yi . Then the random vector   Y1 Yn , . . . , (S q + E)1/q (S q + E)1/q is uniformly distributed on Bqn . Furthermore, we will need a result of Schechtman and Zinn from [SZ90], also independently proven by Rachev and Rüschendorf in [RR91], which asserts that the random variables S and YS are independent. Proof of Corollary 4. Recall that X = (X1 , . . . , Xn ) is a random vector uniformly distributed on Bqn and let Y1 , . . . , Yn , S and E be as above. For the reader’s convenience we repeat the following 12 computation from [BGMN05]. Using the representation described before and the independence of S and YS we get n X n n X X p p 1 S Yi p . E = E E ai Xi = E a Y a i i i S (S q + E)1/q i=1 (S q + E)1/q i=1 i=1 Pn Pn p Yi p p Then, again by independence, E and thus i=1 ai S E|S| = E i=1 ai Yi E n X p p ai Xi i=1 n X p 1 S = E E ai Yi E|S|p (S q + E)1/q i=1 p = c(p, q, n)E n X p ai Yi , (45) i=1 where c(p, q, n) > 0 is independent of the vector (a1 , . . . , an ). In other words, the moments of linear functionals applied to the vector X are proportional to the moments of the same linear functionals applied to Y . In view of Theorem 3 and of the fact that Y1 , . . . , Yn are i.i.d. Gaussian mixtures, this property readily implies Corollary 4.  Similarly to Corollary 23, it is straightforward to deduce the sharp constants for Khintchine inequalities on Bqn . Corollary 24. Fix q ∈ (0, 2] and let X = (X1 , . . . , Xn ) be a random vector, uniformly distributed on Bqn . Then, for every p ∈ (−1, ∞) and a1 , . . . , an in R we have n X Ap i=1 ai Xi 2 6 n X ai Xi i=1 p 6 Bp n X ai Xi i=1 2 , (46) where ( kX 1 kp Ap = kX1 k2 , p ∈ (−1, 2) γp , p ∈ [2, ∞) and Bp = ( γp , kX1 kp kX1 k2 , p ∈ (−1, 2) p ∈ [2, ∞) (47) and for r > −1  2 1/r  r + 1 n + q − 1 1/r , B , (48) q q q > 0, independent of r, which does not affect the values of Ap , Bp . These constants kX1 kr = cq,n for some cq,n are sharp. Proof. The derivation of (47) is identical to the one in the proof of Corollary 23. To deduce (48), n−1 notice that X1 has density f (x) = cq,n (1 − |x|q ) q 1|x|61 and thus for every r > 0  Z 1 1/r  2 1/r  r + 1 n + q − 1 1/r n−1 kX1 kr = cq,n 2 xr (1 − xq ) q dx = cq,n B , , q q q 0 which completes the proof.  We now turn to comparison of entropy. Proof of Theorem 7. Let X be a Gaussian mixture and X1 , . . . , Xn independent copies of X. There exist i.i.d. positive random variables Y1 , . . . , Yn and independent standard Gaussian random variables Z1 , . . . , Zn such that Xi has the same distributionPas the product Yi Zi . For a vector n θ = (θ1 , . . . , θn ) ∈ Rn denote by Xθ the random variable i=1 θi Xi and by fθ the density √ of Xθ . Since Xθ is itself a Gaussian mixture, Theorem 2 implies that the function x 7→ fθ ( x) is completely monotonic. Consequently, there exists a measure µθ on [0, ∞) so that Z ∞ √ fθ ( x) = e−tx dµθ (t), for every x > 0. 0 13 It now immediately follows from Hölder’s inequality that for x, y > 0 and λ ∈ (0, 1) we have Z ∞ p (e−tx )λ (e−ty )1−λ dµθ (t) fθ ( λx + (1 − λ)y) = 0 1−λ λ  Z ∞ Z ∞ √ √ −tx = fθ ( x)λ fθ ( y)1−λ e−ty dµθ (t) e dµθ (t) 6 0 0 √ or, in other words, the function ϕθ (x) = − log fθ ( x) is concave. Let a = (a1 , . . . , an ), b = (b1 , . . . , bn ) ∈ Rn be such that (a21 , . . . , a2n )  (b21 , . . . , b2n ). We first consider the case of Shannon entropy, i.e. α = 1. Jensen’s inequality implies the following well known variational formula n o Ent(Xb ) = E[− log fb (Xb )] = min E[− log g(Xb )] : g : R → R+ is a probability density . (49) Thus, using (49) for g = fa we get n h X i Ent(Xb ) 6 E[− log fa (Xb )] = E − log fa bi Yi Zi i=1 n n h  X 1/2 i X  2 2 = E − log fa bi Yi Z = EZ EY ϕa b2i Yi2 Z 2 , i=1 (50) i=1 where in the last equality we used the fact that Z is independent of the Yi . Now, since (a21 , . . . , a2n ) is majorized by (b21 , . . . , b2n ), the concavity of ϕa along with Marshall and Proschan’s result (41) imply that n n X  X  2 2 2 EY ϕa bi Yi Z 6 EY ϕa a2i Yi2 Z 2 i=1 i=1 which, after averaging over Z, gives n X  2 2 2 Ent(Xb ) 6 Eϕa ai Yi Z = E[− log fa (Xa )] = Ent(Xa ). i=1 For the Rényi entropy of order α, where α > 1, we need to prove that Z Z α fa (x) dx 6 fbα (x) dx. R (51) R Notice that, as before, we can write Z n  X 1/2  faα (x) dx = Efaα−1 (Xa ) = EZ EY faα−1 a2i Yi2 Z . R (52) i=1 √ The concavity of ϕa implies that, since α > 1, the function x 7→ faα−1 ( x) = e(1−α)ϕa (x) is convex and thus from (41) we get n n  X 1/2   X 1/2  α−1 α−1 2 2 Z 6 EY fa b2i Yi2 Z EY fa ai Yi i=1 i=1 which, after integrating with respect to Z, gives Z Z n  X 1/2  α−1 α α−1 2 2 Z = Efa (Xb ) = faα−1 (x)fb (x) dx. fa (x) dx 6 Efa bi Yi R Finally, Hölder’s inequality yields Z Z  α−1  Z 1 α α α−1 α fa (x)fb (x) dx 6 fa (x) dx fbα (x) dx . R (53) R i=1 R R 14 (54) Combining (53) and (54) readily implies (51), i.e. the comparison hα (Xa ) > hα (Xb ).  Remark 25. We note that a result of similar nature was proven in the work [Yu08] of Yu, who showed that for random variables X1 , . . . , Xn the function (a1 , . . . , an ) 7→  symmetric log-concave Pnevery i.i.d. n . In particular, for every vector (a , . . . , a ) ∈ Rn such that Ent a X is Schur convex on R i i 1 n i=1 Pn |a | = 1 we have i=1 i n n 1 X  X  Ent Xi 6 Ent ai Xi 6 Ent(X1 ). (55) n i=1 i=1 The main actors in Yu’s argument are the same: the variational principle for entropy (49) and Marshall and Proschan’s comparison result (41) (the log-concavity assumption is paired up with the linear constraint on the coefficients). Finally, we proceed with the proof of Proposition 9. Proof of Proposition 9. Let X1 , X2 be independent Gaussian mixtures such that Xi has the same distribution as the product Yi Zi , for some independent positive random variables Y1 , Y2 and independent standard Gaussian random variables Z1 , Z2 . Let G be a centered Gaussian random variable independent of X1 with the same variance as X2 . Notice that X1 + X2 has the same distribution as (Y12 + Y22 )1/2 Z, whereas X1 + G has the same distribution as (Y12 + EY22 )1/2 Z, where Z is a standard Gaussian random variable independent of the Yi . Denote by f the density of X1 + X2 and by g the density of X1 + G. Using the variational formula for entropy (49) we get Ent(X1 + X2 ) = E[− log f (X1 + X2 )] 6 E[− log g(X1 + X2 )] = E(Y1 ,Z) EY2 [− log g((Y12 + Y22 )1/2 Z)]. Since X1 + G √ is also a Gaussian mixture, as remarked in the proof of Theorem 7, the function x 7→ − log g( x) is concave and thus EY2 [− log g((Y12 + Y22 )1/2 Z)] 6 − log g((Y12 + EY22 )1/2 Z). Combining the above we deduce that Ent(X1 + X2 ) 6 E[− log g((Y12 + EY22 )1/2 Z)] = E[− log g(X1 + G)] = Ent(X1 + G), which concludes the proof.  Remark 26. In light of Proposition 9, it could seem that the assumption that X1 , X2 are identically distributed in Question 10 is redundant. However, this is not the case. Let X1 , X2 be independent symmetric random variables such that X1 has a smooth density f : R → R+ and let G be an independent Gaussian random variable with the same variance as X2 . A straightforward differentiation shows that the inequality Ent(X1 + εX2 ) 6 Ent(X1 + εG) as ε → 0+ is equivalent to the comparison of the fourth order Taylor coefficients of these expressions, namely Z Z 4 (4) 4 EX2 f (x) log f (x) dx > EG f (4) (x) log f (x) dx. R R However, this inequality can easily be seen to be wrong, e.g. by taking X1 to have density function 2 2 f (x) = √x2π e−x /2 and X2 to be uniformly distributed on a symmetric interval. 15 4. The B-inequality We start by establishing a straightforward representation for products of laws of Gaussian mixtures. Let X1 , . . . , Xn be independent Gaussian mixtures (not necessarily identically distributed) so that Xi has the same distribution as the product Yi Zi , where Y1 , . . . , Yn are independent positive random variables and Z1 , . . . , Zn are independent standard Gaussian random variables. Denote by νi the law of Yi , by µi the law of Xi and by ν, µ the product measures ν1 × · · · × νn and µ1 × · · · × µn respectively. Then, for a Borel set A ⊆ Rn we have µ(A) = P((X1 , . . . , Xn ) ∈ A) = P((Y1 Z1 , . . . , Yn Zn ) ∈ A) Z ∞ Z ∞ = ··· P((y1 Z1 , . . . , yn Zn ) ∈ A) dν1 (y1 ) · · · dνn (yn ) (56) 0 0 Z = γn (∆(y1 , . . . , yn )−1 A) dν(y1 , . . . , yn ), (0,∞)n where ∆(y1 , . . . , yn ) is the diagonal matrix with entries y1 , . . . , yn . In other words, µ is an average of centered Gaussian measures on Rn . We now proceed with the proof of the B-inequality for Gaussian mixtures. Proof of Theorem 12. Let X1 , . . . , Xn be as in the statement of the theorem and denote by hi the density of Yi . Clearly, the log-concavity of the random variable log Yi is equivalent to the log-concavity of the function s 7→ hi (e−s ) on R. Let K ⊆ Rn be a symmetric convex set and (t1 , . . . , tn ) ∈ Rn . Then, by (56) and the change of variables yi = e−si we have Z t1 tn γn (∆(y1−1 et1 , . . . , yn−1 etn )K)h1 (y1 ) · · · hn (yn ) dy µ(∆(e , . . . , e )K) = n (0,∞) (57) Z P s1 +t1 sn +tn −s1 −sn − n si i=1 = γn (∆(e ,...,e )K)h1 (e ) · · · hn (e )e ds. Rn The B-inequality for Gaussian measure (Theorem 11) immediately implies that the function Rn × Rn 3 (s, t) 7−→ γn (∆(es1 +t1 , . . . , esn +tn )K) is log-concave on Rn × Rn . Consequently, the integrand in (57) is a log-concave function of (s, t) ∈ Rn × Rn as a product of log-concave functions. The result now follows from the PrékopaLeindler inequality (see, e.g., [AAGM15, Theorem 1.4.1]) which implies that marginals of logconcave functions are log-concave (see also [GNT14, Theorem 3.15]).  Remark 27. An inspection of the proof of Theorem 12 shows that the same argument also yields the B-inequality for rotationally invariant measures of the form dµ(x) = f (kxk2 ) dx, where f is proportional to the density of a Gaussian mixture that satisfies the assumption of Theorem 12. Checking whether a particular Gaussian mixture X satisfies the assumption of Theorem 12 might be non-trivial, since one has to know the distribution of the positive factor Y occurring in its representation. However, by Lemma 21, we know this factor for random variables with densities p proportional to e−|t| and for symmetric p-stable random variables, where p ∈ (0, 2). This allows us to determine the values of p ∈ (0, 2) for which the assumption is satisfied, for each of these random variables. To this end, denote, as before, by gα the density of a standard positive α-stable random variable, α ∈ (0, 1). Recall that the positive factor in the representation of a standard symmetric p-stable random variable is (2Wp/2 )1/2 , where Wp/2 is a standard positive p/2-stable random variable. Thus, the assumption of Theorem 12 is equivalent to the log-concavity of the function s 7→ gp/2 (e−s ) on R. On the other hand, the corresponding factor in the representation of the random variable p with density cp e−|t| is of the form (2Vp/2 )−1/2 where Vp/2 has density proportional to t−1/2 gp/2 (t). 16 Therefore, the corresponding assumption in this case is again equivalent to the log-concavity of s 7→ gp/2 (e−s ) on R, since the remaining factor es/2 is log-affine. If X is a random variable with density g : R → R+ , the log-concavity of s 7→ g(e−s ) is referred in the literature as multiplicative strong unimodality of X. The multiplicative strong unimodality of positive α-stable distributions has been studied by Simon in [Sim11], who proved that such a random variable has this property if and only if α 6 1/2. Combining this with the above observations and Theorem 12 we deduce the following. p Corollary 28. For every p ∈ (0, 1] the product measure on Rn with density proportional to e−kxkp and the symmetric p-stable product measure on Rn satisfy the B-inequality for every symmetric convex set K ⊆ Rn . We now turn to the proof of the small ball estimate for the symmetric exponential measure (Corollary 13) described in the introduction. The argument is very similar to the one in [LO05]. Proof of Corollary 13. Let K ⊆ Rn be a symmetric convex set such that µn1 (K) 6 1/2 and we denote by r = r(K) the inradius of K. For a set A ⊆ Rn and h > 0 we also denote by Ah the h-enlargement of A, that is, Ah = A+hB2n . Notice that for s ∈ (0, 1) we have (sK)∩(K c )(1−s)r = ∅, where K c is the complement of K, and thus µn1 (sK) 6 1 − µn1 ((K c )(1−s)r ). (58) µn1 (K) µn1 (K c ) Now, choose u > 0 such that = µ1 ((u, ∞)) or, equivalently, = µ1 ((−u, ∞)). Bobkov n and Houdré proved in [BH97] that if A ⊆ R is a Borel set and x ∈ R is such that µn1 (A) = µ1 ((x, ∞)), then for every h > 0 we have   h (59) µn1 (Ah ) > µ1 x − √ , ∞ . 2 6 Combining (58) and (59) we get     s−1 (1 − s)r (1 − s)r √ r(K) n √ , ∞ = µ1 u + √ , ∞ = e2 6 µn1 (sK) 6 1 − µ1 − u − µ1 (K). (60) 2 6 2 6 log s For 0 < t 6 s 6 1 we can write s = t log t and the B-inequality for µn1 implies that log s µn1 (tK) log t µn1 (K) s 1− log log t 6 µn1 (sK), or equivalently µn1 (tK) 6 µn1 (K) which, in view of (60), gives the estimate  s−1 √ · log t r(K) 6 log s µn1 (tK) 6 e 2 µn1 (sK) µn1 (K)  log t log s , r(K) s−1 √ · 6 log s µn1 (K) = t 2 (61) µn1 (K). Taking the limit s → 1− we finally deduce that r(K) √ 6 µn1 (tK) 6 t 2 for every t ∈ [0, 1], which concludes the proof. µn1 (K),  Remark 29. In [PV16a], Paouris and Valettas proved a different small ball probability estimate for the symmetric exponential measure and any unconditional convex body K in terms of the global parameter β(K) = VarkW kK /m(K)2 , where W is distributed according to µn1 and m(K) is the median of k · kK with respect to µn1 . Their result is in the spirit of the work [KV07] of Klartag and Vershynin. In the follow-up paper [PV16b], they showed that a similar estimate holds for every unconditional log-concave measure and unconditional convex body K with a worse dependence on 17 β(K). In the particular case of the symmetric exponential measure the unconditionality assumption in the suboptimal estimate from [PV16b] can be omitted, because of Corollary 28. We would like to remark that Theorem 12 combined with a result of Marsiglietti, [Mar16, Proposition 3.1], immediately implies the following corollary. Corollary 30. Let µ be as in Theorem 12. Then, for every symmetric convex set K ⊆ Rn the function t 7→ µ(tK) is n1 -concave for t > 0, that is 1/n µ (λt + (1 − λ)s)K > λµ(tK)1/n + (1 − λ)µ(sK)1/n , (62) for every t, s > 0 and λ ∈ (0, 1). 5. Correlation inequalities To prove the correlation inequality for Gaussian mixtures (Theorem 15) we will use Royen’s Gaussian correlation inequality (Theorem 14), along with a simple lemma for the standard Gaussian measure. Recall that we write ∆(y) = ∆(y1 , . . . , yn ) for the diagonal n × n matrix with diagonal y = (y1 , . . . , yn ).  Lemma 31. Let K be a symmetric convex set in Rn . Then the function t 7→ γn ∆(t, 1, . . . , 1)K is nondecreasing for t > 0. Proof. It clearly suffices to consider the case when K has nonempty interior. We will prove that the function ψ(x) = log γn ∆(ex , 1, . . . , 1)K is nondecreasing on the real line. By virtue of the B-inequality for the standard Gaussian measure (Theorem 11), ψ is concave. To verify that ψ is nondecreasing, it is enough to prove that limx→∞ ψ(x) > −∞. Take δ > 0 such that [−δ, δ]n ⊆ K. For every real number x we have ψ(x) > log γn ([−ex δ, ex δ] × [−δ, δ]n−1 ), which, for x → ∞, gives lim ψ(x) > log γn (R × [−δ, δ]n−1 ) > −∞. x→∞ This concludes the proof of the lemma.  Proof of Theorem 15. Let µ be a product of laws of Gaussian mixtures. According to (56) for every Borel set A ⊆ Rn we have Z µ(A) = γn (∆(y)−1 A) dν1 (y1 ) · · · dνn (yn ), (0,∞)n for some probability measures ν1 , . . . , νn on (0, ∞). Let K, L ⊆ Rn be symmetric convex sets. The Gaussian correlation inequality yields Z µ(K ∩ L) = γn (∆(y)−1 K ∩ ∆(y)−1 L) dν1 (y1 ) · · · dνn (yn ) n (0,∞) Z (63) > γn (∆(y)−1 K)γn (∆(y)−1 L) dν1 (y1 ) · · · dνn (yn ). (0,∞)n Fix y1 , . . . , yn−1 > 0. Lemma 31 implies that the functions yn 7→ γn (∆(y)−1 K) and yn 7→ γn (∆(y)−1 L) are nonincreasing on (0, ∞). Consequently, combining (63) and Chebyshev’s integral inequality (see, e.g., [HLP88, p. 168]) for the probability measure νn , we get µ(K ∩ L) > Z (0,∞)n−1 Z 0 ∞ γn (∆(y) −1 ∞  Z K) dνn (yn ) 0 18  γn (∆(y)−1 L) dνn (yn ) dν1 (y1 ) · · · dνn−1 (yn−1 ). After iteratively applying Chebyshev’s inequality to ν1 , . . . , νn−1 we finally deduce that Z Z −1 γn (∆(y)−1 L) dν1 (y1 ) · · · dνn (yn ) γn (∆(y) K) dν1 (y1 ) · · · dνn (yn ) · µ(K ∩ L) > (0,∞)n (0,∞)n = µ(K)µ(L), which is the correlation inequality (26).  Remark 32. Similarly to the B-inequality, an inspection of the proof of Theorem 15 reveals that the same argument also gives the correlation inequality for rotationally invariant probability measures of the form dµ(x) = f (kxk2 ) dx, where f is proportional to the density of a Gaussian mixture. Recall that a function f : Rn → R+ is called quasiconcave if for any t > 0 the set At = {x ∈ Rn : f (x) > t} is convex. Writing Z ∞ f (x) = 1At (x) dt, x ∈ R, 0 one can immediately see that if a measure µ satisfies the correlation inequality (26) for any symmetric convex sets K, L ⊆ Rn then for every symmetric quasiconcave functions f, g : Rn → R+ we have Z Z Z f (x)g(x) dµ(x) > f (x) dµ(x) · g(x) dµ(x). (64) Rn Rn Rn Correlation inequalities of the form (64) were treated by Koldobsky and Montgomery-Smith in [KMS96] for another class of functions when µ is a general symmetric stable measure on Rn . Recall that the law µ of a random vector X in Rn is called a symmetric p-stable measure if every marginal hX, ai, a ∈ Rn , is a symmetric p-stable random variable. It is a well known fact (see, e.g., [Wer84, p. 312]) that symmetric p-stable random vectors X = (X1 , . . . , Xn ) in Rn are in one-to-one correspondence with finite measures mX on the unit sphere S n−1 such that n n  X   Z  X p E exp i aj Xj = exp − aj xj dmX (x) , (65) S n−1 j=1 j=1 for every a1 , . . . , an ∈ R. We will argue that the correlation inequality (26) holds for the law µ of any symmetric p-stable random vector X in Rn . Assume first that the corresponding measure mX on S n−1 has a finite support, namely supp(mX ) = {y1 , . . . , y` }, and let Y be a standard `dimensional symmetric p-stable random vector with independent coordinates. In this case, one can find θ1 , . . . , θn ∈ R` such that Xj has the same distribution as hY, θj i or, in other words, X is a linear image of Y and the correlation inequality (26) immediately follows. For a general measure mX on S n−1 there exists a sequence of finitely supported measures m` that converges to mX in the weak* topology (e.g. by the Krein-Milman theorem) which means, by (65), that the corresponding p-stable random vectors X` converge to X in distribution. Note that to prove the correlation inequality (26) for a symmetric p-stable measure µ on Rn , it suffices to consider the case when K, L ⊆ Rn are convex polytopes, which are sets whose boundaries are contained in a finite union of affine hyperplanes. However, any affine hyperplane is of µ-measure zero, since the one-dimensional marginals of µ are p-stable, thus continuous. Therefore, the convergence in distribution concludes the proof of the following corollary. Corollary 33. Let µ be a symmetric p-stable measure on Rn . Then for every symmetric convex sets K, L ⊆ Rn we have µ(K ∩ L) > µ(K)µ(L). This corollary implies inequalities of the form (64), analogous to the ones proven in [KMS96]. n+1 It also implies that the multivariate Cauchy distribution, defined as dµ(x) = cn (1 + kxk22 )− 2 dx, satisfies the correlation inequality (26). Notice that this also follows from Remark 32. In [Mem15], 19 the author showed that this is actually equivalent to Corollary 16. We reproduce his argument below. Proof of Corollary 16. Consider the hyperplane Rn−1 ≡ Rn−1 × {0} ⊆ Rn and let S ⊆ Rn be the sphere of radius 1 centered at en = (0, . . . , 0, 1). Denote by S+ the open lower hemisphere of S, i.e. S+ = {x ∈ S : xn < 1}, and define a bijection q : S+ → Rn−1 by the formula q(x) = the point of Rn−1 which lies on the line joining x to en . (66) One can easily check that closed arcs of great circles on S+ are mapped to line segments on Rn−1 and vice versa, which immediately implies that geodesically convex sets in S+ are in one-to-one correspondence with convex sets in Rn−1 . Moreover, since q(0) = 0, symmetry in Rn−1 agrees with geodesic symmetry in S+ . Denoting by µ the push-forward under q of the normalized surface area measure on S+ , we get that for every r > 0, µ satisfies the identity µ(rB2n−1 ) = |BS n−1 (arctan r)| , |S+ | where BS n−1 (θ) is a spherical cap of radius θ on S n−1 . A simple computation for the volume of spherical caps along with the rotational invariance of µ shows that µ is precisely the law of the multivariate Cauchy distribution on the hyperplane Rn−1 . Therefore, for two symmetric geodesically convex sets K, L ⊆ S+ , the multivariate Cauchy correlation inequality for the symmetric convex sets q(K), q(L) ⊆ Rn−1 implies that |K| |L| |K ∩ L| = µ(q(K ∩ L)) = µ(q(K) ∩ q(L)) > µ(q(K)) · µ(q(L)) = · , |S+ | |S+ | |S+ | which completes the proof of the corollary.  Remark 34. It is a straightforward consequence of Theorem 15 that the product probability measure p µnp with density cnp e−kxkp satisfies the correlation inequality (26) for every p ∈ (0, 2] and n > 1. It turns out that this is the exact range of p > 0 for which this property holds. To see this, take δ > 0 and consider the symmetric strips Kδ = {(x, y) ∈ R2 : |x − y| 6 δ} and Lδ = {(x, y) ∈ R2 : |x + y| 6 δ} on the plane. We will show that µ2p (Kδ ∩ Lδ ) < µ2p (Kδ )µ2p (Lδ ) for p > 2 and small enough δ > 0. Indeed, a straightforward differentiation yields that the Taylor expansions of these two quantities around δ = 0 are 1− p2 2 µ2p (Kδ ∩ Lδ ) = 4c2p δ 2 + o(δ 3 ) and µ2p (Kδ )µ2p (Lδ ) = 4c2p 2 δ + o(δ 3 ) 1− 2 and since 1 < 2 p for p > 2, the correlation inequality (26) cannot hold for small enough δ > 0. A computation along the same lines together with Remark 32 prove that a similar behavior is p exhibited by the rotationally invariant probability measures with densities proportional to e−kxk2 : they satisfy (26) if and only if p ∈ (0, 2]. 6. Sections and projections of Bqn revisited In this section we derive the comparison results for geometric parameters of hyperplane sections and projections of the balls Bqn described in the introduction. First, let us explain how the comparison of the aforementioned Gaussian parameters (Theorem 19) implies the comparison of volume (Corollary 18) and mean width (Corollary 20), following [BGMN05]. Proof of Corollaries 18 and 20. Fix q ∈ (0, 2) and let a = (a1 , . . . , an ), b = (b1 , . . . , bn ) ∈ Rn be unit vectors such that (a21 , . . . , a2n )  (b21 , . . . , b2n ). Recall that Ga , Gb are standard Gaussian random 20 vectors on the hyperplanes a⊥ and b⊥ respectively. According to Theorem 19, for every λ > 0 we have q q −λkGa k n −λkGb k ⊥ n ⊥ Bq ∩a Bq ∩b Ee 6 Ee . Integrating this inequality with respect to λ and any measure µ on (0, ∞) we deduce that Z ∞ Z ∞ −λkGa kq n ⊥ −λkGb kq n ⊥ Bq ∩a Bq ∩b e e E dµ(λ) 6 E dµ(λ), 0 0 which, by Bernstein’s theorem, is equivalent to the validity of the inequality Eg(kGa kqB n ∩a⊥ ) 6 Eg(kGb kqB n ∩b⊥ ) q (67) q for every completely monotonic function g : (0, ∞) → R. In particular, choosing g(s) = s−α/q , we get that , 6 EkGb k−α EkGa k−α B n ∩b⊥ B n ∩a⊥ q q provided that 0 < α < n − 1 so that the integrals are finite. Integration in polar coordinates now shows that for every 0 < α < n − 1 we have Z Z dσb (θ), (68) dσ (θ) 6 kθk−α kθk−α a B n ∩b⊥ B n ∩a⊥ q S(a⊥ ) q S(b⊥ ) where σa , σb are the rotationally invariant probability measures on the unit spheres S(a⊥ ), S(b⊥ ) of the hyperplanes a⊥ and b⊥ , respectively. Letting α → n − 1 in (68) along with the identity Z |K| , (69) kθk−m K dσ(θ) = |B2m | S m−1 which holds for every symmetric convex body K in Rm , imply that |Bqn ∩ a⊥ | 6 |Bqn ∩ b⊥ | and Corollary 18 follows. β Furthermore, applying (67) to g(s) = e−λs , where β ∈ (0, 1] and λ > 0, we have −λkGa kβqn Ee Bq ∩a⊥ −λkGb kβqn Bq ∩b⊥ 6 Ee . Since both sides, as functions of λ > 0, are equal at λ = 0 we deduce that their derivatives at λ = 0 also satisfy the same inequality, that is , 6 EkGa kβq EkGb kβq B n ∩a⊥ B n ∩b⊥ q q for every β ∈ (0, 1]. Choosing β = 1/q and integrating in polar coordinates yields Z Z kθkBqn ∩b⊥ dσb (θ) 6 kθkBqn ∩a⊥ dσa (θ). S(b⊥ ) (70) S(a⊥ ) Recall that for a symmetric convex body K in Rm , the polar body K o of K is defined to be K o = {x ∈ Rm : hx, yi 6 1 for every y ∈ K} and if k · kK o is the norm associated with K o then kθkK o = hK (θ) for every θ ∈ S n−1 . Thus, combining (70) with the well known identity Bqn ∩ H = (ProjH (Bqn∗ ))o , where q ∗ > 2 is such that 1q + q1∗ = 1, we deduce that w(Projb⊥ (Bqn∗ )) 6 w(Proja⊥ (Bqn∗ )). (71) In particular, for every hyperplane H ⊆ Rn we obtain w(ProjH1 (Bqn∗ )) 6 w(ProjH (Bqn∗ )) 6 w(ProjHn (Bqn∗ )), where H1 = (1, 0, . . . , 0)⊥ and Hn = (1, . . . , 1)⊥ . This concludes the proof of Corollary 20. We finally proceed with the proof of Theorem 19. 21  Proof of Theorem 19. Fix q ∈ (0, 2). For a hyperplane H = a⊥ , where a = (a1 , . . . , an ) ∈ Rn is a unit vector, let Ga be a standard Gaussian random vector on a⊥ and denote by H(ε) the set H(ε) = {x ∈ Rn : |hx, ai| < ε}. (72) To proceed, we will need a representation from [BGMN05, Lemma 14] for the Laplace transforms of kGa kqBqn ∩H that reads as follows. For every λ > 0 there exist constants α(q, λ), β(q, λ) > 0 and c(q, λ, n) > 0 such that for every hyperplane H = a⊥ , a = (a1 , . . . , an ) ∈ S n−1 , we have 1 n −λkGa kqB n ∩H q Ee = c(q, λ, n) lim µq,λ (H(ε)), + ε→0 2ε where the probability measure µq,λ on R is of the form dµq,λ (t) = e−α(q,λ)|t| q −β(q,λ)t2 dt (73) (74) and µnq,λ = µ⊗n q,λ . An immediate application of Theorem 2 yields that µq,λ is the law of a Gaussian mixture. Thus, by (56) there exists a probability measure ν = ν(q, λ) on (0, ∞) such that if A ⊆ Rn is a Borel set, then Z µnq,λ (A) = γn (∆(y)−1 A) dνn (y), (0,∞)n where νn = ν ⊗n . Notice that for the symmetric strip (72) we have n n o X −1 n ∆(y) H(ε) = x ∈ R : aj yj xj < ε , j=1  Pn 2 2 −1/2 ε. Consequently, the that is, ∆(y)−1 H(ε) is also a symmetric strip of width j=1 aj yj rotational invariance of the Gaussian measure implies that Z n  X −1/2  Ψ µnq,λ (H(ε)) = 2 a2j yj2 ε dνn (y), (75) (0,∞)n where Ψ(s) = √1 2π Rs e−x j=1 2 /2 dx. Combining (73) and (75) we deduce that Z n  X −1/2  1 −λkGa kqB n ∩H −1 q Ψ c(q, λ, n) · Ee = lim a2j yj2 ε dνn (y) ε→0+ ε (0,∞)n j=1 Z n  X −1/2  d Ψ a2j yj2 = ε dνn (y) (0,∞)n dε ε=0 j=1 Z n n X −1/2 1  X 2 2 −1/2 1 a2j yj2 dνn (y) = √ E aj Yj , =√ 2π (0,∞)n j=1 2π j=1 0 where Y1 , . . . , Yn are i.i.d. random variables distributed according to ν. To verify the assumptions of the dominated convergence theorem for the swap of the limit and integration in the second  Pn 2 2 −1/2 ∈ L (ν ), since Ψ(s) 6 √s equality, it suffices to check that for s > 0. This 1 n j=1 aj yj 2π immediately follows by Fatou’s lemma, that is Z n X −1/2 √ √ 1 −λkGa kqB n ∩H q a2j yj2 dνn (y) 6 2π lim inf µnq,λ (H(ε)) = 2πc(q, λ, n)−1 Ee < ∞. ε→0+ 2ε (0,∞)n j=1 Now, since t 7→ t−1/2 is a convex function on (0, ∞) and Y1 , . . . , Yn are i.i.d. random variables, Marshall and Proschan’s result (41) implies the comparison (34), as required.  22 We note that the crucial identity (75) can also be proven in purely probabilistic terms. Let X1 , . . . , Xn be i.i.d. random variables distributed according to µq,λ and take i.i.d. positive random variables Y1 , . . . , Yn and standard Gaussian random variables Z1 , . . . , Zn such that Xi has the same distribution as the product Yi Zi . Then we have n n    X 1/2  X <ε a2j Yj2 µnq,λ (H(ε)) = EY PZ aj Yj Zj < ε = EY PZ |Z| j=1 j=1  = EY PZ |Z| < n X a2j Yj2 n h  X −1/2 i −1/2  ε , ε = 2E Ψ a2j Yj2 j=1 j=1 where Z is a standard Gaussian random variable, independent of the Yi . Remark 35. A similar approach also yields a direct proof of Corollary 18. The crucial ingredient in this case would be an identity from [MP88] instead of (73). They proved that there exists a constant c(q, n) > 0 such that if H ⊆ Rn is any hyperplane and H(ε) is defined by (72), then 1 n |Bqn ∩ H| = c(q, n) lim µq (H(ε)), (76) + ε→0 2ε q where µnq is the measure on Rn with density proportional to e−kxkq . Since this measure is also a product of laws of i.i.d. Gaussian mixtures the preceding argument works identically. In [KZ03], Koldobsky and Zymonopoulou investigated extremal volumes of sections of the complex `q -balls Bqn (C), which can also be treated by the approach presented above. From now on we will adopt the obvious identification of Cn with R2n without further ado. We will denote by h·, ·i the standard Hermitian inner product on Cn and for a vector ζ ∈ Cn we will write ζ ⊥ for the complex hyperplane orthogonal to ζ. Recall that for a vector z = (x1 , y1 , . . . , xn , yn ) ∈ R2n we denote n n X 1/q  X 1/q 2 2 q/2 kzk`nq (C) = (xj + yj ) = |zj |q , j=1 j=1 where zj = xj + iyj , and = {z ∈ : kzk`nq (C) 6 1}. Let Hn = ξ ⊥ be any complex hyperplane such that |ξ1 | = · · · = |ξn | and H1 = η ⊥ be such that ηj = 0 for j > 2, where ξ = (ξ1 , . . . , ξn ), η = (η1 , . . . , ηn ) ∈ Cn . In [KZ03], the authors proved that for any q ∈ (0, 2) and any complex hyperplane H ⊆ Cn the inequalities Bqn (C) R2n |Bqn (C) ∩ Hn | 6 |Bqn (C) ∩ H| 6 |Bqn (C) ∩ H1 | (77) hold true. We will sketch an alternative proof of their result, similar to the proof of Theorem 19. For a complex hyperplane H = ζ ⊥ , where ζ ∈ Cn , and ε > 0 denote by Hcyl (ε) the cylinder Hcyl (ε) = {z ∈ Cn : |hz, ζi| < ε}. (78) One can prove (see also [MP88, Corollary 2.5]) that there exists a constant c(q, n) > 0 such that for every complex hyperplane H ⊆ Cn we have 1 (79) |Bqn (C) ∩ H| = c(q, n) lim 2 τqn (Hcyl (ε)), ε→0 ε where the measure τqn on R2n is of the form dτqn (x, y) = cnq e− Writing e−s in the form q/2 = R∞ 0 Pn 2 2 q/2 j=1 (xj +yj ) dx dy. e−ts dµ(t) for some measure µ, we deduce that the density of τqn can be written Z P Pn 2 2 − n (x2j +yj2 )q/2 j=1 e = e− j=1 tj (xj +yj ) dµn (t), (0,∞)n 23 where µn = µ⊗n . Therefore, an application of Fubini’s theorem and a change of variables imply that there exists a measure ν on (0, ∞) such that for νn = ν ⊗n and for every Borel set A ⊆ R2n we can write Z n τq (A) = γ2n (∆(y1 , y1 , . . . , yn , yn )−1 A) dνn (y), (80) (0,∞)n where each coordinate of y = (y1 , . . . , yn ) is repeated twice. Notice that the image n n o X ∆(y1 , y1 , . . . , yn , yn )−1 Hcyl (ε) = z ∈ Cn : ζj yj zj < ε j=1  2 −1/2 Pn 2 is still a cylinder in Cn with radius ε. Thus, the unitary invariance of complex j=1 |ζj | yj Gaussian measure and a simple calculation in polar coordinates imply that n  1 X −1  −1 ε2 . (81) γ2n (∆(y1 , y1 , . . . , yn , yn ) Hcyl (ε)) = 1 − exp − |ζj |2 yj2 2 j=1 After interchanging limit and integration in (79) and using (80), (81) we deduce that Z n n X −1 −1 c(q, n) c(q, n)  X n 2 2 |Bq (C) ∩ H| = · |ζj | yj ·E dνn (y) = |ζj |2 Yj2 , 2 2 (0,∞)n j=1 j=1 where Y1 , . . . , Yn are i.i.d. random variables distributed according to ν. This yields (77) as well as a more general comparison result, similar to Corollary 18, by a direct application of Marshall and Proschan’s result (41).  We note that, in view of Ball’s theorem from [Bal86], a Schur monotonicity result for the volume of sections of Bqn cannot hold in any fixed dimension n > 2 and q large enough. Similarly, according to Szarek’s result from [Sza76], the same can be said for the volume of projections of Bqn for values close to q = 1. Finally, we want to stress that a careful look in the previous works [BN02], [Kol98] and [KZ03] reveals that, even though not stated explicitly, the Schur monotonicity for the volume was established there as well. The new aspect here is the replacement of representations which were Fourier-analytic in flavor by others that exploit the rotational invariance of the Gaussian measure. Acknowledgements. We would like to thank Apostolos Giannopoulos for providing several useful references and Petros Valettas for his comments regarding Remark 29. We are also very grateful to Assaf Naor for many helpful discussions. References [AAGM15] S. Artstein-Avidan, A. Giannopoulos, and V. D. Milman. Asymptotic geometric analysis. Part I, volume 202 of Mathematical Surveys and Monographs. American Mathematical Society, Providence, RI, 2015. [ABBN04] S. Artstein, K. M. Ball, F. Barthe, and A. Naor. Solution of Shannon’s problem on the monotonicity of entropy. J. Amer. Math. Soc., 17(4):975–982 (electronic), 2004. [AK01] S. Arora and R. Kannan. Learning mixtures of arbitrary Gaussians. In Proceedings of the Thirty-Third Annual ACM Symposium on Theory of Computing, pages 247–257. ACM, New York, 2001. [Bal86] K. Ball. Cube slicing in Rn . Proc. Amer. Math. Soc., 97(3):465–473, 1986. [BC02] A. Baernstein, II and R. C. Culverhouse. Majorization of sequences, sharp vector Khinchin inequalities, and bisubharmonic functions. Studia Math., 152(3):231–248, 2002. [BC15] S. G. Bobkov and G. P. Chistyakov. Entropy power inequality for the Rényi entropy. IEEE Trans. Inform. Theory, 61(2):708–714, 2015. [BGMN05] F. Barthe, O. Guédon, S. Mendelson, and A. Naor. A probabilistic approach to the geometry of the lpn -ball. Ann. Probab., 33(2):480–513, 2005. [BH96] S. G. Bobkov and C. Houdré. Characterization of Gaussian measures in terms of the isoperimetric property of half-spaces. Zap. Nauchn. Sem. S.-Peterburg. Otdel. Mat. Inst. Steklov. (POMI), 228(Veroyatn. i Stat. 1):31–38, 356, 1996. 24 [BH97] S. G. Bobkov and C. Houdré. Isoperimetric constants for product probability measures. Ann. Probab., 25(1):184–205, 1997. [BLYZ12] K. J. Böröczky, E. Lutwak, D. Yang, and G. Zhang. The log-Brunn-Minkowski inequality. Adv. Math., 231(3-4):1974–1997, 2012. [BN02] F. Barthe and A. Naor. Hyperplane projections of the unit ball of lpn . Discrete Comput. Geom., 27(2):215– 226, 2002. [BNT16] K. Ball, P. Nayar, and T. Tkocz. A reverse entropy power inequality for log-concave random vectors. Studia Math., 235(1):17–30, 2016. [CEFM04] D. Cordero-Erausquin, M. Fradelizi, and B. Maurey. The (B) conjecture for the Gaussian measure of dilates of symmetric convex sets and related problems. J. Funct. Anal., 214(2):410–427, 2004. [Das99] S. Dasgupta. Learning mixtures of Gaussians. In 40th Annual Symposium on Foundations of Computer Science (New York, 1999), pages 634–644. IEEE Computer Soc., Los Alamitos, CA, 1999. [Fel71] W. Feller. An introduction to probability theory and its applications. Vol. II. Second edition. John Wiley & Sons, Inc., New York-London-Sydney, 1971. [GL10] N. Gozlan and C. Léonard. Transport inequalities. A survey. Markov Process. Related Fields, 16(4):635– 736, 2010. [GNT14] O. Guédon, P. Nayar, and T. Tkocz. Concentration inequalities and geometry of convex bodies. In Analytical and probabilistic methods in the geometry of convex bodies, volume 2 of IMPAN Lect. Notes, pages 9–86. Polish Acad. Sci. Inst. Math., Warsaw, 2014. [Haa81] U. Haagerup. The best constants in the Khintchine inequality. Studia Math., 70(3):231–283 (1982), 1981. [HLP88] G. H. Hardy, J. E. Littlewood, and G. Pólya. Inequalities. Cambridge Mathematical Library. Cambridge University Press, Cambridge, 1988. Reprint of the 1952 edition. [KMS96] A. L. Koldobsky and S. J. Montgomery-Smith. Inequalities of correlation type for symmetric stable random vectors. Statist. Probab. Lett., 28(1):91–97, 1996. [Kol98] A. Koldobsky. An application of the Fourier transform to sections of star bodies. Israel J. Math., 106:157– 164, 1998. [Kol05] A. Koldobsky. Fourier analysis in convex geometry, volume 116 of Mathematical Surveys and Monographs. American Mathematical Society, Providence, RI, 2005. [Kön14] H. König. On the best constants in the Khintchine inequality for Steinhaus variables. Israel J. Math., 203(1):23–57, 2014. [KV07] B. Klartag and R. Vershynin. Small ball probability and Dvoretzky’s theorem. Israel J. Math., 157:193– 207, 2007. [KZ03] A. Koldobsky and M. Zymonopoulou. Extremal sections of complex lp -balls, 0 < p 6 2. Studia Math., 159(2):185–194, 2003. [Lat02] R. Latala. On some inequalities for Gaussian measures. In Proceedings of the International Congress of Mathematicians, Vol. II (Beijing, 2002), pages 813–822. Higher Ed. Press, Beijing, 2002. [LBo14] A. Livne Bar-on. The (B) conjecture for uniform measures in the plane. In Geometric aspects of functional analysis, volume 2116 of Lecture Notes in Math., pages 341–353. Springer, Cham, 2014. [Lie78] E. H. Lieb. Proof of an entropy conjecture of Wehrl. Comm. Math. Phys., 62(1):35–41, 1978. [LM15] R. Latala and D. Matlak. Royen’s proof of the gaussian correlation inequality. Preprint, available at http://arxiv.org/abs/1512.08776, 2015. [LO95] R. Latala and K. Oleszkiewicz. A note on sums of independent uniformly distributed random variables. Colloq. Math., 68(2):197–206, 1995. [LO05] R. Latala and K. Oleszkiewicz. Small ball probability estimates in terms of widths. Studia Math., 169(3):305–314, 2005. [Mar16] A. Marsiglietti. On the improvement of concavity of convex measures. Proc. Amer. Math. Soc., 144(2):775– 786, 2016. [Mem15] Y. Memarian. On a correlation inequality for Cauchy type measures. New Zealand J. Math., 45:53–64, 2015. [MO79] A. W. Marshall and I. Olkin. Inequalities: theory of majorization and its applications, volume 143 of Mathematics in Science and Engineering. Academic Press, Inc. [Harcourt Brace Jovanovich, Publishers], New York-London, 1979. [MP65] A. W. Marshall and F. Proschan. An inequality for convex functions involving majorization. J. Math. Anal. Appl., 12:87–90, 1965. [MP88] M. Meyer and A. Pajor. Sections of the unit ball of lpn . J. Funct. Anal., 80(1):109–123, 1988. [PV16a] G. Paouris and P. Valettas. A small deviation inequality for convex functions. Preprint, available at http://arxiv.org/abs/1611.01723, 2016. [PV16b] G. Paouris and P. Valettas. Variance estimates and almost Euclidean structure. Preprint, 2016. 25 [Roy14] [RR91] [Sar15] [Sar16] [Sim11] [Sta59] [SW49] [SZ90] [Sza76] [Wer84] [Whi60] [Yu08] T. Royen. A simple proof of the Gaussian correlation conjecture extended to some multivariate gamma distributions. Far East J. Theor. Stat., 48(2):139–145, 2014. S. T. Rachev and L. Rüschendorf. Approximate independence of distributions on spheres and their stability properties. Ann. Probab., 19(3):1311–1337, 1991. C. Saroglou. Remarks on the conjectured log-Brunn-Minkowski inequality. Geom. Dedicata, 177:353–365, 2015. C. Saroglou. More on logarithmic sums of convex bodies. Mathematika, 62(3):818–841, 2016. T. Simon. Multiplicative strong unimodality for positive stable laws. Proc. Amer. Math. Soc., 139(7):2587– 2595, 2011. A. J. Stam. Some inequalities satisfied by the quantities of information of Fisher and Shannon. Information and Control, 2:101–112, 1959. C. E. Shannon and W. Weaver. The Mathematical Theory of Communication. The University of Illinois Press, Urbana, Ill., 1949. G. Schechtman and J. Zinn. On the volume of the intersection of two Ln p balls. Proc. Amer. Math. Soc., 110(1):217–224, 1990. S. J. Szarek. On the best constants in the Khinchin inequality. Studia Math., 58(2):197–208, 1976. A. Weron. Stable processes and measures: a survey. In Probability theory on vector spaces, III (Lublin, 1983), volume 1080 of Lecture Notes in Math., pages 306–364. Springer, Berlin, 1984. P. Whittle. Bounds for the moments of linear and quadratic forms in independent variables. Teor. Verojatnost. i Primenen., 5:331–335, 1960. Y. Yu. Letter to the editor: On an inequality of Karlin and Rinott concerning weighted sums of i.i.d. random variables. Adv. in Appl. Probab., 40(4):1223–1226, 2008. (A. E.) Mathematics Department, Princeton University, Fine Hall, Washington Road, Princeton, NJ 08544-1000, USA E-mail address: [email protected] (P. N.) Wharton Statistics Department, University of Pennsylvania, 3730 Walnut St, Philadelphia, PA 19104, USA E-mail address: [email protected] (T.T.) Mathematics Department, Princeton University, Fine Hall, Washington Road, Princeton, NJ 08544-1000, USA E-mail address: [email protected] 26
7cs.IT
1 Theoretical Bounds and Constructions of Codes in the Generalized Cayley Metric arXiv:1803.04314v1 [cs.IT] 12 Mar 2018 Siyi Yang, Student Memeber, IEEE, Clayton Schoeny, Student Memeber, IEEE, and Lara Dolecek, Senior Membor, IEEE Abstract—Permutation codes have recently garnered substantial research interest due to their potential in various applications including cloud storage systems, genome resequencing and flash memories. In this paper, we study the theoretical bounds and constructions of permutation codes in the generalized Cayley metric. The generalized Cayley metric captures the number of generalized transposition errors in a permutation, and subsumes previously studied error types, including transpositions and translocations, without imposing restrictions on the lengths and positions of the translocated segments. Relying on the breakpoint analysis proposed by Chee and Vu, we first propose a coding scheme that is order-optimal albeit not constructive based on this method. We then develop another construction of permutation codes in the generalized Cayley distance. This scheme is both explicit and systematic. We also prove the existence of orderoptimal systematic codes and offer a concrete construction based on this method. For the generalized Cayley metric, we prove that our coding schemes have less redundancy than the existing codes based on interleaving when the codelength is sufficiently large and the number of errors is relatively small. Index Terms—Permutation codes, systematic permutation codes, generalized Cayley distance, block permutation distance, order-optimality. I. I NTRODUCTION ENERALIZED transposition errors are encountered in various applications including cloud storage systems, genome resequencing and flash memories. Cloud storage applications such as Dropbox, OneDrive, iTunes, Google play, etc, are becoming increasingly popular, since they help to manage and synchronize the folders stored in different devices (PC) [2]. The items in the folders undergo rearrangements between two rounds of synchronizations. These operations, when the items are uniquely labeled and ordered, correspond to transpositions in permutations. In DNA resequencing, released genomes consist of collections of unassembled contigs and their organizations evolve over time by undergoing rearrangement operations. Gene order in a chromosome is subject to rearrangements including reversals, transpositions, translocations, block-interchanges, etc [3], [4]. Generalized G This paper was presented in part at the IEEE Information Theory Workshop, Kaohsiung, Taiwan, November, 2017 [1]. Siyi Yang is with the Department of Electrical and Computer Engineering, University of California, Los Angeles, CA 90095 USA (email: [email protected]). Clayton Schoeny is with the Department of Electrical and Computer Engineering, University of California, Los Angeles, CA 90095 USA (email: [email protected]). Lara Dolecek is with the Department of Electrical and Computer Engineering, University of California, Los Angeles, CA 90095 USA (email: [email protected]). transpositions are also encountered in flash memories using rank modulation, in which the cells store the relative ranks of their charge levels. Charge leakage between cells correspond to transpositions in the stored permutation. Errors encountered in the applications described above can be appropriately modeled by the generalized Cayley metric for permutation codes, introduced by Chee and Vu, capturing the number of generalized transpositions between two permutations [5]. Permutation codes have recently garnered substantial interest due to their potential in flash memories. In recent years, permutation codes in the Kendall-τ metric [6]–[8] and Ulam metric [9]–[11], along with codes in the Levenshtein metric [12], [13] have been intensely studied. Generalized transposition errors subsume transpositions and translocations that the Kendall-τ metric and Ulam metric describe, when no restrictions are imposed on the positions and lengths of the translocated segments. Codes in the generalized Cayley metric were first studied in [5] using breakpoint analysis, wherein a coding scheme is constructed based on permutation codes, previously introduced in [10], in the Ulam metric. Let N be the length of the codewords, and t be the maximum number of errors in the generalized Cayley metric. While the coding scheme proposed in [5] is explicitly constructive and implementable, the interleaving technique  used inevitably 1 incurs a noticeable rate penalty of O log N , without even considering the number of errors the codes are able to correct. As we show later, the best possible rate of a length-N code that corrects t generalized transposition errors is 1 − O( Nt ). When t is small compared to O( logNN ), the gap between the rate of existing codes based on interleaving and the optimal rate increases with N , thus motivating the need to introduce other techniques that are not based on interleaving. In this paper, we first propose a construction of orderoptimal permutation codes in the generalized Cayley metric. The main idea of our coding scheme is to map each permutation on [1 : N ] to an unique characteristic set on the Galois field Fq , where q is a prime number such that N 2 − N < q < 2N 2 − 2N and N is the codelength. We prove that knowledge of the boundaries of the unaltered segments is sufficient for recovering the permutation from its modified version, obtained through generalized transpositions. We exploit the fact that the symmetric difference of the characteristic sets of two distinct permutations corresponds to these boundaries. Given that the number of such boundaries is linearly upper bounded by the number of generalized transpositions, it is sufficient to find permutations with corresponding sets on Fq that have 2 large enough set differences to ensure error correction code property. Our proposed method provides a sufficient condition for ensuring the lower bound on the cardinality of these set differences, which in turn ensures a large enough minimum distance of the resulting code while the code is order-optimal. The rest of this paper is organized as follows. In Section II, we introduce the basic notation and properties for the generalized Cayley metric and the so-called block permutation metric, which is introduced for metric embedding. In Section III, we define the notion of error-correcting codes in these two metrics and derive useful upper and lower bounds on their optimal rates. We prove the optimal rate to be 1 − O Nt and use these results to guide the construction of order-optimal codes in Section IV. We then present a method for constructing permutation codes in the generalized Cayley metric. We assign to each permutation of length N a parity check sum with elements chosen from a Galois field Fq , where q is a prime number such that N 2 − N < q < 2(N 2 − N ). We prove that the permutations with the same parity check sums constitute a codebook, and we prove that the largest one is order-optimal. Based on this method, we then present a construction for order-optimal systematic permutation codes in the generalized Cayley metric in Section V. In Section VI, we prove that the rates of our proposed codes are higher than those of existing codes based on interleaving. We prove that our coding scheme is more rate efficient when N is large enough and t is relatively small. Lastly, we conclude and summarize our main contributions in Section VII. II. M EASURE OF D ISTANCE In this paper, we denote by [N ] the set {1, 2, · · · , N }. We let SN represent the set of all permutations on [N ], where each permutation σ : [N ] → [N ] is a bijection between [N ] and itself. The symbol ◦ denotes the composition of functions. Specifically, σ ◦ π denotes the composition of two permutations σ, π ∈ SN , i.e., (σ ◦ π) (i) = σ (π (i)), ∀ i ∈ [N ]. We assign a vector (σ(1), σ(2), · · · , σ(N )) to each permutation σ ∈ SN . Under this notation, we call e = (1, 2, · · · , N ) the identity permutation. Additionally, σ −1 is the inverse permutation of σ. The subsequence of σ from position i to j is written as σ [i; j] , (σ(i), σ(i + 1), · · · , σ(j)). The symbol ∆ refers to the symmetric difference. Let GCD (·) and LCM (·) be the greatest common divisor and the least common multiple, respectively. The symbol ≡ denotes ‘congruent modulo’. A generalized transposition φ (i1 , j1 , i2 , j2 ) ∈ SN , where i1 ≤ j1 < i2 ≤ j2 ∈ [N ], refers to a permutation that is obtained from swapping two segments of the identity permutation [5], i.e., e [i1 , j1 ] and e [i2 , j2 ], namely, j1 + 1, · · · , i2 − 1, i1 , · · · , j1 , j2 + 1, · · · , N }. (π(1), · · · , π(i1 − 1), π(i2 ), · · · , π(j2 ), π(j1 + 1), · · · , π(i2 − 1), π(i1 ), · · · , π(j1 ), π(j2 + 1), · · · , π(N )). (1) Denote the set of all transformations of a single generalized transposition on a permutation of length N as TN . For each π ∈ SN and φ (i1 , j1 , i2 , j2 ) ∈ TN , the permutation obtained (2) Example 1. Let π = (3, 5, 6, 7, 9, 8, 1, 2, 10, 4) ∈ S10 . Let the underlines mark the subsequences that are swapped by φ. Then we have,  π = 3, 5, 6, 7, 9, 8, 1, 2, 10, 4 ,  φ(2, 5, 7, 8) = 1, 7, 8, 6, 2, 3, 4, 5, 9, 10 ,  (π ◦ φ) (2, 5, 7, 8) = 3, 1, 2, 8, 5, 6, 7, 9, 10, 4 . Definition 1. (Generalized Cayley Distance, cf. [5]) The generalized Cayley distance dG (π1 , π2 ) is defined as the minimum number of generalized transpositions that is needed to obtain the permutation π2 from π1 , i.e., dG (π1 , π2 ) , min{∃ φ1 , φ2 , · · · , φd ∈ TN , d s.t., π2 = π1 ◦ φ1 ◦ (3) φ2 · · · ◦ φd }. Remark 1. (cf. [5]). For all π1 , π2 , π3 ∈ SN , the generalized Cayley distance dG satisfies the following properties: 1) (Symmetry) dG (π2 , π1 ) = dG (π1 , π2 ). 2) (Left-invariance) dG (π3 ◦ π1 , π3 ◦ π2 ) = dG (π1 , π2 ). 3) (Triangle Inequality) dG (π1 , π3 ) ≤ dG (π1 , π2 ) + dG (π2 , π3 ). Notice that the generalized Cayley distance dG between two permutations is hard to compute, which makes it difficult to construct codes in the generalized Cayley metric. The common method to address the difficulty of specifying the distances between permutations is metric embedding, where we find another metric that is computable and is of the same order as dG . Then we are able to transform the construction of codes in dG into that in the new metric. This new metric is the block permutation distance we introduce next. B. Block Permutation Distance We say a permutation π ∈ SN is minimal1 if and only if no consecutive elements in π are also consecutive elements in the identity permutation e, i.e., ∀ 1 ≤ i < N, π(i + 1) 6= π(i) + 1. A. Generalized Cayley Distance φ (i1 , j1 , i2 , j2 ) , {1, · · · , i1 − 1, i2 , · · · , j2 , from swapping the segments π [i1 ; j1 ] and π [i2 ; j2 ] is exactly π ◦ φ, i.e., the permutation (4) Denote the set of all minimal permutations of length N as DN . We then define the block permutation distance as follows. Definition 2. The block permutation distance dB (π1 , π2 ) between two permutations π1 , π2 ∈ SN is equal to d if π1 = (ψ1 , ψ2 , · · · , ψd+1 ) ,  π2 = ψσ(1) , ψσ(2) , · · · , ψσ(d+1) , (5) 1 We note that this is different from the notion of minimal permutation specified in group theory. 3 where σ ∈ Dd+1 , ψk = π1 [ik−1 + 1 : ik ] for some 0 = i0 < i1 · · · < id < id+1 = N , and 1 ≤ k ≤ d + 1. Note that the block permutation distance is d if and only if (d + 1) is the minimum number of blocks the permutation π1 needs to be divided into in order to obtain π2 through block level permutation. Here by block level permutation we refer to dividing the permutation into multiple segments and making a permutation of those segments. Remark 2. The block permutation distance dB also satisfies the properties of symmetry and left-invariance, which are defined in Remark 1. Proof. We suppose π1 , π2 ∈ SN such that dB (π1 , π2 ) = d. According to the definition of the block permutation distance, π1 , π2 satisfies (5) for some σ ∈ Sd+1 and some ψ1 , ψ2 , · · · , ψd+1 . To prove the symmetry, we define ψi0 = ψσ(i) for 1 ≤ i ≤ d + 1, and σ 0 = σ −1 . Then we will have Lemma 1. For all π1 , π2 ∈ SN , dB (π1 , π2 ) = |A(π2 ) \ A(π1 )| = |A(π1 ) \ A(π2 )|. Remark 3. From Lemma 1 and Definition 4, it is obvious that wB (π) = dB (e, π) = dB (π, e). For all π1 , π2 ∈ SN , it follows immediately from the leftinvariance property of dB and (9) that dB (π1 , π2 ) = wB π1−1   π1 = ψ̃1 , ψ̃2 , · · · , ψ̃d+1 ,   π3 ◦ π2 = ψ̃σ(1) , ψ̃σ(2) , · · · , ψ̃σ(d+1) . π1 , π3 ◦ π2 ) = d = dB (π1 , π2 ). ◦  π2 . In Example 2, we show how to compute the block permutation distance of two permutations from their characteristic sets, as is indicated in Lemma 1. Example 2. Let π1 = (3, 5, 6, 7, 9, 8, 1, 2, 10, 4), π2 = (3, 1, 2, 8, 5, 6, 7, 9, 10, 4). Denote ψi , 1 ≤ i ≤ 4 and σ as below, ψ3 = (8), ψ4 = (1, 2), ψ5 = (10, 4), σ = (1, 4, 3, 2, 5). Then we have π1 = (ψ1 , ψ2 , ψ3 , ψ4 , ψ5 ) ,  π2 = ψσ(1) , ψσ(2) , ψσ(3) , ψσ(4) , ψσ(5) ,  A(π1 ) = {(3, 5), (5, 6), (6, 7), (7, 9), Definition 3. The characteristic set A(π) for any π ∈ SN is defined as set of all consecutive pairs in π, i.e., A(π2 ) = {(3, 1), (1, 2), (2, 8), (8, 5), wB (π) , |A(π) \ A(e)|. (9, 8), (8, 1), (1, 2), (2, 10), (10, 4)}, (5, 6), (6, 7), (7, 9), (9, 10), (10, 4)}, (6) Definition 4. The block permutation weight wB (π) is defined as the number of consecutive pairs in π that does not belong to A(e) (wB is exactly the number of so-called breakpoints in [5]), i.e., (7) Here e refers to the identity permutation. The next two lemmas state explicit representations of the block permutation distance dB by the characteristic set and the block permutation weight, respectively. We apply Lemma 1 to construct the coding scheme later in Section IV, and Lemma 2 to derive the forthcoming relation between the generalized Cayley distance dG and the block permutation distance dB . (11) thus, dB (π1 , π2 ) = 4. Using the characteristic sets, Note that Definition 2 is an implicit representation of dB . We next find other ways to characterize dB explicitly. A(π) , {(π(i), π(i + 1)) |1 ≤ i < N }. (10) ψ2 = (5, 6, 7, 9), ◦ ◦ (9) ψ1 = (3), thus, dB (π2 , π1 ) = d = dB (π1 , π2 ). To prove the left-invariance, suppose the length of ψi is li and ψi = (ψi (1), ψi (2), · · · , ψi (li )) for all 1 ≤ i ≤ d + 1. For any π3 ∈ SN , we define ψ̃i = (π3 (ψi (1)) , π3 (ψi (2)) , · · · , π3 (ψi (li ))), for 1 ≤ i ≤ d + 1. Then we have Therefore dB (π3  Proof. The proof is in Appendix A.  0 π2 = ψ10 , ψ20 , · · · , ψd+1 ,   π1 = ψσ0 0 (1) , ψσ0 0 (2) , · · · , ψσ0 0 (d+1) , π3 (8) we have that |A(π2 ) \ A(π1 )| = |{(3, 5), (9, 8), (8, 1), (2, 10)}| = 4. This example is in accordance with Lemma 1. C. Metric Embedding In general, the generalized Cayley distance is difficult to compute, whereas the block permutation distance is easier to derive. In the next section, we apply metric embedding to transform the problem of code design in dG into that in dB , which is easier to deal with, using the following results. Lemma 2. For all π1 , π2 ∈ SN , we have: 4 (1) wB (π1 ◦ π2 ) ≤ wB (π1 ) + wB (π2 ) . (12)  Proof. The proof is in Appendix B. Remark 4. It follows immediately from equation (10) and Lemma 2 that the block permutation distance satisfies the triangle inequality, i.e., ∀ π1 , π2 , π3 ∈ SN , dB (π1 , π3 ) ≤ dB (π1 , π2 ) + dB (π2 , π3 ). (13) From Lemma 2 and the definitions of the generalized Cayley metric and the block permutation metric, we derive the following relation between dB and dG . This result is used later in Section IV. Lemma 3. For all π1 , π2 ∈ SN , we have: dG (π1 , π2 ) ≤ dB (π1 , π2 ) ≤ 4dG (π1 , π2 ) . (14) Proof. To prove the upper bound, we consider two arbitrary permutations π1 , π2 , and let k = dG (π1 , π2 ). We know from the definition of block permutation weight and generalized transpositions that for any generalized transposition φ ∈ TN (TN is defined before as the set of all generalized transposition with length N ), we have: wB (φ) ≤ 4. (15) From the definition of generalized Cayley metric, we know that ∃ {φi }ki=1 , such that π2 = π1 ◦ φ1 ◦ dB (π1 , π2 ) =wB π1−1 =wB (φ1 ≤ (i+1) π2  = ψσ(i+1) (1) , ψσ(i+1) (2) , · · · , ψσ(i+1) (d+1) . Follow this procedure, and suppose m is the smallest integer (m) such that π2 = π1 . In this procedure, we find l0 , · · · , lm−1 sequentially, where 1 < l0 < l1 < · · · < lm−1 . We also know that lm−1 ≤ d, otherwise we must have σ (m−1) (i) = i for all 1 ≤ i ≤ d, and σ (m−1) (d + 1) 6= d + 1, which leads to a contradiction. Therefore d ≥ lm−1 > · · · > l0 ≥ 1, which indicates that m ≤ d. Note that π1 = π2 ◦ φ1 ◦ · · · ◦ φm , from which we know that dG (π1 , π2 ) ≤ m ≤ d = dB (π1 , π2 ). The lemma is proved.  φ2 · · · ◦ φk . Then from Lemma 2 and (15), we know that: k X (1) Here π2 = π2 ◦ φ1 . If π2 = π1 , then π1 = π2 ◦ φ1 . Otherwise we let l1 be the smallest index l such that σ (1) (l) 6= l, 1 ≤ l ≤ N , and we know that l1 > l0 . We can find a series of generalized transpositions φ1 , φ2 , · · · , φm , 1 ≤ m ≤ d sequentially, by the following procedure, such that π2 ◦ φ1 ◦ φ2 ◦ · · · ◦ φm = π1 . (i) Suppose φ1 , φ2 , · · · , φi are found. Let π2 = φ1 ◦ φ2 ◦  (i) · · · ◦ φi = ψσ(i) (1) , ψσ(i) (2) , · · · , ψσ(i) (d+1) . If π2 = π1 , then π1 = π2 ◦ φ1 ◦ φ2 ◦ · · · ◦ φi . Otherwise we let li be the smallest index such that σ (i) (li ) 6= li . Suppose −1 ki = σ (i) (li ), and we have ki > li . Denote the generalized transposition that swaps the subsequences ψσ(i) (1) , ψσ(i) (2) , · · · , ψσ(i) (ki −1) and ψσ(i) (ki ) = (i) (i) ψli in π2 by φi+1 . Let π2i+1 = π2 ◦ φi+1 , σ (i+1) = (i) (i) (1, 2, · · · , li , σ (li ), σ (li + 1), · · · , σ (i) (ki − 1), σ (i) (ki + 1), · · · , σ (i) (d + 1). Then, ◦ ◦ π2 φ2  ◦ · · · ◦ φk ) wB (φi ) i=1 ≤4k = 4dG (π1 , π2 ) . The upper bound is proved. To prove the lower bound, we consider distinct permutations π1 and π2 such that dB (π1 , π2 ) = d > 0. Then, from the definition of the block permutation weight we know that there exists a minimal permutation σ (minimal permutation is defined in Subsection B in Section II) and a partition {ψi }d+1 i=1 of π1 such that π1 = (ψ1 , ψ2 , · · · , ψd+1 ) and  π2 = ψσ(1) , ψσ(2) , · · · , ψσ(d+1) . Next, suppose l0 is the smallest index l such that σ(l) 6= l, 1 ≤ l ≤ N . Let k0 = σ −1 (l0 ), we have k0 > l0 . Let φ1 be the generalized transposition that swaps the subsequences ψσ(l0 ) , ψσ(l0 +1) , · · · , ψσ(k0 −1) and ψσ(k0 ) = ψl0 in π2 . (1) Let π1 = π2 ◦ φ1 and σ (1) = (1, 2, · · · , l0 , σ(l0 ), σ(l0 + 1), · · · , σ(k0 − 1), σ(k0 + 1), · · · , σ(d + 1). Then,  (1) π2 = ψσ(1) (1) , ψσ(1) (2) , · · · , ψσ(1) (d+1) . III. T HEORETICAL B OUNDS A subset CG (N, t) of SN is called a t-generalized Cayley code if it can correct t generalized transposition errors. Any t-generalized Cayley code has minimum generalized Cayley distance dG,min ≥ 2t + 1. Similarly, a subset CB (N, t) of SN is a t-block permutation code if its minimum block permutation distance dB,min ≥ 2t + 1. Denote the code rate of CG (N, t), CB (N, t) as RG (N, t) and RB (N, t), respectively. Let CG,opt (N, t) and CB,opt (N, t) be t-generalized Cayley codes and t-block permutation codes with optimal rate, denoted as RG,opt (N, t) and RB,opt (N, t), respectively. We derive lower bounds and the upper bounds of RG,opt (N, t) and RB,opt (N, t). For each π ∈ SN , we define the generalized Cayley ball BG (N, t, π) of radius t centered at π to be the set of all permutations in SN that have a generalized Cayley distance from π not exceeding t. We know from the leftinvariance property of dG that the cardinality of BG (N, t, π) is independent of π; we denote |BG (N, t, π)| as bG (N, t). The block permutation ball BB (N, t, π) and the corresponding ball-size bB (N, t) are similarly defined. We derive the lower and upper bounds of bB (N, t) and bG (N, t) in the following two lemmas, respectively. We build on these results and Lemma 6 to compute the bounds of the rate of optimal codes in dG and dB , proving that their redundancy is O( Nt ). 5 Lemma 4. For all N ∈ N∗ , t ≤ N − bounded by the following inequality: t Y (N − k) ≤ bB (N, t) ≤ k=1 √ t Y N − 1, bB (N, t) is (N − k). (16) k=0 Proof. The proof is in Appendix C. √  Lemma 5. For all N ∈ N∗ , t ≤ min{N − N − 1, N 4−1 }, bG (N, t) is bounded as follows:   4t Y N − 1 (2t)! ≤ b (N, t) ≤ (N − k). (17) G 4t 2t t! log bB (N, t) log bB (N, 2t) ≤ RB,opt (N, t) ≤ 1 − , log N ! log N ! log bG (N, 2t) log bG (N, t) 1− ≤ RG,opt (N, t) ≤ 1 − . log N ! log N ! (23) 1− By applying Lemma 5 and Lemma 6 to (23), for fixed t and sufficiently large N , we have k=0 Proof. The proof is in Appendix D. As the metric dB and dG both satisfy the triangle inequality, it follows that a subset C ⊆ SN is a t-generalized Cayley code if dG (x, y) > 2t for all x, y ∈ C, x 6= y. Similarly, C is a t-block permutation code if dB (x, y) > 2t for all x, y ∈ C, x 6= y. The cardinalities of the optimal codes CB,opt (N, t) and CG,opt (N, t) are bounded by the inequalities below. N! N! ≤ |CB,opt (N, t)| ≤ , bB (N, 2t) bB (N, t) N! N! ≤ |CG,opt (N, t)| ≤ . bG (N, 2t) bG (N, t)   log log N ! (8t + 1) log N >1− (N + 12 ) log N − (log e)N   8t + 1 2 log e >1− 1+ . N log N (18) log RG,opt (N, t) ≤ 1 − √ 2πN N +1/2 e−N · erN ,  N −1 (2t)! 4t 2t t! i log N !  h i 4t Q (2t)! log (N − k) + log (4t)!2 t t! (19) =1− k=1 4t =1− N log N − log N ! 4t(log N − 81 ) − 3t log(4t) <1− (N + 1) log N − N + 2 4t N − 3 2 − =1− (21)  4t 1− N log N − 1   4t 3(log t + 1) =1− 1− . N 4(log N − 1) <1− From (20) and (21), Lemma 6 follows. 1 ! 3 4 log t N log N − 1 + 2+log N ! 2+log N 5 + 34 log t 8 + N − N log N − 1 + 2+log N  3 4 (log t + 1) 1 8 (20) where 1 1 < rn < . 12N + 1 12N h  From [14, (1)-(2)], we know that for all N ∈ N∗ , N! =  (N − k) k=0 RG,opt (N, t) ≥ 1 − We formulate the optimal code rate as follows log|CB,opt (N, t)| RB,opt (N, t) = , log N ! log|CG,opt (N, t)| RG,opt (N, t) = . log N ! 8t Q Lemma 6. For all N ∈ N∗ , it follows that N X 1 (N + ) log N −(log e)N < log n < (N +1) log N −N +2. 2 n=1 Similarly, by applying Lemma 4 and Lemma 6 to (23), we have Theorem 1. For fixed t and sufficiently large N , the optimal rates satisfy the following inequalities,  log RB,opt (N, t) ≥ 1 − 2t + 1 t ≤RB,opt (N, t) ≤ 1 − , N N 8t + 1 4t 1 − c1 · ≤RG,opt (N, t) ≤ 1 − c2 · , N N 1 − c1 · where c1 = 1 + 2 log e log N , c2 = 1 − 3(log t+1) 4(log N −1) . Proof. From (18) and (19), it follows that (22) 2t Q  (N − k) k=0 log N ! (2t + 1) log N >1− (N + 21 ) log N − (log e)N (2t + 1) log N >1− N (log N − log e)   2t + 1 2 log e >1− 1+ . N log N 6  log t Q The following Lemma 7 states that the cardinality of the symmetric difference of ν(π1 ), ν(π2 ) for any two permutation π1 , π2 ∈ SN , π1 6= π2 is greater than 2d if their parity check sums α(q,d) (π1 ) and α(q,d) (π2 ) are identical. Therefore their block permutation distance is greater than d based on Lemma 1. This lemma is applied throughout this paper in the construction of order-optimal permutation codes in both the generalized Cayley metric and the block permutation distance.  (N − k) k=1 RB,opt (N, t) ≤ 1 − log N ! t(log N − 12 ) <1− (N + 1) log N − N + 2 t(log N − 21 ) <1− N log N − 12 N t =1− . N The theorem is proved. Lemma 7. For all π1 , π2 ∈ SN , π1 6= π2 , if α(q,d) (π1 ) = α(q,d) (π2 ), then  The above two inequalities in Theorem 1 indicate that the  rate R = 1−O Nt is order-optimal for both the t-generalized Cayley codes and the t-block permutation codes. IV. C ONSTRUCTION We discussed the optimal rate of t-generalized Cayley Codes and t-block permutation codes in the previous section. We now focus on the corresponding constructions of codes with the order-optimal rates. We know from Lemma 3 that any 4t-block permutation code is also a t-generalized Cayley code. In the sequel, we thus focus on the construction of orderoptimal t-block permutation codes. In Subsection A, we develop a construction of order-optimal t-block permutation codes (Theorem 2). We then provide the corresponding decoding scheme of the proposed codes in Subsection B. A. Encoding Scheme ν(π) , {υ(p)|p ∈ A(π)}. (24) Then ν is invertible, namely, we are able to compute a unique π from ν(π). We then define a class of surjections α(q,d) : SN → F2d−1 q as follows: α(q,d) (π) , (α1 , α2 , · · · , α2d−1 ) , (25) where α1 ≡ P b mod q,         α2d−1 ≡ P b2 mod q, b∈ν(π) .. . ≡ P b∈ν(π) (26) b2d−1 mod q. (27)  Note that the function α(q,2t) induces a surjection from SN to F4t−1 and divides SN into q 4t−1 subsets based on their q parity check sums α = (α1 , α2 , · · · , α4t−1 ). We next prove that each such subset is a t-block permutation code, which is stated as the following theorem. , suppose: Theorem 2. For all α ∈ F4t−1 q Cα (N, t) = {π|π ∈ SN , α(q,2t) (π) = α}, (28) where α(q,2t) is defined in (V-B). Then ∀ π1 , π2 ∈ Cα (N, t), π1 6= π2 , we have (29) Proof. Let d = 2t in Lemma 1, then (24) implies that 1 |A(π1 )∆A(π2 )| 2 1 = |ν(π1 )∆ν(π2 )| 2 1 > (2 · 2t) = 2t, 2 dB (π1 , π2 ) = where ∆ refers to the symmetric difference of sets. (30)  Theorem 2 implies that {Cα (N, t) : α ∈ F4t−1 } is a q partition of SN , where each component Cα (N, t) is a t-block permutation code indexed by α. Suppose Cαmax (N, t) is the one with maximal cardinality and has parity check sum αmax . It follows from Pigeonhole Principle that: |Cαmax (N, t)| ≥ b∈ν(π) α2 Proof. The proof is in Appendix E. dB (π1 , π2 ) ≥ 2t + 1. Denote the set of all ordered pairs of non-identical elements from [N ] as P , then |P | = N 2 − N . Suppose q is a prime number such that q ≥ |P |. From Bertrand’s postulate, we can always find a q such that |P | ≤ q ≤ 2|P |. Let υ : P → Fq be an arbitrary injection from P to Fq , where Fq is the Galois field of order q. Let P(Fq ) represent the power set of Fq . We define an injection ν : SN → P(Fq ) as follows:          |ν(π1 )∆ν(π2 )| > 2d. N! N! 4t−1 = q 4t−1 . |Fq | (31) Denote the rate of Cαmax (N, t) by RB (N, t). Given that N 2 − N = |P | ≤ q < 2|P | = 2N 2 − 2N < 2N 2 , it follows from Lemma 6 that for sufficiently large N , 7 RB (N, t) ≥ 1 − >1− >1− >1− >1− 4t log q 8t log N + 4t >1− log N ! log N ! 1 8t(log N + 2 ) (N + 12 ) log N − (log e)N   log N + 12 8t N log N − log e    8t 1 2 log e 1+ 1+ N 2 log N log N   8t 2 log e + 1 1+ . N log N (32) Denote the coefficient of X N −i−1 in f (X; B) and f (X; B 0 ) by ai , a0i , respectively. Let r(B) = (a1 , a2 , · · · , a4t−1 ), r(B 0 ) = (a01 , a02 , · · · , a04t−1 ). Suppose the transmitter sends π ∈ SN and the receiver receives π 0 , where dG (π, π 0 ) ≤ t. The receiver uses the knowledge of α to compute r(B) and to derive r(B 0 ) from B 0 , where B = ν(π) and B 0 = ν(π 0 ). Note that π can be computed from B = ν(π) since ν is an injection from SN to P(Fq ). Thus the objective is to compute B from r(B), r(B 0 ) and B 0 . Denote f1 = f (X; B), f2 = f (X; B 0 ), where f (X; B) is specified in (33). Our objective is to compute B from f1 , f2 . Suppose D2 = B \ B 0 , D1 = B 0 \ B, D3 = B ∩ B 0 . Let Then Cαmax (N, t) is an order-optimal t-block permutation code. B. Decoding Scheme In previous discussion, we map each permutation π ∈ SN to a unique set ν(π) ∈ P(Fq ) as defined in equation (24), where N 2 − N ≤ q ≤ 2N 2 − 2N and P(Fq ) represents the power set of Fq . In the decoding scheme, our objective is to compute ν(π) from a previously specified parity check sum α and the received permutation π 0 . The strategy is, for every set B ∈ P(Fq ), map B to a polynomial f (X; B) defined as follows: f (X; B) , Y b∈B (X + b) = X N −1 + N −1 X N −1−i eB . (33) i X i=1 We call f (X; B) the characteristic function of the set B. All the polynomials as well as the polynomial operations are defined in Fq . Given the a priori agreement on the codebook, i.e., the choice of α, the value of the first 4t coefficients of f (X; B) and f (X; B 0 ) can be computed, where B = ν(π) and B 0 = ν(π 0 ). We then use these coefficients to derive ν(π) = B. Note that this coding strategy bares resemblance to that proposed in [15], the key difference being that the coefficients of the polynomials we discussed are partially known, which making our decoding scheme more complicated, whereas those in [15] are fully known. Note that eB i , 1 ≤ i ≤ N − 1 in (33) is the i-th elementary symmetric polynomial of the elements in B. Also note that the i-th component αi , 1 ≤ i ≤ 4t−1, of the value α = α(q,2t) (π) is exactly the i-th power sum of the elements in B = ν(π). We know from Newton’s identities that there exists a bijection between the 4t − 1 power sums and the first 4t − 1 elementary symmetric polynomials of elements in B, described below:   eB 0 = 1,     eB  1 = α1 ,    −1 B  eB (e1 α1 − α2 ), 2 =2 B −1 B e3 = 3 (e2 α1 − eB  1 α2 + α3 ),    ..   .     B B e4t−1 = (4t − 1)−1 (eB 4t−2 α1 − e4t−3 α2 + · · · + α4t−1 ). (34) Y f1 (X + b), = GCD(f1 , f2 ) b∈D2 Y f2 g2 (X) = (X + b), = GCD(f1 , f2 ) b∈D1 Y g3 (X) = GCD(f1 , f2 ) = (X + b). g1 (X) = (35) b∈D3 Notice that g1 , g2 , g3 uniquely determine f1 , f2 , which indicates that they are sufficient for computing π. We next seek to compute g1 , g2 , g3 from r(B) and f2 = g2 · g3 , from which f1 = g1 · g3 can be determined. Let (h1 , h2 ) = (X t−k g2 , X t−k g1 ), where k = deg g1 = deg g2 = |D1 | = |D2 | ≤ t. Then (h1 , h2 ) satisfy h1 · f1 = h2 · f2 . We will also prove later in Theorem 3 that g1 , g2 , g3 can be computed from an arbitrary solution (h1 , h2 ) of h1 · f1 = h2 · f2 . Therefore any solution to h1 · f1 = h2 · f2 is sufficient for computing π. Also notice that the first 4t−1 coefficients of h1 ·f1 and h2 ·f2 uniquely determine r(B) and r(B 0 ), respectively, if h1 , h2 are known. In order to compute g1 , g2 , g3 , it is sufficient to find (h1 , h2 ) of degree t such that the first 4t − 1 coefficients of h1 ·f1 and that of h2 ·f2 are equal, i.e., the following inequality holds, deg(h1 · f1 − h2 · f2 ) < N − 3t. For each c ∈ F2t q , (36) where c = c1 , · · · , ct , −c01 , · · · , −c0t T , (37) define the polynomials h1 (c), h2 (c) of degree t as follows, h1 (c) , X t + c1 X t−1 + c2 X t−2 + · · · + ct , h2 (c) , X t + c01 X t−1 + c02 X t−2 + · · · + c0t . (38) Define A=  1   a1   ..  .   at−1   .  .. a4t−2 0 .. . at−2 .. . ··· .. . .. . ··· .. . a4t−3 ··· 0 1 .. . 1 0 0 1 .. . a01 .. . 1 .. . a0t−1 .. . a0t−2 .. . ··· .. . .. . ··· .. . a3t−1 a04t−2 a04t−3 ···  0 ..  .    0  , 1   ..  .  a03t−1 (39) 8 r(B 0 ) = (80, 64, 83, 10, 72, 22, 26) from B 0 = ν(π 0 ) = {75, 58, 89, 94, 40, 1, 13, 36, 62}. Then and b = a01 , · · · , a04t−1 T − a1 , · · · , a4t−1 T . (40) The following Lemma 8 provides an equivalent linear equation to find a solution that satisfies (36), and Theorem 3 shows how to compute π from this intermediate value. Lemma 8. Consider the following equation: Ac = b. F2t q , For any vector c ∈ (h1 (c), h2 (c)) satisfies (36). (41) c is a solution to (41) iff Proof. The proof is in Appendix F.  Theorem 3. Let c be an arbitrary solution to (41), and h1 = h1 (c), h2 = h2 (c). Denote h, v1 , v2 as follows. h1 h2 , v2 = . (42) h h Suppose V1 , V2 are the sets of the additive inverses of roots of v1 , v2 , respectively. Then π can be computed from the following equation: h = GCD(h1 , h2 ), v1 = π=ν −1 0 (V2 ∪ (B \ V1 )) . Proof. Note that B = ν(π) and g is an injection, we only need to prove that B = V2 ∪ (B 0 \ V1 ). From (35) it follows that h1 · f1 − h2 · f2 = (h1 · g1 − h2 · g2 ) · g3 , where deg g3 = |B ∩ B 0 | ≥ N − 1 − t. From Lemma 8 we know that (36) is true, therefore h1 · f1 = h2 · f2 . T 31 0 42 54 94 16 31 0 42 54  , 64 83 10 72 22 (43) 80 64 83 10 72 T b = 64 33 83 65 18 25 64 .  Notice that c = 95, 94, 66, 26 is a solution to Ac = b. Therefore h1 = X 2 + 95X + 94 = (X + 1)(X + 94), h2 = X 2 + 31X + 71 = (X + 24)(X + 7). The receiver then knows that D1 = {1, 94}, D2 = {24, 7}. Therefore ν(π) = B = D2 ∪ (B 0 \ D1 ) = {13, 36, 62, 24, 40, 7, 75, 58, 89}. Then it follows that A(π) = {(2, 4), (4, 7), (7, 3), (3, 5), (5, 1), (1, 8), (8, 6), (6, 9), (9, 10)}. From the definition of f , the receiver is able to decode π from A(π) as π = (2, 4, 7, 3, 5, 1, 8, 6, 9, 10).  1 0 A= 1 0 16 1 80 1 V. S YSTEMATIC P ERMUTATION C ODES IN THE G ENERALIZED C AYLEY M ETRIC We presented a coding scheme for an order-optimal t-block permutation code in Section IV. However, we observe that it is difficult to identify a bijection between the transmitted messages and the codewords in the non-systematic codes in this configuration. We now develop order-optimal t-block permutation codes in the systematic form. We first provide in Subsection A a general construction of a systematic t-block permutation code that is not necessarily order-optimal. Then in Subsection B, we provide the decoding scheme of this construction. We next prove the existence of an order-optimal version of this code and provide a specific construction of the systematic order-optimal code in Subsection C. We know from (42) that v1 · f1 = v2 · f2 , A. Encoding Scheme υ(i, j) = 10(i − 1) + j − 1. Let messages be permutations in SN . In systematic codes, the codewords are permutations of length N + M . In our configuration, we derive each codeword σ ∈ SN +M from a message π ∈ SN by sequentially inserting values N + 1, N + 2, · · · , N + M into π in the positions specified by a sequence S = (s1 , s2 , · · · , sM ). We then prove in Lemma 9 that the block permutation distance between the resulting codewords cannot be smaller than that of their original permutations. It follows from Theorem 2 that permutations with the same parity check sum α(q,2t) defined in equation (V-B) have a block permutation distance of at least 2t + 1. Therefore, it suffices to show that the permutations with different parity check sums map to codewords that are sufficiently far apart under the block permutation distance. In this subsection, we present an explicitly constructed encoding method in Theorem 2 based on a so-called t-auxiliary set we introduce in Definition 9. We start by presenting a collection of lemmas and definitions to support our results. The receiver can apply Newton’s Identities to compute r(B) = (16, 31, 0, 42, 54, 94, 59) from α, and derive Definition 5. For any permutation π ∈ SN and the integer i ∈ N, where 1 ≤ s ≤ N , let E(π, s) be a permutation in where GCD(v1 , v2 ) = 1. Then we have f1 f2 = = f. v2 v1 Suppose V3 is the set of the additive inverses of roots of f . Then V2 ∪ V3 = B, V1 ∪ V3 = B 0 , thus B = V2 ∪ V3 = V2 ∪ (B 0 \ V1 ).  v1 |f2 , v2 |f1 , Note that V1 , V2 computed in Theorem 3 are exactly identical to D2 , D1 described before (35), respectively. Example 3. Suppose the sender transmits the permutation π1 = (2, 4, 7, 3, 5, 1, 8, 6, 9, 10) ∈ Cα (10, 2), where α = (16, 0, 86, 44, 61, 9, 49), and the receiver recives π 0 = (8, 6, 9, 10, 5, 1, 2, 4, 7, 3) ∈ S10 . In the encoding scheme, q = 97 > 102 − 10, and for all i 6= j ∈ [10], 9 SN +1 derived by inserting the element N +1 after the element s in π, i.e., E(π, s) , (π1 , π2 , · · · , πk , N + 1, πk+1 , · · · , πN ) , where k = π −1 (s). We call E(π, s) the extension of π on the extension point s. Consider a sequence S = (s1 , s2 , · · · , sM ), where sm ∈ [N ] for all 1 ≤ m ≤ M . The extension E(π, S) of π on the extension sequence S is a permutation in SN +M derived from inserting the elements N + 1, · · · , N + M sequentially after the elements s1 , · · · , sM in π, i.e., Example 5. Suppose π = (1, 5, 7, 2, 3, 6, 4), π 0 = (2, 3, 1, 5, 7, 6, 4), s1 = 4, s01 = 5, s2 = 5, s02 = 6, s3 = 3, s03 = 7. Then σ1 = E(π, s1 ) = (1, 5, 7, 2, 3, 6, 4, 8) , σ10 = E(π 0 , s01 ) = (2, 3, 1, 5, 8, 7, 6, 4) , σ2 = E(π, s2 ) = (1, 5, 8, 7, 2, 3, 6, 4) , σ20 = E(π 0 , s02 ) = (2, 3, 1, 5, 7, 6, 8, 4) , σ3 = E(π, s3 ) = (1, 5, 7, 2, 3, 8, 6, 4) , σ30 = E(π 0 , s03 ) = (2, 3, 1, 5, 7, 8, 6, 4) . Given that dB (π, π 0 ) = 2, we observe by inspection that E(π, S) , E(E(· · · , E(E(π, s1 ), s2 ), · · · , sM −1 ), sM ). Note that in Definition 5, the elements s1 , · · · , sM in the extension sequence S are not necessarily distinct. If different symbols are sequentially inserted after the same element, then they are all placed right after this element in descending order, as is shown in the following example. Example 4. Suppose π = (1, 4, 5, 7, 6, 2, 3), I = {4, 1, 2, 2}, then E(π, I) = (1, 9, 4, 8, 5, 7, 6, 2, 11, 10, 3) . The next Definition 6 presents the notion of the jump points of the extensions of two permutations. Then Lemma 9states that the block permutation distance between two extensions is strictly larger than that of the original permutations when the extension point of one of them is a jump point. Based on this result, we further introduce the notion of jump index and jump set in Definition 7. We know that the block permutation distance of two permutations from SN is lower bounded by the sum of that of their extensions and the cardinality of the jump set. Definition 6. Suppose E(π1 , s1 ), E(π2 , s2 ) are two arbitrary extensions of π1 and π2 , respectively, where π1 , π2 ∈ SN , π1,k1 = s1 and π2,k2 = s2 . Then s1 is called a jump point of E(π1 , s1 ) with respect to E(π2 , s2 ), if s1 6= s2 and at least one of the following conditions is satisfied: 1) k1 = N or k2 = N ; 2) k1 , k2 < N , and π1,k1 +1 6= π2,k2 +1 . Lemma 9. For any two extensions E(π1 , s1 ) and E(π2 , s2 ), if s1 is a jump point, then dB (E(π1 , s1 ), E(π2 , s2 )) > dB (π1 , π2 ), (44) else dB (σ1 , σ10 ) = 4 > dB (π, π 0 ), s1 is a jump point; dB (σ2 , σ20 ) = 5 > dB (π, π 0 ), s2 is a jump point; dB (σ3 , σ30 ) = 2 = dB (π, π 0 ), s3 is not a jump point. Notice that s1 is a jump point that satisfies the first condition in Definition 6 and s2 satisfies the second condition. This example is consistent with Lemma 9. Definition 7. Suppose E(π1 , S1 ) and E(π2 , S2 ) are extensions of π1 and π2 on extension sequences S1 and S2 , respectively, where π1 , π2 ∈ SN , S1 = (s1,1 , s1,2 , · · · , s1,M ) and S2 = (s2,1 , s2,2 , · · · , s2,M ). Then, for any m ∈ [M ], m is called a jump index of E(π1 , S1 ) and E(π2 , S2 ) if s1,m is a jump point of E(E(π1 , J1,m ), s1,m ) with respect to E(E(π2 , J2,m ), s2,m ), where J1,m = (s1,1 , s1,2 , · · · , s1,m−1 ), J2,m = (s2,1 , s2,2 , · · · , s2,m−1 ). Define the jump set F (π1 , π2 , S1 , S2 ) as the set of all jump indices of E(π1 , S1 ) and E(π2 , S2 ). Remark 5. For any extensions E(π1 , S1 ), E(π2 , S2 ) of π1 , π2 on extension sequences S1 , S2 , respectively, it is obvious from the above Definition 7 and Lemma 9 that dB (E(π1 , S1 ), E(π2 , S2 )) ≥ dB (π1 , π2 )+|F (π1 , π2 , S1 , S2 )|. (46) In the following Example 6, we provide an example of how to identify the jump indices and compute the jump set. This example satisfies inequality (46). Example 6. Continuing with the values of π, π 0 specified in Example 5, let S = (4, 6, 7), S 0 = (5, 6, 5). Then σ0 = π = (1, 5, 7, 2, 3, 6, 4) , σ00 = π 0 = (2, 3, 1, 5, 7, 6, 4) , σ1 = E(σ0 , s1 ) = (1, 5, 7, 2, 3, 6, 4, 8) , dB (E(π1 , s1 ), E(π2 , s2 )) = dB (π1 , π2 ). Proof. The proof is in Appendix G. (45)  In the following Example 5, we provide examples of jump points that satisfy the two conditions indicated in the previous Definition 6. We also provide an example of an extension point that is not a jump point. σ10 = E(σ00 , s01 ) = (2, 3, 1, 5, 8, 7, 6, 4) , σ2 = E(σ1 , s2 ) = (1, 5, 7, 2, 3, 6, 9, 4, 8) , σ20 = E(σ10 , s02 ) = (2, 3, 1, 5, 8, 7, 6, 9, 4) , σ3 = E(σ2 , s3 ) = (1, 5, 7, 10, 2, 3, 6, 9, 4, 8) , σ30 = E(σ20 , s03 ) = (2, 3, 1, 5, 10, 8, 7, 6, 9, 4) . It follows immediately that 10 dB (σ0 , σ00 ) = 2, dB (σ1 , σ10 ) = 4 > dB (σ0 , σ00 ), 1 is a jump index; dB (σ2 , σ20 ) = 4 = dB (σ1 , σ10 ), 2 is not a jump index; dB (σ3 , σ30 ) = 5 > dB (σ2 , σ20 ), 3 is a jump index. According to Definition 7, F (π, π 0 , S, S 0 ) = {1, 3}. Moreover, dB (σ, σ 0 ) = dB (σ3 , σ30 ) = 5 > 4 = dB (π, π 0 ) + |F (π, π 0 , S, S 0 )|, which is in accordance with equation (46). Next we prove in Lemma 10 that the right hand expression of equation (46) can be lower bounded by the cardinality of so-called Hamming set defined in the following Definition 8. Based on this result, we present a construction of systematic t-block permutation codes in Theorem 4 with the help of a so-called t-auxiliary set. 1) α1 = α2 . In this case, from Theorem 2 we know that dB (π1 , π2 ) > 2t. Then Lemma 9 implies that dB (σ1 , σ2 ) ≥ dB (π1 , π2 ) ≥ 2t + 1. 2) α1 6= α2 . In this case, S1 6= S2 ∈ A(N, K, t). Then from Definition 9, |H(S1 , S2 )| ≥ 2t + 1. Therefore from Lemma 10, dB (σ1 , σ2 ) ≥ |H(S1 , S2 )| ≥ 2t + 1. From the above discussion, dB (σ1 , σ2 ) ≥ 2t + 1 is aways sys true, which means that CB (N, K, t) is indeed a systematic t-block permutation code.  B. Decoding Scheme (47) Based on the construction and the notation in Theorem 4, suppose the sender sends a codeword σ = E(π, ϕ ◦ α(q,2t) (π)) through the channel and the receiver receives a noisy version σ 0 , where dB (σ, σ 0 ) ≤ t. In this section, we prove in the forthcoming Lemma 11 that the extension sequence S of the codeword E(π, S) is decodable given that dB (σ, σ 0 ) ≤ t, from which the parity check sum defined in (V-B) of the transmitted information π can be derived. For convenience, we introduce the following definition of truncation and will use it throughout this subsection. Remark 6. It is obvious that dH (v1 , v2 ) ≥ |H(v1 , v2 )|. Additionally, for any three sequences v1 , v2 , v3 of integers, the following triangle inequality holds true: Definition 10. For any permutation σ ∈ SN +1 and an integer u ∈ [N + 1], denote T (σ, u) to be the sequence derived by removing the element u from σ, i.e., Definition 8. For any sequences v1 , v2 of integers, with length M , where v1 = (v1,1 , v1,2 , · · · , v1,M ) and v2 = (v2,1 , v2,2 , · · · , v2,M ), define the Hamming set of v1 with respect to v2 as follows, H(v1 , v2 ) , {v1,m |v1,m 6= v2,m , m ∈ [M ]}. |H(v1 , v3 )| ≤ |H(v1 , v2 )| + |H(v2 , v3 )|. (48) Lemma 10. For any extensions E(π1 , S1 ), E(π2 , S2 ) of π1 , π2 on extension sequences S1 , S2 , respectively, it follows that dB (E(π1 , S1 ), E(π2 , S2 )) ≥ |H(S1 , S2 )|. (49)  Proof. The proof is in Appendix H. Example 7. Continuing on with the numerical values of π, π 0 , S, S 0 as in Example 6, we conclude that, H(S, S 0 ) = {4, 7}, m(4) = 1, m(7) = 3. Then it follows that dB (σ, σ 0 ) = 5 > 2 = |H(S, S 0 )|, which is in accordance with the above Lemma 10. K Definition 9. Consider a set A(N, K, t) ⊂ [N ] . We call A(N, K, t) a t-auxiliary set of length K in range [N ] if for any c1 6= c2 ∈ A(N, K, t), |H(c1 , c2 )| ≥ 2t + 1 holds. Theorem 4. For any t-auxiliary set A(N, K, t) with cardinality that is no less than q 4t−1 , suppose ϕ : α(q,2t) (SN ) → A(N, K, t) is an arbitrary injection, where q is a prime number such that N 2 − N < q < 2(N 2 − N ) and the parity check sum α(q,2t) is defined in equation (V-B). Then, sys the set CB (N, K, t) = {E(π, ϕ ◦ α(q,2t) (π))|π ∈ SN } is a systematic t-block permutation code. sys Proof. It is clear by choice of E(π, S) that CB (N, K, t) is systematic. For any arbitrary two messages π1 , π2 ∈ SN , denote their corresponding codeword by σ1 = E(π1 , ϕ ◦ α(q,2t) (π1 )) and σ2 = E(π2 , ϕ ◦ α(q,2t) (π2 )), respectively. Suppose α1 = α(q,2t) (π1 ), α2 = α(q,2t) (π2 ), S1 = ϕ(α1 ) and S2 = ϕ(α2 ). Then σ1 = E(π1 , S1 ), σ2 = E(π2 , S2 ). Consider the following two cases: T (σ, u) , (σ1 , σ2 , · · · , σk−1 , σk+1 , · · · , σN ) , (50) where k = π −1 (u). Then, for any permutation σ ∈ SN +M and a set U ⊂ [N + M ], denote the truncation T (σ, U ) of σ on set U to be the sequence derived by removing the elements contained in U = {u1 , u2 , · · · , uM } from σ, i.e., T (σ, U ) , T (T (· · · , T (T (σ, u1 ), u2 ), · · · , u|U |−1 ), u|U | ). (51) Note that in this Definition 10, the ordering of u1 , · · · , u|U | has no impact on the value of T (σ, U ). The following is the example of the truncation of a permutation. Example 8. Suppose σ = (1, 4, 5, 2, 3, 9, 8, 6, 7), U = {4, 5, 9}, then T (σ, U ) = (1, 2, 3, 8, 6, 7) . Our decoding scheme has two major steps. Recall that α(q,2t) is defined in as the parity check sum of π. The first is to compute the parity check sum α = α(q,2t) (π) of π = T (σ, {N + 1, · · · , N + M }) from σ 0 . The second step is to apply the decoding algorithm proposed in Theorem 3 to the subsequence π 0 = T (σ 0 , {N + 1, · · · , N + M }) and compute π. The following Lemma 11 proves the decodability of the sequence S from S 0 , where S is the extension sequence of π in σ, by showing that the cardinality of the Hamming set H(S, S 0 ) does not exceed t. Therefore from equation (48) and Definition 9, we are able to compute S from S 0 since each 11 t-auxiliary set A(N, K, t) has the property that cardinalities of Hamming sets constructed from its pairwise distinct elements are at least 2t + 1. The parity check sum α is then uniquely derived from S. Lemma 11. Consider an arbitrary σ ∈ C = {E(π, ϕ ◦ α(q,2t) (π))|π ∈ SN }, for C defined in Theorem 2 (then σ ∈ SN +k ). Suppose there is a σ 0 such that dB (σ, σ 0 ) ≤ t. Let S = ϕ ◦ α(q,2t) (π) and π 0 = T (σ 0 , [N + 1 : N + M ]). Suppose σ 0 is the extension of π 0 on the extension sequence S 0 , i.e., σ 0 = E(π 0 , S 0 ), then H(S, S 0 ) ≤ t. (52) Proof. Suppose S = (s1 , s2 , · · · , sk ), S 0 = (s01 , s02 , · · · , s0k ). From Theorem 4, we know that S ∈ A(N, k, t). Denote M = {m|sm 6= s0m , 1 ≤ m ≤ k}. Then for all m ∈ M, sm 6= s0m , and there exists k(m), k 0 (m) ∈ [k], integers n1 , n2 , · · · , nk(m) , and n01 , n02 , · · · , n0k(m)0 ∈ [N + 1 : N + M ] such that the sequences pm = (sm , nk(m) , nk(m)−1 , · · · , n1 , N + m) and p0m = (s0m , n0k(m)0 , n0k(m)0 −1 , · · · , n01 , N + m) are subsequences of σ, σ 0 , respectively. Note that sm 6= s0m , which means that (sm , nk(m) , nk(m)−1 , · · · , n1 ) 6= (s0m , n0k(m)0 , n0k(m)0 −1 , · · · , n01 ). Let i(m) = min 1≤i≤min{k(m),k(m)0 } ni 6=n0i i. Then ni(m) 6= n0i(m) and ni(m)−1 = n0i(m)−1 , where we let n0 = n00 = N + m if i(m) = 1. Recall the notion of characteristic set in Definition 3. We know that (ni(m) , ni(m)−1 ) ∈ A(σ), (n0i(m) , n0i(m)−1 ) ∈ A(σ 0 ). These two conditions ni(m) 6= n0i(m) and ni(m)−1 = n0i(m)−1 imply that (ni(m) , ni(m)−1 ) ∈ (A(σ) \ A(σ 0 )) for all m ∈ M. Notice that for all sm ∈ {sm : m ∈ M} = H(S, S 0 ), the associated subsequences pm start with different sm and thus they do not overlap, which indicates that the pairs (ni(m) , ni(m)−1 ) are distinct. Then |A(σ) \ A(σ 0 )| ≥ |H(S, S 0 )|, which is equivalent to H(S, S 0 ) ≤ dB (σ, σ 0 ) ≤ t.  From Lemma 11, the receiver first computes π 0 = T (σ 0 , {N +1, · · · , N +k}) and derives the extension sequence S 0 such that σ 0 = E(π 0 , S 0 ). Then, the receiver decodes Ŝ = ϕ ◦ α(q,2t) (π) ∈ A(N, K, t) from S 0 such that |H(S, Ŝ)| ≤ t and derives α from S. From Lemma 9, we know that dB (π, π 0 ) ≤ dB (σ, σ 0 ) ≤ t. Then, the receiver can apply the decoding algorithm described in Section IV to compute π from π 0 and α reliably. The decoding scheme for the systematic t-block permutation code C constructed in Theorem 4 is then complete. C. Order-optimal Systematic t-Block Permutation Codes Theorem 4 presents the construction of systematic t-block permutation codes with K redundant symbols based on a tauxiliary set A(N, K, t). When N is sufficiently large and K is relatively small compared to N , the code rate is 1 − O( K N ), which is not necessarily order-optimal. In the forthcoming Theorem 5, we prove the existence of an order-optimal systematic t-block permutation code. Theorem 5 is based on Lemma 12 and Lemma 13, where we prove the existence of a t-auxiliary set A(N, K, t) with length K = O(t) when t is sufficiently small compared to N . We further provide a construction of A(N, 56t, t) in Theorem 7 based on Lemma 14 and Theorem 6. Then the permutation codes generated from this set in Theorem 4 are order-optimal. Lemma 12. (cf. [16, Problem 3.2]) For any integers (N ) N, l, a, m ∈ N∗ , where l ≤ N , a ≤ l, if m ≤ la 2 , then there (a) exists a set L(N, l, a) = {L1 , L2 , · · · , Lm } of m subsets of [N ] such that for all 1 ≤ i ≤ M , 1) |Li | = l. 2) ∀j 6= i and j ∈ [M ], |Li ∩ Lj | < a. We call L(N, l, a) that satisfies the above two conditions a (N, l, a)-set with cardinality m.  Proof. The proof is in Appendix I. Lemma 13. For all t, k, N ∈ N∗ , if N > 2k and 14+2c 1−c t ≤ k < N c for some constant c ∈ R, 0 < c < 1, there exists a t-auxiliary set A(N, k, t) with cardinality no less than q 4t−1 , where q is a prime number such that N 2 − N < q < 2(N 2 − N ). Proof. Let l = k, a = k − 2t, m = q 4t−1 in Lemma 12, we ( N ) know that if q 4t−1 < k−2t 2 , we can always find an (N, l, a)k ) (k−2t set L(N, l, a) with cardinality m. c Notice that for all integers k, t such that 14+2c 1−c t ≤ k < N for some constant 0 < c < 1,   2 N k / k − 2t k − 2t N (N − 1) · · · (N − k + 2t + 1)/(k − 2t)!  = = 2 (k(k − 1) · · · (k − 2t + 1)) /((2t)!)2 N (N − 1) · · · (N − k + 2t + 1)((2t)!)2 2 (k(k − 1) · · · (k − 2t + 1)) (k − 2t)! N (N − 1) · · · (N − k + 6t + 1) > (k − 2t)! N (N − 1) · · · (N − k + 6t + 1) > 2(k−2t+1) log (k−2t)−k+2t+2 N (N − 1) · · · (N − k + 6t + 1)2k−2t > (k − 2t)(k−2t) k−6t 4t N 2 > c(k−2t) N =N (1−c)k−(6+2c)t 24t >N 8t 24t = (2N 2 )4t > q 4t−1 . From the above equation and Lemma 12, such an (N, k, k− 2t)-set L(N, k, k − 2t) with cardinality m exists. In this set, for all i 6= j ≤ q 4t−1 , |Li ∩ Lj | < k − 2t. For each Li ∈ L(N, k, k − 2t) = (L1 , · · · , Lm ), 1 ≤ i ≤ q 4t−1 ≤ m, let ci be an arbitrary permutation of elements in Li . Let A(N, k, t) = {ci |1 ≤ i ≤ q 4t−1 }. Then |H(ci , cj )| = dH (ci , cj ) ≥ k − |Li ∩ Lj | > k − (k − 2t) = 2t for all 12 d 1 ≤ i < j ≤ q 4t−1 . Therefore A(N, k, t) is a t-auxiliary set. The lemma is proved.  Given that x1 , x2 ∈ [q] , x1 6= x2 , then γ1 6= γ2 . From Lemma 14 we know that Theorem 5. There exists a systematic t-block √ permutation 1 code with 30t redundant symbols when t < 30 N. |γ1 − γ2 | ≥ LCM (N + i1 , N + i2 , · · · , N + iM ) > N M − 2 . k Proof. Let c = 12 in Lemma 13, then there exists a t-auxiliary set A(N, 30t, t) with at least q 4t−1 elements. From Theorem 4, sys the code CB (N, t) = {E(π, ϕ ◦ α(q,2t) (π))|π ∈ SN } based on A(N, 30t, t) is a systematic t-block permutation code with k = 30t redundant symbols.  Moreover, we know from x1 , x2 ∈ [q] , x1 6= x2 , that 0 ≤ γ1 , γ2 < q d and γ1 6= γ2 . Therefore, Remark 7. A code that satisfies Theorem 5 is order-optimal when N is sufficiently large. According to the above two inequalities, N M − 2 < |γ1 − γ2 | < q d < (2N 2 )d is true, which means that M − k2 < d(2 + logN 2). Therefore M < k2 + d(2 + logN 2), and then Based on the upcoming Lemma 14 and Theorem 6, we provide an explicit construction of a t-auxiliary set of length 56t in Theorem 7, from which we are able to explicitly construct an order-optimal permutation code by Theorem 4. Lemma 14. For all k, N ∈ N∗ , k > 3, N > k 2 , consider an arbitrary subset Y ⊂ [k], where |Y | = M < k, Y = {i1 , i2 , · · · , iM }, then k LCM (N + i1 , N + i2 , · · · , N + iM ) > N M − 2 .  Theorem 6. For all N, k, d ∈ N∗ , N > k 2 , k > 3, define a d function β (q,d,k) : [q] → [N + 1] × [N + 2] × · · · × [N + k] as below: β (q,d,k) (x) = (q,d,k) (q,d,k) β1 (x), β2 (x), · · · · · · , γ(x) mod (N + k)). (54) d d P xi q i−1 . Then i=1 d ∀ x1 , x2 ∈ [q] , x1 6= x2 , dH (β (q,d,k) (x1 ), β (q,d,k) (x2 )) > k − d(2 + logN 2). (55) 2 d Proof. For arbitrary x1 , x2 ∈ [q] , x1 6= x2 , let β1 β (q,d,k) (x1 ), β2 = β (q,d,k) (x2 ). Let Z = {i : β1,i β2,i , 1 ≤ i ≤ d}, then dH (β (q,d,k) (x1 ), β (q,d,k) (x2 )) k − |Z| = k − M , where M = |Z|. Suppose Z = {i1 , i2 , · · · , iM }. Let γ1 = γ(x1 ), γ2 γ(x2 ). From the definition of β (q,d,k) , we know that    γ1 ≡ γ2 mod (N + i1 )    γ1 ≡ γ2 mod (N + i2 ) ..   .    γ1 ≡ γ2 mod (N + iM ). Then, γ1 ≡ γ2 k dH (β1 , β2 ) = k − M > k − ( k + d(2 + logN 2)) 2 k − d(2 + logN 2). 2 The theorem is proved. =  Example 9. Let k = 7, N = 50, d = 1, q = 2503, x1 = (280), x2 = (1008), then γ1 = 280, γ2 = 1008, and mod LCM (N + i1 , N + i2 , · · · , N + iM ) . β1 =(280 mod 51, 280 mod 52, · · · , 280 mod 57) =(25, 20, 15, 10, 5, 0, 52). β2 =(1008 mod 51, 1008 mod 52, · · · , 1008 mod 57) =(39, 20, 1, 36, 18, 0, 39). Then dH (β1 , β2 ) = 5 > accordance with Theorem 6.  (q,d,k) , βd (x) ,(γ(x) mod (N + 1), γ(x) mod (N + 2), where x = (x1 , x2 , · · · , xd ) ∈ [q] , γ(x) , |γ1 − γ2 | < q d . (53) Proof. The proof is in Appendix J.  d = = = = k 2 − d(2 + logN 2), which is in Based on Theorem 6, we provide an explicit construction of a t-auxiliary set A(N, 56t, t) in the following Theorem 7. √ Theorem 7. For all N, k, t ∈ N∗ , k ≥ 28t, k < b N − 12 c. 4t−1 Suppose [q] = {x1 , x2 , · · · , xq4t−1 }, where q is a prime number such that N 2 − N < q < 2N 2 − 2N . For any   s ∈ q 4t−1 , suppose xs = (x1 , x2 , · · · , x4t−1 ), let cs = (c1 , c2 , · · · , c2k ), β (q,4t−1,k) (x) = (β1 , β2 , · · · , βk ) for all 1 ≤ i ≤ k, where cs is defined as follows: (  N c2i = (i − 1)b N k c + 1 + βi mod b k c , (56) βi c2i−1 = (i − 1)b N c. k c + 1 + bbN c k   Then A(N, 2k, t) = {cs : s ∈ q 4t−1 } is a t-auxiliary set with cardinality q 4t−1 . 4t−1 Proof. For any x1 , x2 ∈ [q] , x1 6= x2 , let β1 = β (q,4t−1,k) (x1 ), β2 = β (q,4t−1,k) (x2 ). Then from Theorem 6, we know that k − (4t − 1)(2 + logN 2) 2 k 28t > − (12t − 3) > − 12t = 2t. 2 2 In equation (56), let mi = (i − 1)b N k c + 1. Notice that (c2i−1 − mi )b N c + (c − m ) = β . Given βi < N + k for 2i i i k √ all 1 ≤ i < k, and k < b N − 21 c, then dH (β1 , β2 ) > 13 !2 N √ −1 N − 32  2  2 √ √ 3 1 > N + −1 = N+ 2 2 √ > N + N > N + k > βi . N b c2 > k  2 N −1 ≥ k Therefore (c2i−1 − mi , c2i − mi ) is exactly the b N k c-ary representation of βi , for all 1 ≤ i ≤ k. Suppose β1 = (β1,1 , β1,2 , · · · , β1,k ) and β2 = (β2,1 , β2,2 , · · · , β2,k ). Let Y = {i : β1,i 6= β2,i , 1 ≤ i ≤ k}, then |Y | = dH (β1 , β2 ). Notice that for all i ∈ Y , β1,i 6= β2,i , then either c1,2i−1 − mi 6= c2,2i−1 − mi or c1,2i − mi 6= c2,2i − mi , which means that |H(c1 , c2 ) ∩ {c1,2i−1 , c1,2i }| ≥ 1, i ∈ Y. (57) N Notice that (i − 1)b N k c < c1,2i−1 , c1,2i ≤ ib k c, therefore {c1,2i−1 , c1,2i } ∩ {c1,2i0 −1 , c1,2i0 } = ∅, ∀ 1 ≤ i < i0 ≤ k. (58) From (57) and (58), i=1 ≥ |H(c1 , c2 ) ∩ {c1,2i−1 , c1,2i }| i∈Y ≥ X 1 = |Y | = dH (β1 , β2 ) > 2t. i∈Y From Definition 9, A(N, k, t) is indeed a t-auxiliary set.  Remark 8. Let k = 28t in the above Theorem 7 to construct sys a t-auxiliary set A(N, 56t, t). Then the code CB (N, 56t, t) constructed in Theorem 4 based on A(N, 56t, t) is an orderoptimal systematic t-block permutation codes. 16t(2 log N + 1) log N ! 32t log N + 16t >1− . N log N − (log e)N + 21 log N RG (N, t) = RB (N, 4t) > 1 − (61) Then it follows that RG (N, t) − Rρg C (N, t)  2N − (32t log N + 16t) + O (log N )2 > > 0, N log N − (log e)N + 21 log N (62) Based on Remark 8 in section V, we presented a con0 struction of systematic t-generalized Cayley code CG (N, t) = sys sys 0 CB (N, 56 · 4t, 4t) = CB (N, 224t, 4t) with rate RG (N, t). 0 In the next Lemma 16, we compare the rate of CG (N, t) with that of Aρg C (N, t). 0 Lemma 16. RG (N, √ t) > Rρg C (N, t) when t N 1 min{ 112 log N , 112 b N − 12 c} for sufficiently large N . In section IV, we can construct a t-generalized Cayley code CG (N, t) = Cα (N, 4t) with rate RG (N, t). In [5], a tgeneralized Cayley code Aρg C (N, t) with rate Rρg C (N, t) was constructed. We next compare the rates of these two codes in Lemma 15. N (16 log N +8) < Proof. For sufficiently large N , it follows from Lemma 15 and Lemma 6 that Rρg C (N, t) < 1 − VI. R ATE A NALYSIS Lemma 15. RG (N, t) > Rρg C (N, t) when t < for sufficiently large N . And we know from Lemma 6 that: for sufficiently large N and t < (16 logNN +8) . From the above discussion, our proposed code in Section IV indeed has a higher rate than the interleaving-based code for sufficiently small t.  k X |H(c1 , c2 ) ∩ {c1,2i−1 , c1,2i }| |H(c1 , c2 )| = X log|Aρg C (N, t)| log N !  N log N − (2 + log e)N + O (log N )2 < N log N − (log e)N + 21 log N  2N + 12 log N + O (log N )2 =1− N log N − (log e)N + 12 log N  2N + O (log N )2 =1− . N log N − (log e)N + 12 log N (60) Rρg C (N, t) =  2N + O (log N )2 . N log N − (log e)N + 12 log N (63) And we know from Lemma 6 that: 224t log N log N ! 224t log N >1− N log N − (log e)N + 0 RG (N, t) > 1 − (64) 1 2 log N . Then it follows that Proof. We know from [12, Appendix A] that: 0 RG (N, t) − Rρg C (N, t) 2  log|Aρg C (N, t)| ≤ N log N − (2 + log e)N + O (log N ) . (59) Therefore for sufficiently large N , it follows from Lemma 6 that  (65) 2N − 224t log N + O (log N )2 > > 0, 1 N log N − (log e)N + 2 log N √ 1 1 for sufficiently large N and t < min{ 112 N log N , 112 b N − 2 c}. 14 From the above discussion, our proposed systematic code indeed has a higher rate than the interleaving-based code for sufficiently small t in the generalized Cayley distance.  VII. C ONCLUSION The generalized Cayley metric is a distance measure that generalizes the Kendall-tau metric and the Ulam metric. Interleaving was previously shown to be efficient in constructions of permutation codes in the generalized Cayley metric. However, interleaving incurs a noticeable rate penalty such that the constructed permutation codes cannot be order-optimal. In this paper, we presented a construction of order-optimal permutation codes, which is not necessarily systematic, in the generalized Cayley metric, without interleaving. Based on this method, we then came up with an explicit construction of systematic permutation codes from extensions of permutations. We further proved the existence of order-optimal systematic codes in this configuration and provided a explicit construction. Later on, we proved that our proposed codes are more rate efficient than the existing coding schemes based on interleaving for sufficiently large N when t is relatively small. In future work, we seek to find corresponding results in the binary case, which is expected to be useful in the synchronization of binary files. A majority of currently existing synchronization method of binary files focus on errors that are i.i.d.. However, they are not efficient in correcting highlyconcentrated errors such as the exchange of two paragraphs. This motivates the extension of this research towards binary generalized Cayley codes. A PPENDIX A P ROOF OF L EMMA 1 Proof. We know from the symmetry property of block permutation distance that it is enough for us to prove that dB (π1 , π2 ) = |A(π1 ) \ A(π2 )|. Suppose π1 , π2 ∈ SN such that dB (π1 , π2 ) = d, then from the definition of block permutation distance we know that π1 , π2 satisfy (5) for some σ ∈ Sd+1 and some ψ1 , ψ2 , · · · , ψd+1 . Suppose ψk = π1 [ik−1 + 1 : ik ] for 1 ≤ k ≤ d + 1, where 0 = i0 < i1 · · · < id < id+1 = N . Then ∀ i ∈ [N − 1] we have |B(π)| = |A(π) \ A(e)| = wB (π). Denote B1 = B(π1 ), B2 = B(π2 ), B3 = B(π1 ∀ i ∈ B3 , we have: (66) ◦ π2 ). Then π1 (π2 (i + 1)) 6= π1 (π2 (i)) + 1. Then i must satisfy at least one of the conditions below: {π2 (i + 1) 6= π2 (i) + 1}, or {π2 (i) = k and π1 (k + 1) 6= π1 (k) + 1}. (67) Equation (67) means that either i ∈ B2 or π2 (i) ∈ B1 is true. Then we define an injection f : (B \ B2 ) → B1 as below. f (i) , π2 (i). which means that |B| = |B \ B2 | + |B ∩ B2 | ≤ |B1 | + |B2 |. (68) We know from (66) that (68) is equivalent to wB (π1 ◦ π2 ) ≤ wB (π1 ) + wB (π2 ) .  A PPENDIX C P ROOF OF L EMMA 4 Proof. Suppose the number of permutations of length N with block permutation weight m is F (m), then bB (N, t) = t P F (m). m=0 We know from [17, equation (3)] that F (0) = 1, and for all m > 1,  F (m) =  X m N −1 (k + 1) . m! (−1)m−k (m − k)! m (69) k=0 (k+1) ≤ m+1, 0 ≤ k ≤ m, then am = m+1 > Let ak = (m−k)! am−1 = m > am−2 > · · · > a0 holds. For arbitrary k, we have ( 1, i ∈ / {i1 , · · · , id }, I [(π1 (i), π1 (i + 1)) ∈ A(π2 )] = 0, i ∈ {i1 , · · · , id }. Therefore |A(π1 ) \ A(π2 )| = |{i1 , · · · , id }| = d. The lemma is proved. which indicates that k X a2k − a2k−1 + · · · + a0 = a0 + (a2i − a2i−1 ) > 0,  A PPENDIX B P ROOF OF L EMMA 2 a2k−1 − a2k−2 + · · · − a0 = i=1 k X (a2i−1 − a2i−2 ) > 0. i=1 Proof. Define B(π) as below, Therefore B(π) , {i|π(i + 1) 6= π(i) + 1, 1 ≤ i < N }. Then we know that A = m + 1 − (am−1 − am−2 + · · · + (−1)m−1 a0 ) < m + 1, A = m + 1 − m + (am−2 − am−3 + · · · + (−1)m a0 ) > 1, B(π) = {i|(π(i), π(i + 1)) ∈ (A(π) \ A(e)) , 1 ≤ i < N }, and 15 1≤A= m X A PPENDIX D P ROOF OF L EMMA 5 (−1)m−k k=0 (k + 1) ≤ m + 1. (m − k)! From the above discussion, we know that     N −1 N −1 m! ≤ F (m) ≤ (m + 1)!. m m To derive the upper bound of the ballsize bB (N, t), we have  F (m) ≤  m Y N −1 (m + 1)! = (m + 1) · (N − k). m k=1 Proof. The upper bound is derived from (16) by replacing t by 4t and applying (14). For every π ∈ BG (N, t, e), we know that dG (π, e) ≤ t. Then from (14), we have dB (π, e) ≤ 4dG (π, e) ≤ 4t, which means that π ∈ BB (N, 4t, e). Therefore BG (N, t, e) ⊆ BB (N, 4t, e), which implies that bG (N, t) ≤ bB (N, 4t). From (16) we will get the upper bound. For the lower bound, let DB (N, 4t) be the set of all permutations that have block permutation weight 4t. Let K = |BG (N, t, e) ∩ DB (N, 4t)|, then bG (N, t) > K. For any π ∈ DB (N, 4t), there exists some σ ∈ D4t+1 (recall D4t+1 is defined in Subsection A Section II as the set of all minimal permutations with length 4t + 1) and ψ1 , ψ2 , · · · , ψ4t+1 such that √ √ For t ≤ N − N − 1, we have i ≤ N − N − 1 for all 1 ≤ i ≤ t. Therefore for all 1 ≤ i ≤ t, (N − i − 1)2 ≥ (N − (N − √ Then we have dG (e, π) = dG (e, σ). If π ∈ (BG (N, t, e) ∩ DB (N, 4t)) , then dG (e, σ) ≤ t, which means that σ ∈ −1 BG (4t + 1, t, e). We know that there are N4t different partitions of e, each with the form e (ψ1 , ψ2 , · · · , ψ4t+1 ). For each such partition {ψi , 1 ≤ i ≤ 4t + 1} and any permutation σ ∈ (BG (4t + 1, t, e)∩ D4t+1 ), the permutation π = ψσ(1) , ψσ(2) , · · · , ψσ(4t+1) ∈ (BG (N, t, e) ∩ DB (N, 4t)). Suppose that there are x = |BG (4t + 1, t, e) ∩ D4t+1 | different −1 such σ’s, then K ≥ N4t x. We only need to lower bound x. For any partition that divides {2, 4, · · · , 4t} into t different subsets with cardinality 2, we can apply t generalized transpositions to the identity permutation e to exchange the elements in each subset and get permutation σ. Then all even numbers in e are not in their original position, and all odd numbers are not changed. Therefore, no consecutive pairs in e appear in σ, which means σ ∈ (BG (4t + 1, t, e) ∩ D4t+1 ). There are (2t)! 2t t! such (2t)! N −1 partitions, therefore x ≥ 2t t! . From bG (N, t) ≥ 4t x the lower bound follows. The lemma is proved.  N ))2 = N ≥ i + 1. Then, bB (N, t) t X = F (i) i=0 t i X Y (i + 1) · (N − k) ≤1 + i=1 t X =1 + =1 + = = = ≤ t Y k=1 (N − (N − i − 1)) · i=1 t X i Y i=1 k=0 i Y (N − k) k=1 i+1 Y (N − k) − ! (N − k) k=1 (N − k) − t X i+1 Y (N − k) − k=0 t Y i=1 k=1 t i−1 X Y k=0 t Y i=1 k=1 t i−1 X Y k=0 t Y i=1 k=1 (N − k) − (N − k) − i−1 Y e = (ψ1 , ψ2 , · · · , ψ4t+1 ) ,  π = ψσ(1) , ψσ(2) , · · · , ψσ(4t+1) . ! (N − k) k=0 A PPENDIX E P ROOF OF L EMMA 7 (N − k) ((N − i)(N − i − 1) − N ) Proof. Let B1 = ν(π1 ), B2 = ν(π2 ). We prove the statement by contradiction. If the lemma is not true, i.e., |B1 ∆B2 | ≤ 2d, then k = |D1 | = |D2 | ≤ d, where D1 = B1 \ B2 , D2 = B2 \ B1 . Suppose D1 = {x1 , x2 , · · · , xk }, D2 = {xk+1 , xk+2 , · · · , x2k }. Then, α(q,d) (π1 ) = α(q,d) (π2 ) is equivalent to the following equations.  (N − k) (N − i − 1)2 − i − 1 (N − k). k=0 For the lower bound, we know that bB (N, t) = t X F (i) ≥ 1 + i=0 The lemma is proved. t Y i X i=1 k=1 (N − k) ≥ t Y (N − k). k=1       x1 + · · · + xk x21 + · · · + x2k     x12d−1 + · · · + xk2d−1 = = .. . xk+1 + · · · + x2k , x2k+1 + · · · + x22k , 2d−1 = xk+1 + · · · + x2d−1 . 2k From (70), it follows that (70) 16  1 x2 x22 .. . ··· ··· ··· .. . 1 x2k x22k .. . x2d−1 2 ··· x2d−1 2k 1 x1 x21 .. .       x2d−1 1                  y = 0,              T where y = [y1 , y2 , · · · , y2k ] , and ( 1, 1 ≤ i ≤ k, yi = −1, k < i ≤ 2k. Given that 2k ≤ 2d,  1  x1  2  x1   ..  . x2k−1 1 Then (36) is true iff si = s0i for all N − 3t ≤ i ≤ N + t − 2, which is equivalent to the following equation: the above equation implies that  1 ··· 1 x2 ··· x2k   2 x2 ··· x22k   y = 0. .. ..  .. . . .  x2k−1 2 ···  (71) x2k−1 2k Denote the Vandermonde matrix in equation (71) by U. Then y is in the nullspace of U. Therefore U is singular, and it implies that the determinant of U is equal to 0, i.e., Y 0 = det U = (xi − xj ) . (72) 1≤i<j≤2k As q is a divisor of 0, q should also be a divisor of the right hand of equation (72), which implies that ∃ i 6= j ∈ [2k] such that q|(xi − xj ). Then xi = xj on Fq , and we must have xi ∈ D1 , xj ∈ D2 or xi ∈ D2 , xj ∈ D1 , which implies that xi , xj ∈ D1 ∩ D2 , which is a contradiction. The lemma is proved.  Proof. Suppose f1 = X N −1 + a1 X N −2 + · · · + a4t−1 X N −4t + g1 , f2 = X + a01 X N −2 + ··· + a04t−1 X N −4t + g2 . (73) Additionally, suppose h1 · f1 = X N +t−1 + βN +t−2 X N +t−2 + · · · + β0 , 0 N +t−2 h2 · f2 = X N +t−1 + βN + · · · + β00 . +t−2 X Then from (73) and (38) it follows that the first 4t coefficients of h1 · f1 can be represented by {ai }, {ci } as below:                        sN +t−2 = a1 + c1 , sN +t−3 = a2 + c1 a1 + c2 , .. . sN −1 = at + c1 at−1 + · · · + ct , .. . sN −3t = a4t−1 + c1 a4t−2 + c2 a4t−3 + · · · + ct a3t−1 . Similarly, we also have 1 a1 .. .       at−1   .  .. a4t−2 1  a01   ..  .  0  at−1   .  .. a04t−2  1 .. . at−2 .. . a4t−3 .. . ··· .. . ···     a1  c1     c2   a2   .  +  .  = 1    ..   ..  ..  c a4t−1 t .  a3t−1   1 .. . a0t−2 .. . a04t−3 .. . ··· .. . ··· (74)  0   0  a  c1   0   10   c2   a2   .  +  . . 1    ..   ..  ..  c0 a04t−1 t .  a03t−1 We note that (74) is equivalent to (41).  A PPENDIX G P ROOF OF L EMMA 9 Proof. Let σ1 = E(π1 , s1 ), σ2 = E(π2 , s2 ). Recall the notion of characteristic sets in Definition 3. Suppose A(π1 ), A(π2 ), A(σ1 ), A(σ2 ) are the characteristic sets of π1 , π2 , σ1 , σ2 , respectively. According to Lemma 1, A PPENDIX F P ROOF OF L EMMA 8 N −1 s0N +t−2 = a01 + c01 , s0N +t−3 = a02 + c01 a01 + c02 , .. . s0N −1 = a0t + c01 a0t−1 + · · · + c0t , .. . s0N −3t = a04t−1 + c01 a04t−2 + c02 a04t−3 + · · · + c0t a03t−1 . dB (π1 , π2 ) = |A(π1 ) \ A(π2 )|, dB (σ1 , σ2 ) = |A(σ1 ) \ A(σ2 )|. (75) Let k1 = π1−1 (s1 ), k2 = π2−1 (s2 ), then π1,k1 = s1 and π2,k2 = s2 . If 1 ≤ k1 , k2 < N , let π1,k1 +1 = j1 and π2,k2 +1 = j2 . Suppose first s1 is a jump point, then consider the following cases. 1) s1 6= s2 and either k1 = N or k2 = N . a) k1 = k2 = N . In this case, A(σ1 ) = A(π1 ) ∪ {(s1 , N + 1)}, A(σ2 ) = A(π2 ) ∪ {(s2 , N + 1)}. Therefore, A(σ1 )\A(σ2 ) = (A(π1 ) \ A(π2 ))∪{(s1 , N +1)}. From (75) we know that dB (σ1 , σ2 ) = dB (π1 , π2 ) + 1. b) k1 = N 6= k2 . In this case, A(σ1 ) = A(π1 ) ∪ {(i1 , N + 1)}, A(σ2 ) = (A(π2 ) \ {(s2 , j2 )}) ∪ {(s2 , N +1), (N +1, j2 )}. Therefore, A(σ1 )\A(σ2 ) = (A(π1 ) \ (A(π2 ) \ {(s2 , j2 )})) ∪ {(s1 , N + 1)}, which means (A(π1 ) \ A(π2 )) ∪ {(s1 , N + 1)} ⊆ A(σ1 ) \ A(σ2 ). From (75) we know that dB (σ1 , σ2 ) ≥ dB (π1 , π2 ) + 1. 17 c) k2 = N 6= k1 . Following the same logic in the previous case, we know that dB (σ1 , σ2 ) ≥ dB (π1 , π2 ) + 1. 2) s1 6= s2 , k1 , k2 6= N . Since s1 is a jump point, j1 6= j2 . a) In this case, A(σ1 ) = (A(π1 ) \ {(s1 , j1 )}) ∪ {(s1 , N + 1), (N + 1, j1 )}, A(σ2 ) = (A(π2 ) \ {(s2 , j2 )}) ∪ {(s2 , N + 1), (N + 1, j2 )}. Therefore, ((A(π1 ) \ A(π2 )) \ {(s1 , j1 )}) ∪ {(s1 , N + 1), (N + 1, j1 )} ⊆ A(σ1 ) \ A(σ2 ). From (75) we know that dB (σ1 , σ2 ) ≥ dB (π1 , π2 ) + 1. If i1 is not a jump point, then consider the following cases. 1) s1 = s2 and either k1 = N or k2 = N a) k1 = k2 = N . In this case, A(σ1 ) = A(π1 ) ∪ {(s1 , N + 1)}, A(σ2 ) = A(π2 ) ∪ {(s1 , N + 1)}. Therefore, A(σ1 ) \ A(σ2 ) = (A(π1 ) \ A(π2 )). From (75) we know that dB (σ1 , σ2 ) = dB (π1 , π2 ). b) k1 = N 6= k2 . In this case, A(σ1 ) = A(π1 ) ∪ {(s1 , N + 1)}, A(σ2 ) = (A(π2 ) \ {(s1 , j2 )}) ∪ {(s1 , N +1), (N +1, j2 )}. Therefore, A(σ1 )\A(σ2 ) = (A(π1 ) \ (A(π2 ) \ {(s1 , j2 )})) = (A(π1 ) \ A(π2 )). From (75) we know that dB (σ1 , σ2 ) = dB (π1 , π2 ). c) k2 = N 6= k1 . Follow the same logic in the previous case, we know that dB (σ1 , σ2 ) = dB (π1 , π2 ). 2) k1 , k2 6= N . Since s1 is not a jump point, either s1 = s2 or j1 = j2 must be satisfied. a) s1 = s2 and j1 = j2 . In this case, A(σ1 ) = (A(π1 ) \ {(s1 , j1 )}) ∪ {(s1 , N + 1), (N + 1, j1 )}, A(σ2 ) = (A(π2 ) \ {(s1 , j1 )}) ∪ {(s1 , N + 1), (N + 1, j1 )}. Therefore, A(σ1 ) \ A(σ2 ) = A(π1 ) \ A(π2 ). From (75) we know that dB (σ1 , σ2 ) = dB (π1 , π2 ). b) s1 = s2 and j1 6= j2 . In this case, A(σ1 ) = (A(π1 ) \ {(s1 , j1 )}) ∪ {(s1 , N + 1), (N + 1, j1 )}, A(σ2 ) = (A(π2 ) \ {(s1 , j2 )}) ∪ {(s1 , N + 1), (N + 1, j2 )}. Therefore, A(σ1 ) \ A(σ2 ) = ((A(π1 ) \ A(π2 )) \ {(s1 , j1 )}) ∪ {(N + 1, j1 )}. From (75) we know that dB (σ1 , σ2 ) = dB (π1 , π2 ). c) s1 6= s2 and j1 = j2 . Follow the same logic as indicated in the previous case, we know that dB (σ1 , σ2 ) = dB (π1 , π2 ). The lemma is proved.  A PPENDIX H P ROOF OF L EMMA 10 Proof. For all i ∈ H(S1 , S2 ), let m(i) = min{m : s1,m = i, s2,m 6= i}. (76)  Suppose J1,m(i) = s1,1 , s1,2 , · · · , s1,m(i)−1 , J2,m(i) =  m(i) s2,1 , s2,2 , · · · , s2,m(i)−1 . Let σ1 = E(π1 , J1,m(i) ) and m(i) = E(π2 , J2,m(i) ). Recall the definition of the jump set σ2 F (π1 , π2 , S1 , S2 ) in Definition 7. Consider the following two cases: 1) If m(i) ∈ F (π1 , π2 , S1 , S2 ), then s1,m(i) = i is m(i) a jump point of E(σ1 , s1,m(i) ) with respect to m(i) E(σ2 , s2,m(i) ). 2) If m(i) ∈ / F (π1 , π2 , I1 , I2 ), then i is not a jump point m(s) m(s) of E(σ1 , s1,m(i) ) with respect to E(σ2 , s2,m(i) ). m(i) Let k10 = (σ1 )−1 (s1,m(i) ), k1 = π1−1 (s1,m(i) ), k20 = m(i) m(i) (σ2 )−1 (s2,m(i) ), k2 = π2−1 (s2,m(i) ), then σ1,k0 = 1 m(i) π1,k1 = s1,m(i) and σ2,k0 = π2,k2 = s2,m(i) . Given that 2 s1,m(i) is not a jump point and s1,m(i) = s 6= s2,m(i) , we know from Definition 6 that k1 , k2 6= N + m(i) − 1 m(i) m(i) m(i) and σ1,k0 +1 = σ2,k0 +1 must be true. Let j = σ1,k0 +1 = m(i) 1 2 1 σ2,k0 +1 . We know from equation (76) that π1,k1 +1 = 2 π2,k2 +1 = j ∈ [N ], otherwise N < j < N + m(i) is inserted after i in π1 and is not inserted after i in π2 , a contradiction. Then (i, j) ∈ A(π1 ), (s2,m(i) , j) ∈ A(π2 ) and s2,m(i) 6= i. Therefore (i, j) ∈ (A(π1 ) \ A(π2 )). Suppose J = {i|m(i) ∈ / F (π1 , π2 , S1 , S2 ), i ∈ H(S1 , S2 )}, then from the above discussion: |F (π1 , π2 , S1 , S2 )| ≥ |H(S1 , S2 ) \ J|, dB (π1 , π2 ) = |A(π1 ) \ A(π2 )| ≥ |J|. And from Lemma 9 we know that dB (E(π1 , S1 ), E(π2 , S2 )) ≥dB (π1 , π2 ) + |F (π1 , π2 , S1 , S2 )| ≥|H(S1 , S2 ) \ J| + |J| ≥|H(S1 , S2 )|. The lemma is proved.  A PPENDIX I P ROOF OF L EMMA 12 Proof. Denote the set of all subsets of [N ] with cardinality l by B. Let Lmax be the largest (N, l, a)-set. Suppose that k = |Lmax | < m. Otherwise  if k  < m, and for each set Li ∈ Lmax , there are at most al n−a |Li ∩ l−a sets Lj ∈ B that satisfy   l n−a Lj | ≥ a for j 6= i. Then there will be at most k a l−a < 2   −a  m(al ) N  −a)! < Nl = |B| m al Nl−a = m al (N (N l −l)!(l−a)! = (N ) a sets Lj ∈ B such that each such set has an intersection with cardinality no less than a with at least one of the sets in Lmax . Then there exists a set Lk+1 ∈ B such that for all Li ∈ Lmax , |Li ∩ Lk+1 | < a. Then {Lk+1 } ∪ Lmax is an (N, l, a)-set that satisfies the two conditions with cardinality k + 1. The cardinality of this newly constructed (N, l, a)-set is larger than that of Lmax . Contradiction! Therefore k ≥ m must be true, the lemma is proved.  A PPENDIX J P ROOF OF L EMMA 14 Proof. From [18, equation (13)], we know that for all r, n ∈ N∗ gr (n) = GCD(r!, (n + r)gk−1 (n)), (77) where for all r ∈ N, n ∈ N∗ , gr (n) = n(n + 1) · · · (n + r) . LCM(n, n + 1, · · · , n + r) (78) From (77) and (78), we know that gr (n)|r!, ∀r, n ∈ N∗ , (79) 18 which implies that n(n + 1) · · · (n + r) ≤ r!. LCM(n, n + 1, · · · , n + r) (80) Let n = N + 1, r = k − 1 in (80), we know that for all N, k ∈ N∗ , LCM (N + 1, N + 2, · · · , N + k) (N + 1)(N + 2) · · · (N + k) ≥ . (k − 1)! (81) Let [K] \ Y = {j1 , j2 , · · · , jk−M }. Notice that LCM (N + 1, N + 2, · · · , N + k) =LCM(LCM (N + i1 , N + i2 , · · · , N + iM ) , LCM (N + j1 , N + j2 , · · · , N + jk−M )) "k−M # Y ≤ (N + js ) LCM (N + i1 , N + i2 , · · · , N + iM ) . s=1 (82) From equation (81) and (82), LCM (N + 1, N + 2, · · · , N + iM ) LCM(N + 1, N + 2, · · · , N + k) ≥ k−M Q (N + js ) s=1 (N + 1)(N + 2) · · · (N + k) ≥ k−M Q (k − 1)! (N + js ) s=1 M Q = (N + is ) s=1 (k − 1)! > NM . k! From Lemma 6, for all k > 3 and N > k 2 , k NM NM N M 2k−2 NM ≥ > N M− 2 . > (k+1) log k−k+2 = k+1 k k! k k 2 The lemma is proved.  ACKNOWLEDGMENT Research supported in part by NSF CAREER grant No.1150212 and NSF CIF grant No.1527130. R EFERENCES [1] S. Yang, C. Schoeny, and L. Dolecek, “Order-optimal permutation codes in the generalized Cayley metric,” in IEEE Information Theory Workshop, Kaohsiung, Taiwan, Nov 2017, pp. 234–238. [2] I. Dixon and G. Whittaker, Eds., Storing your music in the iCloud. Apress, 2015. [3] R. Zeira and R. Shamir, “Sorting by cuts, joins and whole chromosome duplications,” Journal of Computational Biology, vol. 24, pp. 127–137, 2017. [4] K.-T. Chen, C.-L. Li, H.-T. Chiu, and C. L. Lu, “An efficient algorithm for one-sided block ordering problem under block-interchange distance,” Theoretical Computer Science, vol. 609, pp. 296 – 305, 2016. [5] Y. M. Chee and V. K. Vu, “Breakpoint analysis and permutation codes in generalized Kendall tau and Cayley metrics,” in Proc. IEEE Int. Symp. Inf. Theory, Hawaii, USA, Jun. 2014, pp. 2959–2963. [6] S. Buzaglo, E. Yaakobi, T. Etzion, and J. Bruck, “Systematic errorcorrecting codes for permutations and multi-permutations,” IEEE Trans. Inf. Theory, vol. 62, no. 6, pp. 3113–3124, Jun. 2016. [7] S. Buzaglo and T. Etzion, “Bounds on the size of permutation codes with the Kendall tau-metric,” IEEE Trans. Inf. Theory, vol. 61, no. 6, pp. 3241–3250, Jun. 2015. [8] Y. Zhang and G. Ge, “Snake-in-the-box codes for rank modulation under Kendall’s τ -metric,” IEEE Trans. Inf. Theory, vol. 62, no. 1, pp. 151– 158, Jan. 2016. [9] F. Farnoud and O. Milenkovic, “Multipermutation codes in the ulam metric for nonvolatile memories,” IEEE J. Sel. Areas Commun., vol. 32, no. 5, pp. 919–932, May 2014. [10] F. Farnoud, V. Skachek, and O. Milenkovic, “Error-correction in flash memories via codes in the Ulam metric,” IEEE Trans. Inf. Theory, vol. 59, no. 5, pp. 3003–3020, May 2013. [11] F. Göloǧlu, J. Lember, A. E. Riet, and V. Skachek, “New bounds for permutation codes in Ulam metric,” in Proc. IEEE Int. Symp. Inf. Theory, Hong Kong, Jun. 2015, pp. 1726–1730. [12] R. Gabrys, E. Yaakobi, F. Farnoud, F. Sala, J. Bruck, and L. Dolecek, “Codes correcting erasures and deletions for rank modulation,” IEEE Trans. Inf. Theory, vol. 62, no. 1, pp. 136–150, Jan. 2016. [13] Y. M. Chee, V. K. Vu, and X. Zhang, “Permutation codes correcting a single burst deletion I: Unstable deletions,” in Proc. IEEE Int. Symp. Inf. Theory, Hong Kong, Jun. 2015, pp. 1741–1745. [14] H. Robbins, “A remark on Stirling’s formula,” The American Mathematical Monthly, vol. 62, no. 1, pp. 26–29, 1955. [Online]. Available: http://www.jstor.org/stable/2308012 [15] L. Dolecek and V. Anantharam, “Repetition error correcting sets: Explicit constructions and prefixing methods,” SIAM J. Discrete Math., vol. 23, no. 4, pp. 2120–2146, Jan. 2010. [16] S. P. Vadhan, Ed., Pseudorandomness. Foundations and Trends®in Theoretical Computer Science, 2012, vol. 7, no. 1-3. [Online]. Available: http://dx.doi.org/10.1561/0400000010 [17] A. Myers, “Counting permutations by their rigid patterns,” J. Combin. Theory Ser. A, vol. 99, no. 2, pp. 345–357, 2002. [18] B. Farhi, “Nontrivial lower bounds for the least common multiple of some finite sequences of integers,” J. Number Theory, vol. 125, no. 2, pp. 393–411, 2007.
7cs.IT
Logical Methods in Computer Science Vol. 7 (2:3) 2011, pp. 1–39 www.lmcs-online.org Submitted Published Jun. 11, 2010 May. 1, 2011 CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS DIMITRIOS VARDOULAKIS AND OLIN SHIVERS Northeastern University e-mail address: {dimvar,shivers}@ccs.neu.edu Abstract. In a functional language, the dominant control-flow mechanism is function call and return. Most higher-order flow analyses, including k-CFA, do not handle call and return well: they remember only a bounded number of pending calls because they approximate programs with control-flow graphs. Call/return mismatch introduces precisiondegrading spurious control-flow paths and increases the analysis time. We describe CFA2, the first flow analysis with precise call/return matching in the presence of higher-order functions and tail calls. We formulate CFA2 as an abstract interpretation of programs in continuation-passing style and describe a sound and complete summarization algorithm for our abstract semantics. A preliminary evaluation shows that CFA2 gives more accurate data-flow information than 0CFA and 1CFA. Introduction Higher-order functional programs can be analyzed using analyses such as the k -CFA family [26]. These algorithms approximate the valid control-flow paths through the program as the set of all paths through a finite graph of abstract machine states, where each state represents a program point plus some amount of abstracted environment and control context. In fact, this is not a particularly tight approximation. The set of paths through a finite graph is a regular language. However, the execution traces produced by recursive function calls are strings in a context-free language. Approximating this control flow with regular-language techniques permits execution paths that do not properly match calls with returns. This is particularly harmful when analyzing higher-order languages, since flowing functional values down these spurious paths can give rise to further “phantom” control-flow structure, along which functional values can then flow, and so forth, in a destructive spiral that not only degrades precision but drives up the cost of the analysis. Pushdown models of programs can match an unbounded number of calls and returns, tightening up the set of possible executions to strings in a context-free language. Such models have long been used for first-order languages. The functional approach of Sharir and Pnueli [25] computes transfer-functions for whole procedures by composing transferfunctions of their basic blocks. Then, at a call-node these functions are used to compute the 1998 ACM Subject Classification: F.3.2, D.3.4. Key words and phrases: control-flow analysis, higher-order languages, pushdown models, summarization. l LOGICAL METHODS IN COMPUTER SCIENCE c DOI:10.2168/LMCS-7 (2:3) 2011 CC D. Vardoulakis and O. Shivers Creative Commons 2 D. VARDOULAKIS AND O. SHIVERS data-flow value of the corresponding return-node directly. This “summary-based” technique has seen widespread use [5, 23]. Other pushdown models include Recursive State Machines [2] and Pushdown Systems [3, 10]. In this paper, we propose CFA2, a pushdown model of higher-order programs.1 Our contributions can be summarized as follows: • CFA2 is a flow analysis with precise call/return matching that can be used in the compilation of both typed and untyped languages. No existing analysis for functional languages enjoys all of these properties. k -CFA and its variants support limited call/return matching, bounded by the size of k (section 3.1). Type-based flow analysis with polymorphic subtyping [21, 22] also supports limited call/return matching, and applies to typed languages only (section 7). • CFA2 uses a stack and a heap for variable binding. Variable references are looked up in one or the other, depending on where they appear in the source code. Most references in typical programs are read from the stack, which results in significant precision gains. Also, CFA2 can filter certain bindings off the stack to sharpen precision (section 4). k -CFA with abstract garbage collection [20] cannot infer that it is safe to remove these bindings. Last, the stack makes CFA2 resilient to syntax changes like η-expansion (section 4.1). It is well known that k -CFA is sensitive to such changes [30, 31]. • We formulate CFA2 as an abstract interpretation of programs in continuation-passing style (CPS). The abstract semantics uses a stack of unbounded height. Hence, the abstract state space is infinite, unlike k -CFA. To analyze the state space, we extend the functional approach of Sharir and Pnueli [25]. The resulting algorithm is a search-based variant of summarization that can handle higher-order functions and tail recursion. Currently, CFA2 does not handle first-class-control operators such as call/cc (section 5). • We have implemented 0CFA, 1CFA and CFA2 in the Twobit Scheme compiler [6]. Our experimental results show that CFA2 is more precise than 0CFA and 1CFA. Also, CFA2 usually visits a smaller state space (section 6). 1. Preliminary definitions and notational conventions In flow analysis of λ-calculus-based languages, a program is usually turned to an intermediate form where all subexpressions are named before it is analyzed. This form can be CPS, administrative normal form [11], or ordinary direct-style λ-calculus where each expression has a unique label. Selecting among these is mostly a matter of taste, and an analysis using one form can be changed to use another form without much effort. This work uses CPS. We opted for CPS because it makes contexts explicit, as continuation-lambda terms. Moreover, call/cc, which we wish to support in the future, is directly expressible in CPS without the need for a special primitive operator. In this section we describe our CPS language. For brevity, we develop the theory of CFA2 in the untyped λ-calculus. Primitive data, explicit recursion and side-effects can be added using standard techniques [26, ch. 3] [19, ch. 9]. Compilers that use CPS [16, 29] 1 CFA2 stands for “a Context-Free Approach to Control-Flow Analysis”. We use “context-free” with its usual meaning from language theory, to indicate that CFA2 approximates valid executions as strings in a context-free language. Unfortunately, “context-free” means something else in program analysis. To avoid confusion, we use “monovariant” and “polyvariant” when we refer to the abstraction of calling context in program analysis. CFA2 is polyvariant (aka context-sensitive), because it analyzes different calls to the same function in different environments. CFA2: A CONTEXT-FREE APPROACH v ∈ Var u ∈ UVar k ∈ CVar ψ ∈ Lab l ∈ ULab γ ∈ CLab lam ∈ Lam ulam ∈ ULam = UVar + CVar = a set of identifiers = a set of identifiers = ULab + CLab = a set of labels = a set of labels = ULam + CLam ::= [[(λl (u k) call )]] TO CONTROL-FLOW ANALYSIS clam ∈ CLam call ∈ Call UCall CCall g ∈ Exp f, e ∈ UExp q ∈ CExp pr ∈ Program ::= = ::= ::= = = = ::= 3 [[(λγ (u) call )]] UCall + CCall [[(f e q)l ]] [[(q e)γ ]] UExp + CExp ULam + UVar CLam + CVar ULam Figure 1: Partitioned CPS usually partition the terms in a program in two disjoint sets, the user and the continuation set, and treat user terms differently from continuation terms. We adopt this partitioning for our language (Fig. 1). Variables, lambdas and calls get labels from ULab or CLab. Labels are pairwise distinct. User lambdas take a user argument and the current continuation; continuation lambdas take only a user argument. We apply an additional syntactic constraint: the only continuation variable that can appear free in the body of a user lambda (λl (u k) call ) is k. This simple constraint forbids first-class control [24]. Intuitively, we get such a program by CPS-converting a direct-style program without call/cc. We assume that all variables in a program have distinct names. Concrete syntax enclosed in [[·]] denotes an item of abstract syntax. Functions with a ‘?’ subscript are predicates, e.g., Var ? (e) returns true if e is a variable and false otherwise. We use two notations for tuples, (e1 , . . . , en ) and he1 , . . . , en i, to avoid confusion when tuples are deeply nested. We use the latter for lists as well; ambiguities will be resolved by the context. Lists are also described by a head-tail notation, e.g., 3 :: h1, 3, −47i. CFA2 treats references to the same variable differently in different contexts. We split references in two categories: stack and heap references. In direct-style, if a reference appears at the same nesting level as its binder, then it is a stack reference, otherwise it is a heap reference. For example, the program (λ1 (x)(λ2 (y)(x (x y)))) has a stack reference to y and two heap references to x. Intuitively, only heap references may escape. When a program p is CPS-converted to a program p0 , stack (resp. heap) references in p remain stack (resp. heap) references in p0 . All references added by the transform are stack references. We can give an equivalent definition of stack and heap references directly in CPS, without referring to the original direct-style program. Labels can be split into disjoint sets according to the innermost user lambda that contains them. In the program (λ1 (x k1) (k1 (λ2 (y k2) (x y (λ3 (u) (x u k2)4 ))5 ))6 ), which is the CPS translation of the previous program, these sets are {1, 6} and {2, 3, 4, 5}. The “label to variable” map LV (ψ) returns all the variables bound by any lambdas that belong in the same set as ψ, e.g., LV (4) = {y, k2, u} and LV (6) = {x, k1}. We use this map to model stack behavior, because all continuation lambdas that “belong” to a given user lambda λl get closed by extending λl ’s stack frame (cf. section 4). Notice that, for any ψ, LV (ψ) contains exactly one continuation variable. Using LV , we give the following definition. 4 D. VARDOULAKIS AND O. SHIVERS [UEA] ([[(f e q)l ]], β, ve, t) → (proc, d, c, ve, l :: t) proc = A(f, β, ve) d = A(e, β, ve) c = A(q, β, ve) ( (g, β) A(g, β, ve) , ve(g, β(g)) Lam ? (g) Var ? (g) Concrete domains: 0 0 [UAE] (proc, d, c, ve, t) → (call , β , ve , t) proc ≡ h[[(λl (u k) call )]], βi β 0 = β[u 7→ t][k 7→ t] ve 0 = ve[(u, t) 7→ d][(k, t) 7→ c] [CEA] ([[(q e)γ ]], β, ve, t) → (proc, d, ve, γ :: t) proc = A(q, β, ve) d = A(e, β, ve) [CAE] (proc, d, ve, t) → (call , β 0 , ve 0 , t) proc = h[[(λγ (u) call )]], βi β 0 = β[u 7→ t] ve 0 = ve[(u, t) 7→ d] ς ∈ State Eval UEval CEval Apply UApply CApply Clos d ∈ UClos c ∈ CClos β ∈ BEnv ve ∈ VEnv t ∈ Time = Eval + Apply = UEval + CEval = UCall × BEnv × VEnv × Time = CCall × BEnv × VEnv × Time = UApply + CApply = UClos ×UClos ×CClos ×VEnv ×Time = CClos × UClos ×VEnv ×Time = UClos + CClos = ULam × BEnv = (CLam × BEnv ) + halt = Var * Time = Var × Time * Clos = Lab ∗ Figure 2: Concrete semantics and domains for Partitioned CPS Definition 1.1 (Stack and heap references). • Let ψ be a call site that refers to a variable v. The predicate S? (ψ, v) holds iff v ∈ LV (ψ). We call v a stack reference. • Let ψ be a call site that refers to a variable v. The predicate H? (ψ, v) holds iff v ∈ / LV (ψ). We call v a heap reference. • v is a stack variable, written S? (v), iff all its references satisfy S? . • v is a heap variable, written H? (v), iff some of its references satisfy H? . Then, S? (5, y) holds because y ∈ {y, k2, u} and H? (5, x) holds because x ∈ / {y, k2, u}. 2. Concrete Semantics Execution in Partitioned CPS is guided by the semantics of Fig. 2. In the terminology of abstract interpretation, this semantics is called the concrete semantics. In order to find properties of a program at compile time, one needs to derive a computable approximation of the concrete semantics, called the abstract semantics. CFA2 and k -CFA are such approximations. Execution traces alternate between Eval and Apply states. At an Eval state, we evaluate the subexpressions of a call site before performing a call. At an Apply, we perform the call. The last component of each state is a time, which is a sequence of call sites. Eval to Apply transitions increment the time by recording the label of the corresponding call site. Apply to Eval transitions leave the time unchanged. Thus, the time t of a state reveals the call sites along the execution path to that state. Times indicate points in the execution when variables are bound. The binding environment β is a partial function that maps variables to their binding times. The variable environment ve maps variable-time pairs to values. To find the value of a variable v, we look up the time v was put in β, and use that to search for the actual value in ve. Let’s look at the transitions more closely. At a UEval state with call site (f e q)l , we evaluate f , e and q using the function A. Lambdas are paired up with β to become closures, CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 5 while variables are looked up in ve using β. We add the label l in front of the current time and transition to a UApply state (rule [UEA]). From UApply to Eval , we bind the formals of a procedure h[[(λl (u k) call )]], βi to the arguments and jump to its body. The new binding environment β 0 extends the procedure’s environment, with u and k mapped to the current time. The new variable environment ve 0 maps (u, t) to the user argument d, and (k, t) to the continuation c (rule [UAE]). The remaining two transitions are similar. We use halt to denote the top-level continuation of a program pr . The initial state I(pr ) is ((pr , ∅), input, halt, ∅, hi), where input is a closure of the form h[[(λl (u k) call )]], ∅i. The initial time is the empty sequence of call sites. CPS-based compilers may or may not use a stack for the final code. Steele’s view, illustrated in the Rabbit compiler [29], is that argument evaluation pushes stack and function calls are GOTOs. Since arguments in CPS are not calls, argument evaluation is trivial and Rabbit never needs to push stack. By this approach, every call in CPS is a tail call. An alternative style was used in the Orbit compiler [16]. At every function call, Orbit pushes a frame for the arguments. By this approach, tail calls are only the calls where the continuation argument is a variable. These CPS call sites were in tail position in the initial direct-style program. CEval states where the operator is a variable are calls to the current continuation with a return value. Orbit pops the stack at tail calls and before calling the current continuation. We will see later that the abstract semantics of CFA2 uses a stack, like Orbit. However, CFA2 computes safe flow information which can be used by both aforementioned approaches. The workings of the abstract interpretation are independent of what style an implementor chooses for the final code. 3. Limitations of k -CFA In this section, we discuss the main causes of imprecision and inefficiency in k -CFA. Our motivation in developing CFA2 is to create an analysis that overcomes these limitations. We assume some familiarity with k -CFA, and abstract interpretation in general. Detailed descriptions on these topics can be found in [19, 26]. We use Scheme syntax for our example programs. 3.1. k -CFA does not properly match calls and returns. In order to make the state space of k -CFA finite, Shivers chose a mechanism similar to the call-strings of Sharir and Pnueli [25]. Thus, recursive programs introduce approximation by folding an unbounded number of recursive calls down to a fixed-size call-string. In effect, by applying k -CFA to a higher-order program, we turn it into a finite-state machine. Taken to the extreme, when k is zero, a function can return to any of its callers, not just to the last one. For example, consider the function len that computes the length of a list. Fig. 3 shows the code for len, its CPS translation and the associated control-flow graph. In the graph, the top level of the program is presented as a function called main. Function entry and exit nodes are rectangles with sharp corners. Inner nodes are rectangles with rounded corners. Each call site is represented by a call node and a corresponding return node, which contains the variable to which the result of the call is assigned. Each function uses a local variable ret for its return value. Solid arrows are intraprocedural steps. Dashed arrows go from call sites to function entries and from function exits to return points. There is no edge between call and return nodes; a call reaches its corresponding return only if the callee 6 D. VARDOULAKIS AND O. SHIVERS (define (len l) (if (pair? l) (+ 1 (len (cdr l))) 0)) (len ’(3)) ⇓ CPS 1 main() (define (len l k) (pair? l) 2 len ’(3) (λ(test) ret 3 (if test (λ() 4 main (cdr l (λ(rest) (len rest (λ(ans) (+ 1 ans k)))))) (λ() (k 0))))) (len ’(3) halt) 5 len(l) 6 test := pair? l 7 test #t #f 8 ret := 0 9 rest := cdr l 10 len rest ans 11 12 ret := 1 + ans 13 len Figure 3: 0CFA on len terminates. A monovariant analysis, such as 0CFA, considers every path from 1 to 4 to be a valid execution. In particular, it cannot exclude the path 1, 2, 5, 6, 7, 9, 10, 5, 6, 7, 8, 13, 3, 4. By following such a path, the program will terminate with a non-empty stack. It is clear that k -CFA cannot help much with optimizations that require accurate calculation of the stack change between program states, such as stack allocation of closure environments. Spurious flows caused by call/return mismatch affect traditional data-flow information as well. For instance, 0CFA-constant-propagation for the program below cannot spot that n2 is the constant 2, because 1 also flows to x and is mistakenly returned by the second call to app. 1CFA also fails, because both calls to id happen in the body of app. 2CFA helps in this example, but repeated η-expansion of id can trick k -CFA for any k. (let* ((app (λ(f e) (f e))) (id (λ(x) x)) (n1 (app id 1)) (n2 (app id 2))) (+ n1 n2)) In a non-recursive program, a large enough k can provide accurate call/return matching, but this is not desirable because the analysis becomes intractably slow even when k is 1 [30]. Moreover, the ubiquity of recursion in functional programs calls for a static analysis that can match an unbounded number of calls and returns. This can be done if we approximate programs using pushdown models instead of finite-state machines. 3.2. The environment problem and fake rebinding. In higher-order languages, many bindings of the same variable can be simultaneously live. Determining at compile time whether two references to some variable will be bound in the same run-time environment is referred to as the environment problem [26]. Consider the following program: CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 7 (let ((f (λ(x thunk) (if (number? x) (thunk) (λ1 () x))))) (f 0 (f "foo" "bar"))) In the inner call to f, x is bound to "foo" and λ1 is returned. We call f again; this time, x is 0, so we jump through (thunk) to λ1 , and reference x, which, despite the just-completed test, is not a number: it is the string "foo". Thus, during abstract interpretation, it is generally unsafe to assume that a reference has some property just because an earlier reference had that property. This has an unfortunate consequence: sometimes an earlier reference provides safe information about the reference at hand and k -CFA does not spot it: (define (compose-same f x) (f (f x)1 )2 ) In compose-same, both references to f are always bound at the same time. However, if multiple closures flow to f, k -CFA may call one closure at call site 1 and a different closure at call site 2. This flow never happens at run time. Imprecise binding information also makes it difficult to infer the types of variable references. In len, the cdr primitive must perform a run-time check and signal an error if l is not bound to a pair. This check is redundant since we checked for pair? earlier, and both references to l are bound in the same environment. If len is called with both pair and non-pair arguments, k -CFA cannot eliminate the run-time check. CFA2 tackles this problem by distinguishing stack from heap references. If a reference v appears in a static context where we know the current stack frame is its environment record, we can be precise. If v appears free in some possibly escaping lambda, we cannot predict its extent so we fall back to a conservative approximation. 3.3. Imprecision increases the running time of the analysis. k -CFA for k > 0 is not a cheap analysis, both in theory [30] and in practice [27]. Counterintuitively, imprecision in higher-order flow analyses can increase their running time: imprecision induces spurious control paths, along which the analysis must flow data, thus creating further spurious paths, and so on, in a vicious cycle which creates extra work whose only function is to degrade precision. This is why techniques that aggressively prune the search space, such as ΓCFA [20], not only increase precision, but can also improve the speed of the analysis. In the previous subsections, we saw examples of information known at compile time that k -CFA cannot exploit. CFA2 uses this information. The enhanced precision of CFA2 has a positive effect on its running time (cf. section 6). 4. The CFA2 semantics In this section we define the abstract semantics of CFA2. The abstract semantics approximates the concrete semantics. This means that each concrete state has a corresponding abstract state. Therefore, each concrete execution, i.e., sequence of states related by →, has a corresponding abstract execution that computes an approximate answer. Each abstract state has a stack. Analyzing recursive programs requires states with stacks of unbounded size. Thus, the abstract state space is infinite and the standard algorithms for k -CFA [19,26] will diverge because they work by enumerating all states. We show how to solve the stack-size problem in section 5. Here, we describe the abstract semantics (section 4.1), show how to map concrete to abstract states and prove the correctness of the abstract semantics (section 4.2). 8 D. VARDOULAKIS AND O. SHIVERS [ ([[(f e q)l ]], st, h) ; (ulam, d̂, ĉ, st 0 , h) [UEA] ulam ∈ Âu (f, l, st, h) d̂ = Âu (e, l, st, h) ĉ = Âk (q, st)  Var ? (q) pop(st) st 0 = st Lam ? (q) ∧ (H? (l, f ) ∨ Lam ? (f ))   st[f 7→ {ulam}] Lam ? (q) ∧ S? (l, f )   {e} Âu (e, ψ, st, h) , st(e)   h(e) ( Âk (q, st) , q st(q) Lam ? (e) S? (ψ, e) H? (ψ, e) Lam ? (q) Var ? (q) Abstract domains: [ ([[(λl (u k) call )]], d̂, ĉ, st, h) ; (call , st 0 , h 0 ) [UAE] st 0 = ( push([u 7→ d̂][k 7→ ĉ], st) h t [u 7→ d̂] H? (u) 0 h = h S? (u) [ ([[(q e)γ ]], st, h) ; (clam, d̂, st 0 , h) [CEA] clam = Âk (q, st) d̂ = Â( u (e, γ, st, h) pop(st) Var ? (q) st 0 = st Lam ? (q) \ = UCall × Stack × Heap ςˆ ∈ UEval \ = ULam × UClos \ × CClos \ ×Stack×Heap ςˆ ∈ UApply \ = CCall × Stack × Heap ςˆ ∈ CEval \ = CClos \ × UClos \ × Stack × Heap ςˆ ∈ CApply \ d̂ ∈ UClos = Pow (ULam) \ = CLam + halt ĉ ∈ CClos \ ∪ (CVar * CClos) \ fr , tf ∈ Frame = (UVar * UClos) st ∈ Stack = Frame∗ \ h ∈ Heap = UVar * UClos Stack operations: [ ([[(λγ (u) call )]], d̂, st, h) ; (call , st 0 , h 0 ) [CAE] st 0 = ( st[u 7→ d̂] h t [u 7→ d̂] H? (u) h0 = h S? (u) pop(tf :: st) , st push(fr , st) , fr :: st (tf :: st)(v) , tf (v) (tf :: st)[u 7→ d̂] , tf [u 7→ d̂] :: st Figure 4: Abstract semantics and relevant definitions 4.1. Abstract semantics. The CFA2 semantics is an abstract interpreter that executes a CPS program, using a stack for variable binding and return-point information. We describe the stack-management policy with an example. Assume that we run the len program of section 3. When calling (len ’(3) halt) we push a frame [l 7→ (3)][k 7→ halt] on the stack. The test (pair? l) is true, so we add the binding [test 7→ true] to the top frame and jump to the true branch. We take the cdr of l and add the binding [rest 7→ ()] to the top frame. We call len again, push a new frame for its arguments and jump to its body. This time the test is false, so we extend the top frame with [test 7→ false] and jump to the false branch. The call to k is a function return, so we pop a frame and pass 0 to (λ(ans)(+ 1 ans k)). Call site (+ 1 ans k) is also a function return, so we pop the remaining frame and pass 1 to the top-level continuation halt. In general, we push a frame at function entries and pop at tail calls and at function returns. Results of intermediate computations are stored in the top frame. This policy enforces two invariants about the abstract interpreter. First, when executing inside a user function (λl (u k) call ), the domain of the top frame is a subset of LV (l). Second, the frame below the top frame is the environment of the current continuation. Each variable v in our example was looked up in the top frame, because each lookup happened while executing inside the lambda that binds v. This is not always the case; in the first snippet of section 3.2 there is a heap reference to x in λ1 . When control reaches that reference, the top frame does not belong to the lambda that binds x. In CFA2, we CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 9 look up stack references in the top frame, and heap references in the heap. Stack lookups below the top frame never happen. The CFA2 semantics appears in Fig. 4. An abstract value is either an abstract user \ or an abstract continuation closure (member of CClos). \ closure (member of the set UClos) An abstract user closure is a set of user lambdas. An abstract continuation closure is either a continuation lambda or halt. A frame is a map from variables to abstract values, and a stack is a sequence of frames. All stack operations except push are defined for non-empty stacks only. A heap is a map from variables to abstract values. It contains only user bindings because, without first-class control, every continuation variable is a stack variable. \ state ςˆ to a UApply \ state ςˆ0 (rule [UEA]), [ we first evaluate On transition from a UEval f , e and q. We evaluate user terms using Âu and continuation terms using Âk . We nondeterministically choose one of the lambdas that flow to f as the operator in ςˆ0 .2 The change to the stack depends on q and f . If q is a variable, the call is a tail call so we pop the stack (case 1). If q is a lambda, it evaluates to a new closure whose environment is the top frame, hence we do not pop the stack (cases 2, 3). Moreover, if f is a lambda or a heap reference then we leave the stack unchanged. However, if f is a stack reference, we set f ’s value in the top frame to {ulam}, possibly forgetting other lambdas that flow to f . This “stack filtering” prevents fake rebinding (cf. section 3.2): when we return to ĉ, we may reach more stack references of f . These references and the current one are bound at the same time. Since we are committing to ulam in this transition, these references must also be bound to ulam. \ [ transition (rule [UAE]), [ In the UApply-toEval we push a frame for the procedure’s arguments. In addition, if u is a heap variable we must update its binding in the heap. The join operation t is defined as: ( h(v) v 6≡ u (h t [u 7→ d̂])(v) , h(v) ∪ d̂ v ≡ u \ -to-CApply \ transition (rule [CEA]), [ In a CEval we are preparing for a call to a continuation so we must reset the stack to the stack of its birth. When q is a variable, the \ state is a function return and the continuation’s environment is the second stack CEval frame. Therefore, we pop a frame before calling clam. When q is a lambda, it is a newly created closure thus the stack does not change. Note that the transition is deterministic, [ Since we always know which continuation we are about to call, call/return unlike [UEA]. mismatch never happens. For instance, the function len may be called from many places in a program, so multiple continuations may flow to k. But, by retrieving k’s value from the stack, we always return to the correct continuation. \ [ transition (rule [CAE]), [ our stack policy dictates that we extend In the CApply-toEval the top frame with the binding for the continuation’s parameter u. If u is a heap variable, we also update the heap.3 2An abstract execution explores one path, but the algorithm that searches the state space considers all possible executions (cf. section 5), as is the case in the operational formulation of k -CFA [19]. 3All temporaries created by the CPS transform are stack variables; but a compiler optimization may rewrite a program to create heap references to temporaries. 10 D. VARDOULAKIS AND O. SHIVERS Examples. When the analyzed program is not recursive, the stack size is bounded so we can enumerate all abstract states without diverging. Let’s see how the abstract semantics works on a simple program that applies the identity function twice and returns the result \ of the second call. The initial state Î(pr ) is a UApply. ([[(λ(id h)(id 1 (λ1 (n1)(id 2 (λ2 (n2)(h n2))))))]], {[[(λ3 (x k)(k x))]]}, halt, hi, ∅) All variables in this example are stack variables, so the heap will remain empty throughout [ we push the execution. In frames, we abbreviate lambdas by their labels. By rule [UAE], \ state. a frame for id and h and transition to a UEval ([[(id 1 (λ1 (n1)(id 2 (λ2 (n2)(h n2)))))]], h[id 7→ {λ3 }][h 7→ halt]i, ∅) We look up id in the top frame. Since the continuation argument is a lambda, we do not \ pop the stack. The next state is a UApply. ([[(λ3 (x k)(k x))]], {1}, λ1 , h[id 7→ {λ3 }][h 7→ halt]i, ∅) We push a frame for the arguments of λ3 and jump to its body. ([[(k x)]], h[x 7→ {1}][k 7→ λ1 ], [id 7→ {λ3 }][h 7→ halt]i, ∅) \ state where the operator is a variable, so we pop a frame. This is a CEval ([[(λ1 (n1)(id 2 (λ2 (n2)(h n2))))]], {1}, h[id 7→ {λ3 }][h 7→ halt]i, ∅) We extend the top frame to bind n1 and jump to the body of λ1 . ([[(id 2 (λ2 (n2)(h n2)))]], h[n1 7→ {1}][id 7→ {λ3 }][h 7→ halt]i, ∅) The new call to id is also not a tail call, so we do not pop. ([[(λ3 (x k)(k x))]], {2}, λ2 , h[n1 7→ {1}][id 7→ {λ3 }][h 7→ halt]i, ∅) We push a frame and jump to the body of λ3 . ([[(k x)]], h[x 7→ {2}][k 7→ λ2 ], [n1 7→ {1}][id 7→ {λ3 }][h 7→ halt]i, ∅) We pop a frame and jump to λ2 . ([[(λ2 (n2)(h n2))]], {2}, h[n1 7→ {1}][id 7→ {λ3 }][h 7→ halt]i, ∅) We extend the top frame to bind n2 and jump to the body of λ2 . ([[(h n2)]], h[n2 7→ {2}][n1 7→ {1}][id 7→ {λ3 }][h 7→ halt]i, ∅) The operator is a variable, so we pop the stack. The next state is a final state, so the program terminates with value {2}. (halt, {2}, hi, ∅) 1CFA would also find the precise answer for this program. However, if we η-expand λ3 to (λ3 (x k)((λ4 (y k2)(k2 y)) x k)), 1CFA will return {1, 2} because both calls to λ4 happen at the same call site. CFA2 is more resilient to η-expansion. It will return the precise answer in the modified program because the change did not create any heap references. However, if we change λ3 to (λ3 (x k)((λ4 (y k2)(k2 x)) x k)), then both 1 and 2 flow to the heap reference to x and CFA2 will return {1, 2}. CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 11 |([[(g1 . . . gn )ψ ]], β, ve, t)|ca = ([[(g1 . . . gn )ψ ]], toStack (LV (ψ), β, ve), |ve|ca ) |(h[[(λl (u k)( call )]], βi, d, c, ve, t)|ca = ([[(λl (u k) call )]], |d|ca , |c|ca , st, |ve|ca ) hi c = halt where st = 0 toStack (LV (γ), β , ve) c = ([[(λγ (u0 )call 0 )]], β 0 ) |(h[[(λγ (u) call )]], βi, d, ve, t)|ca = ([[(λγ (u) call )]], |d|ca , toStack (LV (γ), β, ve), |ve|ca ) |(halt, d, ve, t)|ca = (halt, |d|ca , hi, |ve|ca ) |([[(λl (u k) call )]], β)|ca = {[[(λl (u k) call )]]} |([[(λγ (u) call )]], β)|ca = [[(λγ (u) call )]] |halt|ca = halt |ve|ca = { (u, F t |ve(u, t)|ca ) : H? (u)} toStack ({u1 , . . . , un , k}, β, ve) ,  h[ ui 7→ d̂i ][k 7→ halt]i  halt = ve(k, β(k)) [ ui 7→ d̂i ][k 7→ [[(λγ (u) call )]]] :: st ([[(λγ (u) call )]], β 0 ) = ve(k, β(k)) where d̂i = |ve(ui , β(ui ))|ca and st = toStack (LV (γ), β 0, ve) Figure 5: From concrete states to abstract states (call , st 1 , h1 ) v (call , st 2 , h2 ) st 1 v st 2 ∧ h1 v h2 iff (ulam, d̂1 , ĉ, st 1 , h1 ) v (ulam, d̂2 , ĉ, st 2 , h2 ) (ĉ, d̂1 , st 1 , h1 ) v (ĉ, d̂2 , st 2 , h2 ) h1 v h2 iff h1 (u) v h2 (u) tf 1 :: st 1 v tf 2 :: st 2 iff iff iff d̂1 v d̂2 ∧ st 1 v st 2 ∧ h1 v h2 d̂1 v d̂2 ∧ st 1 v st 2 ∧ h1 v h2 for each u ∈ dom(h1 ) tf 1 v tf 2 ∧ st 1 v st 2 hi v hi tf 1 v tf 2 d̂1 v d̂2 iff iff tf 1 (v) v tf 2 (v) for each v ∈ dom(tf 1 ) d̂1 ⊆ d̂2 ĉ v ĉ Figure 6: The v relation on abstract states 4.2. Correctness of the abstract semantics. We proceed to show that the CFA2 semantics safely approximates the concrete semantics. First, we define a map |·|ca from concrete to abstract states. Next, we show that if ς transitions to ς 0 in the concrete semantics, the abstract counterpart |ς|ca of ς transitions to a state ςˆ0 which approximates |ς 0 |ca . Hence, we ensure that the possible behaviors of the abstract interpreter include the actual run-time behavior of the program. The map |·|ca appears in Fig. 5. The abstraction of an Eval state ς of the form [ state ςˆ with the same call site. Since ς does not have ([[(g1 . . . gn )ψ ]], β, ve, t) is an Eval a stack, we must expose stack-related information hidden in β and ve. Assume that λl is 12 D. VARDOULAKIS AND O. SHIVERS \ the innermost user lambda that contains ψ. To reach ψ, control passed from a UApply 0 state ςˆ over λl . According to our stack policy, the top frame contains bindings for the formals of λl and any temporaries added along the path from ςˆ0 to ςˆ. Therefore, the domain of the top frame is a subset of LV (l), i.e., a subset of LV (ψ). For each user variable ui ∈ (LV (ψ) ∩ dom(β)), the top frame contains [ui 7→ |ve(ui , β(ui ))|ca ]. Let k be the sole continuation variable in LV (ψ). If ve(k, β(k)) is halt (the return continuation is the toplevel continuation), the rest of the stack is empty. If ve(k, β(k)) is ([[(λγ (u) call )]], β 0 ), the second frame is for the user lambda in which λγ was born, and so forth: proceeding through the stack, we add a frame for each live activation of a user lambda until we reach halt. \ state ςˆ whose The abstraction of a UApply state over h[[(λl (u k) call )]], βi is a UApply operator is [[(λl (u k) call )]]. The stack of ςˆ is the stack in which the continuation argument was created, and we compute it using toStack as above. Abstracting a CApply is similar to the UApply case, only now the top frame is the environment of the continuation operator. Note that the abstraction maps drop the time of the concrete states, since the abstract states do not use times. The abstraction of a user closure is the singleton set with the corresponding lambda. The abstraction of a continuation closure is the corresponding lambda. When abstracting a variable environment ve, we only keep heap variables. We can now state our simulation theorem. The proof proceeds by case analysis on the concrete transition relation. The relation ςˆ1 v ςˆ2 is a partial order on abstract states and can be read as “ˆ ς1 is more precise than ςˆ2 ” (Fig. 6). The proof can be found in the appendix. Theorem 4.1 (Simulation). If ς → ς 0 and |ς|ca v ςˆ, then there exists ςˆ0 such that ςˆ ; ςˆ0 and |ς 0 |ca v ςˆ0 . 5. Computing CFA2 5.1. Pushdown models and summarization. In section 3, we saw that a monovariant analysis like 0CFA treats the control-flow graph of len as a finite-state machine (FSM), where all paths are valid executions. For k > 0, k -CFA still approximates len as a FSM, albeit a larger one that has several copies of each procedure, caused by different call strings. But in reality, calls and returns match; the call from 2 returns to 3 and each call from 10 returns to 11. Thus, by thinking of executions as strings in a context-free language, we can do more precise flow analysis. We can achieve this by approximating len as a pushdown system (PDS) [3, 10]. A PDS is similar to a pushdown automaton, except it does not read input from a tape. For illustration purposes, we take the (slightly simplified) view that the state of a PDS is a pair of a program point and a stack. The transition rules for call nodes push the return point on the stack: (2, s) ,→ (5, 3 :: s), (10, s) ,→ (5, 11 :: s) Function exits pop the node at the top of the stack and jump to it: (13, n :: s) ,→ (n, s) All other nodes transition to their successor(s) and leave the stack unchanged, e.g. (3, s) ,→ (4, s), (7, s) ,→ (8, s), (7, s) ,→ (9, s) CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 13 Suppose we want to find all nodes reachable from 1. Obviously, we cannot do it by enumerating all states. Thus, algorithms for pushdown reachability use a dynamic programming technique called summarization. The intuition behind summarization is to flow facts from a program point n with an empty stack to a point n0 in the same procedure. We say that n0 is same-context reachable from n. These facts are then suitably combined to get flow facts for the whole program. We use summarization to explore the state space in CFA2. Our algorithm is based on Sharir and Pnueli’s functional approach [25, pg. 207], adapted to the more modern terminology of Reps et al. [23]. Summarization requires that we know all call sites of a function. Therefore, it does not apply directly to higher-order languages, because we cannot find the call sites of a function by looking at a program’s source code. We need a search-based variant of summarization, which records callers as it discovers them. We illustrate our variant on len. We find reachable nodes by recording path edges, i.e., edges whose source is the entry of a procedure and target is some program point in the same procedure. Path edges should not be confused with the edges already present in len’s control-flow graph. They are artificial edges used by the analysis to represent intraprocedural paths, hence the name. From 1 we can go to 2, so we record h1, 1i and h1, 2i. Then 2 calls len, so we record the call h2, 5i and jump to 5. In len, we reach 6 and 7 and record h5, 5i, h5, 6i and h5, 7i. We do not assume anything about the result of the test, so we must follow both branches. By following the false branch, we discover h5, 8i and h5, 13i. Node 13 is an exit, so each caller of len can reach its corresponding return point. We keep track of this fact by recording the summary edge h5, 13i. We have only seen a call from 2, so we return to 3 and record h1, 3i. Finally, we record h1, 4i, which is the end of the program. By analyzing the true branch, we discover edges h5, 9i and h5, 10i, and record the new call h10, 5i. Reachability inside len does not depend on its calling context, so from the summary edge h5, 13i we infer that 10 can reach 11 and we record h5, 11i and subsequently h5, 12i. At this point, we have discovered all possible path edges. Summarization works because we can temporarily forget the caller while analyzing inside a procedure, and remember it when we are about to return. A consequence is that if from node n with an empty stack we can reach n0 with stack s, then n with s0 can go to n0 with append(s, s0 ). 5.2. Local semantics. Summarization-based algorithms operate on a finite set of program points. Hence, we cannot use (an infinite number of) abstract states as program points. For this reason, we introduce local states and define a map |·|al from abstract to local states (Fig. 7). Intuitively, a local state is like an abstract state but with a single frame instead of a stack. Discarding the rest of the stack makes the local state space finite; keeping the top frame allows precise lookups for stack references. The local semantics describes executions that do not touch the rest of the stack (in ^ state with call site other words, executions where functions do not return). Thus, a CEval γ (k e) has no successor in this semantics. Since functions do not call their continuations, the frames of local states contain only user bindings. Local steps are otherwise similar to abstract steps. The metavariable ς˜ ranges over local states. We define the map |·|cl from concrete to local states to be |·|al ◦ |·|ca . We can now see how the local semantics fits in a summarization algorithm for CFA2. Essentially, CFA2 approximates a higher-order program as a PDS. The local semantics 14 D. VARDOULAKIS AND O. SHIVERS   Lam ? (e) {e} Ãu (e, ψ, tf , h) , tf (e) S? (ψ, e)   h(e) H? (ψ, e) ] ([[(f e q)l ]], tf , h) ≈> (ulam, d̂, h) [UEA] ulam ∈ Ãu (f, l, tf , h) d̂ = Ãu (e, l, tf , h) ] ([[(λl (u k) call )]], d̂, h) ≈> (call , [u 7→ d̂], h 0 ) [UAE] ( h t [u 7→ d̂] H? (u) h0 = h S? (u) ] ([[(clam e)γ ]], tf , h) ≈> (clam, d̂, tf , h) [CEA] d̂ = Ãu (e, γ, tf , h) ] ([[(λγ (u) call )]], d̂, tf , h) ≈> (call , tf 0 , h 0 ) [CAE] tf 0 =( tf [u 7→ d̂] h t [u 7→ d̂] H? (u) h0 = h S? (u) Local domains: g = Call × Stack ] × Heap Eval ^ = ULam × UClos \ × Heap UApply ^ = CClos \ × UClos \ × Stack× ] Heap CApply \ ^ Frame = UVar * UClos ] = Frame ^ Stack Abstract to local maps: |(call , st, h)|al = (call , |st|al , h) |(ulam, d̂, ĉ, st, h)|al = (ulam, d̂, h) |(ĉ, d̂, st, h)|al = (ĉ, d̂, |st|al , h) |tf :: st 0 |al = { (u, tf (u)) : UVar ? (u)} |hi|al = ∅ Figure 7: Local semantics describes the PDS transitions that do not return (intraprocedural steps and function calls). We discover return points by recording callers and summary edges. Summarization distinguishes between different kinds of states: entries, exits, calls, returns and inner states. CPS lends itself naturally to such a categorization: ^ state corresponds to an entry node—control is about to enter the body of a • A UApply function. ^ state where the operator is a variable is an exit node—a function is about to • A CEval pass its result to its context. ^ state where the operator is a lambda is an inner state. • A CEval ^ state where the continuation argument is a variable is an exit—at tail calls • A UEval control does not return to the caller. ^ state where the continuation argument is a lambda is a call. • A UEval ^ state is a return if its predecessor is an exit, or an inner state if its predecessor • A CApply is also an inner state. Our algorithm will not need to distinguish between the two kinds ^ the difference is just conceptual. of CApplys; Last, we generalize the notion of summary edges to handle tail recursion. Consider an earlier example, written in CPS. ((λ(app id k) (app id 1 (λ1 (n1) (app id 2 (λ2 (n2) (+ n1 n2 k)))))) (λ(f e k) (f e k)) (λ(x k) (k x)) halt) CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Summary, Callers, TCallers, Final ←− ∅ Seen, W ←− {(Ĩ(pr ), Ĩ(pr ))} while W 6= ∅ remove (˜ ς1 , ς˜2 ) from W switch ς˜2 case ς˜2 of Entry, CApply, Inner-CEval for each ς˜3 in succ(˜ ς2 ) Propagate(˜ ς1 , ς˜3 ) case ς˜2 of Call for each ς˜3 in succ(˜ ς2 ) Propagate(˜ ς3 , ς˜3 ) insert (˜ ς1 , ς˜2 , ς˜3 ) in Callers for each (˜ ς3 , ς˜4 ) in Summary Update(˜ ς1 , ς˜2 , ς˜3 , ς˜4 ) case ς˜2 of Exit-CEval if ς˜1 = Ĩ(pr ) then Final(˜ ς2 ) else insert (˜ ς1 , ς˜2 ) in Summary for each (˜ ς3 , ς˜4 , ς˜1 ) in Callers Update(˜ ς3 , ς˜4 , ς˜1 , ς˜2 ) for each (˜ ς3 , ς˜4 , ς˜1 ) in TCallers Propagate(˜ ς3 , ς˜2 ) case ς˜2 of Exit-TC for each ς˜3 in succ(˜ ς2 ) Propagate(˜ ς3 , ς˜3 ) insert (˜ ς1 , ς˜2 , ς˜3 ) in TCallers for each (˜ ς3 , ς˜4 ) in Summary Propagate(˜ ς1 , ς˜4 ) 25 Propagate(˜ ς1 , ς˜2 ) , if (˜ ς1 , ς˜2 ) not in Seen then insert (˜ ς1 , ς˜2 ) in Seen and W 26 27 28 29 30 31 32 33 34 35 15 Update(˜ ς1 , ς˜2 , ς˜3 , ς˜4 ) , ς˜1 of the form ([[(λl1 (u1 k1 ) call 1 )]] , d̂1 , h1 ) ς˜2 of the form ([[(f e2 (λγ2 (u2 ) call 2 ))l2 ]], tf 2 , h2 ) ς˜3 of the form ([[(λl3 (u3 k3 ) call 3 )]] , d̂3 , h2 ) ς˜4 of the form ([[(k4 e4 )γ4 ]], tf 4 , h4 ) d̂ ←− à (u (e4 , γ4 , tf 4 , h4 ) tf 2 [f 7→ {[[(λl3 (u3 k3 ) call 3 )]]}] S? (l2 , f ) tf ←− tf 2 H? (l2 , f ) ∨ Lam ? (f ) ς˜ ←− ([[(λγ2 (u2 ) call 2 )]], d̂, tf , h4 ) Propagate(˜ ς1 , ς˜) Final(˜ ς) , ς˜ of the form ([[(k e)γ ]], tf , h) insert (halt, Ãu (e, γ, tf , h), ∅, h) in Final Figure 8: CFA2 workset algorithm The call (f e k) in the body of app is a tail call, so no continuation is born there. Upon return from the first call to id, we must be careful to pass the result to λ1 . Also, we must restore the environment of the first call to app, not the environment of the tail call. Similarly, the second call to id must return to λ2 and restore the correct environment. We achieve these by recording a “cross-procedure” summary from the entry of app to call site (k x), which is the exit of id. This transitive nature of summaries is essential for tail recursion. 5.3. Summarization for CFA2. The algorithm for CFA2 is shown in Fig. 8. It is a searchbased summarization for higher-order programs with tail calls. Its goal is to compute which 16 D. VARDOULAKIS AND O. SHIVERS local states are reachable from the initial state of a program through paths that respect call/return matching. Overview of the algorithm’s structure. The algorithm uses a workset W , which contains path edges and summaries to be examined. An edge (˜ ς1 , ς˜2 ) is an ordered pair of local states. We call ς˜1 the source and ς˜2 the target of the edge. At every iteration, we remove an edge from W and process it, potentially adding new edges in W . We stop when W is empty. The algorithm maintains several sets. The results of the analysis are stored in the set Seen. It contains path edges (from a procedure entry to a state in the same procedure) ^ exit, not necessarily in the same procedure). and summary edges (from an entry to a CEval The target of an edge in Seen is reachable from the source and from the initial state (cf. theorem 5.3). Summaries are also stored in Summary. Final records final states, i.e., ^ that call halt with a return value for the whole program. Callers contains triples CApplys h˜ ς1 , ς˜2 , ς˜3 i, where ς˜1 is an entry, ς˜2 is a call in the same procedure and ς˜3 is the entry of the callee. TCallers contains triples h˜ ς1 , ς˜2 , ς˜3 i, where ς˜1 is an entry, ς˜2 is a tail call in the same procedure and ς˜3 is the entry of the callee. The initial state Ĩ(pr ) is defined as |I(pr )|cl . The helper function succ(˜ ς ) returns the successor(s) of ς˜ according to the local semantics. Edge processing. Each edge (˜ ς1 , ς˜2 ) is processed in one of four ways, depending on ς˜2 . If ς˜2 is an entry, a return or an inner state (line 6), then its successor ς˜3 is a state in the same procedure. Since ς˜2 is reachable from ς˜1 , ς˜3 is also reachable from ς˜1 . If we have not already recorded the edge (˜ ς1 , ς˜3 ), we do it now (line 25). If ς˜2 is a call (line 8) then ς˜3 is the entry of the callee, so we propagate (˜ ς3 , ς˜3 ) instead of (˜ ς1 , ς˜3 ) (line 10). Also, we record the call in Callers. If an exit ς˜4 is reachable from ς˜3 , it should return to the continuation born at ς˜2 (line 12). The function Update is responsible for computing the return state. We find the return value d̂ by evaluating the expression e4 passed to the continuation (lines 29-30). Since we are returning to λγ2 , we must restore the environment of its creation which is tf 2 (possibly with stack filtering, line 31). The new state ς˜ is the corresponding return of ς˜2 , so we propagate (˜ ς1 , ς˜) (lines 32-33). ^ If ς˜2 is a CEval exit and ς˜1 is the initial state (lines 14-15), then ς˜2 ’s successor is a final state (lines 34-35). If ς˜1 is some other entry, we record the edge in Summary and pass the result of ς˜2 to the callers of ς˜1 (lines 17-18). Last, consider the case of a tail call ς˜4 to ς˜1 (line 19). No continuation is born at ς˜4 . Thus, we must find where ς˜3 (the entry that led to the tail call) was called from. Then again, all calls to ς˜3 may be tail calls, in which case we keep searching further back in the call chain to find a return point. We do the backward search by transitively adding a cross-procedure summary from ς˜3 to ς˜2 (line 25). If ς˜2 is a tail call (line 20), we find its successors and record the call in TCallers (lines 21-23). If a successor of ς˜2 goes to an exit, we propagate a cross-procedure summary transitively (line 24). Figure 9 shows a complete run of the algorithm for a small program. 5.4. Correctness of the workset algorithm. The local state space is finite, so there is a finite number of path and summary edges. We record edges as seen when we insert them in W , which ensures that no edge is inserted in W twice. Therefore, the algorithm terminates. We obviously cannot visit an infinite number of abstract states. To establish the soundness of our analysis, we show that if a state ςˆ is reachable from Î(pr ), then the algorithm CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 17 Name Kind Value Ĩ(pr ) Entry ([[(λ2 (id h)(id 1 (λ3 (u)(id 2 h))))]], {[[(λ1 (x k)(k x))]]}, ∅) ς˜1 Call ([[(id 1 (λ3 (u)(id 2 h)))]], [id 7→ {λ1 }], ∅) ς˜2 (λ1 , {1}, ∅) ς˜3 Entry ^ Exit CEval ς˜4 ^ CApply (λ3 , {1}, [id 7→ {λ1 }], ∅) ς˜5 Exit tail call ([[(id 2 h)]], [id 7→ {λ1 }][u 7→ {1}], ∅) ς˜6 (λ1 , {2}, ∅) ς˜7 Entry ^ Exit CEval ς˜8 ^ (final state) CApply (halt, {2}, ∅, ∅) ([[(k x)]], [x 7→ {1}], ∅) ([[(k x)]], [x 7→ {2}], ∅) W Summary Callers TCallers Final (Ĩ(pr ), Ĩ(pr )) ∅ ∅ ∅ ∅ (Ĩ(pr ), ς˜1 ) ∅ ∅ ∅ ∅ (˜ ς2 , ς˜2 ) ∅ (Ĩ(pr ), ς˜1 , ς˜2 ) ∅ ∅ (˜ ς2 , ς˜3 ) ∅ (Ĩ(pr ), ς˜1 , ς˜2 ) ∅ ∅ (Ĩ(pr ), ς˜4 ) (˜ ς2 , ς˜3 ) (Ĩ(pr ), ς˜1 , ς˜2 ) ∅ ∅ (Ĩ(pr ), ς˜5 ) (˜ ς2 , ς˜3 ) (Ĩ(pr ), ς˜1 , ς˜2 ) ∅ ∅ (˜ ς6 , ς˜6 ) (˜ ς2 , ς˜3 ) (Ĩ(pr ), ς˜1 , ς˜2 ) (Ĩ(pr ), ς˜5 , ς˜6 ) ∅ (˜ ς6 , ς˜7 ) (˜ ς2 , ς˜3 ) (Ĩ(pr ), ς˜1 , ς˜2 ) (Ĩ(pr ), ς˜5 , ς˜6 ) ∅ (Ĩ(pr ), ς˜7 ) (˜ ς2 , ς˜3 ), (˜ ς6 , ς˜7 ) (Ĩ(pr ), ς˜1 , ς˜2 ) (Ĩ(pr ), ς˜5 , ς˜6 ) ∅ ∅ (˜ ς2 , ς˜3 ), (˜ ς6 , ς˜7 ) (Ĩ(pr ), ς˜1 , ς˜2 ) (Ĩ(pr ), ς˜5 , ς˜6 ) ς˜8 Figure 9: A complete run of CFA2. Note that λ1 is applied twice and returns to the correct context both times. The program evaluates to 2. For brevity, we first show all reachable states and then refer to them by their names. Ĩ(pr ) shows the whole program; in the other states we abbreviate lambdas by their labels. All heaps are ∅ because there are no heap variables. The rows of the table show the contents of the sets at line 3 for each iteration. Seen contains all pairs entered in W . visits |ˆ ς |al (cf. theorem 5.3). For instance, CFA2 on len tells us that we reach program point 5, not that we reach 5 with a stack of size 1, 2, 3, etc. Soundness guarantees that CFA2 does not miss any flows, but it may also add flows that do not happen in the abstract semantics. For example, a sound but useless algorithm would add all pairs of local states in Seen. We establish the completeness of CFA2 by proving that every visited edge corresponds to an abstract flow (cf. theorem 5.4), which means that there is no loss in precision when going from abstract to local states. The theorems use two definitions. The first associates a state ςˆ with its corresponding entry, i.e., the entry of the procedure that contains ςˆ. The second finds all entries that reach CE p (ˆ ς ) through tail calls. We include the proofs of the theorems in the appendix. 18 D. VARDOULAKIS AND O. SHIVERS Definition 5.1. The Corresponding Entry CE p (ˆ ς ) of a state ςˆ in a path p is: • ςˆ, if ςˆ is an Entry • ςˆ1 , if ςˆ is not an Entry, ςˆ2 is not an Exit-CEval, p ≡ p1 ; ςˆ1 ;∗ ςˆ2 ; ςˆ ; p2 , and CE p (ˆ ς2 ) = ςˆ1 • ςˆ1 , if ςˆ is not an Entry, p ≡ p1 ; ςˆ1 ;+ ςˆ2 ; ςˆ3 ;+ ςˆ4 ; ςˆ ; p2 , ςˆ2 is a Call and ςˆ4 is an Exit-CEval, CE p (ˆ ς2 ) = ςˆ1 , and ςˆ3 ∈ CE ∗p (ˆ ς4 ) Definition 5.2. For a state ςˆ and a path p, CE ∗p (ˆ ς ) is the smallest set such that: ∗ • CE p (ˆ ς ) ∈ CE p (ˆ ς) • CE ∗p (ˆ ς1 ) ⊆ CE ∗p (ˆ ς ), when p ≡ p1 ; ςˆ1 ; ςˆ2 ;∗ ςˆ ; p2 , ςˆ1 is a Tail Call, ςˆ2 is an Entry, and ςˆ2 = CE p (ˆ ς) Theorem 5.3 (Soundness). If p ≡ Î(pr ) ;∗ ςˆ then, after summarization: • if ςˆ is not a final state then (|CE p (ˆ ς )|al , |ˆ ς |al ) ∈ Seen • if ςˆ is a final state then |ˆ ς |al ∈ Final • if ςˆ is an Exit-CEval and ςˆ0 ∈ CE ∗p (ˆ ς ) then (|ˆ ς 0 |al , |ˆ ς |al ) ∈ Seen Theorem 5.4 (Completeness). After summarization: • For each (˜ ς1 , ς˜2 ) in Seen, there exist ςˆ1 , ςˆ2 and p such that p ≡ Î(pr ) ;∗ ςˆ1 ;∗ ςˆ2 and ς˜1 = |ˆ ς1 |al and ς˜2 = |ˆ ς2 |al and ςˆ1 ∈ CE ∗p (ˆ ς2 ) • For each ς˜ in Final , there exist ςˆ and p such that p ≡ Î(pr ) ;+ ςˆ and ς˜ = |ˆ ς |al and ςˆ is a final state. 5.5. Complexity. A simple calculation shows that CFA2 is in exptime. The size of the 2 domain of Heap is n and the size of the range is 2n , so there are 2n heaps. Similarly, there 2 ^ which is n·2n ·2n2 ·2n2 = ] is dominated by the size of CApply are 2n frames. The size of State 2 ^ and State, ] which is O(n · 22n +n ). The size of Seen is the product of the sizes of UApply 2 2 2 (n · 2n · 2n ) · (n · 22n +n ) = O(n2 · 23n +2n ). The running time of the algorithm is bounded by the number of edges in W times 2 the cost of each iteration. W contains edges from Seen only, so its size is O(n2 · 23n +2n ). 2 The most expensive iteration happens when line 19 is executed. There are O(n3 · 24n +2n ) TCallers and for each one we call Propagate, which involves searching Seen. Therefore, 2 2 2 the loop costs O(n3 · 24n +2n ) · O(n2 · 23n +2n ) = O(n5 · 27n +4n ). Thus, the total cost of the 2 2 2 algorithm is O(n2 · 23n +2n ) · O(n5 · 27n +4n ) = O(n7 · 210n +6n ). Showing that CFA2 is in exptime does not guarantee the existence of a program that, when analyzed, triggers the exponential behavior. Is there a such a program? The answer is yes. Consider the following program, suggested to us by Danny Dubé: (let* ((merger (_ (clos (f1 (_ (f2 (_ (λ1 (f) (λ2 (_) f))) (merger (λ3 (x) x))) (merger (λ4 (y) y))) (clos _)1 ) (f1 _)10 ) (clos _)2 ) (f2 _)20 ) . . . (fn (_ _ ) (clos _)n ) (fn _)n0 )) CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 19 The idea is to create an exponential number of frames by exploiting the strong updates CFA2 does on the top frame. The code is in direct style for brevity; the let-bound variables would be bound by continuation lambdas in the equivalent CPS program. The only heap reference appears in the body of λ2 . We use underscores for unimportant expressions. The merger takes a function, binds f to it and returns a closure that ignores its argument and returns f. We call the merger twice so that f is bound to {λ3 , λ4 } in the heap. Now clos is bound to λ2 in the top frame and every call to clos returns {λ3 , λ4 }. Thus, after call site 1 the variable f1 is bound to {λ3 , λ4 }. At 10 , execution splits in two branches. One calls λ3 and filters the binding of f1 in the top frame to {λ3 }. The other calls λ4 and filters the binding to {λ4 }. Each branch will split in two more branches at call 20 , etc. By binding each fi to a set of two elements and applying it immediately, we force a strong update and create exponentially many frames. Even though strong update can be subverted, it can also speed up the analysis of some programs by avoiding spurious flows. In compose-same (cf. sec. 3.2), if two lambdas λ1 and λ2 flow to f, 0CFA will apply each lambda at each call site, resulting in four flows. CFA2 will only examine two flows, one that uses λ1 in both call sites and one that uses λ2 . We tried to keep the algorithm of Fig. 8 simple because it is meant to be a model. There are many parameters one can tune to improve the performance and/or asymptotic complexity of CFA2: • no stack filtering: CFA2 is sound without stack filtering, but less precise. Permitting fake rebinding may not be too harmful in practice. Suppose that a set {λ1 , λ2 } flows to a variable v with two stack references vl and vl0 . Even with stack filtering, both lambdas will flow to both references. Stack filtering just prevents us from using λ1 at vl and λ2 at vl0 along the same execution path. • heap widening: implementations of flow analyses rarely use one heap per state. They use a global heap instead and states carry timestamps [26, ch. 5]. Heap is a lattice of height O(n2 ). Since the global heap grows monotonically, it can change at most O(n2 ) times during the analysis. • summary reuse: we can avoid some reanalyzing of procedures by creating general summaries that many callers can use. One option is to create more approximate summaries by widening. Another option is to include only relevant parts of the state in the summary [4]. • representation of the sets: in calculating the exponential upper bound, we pessimistically assumed that looking up an element in a set takes time linear in the size of the set. This need not be true if one uses efficient data structures to represent Seen and the other sets. An in-depth study of the performance and complexity of the proposed variants would increase our understanding of their relative merits. Also, we do not know if CFA2 has an exponential lower bound. Our evaluation, presented in the next section, shows that CFA2 compares favorably to 0CFA, a cubic algorithm. 6. Evaluation We implemented CFA2, 0CFA and 1CFA for the Twobit Scheme compiler [6] and used them to do constant propagation and folding. In this section we report on some initial measurements and comparisons. 0CFA and 1CFA use a standard workset algorithm. CFA2 uses the algorithm of section 5.3. To speed up the analyses, the variable environment and the heap are global. 20 D. VARDOULAKIS AND O. SHIVERS len rev-iter len-Y tree-count ins-sort DFS flatten sets church-nums S ? H? 9 0 17 0 15 4 33 0 33 5 94 11 37 0 90 3 46 23 0CFA 1CFA CFA2 visited constants visited constants visited constants 81 0 126 0 55 2 121 0 198 0 82 4 199 0 356 0 131 2 293 2 2856 6 183 10 509 0 1597 0 600 4 1337 8 6890 8 1719 16 1520 0 6865 0 478 5 3915 0 54414 0 4251 4 19130 0 19411 0 22671 0 Figure 10: Benchmark results We compared the effectiveness of the analyses on a small set of benchmarks (Fig. 10). We measured the number of stack and heap references in each program and the number of constants found by each analysis. We also recorded what goes in the workset in each analysis, i.e., the number of abstract states visited by 0CFA and 1CFA, and the number of path and summary edges visited by CFA2. The running time of an abstract interpretation is proportional to the amount of things inserted in the workset. We chose programs that exhibit a variety of control-flow patterns. Len computes the length of a list recursively. Rev-iter reverses a list tail-recursively. Len-Y computes the length of a list using the Y-combinator instead of explicit recursion. Tree-count counts the nodes in a binary tree. Ins-sort sorts a list of numbers using insertion-sort. DFS does depth-first search of a graph. Flatten turns arbitrarily nested lists into a flat list. Sets defines the basic set operations and tests De Morgan’s laws on sets of numbers. Church-nums tests distributivity of multiplication over addition for a few Church numerals. CFA2 finds the most constants, followed by 1CFA. 0CFA is the least precise. CFA2 is also more efficient at exploring its abstract state space. In five out of nine cases, it visits fewer paths than 0CFA does states. The visited set of CFA2 can be up to 3.2 times smaller (flatten), and up to 1.3 times larger (DFS) than the visited set of 0CFA. 1CFA is less efficient than both 0CFA (9/9 cases) and CFA2 (8/9 cases). The visited set of 1CFA can be significantly larger than that of CFA2 in some cases (15.6 times in tree-count, 14.4 times in flatten, 12.8 times in sets). Naturally, the number of stack references in a program is much higher than the number of heap references; most of the time, a variable is referenced only by the lambda that binds it. Thus, CFA2 uses the precise stack lookups more often than the imprecise heap lookups. 7. Related work We were particularly influenced by Chaudhuri’s paper on subcubic algorithms for recursive state machines [5]. His clear and intuitive description of summarization helped us realize that we can use this technique to explore the state space of CFA2. Our workset algorithm is based on Sharir and Pnueli’s functional approach [25, pg. 207] and the tabulation algorithm of Reps et al. [23], extended for tail recursion and higherorder functions. In section 5.2, we mentioned that CFA2 essentially produces a pushdown system. Then, the reader may wonder why we designed a new algorithm instead of using an CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 21 existing one like post ∗ [3, 10]. The reason is that callers cannot be identified syntactically in higher-order languages. Hence, algorithms that analyze higher-order programs must be based on search. The tabulation algorithm can be changed to use search fairly naturally. It is less clear to us how to do that for post ∗ . In a way, CFA2 creates a pushdown system and analyzes it at the same time, much like what k -CFA does with control-flow graphs. Melski and Reps [17] reduced Heintze’s set-constraints [13] to an instance of contextfree-language (abbrev. CFL) reachability, which they solve using summarization. Therefore, their solution has the same precision as 0CFA. CFL reachability has also been used for points-to analysis of imperative higher-order languages. For instance, Sridharan and Bodı́k’s points-to analysis for Java [28] uses CFL reachability to match writes and reads to object fields. Precise call/return matching is achieved only for programs without recursive methods. Hind’s survey [14] discusses many other variants of points-to analysis. Debray and Proebsting [7] used ideas from parsing theory to design an interprocedural analysis for first-order programs with tail calls. They describe control-flow with a contextfree grammar. Then, the FOLLOW set of a procedure represents its possible return points. Our approach is quite different on the surface, but similar in spirit; we handle tail calls by computing summaries transitively. Mossin [21] created a type-based flow analysis for functional languages, which uses polymorphic subtyping for polyvariance. The input to the analysis is a program p in the simply-typed λ-calculus with recursion. First, the analysis annotates the types in p with labels. Then, it computes flow information by assigning labeled types to each expression in p. Thus, flow analysis is reduced to a type-inference problem. The annotated type system uses let-polymorphism. As a result, it can distinguish flows to different references of letand letrec-bound variables. In the following program, it finds that n2 is a constant. (let* ((id (λ(x) x)) (n1 (id 1)) (n2 (id 2))) (+ n1 n2)) However, the type system merges flows to different references of λ-bound variables. For instance, it cannot find that n2 is a constant in the app example of section 3.1. Mossin’s algorithm runs in time O(n8 ). Rehof and Fähndrich [9, 22] used CFL reachability in an analysis that runs in cubic time and has the same precision as Mossin’s. They also extended the analysis to handle polymorphism in the target language. Around the same time, Gustavsson and Svenningsson [12] formulated a cubic version of Mossin’s analysis without using CFL reachability. Their work does not deal with polymorphism in the target language. Midtgaard and Jensen [18] created a flow analysis for direct-style higher-order programs that keeps track of “return flow”. They point out that continuations make return-point information explicit in CPS and show how to recover this information in direct-style programs. Their work does not address the issue of unbounded call/return matching. Earl et al. followed up on CFA2 with a pushdown analysis that does not use frames [8]. Rather, it allocates all bindings in the heap with context, in the style of k-CFA [26]. For k = 0, their analysis runs in time O(n6 ), where n is the size of the program. Like all pushdown-reachability algorithms, Earl et al.’s analysis records pairs of states (ς1 , ς2 ) where ς2 is same-context reachable from ς1 . However, their algorithm does not classify states as entries, exits, calls, etc. This has two drawbacks compared to the tabulation algorithm. 22 D. VARDOULAKIS AND O. SHIVERS First, they do not distinguish between path and summary edges. Thus, they have to search the whole set of edges when they look for return points, even though only summaries can contribute to the search. More importantly, path edges are only a small subset of the set S of all edges between same-context reachable states. By not classifying states, their algorithm maintains the whole set S, not just the path edges. In other words, it records edges whose source is not an entry. In the graph of len, some of these edges are h6, 8i, h6, 13i, h7, 11i. Such edges slow down the analysis and do not contribute to call/return matching, because they cannot evolve into summary edges. In CFA2, it is possible to disable the use of frames by classifying each reference as a heap reference. The resulting analysis has similar precision to Earl et al.’s analysis for k = 0. We conjecture that this variant is not a viable alternative in practice, because of the significant loss in precision. Might and Shivers [20] proposed ΓCFA (abstract garbage collection) and µCFA (abstract counting) to increase the precision of k -CFA. ΓCFA removes unreachable bindings from the variable environment, and µCFA counts how many times a variable is bound during the analysis. The two techniques combined reduce the number of spurious flows and give precise environment information. Stack references in CFA2 have a similar effect, because different calls to the same function use different frames. However, we can utilize ΓCFA and µCFA to improve precision in the heap. Recently, Kobayashi [15] proposed a way to statically verify properties of typed higherorder programs using model-checking. He models a program by a higher-order recursion scheme G, expresses the property of interest in the modal µ-calculus and checks if the infinite tree generated by G satisfies the property. This technique can do flow analysis, since flow analysis can be encoded as a model-checking problem. The target language of this work is the simply-typed lambda calculus. Programs in a Turing-complete language must be approximated in the simply-typed lambda calculus in order to be model-checked. 8. Conclusions In this paper we propose CFA2, a pushdown model of higher-order programs, and prove it correct. CFA2 provides precise call/return matching and has a better approach to variable binding than k -CFA. Our evaluation shows that CFA2 gives more accurate data-flow information than 0CFA and 1CFA. Stack lookups make CFA2 polyvariant because different calls to the same function are analyzed in different environments. We did not add polyvariance in the heap to keep the presentation simple. Heap polyvariance is orthogonal to call/return matching; integrating existing techniques [1, 26, 31] in CFA2 should raise no difficulties. For example, CFA2 can be extended with call-strings polyvariance, like k -CFA, to produce a family of analyses CFA2.0, CFA2.1 and so on. Then, any instance of CFA2.k would be strictly more precise than the corresponding instance of k -CFA. We believe that pushdown models are a better tool for higher-order flow analysis than control-flow graphs, and are working on providing more empirical support to this thesis. We plan to use CFA2 for environment analysis and stack-related optimizations. We also plan to add support for call/cc in CFA2. CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 23 Acknowledgements. We would like to thank Danny Dubé for discovering the stackfiltering exploit and for giving us permission to include it here. Thanks also to Mitch Wand and the anonymous reviewers for their helpful comments on the paper. References [1] Ole Agesen. The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism. In European Conference on Object-Oriented Programming, pages 2–26, 1995. [2] Rajeev Alur, Michael Benedikt, Kousha Etessami, Patrice Godefroid, Thomas W. Reps, and Mihalis Yannakakis. Analysis of Recursive State Machines. Transactions on Programming Languages and Systems, 27(4):786–818, 2005. [3] Ahmed Bouajjani, Javier Esparza, and Oded Maler. Reachability Analysis of Pushdown Automata: Application to Model-Checking. In International Conference on Concurrency Theory, pages 135–150, 1997. [4] Satish Chandra, Stephen J. Fink, and Manu Sridharan. Snugglebug: a powerful approach to weakest preconditions. In Programming Language Design and Implementation, pages 363–374, 2009. [5] Swarat Chaudhuri. Subcubic Algorithms for Recursive State Machines. In Principles of Programming Languages, pages 159–169, 2008. [6] William D. Clinger and Lars Thomas Hansen. Lambda, the Ultimate Label or a Simple Optimizing Compiler for Scheme. In LISP and Functional Programming, pages 128–139, 1994. [7] Saumya K. Debray and Todd A. Proebsting. Interprocedural Control Flow Analysis of First-Order Programs with Tail-Call Optimization. Transactions on Programming Languages and Systems, 19(4):568– 585, 1997. [8] Christopher Earl, Matthew Might, and David Van Horn. Pushdown Control-Flow Analysis of HigherOrder Programs. In Workshop on Scheme and Functional Programming, 2010. [9] Manuel Fähndrich and Jakob Rehof. Type-based flow analysis and context-free language reachability. Mathematical Structures in Computer Science, 18(5):823–894, 2008. [10] Alain Finkel, Bernard Willems, and Pierre Wolper. A direct symbolic approach to model checking pushdown systems. Electronic Notes in Theoretical Computer Science, 9, 1997. [11] Cormac Flanagan, Amr Sabry, Bruce F. Duba, and Matthias Felleisen. The Essence of Compiling with Continuations. In Programming Language Design and Implementation, pages 237–247, 1993. [12] Jörgen Gustavsson and Josef Svenningsson. Constraint Abstractions. In Programs as Data Objects, pages 63–83, 2001. [13] Nevin Heintze. Set-based program analysis. PhD thesis, Carnegie-Mellon Univ., 1992. [14] Michael Hind. Pointer analysis: haven’t we solved this problem yet? In Program Analysis For Software Tools and Engineering, pages 54–61, 2001. [15] Naoki Kobayashi. Types and higher-order recursion schemes for verification of higher-order programs. In Principles of Programming Languages, pages 416–428, 2009. [16] David Kranz. ORBIT: An Optimizing Compiler for Scheme. PhD thesis, Yale University, 1988. [17] David Melski and Thomas Reps. Interconvertibility of a Class of Set Constraints and Context-FreeLanguage Reachability. Theoretical Comp. Sci., 248(1-2):29–98, 2000. [18] Jan Midtgaard and Thomas Jensen. Control-flow analysis of function calls and returns by abstract interpretation. In International Conference on Functional Programming, pages 287–298, 2009. [19] Matthew Might. Environment Analysis of Higher-Order Languages. PhD thesis, Georgia Institute of Technology, 2007. [20] Matthew Might and Olin Shivers. Improving Flow Analyses via ΓCFA: Abstract Garbage Collection and Counting. In International Conference on Functional Programming, pages 13–25, 2006. [21] Christian Mossin. Flow Analysis of Typed Higher-Order Programs. PhD thesis, DIKU, Department of Computer Science, University of Copenhagen, 1996. [22] Jakob Rehof and Manuel Fähndrich. Type-Based Flow Analysis: From Polymorphic Subtyping to CFL-Reachability. In Principles of Programming Languages, pages 54–66, 2001. [23] Thomas W. Reps, Susan Horwitz, and Shmuel Sagiv. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Principles of Programming Languages, pages 49–61, 1995. 24 D. VARDOULAKIS AND O. SHIVERS [24] Amr Sabry and Matthias Felleisen. Reasoning About Programs in Continuation-Passing Style. In LISP and Functional Programming, pages 288–298, 1992. [25] Micha Sharir and Amir Pnueli. Two Approaches to Interprocedural Data Flow Analysis. In Program Flow Analysis, Theory and Application. Prentice Hall, 1981. [26] Olin Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie-Mellon University, 1991. [27] Olin Shivers. Higher-Order Control-Flow Analysis in Retrospect: Lessons Learned, Lessons Abandoned. In Best of PLDI, pages 257–269, 2004. [28] Manu Sridharan and Rastislav Bodı́k. Refinement-based context-sensitive points-to analysis for Java. In Programming Language Design and Implementation, pages 387–400, 2006. [29] Guy L. Steele. Rabbit: A Compiler for Scheme. Master’s thesis, MIT, 1978. [30] David Van Horn and Harry G. Mairson. Deciding k-CFA is complete for EXPTIME. In International Conference on Functional Programming, pages 275–282, 2008. [31] Andrew Wright and Suresh Jagannathan. Polymorphic Splitting: An Effective Polyvariant Flow Analysis. Transactions on Programming Languages and Systems, 20(1):166–207, 1998. CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 25 Appendix A. We use the notation πi (he1 , . . . , en i) to retrieve the ith element of a tuple he1 , . . . , en i. Also, we write L(g) to get the label of a term g. In section 1, we mentioned that labels in a program can be split into disjoint sets according to the innermost user lambda that contains them. The “label to label” map LL(ψ) returns the labels that are in the same set as ψ. For example, in the program (λ1 (x k1) (k1 (λ2 (y k2) (x y (λ3 (u) (x u k2)4 ))5 ))6 ), these sets are {1, 6} and {2, 3, 4, 5}, so we know LL(4) = {2, 3, 4, 5} and LL(6) = {1, 6}. Definition A.1. For every term g, the map BV (g) returns the variables bound by lambdas which are subterms of g. The map has a simple inductive definition: BV ([[(λψ (v1 . . . vn )call )]]) = {v1 , . . . , vn } ∪ BV (call ) BV ([[(g1 . . . gn )ψ ]]) = BV (g1 ) ∪ · · · ∪ BV (gn ) BV (v) = ∅ We assume that CFA2 works on an alphatized program, i.e., a program where all variables have distinct names. Thus, if (λψ (v1 . . . vn )call ) is a term in such a program, we know that no other lambda in that program binds variables with names v1 , . . . , vn . (During execution of CFA2, we do not rename any variables.) The following lemma is a simple consequence of alphatization. Lemma A.2. A concrete state ς has the form (. . . , ve, t). (1) For any closure (lam, β) ∈ range(ve), it holds that dom(β) ∩ BV (lam) = ∅. (2) If ς is an Eval with call site call and environment β, then dom(β) ∩ BV (call ) = ∅. (3) If ς is an Apply, for any closure (lam, β) in operator or argument position, then dom(β) ∩ BV (lam) = ∅. Proof. We show that the lemma holds for the initial state I(pr ). Then, for each transition ς → ς 0 , we assume that ς satisfies the lemma and show that ς 0 also satisfies it. • I(pr ) is a UApply of the form ((pr , ∅), (lam, ∅), halt, ∅, hi). Since ve is empty, (1) trivially holds. Also, both closures have an empty environment so (3) holds. • The [UEA] transition is: ([[(f e q)l ]], β, ve, t) → (proc, d, c, ve, l :: t) proc = A(f, β, ve) d = A(e, β, ve) c = A(q, β, ve) The ve doesn’t change in the transition, so (1) holds for ς 0 . The operator is a closure of the form (lam, β 0 ). We must show that dom(β 0 ) ∩ BV (lam) = ∅. If Lam ? (f ), then lam = f and β 0 = β. Also, we know dom(β) ∩ BV ([[(f e q)l ]]) = ∅ ⇒ dom(β) ∩ (BV (f ) ∪ BV (e) ∪ BV (q)) = ∅ ⇒ dom(β) ∩ BV (f ) = ∅. If Var ? (f ), then (lam, β 0 ) ∈ range(ve), so we get the desired result because ve satisfies (1). Similarly for d and c. • The [UAE] transition is: (proc, d, c, ve, t) → (call , β 0 , ve 0 , t) 26 D. VARDOULAKIS AND O. SHIVERS proc ≡ h[[(λl (u k) call )]], βi β 0 = β[u 7→ t][k 7→ t] ve 0 = ve[(u, t) 7→ d][(k, t) 7→ c] To show (1) for ve 0 , it suffices to show that d and c don’t violate the property. The user argument d is of the form (lam 1 , β1 ). Since ς satisfies (3), we know dom(β1 )∩BV (lam 1 ) = ∅, which is the desired result. Similarly for c. Also, we must show that ς 0 satisfies (2). We know {u, k}∩BV (call ) = ∅ because the program is alphatized. Also, from property (3) for ς we know dom(β)∩BV ([[(λl (u k) call )]]) = ∅, which implies dom(β) ∩ BV (call ) = ∅. We must show dom(β 0 ) ∩ BV (call ) = ∅ ⇔ (dom(β) ∪ {u, k}) ∩ BV (call ) = ∅ ⇔ (dom(β) ∩ BV (call )) ∪ ({u, k} ∩ BV (call )) = ∅ ⇔ ∅ ∪ ∅ = ∅. • Similarly for the other two transitions. Theorem A.3 (Simulation). If ς → ς 0 and |ς|ca v ςˆ, then there exists ςˆ0 such that ςˆ ; ςˆ0 and |ς 0 |ca v ςˆ0 . Proof. By cases on the concrete transition. a) Rule [UEA] ([[(f e q)l ]], β, ve, t) → (proc, d, c, ve, l :: t) proc = A(f, β, ve) d = A(e, β, ve) c = A(q, β, ve) Let ts = toStack (LV (l), β, ve). Since |ς|ca v ςˆ, ςˆ is of the form ([[(f e q)l ]], st, h), where |ve|ca v h and ts v st. The abstract transition is ([[(f e q)l ]], st, h) ; (f 0 , d̂, ĉ, st 0 , h) f 0 ∈ Âu (f, l, st, h) d̂ = Âu (e, l, st, h) ĉ = Â k (q, st) pop(st) Var ? (q)  0 st = st Lam ? (q) ∧ (H? (l, f ) ∨ Lam ? (f ))   0 st[f 7→ {f }] Lam ? (q) ∧ S? (l, f ) State ςˆ has many possible successors, one for each lambda in Âu (f, l, st, h). We must show that one of them is a state ςˆ0 such that |ς 0 |ca v ςˆ0 . The variable environment and the heap don’t change in the transitions, so for ς 0 and ςˆ0 we know that |ve|ca v h. We must show π1 (proc) = f 0 , |d|ca v d̂, |c|ca v ĉ and ts 0 v st 0 , where ts 0 is the stack of |ς 0 |ca . We first show π1 (proc) = f 0 , by cases on f : • Lam ? (f ) Then, proc = (f, β) and f 0 ∈ {f }, so f 0 = f . CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 27 • S? (l, f ) Then, proc = ve(f, β(f )), a closure of the form (lam, β 0 ). Since ts(f ) = |ve(f, β(f ))|ca = {lam} and ts v st, we get lam ∈ st(f ). So, we pick f 0 to be lam. • H? (l, f ) Then, proc = ve(f, β(f )), a closure of the form (lam, β 0 ). Since |ve|ca v h and lam ∈ |ve|ca (f ), we get lam ∈ h(f ). So, we pick f 0 to be lam. Showing |d|ca v d̂ is similar. We now show |c|ca v ĉ, by cases on q: • Lam ? (q) Then, c = (q, β) and ĉ = q, so |c|ca v ĉ. • Var ? (q) and c = ve(q, β(q)) = halt Then, ts(q) = halt. Since ts v st, we get st(q) = halt. Thus, ĉ = halt. • Var ? (q) and c = ve(q, β(q)) = (lam, β 0 ) Similar to the previous case. It remains to show that ts 0 v st 0 . We proceed by cases on q and f : • Var ? (q) and c = ve(q, β(q)) = halt Then, ts 0 = hi. By ts v st, we know that ts and st have the same size. Also, st 0 = pop(st), thus st 0 = hi. Therefore, ts 0 v st 0 . • Var ? (q) and c = ve(q, β(q)) = (lam, β 0 ) By Fig. 5, we know that ts 0 = toStack (LV (L(lam)), β 0 , ve) = pop(ts). Also, st 0 = pop(st). Thus, to show ts 0 v st 0 it suffices to show pop(ts) v pop(st), which holds because ts v st. • Lam ? (q) ∧ (Lam ? (f ) ∨ H? (l, f )) Then, ts 0 = ts and st 0 = st, so ts 0 v st 0 . • Lam ? (q) ∧ S? (l, f ) By LV (L(q)) = LV (l), we get that ts 0 = ts. Also, proc = ve(f, β(f )), a closure of the form (lam, β 0 ). We pick f 0 to be lam. The stack of ςˆ0 is st 0 = st[f 7→ {lam}]. Since pop(ts) v pop(st), we only need to show that the top frames of ts 0 and st 0 are in v. For this, it suffices to show that ts 0 (f ) v st 0 (f ) which holds because ts 0 (f ) = ts(f ) = {lam}. b) Rule [UAE] (proc, d, c, ve, t) → (call , β 0 , ve 0 , t) proc ≡ h[[(λl (u k) call )]], βi β 0 = β[u 7→ t][k 7→ t] ve 0 = ve[(u, t) 7→ d][(k, t) 7→ c] ( hi c = halt Let ts = toStack (LV (L(lam)), β1 , ve) c = (lam, β1 ) Since |ς|ca v ςˆ, ςˆ is of the form ([[(λl (u k) call )]], d̂, ĉ, st, h), where |d|ca v d̂, |c|ca = ĉ, ts v st and |ve|ca v h. The abstract transition is ([[(λl (u k) call )]], d̂, ĉ, st, h) ; (call , st 0 , h 0 ) st 0 =( push([u 7→ d̂][k 7→ ĉ], st) h t [u 7→ d̂] H? (u) h0 = h S? (u) 28 D. VARDOULAKIS AND O. SHIVERS Let ts 0 be the stack of |ς 0 |ca . The innermost user lambda that contains call is λl , therefore ts 0 = toStack (LV (l), β 0 , ve 0 ). We must show that |ς 0 |ca v ςˆ0 , i.e., ts 0 v st 0 and |ve 0 |ca v h 0 . We assume that c = (lam, β1 ) and that H? (u) holds, the other cases are simpler. In this case, |ve 0 |ca is the same as |ve|ca except that |ve 0 |ca (u) = |ve|ca (u) t |d|ca . Also, h 0 (u) = h(u) t d̂, thus |ve 0 |ca v h 0 . We know that β 0 contains bindings for u and k, and by lemma A.2 it doesn’t bind any variables in BV (call ). Since LV (l) \ {u, k} = BV (call ), β 0 doesn’t bind any variables in LV (l) \ {u, k}. Thus, the top frame of ts 0 is [u 7→ |d|ca ][k 7→ |c|ca ]. The top frame of st 0 is [u 7→ d̂][k 7→ ĉ], therefore the frames are in v. To complete the proof of ts 0 v st 0 , we must show that pop(ts 0 ) v pop(st 0 ) ⇔ pop(ts 0 ) v st ⇐ pop(ts 0 ) = ts. We know pop(ts 0 ) = toStack (LV (L(lam)), β1 , ve 0 ), ts = toStack (LV (L(lam)), β1 , ve). By the temporal consistency of states (cf. [19] definition 4.4.5), pop(ts 0 ) won’t contain the two bindings born at time t because they are younger than all bindings in β1 . This implies that pop(ts 0 ) = ts. c) Rule [CEA] ([[(q e)γ ]], β, ve, t) → (proc, d, ve, γ :: t) proc = A(q, β, ve) d = A(e, β, ve) Let ts = toStack (LV (γ), β, ve). Since |ς|ca v ςˆ, ςˆ is of the form ([[(q e)γ ]], st, h), where |ve|ca v h and ts v st. The abstract transition is ([[(q e)γ ]], st, h) ; (q 0 , d̂, st 0 , h) q 0 = Âk (q, st) d̂ = Â( u (e, γ, st, h) pop(st) Var ? (q) st 0 = st Lam ? (q) Let ts 0 be the stack of |ς 0 |ca . We must show that |ς 0 |ca v ςˆ0 , i.e., |proc|ca = q 0 , |d|ca v d̂, and ts 0 v st 0 . We first show |proc|ca = q 0 , by cases on q: • Lam ? (q) Then, proc = (q, β) and q 0 = q. Thus, |proc|ca = q 0 . • Var ? (q) and proc = ve(q, β(q)) = (lam, β1 ) Since q ∈ LV (γ) we get ts(q) = lam. From the latter and ts v st, we get st(q) = lam, which implies q 0 = lam, which implies |proc|ca = q 0 . • Var ? (q) and proc = ve(q, β(q)) = halt Similar to the previous case. Showing |d|ca v d̂ is similar, by cases on e. Last, we show ts 0 v st 0 , by cases on q: • Lam ? (q) Then, st 0 = st. Also, ts 0 = toStack (LV (L(q)), β, ve) and LV (L(q)) = LV (γ). Thus, ts 0 = ts, which implies ts 0 v st 0 . CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 29 • Var ? (q) and proc = ve(q, β(q)) = (lam, β1 ) Then, ts 0 = toStack (LV (L(lam)), β1 , ve) = pop(ts) and st 0 = pop(st). To show ts 0 v st 0 , it suffices to show pop(ts) v pop(st), which holds by ts v st. • Var ? (q) and proc = ve(q, β(q)) = halt Similar to the previous case. d) Rule [CAE] This case requires arguments similar to the previous cases. d -to-Apply \ transition, the stack below the top frame is irrelevant. Lemma A.4. On an Eval Formally, • If ([[(f e lam)l ]], tf :: st, h) ; (ulam, d̂, lam, tf 0 :: st, h) then for any st 0 , ([[(f e lam)l ]], tf :: st 0 , h) ; (ulam, d̂, lam, tf 0 :: st 0 , h) • If ([[(f e k)l ]], tf :: st, h) ; (ulam, d̂, ĉ, st, h) then for any st 0 , ([[(f e k)l ]], tf :: st 0 , h) ; (ulam, d̂, ĉ, st 0 , h) [ • Similarly for rule [CEA]. d transition, the stack is irrelevant. Formally, \ Lemma A.5. On an Apply-toEval • If ([[(λl (u k) call )]], d̂, ĉ, st, h) ; (call , [u 7→ d̂][k 7→ ĉ] :: st, h 0 ) then for any st 0 , ([[(λl (u k) call )]], d̂, ĉ, st 0 , h) ; (call , [u 7→ d̂][k 7→ ĉ] :: st 0 , h 0 ) [ where st 0 is any non-empty stack. • Similarly for rule [CAE], Definition A.6 (Push Monotonicity). Let p ≡ ςˆe ;∗ ςˆ where ςˆe is an entry with stack st e . The path p is push monotonic iff every transition ςˆ1 ; ςˆ2 satisfies the following property: If the stack of ςˆ1 is st e then the transition can only push the stack, it cannot pop or modify the top frame. Push monotonicity is a property of paths, not of individual transitions. A push monotonic path can contain transitions that pop, as long as the stack never shrinks below the stack of the initial state of the path. The following properties are simple consequences of push monotonicity. Property A.7. The stack of the first state in a push-monotonic path is a suffix of the stack of every other state in the path. Property A.8. In a push-monotonic path, the number of pushes is greater than or equal to the number of pops. The following lemma associates entries with “same-level reachable” states. A state ςˆ is same-level reachable from an entry ςˆe if it is in the procedure whose entry is ςˆe or if it is in some procedure that can be reached from ςˆe through tail calls, i.e., without growing the stack. Lemma A.9 (Same-level reachability). Let ςˆe = ([[(λl (u k) call )]], d̂, ĉ, st e , he ), ςˆ = (. . . , st, h), and p ≡ ςˆe ;∗ ςˆ where ςˆe ∈ CE ∗p (ˆ ς ). Then, (1) If ςˆ is an entry, st = st e . 30 D. VARDOULAKIS AND O. SHIVERS (2) If ςˆ is not an entry, (a) st is of the form tf :: st e , for some frame tf . (b) there exists k 0 such that tf (k 0 ) = ĉ. (c) if ςˆe = CE p (ˆ ς ) then dom(tf ) ⊆ LV (l), tf (u) v d̂ and tf (k) = ĉ. d over call site ψ then ψ ∈ LL(l), and if ςˆ is a CApply \ over Moreover, if ςˆ is an Eval 0 0 (λγ (u )call ) then γ ∈ LL(l). (3) p is push monotonic. Proof. By induction on the length |p| of p. Note that (3) follows from the form of the stack in (1) and (2), so we won’t prove it separately. Basecase: If |p| = 0, then ςˆ = ςˆe so st = st e . Inductive step: If |p| > 0, there are two cases; either ςˆe = CE p (ˆ ς ) or ςˆe 6= CE p (ˆ ς ). a) ςˆe = CE p (ˆ ς) Since |p| > 0, ςˆ is not an entry, so the second or the third branch of the definition of CE p determine the shape of p. a1) p ≡ ςˆe ;∗ ςˆ0 ; ςˆ \ exit, and ςˆe = CE p (ˆ Here, the predecessor ςˆ0 of ςˆ is not a CEval ς 0 ). We proceed by \ because then ςˆ is an entry, so ςˆ = CE p (ˆ cases on ςˆ0 . Note that ςˆ0 cannot be a UEval ς ), and our assumption that ςˆe = CE p (ˆ ς ) breaks. \ a1.1) ςˆ0 is an inner CEval 0 Then, ςˆ0 = ([[((λγ (u0 )call 0 ) e0 )γ ]], st 0 , h 0 ). By IH, st 0 = tf 0 :: st e , dom(tf 0 ) ⊆ LV (l), tf 0 (u) v d̂, tf 0 (k) = ĉ and γ 0 ∈ LL(l). By the abstract semantics, ςˆ = ([[(λγ (u0 )call 0 )]], d̂0 , st 0 , h 0 ) where d̂0 = Âu (e0 , γ 0 , st 0 , h 0 ). We know that γ ∈ LL(l) because γ 0 ∈ LL(l). Also, the stack is unchanged in the transition. Thus, (2a), (2b) and (2c) hold for ςˆ. \ a1.2) ςˆ0 is a CApply Then, ςˆ0 = ([[(λγ (u0 )call 0 )]], d̂0 , st 0 , h 0 ). By IH, st 0 = tf 0 :: st e , dom(tf 0 ) ⊆ LV (l), tf 0 (u) v d̂, tf 0 (k) = ĉ and γ ∈ LL(l). By the abstract semantics, ςˆ = (call 0 , st, h) where st = st 0 [u0 7→ d̂0 ]. So, st = tf :: st e which satisfies (2a). Also, tf = tf 0 [u0 7→ d̂0 ] where u0 ∈ LV (l) because γ ∈ LL(l), and u0 6= u because the program is α-tized. Thus, dom(tf ) = dom(tf 0 ) ∪ {u0 } ⊆ LV (l), and tf (u) = tf 0 (u) v d̂, and tf (k) = tf 0 (k) = ĉ. Last, the label of call 0 is in LL(l) because γ ∈ LL(l). \ a1.3) ςˆ0 is a UApply 0 Then, ςˆ = ςˆe because ςˆe = CE p (ˆ ς 0 ). This case is simple. + + 0 a2) p ≡ ςˆe ; ςˆ2 ; ςˆ3 ; ςˆ ; ςˆ Here, the third branch of the definition of CE p determines the shape of p, so ςˆ2 is a \ exit and ςˆ3 ∈ CE ∗p (ˆ call, ςˆe = CE p (ˆ ς2 ), ςˆ0 is a CEval ς 0 ). By IH for ςˆe ;+ ςˆ2 we get ςˆ2 = ([[(f2 e2 (λγ2 (u2 )call 2 ))l2 ]], st 2 , h2 ), where st 2 ≡ tf 2 :: st e , dom(tf 2 ) ⊆ LV (l), tf 2 (u) v d̂, tf 2 (k) = ĉ and l2 ∈ LL(l). By the abstract semantics for ςˆ2 ; ςˆ3 we get ςˆ3 = ([[(λl3 (u3 k3 )call 3 )]], d̂3 , ĉ3 , st 3 , h2 ), where [[(λl3 (u3 k3 )call 3 )]] ∈ Âu (f2 , l2 , st 2 , h2 ), CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 31 d̂3 = Âu (e2 , l2 , st 2 , h2 ), ĉ3 = [[(λγ2 (u2 )call 2 )]] and either st 3 = st 2 , if (Lam ? (f2 ) ∨ H? (l2 , f2 )) holds, or st 3 = st 2 [f2 7→ {[[(λl3 (u3 k3 )call 3 )]]}], if S? (l2 , f2 ) holds. a2.1) S? (l2 , f2 ) Then, st 3 = tf 2 [f2 7→ {[[(λl3 (u3 k3 )call 3 )]]}] :: st e . 0 By IH for ςˆ3 ;+ ςˆ0 we get ςˆ0 = ([[(k 0 e0 )γ ]], st 0 , h 0 ), where st 0 = tf 0 :: st 3 and tf 0 (k 0 ) = [[(λγ2 (u2 )call 2 )]]. Thus, by the abstract semantics for ςˆ0 ; ςˆ we get ςˆ = ([[(λγ2 (u2 )call 2 )]], d̂0 , st 3 , h 0 ). Now, γ2 ∈ LL(l) follows from l2 ∈ LL(l). Also, st = tf :: st e where tf = tf 2 [f2 7→ {[[(λl3 (u3 k3 )call 3 )]]}]. Then, dom(tf ) = dom(tf 2 ) ∪ {f2 } ⊆ LV (l) because S? (l2 , f2 ) implies f2 ∈ LV (l). Also, tf (k) = tf 2 (k) = ĉ. Last, we take cases depending on whether u and f2 are the same variable or not. • u = f2 tf (u) = {[[(λl3 (u3 k3 )call 3 )]]} ⊆ Âu (f2 , l2 , st 2 , h2 ) = st 2 (f2 ) = tf 2 (f2 ) = tf 2 (u) v d̂ • u 6= f2 tf (u) = tf 2 (u) v d̂ a2.2) Lam ? (f2 ) ∨ H? (l2 , f2 ) This case is simpler than the previous case because st 3 = st 2 . b) ςˆe 6= CE p (ˆ ς ) (but ςˆe ∈ CE ∗p (ˆ ς )) Then, the second branch of the definition of CE ∗p determines the shape of p; p ≡ ςˆe ;+ ςˆ1 ; ςˆ2 ;∗ ςˆ, where ςˆ1 is a tail call, ςˆ2 = CE p (ˆ ς ) and ςˆe ∈ CE ∗p (ˆ ς1 ). l1 + By IH for ςˆe ; ςˆ1 we get ςˆ1 = ([[(f1 e1 k1 ) ]], st 1 , h1 ), where st 1 = tf 1 :: st e , tf 1 (k1 ) = ĉ. By the abstract semantics, ςˆ2 = ([[(λl2 (u2 k2 )call 2 )]], d̂2 , ĉ, st e , h1 ). b.1) ςˆ is an entry Then, ςˆ = ςˆ2 because ςˆ2 = CE p (ˆ ς ). So, st = st e . b.2) ςˆ is not an entry By IH for ςˆ2 ;∗ ςˆ we get st ≡ tf :: st e and tf (k2 ) = ĉ. This is the desired result for ςˆe ;∗ ςˆ. Lemma A.10 (Local simulation). If ςˆ ; ςˆ0 and succ(|ˆ ς |al ) 6= ∅, then |ˆ ς 0 |al ∈ succ(|ˆ ς |al ). Proof. By cases on the abstract transition. [ the other cases are similar. We only show the lemma for [UEA], l 0 0 ([[(f e q) ]], st, h) ; (f , d̂, ĉ, st , h) f 0 ∈ Âu (f, l, st, h) d̂ = Âu (e, l, st, h) ĉ = Â k (q, st)  Var ? (q) pop(st) 0 st = st Lam ? (q) ∧ (H? (l, f ) ∨ Lam ? (f ))   0 st[f 7→ {f }] Lam ? (q) ∧ S? (l, f ) \ state has a successor only when its stack is not empty, so st ≡ tf :: st 00 . A UEval 32 D. VARDOULAKIS AND O. SHIVERS Thus, |st|al = { (v, tf (v)) : v ∈ dom(tf ) ∧ UVar ? (v)}. Then, |ˆ ς |al = ([[(f e q)l ]], |st|al , h). Also, |ˆ ς 0 |al = (f 0 , d̂, h). If suffices to show that f 0 ∈ Ãu (f, l, |st|al , h) and d̂ = Ãu (e, l, |st|al , h); but these hold because Ãu (v, ψ, |st|al , h) = Âu (v, ψ, st, h) is true for any v (uvar or ulam). Lemma A.11 (Converse of Local Simulation). If ς˜ ≈> ς˜0 then, for any ςˆ such that ς˜ = |ˆ ς |al , there exists a state ςˆ0 such that ςˆ ; ςˆ0 and 0 0 ς˜ = |ˆ ς |al Lemma A.12 (Path decomposition). Let p ≡ ςˆe ;∗ ςˆ be push monotonic and ςˆe = ([[(λl (u k) call )]], d̂, ĉ, st e , he ). \ of the form (ĉ, . . . , st e , . . . ) then CE p (ˆ • if ςˆ is a CApply ς ) is not defined. • Otherwise, (1) CE p (ˆ ς ) is defined, i.e., p ≡ ςˆe ;∗ ςˆ1 ;∗ ςˆ, where ςˆ1 = CE p (ˆ ς ). (2) Regarding the set CE ∗p (ˆ ς ), p can be in one of four forms (a) p ≡ ςˆe ;∗ ςˆ where ςˆe = CE p (ˆ ς ) and CE ∗p (ˆ ς ) = {ˆ ςe } + + ∗ (b) p ≡ e1 ; c1 ; . . . ; ek ; ck ; ςˆ1 ; ςˆ, k > 0, where ei s are entries, ci s are tail calls, e1 = ςˆe , ei = CE p (ci ), ςˆ1 = CE p (ˆ ς ) and CE ∗p (ˆ ς ) = {e1 , . . . , ek , ςˆ1 } + ∗ (c) p ≡ ςˆe ; c ; ςˆ1 ; ςˆ where c is a call, ςˆ1 = CE p (ˆ ς ) and CE ∗p (ˆ ς ) = {ˆ ς1 } (d) p ≡ ςˆe ;+ c ; e1 ;+ c1 ; . . . ; ek ;+ ck ; ςˆ1 ;∗ ςˆ, k > 0, where c is a call, ei s are entries, ci s are tail calls, ei = CE p (ci ), ςˆ1 = CE p (ˆ ς ) and ∗ CE p (ˆ ς ) = {e1 , . . . , ek , ςˆ1 } Proof. By induction on the length of p. Basecase: ςˆe ;0 ςˆe Then, ςˆ = ςˆe ⇒ ςˆe = CE p (ˆ ς ) ⇒ CE ∗p (ˆ ς ) = {ˆ ςe } ⇒ (2a) holds Inductive step: ςˆe ;∗ ςˆ0 ; ςˆ Cases on ςˆ0 : a) ςˆ0 is a Call Then, ςˆ is an entry so CE p (ˆ ς ) = ςˆ. Also, CE ∗p (ˆ ς ) = {ˆ ς } so (2c) holds. 0 b) ςˆ is a Tail Call Then, ςˆ is an entry so CE p (ˆ ς ) = ςˆ. To show (2), we take cases on whether (2a), (2b), (2c) or (2d) holds for ςˆ0 . b.1) (2a) holds for ςˆ0 , i.e., p ≡ ςˆe ;∗ ςˆ0 ; ςˆ where ςˆe = CE p (ˆ ς 0 ) and CE ∗p (ˆ ς 0 ) = {ˆ ςe }. By the second branch ∗ ∗ 0 ∗ ς ) ⊆ CE p (ˆ ς ). Hence, CE ∗p (ˆ ς ) = {ˆ ςe , ςˆ}, which implies of the definition of CE p , CE p (ˆ that (2b) holds for ςˆ. b.2) (2b) holds for ςˆ0 By a similar argument, we find that (2b) holds for ςˆ. b.3) (2c) holds for ςˆ0 By a similar argument, we find that (2d) holds for ςˆ. b.4) (2d) holds for ςˆ0 By a similar argument, we find that (2d) holds for ςˆ. 0 \ ≡ (ĉ, . . . , st e , . . . ) c) ςˆ is a CApply Then, in the transition ςˆ0 ; ςˆ we modify the top frame of st e , which means that p isn’t push monotonic. Thus, this case can’t arise. CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 33 \ or a CApply \ 6≡ (ĉ, . . . , st e , . . . ) d) ςˆ0 is an inner CEval ∗ By IH , p ≡ Î(pr ) ; ςˆ1 ;+ ςˆ0 ; ςˆ, where ςˆ1 = CE p (ˆ ς 0 ). By the second branch of the definition of CE p , ςˆ1 = CE p (ˆ ς ). To show (2), we take cases on whether (2a), (2b), (2c) or (2d) holds for ςˆ0 . The reasoning is the same as in case (b). \ exit e) ςˆ0 is a CEval By IH , p ≡ ςˆe ;∗ ςˆ1 ;+ ςˆ0 ; ςˆ, where ςˆ1 = CE p (ˆ ς 0 ). 0 Cases on (2a), (2b), (2c) or (2d) for ςˆ . e.1) (2a) holds for ςˆ0 , i.e. p ≡ ςˆe ;+ ςˆ0 ; ςˆ where ςˆe = CE p (ˆ ς 0 ). 0 By lemma A.9, the stack of ςˆ is of the form tf :: st e and tf (k) = ĉ. Thus, ςˆ0 ≡ (ĉ, . . . , st e , . . . ). The only way for CE p (ˆ ς ) to exist is by the third branch of the definition 0 \ exit. But there is no call leading to ςˆe , thus CE p (ˆ of CE p , since ςˆ is a CEval ς ) can’t exist. Similarly when (2b) holds for ςˆ0 . e.2) (2c) holds for ςˆ0 , i.e. p ≡ ςˆe ;+ c ; ςˆ1 ;+ ςˆ0 ; ςˆ where c is a call and ςˆ1 = CE p (ˆ ς 0 ). By IH , CE p (c) exists so p can be written p ≡ ςˆe ;∗ ςˆ2 ;+ c ; ςˆ1 ;+ ςˆ0 ; ςˆ where ςˆ2 = CE p (c). Then, by the third branch of the definition of CE p , CE p (ˆ ς ) = CE p (c) = ςˆ2 . To show (2) for ςˆ we work as in the previous cases. f) ςˆ0 is an Entry This case is simple. Lemma A.13 (Stack irrelevance). Let p ≡ ςˆ1 ; ςˆ2 ; . . . ; ςˆn be push monotonic, where ςˆ1 = (ulam, d̂, ĉ, st e , he ). Also, ςˆn is \ of the form (ĉ, . . . , st e , . . . ). By property A.7, the stack of each ςˆi is of the not a CApply form append (st i , st e ). For an arbitrary stack st 0 and continuation ĉ0 , consider the sequence p0 of states ςˆ10 ςˆ20 . . . ςˆn0 where each ςˆi0 is produced by ςˆi as follows: • if ςˆi is an entry with stack st e then replace the continuation argument with ĉ0 and the stack with st 0 . • if st e is a proper suffix of the stack of ςˆi then the latter has the form append (st 0i , hfr i i, st e ) for some stack st 0i . Change st e to st 0 and bind the continuation variable in fr i to ĉ0 . (Note: the map isn’t total, but it should be defined for all states in p.) Then, 0 0 • for any two states ςˆi0 and ςˆi+1 in p0 , it holds that ςˆi0 ; ςˆi+1 0 • the path p is push monotonic Proof. By induction on the length of p. The basecase is simple. Inductive step: p = ςˆ1 ;∗ ςˆn−1 ; ςˆn 0 By IH, the transitions in the path ςˆ10 ;∗ ςˆn−1 are valid with respect to the abstract semantics 0 and the path is push monotonic. We must show that (ˆ ςn−1 , ςˆn0 ) ∈; and that ςˆ10 ;∗ ςˆn0 is push monotonic. Cases on ςˆn−1 : 34 D. VARDOULAKIS AND O. SHIVERS \ , of the form ([[(f e q)l ]], st, h) (1) ςˆn−1 is a UEval By lemma A.12, CE p (ˆ ςn−1 ) is defined and p can be in one of four forms. We consider only the first case, the rest are similar. Let p ≡ ςˆ1 ;+ ςˆn−1 ; ςˆn where ςˆ1 = CE p (ˆ ςn−1 ). By lemma A.9, st is of the form tf :: st e and the continuation variable in tf (call it k) is bound to ĉ. (a) q is a variable By the abstract semantics we have that ςˆn is (ulam n , d̂n , ĉ, st e , h). Also, the state 0 ςˆn−1 is ([[(f e q)l ]], tf [k 7→ ĉ0 ] :: st 0 , h), and it transitions to (ulam n , d̂n , ĉ0 , st 0 , h) which is ςˆn0 . (b) q is a lambda and f is a stack reference Then, ςˆn is (ulam n , d̂n , q, tf [f 7→ {ulam n }] :: st e , h). 0 Also, the state ςˆn−1 is ([[(f e q)l ]], tf [k 7→ ĉ0 ] :: st 0 , h), and it transitions to (ulam n , d̂n , q, tf [k 7→ ĉ0 ][f 7→ {ulam n }] :: st 0 , h) which is ςˆn0 . (c) q is a lambda and f is a heap reference Similarly. \ exit (2) ςˆn−1 is a CEval By lemma A.12, CE p (ˆ ςn−1 ) is defined and p can be in one of four forms. (a) p ≡ ςˆ1 ;+ ςˆn−1 ; ςˆn where ςˆ1 = CE p (ˆ ςn−1 ) Then, by lemma A.9 and the abstract semantics, it is easy to see that ςˆn is of the form (ĉ, . . . , st e , . . . ). Thus, this case isn’t possible. ςn−1 ). Similarly when ςˆ1 6= CE p (ˆ ςn−1 ) but is in CE ∗p (ˆ + 0 + 0 (b) p ≡ ςˆ1 ; c ; ςˆe ; ςˆn−1 ; ςˆ where ςˆe = CE p (ˆ ςn−1 ) and c is a call: Then, CE p (c) is defined and its stack has st e as a suffix. Hence, by lemma A.9, the stack of c is bigger than st e by at least a frame. Since the stack of ςˆe0 has the same size as the stack of c, the stack of ςˆn−1 is bigger than st e by at least two frames. By lemma A.4 we get the desired result. Similarly when ςˆe0 6= CE p (ˆ ςn−1 ) but is in CE ∗p (ˆ ςn−1 ). \ (3) ςˆn−1 is an inner CEval Similarly to the previous cases. \ (4) ςˆn−1 is a UApply Lemma A.12 gives the same four cases. We only consider one, the rest are similar. Let p ≡ ςˆ1 ;+ c ; ςˆn−1 ; ςˆn where c is a call. Then, CE p (c) is defined and its stack has st e as a suffix. Hence, by lemma A.9, the stack of c is bigger than st e by at least a frame. Since the stack of ςˆn−1 has the same 0 size as the stack of c, we don’t change the continuation argument in ςˆn−1 . By lemma A.5 we get the desired result. \ (5) ςˆn−1 is a CApply Similarly to the previous cases. Theorem A.14 (Soundness). If p ≡ Î(pr ) ;∗ ςˆ then, after summarization: • if ςˆ is not a final state then (|CE p (ˆ ς )|al , |ˆ ς |al ) ∈ Seen • if ςˆ is a final state then |ˆ ς |al ∈ Final CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 35 \ exit and ςˆ0 ∈ CE ∗p (ˆ • if ςˆ is a CEval ς ) then (|ˆ ς 0 |al , |ˆ ς |al ) ∈ Seen Proof. By induction on the length of p. Basecase: Î(pr ) ;0 Î(pr ) Then, (Î(pr ), Î(pr )) ∈ Seen. Inductive step: Î(pr ) ;∗ ςˆ0 ; ςˆ Cases on ςˆ: a) ςˆ is an Entry Then, CE p (ˆ ς ) = ςˆ. Also, ςˆ0 is a call or a tail call. By lemma A.12, p ≡ Î(pr ) ;∗ ςˆ1 ;+ ςˆ0 ; ςˆ, where ςˆ1 = CE p (ˆ ς 0 ). 0 By IH, (|ˆ ς1 |al , |ˆ ς |al ) ∈ Seen which means that it has been entered in W and examined. By lemma A.10, |ˆ ς |al ∈ succ(|ˆ ς 0 |al ) so in line 10 or 22 (|ˆ ς |al , |ˆ ς |al ) will be propagated. \ but not a final state b) ςˆ is a CApply 0 Then, ςˆ = ([[(λγ (u) call )]], d̂, st, h) and ςˆ0 = ([[(q e)γ ]], st 0 , h). \ b.1) Lam ? (q), i.e. ςˆ0 is an inner CEval This case is simple. \ exit b.2) Var ? (q), i.e. ςˆ0 is a CEval ∗ The path Î(pr ) ; ςˆ0 satisfies part 2 of lemma A.12. It can’t satisfy cases 2a or 2b because ςˆ would be a final state by lemma A.9. Thus, it satisfies 2c or 2d. Then, the path is of the form p ≡ Î(pr ) ;∗ ςˆ1 ;+ ςˆ2 ; ςˆ3 ;+ ςˆ0 ; ςˆ where ςˆ2 is a call, ςˆ1 = CE p (ˆ ς2 ) and ςˆ3 ∈ CE ∗p (ˆ ς 0 ). Note that by the third branch of the definition of CE p , ςˆ1 = CE p (ˆ ς ). We must show that (|ˆ ς1 |al , |ˆ ς |al ) ∈ Seen. The state ςˆ1 is an entry of the form ςˆ1 = ([[(λl1 (u1 k1 ) call 1 )]], d̂1 , ĉ1 , st 1 , h1 ) The state ςˆ2 is a call of the form ςˆ2 = ([[(f2 e2 q2 )l2 ]], st 2 , h2 ), where q2 is a clam. Lemma A.9 for ςˆ1 ;+ ςˆ2 gives st 2 ≡ tf 2 :: st 1 . By the abstract semantics for ςˆ2 ; ςˆ3 , we get: ςˆ3 = (ulam, d̂3 , q2 , st 3 , h2 ), where either st 3 = st 2 , if (Lam ? (f2 ) ∨ H? (l2 , f2 )) holds, or st 3 = st 2 [f2 7→ {ulam}], if S? (l2 , f2 ) holds. i.e. st ( 3 = tf 3 :: st 1 , and tf 2 Lam ? (f2 ) ∨ H? (l2 , f2 ) tf 3 = tf 2 [f2 7→ {ulam}] S? (l2 , f2 ) By lemma A.9 for ςˆ3 ;+ ςˆ0 , we get st 0 = tf 0 :: st 3 and tf 0 (q) = q2 . Then, by the abstract semantics for ςˆ0 ; ςˆ, q2 = [[(λγ (u) call )]], st = st 3 , and d̂ = Âu (e, γ 0 , st 0 , h). The above information will become useful when dealing with the local counterparts of the aforementioned states. By IH , (|ˆ ς3 |al , |ˆ ς 0 |al ) was entered in W (at line 25) and later examined at line 13. Note that ςˆ3 6= Î(pr ) because ςˆ2 is between them, therefore Final will not be called at line 15. Also by IH , (|ˆ ς1 |al , |ˆ ς2 |al ) was entered in W and later examined. Lemma A.10 implies that |ˆ ς3 |al ∈ succ(|ˆ ς2 |al ) so (|ˆ ς1 |al , |ˆ ς2 |al , |ˆ ς3 |al ) will go in Callers. We take cases on whether (|ˆ ς3 |al , |ˆ ς 0 |al ) or (|ˆ ς1 |al , |ˆ ς2 |al ) was examined first by the algorithm. 36 D. VARDOULAKIS AND O. SHIVERS b.2.1) (|ˆ ς1 |al , |ˆ ς2 |al ) was examined first Then, when (|ˆ ς3 |al , |ˆ ς 0 |al ) is examined, (|ˆ ς1 |al , |ˆ ς2 |al , |ˆ ς3 |al ) is in Callers. Therefore, at line 18 we call Update(|ˆ ς1 |al , |ˆ ς2 |al , |ˆ ς3 |al , |ˆ ς 0 |al ). By applying |·|al to the abstract states we get |ˆ ς1 |al = ([[(λl1 (u1 k1 ) call 1 )]], d̂1 , h1 ) |ˆ ς2 |al = ([[(f2 e2 q2 )l2 ]], tf 2 , h2 ), where q2 = [[(λγ (u) call )]]. |ˆ ς3 |al = (ulam, d̂3 , h2 ) 0 |ˆ ς 0 |al = ([[(q e)γ ]], tf 0 , h), where tf 0 (q) = [[(λγ (u) call )]]. By looking at Update’s code, we see that the return value is Ãu (e, γ 0 , tf 0 , h) = 0 0  (u (e, γ , st , h) = d̂. The frame of the return state is tf 2 Lam ? (f2 ) ∨ H? (l2 , f2 ) tf 2 [f2 7→ {ulam}] S? (l2 , f2 ) which is equal to tf 3 . The heap at the return state is h. Last, the continuation we are returning to is [[(λγ (u) call )]]. Thus, the return state ς˜ is equal to |ˆ ς |al , and we call Propagate(|ˆ ς1 |al , |ˆ ς |al ), so (|ˆ ς1 |al , |ˆ ς |al ) will go in Seen. b.2.2) (|ˆ ς3 |al , |ˆ ς 0 |al ) was examined first Then, when (|ˆ ς1 |al , |ˆ ς2 |al ) is examined, (|ˆ ς3 |al , |ˆ ς 0 |al ) is in Summary, and at line 12 we 0 call Update(|ˆ ς1 |al , |ˆ ς2 |al , |ˆ ς3 |al , |ˆ ς |al ). Proceed as above. c) ςˆ is a final state Then, ςˆ = (halt, d̂, hi, h). We must show that |ˆ ς |al will be in Final after the execution of the summarization algorithm. By the abstract semantics for ςˆ0 ; ςˆ, ςˆ0 = ([[(k e)γ ]], st 0 , h), where st 0 = tf 0 :: hi, tf 0 (k) = halt, and d̂ = Âu (e, γ, st 0 , h). By IH for Î(pr ) ;∗ ςˆ0 , we know that (|Î(pr )|al , |ˆ ς 0 |al ) was entered in W and Summary sometime during the algorithm. When it was examined, the test at line 14 was true so we called Final(|ˆ ς 0 |al ). Hence, we insert ς˜ = (halt, Ãu (e, γ, tf 0 , h), ∅, h) in Final . But, 0 Ãu (e, γ, tf , h) = Âu (e, γ, st 0 , h) = d̂, hence ς˜ = |ˆ ς |al . \ d) ςˆ is a CEval exit By lemma A.12 for Î(pr ) ;∗ ςˆ0 , p ≡ Î(pr ) ;∗ ςˆ1 ;∗ ςˆ0 ; ςˆ, where ςˆ1 = CE p (ˆ ς 0 ). But \ exit (it is an Apply \ state), so by the second branch of the definition of ςˆ0 is not a CEval CE p we get ςˆ1 = CE p (ˆ ς ). By IH , (|ˆ ς1 |al , |ˆ ς 0 |al ) is entered in Seen and W ; and examined at line 6. By lemma A.10, |ˆ ς |al ∈ succ(|ˆ ς 0 |al ) so (|ˆ ς1 |al , |ˆ ς |al ) will be propagated (line 7) and entered in Seen (line 25). We need to show that for every ςˆ00 ∈ CE ∗p (ˆ ς ), (|ˆ ς 00 |al , |ˆ ς |al ) will be inserted in Seen. The ∗ 0 path Î(pr ) ; ςˆ satisfies part 2 of lemma A.12; proceed by cases: d.1) Î(pr ) ;∗ ςˆ0 satisfies 2a Then, ςˆ1 = Î(pr ) and p ≡ ςˆ1 ;∗ ςˆ0 ; ςˆ and CE ∗p (ˆ ς ) = {ˆ ς1 }. But we ’ve shown that (|ˆ ς1 |al , |ˆ ς |al ) is entered in Seen. d.2) Î(pr ) ;∗ ςˆ0 satisfies 2b Then, p ≡ e1 ;+ c1 ; . . . ; ek ;+ ck ; ςˆ1 ;∗ ςˆ0 ; ςˆ, where e1 = Î(pr ), ei s are entries, ci s are tail calls, ei = CE p (ci ), CE ∗p (ˆ ς 0 ) = {e1 , . . . , ek , ςˆ1 }. CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 37 Hence, CE ∗p (ˆ ς ) = {e1 , . . . , ek , ςˆ1 }. To show that (|ek |al , |ˆ ς |al ) is entered in Seen, we proceed by cases on whether (|ek |al , |ck |al ) or (|ˆ ς1 |al , |ˆ ς |al ) was examined first by the algorithm. d.2.1) (|ek |al , |ck |al ) was examined first By lemma A.10, |ˆ ς1 |al is in succ(|ck |al ), hence (|ek |al , |ck |al , |ˆ ς1 |al ) will go in TCallers. Then, when (|ˆ ς1 |al , |ˆ ς |al ) is examined, in line 19 we will call Propagate(|ek |al , |ˆ ς |al ), so (|ek |al , |ˆ ς |al ) will go in Seen. d.2.2) (|ˆ ς1 |al , |ˆ ς |al ) was examined first When (|ek |al , |ck |al ) is examined, (|ˆ ς1 |al , |ˆ ς |al ) will be in Summary, and by lemma A.10 we know |ˆ ς1 |al ∈ succ(|ck |al ). Thus, in line 24 we will call Propagate which will insert (|ek |al , |ˆ ς |al ) in Seen. By repeating this process k − 1 times, we can show that all edges (|ei |al , |ˆ ς |al ) go in Seen. d.3) Î(pr ) ;∗ ςˆ0 satisfies 2c or 2d These cases are similar to the previous cases. The only difference is that now Î(pr ) is not in CE ∗p (ˆ ς 0 ) (which doesn’t change the proof). e) ςˆ is a Tail Call (thus an exit) By lemma A.12 for Î(pr ) ;∗ ςˆ0 , p ≡ Î(pr ) ;∗ ςˆ1 ;∗ ςˆ0 ; ςˆ, where ςˆ1 = CE p (ˆ ς 0 ). But \ exit (it is an Apply \ state), so by the second branch of the definition of ςˆ0 is not a CEval CE p we get ςˆ1 = CE p (ˆ ς ). By IH , (|ˆ ς1 |al , |ˆ ς 0 |al ) is entered in Seen and W ; and examined at line 6. By lemma A.10, |ˆ ς |al ∈ succ(|ˆ ς 0 |al ) so (|ˆ ς1 |al , |ˆ ς |al ) will be propagated (line 7) and entered in Seen (line 25). \ f) ςˆ is an inner CEval This case is simple. g) ςˆ is a Call This case is simple. Theorem A.15 (Completeness). After summarization: • For each (˜ ς1 , ς˜2 ) in Seen, there exist ςˆ1 , ςˆ2 and p such that p ≡ Î(pr ) ;∗ ςˆ1 ;∗ ςˆ2 and ς˜1 = |ˆ ς1 |al and ς˜2 = |ˆ ς2 |al and ςˆ1 ∈ CE ∗p (ˆ ς2 ) • For each ς˜ in Final , there exist ςˆ and p such that p ≡ Î(pr ) ;+ ςˆ and ς˜ = |ˆ ς |al and ςˆ is a final state. Proof. By induction on the number of iterations. We prove that the algorithm maintains the following properties for Seen and Final . (1) For each (˜ ς1 , ς˜2 ) in Seen, there exist ςˆ1 , ςˆ2 and p such that p ≡ Î(pr ) ;∗ ςˆ1 ;∗ ςˆ2 ^ exit then ςˆ1 ∈ CE ∗p (ˆ and ς˜1 = |ˆ ς1 |al and ς˜2 = |ˆ ς2 |al and, if ς˜2 is a CEval ς2 ) otherwise ςˆ1 = CE p (ˆ ς2 ) (2) For each ς˜ in Final , there exist ςˆ and p such that p ≡ Î(pr ) ;+ ςˆ and ς˜ = |ˆ ς |al and ςˆ is a final state. 38 D. VARDOULAKIS AND O. SHIVERS Initially, we must show that the properties hold before the first iteration (at the beginning of the algorithm): Final is empty and W contains just (Ĩ(pr ), Ĩ(pr )), for which property 1 holds. Now the inductive step: at the beginning of each iteration, we remove an edge (˜ ς1 , ς˜2 ) from W . We assume that the properties hold at that point. We must show that, after we process the edge, the new elements of Seen and Final satisfy the properties. ^ or an inner CEval ^ • ς˜2 is an entry, a CApply (˜ ς1 , ς˜2 ) is in Seen, so by IH ∃ ςˆ1 , ςˆ2 , p. p ≡ Î(pr ) ;∗ ςˆ1 ;∗ ςˆ2 ∧ ς˜1 = |ˆ ς1 |al ∧ ς˜2 = |ˆ ς2 |al ∧ ςˆ1 = CE p (ˆ ς2 ) For each ς˜3 in succ(˜ ς2 ), (˜ ς1 , ς˜3 ) will be propagated. If (˜ ς1 , ς˜3 ) is already in Seen then property 1 holds by IH (in the following cases, we won’t repeat this argument and will assume that the insertion in Seen happens now). Otherwise, we insert the edge at this iteration, at line 25. By lemma A.11, ∃ ςˆ3 . ς˜3 = |ˆ ς3 |al ∧ ςˆ2 ; ςˆ3 By the second branch of the definition of CE p , ςˆ1 = CE p (ˆ ς3 ) • ς˜2 is a call Let ς˜1 = ([[(λ1 (u1 k1 )call 1 )]], d̂1 , h1 ) and ς˜2 = ([[(f2 e2 (λ2 (u2 )call 2 ))l2 ]], tf 2 , h2 ) Also, assume S? (l2 , f2 ) (the other cases are simpler). (˜ ς1 , ς˜2 ) is in Seen, so by IH ∃ ςˆ1 , ςˆ2 , p. p ≡ Î(pr ) ;∗ ςˆ1 ;+ ςˆ2 ∧ ς˜1 = |ˆ ς1 |al ∧ ς˜2 = |ˆ ς2 |al ∧ ςˆ1 = CE p (ˆ ς2 ) Each entry ς˜3 in succ(˜ ς2 ) will be propagated. By lemma A.11, ∃ ςˆ3 . ς˜3 = |ˆ ς3 |al ∧ ςˆ2 ; ςˆ3 Since ςˆ3 = CE p (ˆ ς3 ), property 1 holds for ς˜3 . If there is no edge (˜ ς3 , ς˜4 ) in Summary, we are done. Otherwise, we call Update(˜ ς1 , ς˜2 , ς˜3 , ς˜4 ) and we must show that property 1 holds for the edge inserted in Seen by Update. Let st 1 be the stack of ςˆ1 . By lemma A.9, the stack of ςˆ2 is tf 2 :: st 1 . Let ς˜3 = ([[(λ3 (u3 k3 )call 3 )]], d̂3 , h2 ) and ς˜4 = ([[(k4 e4 )l4 ]], tf 4 , h4 ). (Note that tf 4 contains only user bindings.) ^ exit) We know Summary ⊆ Seen so by IH for (˜ ς3 , ς˜4 ) we get (note that ς˜4 is a CEval ∗ 0 0 0 0 ∗ 0 + 0 0 0 0 ∃ ςˆ3 , ςˆ4 , p . p ≡ Î(pr ) ; ςˆ3 ; ςˆ4 ∧ ς˜3 = |ˆ ς3 |al ∧ ς˜4 = |ˆ ς4 |al ∧ ςˆ3 ∈ CE p0 (ˆ ς40 ) Then, ςˆ30 = ([[(λ3 (u3 k3 )call 3 )]], d̂3 , ĉ3 , st 03 , h2 ) and by lemma A.9, ςˆ40 = ([[(k4 e4 )]], tf 4 [k4 7→ ĉ3 ] :: st 03 , h4 ). But the path from ςˆ30 to ςˆ40 is push monotonic, so by lemma A.13 there exist states ςˆ3 = ([[(λ3 (u3 k3 )call 3 )]], d̂3 , [[(λ2 (u2 )call 2 )]], st 3 , h2 ) where st 3 = tf 2 [f2 7→ {[[(λ3 (u3 k3 )call 3 )]]}] :: st 1 , and ςˆ4 = ([[(k4 e4 )]], st 4 , h4 ) where st 4 = tf 4 [k4 7→ [[(λ2 (u2 )call 2 )]]] :: st 3 , such that ςˆ3 ;+ ςˆ4 . Thus, the path p can be extended to Î(pr ) ;∗ ςˆ1 ;+ ςˆ2 ; ςˆ3 ;+ ςˆ4 . By the abstract semantics, the successor ςˆ of ςˆ4 is ([[(λ2 (u2 )call 2 )]], Âu (e4 , l4 , st 4 , h4 ), st 3 , h4 ). The state ς˜ produced by Update is ([[(λ2 (u2 )call 2 )]], Ãu (e4 , l4 , tf 4 , h4 ), tf , h4 ) where tf = tf 2 [f2 7→ {[[(λ3 (u3 k3 )call 3 )]]}]. It is simple to see that ς˜ = |ˆ ς |al . l2 ^ • ς˜2 is a CEval exit, ([[(k e) ]], tf 2 , h2 ) If ς˜1 is Ĩ(pr ) then Final(˜ ς2 ) is called and a local state ς˜ of the form (halt, Ãu (e, l2 , tf 2 , h2 ), ∅, h2 ) goes in Final . We must show that property 2 holds. By IH for (˜ ς1 , ς˜2 ), ∃ ςˆ2 , p. p ≡ Î(pr ) ;+ ςˆ2 ∧ ς˜2 = |ˆ ς2 |al ∧ Î(pr ) ∈ CE ∗p (ˆ ς2 ). CFA2: A CONTEXT-FREE APPROACH TO CONTROL-FLOW ANALYSIS 39 (Note that ςˆ1 = Î(pr ).) By lemma A.9, the stack st 2 of ςˆ2 is tf 2 [k 7→ halt] :: hi. Hence, the successor ςˆ of ςˆ2 is (halt, Âu (e, st 2 , h2 ), hi, h2 ), and ς˜ = |ˆ ς |al holds. If ς˜1 6= Ĩ(pr ), for each triple (˜ ς3 , ς˜4 , ς˜1 ) in Callers, we call Update(˜ ς3 , ς˜4 , ς˜1 , ς˜2 ). Insertion in Callers happens only at line 11, which means that (˜ ς3 , ς˜4 ) is in Seen. Thus, by IH ∃ ςˆ3 , ςˆ4 , p. p ≡ Î(pr ) ;∗ ςˆ3 ;+ ςˆ4 ∧ ς˜3 = |ˆ ς3 |al ∧ ς˜4 = |ˆ ς4 |al ∧ ςˆ3 = CE p (ˆ ς4 ) Also, ς˜4 ≈> ς˜1 thus by lemma A.11 ∃ ςˆ1 . ςˆ4 ; ςˆ1 ∧ ς˜1 = |ˆ ς1 |al Using the IH for (˜ ς1 , ς˜2 ) and lemma A.13 we can show that the edge inserted by Update satisfies property 1 (similar to the previous case). For each triple (˜ ς3 , ς˜4 , ς˜1 ) in TCallers, we call Propagate(˜ ς3 , ς˜2 ). We must show that property 1 holds for (˜ ς3 , ς˜2 ). Insertion in TCallers happens only at line 23, which means that (˜ ς3 , ς˜4 ) is in Seen. By IH for (˜ ς1 , ς˜2 ) and (˜ ς3 , ς˜4 ) and by lemma A.13, we can show that there are states ςˆ3 and ςˆ2 and path p0 such that ς˜3 = |ˆ ς3 |al , ς˜2 = |ˆ ς2 |al and ςˆ3 ∈ CE ∗p0 (ˆ ς2 ). Hence, property 1 holds for (˜ ς3 , ς˜2 ). • ς˜2 is a tail call Similarly. This work is licensed under the Creative Commons Attribution-NoDerivs License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/2.0/ or send a letter to Creative Commons, 171 Second St, Suite 300, San Francisco, CA 94105, USA, or Eisenacher Strasse 2, 10777 Berlin, Germany
6cs.PL
A Local-Search Algorithm for Steiner Forest Martin Groß∗† Anupam Gupta‡ arXiv:1707.02753v1 [cs.DS] 10 Jul 2017 Daniel R. Schmidtk↑ Amit Kumar§ Melanie Schmidt♯↑ Jannik Matuschke¶↑ José Verschae♮ July 11, 2017 Abstract In the Steiner Forest problem, we are given a graph and a collection of source-sink pairs, and the goal is to find a subgraph of minimum total length such that all pairs are connected. The problem is APX-Hard and can be 2-approximated by, e.g., the elegant primal-dual algorithm of Agrawal, Klein, and Ravi from 1995. We give a local-search-based constant-factor approximation for the problem. Local search brings in new techniques to an area that has for long not seen any improvements and might be a step towards a combinatorial algorithm for the more general survivable network design problem. Moreover, local search was an essential tool to tackle the dynamic MST/Steiner Tree problem, whereas dynamic Steiner Forest is still wide open. It is easy to see that any constant factor local search algorithm requires steps that add/drop many edges together. We propose natural local moves which, at each step, either (a) add a shortest path in the current graph and then drop a bunch of inessential edges, or (b) add a set of edges to the current solution. This second type of moves is motivated by the potential function we use to measure progress, combining the cost of the solution with a penalty for each connected component. Our carefully-chosen local moves and potential function work in tandem to eliminate bad local minima that arise when using more traditional local moves. Our analysis first considers the case where the local optimum is a single tree, and shows optimality w.r.t. moves that add a single edge (and drop a set of edges) is enough to bound the locality gap. For the general case, we show how to “project” the optimal solution onto the different trees of the local optimum without incurring too much cost (and this argument uses optimality w.r.t. both kinds of moves), followed by a tree-by-tree argument. We hope both the potential function, and our analysis techniques will be useful to develop and analyze local-search algorithms in other contexts. ∗ Institut für Mathematik, Technische Universität Berlin, [email protected]. Supported by the DFG within project A07 of CRC TRR 154. ‡ Department of Computer Science, Carnegie Mellon University, [email protected]. § Department of Computer Science and Engineering, Indian Institute of Technology, [email protected]. ¶ TUM School of Management, Technische Universität München, [email protected]. ↑ Partly supported by the German Academic Exchange Service (DAAD). k Institut für Informatik, Universität zu Köln, [email protected]. ♯ Institut für Informatik, Universität Bonn, [email protected]. ♮ Facultad de Matemáticas & Escuela de Ingeniería, Pontificia Universidad Católica de Chile, [email protected]. Partly supported by Nucleo Milenio Información y Coordinación en Redes ICM/FIC P10-024F. † 1 Introduction The Steiner Forest problem is the following basic network design problem: given a graph G = (V, E) with edge-lengths de , and a set of source-sink pairs {{si , ti }}ki=1 , find a subgraph H of minimum total length such that each {si , ti } pair lies in the same connected component of H. This problem generalizes the Steiner Tree problem, and hence is APX-hard. The Steiner Tree problem has a simple 2-approximation, namely the minimum spanning tree on the terminals in the metric completion; however, the forest version does not have such obvious algorithms. Indeed, the first approximation algorithm for this problem was a sophisticated and elegant primal-dual 2-approximation due to Agrawal, Klein, and Ravi [AKR95]. Subsequently, Goemans and Williamson streamlined and generalized these ideas to many other constrained network design problems [GW95]. These results prove an integrality gap of 2 for the natural cut-covering LP. Other proofs of this integrality gap were given in [Jai01, CS09]. No better LP relaxations are currently known (despite attempts in, e.g., [KLS05, KLSvZ08]), and improving the approximation guarantee of 2 remains an outstanding open problem. Note that all known constant-factor approximation algorithms for Steiner Forest were based on linear programming relaxations, until a recent greedy algorithm [GK15]. In this paper, we add to the body of techniques that give constant-factor approximations for Steiner Forest. The main result of this paper is the following: Theorem 1. There is a (non-oblivious) local search algorithm for Steiner Forest with a constant locality gap. It can be implemented to run in polynomial time. The Steiner Forest problem is a basic network problem whose approximability has not seen any improvements in some time. We explore new techniques to attacking the problem, with the hope that these will give us more insights into its structure. Moreover, for many problems solved using the constrained forest approach of [GW95], the only constant factor approximations known are via the primal-dual/local-ratio approach, and it seems useful to bring in new possible techniques. Another motivation for our work is to make progress towards obtaining combinatorial algorithms for the survivable network design problem. In this problem, we are given connectivity requirements between various source-sink pairs, and we need to find a minimum cost subset of edges which provide this desired connectivity. Although we know a 2approximation algorithm for the survivable network design problem [Jai01] based on iterative rounding, obtaining a combinatorial constant-factor approximation algorithm for this problem remains a central open problem [WS11]. So far, all approaches of extending primal-dual or greedy algorithms to survivable network design have only had limited success. Local search algorithms are more versatile in the sense that one can easily propose algorithms based on local search for various network design problems. Therefore, it is important to understand the power of such algorithms in such settings. We take a step towards this goal by showing that such ideas can give constant-factor approximation algorithms for the Steiner Forest problem. Finally, we hope this is a step towards solving the dynamic Steiner Forest problem. In this problem, terminal pairs arrive online and we want to maintain a constant-approximate Steiner Forest while changing the solution by only a few edges in each update. Several of the approaches used for the Steiner Tree case (e.g., in [MSVW12, GGK13, LOP+ 15]) are based on local-search, and we hope our local-search algorithm for Steiner Forest in the offline setting will help solve the dynamic Steiner Forest problem, too. 1.1 Our Techniques One of the challenges with giving a local-search algorithm for Steiner Forest is to find the right set of moves. Indeed, it is easy to see that simple-minded approaches like just adding and dropping a constant number of edges at each step is not enough. E.g., in the example of Figure 1, the improving moves must add an edge 1 and remove multiple edges. (This holds even if we take the metric completion of the graph.) We therefore consider a natural generalization of simple edge swaps in which we allow to add paths and remove multiple edges from the induced cycle. Local Moves: Our first task is to find the “right” moves that add/remove many edges in each “local” step. At any step of the algorithm, our algorithm has a feasible forest, and performs one of these local moves (which are explained in more detail in §3): • edge/set swaps: Add an edge to a tree in the forest, and remove one or more edges from the cycle created. • path/set swaps: Add a shortest-path between two vertices of a tree in the forest, and again remove edges from the cycle created. • connecting moves: Connect some trees of the current forest by adding edges between them. At the end of the algorithm, we apply the following post-processing step to the local optimum: • clean-up: Delete all inessential edges. (An edge is inessential if dropping it does not alter the feasibility of the solution.) Given these local moves, the challenge is to bound the locality gap of the problem: the ratio between the cost of a local optimum and that of the global optimum. The Potential: The connecting moves may seem odd, since they only increase the length of the solution. However, a crucial insight behind our algorithm is that we do not perform local search with respect to the total length of the solution. Instead we look to improve a different potential φ. (In the terminology of [Ali94, KMSV98], our algorithm is a non-oblivious local search.) The potential φ(T ) of a tree T is the total length of its edges, plus the distance between the furthest source-sink pair in it, which we call its width. The potential of the forest A is the sum of the potentials of its trees. We only perform moves that cause the potential of the resulting solution to decrease. In §A.2 we give an example where performing the above moves with respect to the total length of the solution gives us local optima with cost Ω(log n) · OPT — this example is useful for intuition for why using this potential helps. Indeed, if we have a forest where the distance between two trees in the forest is much less than both their widths, we can merge them and reduce the potential (even though we increase the total length). So the trees in a local optimum are “well-separated” compared to their widths, an important property for our analysis. The Proof: We prove the constant locality gap in two conceptual steps. ℓ ℓ ℓ As the first step, we assume 1 1 1 k k k s1 s2 t2 s3 t3 sℓ tℓ t1 that the local optimum hapℓ pens to be a single tree. In this case we show that the essen- Figure 1: The black edges (continuous lines) are the current solution. If ℓ ≫ k, we should tial edges of this tree T have move to the blue forest (dashed lines), but any improving move must change Ω(k) edges. cost at most O(OPT)—hence Details can be found in §A.1. the final removal of inessential edges gives a good solution. To prove this, we need to charge our edges to OPT’s edges. However, we cannot hope to charge single edges in our solution to single edges in OPT—we need to charge multiple edges in our solution to edges of OPT. (We may just have more edges than OPT does. More concretely, this happens in the example from Figure 1, when ℓ = Θ(k) and we are at the black tree and OPT is the blue forest.) So we consider edge/set swaps that try to swap some subset S of T ’s edges for an edge f of OPT. Since such a swap is non-improving at a local optimum, the cost of S is no more than that of f . Hence, we would like to partition T ’s edges into groups and find an O(1)-to-1 map of groups to edges of OPT of no less cost. Even if we cannot find an explicit such map, it turns out that Hall’s theorem is the key to showing its existence. ... 2 Indeed, the intuition outlined above works out quite nicely if we imagine doing the local search with respect to the total length instead of the potential. The main technical ingredient is a partitioning of our edges into equivalence classes that behave (for our purposes) “like single edges”, allowing us to apply a Hall-type argument. This idea is further elaborated in §4.1 with detailed proofs in §6. However, if we go back to considering the potential, an edge/set swap adding f and removing S may create multiple components, and thus increase the width part of the potential. Hence we give a more delicate argument showing that similar charging arguments work out: basically we now have to charge to the width of the globally optimal solution as well. A detailed synopsis is presented in §4.2, and the proofs are in §7. The second conceptual step is to extend this argument to the case where we can perform all possible local moves, and the local optimum is a forest A . If OPT’s connected components are contained in those of A , we can do the above analysis for each A -component separately. So imagine that OPT has edges that go between vertices in different components of A . We simply give an algorithm that takes OPT and “projects” it down to another solution OPT′ of comparable cost, such that the new projected solution OPT′ has connected components that are contained in the components of A . We find the existence of a cheap projected solution quite surprising; our proof crucially uses the optimality of the algorithm’s solution under both path/set swaps and connecting moves. Again, a summary of our approach is in §5, with proofs in §8. Polynomial-time Algorithm. The locality gap with respect to the above moves is at most 46. Finally, we show that the swap moves can be implemented in polynomial time, and the connecting moves can be approximated to within constant factors. Indeed, a c-approximation for weighted k-MST gives a 23(1+ c)+ ε-approximation. Applying a weighted version of Garg’s 2-approximation [Gar05, Gar16] yields c = 2. The resulting approximation guarantee is 69 (compared to 96 for [GK15]). Details on this can be found in §B. 1.2 Related Work Local search techniques have been very successful for providing good approximation guarantees for a variety of problems: e.g., network design problems such as low-degree spanning trees [FR94], min-leaf spanning trees [LR96, SO98], facility location and related problems, both uncapacitated [KPR00, AGK+ 04] and capacitated [PTW01], geometric k-means [KMN+ 04], mobile facility location [AFS13], and scheduling problems [PS15]. Other examples can be found in, e.g., the book of Williamson and Shmoys [WS11]. More recent are applications to optimization problems on planar and low-dimensional instances [CM15, CG15]. In particular, the new PTAS for low dimensional k-means in is based on local search [CAKM16, FRS16]. Local search algorithms have also been very successful in practice – e.g., the widely used Lin-Kernighan heuristic [LK73] for the travelling salesman problem, which has been experimentally shown to perform extremely well [Hel00]. Imase and Waxman [IW91] defined the dynamic Steiner tree problem where vertices arrive/depart online, and a few edge changes are performed to maintain a near-optimal solution. Their analysis was improved by [MSVW12, GGK13, GK14, LOP+ 15], but extending it to Steiner Forest remains wide open. 2 Preliminaries Let G = (V, E) be an undirected graph with non-negative edge weights de ∈ R≥0 . Let n := |V |. For W ⊆ V , let G[W ] = (W, E[W ]) be the vertex-induced subgraph, and for F ⊆ E, G[F ] = (V [F ], F ) the edge-induced subgraph, namely the graph consisting of the edges in F and the vertices contained in them. A forest is a set of edges F ⊆ E such that G[F ] is acyclic. For a node set W ⊆ V and an edge set F ⊆ E, let δF (W ) denote the edges of F leaving W . Let δF (A : B) := δF (A) ∩ δF (B) for two disjoint node sets A, B ⊆ V be the set of edges that go between A 3 and B. For forests F1 , F2 ⊆ E we use δF (F1 : F2 ) := δF (V [F1 ] : V [F2 ]). We may drop the subscript if it is clear from the context. Let T ⊆ {{v, v̄} | v, v̄ ∈ V } be a set of terminal pairs. Denote the shortest-path distance between u and ū in (G, d) by distd (u, ū). Let nt be the number of terminal pairs. We number the pairs according to nondecreasing shortest path distance (ties broken arbitrarily). Thus, T = {{u1 , ū1 }, . . . , {unt , ūnt }} and i < j implies distd (ui , ūi ) ≤ distd (uj , ūj ). This numbering ensures consistent tie-breaking throughout the paper. We say that G = (V, E), the weights d and T form a Steiner Forest instance. We often use A to denote a feasible Steiner forest held by our algorithm and F to denote an optimal/good feasible solution to which we compare A . Width. Given a connected set of edges E ′ , the width w(E ′ ) of E ′ is the maximum distance (in the original graph) of any terminal pair connected by E ′ : i.e., w(E ′ ) = max{u,ū}∈T,u,ū∈V [E ′ ] distd (u, ū). Notice that w(E ′ ) is the width of the pair {ui , ūi } with the largest i among all pairs in V [E ′ ]. We set index(E ′ ) := max{i | ui , ūi ∈ V [E ′ ]}, i.e., w(E ′ ) = distd (uindex(E ′ ) , ūindex(E ′ ) ). For a subgraph G[F ] = (V [F ], F ) given by F ⊆ E with connected components E1 , . . . , El ⊆ F , we define P the total width of F to be the sum w(F ) := li=1 w(Ei ) of the widths of its connected components. Let P d(F ) := e∈F de be the sum of edge lengths of edges in F and define φ(F ) := d(F ) + w(F ). By the definition of the width, it follows that d(F ) ≤ φ(F ) ≤ 2d(F ). 3 The Local Search Algorithm Our local-search algorithm starts with a feasible solution A , and iteratively tries to improve it. Instead of looking at the actual edge cost d(A ), we work with the potential φ(A ) and decrease it over time. In the rest of the paper, we say a move changing A into A ′ is improving if φ(A ′ ) < φ(A ). A solution A is <move>-optimal with respect to certain kind of move if no moves of that kind are improving. a a b c c d edge/edge swap a b b d c c a d edge/set swap a b b d c c a d path/set swap a c b b d d c d a b e connecting move untouched by move added by move e removed by move Figure 2: Our different moves. Swaps. Swaps are moves that start with a cycle-free feasible solution A , add some edges and remove others to get to another cycle-free feasible solution A ′ . • The most basic swap is: add an edge e creating a cycle, remove an edge f from this cycle. This is called an edge/edge swap (e, f ). • We can slightly generalize this: add an edge e creating a cycle, and remove a subset S of edges from this cycle C(e). This is called the edge/set swap (e, S). Edge/edge swaps are a special case of edge/set swaps, so edge/set swap-optimality implies edge/edge swap-optimality. There may be many different subsets of C(e) we could remove. A useful fact is that if we fix some edge f ∈ C(e) to remove, this uniquely gives a maximal set R(e, f ) ⊆ C(e) of edges that can be removed along with f after adding e without violating feasibility. Indeed, R(e, f ) contains f , and also all edges on C(e) that can be removed in A ∪ {e}\{f } without destroying feasibility. (See Lemma 13 for a formalization.) 4 Moreover, given a particular R(e, f ), we could remove any subset S ⊆ R(e, f ). If we were doing local search w.r.t. d(A ), there would be no reason to remove a proper subset. But since the local moves try to reduce φ(A ), removing a subset of R(e, f ) may be useful. If e1 , . . . , eℓ are the edges in R(e, f ) in the order they appear on C(e), we only need swaps where S consists of edges ei , . . . , ej that are consecutive in the above order. There are O(n2 ) sets S ⊆ R(e, f ) that are consecutive.∗ Moreover, there are at most n − 1 choices for e and O(n) choices for f , so the number of edge/set swaps is polynomial. • A further generalization: we can pick two vertices u, v lying in some component T , add a shortest-path between them (in the current solution, where all other components are shrunk down to single points, and the vertices/edges in T \ {u, v} are removed). This creates a cycle, and we want to remove some edges. We now imagine that we added a “virtual” edge {u, v}, and remove a subset of consecutive edges from some R({u, v}, f ) ⊆ C({u, v}), just as if we’d have executed an edge/set swap with the “virtual” edge {u, v}. We call such a swap a path/set swap (u, v, S). Some subtleties: Firstly, the current solution A may already contain an edge {u, v}, but the uv-shortestpath we find may be shorter because of other components being shrunk. So this move would add this shortest-path and remove the direct edge {u, v}—indeed, the cycle C(uv) would consist of two parallel edges, and we’d remove the actual edge {u, v}. Secondly, although the cycle contains edges from many components, only edges within T are removed. Finally, there are a polynomial number of such moves, since there are O(n2 ) choices for u, v, O(n) choices for f , and O(n2 ) consecutive removal sets S. Note that edge/set swaps never decrease the number of connected components of A , but path/set swaps may increase or decrease the number of connected components. Connecting moves. Connecting moves reduce the number of connected components by adding a set of edges that connect some of the current components. Formally, let Gall A be the (multi)graph that results from contracting all connected components of A in G, deleting loops and keeping parallel edges. A connecting move (denoted conn(T )) consists of picking a tree in Gall A , and adding the corresponding edges to A . The number of possible connecting moves can be large, but Section B.1 discusses how to do this approximately, using a k-MST procedure. Note that connecting moves cause d(A ′ ) > d(A ), but since our notion of improvement is with respect to the potential φ, such a move may still cause the potential to decrease. In addition to the above moves, the algorithm runs the following post-processing step at the end. Clean-up. Remove the unique maximal edge set S ⊆ A such that A \ S is feasible, i.e., erase all unnecessary edges. This might increase φ(A ), but it will never increase d(A ). Checking whether an improving move exists is polynomial except for connecting moves, which we can do approximately (see §B.1). Thus, the local search algorithm can be made to run in polynomial time by using standard methods (see § B). 4 In Which the Local Optimum is a Single Tree We want to bound the cost of a forest that is locally optimal with respect to the moves defined above. To start, let us consider a simpler case: suppose we were to find a single tree T that is optimal with respect to just the edge/edge and edge/set swaps. (Recall that edge/set swaps add an edge and remove a consecutive ∗ In fact, we only need five different swaps (e, S) for the following choices of consecutive sets S: The set S = {f }, the complete set S = R(e, f ), and three sets of the form S = {e1 , . . . , ei }, S = {ei+1 , . . . , ej } and S = {ej+1 , . . . , eℓ } for specific indices i and j. How to obtain the values for i and j is explained in Section 4.1. 5 subset of the edges on the resulting cycle, while maintaining feasibility. Also, recall that optimality means that no such moves cause the potential φ to decrease.) Our main result of this section is the following: Corollary 2. Let G = (V, E) be a graph, let de be the cost of edge e ∈ E and let T ⊆ V × V be a set of terminal pairs. Let A , F ⊆ E be two feasible Steiner forests for (G, d, T) with V [A ] = V [F ]. Assume that A is a tree and that A is swap-optimal with respect to F and φ under edge/edge and edge/set swaps. Denote by A ′ the modified solution where all inessential edges have been dropped from A . Then, d(A ′ ) ≤ 10.5 · d(F ) + w(F ) ≤ 11.5 · d(F ). The actual approximation guarantee is 42 for this case: indeed, Corollary 2 assumes V [A ] = V [F ], which can be achieved (by taking the metric completion on the terminals) at the cost of a factor 2. The intuition here comes from a proof for the optimality of edge/edge swaps for the Minimum Spanning tree problem. Let A be the tree produced by the algorithm, and F the reference (i.e., optimal or near-optimal) solution, with V [A ] = V [F ]. Suppose we were looking for a minimum spanning tree instead of a Steiner forest: one way to show that edge/edge swaps lead to a global optimum is to build a bipartite graph whose vertices are the edges of A and F , and which contains edge (e, f ) when f ∈ F can be swapped for e ∈ A and de ≤ df . Using the fact that all edge/edge swaps are non-improving, we can show that there exists a perfect matching between the edges in A and F , and hence the cost of A is at most that of F . Our analysis is similar in spirit. Of course, we now have to (a) consider edge/set swaps, (b) do the analysis with respect to the potential φ instead of just edge-lengths, and (c) we cannot hope to find a perfect matching because the problem is NP-hard. These issues make the proofs more complicated, but the analogies still show through. 4.1 An approximation guarantee for trees and d In this section, we conduct a thought-experiment where we imagine that we get a connected tree on the terminals which is optimal for edge/set swaps with respect to just the edge lengths, not the potential. In very broad strokes, we define an equivalence relation on the edges of A , and show a constant-to-1 cost-increasing map from the resulting equivalence classes to edges of F —again mirroring the MST analysis—and hence bounding the cost of A by a constant times the cost of F . The analysis of the real algorithm in §4.2 builds on the insights we develop here. Some Definitions. The crucial equivalence relation is defined as follows: For edges e, f ∈ A , let Te,f be the connected component of A \ {e, f } that contains the unique e-f -path in A . We say e and f are compatible w.r.t. F if e = f or if there are no F -edges leaving Te,f , and denote it by e ∼cp f . In Lemma 6 we show that ∼cp is an equivalence relation, and denote the set of equivalence classes by S. An edge is essential if dropping it makes the solution infeasible. If T1 , T2 are the connected components of A \ {e}, then e is called safe if at least one edge from F crosses between T1 and T2 . Observe that any essential edge is safe, but the converse is not true: safe edges can be essential or inessential. However, it turns out that the set Su of all unsafe edges in A forms an equivalence class of ∼cp . Hence, all other equivalence classes in S contain only safe edges. Moreover, these equivalence classes containing safe edges behave like single edges in the following sense. (Proof in Lemma 14 in §6.) (1) Each equivalence class S lies on a path in A . (2) For any edge f ∈ F , either S is completely contained in the fundamental cycle CA (f ) obtained by adding f to A , or S ∩ CA (f ) = ∅. (3) If (A \ {e}) ∪ {f } is feasible, and e belongs to equivalence class S, then (A \ S) ∪ {f } is feasible. (This last property also trivially holds for S = Su .) 6 Charging. We can now give the bipartite-graph-based charging argument sketched above. Theorem 3. Let I = (V, E, T, d) be a Steiner Forest instance and let F be a feasible solution for I. Furthermore, let A ⊆ E be a feasible tree solution for I. Assume that V [F ] = V [A ]. Let ∆ : S → R be a cost function that assigns a cost to all S ∈ S. Suppose that ∆(S) ≤ df for all pairs of S ∈ S \ {Su } and f ∈ F such that the cycle in A ∪ {f } contains S. Then, X ∆(S) ≤ S∈S\{Su } 7 X df . · 2 f ∈F Proof. Construct a bipartite graph H = (A ∪ B, E(H)) with nodes A := {aS | S ∈ S \ {Su }} and B := {bf | f ∈ F }. Add an edge {aS , bf } whenever f closes a cycle in A that contains S. By our assumption, if {aS , bf } ∈ E(H) then ∆(S) ≤ df . Suppose that we can show that 27 · |N (X)| ≥ |X| for all X ⊆ A, where N (X) ⊆ B is the set of neighbors of nodes in X. By a generalization of Hall’s Theorem (stated as Fact 15 in §6), this condition implies that there is an assignment α : E → R+ such that P P 7 e∈δH (b) α(e) ≤ 2 for all b ∈ B. Hence e∈δH (a) α(e) ≥ 1 for all a ∈ A and X ∆(S) ≤ S∈S\{Su } X X α(e)∆(S) = S∈S\{Su } e∈δH (aS ) X X α(e)∆(S) ≤ f ∈F e∈δH (bf ) X X α(e)df ≤ f ∈F e∈δH (bf ) 7 X df . 2 f ∈F It remains to show that 27 ·|N (X)| ≥ |X| for all X ⊆ A. To that aim, fix X ⊆ A and define S′ := {S | aS ∈ S X}. In a first step, contract all e ∈ U := S∈S\S′ S in A , and denote the resulting tree by A ′ := A U .† Note that edges in each equivalence class are either all contracted or none are contracted. Also note that all unsafe edges are contracted, as Su ∈ / S′ . Apply the same contraction to F to obtain F ′ := F U , from which we remove all loops and parallel edges. Let f ∈ F ′ . Since A ′ is a tree, f closes a cycle C in A ′ containing at least one edge e ∈ A ′ . Denoting the equivalence class of e by Se , observing that all edges in A ′ are safe, and using property (2) given above (formally, using Lemma 14(c)), we get that cycle C contains Se . Hence the node bf ∈ B corresponding to f belongs to N (aSe ) ⊆ N (X). Thus, |N (X)| ≥ |F ′ | and it remains to show that 72 |F ′ | ≥ |X|. We want to find a unique representative for each aS ∈ X. So we select an arbitrary root vertex r ∈ V [A ′ ] and orient all edges in A ′ away from r. Every non-root vertex now has exactly one incoming edge. Every equivalence class S ∈ S′ consists only of safe edges, so it lies on a path (by Lemma 14(a)). Consider the two well-defined endpoints which are the outermost vertices of S on this path. For at least one of them, the unique incoming edge must be an edge in S. We represent S by one of the endpoints which has this property and call this representative rS . Let R ⊆ V [A ′ ] be the set of all representative nodes. Since every vertex has an unique incoming edge, S 6= S ′ implies that rS 6= rS ′ . Hence |R| = |S′ | = |X|. Moreover, let R1 and R2 be the representatives with degrees 1 and 2 in A ′ , and L be the set of leaves of A ′ . As the number of vertices of degree at least 3 in a tree is bounded by the number of its leaves, the number of representatives of degree at least 3 in A ′ is bounded by |L|. So |X| ≤ |R1 | + |R2 | + |L|. We now show that every v ∈ R2 ∪ L is incident to an edge in F ′ . First, consider any v ∈ L and let e be the only edge in A ′ incident to v. As e is safe, there must be an edge f ∈ F ′ incident to v. Now consider any rS ∈ R2 and let e1 , e2 ∈ A ′ be the unique edges incident to rS . Because rS is the endpoint of the path corresponding to the equivalence class S, the edges e1 and e2 are not compatible. Hence there must be † Formally, we define the graph G[T ]/e = (V [T ]/e, T /e) for a tree T by V [T ]/e := V [T ] ∪ {uv} \ {u, v} and T /e := T \ δ({u, v}) ∪ {{w, uv} | {u, w} ∈ T ∨ {v, w} ∈ T } for an edge e = {u, v} ∈ E, then set G/U := G/e1 /e2 / . . . /ek for U = {e1 , . . . , ek } and let T /U be the edge set of this graph. If U ⊆ T , then the contraction causes no loops or parallel edges, otherwise, we delete all loops or parallel edges. 7 an edge f ∈ F ′ incident to rS . Because R2 and L are disjoint and every edge is incident to at most two vertices, we conclude that |F ′ | ≥ (|R2 | + |L|)/2. Finally, we show that |F ′ | ≥ 23 |R1 |. Let C be the set of connected components of F ′ in GU . Let C ′ := {T ∈ C | |V [T ] ∩ R1 | ≤ 2} and C ′′ := {T ∈ C | |V [T ] ∩ R1 | > 2}. Note that no representative rS ∈ R1 is a singleton as every leaf of A ′ is incident to an edge of F ′ . We claim that |T | ≥ |V [T ] ∩ R1 | for every T ∈ C ′ . Assume by contradiction that this was not true and let T ∈ C ′ with |T | < |V (T ) ∩ R1 |. This means that V [T ] ∩ R1 contains exactly two representatives rS , rS ′ ∈ R1 and T contains only the edge {rS , rS ′ }. Let e ∈ S and e′ ∈ S ′ be the edges of A ′ incident to rS and rS ′ , respectively. As e and e′ are not compatible, there must be an edge f ∈ F ′ with exactly one endpoint in {rS , rS ′ }, a contradiction as this edge would be part of the connected component T . We conclude that |T | ≥ |V [T ] ∩ R1 | for every T ∈ C ′ . Additionally, we have that |T | ≥ |V [T ]| − 1 ≥ 23 |V [T ]| for all T ∈ C ′′ as |V [T ]| > 2. Therefore, |F ′ | = X |T | ≥ X |V [T ] ∩ R1 | + T ∈C ′ T ∈C X 2 T ∈C ′′ 3 2 |V [T ] ∩ R1 | ≥ |R1 |. 3 The three bounds together imply |X| ≤ |R1 | + |R2 | + |L| ≤ 32 |F ′ | + 2|F ′ | = 27 |F ′ |. We obtain the following corollary of Theorem 3. Corollary 4. Let I = (V, E, T, d) be a Steiner Forest instance and let OPT be a solution for I that minimizes P d(OPT) = e∈OPT de . Let A ⊆ E be feasible tree solution for I that does not contain inessential edges. Assume V [A ] = V [OPT]. If A is edge/edge and edge/set swap-optimal with respect to OPT and d, then it P P holds that e∈A de ≤ (7/2) · e∈OPT de . P Proof. Since there are no inessential edges, Su = ∅. We set ∆(S) := e∈S de for all S ∈ S. Let f ∈ OPT be an edge that closes a cycle in A that contains S. Then, (A \ {e}) ∪ {f } is feasible for any single edge e ∈ S because it is still a tree. By Lemma 14(d), this implies that (A \ S) ∪ {f } is also feasible. Thus, we consider the swap that adds f and deletes S. It was not improving with respect to d, because A is edge/set P swap-optimal with respect to edges from OPT and d. Thus, ∆(S) = e∈S de ≤ df , and we can apply Theorem 3 to obtain the result. 4.2 An approximation guarantee for trees and φ We now consider the case where a connected tree A is output by the algorithm when considering the edge/set swaps, but now with respect to the potential φ (instead of just the total length as in the previous section). These swaps may increase the number of components, which may have large widths, and hence edge/set swaps that are improving purely from the lengths may not be improving any more. This requires a more nuanced analysis, though relying on ideas we have developed in the previous section. Here is the high-level summary of this section. Consider some equivalence class S ∈ S\{Su } of safe edges: these lie on a path (by Lemma 14(a)), hence look like this: e eℓ(S) e e 1 2 i w0 −→ v1 → · · · → w1 −→ v2 → · · · → wi−1 − → vi → . . . wℓ(S)−1 −−−→ vℓ(S) , where there are ℓ(S) edges and hence ℓ(S) + 1 components formed by deleting S. We let InS be set of the “inner” components (the ones containing v1 , . . . , vℓ(S)−1 ), and InS ′ be the inner components except the two with the highest widths. Just taking the definition of φ, and adding and subtracting the widths of these “not-the-two-largest” inner components, we get φ(A ) = w(A ) + X e∈Su de + X ℓ(S) S∈S\{Su } | X dei − i=1 X K∈InS ′ {z ≤10.5·d(F ) by Corollary 18 8  w(K) + } X X w(K) . S∈S\{Su } K∈InS ′ | {z ≤w(F ) by Lemma 22 } As indicated above, the argument has two parts. For the first summation, look at the cycle created by adding edge f ∈ F to our solution A . Suppose class S is contained in this cycle. We prove that edge/set swap Pℓ(S) P optimality implies that i=1 dei − K∈In ′ w(K) is at most 3df . (Think of this bound as being a weak S version of the facts in the previous section, which did not have a factor of 3 but did not consider weights in the analysis.) Using this bound in Theorem 3 from the previous section gives us a matching that bounds the first summation by 3 · (7/2) · d(F ). (A couple of words about the proofs: the bound above follows from showing that three different swaps must be non-improving, hence the factor of 3. Basically, we break the above path into three at the positions of the two components of highest width, since for technical reasons we do not want to disconnect these high-width components. Details are in §7.1.) For the second summation, we want to sum up the widths of all the “all-but-two-widest” inner components, over all these equivalence classes, and argue this is at most w(F ). This is where our notions of safe and compatible edges comes into play. The crucial observations are that (a) given the inner components corresponding to some class S, the edges of some class S ′ either avoid all these inner components, or lie completely within some inner component; (b) the notion of compatibility ensures that these inner components correspond to distinct components of F , so we can get more width to charge to; and (c) since we don’t charge to the two largest widths, we don’t double-charge these widths. The details are in §7.3. 5 In Which the Local Optimum may be a Forest The main theorem. In the general case, both A and F may have multiple connected components. We assume that the distance function d is a metric. The first thing that comes to mind is to apply the previous analysis to the components individually. Morally, the main obstacle in doing so is in the proof of Theorem 3: There, we assume implicitly that no edge from F goes between connected components of A .‡ This is vacuously true if A is a single tree, but may be false if A is disconnected. In the following, our underlying idea is to replace F -edges that cross between the components of A by edges that lie within the components of A , thereby re-establishing the preconditions of Theorem 3. We do this in a way that F stays feasible, and moreover, its cost increases by at most a constant factor. This allows us to prove that the local search has a constant locality gap. Reducing to local tree optima. Suppose F has no inessential edges to start. Then we convert F into a collection of cycles (shortcutting non-terminals), losing a factor of 2 in the cost. Now observe that each “offending” F -edge (i.e., one that goes between different components of A ) must be part of a path P in F that connects some s, s̄, and hence starts and ends in the same component of A . This path P may connect several terminal pairs, and for each such pair s, s̄, there is a component of A that contains s and s̄. Thus, P could be replaced by direct connections between s, s̄ within the components of A . This would get rid of these “offending” edges, since the new connections would stay within components of A . The worry is, however, that this replacement is too expensive. We show how to use connecting tree moves to bound the cost of the replacement. Consider one cycle from F , regarded as a circuit C in the graph GA where the connected components A1 , . . . , Ap of A are shrunk to single nodes, i.e., C consists of offending edges. The graph GA might contain parallel edges and C might have repeated vertices. So C is a circuit, meaning that it is a potentially non-simple cycle, or, in other words, a Eulerian multigraph. The left and middle of Figure 3 are an example. Index the Aj ’s such that w(A1 ) ≤ · · · ≤ w(Ap ) and say that node j in GA corresponds to Aj . Suppose C visits the nodes v1 , . . . , v|C| , v1 (where several of these nodes may correspond to the same component Aj ) and that component Aj is visited nj times by C. In the worst case, we may need to insert nj different ‡ More precisely, we need the slightly weaker condition that for each node t ∈ V [A ], there is an F -edge incident to t that does not leave the connected component of A containing t. 9 s, s̄ connections into component Aj of A , for all j. The key observation is that the total cost of our direct P|C| connections is at most i=1 ni w(Ai ). We show how to pay for this using the length of C.§ To do so, we use optimality with respect to all moves, in particular connecting moves. The idea is simple: We cut C into a set of trees that each define a valid connecting move. For each tree, the connecting move optimality bounds the widths of some components of A by the length of the tree. E.g., w(A1 ) + w(A4 ) is at most the length of the tree connecting A1 , A4 , A5 in Figure 3. Observe that we did not list w(A5 ): Optimality against a connecting move with tree T relates the length of T to the width of all the components that T connects, except for the component with maximum width. We say a tree pays for Aj if it hits Aj , and also hits another Aj of higher width. So we need three properties: (a) the trees should collectively pack into the edges of the Eulerian multigraph C, (b) each tree hits each component Aj at most once, and (c) the number of trees that pay for Aj is at least nj . Assume that we found such a tree packing. For circuit C, if Aj ⋆ is the component with greatest width hit by C, then using connecting move optimality for all the trees shows that X nj w(Aj ) j:Aj hit by C,j6=j ⋆ ≤ d(C). In fact, even if we have c-approximate connection-move optimality, the right-hand side just gets multiplied by c. But what about nj ⋆ w(Aj ⋆ )? We can cut C into sub-circuits, such that each subcircuit C ′ hits Aj ⋆ exactly once. To get this one extra copy of w(Aj ⋆ ), we use path/set swap optimality which tells us that the missing connection cannot be more expensive than the length of C. Thus, collecting all our bounds (see Lemma 36), adding all the extra connections to F increases the cost to at most 2(1 + c)d(F ): the factor 2 to make F Eulerian, (1 + c) to add the direct connections, using c-approximate optimality with respect to connecting moves and optimality with respect to path/set swaps. §B.2 discusses that c ≤ 2. Now each component Aj of A can be treated separately, i.e., we can use Corollary 2 on each Aj and the portion of F that falls into Aj . By combining the conclusions for all connected components, we get that Cor. 2 Lem. 36 d(A ′ ) ≤ 10.5d(F ′ ) + w(F ′ ) ≤ 11.5d(F ′ ) ≤ 23(1 + c) · d(F ) ≤ 69 · d(F ) for any feasible solution F . This proves Theorem 1. Obtaining a decomposition into connecting moves. It remains to show how to take C and construct the set of trees. If C had no repeated vertices (it is a simple cycle) then taking a spanning subtree would suffice. And even if C has some repeated vertices, decomposing it into suitable trees can be easy: E.g., if C is the “flower” graph on n vertices, with vertex 1 having two edges to each vertex 2, . . . , n. Even though 1 appears multiple times, we find a good decomposition (see Figure 4). Observe, however, that breaking C into simple cycles and than doing something on each simple cycle would not work, since it would only pay 1 multiple times and none of the others. The flower graph has a property that is a generalization of a simple cycle: We say that C is minimally guarded if (a) the largest vertex is visited only once (b) between two occurrences of the same (non-maximal) vertex, there is at least one larger number. The flower graph and the circuit at the top of Figure 5 have this property. We show that every minimally guarded circuit can be decomposed suitably by providing Algorithm 1. It iteratively finds trees that pay for all (non maximal) j with j ≤ z for increasing z. Figure 5 shows how the set of trees M5 is converted into M6 in order to pay for all occurrences of 6. Intuitively, we look where 6 falls into the trees in M5 . Up to one occurrence can be included in a tree. If there are more occurrences, the tree has to be split into multiple trees appropriately. §8.1.2 explains the details. Finally, Lemma 35 shows how to go from minimally guarded circuits to arbitrary C in a recursive fashion. § We also need to take care of the additional width of the modified solution, but this is the easier part. 10 5 A5 A5 C A7 A7 4 A1 A4 7 A1 A4 1 Figure 3: The charging argument with four components A1 , A4 , A5 and A7 of A . The area of each component corresponds to its width. On the left. A cycle in F . In the middle. The corresponding circuit (non-simple cycle) in GA . On the right. A suitable decomposition into connecting moves. 3 4 5 1 6 3 4 5 2 7 1 6 3 4 2 5 1 7 1 1 1 1 1 2 7 6 Figure 4: A flower graph. Even though the graph is a non-simple cycle, we can easily decompose it into trees that pay for each j 6= 6 at least nj times (1 is payed for 7 = n1 + 1 times). C v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 7 1 2 1 4 1 2 5 1 3 2 7 M5 7 4 M6 7 4 2 5 2 4 1 4 1 2 5 2 5 3 5 1 2 3 2 3 3 2 1 Figure 5: Two iterations of an example run of the Algorithm 1. 6 Proofs: Bounds on d when the Local Optimum is a Tree Let A , F ⊆ E be two feasible Steiner forests with respect to a set T of terminal pairs. We think of F as an optimum or near optimum Steiner forest and of A as a feasible solution computed by our algorithm. We assume that V [A ] = V [F ] (this will be true when we use the results from this section later on). Throughout this section, we assume that A is a tree (thus, it is a spanning tree on V [A ] = V [F ]). The following definition is crucial for our analysis. Definition 5. Let e = {s, v1 }, f = {vl , t} ∈ A be two edges. Consider the unique (undirected) path e f P = s − → v1 → · · · → vl − → t in A that connects e and f . Let Te,f be the connected component in 11 Te,f Tf,g f e v1 v2 vi g vi+1 vs−1 Tf Te,f Tf,g f w1 v1 g v2 v1 vs−1 vs (b) Second case: The path connecting f to the path P from e to g touches an outer node of P . There can be no F -edge between Tf,g and Tf ∪ Te,f because e and f are compatible. Likewise, no F -edge can cross from Tf,g to Tg because f and g are compatible. This shows that no F -edge is cut by Tf,g and thus, e and g are compatible. g vs v2 v w2 f w1 Tg e w2 vs−1 e (a) First case: Edge f lies on the path from e to g. If an F -edge is cut by Tf,g , the edges f and g cannot be compatible. Likewise, e and f cannot be compatible if an F -edge is cut by Te,f . Thus, no F -edge is cut by Te,f ∪ Tf,g and e and g are compatible. Tg Te,f,g Te vs Tf (c) Third case: The path connecting f to the path P from e to g touches an inner node v of P . Here, no F -edge can cross from Te,f,g to Te nor from Tf to Tg since e and f are compatible. The edges f and g being compatible, there also cannot be F -edges from Te,f,g to Tg nor from Te to Tf . Thus, no F -edge is cut by Te,f,g ∪ Tf and thus, the edges e and g are compatible. Figure 6: The situation in Lemma 6. A \ {e, f } that contains P \ {e, f }. We say that e and f are compatible with respect to F if e = f or if there are no F -edges leaving Te,f . In this case, we write e ∼cp f . Observe that ∼cp is a reflexive and symmetric relation. We show that the relation is also transitive, i.e., it is an equivalence relation. Lemma and Definition 6. Let A be feasible and let e, f ∈ A and f, g ∈ A be two pairs of compatible edges. Then, e and g are also compatible. In particular, ∼cp is an equivalence relation. We denote the set of all equivalence classes of ∼cp by S. e Proof. Consider the unique path P that connects e and g in A . This path has the form v1 − → v2 → · · · → g vs−1 − → vs . We distinguish three cases (see Figure 6). For the first case, suppose that f = {vi , vi+1 } lies on P , for some i ∈ {2, . . . , s − 2}. Let Te,f and Tf,g be the connected components of A \ {e, f, g} that contain v2 , . . . , vi and vi+1 , . . . , vs−1 , respectively. Assume by contradiction that δF (Te,g ) 6= ∅. Since δF (Te,g ) 6= ∅, it follows that δF (Te,f ) 6= ∅ or δF (Tf,g ) 6= ∅. This is a contradiction to the assumption that e, f and f, g are compatible, respectively. For the second case, suppose that f does not lie on P . Let R be the unique, possibly empty, path that connects f to P and suppose that R meets P at one of the outer nodes (w.l.o.g. assume that P and R meet f e in v1 ). Thus, we are in the situation where R ∪ P has the form w1 − → w2 → · · · → wt → v1 − → v2 · · · → g vs−1 − → vs . Consider the four connected components that A \ {e, f, g} decomposes into: The component Tf contains w1 , the component Tf,e contains w2 , . . . , wt , v1 , the component Te,g contains v2 , . . . , vs−1 and Tg contains vs . If R is empty, the nodes w2 , wt and v1 coincide and Tf,e contains only v1 . Both the cuts δF (Te,g : Tg ) and δF (Te,g : Tf ) must be empty because f and g are compatible. The cut δF (Te,g : Tf,e ) must be empty because e and f are compatible. It follows that e and g are compatible. For the last remaining case, suppose that f does not lie on P and that the unique path R connecting f to 12 T3 T0 T2 e3 e2 v3 v2 v0 e1 v1 T1 Figure 7: The situation from the proof of Lemma 12. Since e1 , e2 , and e3 are pairwise compatible, no F -edge can leave T1 . f → w2 → · · · → wt → vi R meets P in an inner node vi , i ∈ {2, . . . , s − 1}. Here, R has the form w1 − and A \ {e, f, g} decomposes into four components: The component Te contains v1 , the component Te,f,g contains v2 , . . . , vs−1 and w2 , . . . , wt , the component Tg contains vs and the component Tf contains w1 . The cuts δF (Tf : Tg ) and δF (Te,f,g : Te ) must be empty because e and f are compatible. The cuts δF (Tf : Te ) and δF (Te,f,g : Tg ) must be empty because f and g are compatible. Thus, the edges e and g are compatible. This concludes the proof. We classify the edges in A with respect to F and T. Recall that we assume V [A ] = V [F ], and that A is a tree, thus, it is a spanning tree on the vertices that we are interested in. Definition 7. An edge e ∈ A is essential if A is feasible with respect to T, but A \ {e} is infeasible with respect to T. Definition 8. Let e ∈ A and let T1 , T2 be the connected components of A \ {e}. We say that e is safe if δF (T1 ) = δF (T2 ) 6= ∅, i.e., if at least one F -edge crosses between T1 and T2 . By definition, any essential edge is safe, however, the opposite is not true in general: Safe edges can be essential or inessential. We thus have classified the edges of A into three classes: safe essential edges, safe inessential edges and unsafe (and ergo, inessential) edges. Lemma 9. Let e, f ∈ A be two compatible edges. Then e is safe if and only if f is safe. f e Proof. Suppose that e is safe and let P = v1 − → v2 → · · · → vs−1 − → vs be the unique path between e and f in A . Let Te , Te,f and Tf be the connected components of A that contain the vertex v1 , the vertices v2 , . . . , vs−1 and the vertex vs , respectively. Since e and f are compatible we know that δF (Tf : Te,f ) is empty. Also, since e is safe, we have that δF (Te : Tf ) = δF (Tf : Te ) is non-empty. It follows from δF (Tf ) = δF (Tf : Te ) ∪ δF (Tf : Te,f ) that f is safe. The reverse implication follows since e and f are exchangeable. Lemma 10. Let e, f ∈ A be two unsafe edges. Then e and f are compatible. e f Proof. Let P = v1 − → v2 → · · · → vs−1 − → vs be the unique path between e and f in A . Let Te , Te,f and Tf be the connected components of A that contain the vertex v1 , the vertices v2 , . . . , vs−1 and the vertex vs , respectively. We need to show that δF (Te : Te,f ) = δF (Tf : Te,f ) = ∅. Observe that δF (Te : Te,f ) ⊆ δF (Te ) and that δF (Tf : Te,f ) ⊆ δF (Tf ). The assumption that e and f are both unsafe implies that δF (Te ) = δF (Tf ) = ∅ and we have thus shown the claim. We have the following summary lemma showing that ∼cp behaves well. 13 Lemma 11. Let e, f ∈ A be compatible edges. Then 1. e is essential if and only if f is essential and 2. e is safe if and only f is safe. Furthermore, if two edges e, f ∈ A are unsafe, then they are compatible. Thus, the set Su := {e ∈ A | e is unsafe} forms an equivalence class of ∼cp . If S ∈ S is an equivalence class of ∼cp , then either all edges e ∈ S are essential or none. Also, if S 6= Su , then all edges in S are safe. Proof. We show Statement 1. e Statement 2 and the compatibility of unsafe edges are shown in Lemma 9 and Lemma 10. Let P = v1 − → f v2 → · · · → vs−1 − → vs be the unique path between e and f in A . Let Te , Te,f and Tf be the connected components of A that contain the vertex v1 , the vertices v2 , . . . , vs−1 and the vertex vs , respectively. Suppose that e is essential. We show that there must be a terminal pair u, ū with u ∈ Te ∪ Te,f and ū ∈ Tf . It then follows that A \ {f } is infeasible. Since the edge e is essential, there must be a terminal pair u, ū with u ∈ Te and ū ∈ Te,f ∪ Tf . Since e and f are compatible, however, we know that δF (Te : Te,f ) = δF (Tf : Te,f ) = ∅ which implies that δF (Te,f ) = ∅. Thus, if ū ∈ Te,f , the forest F would be infeasible. It follows that ū ∈ Tf and thus, that f is essential. We can now show that the compatibility classes in S \ Su behave as if they were single edges. Lemma 12. Let K := {e1 , . . . , el } ⊆ A with l ≥ 2 be a set of pairwise compatible edges. Furthermore, suppose that ei ∈ K is safe for all i = 1, . . . , l. Then there is a path P ⊆ A with K ⊆ P . Proof. For e, f ∈ K let Pe,f be the unique path in A starting with e and ending with f . Define R := S e,f ∈K Pe,f . Observe that K ⊆ R ⊆ A and that R is a tree whose leaves are all incident to edges in K. By contradiction assume R is not a path. Then there exists a vertex v0 with |δR (v0 )| ≥ 3. In particular, there are three leaves v1 , v2 , v3 of R such that the unique v0 -vi -paths in R for i ∈ {1, 2, 3} are pairwise edge-disjoint. Let e1 , e2 , e3 ∈ K be the edges incident to v1 , v2 , v3 in R, respectively. Let T0 , T1 , T2 , T3 be the four components of A \ {e1 , e2 , e3 } with vi ∈ Ti for i ∈ {0, 1, 2, 3}, see Figure 7. Observe that δF (T1 : T0 ∪ T3 ) = δF (T1 : T0 ∪ T2 ) = ∅ because e1 ∼cp e2 and e1 ∼cp e3 . We deduce that δF (T1 ) = ∅, contradicting the fact that e1 is safe. Lemma 13. Let S ∈ S be an equivalence class of ∼cp and let e ∈ S. Let f ∈ F such that A \ {e} ∪ {f } is feasible. Then, A \ S ′ ∪ {f } is feasible for all S ′ ⊆ S. Proof. If e is inessential, then all edges in S are inessential by Lemma 11. Thus, A \ S is feasible even without f and we are done. Otherwise, e is essential, which implies that all edges in S are essential by Lemma 11. So, they are also safe and we can apply 14(b) from Lemma 14. Let T0 , . . . , Tl be the connected components of A \ S in the order they are traversed by the path P containing S. Statement 14(b) implies that δF (Ti ) = ∅ for all i ∈ {1, . . . , l − 1}. Therefore, for every terminal pair {u, ū} ∈ T there either is an i ∈ {0, . . . , l} with u, ū ∈ Ti , or u ∈ T0 and ū ∈ Tl (w.l.o.g.). Hence the only terminal pairs that are disconnected by the removal of S are those with u ∈ T0 and ū ∈ Tl . Statement 14(b) also implies that either f ∈ δF (T0 : Tl ) or both endpoints of f are contained in one of the Ti . In the former case, A \ S ∪ {f } is feasible since T0 ∪Tl is a connected component of this solution. In the latter case, the connected components of A \ {e} ∪ {f } and A \ {e} are the same, which would imply that A \ {e} is feasible by our assumption, which is a contradiction to e being essential. 14 Lemma 14. Let S ∈ S\{Su } be an equivalence class of safe edges. Let f ∈ F be an edge. a. Let K ⊆ S. Then there is a path P ⊆ A with K ⊆ P . b. Let P ⊆ A be the unique minimal path containing S and let T0 , . . . , Tl be the components of A \ S in the order they are traversed by P . Then either f ∈ δF (T0 : Tl ), or there is an i ∈ {0, . . . , l} such that Ti contains both endpoints of f . c. Let C be the unique cycle in A ∪ {f }. Then S ⊆ C or S ∩ C = ∅. d. If A \ {e} ∪ {f } is feasible for some edge e ∈ S, then A \ S ′ ∪ {f } is feasible for all S ′ ⊆ S. This also holds for S = Su . Proof. The proof of 14(a) is done in Lemma 12. For 14(b), denote the edges in S by e1 , . . . , el such that ei is the edge between Ti−1 and Ti for all i ∈ {1, . . . , l}. Since for any i 6= j ∈ {1, . . . , l}, the edges ei and ej are pairwise compatible, no F -edge can cross between Ti and Tj , for any i 6= j ∈ {1, . . . , l}. Nor can there be F -edges from T0 to any Ti , for i ∈ {1, . . . , l}, since e1 and ei+1 are compatible. Therefore either both endpoints of f lie within the same component Ti , or f ∈ δF (T0 : Tl ). Property 14(c) follows from 14(b) for S ∈ S\{Su }. Notice that for any f ∈ F , all edges on C are automatically safe. Thus, the statement is true for Su as well. Statement 14(d) is proven in Lemma 13. The following fact is a straightforward generalization of Hall’s theorem and an easy consequence of max flow/min cut (see, e.g., [CIM09]). Fact 15. Let G = (A ∪ B, E) be a bipartite graph. For any A′ ⊆ A, let N (A′ ) ⊆ B be the set of neighbors of the nodes in A′ . If for all A′ ⊆ A : |N (A′ )| ≥ |A′ |/c then there exists an assignment α : E → R+ such that for all b ∈ B. P e∈δ(a) α(e) ≥ 1 for all a ∈ A and P e∈δ(b) α(e) ≤ c 7 Proofs: Bounds on φ when the Local Optimum is a Tree Let’s recall (and formalize) some notation from §4.2. Let equivalence class S ∈ S\{Su } of safe edges contain ℓ(S) edges. By Lemma 14(a), the edges of S = heS,1 , . . . , eS,ℓ(S) i lie on a path: let eS,1 eS,2 eS,i eS,ℓ(S) wS,0 −−→ vS,1 → · · · → wS,1 −−→ vS,2 → · · · → wS,i−1 −−→ vS,i → . . . wS,ℓ(S)−1 −−−−→ vS,ℓ(S) be this path, where each eS,i = {wS,i−1 , vS,i }. When the context is clear (as it is in this subsection), we use e1 , . . . , eℓ(S) and v1 , . . . , vℓ(S) , w0 , . . . , wℓ(S)−1 instead. Notice that wS,i = vS,i is possible, but we always have wS,i−1 6= vS,i . Removing S decomposes A into ℓ(S) + 1 connected components. Let the connected component containing wi be (VS,i , ES,i ) and the connected component that contains vℓ(S) be (VS,ℓ(S) , ES,i ). As in the rest of the paper, we will associate each components by its edge set. We think of ES,0 , ES,ℓ(S) as the outside of the path that S lies on, and ES,1 , . . . , ES,ℓ(S)−1 as the inner components. Note that these components form vertex-disjoint subtrees of A . Observation 16. Let S ∈ S\{Su } and i, i′ ∈ {0, . . . , ℓ(S)}, i 6= i′ . Then ES,i ∩ ES,i′ = ∅. Also, A is the disjoint union of ES,0 , . . . , ES,ℓ(S) and S. 15 Next, we set m(S) and n(S) to be the index of the inner components with the largest and second-largest widths, respectively. (We use the indexing index from §2 to break ties, so m(S) := arg maxi=1,...,ℓ(S)−1 index(ES,i ), and n(S) := arg maxi∈{1,...,ℓ(S)−1}\{m(S)} index(ES,i ).) Without loss of generality, we assume that the orientation of the path is such that m(S) < n(S). Let InS := {1, 2, . . . , ℓ(S) − 1} be the indices of the inner components, and InS ′ := InS \ {m(S), n(S)}. Now we split the cost of the solution A into three terms. It holds that φ(A ) = w(A ) + P e∈A = w(A ) + df = w(A ) + P e∈Su de ! P e∈Su P + S∈S\{Su } P + P de + P S∈S\{Su } e∈S  ℓ(S) P P i=1 P S∈S\{Su } i∈InS dei − de i∈InS ! ! w(ES,i ) w(ES,i ) . 7.1 Bounding the Middle Term The next lemma and the corollary bound the cost of the middle term. Lemma 17. Let I = (V, E, T, d) be a Steiner Forest instance and let F be a feasible solution for I. Furthermore, let A ⊆ E be a feasible tree solution for I that is edge/set swap-optimal with respect to F and φ. Set S ∈ S\{Su } be an equivalence class of safe edges. Let f ∈ F be an edge that closes a cycle in A that contains S. Then ! ℓ(S) X 1 X wi . de − df ≥ 3 i=1 i i∈In S Proof. Since f closes a cycle in A that contains S, any edge e in S satisfies that A \{e}∪{f } is feasible. By Lemma 14(d), this implies that A \S ∪{f } is feasible as well. Thus, adding f and removing any subset S ′ ⊆ S is a feasible edge/set swap. We consider three subsets S1′ := {e1 , . . . , em(S) }, S2′ := {em(S)+1 , . . . , en(S) } and S3′ := {en(S)+1 , . . . , eℓ(S) }. Since A is edge/set swap-optimal with respect to F and φ, we know that adding f and removing S1′ , S2′ or S3′ is not an improving swap. When adding f , we pay df . When removing Pm(S) S1′ , we gain i=1 dei , but we have to pay the width of the connected components that we create. Notice that we detach the connected components ES,1 , . . . ES,m(S)−1 from the tree. Since ES,m(S) has the maximum width on the path, the increase in φ that originates from widths has to be that the swap is not improving yields that m(S)−1 df + X m(S) w(ES,i ) ≥ i=1 X m(S) dei ⇔ df ≥ i=1 X Pm(S)−1 i=1 w(ES,i ). Thus, the fact m(S)−1 dei − i=1 X w(ES,i ) i=1 Similarly, we gain that n(S) df ≥ X i=m(S)+1 ℓ(S) n(S)−1 dei − X w(ES,i ) and i=m(S)+1 df ≥ X i=n(S)+1 ℓ(S)−1 dei − X w(ES,i ) i=n(S) from the fact that (f, S2′ ) and (f, S3′ ) are not improving. The statement of the lemma follows by adding the inequalities and dividing the resulting inequality by three. Corollary 18. Let I = (V, E, T, d) be a Steiner Forest instance and let F be a feasible solution for I. Furthermore, let A ⊆ E be a feasible tree solution for I that is edge/edge and edge/set swap-optimal with 16 respect to F and φ. Then, X S∈S\{Su } Proof. We set ∆(S) := Theorem 3. 1 3 P ℓ(S) i=1  ℓ(S) X dei − P  w(ES,i ) ≤ 10.5 · i∈InS i=1 dei − X i∈InS X de . e∈F  w(ES,i ) . The corollary then follows by Lemma 17 and 7.2 Bounding the First Term The following lemma bounds the first term of the cost. Lemma 19. Let I = (V, E, T, d) be a Steiner Forest instance and let F be a feasible solution for I with cc(F ) connected components F1 , . . . , Fcc(F ) . Furthermore, let A ⊆ E be a feasible tree solution for I and recall that Su is the equivalence class of unsafe edges in A . Assume that A is removing swap-optimal. It holds that w(A ) + X cc(F ) de ≤ X w(Fi ). i=1 e∈Su Proof. A \Su contains |Su | + 1 connected components E1 , . . . , E|Su |+1 , number them by decreasing width, i.e., w(E1 ) ≥ w(E2 ) ≥ . . . ≥ w(E|Su |+1 ). Since F does not connect them by definition of Su , its number of connected components satisfies cc(F ) ≥ |Su | + 1. Furthermore, any component Ei contains a component Fj with w(Fj ) = w(Ei ). Assume that the components are numbered such that w(Fi ) = w(Ei ) for i = 1, . . . , |Su | + 1. Consider the removing swap that removes all edges in Su . Before the swap, A paid all edges and w(A ). P|Su |+1 P|Su |+1 After the swap, A would pay all edges except those in Su plus i=1 w(Ei ) = i=1 w(Fi ). Since the swap was not improving, we know that w(A ) + X |Su |+1 de ≤ e∈A Thus, w(A ) + P e∈Su de ≤ P|Su |+1 i=1 w(Fi ) ≤ X w(Fi ) + i=1 X de − e∈A Pcc(F ) i=1 X de . e∈Su w(Fi ). 7.3 Bounding the Third Term: Sum of Widths For the third term, we need a bit more work. The main step is to show that index(ES,i ) is an injective function of S, i when restricting to i ∈ InS . The following lemma helps to prove this statement. Lemma 20. Let S, S ′ ∈ S\{Su } with S 6= S ′ . Exactly one of the following two cases holds: • S ′ ⊆ ES,0 ∪ ES,ℓ(S) , i.e., S ′ lies in the outside of the path of S • There exists i ∈ {1, . . . , ℓ(S) − 1} with S ′ ⊆ ES,i . Proof. Notice that S ∩ S ′ = ∅ by definition because S and S ′ are different equivalence classes. Let e′ , f ′ ∈ S ′ , i.e., e′ , f ′ ∈ / S. Assume that e′ ∈ ES,i for an i ∈ {1, . . . , ℓ(S) − 1}, but f ′ ∈ / ES,i . Following the notation on page 15, we denote the unique edges in S that touch ES,i by eS,i and eS,i+1 and their adjacent vertices in ES,i by vi and wi . Removing eS,i and eS,i+1 creates three connected components in A . The first component contains ES,0 , . . . , ES,i−1 and the edges eS,1 , . . . , eS,i−1 and we name it ES,< . The second 17 1 ES,< f′ 1 ES,i ei 2 ES,i e 1 ES,> ei+1 ′ vi wi f′ (a) First case: Removing e′ disconnects vi and wi . Thus, ei , e′ and ei+1 lie on a path. No F -edge can leave 1 2 1 2 ES,i = ES,i ∪ ES,i . Also, no F -edge can go between ES,i and ES,i since e′ and f ′ are compatible. Thus, e′ is compatible to ei and ei+1 . 1 ES,i ES,< f′ ES,> ei+1 ei f′ v3 v2 e′ v1 2 ES,i (b) Second case: The nodes vi and wi lie in the same connected component when removing e′ . Again, no F -edge can 1 2 leave ES,i . Also, no edge can go between ES,i and ES,i because e′ and f ′ are compatible. Thus, e′ is compatible to ei and ei+1 . Figure 8: Two cases that occur in Lemma 20. component is ES,i . The third component contains ES,i+1 , . . . , ES,ℓ(S) and the edges eS,i+1 , . . . , eS,ℓ(S) and we name it ES,> . Since f ′ ∈ / ES,i , and f ′ ∈ / S, we know that f ′ ∈ ES,< ∪ ES,> . Notice that e′ and f ′ are compatible, eS,i and eS,i+1 are compatible, but e′ is not compatible to either eS,i or eS,i+1 . If we remove e′ in addition to eS,i and eS,i+1 , then ES,i decomposes into two connected 1 and E 2 . We assume without loss of generality that v 1 components, ES,i S,i ∈ ES,i . The vertex wS,i can S,i ′ 2 1 . The two cases either be separated from vS,i when removing e , i.e., wS,i ∈ ES,i , or not, i.e., wS,i ∈ ES,i are depicted in Figure 8. 2 , then the edges e , e′ and e 1 2 If wS,i ∈ ES,i S,i S,i+1 lie on a path. No F -edge can leave ES,i = ES,i ∪ ES,i 1 has to end in E 2 . On the other because eS,i and eS,i+1 are compatible. Thus, any F -edge leaving ES,i S,i 1 hand, consider removing e′ and f ′ from A , which creates three components Te′ , Te′ ,f ′ , Tf ′ . As both ES,i 2 ′ and ES,i are incident to e , they are contained in two different components, Te′ and Te′ ,f ′ . Since no edge can 1 and E 2 . Thus, no F -edges leave Te′ ,f ′ because e′ and f ′ are compatible, no edge can cross between ES,i S,i 1 or E 2 , which means that e′ is compatible to e leave ES,i S,i and eS,i+1 . S,i 1 , the argument is similar. Still, no F -edge can leave E 1 2 If wS,i ∈ ES,i S,i = ES,i ∪ ES,i because eS,i and 2 1 eS,i+1 are compatible. Also, ES,i ⊆ Te′ ,f ′ and ES,i ⊆ Te′ still are in different connected components when e′ and f ′ are removed. Thus, no F -edge can connect them, and thus e′ is compatible to eS,i and eS,i+1 . Both cases end in a contradiction since e′ cannot be compatible to any edge in S because S and S ′ are different equivalence classes. Thus, e′ ∈ ES,i implies that S ⊆ ES,i . Only if no edge in S ′ lies in any ES,i for i ∈ {1, . . . , ℓ(S) − 1}, then it is possible that edges of S ′ lie in ES,0 or ES,ℓ(S) . However, then S ′ ⊆ (ES,0 ∪ ES,ℓ(S) ). We set µ(S, i) = index(ES,i ) for all S ∈ S \ {Su } and i ∈ InS . Lemma 21. Let S, S ′ ∈ S\{Su }, i ∈ InS , i′ ∈ InS ′ . Then µ(S, i) = µ(S ′ , i′ ) ⇒ S = S ′ and i = i′ , i.e., the mapping µ is injective. 18 Proof. Let µ(S, i) = µ(S ′ , i′ ) and denote by u∗ := uµ(S,i) = uindex(ES,i ) and ū∗ := ūµ(S,i) = ūindex(ES,i ) the corresponding terminal pair. By the definition of index, it follows that u∗ , ū∗ ∈ VS,i ∩ VS ′ ,i′ and in particular, we know that VS,i ∩ VS ′ ,i′ 6= ∅. If S = S ′ , then either i = i′ (and we are done) or i 6= i′ implies that VS,i ∩ VS ′ ,i′ = ∅ which is a contradiction. Thus, assume in the following that S 6= S ′ . Let P be the unique u∗ -vS,i -path in ES,i . If P ∩ S ′ = ∅, then P ⊆ ES ′ ,i′ because u∗ ∈ VS ′ ,i′ . Thus, vS,i ∈ VS ′ ,i′ , which also implies that eS,i ∈ ES ′ ,i′ . By Lemma 20, we get S ⊆ ES ′ ,i′ . On the other hand, if P ∩ S ′ 6= ∅, then S ′ ⊆ ES,i by Lemma 20. Thus S ⊆ ES ′ ,i′ or S ′ ⊆ ES,i . W.l.o.g., we assume the latter. Now let j ∈ {m(S ′ ), n(S ′ )} be such that ES ′ ,j ∩ S = ∅ (note that j exists due to Lemma 20). Because eS ′ ,j , eS ′ ,j+1 ∈ S ′ ⊆ ES,i and ES ′ ,j ∩ S = ∅, we deduce that ES ′ ,j ⊆ ES,i . This implies that µ(S, i) ≥ index(ES ′ ,j ) > µ(S ′ , i′ ), again a contradiction. We can now bound the third term of our objective function (see page 16). Lemma 22. As previously, let S denote the set of all equivalence classes of the compatibility relation ∼cp , let A be a feasible tree and denote by ES,i the i-th inner connected component on the path that contains S ∈ S \ {Su }. Let F be a feasible Steiner Forest with cc(F ) connected components F1 , . . . , Fcc(F ) . Then, X X cc(F ) w(ES,i ) ≤ X w(Fi ) i=1 S∈S\{Su } i∈InS Proof. As previously, we set µ(S, i) = index(ES,i ) for all S ∈ S \ {Su } and i ∈ InS . We also recall that by definition, w(ES,i ) = dG (uindex(S,i) , ūindex(S,i) ) = dG (uµ(S,i) , ūµ(S,i) ) for all S ∈ S \ {Su } and all i ∈ InS . We thus have X X w(ES,i ) = X X (1) dG (uµ(S,i) , ūµ(S,i) ). S∈S\{Su } i∈InS S∈S\{Su } i∈InS Let χ(S, i) denote the index of the connected component Fχ(S,i) containing the terminal pair uindex(S,i) , ūindex(S,i) in F . We claim that χ is injective. To see this, consider S, S ′ ∈ S and i ∈ InS , i′ ∈ InS ′ with χ(S, i) = χ(S ′ , i′ ). Since δF (VS,i ) = δF (VS ′ ,i′ ) = ∅ and Fχ(S,i) is connected, we deduce that V [Fχ(S,i) ] ⊆ VS,i ∩ VS ′ ,i′ . This implies that uµ(S,i) , ūµ(S,i) ∈ VS ′ ,i′ and that uµ(S ′ ,i′ ) , ūµ(S ′ ,i′ ) ∈ VS,i . Hence µ(S, i) = µ(S ′ , i′ ), which implies S = S ′ and i = i′ by Lemma 21. Since dG (uµ(S,i , ūµ(S,i) ) ≤ w(Fχ(S,i) ), we can now continue (1) to see that X X X dG (uµ(S,i) , ūµ(S,i) ) ≤ X cc(F ) w(Fχ(S,i) ) X w(Fi ). i=1 S∈S\{Su } i∈InS S∈S\{Su } i∈InS ≤ Here, the last inequality follows from our argument that χ is injective. 7.3.1 Wrapping Things Up We can now prove the main result of this section. Theorem 23. Let G = (V, E) be a graph, let de be the cost of edge e ∈ E and let T ⊆ V × V be a terminal set. Let A , F ⊆ E be two feasible solutions for (G, d, T) with V [A ] = V [F ]. Furthermore, suppose that A is a tree and that A is edge/set swap optimal with respect to F and φ. Then, φ(A ) = X de + w(A ) ≤ 10.5 · d(F ) + w(F ) + e∈Su e∈A In particular, d(A ) ≤ 10.5 · d(F ) + w(F ) + X P e∈Su 19 de . de + w(A ). Proof. Rewrite φ(A ) as on page 16 to φ(A ) = w(A ) + X de + e∈Su This proves the theorem. ℓ(S) X S∈S\{Su } | X dei − X i∈InS i=1 {z  w(ES,i ) + ≤10.5·d(F ) by Corollary 18 } X X w(ES,i ) . S∈S\{Su } i∈InS | {z ≤w(F ) by Lemma 22 } Additionally applying Lemma 19 yields the following reformulation of Theorem 23. Corollary 24. Let G = (V, E) be a graph, let de be the cost of edge e ∈ E and let T ⊆ V × V be a terminal set. Let A , F ⊆ E be two feasible solutions for (G, d, T) with V [A ] = V [F ]. Furthermore, suppose that A is a tree and that A is optimal with respect to F and φ under edge/edge, edge/set and removing swaps. Then, φ(A ) ≤ 10.5 · d(F ) + w(F ) + X de + w(A ) ≤ 10.5 · d(F ) + 2w(F ) ≤ 10.5 · φ(F ) e∈Su If we want to bound the original objective function of the Steiner Forest problem, we do not need removing swaps. Corollary 2. Let G = (V, E) be a graph, let de be the cost of edge e ∈ E and let T ⊆ V × V be a set of terminal pairs. Let A , F ⊆ E be two feasible Steiner forests for (G, d, T) with V [A ] = V [F ]. Assume that A is a tree and that A is swap-optimal with respect to F and φ under edge/edge and edge/set swaps. Denote by A ′ the modified solution where all inessential edges have been dropped from A . Then, d(A ′ ) ≤ 10.5 · d(F ) + w(F ) ≤ 11.5 · d(F ). Proof. Let Sis be the set of safe but inessential edges. We have d(A ) ≤ 10.5 · d(F ) + w(F ) + by Theorem 23. That implies X e∈A ′ de = d(A ) − X e∈Su de − X de ≤ 10.5 · d(F ) + w(F ) − e∈Sis X P e∈Su de de . e∈Sis 8 Proofs: Bounds when the Local Optimum is a Forest The aim of this section is to transform (a.k.a. “project”) a pair (A , F ) of arbitrary solutions into a pair (A , F ′ ) of solutions to which the results from the previous section apply. I.e., each connected component of F ′ is contained within a connected component of A . The main lemma is Lemma 36. Let G = (V, E) be a complete graph, let d : E → R≥0 be a metric that assigns a cost de to every edge e ∈ E and let T ⊆ V × V be a set of terminal pairs. Let A , F ⊆ E be two feasible Steiner Forest solutions for (G, T). Furthermore, suppose that A is edge/edge, edge/set and path/set swap-optimal with respect to E and φ, that A is c-approximate connecting move optimal and that A only uses edges between terminals. Then there exists a feasible solution F ′ with d(F ′ ) ≤ 2(1 + c) · d(F ) that satisfies F ′ = F ′  such that A is edge/edge and edge/set swap-optimal with respect to F ′ . We use the notation F to denote the set of edges in F that go within components of A and F↔ to denote the set of all edges between different components, and c is the approximation guarantee of the approximate connecting moves. Formally, c-approximate tree move optimality is defined as follows: 20 Definition 25. A c-approximate connecting move for some constant c ≥ 1 is a connecting move conn(T ) applied to the current solution A using a tree T in Gall A such that c · d(T ) ≤ w̄(A ) − w̄(A ∪ T ). A solution is c-approximate connecting move optimal, if there are no c-approximate connecting moves. Lemma 36 shows that for any solution F , we can find a solution F ′ with d(F ′ ) ≤ 2(1 + c) · d(F ) which does not contain edges between different components of A , i.e., F′ = F ′ . With Section B.2, we know that c is at most 2, i.e., we can find F ′ with d(F ′ ) ≤ 6 · d(F ). Every connected component Aj of A can now be treated separately by using Corollary 2 on Aj and the part of F ′ that falls into Aj . By combining the conclusions for all connected components, we get that d(A ′ ) ≤ 11.5 · d(F ′ ) ≤ 23(1 + c) · d(F ) ≤ 69 · d(F ) for any feasible solution F . This proves the main theorem. Theorem 1. There is a (non-oblivious) local search algorithm for Steiner Forest with a constant locality gap. It can be implemented to run in polynomial time. Proof outline The forest case depends on path/set swaps and connecting moves. Exploiting connecting move-optimality is the main effort of the section, while path/set swap-optimality is only used to handle one specific situation. The goal is to replace F↔ by edges that go within components of A . We first convert F into a collection of disjoint cycles at the expense of a factor of 2 in the edge costs. Let Fi be one of the cycles. We want to replace (Fi )↔ . To do so, we look at Fi in GA – the graph where the edges in F are contracted and loops are removed. In this graph GA , the set (Fi )↔ is a circuit (i.e., a possibly non-simple cycle). In a first step, we use Algorithm 1 to cope with the case that (Fi )↔ has a special structure that we call minimally guarded. The second step inductively ensures that this structure is present. An example run of Algorithm 1 is visualized in Figure 12. The algorithm partitions (Fi )↔ into trees in GA . These trees define connecting moves, so (approximate) connecting move-optimality gives us a lower bound on the total edge weight of each tree. Let nj be the number of times that Fi passes through Aj , the j-th connected component of A . Then the lower bound that we get is  d((Fi )↔ ) ≥  p X j=1  nj w(Aj ) − njm w(Ajm ). Here, jm is the component with the largest width among all components that Fi touches. In a minimally guarded circuit, this component is only visited once. The lower bound (for minimally guarded circuits) results from Lemma 29 and Corollary 34 (notice that nj is defined differently in the actual proof, but we need less detail here). The part between the two statements establishes invariants of Algorithm 1 that we need to show that it computes trees with the correct properties. The lower bound means that we can do the following. Assume that we delete (Fi )↔ . Now some vertices in A do no longer have adjacent F -edges which is a problem for applying Corollary 2. We fix this by inserting a direct connection to their terminal partner, which has to be in the same component of A . In order to keep the modified solution feasible, we insert the new connections a bit differently, but with the same result. This 21 connection is paid for by (Fi )↔ which – due to our construction – can give each of these vertices a budget equivalent to the width of its component. This enables us to use the results from the tree case. This argument does not work for the vertices in the largest-width component. If Fi is minimally guarded, it visits the largest width component exactly once and there are exactly two problematic vertices. To reconnect these vertices, we use path/set swap-optimality and charge (Fi )↔ again to pay for directly connecting them (this argument comes later, in the proof of Lemma 35, when Corollary 34 is applied). If otherwise Fi is not minimally guarded, we need a second step. This is taken care of in Lemma 35 which extends Corollary 34 to guarded circuits that are not necessarily minimal. This is done by applying Corollary 34 to subcircuits and removing these until the minimality criterion is met. The proof is by induction. Lemma 35 outputs a broken solution F ′ which is not feasible, but is equipped with the widths from the lower bound. Figures 13 up to 21 show the recursive process for an example circuit and visualize the broken solution that comes out of it. The solution is then repaired in Lemma 36, giving the final reduction result. 8.1 Details: Getting a Good Tree Packing While the previous sections operated on arbitrary graphs, we now consider the metric case of the Steiner forest problem. Consequently, we assume that G = (V, E) is the complete graph on V and that the cost de = dvw of each edge e = {v, w} ∈ E is given by a metric d : V × V → R≥0 . Together with a set of terminal pairs T ⊆ V , the graph G and the metric d define an instance of the metric Steiner Forest problem. The more important change in our setting is, however, that we no longer assume that our feasible solution A ⊆ E is a tree; rather, A can be an arbitrary feasible forest in G. We write its connected components as A1 , . . . , Ap ⊆ A , where the numbering is fixed and such that w(A1 ) ≤ w(A2 ) ≤ · · · ≤ w(Ap ) holds. As in the previous sections, we compare A to another solution F . The connected components of A are trees and it is a natural idea to apply the results from the previous sections to these trees by considering each connected component of A individually. Morally, the main obstacle in doing so is the following: In the proof of Theorem 3, we assume implicitly that no F -edge crosses between connected components of A .¶ This is vacuously true in the case where A is a tree; however, if A is a forest, this assumption is not justified in general. In the following, our underlying idea is to replace F -edges that cross between the components of A by edges that lie within the components of A , thereby re-establishing the preconditions of Theorem 3. We show how to do this such that F stays feasible and such that its cost is increased by at most a constant factor. 8.1.1 Notation We start with some normalizing assumptions on F . As before, we denote the connected components of F by F1 , . . . , Fq ⊆ F . First we can assume that each Fi has no inessential edges. Then, since we are in the metric case, we can convert each Fi into a simple cycle—this can be done with at most a factor 2 loss in the cost of F by taking an Euler tour and short-cutting over repeated vertices and non-terminals. This implies that that V [F ] ⊆ V [A ], since now F only has terminals, which are all covered by A . Assume that V [A ] only contains terminals. Then, V [F ] and V [A ] are equal. Recall that T is the set of terminal pairs, let VT be the set of all terminals. Henceforth, we assume that V = V [F ] = V [A ] = VT . Observation 26. Let F , A be feasible solutions and assume that V [A ] = VT . Then there exists a solution P P F ′ of cost 2 · e∈F de + qi=1 w(Fq ) whose connected components are node disjoint cycles and which satisfies V [F ′ ] = V [A ] = VT . ¶ More precisely, we need the slightly weaker condition that for each node t ∈ V [A ], there is an F -edge incident to t that does not leave the connected component of A containing t. 22 5 A5 A7 4 A1 7 A4 1 T1 Figure 9: A simple cycle Fi in G (depicted in blue and black) that induces the blue circuit Ci in GA . Notice that Ci is not simple. The rounded rectangles represent connected components of A , and their size indicates their width. Next, we define a convenient notation for the connected components of A and the F -cycles that pass through them. For each v ∈ V , we set ξ(v) = j for the unique j ∈ {1, . . . , p} that satisfies that v ∈ Aj , i.e., ξ(v) is the index of the connected component of A that contains v. Using this notation, we define a graph GA = G{A1 , . . . , Ap } = (VA , EA ) which results from contracting the connected components of A in F . We set VA := {1, . . . , p} and EA := {ef | f = {v, w} ∈ F , ξ(v) 6= ξ(w)}. It is important that this definition removes all loops induced by the contraction, but it retains possible parallel edges. In this way, the edges of GA correspond to the edges of F that are crossing between the connected components of A , while the nodes correspond to the components. Notice that GA can be seen as a subgraph of Gall A defined in the preliminaries for connecting moves. Thus, every tree in GA induces a connecting move. We extend d to GA by setting def = df for all ef ∈ EA . We also consider the graph ĜA on VA that is the transitive closure of GA . For all pairs j1 , j2 ∈ VA , it contains an additional edge e′j1 j2 whose weight de′j j is given by the length of a shortest j1 -j2 -path in GA . 1 2 For each i ∈ {1, . . . , q}, the simple cycle Fi in G induces a circuit Ci in GA . Figure 9 shows a cycle Fi and its induced circuit Ci . The edges of Ci correspond to those edges of Fi that we want to replace. Observe that Ci is indeed not necessarily simple: Whenever Fi revisits the connected component Aj of A , the induced circuit Ci revisits the same node j ∈ VA . Assume Ci visits exactly s distinct vertices. Then we name them ξ1 , . . . , ξs and assume without loss of generality that ξ1 > · · · > ξs . Since the connected components of A are numbered according to their width, we know that w(Aξ1 ) ≥ · · · ≥ w(Aξs ), and thus the ξi are ordered according to the widths of the components as well. Finally, let nℓ be the number of times that Ci visits ξℓ . In Figure 9, ξ1 = 7, ξ2 = 5, ξ3 = 4, ξ4 = 1, and n1 = 1, n2 = 1, n3 = 2 and n4 = 1. The crucial idea for the replacement of Ci is to use the connecting move optimality↑ of A to lower bound d(Ci ). Any subgraph of Ci that is a tree in GA induces a connecting move. For an example, consider ↑ We will later use approximate moves, but for simplicity, we forget about approximate optimality during this explanation. 23 A5 A5 A7 A5 A7 A4 A 1 A1 A7 A4 A 1 A4 T1 T2 T3 Figure 10: A partitioning of the blue circuit in Figure 9 into trees T1 , T2 , T3 in GA . If none of the three induced connecting moves is improving, then d(T1 ) ≥ w(A4 ), d(T2 ) ≥ w(A4 ) + w(A1 ) and d(T3 ) ≥ w(A4 ) + w(A1 ). Thus, we get d(Ci ) ≥ 3w(A4 ) + 2w(A1 ). Figure 10. We partitioned the edges in Ci from Figure 9 into three trees. For any Ti among the three trees, connecting move optimality guarantees that the sum of the edges d(Ti ) is at least as expensive as the sum of the widths of the components that get connected, except for the largest. For example, when adding T1 to the solution, the edge cost increases by c(T1 ), but the width cost decreases by w(A4 ). Thus, d(T1 ) ≥ w(A4 ) when A is connecting move optimal. Since T1 , T2 and T3 are a edge-disjoint partitioning of Ci , it holds that d(Ci ) = d(T1 ) + d(T2 ) + d(T3 ) and thus we get d(Ci ) ≥ 3w(A4 ) + 2w(A1 ) by considering all three connecting moves. Now consider Figure 11. Here, we partitioned the edges of Ci into a different set of trees. It turns out that this partitioning provides a better lower bound on d(Ci ), namely w(A5 ) + 2w(A4 ) + 2w(A1 ). In fact, this lower bound contains w(Aξℓ ) at least nℓ times for all ℓ ∈ {2, 3, 4}. We observe a sufficient condition for guaranteeing that such a partitioning exists. Definition 27. We say that a tree pays for ξℓ (once) if it contains ξℓ and at least one vertex ξℓ′ with ξℓ′ > ξℓ . Definition 28. Let C = (e1 , . . . , e|C| ) be a circuit in GA that visits the nodes v1 , . . . , v|C|+1 = v1 in this order. We say that C is guarded if we have vi < v1 for all i ∈ {2, . . . , |C|}. A circuit C is minimally guarded if it is guarded and no subcircuit (vi1 , . . . , vi2 ) with i1 , i2 ∈ {2, . . . , |C|}, i1 < i2 and vi1 = vi2 is guarded. Notice that in any guarded circuit, the highest component number only appears once. In Figure 9, Ci is minimally guarded because the only component visited between the two visits of A4 is A5 , which has a higher index. Lemma 29. Let C = (e1 , . . . , e|C| ) be a guarded circuit in GA that visits the nodes v1 , . . . , v|C|+1 = v1 in this order. Assume that v1 = v|C|+1 ≥ vi for all j ∈ {2, . . . , |C|} and that {v1 , . . . , v|C| } consists of s disjoint elements ξ1 > ξ2 > . . . > ξs (this means that v1 = ξ1 ). Furthermore, let nℓ be the number of times that C visits node ξℓ , for all ℓ = 1, . . . , s. If A is c-approximate connecting move optimal and there exists a set of trees M in GA that satisfies that 1. all trees in M are edge-disjoint and only contain edges from C and 2. for all ℓ ∈ {2, . . . , s}, there are at least nℓ trees in M that pay for ξℓ , 24 then it holds that |C| X w(Avi ) = i=2 s X nℓ w(Aξℓ ) ≤ c · |C| X dei = c · d(C). i=1 ℓ=2 Recall that Avi is the connected component of A that corresponds to the index vi . Proof. By the first precondition we know that X X de ≤ |C| X dei . i=1 T ∈M e∈T Now notice that every tree in GA and thus every tree in M defines a connecting move. Since A is capproximate connecting move optimal, it holds that X w(Av ) − max w(Av ) ≤ c · v∈V [T ] v∈V [T ] X de e∈T for every tree T in M. Let low(T ) = V [T ] \ {maxξi ∈T ξi }. Then, we have |C| X w(Avi ) = i=2 s X nℓ w(Aξℓ ) ℓ=2 X 2. s X ≤ = ℓ=2 T ∈M s X X 1low(T ) (ξℓ )w(Aξℓ ) 1low(T ) (ξℓ )w(Aξℓ ) T ∈M ℓ=2 = X X w(Av ) T ∈M v∈low(T ) = X X v∈V [T ] T ∈M v∈V [T ] ≤c· X  w(Av ) − max w(Av ) X de T ∈M e∈T and this proves the lemma. 8.1.2 The Partitioning Algorithm We show how to partition minimally guarded circuits by providing Algorithm 1. It computes a sequence of sets Mk of trees. For k ∈ {2, . . . , s}, Mk contains a partitioning with ni tree that each pay for ξi once, for all i ∈ {1, . . . , k}. The output of the algorithm is Ms . The algorithm maintains a partitioning of C into a set of sub-paths Pk . While these paths are not necessarily simple, they are at all times edge-disjoint. The algorithm iteratively splits non-simple subpaths into simple subpaths. At the same time, it needs to make sure that the subpaths can be combined to trees that satisfy the conditions of Lemma 29. This is accomplished by building the trees of Mk in the transitive closure ĜA of GA : In this way, we can ensure that any edge of each tree in Mk corresponds to a path in the current partitioning Pk . More precisely, if a tree in Mk contains an edge (v, w), then the partitioning contains a subpath (v, . . . , w). This is why we say that a tree T ∈ Mk claims a sub-path p of C if one of the edges in T corresponds to p. Each time the algorithm splits a sub-path, it also splits the corresponding edge of 25 Algorithm 1: A charging algorithm input : A minimally guarded circuit C = (v1 , . . . , v|C|+1 ) in GA with v1 = v|C|+1 . Let {ξ1 , . . . , ξs } be the set of disjoint vertices on C, w.l.o.g. ξ1 > · · · > ξs . output: A set M of edge disjoint trees in GA consisting of edges from C 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Initialization: Observe that ξ2 can only occur once on C. If vi1 , vi2 ∈ C with i1 6= i2 , but vi1 = vi2 = ξ2 , then the subcircuit (vi1 , . . . , vi2 ) certifies that C is not minimally guarded. let v be the unique node in C with v = ξ2 . let T = {{v1 , v}} and let M2 = {(T, v1 )} T is stored with root v1 let P2 = {(v1 , . . . , v), (v, . . . , v|C|−1 )}. the second part of C is unclaimed Main loop: Iteration k computes Mk and Pk foreach k = 3, . . . , s do let Mk = Mk−1 and let Pk = Pk−1 We need to process all occurrences of ξk on C, so we store their indices in I let I = {j ∈ {2, . . . , |C| − 1} | vj = ξk }. Find the path Pj that j lies on. We assume that vPj occurs before wPj on C let Pj = (vPj , . . . , wPj ) be the path in Pk−1 with j as inner node, for all j ∈ I. First case: Treats all occurences of ξk in unclaimed parts of C by creating new trees. foreach j ∈ I with πk−1 (Pj ) = ⊥ do let T = {{vPj , vj }} and let Mk = Mk ∪ {(T, vPj )} new tree claims left part let Pk = Pk \ {Pj } ∪ {(vPj , . . . , vj ), (vj , . . . , wPj )} path Pj is split at vj end Second case: Treats all occurrences of ξk that fall on edges of trees in Mk . This is done by iterating through all trees and processing all occurrences in the same tree together. foreach (T, r) ∈ Mk−1 do let IT = {j ∈ I | πk−1 (Pj ) ∈ T } if IT = ∅ then continue If IT is empty, then T remains unchanged ∗ ∗ select j ∈ IT such that the path from j to r in T contains no j ∈ IT \ {j ∗ } T is modified to include j ∗ . Notice that πk−1 (Pj ∗ ) = {vPj∗ , wPj∗ }. let T = T \ {{vPj∗ , wPj∗ }} ∪ {{vPj∗ , vj ∗ }, {vj ∗ , wPj∗ }} let Pk = Pk \ {Pj ∗ } ∪ {(vPj∗ , . . . , vj ∗ ), (vj ∗ , . . . , wPj∗ )} foreach j ∈ IT \{j ∗ } do Any edge containing a j 6= j ∗ is split: Half of the edge becomes a new tree, and the other half is used to keep the tree connected. Notice that πk−1 (Pj ) = {vPj , wPj }. let T = T \ {{vPj , wPj }} ∪ {{vj , wPj }} let T ′ = {{vPj , vj }} and let Mk = Mk ∪ {(T ′ , vPj )} let Pk = Pk \ {Pj } ∪ {(vPj , . . . , vj ), (vj , . . . , wPj )} end end end return Ms 26 A5 A5 A7 A7 A5 A4 A1 A1 A7 A4 A 1 A4 T1 T3 T2 Figure 11: A different partitioning of the blue circuit in 9 into trees T1 , T2 , T3 in GA . If none of the three induced connecting moves is improving, then d(T1 ) ≥ w(A5 ) + w(A4 ), d(T2 ) ≥ w(A4 ) + w(A1 ) and d(T3 ) ≥ w(A1 ). Thus, we get d(Ci ) ≥ w(A5 ) + 2w(A4 ) + 2w(A1 ) ≥ n2 w(A5 ) + n3 w(A4 ) + n4 w(A1 ). a tree in Mk . To represent the correspondence of trees and subpaths, we define the mapping πk : Pk → ∪T ∈Mk T ×{⊥} that maps a path p = (v, . . . , w) ∈ Pk to an edge e ∈ ∪T ∈Mk T if and only if e∩p = {v, w}. If no such edge exists, then πk (P ) = ⊥. This mapping is well-defined. The trees in the final set Ms do not contain transitive edges, i.e., they are subgraphs of GA . They also leave no part of C unclaimed. We now describe the algorithm in more detail and simultaneously observe its main property: Invariant 30. For all k = 2, . . . , s, it holds after iteration k that for all i ∈ {2, . . . , k} there are at least ni trees in Mk that pay for ξi . For presentation purposes, we assume that we already know that the following invariants are true and prove them later in Lemma 33. An example run of the algorithm to accompany the explanation can be found in Figure 12. Notice that the trees in Mk are rooted, i.e., we store each tree as a tuple consisting of the actual tree plus a root. The trees in connecting moves are unrooted, the roots in Mk are only needed for the computation. Invariants 31. For all k = 2, . . . , s, the following holds: 1. The trees in Mk are edge disjoint. 2. The paths in Pk are edge-disjoint and it holds that S p∈Pk p = C\{{v|C| , v|C|+1 }}. 3. If v is an outer node of some p ∈ Pk , then v ∈ {ξ1 , . . . , ξk }. If v is an inner node, then v ∈ {ξk+1 , . . . , ξs }. 4. For any e ∈ T , T ∈ Mk , πk−1 (e) consists of one path from Pk . 5. If {vj1 , vj2 } with j1 < j2 is an edge in T, (T, r) ∈ Mk , then vj1 is closer to r than vj2 . The initialization consists of setting M2 and P2 . Observe that ξ2 is visited exactly once by C: If there were vi , vj ∈ C with i 6= j, but vi = vj = ξ2 , the sub-circuit (vi , . . . , vj ) would be such that vi > vj for all j ∈ {i + 1, . . . , j − 1}, because ξ1 only occurs at v1 and v|C|+1 . This would be a contradiction to the assumption that C is minimally guarded. The algorithm splits (v1 , . . . , v|C| ) at the unique occurrence v of ξ2 on C. This is done by setting P2 to consist of the paths (v1 , . . . , v) and (v, . . . , v|C| ) and by inserting the tree T = {{v1 , v}} with root v1 into 27 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 7 1 2 1 4 1 2 5 1 3 2 7 M2 Trees in ĜA 7 5 7 4 5 7 4 5 7 2 5 2 4 1 4 1 2 5 2 P2 M3 P3 M4 5 3 5 3 5 1 P4 M5 4 3 2 3 3 2 P5 M6 7 4 2 1 P6 Figure 12: An example for Algorithm 1. On top, we see a circuit v1 , . . . , vs drawn in a path form with the only occurrences of ξ1 = 7 at the endpoints. Below that, we see how Mk and Pk develop through the iterations k = 2, . . . , 6, after which the algorithm stops. Iteration k = 5 is the first where two occurrences of ξk fall into the same tree, which changes the structure of the tree, because the edge between v5 and v8 is split and distributed between two trees: the edge v7 and v8 stays in the tree, and the edge between v5 and v7 forms a new tree. Notice that connectivity is maintained by this operation. 28 M2 . Notice that now π2 ((v1 , . . . , v)) = {v1 , v} in T and π2 ((v, . . . , v|C| )) = ⊥. Invariant 30 is true because there is now one tree paying for ξ2 . For k ≥ 3, we assume that the properties are true for k − 1 by induction. The algorithm starts by setting Mk = Mk−1 and Pk = Pk−1 . Then it considers the set I = {j | vj = ξk } of all occurrences of ξk on C. For all j ∈ I it follows from Properties 31-2 and 31-3 that there is a unique path Pj = (vPj , . . . , wPj ) in Pk−1 with j ∈ Pj . The algorithm defines Pj in Line 7. We know that the paths Pj are different for all j ∈ I: By Property 31-3, all inner nodes are ξk or a ξℓ with higher index. If at least two occurrences of ξk would fall on the same Pj , take the two that are closest together: All nodes between them would be equal to a ξj ′ with j ′ > k, which contradicts the assumption that C is minimally guarded (because the ξℓ are sorted decreasingly). Thus, all j ∈ I have a distinct Pj that they lie on. During the whole algorithm, the endpoints of Pj are always named vPj and wPj , where vPj occurs first on C. Suppose that πk−1 (Pj ) 6= ⊥. The algorithm deals with all j that satisfy this in the for loop that starts in Line 12. For any T with occurences of ξk , it considers IT = {j ∈ I | πk−1 (Pj ) ∈ T }, the set of all occurrences of ξk that fall into the same tree T ∈ Mk−1 . It select a node j ∗ ∈ IT whose unique path to the root of T does not contain any other j ∈ IT . This node must exist because T is a tree. The algorithm updates T , and adds a new tree for any j ∈ IT \{j ∗ }. The idea is that the edge that j ∗ falls on is divided into two edges that stay in T , while all other edges are split into an edge that stays in T and an edge that forms a new tree. Since all vj with j ∈ IT represent the same connected component, T stays connected. More precisely, for j ∗ the edge {vpj∗ , wpj∗ } is divided in T and is replaced by two edges {vpj∗ , vj ∗ } and {vj ∗ , wpj∗ }. For all j ∈ IT \ {j ∗ }, the algorithm replaces {vpj , wpj } by {vj , wPj } in T . By Property 31-5, we know that vPj is closer to the root r of T . Thus, removing {vpj , wpj } disconnects the subtree at wpj from r. However, adding {vj , wPj } reconnects the tree because vj and vj ∗ are the same node and the algorithm assured that vj ∗ ∈ V [T ]. Thus, T stays connected. The algorithm also adds the new tree {{vPj , vj }} to Mk which it can do because this part of C is now free. The algorithm also updates Pk by removing Pj , inserting {vPj , . . . , vj } and {vj , . . . , wPj } instead, thus splitting Pj at vj for all j ∈ IT including j ∗ . The algorithm also processes all j ∈ I where πk−1 (Pj ) = ⊥. This is done in the for loop in Line 8. In this case, the path Pj is split at node j by removing Pj from Pk . Then, the algorithm inserts its two parts (vPj , . . . , vj ) and (vj , . . . , wPj ) into Pk to Pk . It also adds a new tree {{vPj , vj }} with root vPj to Mk . Notice that all trees that are created satisfy that there is a vertex with a higher number than ξk : if a vertex is added into a tree, then the other vertices in the tree have higher value, and if a new tree is created, then it consists of an edge to a vertex which previously was an endpoint of a path, and these have numbers in {ξ1 , . . . , ξk−1 }. For every j ∈ I, it either happens that a tree is updated or that a new tree is created. Thus, the set Mk satisfies Invariant 30 when the iteration is completed. Lemma 32. Invariant 30 holds. Verifying the other invariants consists of checking all updates on Mk and Pk . Lemma 33. Invariants 31 hold. Proof. It is easy to verify that all properties hold for k = 2 since the algorithm sets M2 = ({v1 , v}, v1 ) and P2 = {(v1 , . . . , v), (v, . . . , v|C|−1 )}. Property 31-1 is also true for the new tree created in Line 9 because it is only executed if Pj is unclaimed. Line 16 subdivides an edge into two. Lines 19 and 20 split an existing edge and distributes it among T and T ′ . Thus, Property 31-1 is preserved. For Property 31-2, consider Lines 10, 17 and 21 to verify that paths are only split into subpaths and no edges are lost. Property 31-3 stays true because iteration k processes all occurrences of ξk and always executes one of the Lines 10, 17 and 21, 29 thus splitting the corresponding paths such that ξk becomes an outer node. Lines 9, 10, 16, 17, 19, 20, 21 affect Property 31-4. In all cases, Mk and Pk are adjusted consistently. Finally, consider Property 31-5. Line 9 creates a new tree by claiming (vPj , . . . , vj ) of the unclaimed edges on (vPj , . . . , wPj ). Notice that we assume that vPj occurs on C before vPj . Thus, assuming that Property 31-5 holds for all trees existing before Line 9, we see that it also holds for the new tree. Line 16 modifies a tree T by inserting vj ∗ into an edge. Since vj ∗ is an inner node of (vPj∗ , . . . , wj ∗ ), Property 31-5 is preserved. Line 19 splits edge {vPj , wPj }. Again, recall that vPj occurs before wPj on C and thus inductively is closer to r. Further notice that vj occurs before wPj and that wPj gets disconnected from r when {vPj , wPj } is removed. It is then reconnected to r by adding {vj , wPj }. This means that vj is closer to r than wPj . Line 20 creates a new tree that satisfies Property 31-5 because vPj occurs on C before vj . Corollary 34. Assume that A is c-approximate connecting move optimal. Let C = (v1 , . . . , vl ) be a circuit in GA with edges (e1 , . . . , el ). If C is minimally guarded, then l−1 X w(Tvi ) ≤ c · i=2 l X dei = c · d(C) i=1 Proof. For all T ∈ M and all edges e ∈ T ⊆ Ms , Property 31-4 says that there is a unique path π −1 (e) ∈ Ps . Property 31-3 for k = s means that paths can no longer have inner nodes. Thus, π −1 (e) is a single edge, and therefore, e also exist in GA . Thus, all trees in Ms are trees in GA . By Property 31-4, the trees are edge disjoint. Lemma 32 ensures that they satisfy the precondition of Lemma 29. The corollary then follows. As before, we set ξ(v) = j for the unique j ∈ {1, . . . , p} with v ∈ Aj , for all v ∈ V . For any edge set F in G, we define F := {e = {u, v} ∈ F | ξ(u) = ξ(v)} and F↔ := {e = {u, v} ∈ F | ξ(u) 6= ξ(v)} as the subset of edges of F within components of A or between them, respectively. Furthermore, if an edge set F ′ in G satisfies V [F ′ ] ⊆ V [Aj ] for a j ∈ {1, . . . , p}, then we set ξ(F ′ ) = j. Notice that in this case, F ′ = F′ . Lemma 35. Let F̄ be a simple path in G that starts and ends in the same connected component Tj ∗ of A and satisfies that ξ(v) ≤ j ∗ for all v ∈ V [F̄ ]. Assume that F̄ 6= F̄ . Assume that A is edge/set and path/set swap-optimal with respect to F̄↔ and that A is c-approximate connecting move optimal. Then, there exists a set R of edges on the vertices V [F̄↔ ] with (F̄ ∪ R)↔ = (F̄ ∪ R) that satisfies the properties listed below. Let F1′ , . . . , Fx′ be the connected components of F̄ ∪ R in (V [F ′ ], E[F ′ ]). 1. A is edge/set swap-optimal with respect to R. 2. It holds that d(R) ≤ d(F̄↔ ) and Px ℓ=2 w(Tξ(Fℓ′ ) ) ≤ c · d(F̄↔ ). 3. For all Fℓ′ , there exists an index j such that V [Fℓ′ ] ⊆ V [Aj ] (thus, ξ(Fℓ′ ) = j). 4. There is only one Fℓ′ with ξ(Fℓ′ ) = j ∗ , assume w.l.o.g. that ξ(F1′ ) = j ∗ . Proof. Let F̄ = (s, . . . , v1 , w1 , . . . , w2 , v2 , . . . , t) where (s, . . . , v1 ) and (v2 , . . . , t) are the prefix and suffix of F̄ lying in Tj ∗ , i.e., we assume that s, . . . , v1 ∈ Tj ∗ , v2 , . . . , t ∈ Tj ∗ and w1 , w2 6∈ Tj ∗ . The nodes s and v1 may coincide as well as v2 and t. Let C̄ be the circuit that F̄ induces in GA . We do induction on the inclusion-wise hierarchy of guarded circuits. Thus, our base case is that C̄ is minimally guarded. In this case, we know that all vertices v from (w1 , . . . , w2 ) satisfy ξ(v) < j ∗ . We set R = {ē} with ē := {v1 , v2 } and d(ē) := d(F̄↔ ) and show that R satisfies Properties 35-1–35-4. For 30 Property 35-1, we need path/set swap optimality. Picking v1 and v2 uniquely defines a set of edges X which form a shortest path from v1 to v2 in the contracted graph and which every v1 -v2 -based path move adds. Let (ē, S) be a edge/set swap that adds ē. We argue that this move cannot be improving because otherwise, the path/set swap (X, S) was improving. Let loss(X) be the increase that adding X to A incurs in φ, and let gain(S) be the amount by which deleting S decreases φ. Assume that (ē, S) is improving, i.e., d(ē) = d(F̄↔ ) < gain(S). Notice that F̄↔ is a path from v1 to v2 in the contracted graph. Thus, d(F̄↔ ) ≥ d(X). Furthermore, notice that loss(X) ≤ d(X). Thus, loss(X) ≤ d(F̄↔ ), such that our assumption implies loss(X) < gain(S). That is a contradiction to path/set swap optimality. Property 35-1 holds. Property 35-2 is true because d(F ′ ) = d(F̄↔ ) and by Corollary 34 since d(F̄↔ ) = d(C̄). Now we look at the connected components of F̄ ∪ R. They are equal to the connected components of F̄ except that we add the edge e. Notice that F̄ only contains edges that go within the same component, and that that e connects two vertices from the same component. Thus, Property 35-4 holds. Furthermore, notice that F̄ has exactly two connected components consisting of vertices from Tj ∗ : The vertices on the prefix and suffix of F̄ . These components are connected by e = {v1 , v2 }. Thus, Property 35-2 holds. Now assume that C̄ is not minimally guarded. First assume that C̄ is not guarded. Define v1 and v2 as before. Since C̄ is not guarded, F̄ has to visit Tj ∗ again between v1 and v2 . Let v3 and v4 be the first and last vertex of one arbitrary visit to Tj ∗ between v1 and v2 . It is possible that v3 = v4 , otherwise, notice that v3 and v4 are connected in F̄ . We split F̄ into two paths P1 := (v1 , . . . , v3 ) and P2 := (v4 , . . . , v2 ) and obtain ′ ′ two sets F 1 and F 2 by using the induction hypothesis on the two inclusionwise smaller paths. By induction ′ hypothesis, v1 , v3 and all other occurrences of vertices from Tj ∗ in P1 have to be connected in F̄ ∪ F 1 . ′ Also, v4 , v2 and all other occurrences of vertices from Tj ∗ in P2 have to be connected in F̄ ∪ F 2 . Thus, ′ ′ all occurrences of vertices from Tj ∗ on F̄ are connected in F̄ ∪ F 1 ∪ F 2 because v3 is connected to v4 in F̄ . So, Property 35-4 holds. Furthermore, since F̄ is a simple path, no other components of F1 ′ and F2 ′ ′ ′ can contain the same vertex because only v3 is in both P1 and P2 . Thus, Property 35-3 holds for F 1 ∪ F 2 ′ ′ since it holds for F 1 and F 2 individually. If A is edge/set swap-optimal with respect to a set A and also with respect to a set B, then it is edge/set swap-optimal with respect to A ∪ B, thus Property 35-1 holds ′ ′ ′ ′ for F 1 ∪ F 2 . Similarly, Property 35-2 holds because it holds for F11 and F12 individually with respect to disjoint parts of F̄↔ . Finally, assume that F̄ is guarded, but not minimally guarded. Define v1 and v2 as before. Since F̄ is guarded, but not minimally guarded, it visits a connected component Tj with j < j ∗ twice between v1 and v2 , and between these two visits, it never visits a component Tj ′ with j ′ > j. Pick a j and two visits of Tj with this property, and let v3 be the last vertex in the first of these visits of Tj and let v4 be the first vertex of the second visit of Tj . Again, v3 = v4 is possible and otherwise, v3 and v4 are connected in F̄ . We apply the induction to the path F̄ ′ which is the subpath (v3 , . . . , v4 ) and obtain a set F ′ by the induction hypothesis. Additionally, we create F̄ ′′ from F̄ by replacing the subpath (v3 , . . . , v4 ) by the edge (v3 , v4 ). Since this path is shorter, we can apply the induction hypothesis to F̄ ′′ to obtain a set F ′′ . We claim that ′ ∪ F ′′ . Again, Property 35-1 is true because F ′ ∪ F ′′ F ′ ∪ F ′′ satisfies all properties. Notice that F̄↔ = F̄↔ ↔ is the union of two sets that satisfy Property 35-1. What are the connected components of F̄ ∪ F ′ ∪ F ′′ ? Let CC be the set of connected components of F̄ , and define CC ′ and CC ′′ to be the connected components of F̄ ∪ F ′ and F̄ ∪ F ′′ , respectively. All edges in F ′ ∪ F ′′ go between different components in CC, and F ′ and F ′′ are defined on vertex sets that are disjoint with the exception of v3 and v4 . Both C ′ and C ′′ contain exactly one connected component which contains both v3 and v4 (notice that v3 and v4 are connected in F̄ ′′ and F̄ ). In C ′ , it is the connected component with the highest width (i.e.,, F1′ ), but in CC ′′ , the component with the highest width is the component that contains v1 and v2 . Thus, v1 , v2 ∈ F1′′ and v3 , v4 ∈ Fj′′′′ with j ′′ 6= 1. In F̄ ∪ F ′ ∪ F ′′ , F1′ and Fj ′′′ are merged into 31 one connected component because they both contain v3 and v4 , meaning that w(F1′ ) = w(Fj ′′′ ) is counted twice when applying Property 35-2 for F ′ and F ′′ compared to applying Property 35-2 to F ′ ∪ F ′′ . All other components in C ′ and C ′′ are defined on disjoint vertex sets and thus F̄ ∪ F ′ ∪ F ′′ is the disjoint union of CC ′ \{F1′ }, CC ′′ \{Fj′′′′ } and {F1′ ∪ Fj′′′ }. We see that Property 35-3 and 35-4 carry over to F ′ ∪ F ′′ from holding for F ′ and F ′′ . Name the connected components of F̄ ∪ F ′ ∪ F ′′ as F1′′′ , . . . , Fy′′′ . The component with the highest width among these, F1′′′ , is the one that contains v1 and v2 , i.e., F1′′′ = F1′′ . We thus have y X ℓ=2 ′ w(Tξ(Fℓ′′′ ) ) = x X ℓ=2 ′′ w(Tξ(Fℓ′ ) ) + x X ℓ=2 ′ ′′ w(Tξ(Fℓ′′ ) ) ≤ c · d(F↔ ) + c · d(F↔ ) = c · d(F̄↔ ). ′ ∪ F ′′ and d(F ′ ) ≤ d(F̄ ′ ) and d(F ′′ ) ≤ d(F̄ ′′ ) by the induction hypothesis, we have Since F̄↔ = F̄↔ ↔ ↔ ↔ ′ ′′ d(F ∪ F ) ≤ d(F̄↔ ) and thus F ′ ∪ F ′′ satisfies Property 35-2. Figure 13-21 illustrate how F ′ is constructed recursively. v1 v2 Figure 13: The rounded rectangles visualize the connected components of A , their size indicates their width. We see a path F̄ that corresponds to a circuit in GA which is guarded, but not minimally guarded. We pick v1 and v2 as described. 32 v1 v2 v3 v4 Figure 14: We identify suitable v3 and v4 and split the path into two paths: The green path, and the black path that now contains the dashed edge. v1 v2 v1 v2 Figure 15: These are the two paths for which we use the induction hypothesis. Both are guarded, but not minimally guarded. 33 v1 v4 v2 v3 v1 v2 Figure 16: We identify v3 and v4 for the two paths in Figure 15 and split the path into the green part and the black part with the dashed edge. v1 v2 v1 v2 Figure 17: These are the two black paths. The left one is now minimally guarded, but the right one is split again. 34 v1 v2 v2 v1 v1 v2 v2 v1 v2 v1 Figure 18: The five base cases that occur. v1 v2 v2 v1 v1 v2 v2 v1 v2 v1 Figure 19: We get that the blue edges cost at most the same as the black edges in Figure 18, and that summing the widths for all blue components costs at most the cost of the black edges in Figure 18 as well. 35 v1 v2 Figure 20: The result of the induction for the paths in Figure 15 . Figure 21: Final set F ′ and connected components of F ′ ∪ F̄ . 36 8.1.3 Wrapping Up Lemma 36. Let G = (V, E) be a complete graph, let d : E → R≥0 be a metric that assigns a cost de to every edge e ∈ E and let T ⊆ V × V be a set of terminal pairs. Let A , F ⊆ E be two feasible Steiner Forest solutions for (G, T). Furthermore, suppose that A is edge/edge, edge/set and path/set swap-optimal with respect to E and φ, that A is c-approximate connecting move optimal and that A only uses edges between terminals. Then there exists a feasible solution F ′ with d(F ′ ) ≤ 2(1 + c) · d(F ) that satisfies F ′ = F ′  such that A is edge/edge and edge/set swap-optimal with respect to F ′ . Proof. By Observation 26, we know that by accepting a factor of 2 in the cost, we can assume that the connected components F1 , . . . , Fq of F are node disjoint cycles and that V [F ] = V [A ] equals the set of all terminals. The connected components of A are T1 , . . . , Tp . Recall that we use ξ(v) for the index of the component Tj that v lies in, and we use F := {e = {u, v} ∈ F | ξ(u) = ξ(v)} and F↔ := {e = {u, v} ∈ F | ξ(u) 6= ξ(v)} for any edge set F for the set of edges within components of A or between them, respectively. Also, if an edge set F ′ in G satisfies V [F ′ ] ⊆ V [Tj ] for a j ∈ {1, . . . , p}, then we use ξ(F ′ ) = j. We want to replace all cycles Fi by sets Fi′ which satisfy Fi′ = (Fi′ ) while keeping the solution feasible and within a constant factor of φ(F ). Let F = Fi be one of the cycles. Let j ∗ := maxv∈V [F ] ξ(v) be the index of the component with the highest width among the components that F visits. There have to be at least two vertices on F from Tj ∗ (every vertex is a terminal by our assumption, and since the cycles are disjoint, a lone vertex would not be connected to its mate, but F is a feasible solution). If the two vertices are adjacent in F , then we can delete the edge that connects them and obtain a path that satisfies the preconditions of Lemma 35. We get an edge set F ′ . Otherwise, let v1 and v2 be two vertices from Tj ∗ that are not connected by an edge in F . Then the cycle is partitioned into two paths, both with endpoints v1 and v2 , that both satisfy the preconditions of Lemma 35. In this case, we get two solutions Fl′ and Fr′ and set F ′ := Fl′ ∪ Fr′ . Notice that, either way, we get a set of edges F ′ on the vertices V [F ] inducing connected components F1′ , . . . , Fx′ of F ∪ F ′ with the following properties: 1. A is edge/set swap-optimal with respect to F ′ 2. For all Fℓ′ , there exists an index j such that V [Fℓ′ ] ⊆ V [Tj ] (thus, ξ(Fℓ′ ) = j). When F ′ = Fl′ ∪ Fr′ , then notice that the connected components of Fl′ and Fr′ are disjoint with the exception of those containing v1 and v2 . Thus, no components with vertices from different Tj will get connected. 3. There is only one Fℓ′ with ξ(Fℓ′ ) = j ∗ , assume w.l.o.g. that ξ(F1′ ) = j ∗ . When F ′ = Fl′ ∪ Fr′ , then notice that all occurrences of vertices from Tj ∗ are connected to v1 and v2 in either Fl′ or Fr′ , thus, they are all in the same connected component of F ′ . P 4. It holds that d(F ′ ) ≤ d(F↔ ) and xℓ=2 w(Tξ(Fℓ′ ) ) ≤ c · d(F↔ ). When F ′ = Fl′ ∪ Fr′ , notice that P d(F ′ ) = d(Fl′ ) + d(Fr′ ) ≤ d(F↔ ), and that xℓ=2 w(Tξ(Fℓ′ ) ), which does not include the components with v1 and v2 , can be split according to the ‘side’ of the cycle that the components belong to. The solution F ′ that arises from substituting F↔ by F ′ is not necessarily feasible because F ∪ F ′ can consist of multiple connected components. We need to transform F ′ such that all terminal pairs in F ∪ F ′ are connected. Notice that a terminal pair u, ū always satisfies ξ(u) = ξ(ū) because A is feasible, i.e., we do not need to connect connected components with vertices from different Tj . Furthermore, all vertices in V [F ] from Tj ∗ are already connected because of 3. Fix a j < j ∗ and consider all connected components Fℓ′ P with ξ(Fℓ′ ) = j. Notice that j < j ∗ implies that the widths of these components are part of xℓ=2 w(Tξ(Fℓ′ ) ). Start with an arbitrary Fℓ′ . If there is a terminal u ∈ Fℓ′ whose partner ū is in Fℓ′′ , ℓ′ 6= ℓ, then connect u to ū. Since u, ū ∈ Tj , their distance is at most w(Tj ). Since w(Tξ(Fℓ′ ) ) = w(Tj ), the contribution of Fℓ′ to the 37 width sum is large enough to cover the connection cost. Now, Fℓ′ and Fℓ′′ are merged into one component, we keep calling it Fℓ′ . Repeat the process until all terminals in Fℓ′ are connected to their partner, while always spending a connection cost that is bounded by the contribution of the component that gets merged into Fℓ′ . When Fℓ′ is done, pick a component that was not merged and continue in the same fashion. Repeat until all components are merged or processed. In the end, F ′ is a feasible solution, and the money spent for P the additional edges is bounded by xℓ=2 w(Tξ(Fℓ′ ) ) ≤ c · d(F↔ ). Thus, the cost of the new solution is at most (1 + c) · d(F↔ ). We process all Fi with Fi 6= (Fi ) in this manner to obtain a solution F ′ with F ′ = F′ . Notice that A is edge/edge and edge/set swap-optimal with respect to F ′ . This holds for the new edges because they are from G and A is swap-optimal with respect to G, and it holds for the edges that we get from Lemma 35 by property 1. Thus, we have found F ′ with the necessary properties. We can now apply Corollary 2 to bound the cost of A . Corollary 37. Let G = (V, E) be a complete graph, let d : E → R≥0 be a metric that assigns a cost de to every edge e ∈ E and let T ⊆ V × V be a terminal set. Let A , F ⊆ E be two feasible Steiner Forest solutions for (G, T). Furthermore, suppose that A is edge/edge, edge/set and path/set swap-optimal with respect to E and φ, that A is c-approximate connecting move optimal and that A only uses edges between terminals. Then d(A ′ ) ≤ 23(1 + c) · d(F ). Proof. Lemma 36 ensures that there is a solution F ′ with d(F ′ ) ≤ 2(1 + c) · d(F ) that satisfies F′ = F ′ . Every connected component Aj of A can now be treated separately by using Corollary 2 on Aj and the part of F ′ that falls into Aj . By combining the conclusions for all connected components, we get that d(A ′ ) ≤ 11.5φ(F ′ ) ≤ 23(1 + c) · d(F ) for any feasible solution F . Theorem 1 follows directly. Since the 2-approximation for k-MST [Gar05] can be adapted to the weighted case [Gar16], c = 2 is possible and we can achieve an approximation guarantee of 69. References [AFS13] Sara Ahmadian, Zachary Friggstad, and Chaitanya Swamy, Local-search Based Approximation Algorithms for Mobile Facility Location Problems, Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’13, SIAM, 2013, pp. 1607–1621. [AGK+ 04] Vijay Arya, Naveen Garg, Rohit Khandekar, Adam Meyerson, Kamesh Munagala, and Vinayaka Pandit, Local Search Heuristics for k-Median and Facility Location Problems, SIAM Journal on Computing 33 (2004), no. 3, 544–562. [AK00] Sanjeev Arora and George Karakostas, A 2 + ǫ Approximation Algorithm for the k-MST Problem, Proceedings of the Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms (David Shmoys, ed.), SODA ’00, Society for Industrial and Applied Mathematics, 2000, pp. 754–759. [AKR95] Ajit Agrawal, Philip Klein, and R. Ravi, When Trees Collide: An Approximation Algorithm for the Generalized Steiner problem on Networks, SIAM Journal on Computing 24 (1995), no. 3, 440–456. [Ali94] Paola Alimonti, New Local Search Approximation Techniques for Maximum Generalized Satisfiability Problems, Proceedings of the Second Italian Conference on Algorithms and Complexity (Maurizio Bonuccelli, Pierluigi Crescenzi, and Rossella Petreschi, eds.), CIAC ’94, Springer-Verlag, 1994, pp. 40– 53. 38 [AR98] Sunil Arya and H. Ramesh, A 2.5-factor Approximation Algorithm for the k-MST Problem, Information Processing Letters 65 (1998), no. 3, 117–118. [Big98] Norman Biggs, Constructions for cubic graphs with large girth, The Electronic Journal of Combinatorics 5 (1998), no. 1, A1:1–A1:25. [BRV96] Avrim Blum, R. Ravi, and Santosh Vempala, A Constant-factor Approximation Algorithm for the k-MST Problem, Proceedings of the Twenty-eighth Annual ACM Symposium on Theory of Computing (Gary L. Miller, ed.), STOC ’96, ACM, 1996, pp. 442–448. [CAKM16] Vincent Cohen-Addad, Philip N. Klein, and Claire Mathieu, Local search yields approximation schemes for k-means and k-median in euclidean and minor-free metrics, Proceedings of the 57th Annual Symposium on Foundations of Computer Science, 2016, to appear. [CG15] Sergio Cabello and David Gajser, Simple PTAS’s for families of graphs excluding a minor, Discrete Applied Mathematics 189 (2015), 41–48. [CIM09] Chandra Chekuri, Sungjin Im, and Benjamin Moseley, Longest wait first for broadcast scheduling [extended abstract], Approximation and Online Algorithms, Springer, 2009, pp. 62–74. [CM15] Vincent Cohen-Addad and Claire Mathieu, Effectiveness of local search for geometric optimization, 31st International Symposium on Computational Geometry, SoCG 2015, June 22-25, 2015, Eindhoven, The Netherlands, 2015, pp. 329–343. [CRV10] Ho-Lin Chen, Tim Roughgarden, and Gregory Valiant, Designing network protocols for good equilibria, SIAM J. Comput. 39 (2010), no. 5, 1799–1832. MR 2592034 (2011d:68012) [CRW04] Fabián A. Chudak, Tim Roughgarden, and David P. Williamson, Approximate k-MSTs and k-Steiner Trees via the Primal-dual Method and Lagrangean Relaxation, Mathematical Programming 100 (2004), no. 2, 411–421. [CS09] Chandra Chekuri and F. Bruce Shepherd, Approximate Integer Decompositions for Undirected Network Design Problems, SIAM Journal on Discrete Mathematics 23 (2009), no. 1, 163–177. [FHJM94] Matteo Fischetti, Horst W. Hamacher, Kurt Jørnsten, and Francesco Maffioli, Weighted k-Cardinality Trees: Complexity and Polyhedral Structure, Networks 24 (1994), no. 1, 11–21. [FR94] Martin Fürer and Balaji Raghavachari, Approximating the minimum-degree steiner tree to within one of optimal, J. Algorithms 17 (1994), no. 3, 409–423. [FRS16] Zachary Friggstad, Mohsen Rezapour, and Mohammad R. Salavatipour, Local search yields a PTAS for k-means in doubling metrics, Proceedings of the 57th Annual Symposium on Foundations of Computer Science, vol. abs/1603.08976, 2016, to appear. [Gar96] Naveen Garg, A 3-approximation for the Minimum Tree Spanning K Vertices, Proceedings of the Thirtyseventh Annual Symposium on Foundations of Computer Science, FOCS ’96, IEEE Computer Society, 1996, pp. 302–309. [Gar05] , Saving an Epsilon: A 2-approximation for the k-MST Problem in Graphs, Proceedings of the Thirty-seventh Annual ACM Symposium on Theory of Computing (Ronald Fagin and Hal Gabow, eds.), STOC ’05, ACM, 2005, pp. 396–402. [Gar16] Naveen Garg, 2016, Personal Communication. [GGK13] Albert Gu, Anupam Gupta, and Amit Kumar, The Power of Deferral: Maintaining a ConstantCompetitive Steiner Tree Online, Proceedings of the Forty-fifth Annual ACM Symposium on Theory of Computing (Dan Bonesh, Joan Feigenbaum, and Tim Roughgarden, eds.), STOC ’13, ACM, 2013, pp. 525–534. [GK14] Anupam Gupta and Amit Kumar, Online steiner tree with deletions, SODA, Jan 2014, pp. 455–467. [GK15] Anupam Gupta and Amit Kumar, Greedy Algorithms for Steiner Forest, Proceedings of the Forty-seventh Annual ACM Symposium on Theory of Computing (Ronitt Rubinfeld and Rocco Servedio, eds.), STOC ’15, ACM, 2015, pp. 871–878. 39 [GW95] Michel X. Goemans and David P. Williamson, A General Approximation Technique for Constrained Forest Problems, SIAM Journal on Computing 24 (1995), no. 2, 296–317. [Hel00] Keld Helsgaun, An Effective Implementation of the Lin-Kernighan Traveling Salesman Heuristic, European Journal of Operational Research 126 (2000), no. 1, 106–130. [IW91] Makoto Imase and Bernard M. Waxman, Dynamic Steiner tree problem, SIAM J. Discrete Math. 4 (1991), no. 3, 369–384. MR 92f:68066 [Jai01] Kamal Jain, A Factor 2 Approximation Algorithm for the Generalized Steiner Network Problem, Combinatorica 21 (2001), no. 1, 39–60. [JMP00] David S. Johnson, Maria Minkoff, and Steven Phillips, The Prize Collecting Steiner Tree Problem: Theory and Practice, Proceedings of the Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’00, Society for Industrial and Applied Mathematics, 2000, pp. 760–769. [JV01] Kamal Jain and Vijay V. Vazirani, Approximation Algorithms for Metric Facility Location and k-Median Problems Using the Primal-dual Schema and Lagrangian Relaxation, Journal of the ACM 48 (2001), no. 2, 274–296. [KLS05] Jochen Könemann, Stefano Leonardi, and Guido Schäfer, A Group-Strategyproof Mechanism for Steiner Forests, Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’05, Society for Industrial and Applied Mathematics, 2005, pp. 612–619. [KLSvZ08] Jochen Könemann, Stefano Leonardi, Guido Schäfer, and Stefan H. M. van Zwam, A GroupStrategyproof Cost Sharing Mechanism for the Steiner Forest Game, SIAM Journal on Computing 37 (2008), no. 5, 1319–1341. [KMN+ 04] Tapas Kanungo, David M. Mount, Nathan S. Netanyahu, Christine D. Piatko, Ruth Silverman, and Angela Y. Wu, A Local Search Approximation Algorithm for k-means Clustering, Computational Geometry 28 (2004), no. 2–3, 89–112, Special Issue on the 18th Annual Symposium on Computational Geometry – SoCG2002. [KMSV98] Sanjeev Khanna, Rajeev Motwani, Madhu Sudan, and Umesh V. Vazirani, On Syntactic versus Computational Views of Approximability, SIAM Journal on Computing 28 (1998), no. 1, 164–191. [KPR00] Madhukar R. Korupolu, C. Greg Plaxton, and Rajmohan Rajaraman, Analysis of a local search heuristic for facility location problems, J. Algorithms 37 (2000), no. 1, 146–188. [LK73] Shen Lin and Brian W. Kernighan, An Effective Heuristic Algorithm for the Traveling-Salesman Problem, Operations Research 21 (1973), no. 2, 498–516. [LOP+ 15] Jakub Łacki, ˛ Jakub Oćwieja, Marcin Pilipczuk, Piotr Sankowski, and Anna Zych, The Power of Dynamic Distance Oracles: Efficient Dynamic Algorithms for the Steiner Tree, Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing (New York, NY, USA), STOC ’15, ACM, 2015, pp. 11–20. [LR96] Hsueh-I Lu and R. Ravi, The Power of Local Optimization: Approximation Algorithms for Maximumleaf Spanning Tree, In Proceedings, Thirtieth Annual Allerton Conference on Communication, Control and Computing, 1996, pp. 533–542. [MSVW12] Nicole Megow, Martin Skutella, José Verschae, and Andreas Wiese, The power of recourse for online MST and TSP, ICALP (1), 2012, pp. 689–700. [PS15] Lukáš Poláček and Ola Svensson, Quasi-Polynomial Local Search for Restricted Max-Min Fair Allocation, ACM Transactions on Algorithms 12 (2015), no. 2, 13:1–13:13. [PTW01] Martin Pál, Éva Tardos, and Tom Wexler, Facility location with nonuniform hard capacities, 42nd Annual Symposium on Foundations of Computer Science, FOCS 2001, 14-17 October 2001, Las Vegas, Nevada, USA, 2001, pp. 329–338. 40 [SO98] Roberto Solis-Oba, 2-Approximation Algorithm for Finding a Spanning Tree with Maximum Number of Leaves, Proceedings of the Sixth Annual European Symposium on Algorithms (Gianfranco Bilardi, Giuseppe F. Italiano, Andrea Pietracaprina, and Geppino Pucci, eds.), ESA ’98, Springer Berlin Heidelberg, 1998, pp. 441–452. [WS11] David P Williamson and David B Shmoys, The design of approximation algorithms, Cambridge university press, 2011. 41 A Notes on simpler local search algorithms A.1 Adding an edge and removing a constant number of edges Let ℓ and k < ℓ be integers and consider Figure 22. Notice that adding a single edge and removing k edges does not improve the solution. However, the current solution costs more than ℓ2 /k and the optimal solution costs less than 2ℓ, which is a factor of ℓ/(2k) better. s1 ℓ k s2 1 t2 ℓ k s3 1 t3 ℓ ... sℓ 1 tℓ ℓ k t1 Figure 22: A bad example for edge/set swaps that remove a constant number of edges. A.2 Regular graphs with high girth and low degree Assume that G is a degree-3 graph with girth g = c log n like the graph used in Chen et al. [CRV10]. Such graphs can be constructed, see [Big98]. Select a spanning tree F in G which will be the optimal solution. Let E ′ be the non-tree edges, notice that |E ′ | ≥ n/2, and let M be a maximum matching in E ′ . Because of the degrees, we know that |M | ≥ n/10. The endpoints of the edges in M form the terminal pairs T. Set the length of all edges in F to 1 and the length of the remaining edges to g/4. The solution F is feasible and costs n − 1. The solution M costs Ω(log n). Assume we want to remove an edge e = {v, w} ∈ M and our swap even allows us to add a path to reconnect v and w (in the graph where M \{e} is contracted). Let P be such a path. Since M is a matching, at most every alternating edge on P is in M . Thus, we have to add |P |/2 − 1 ≥ g/2 − 1 edges of length one at a total cost that is larger than the cost g/4 of e. Thus, no d-improving swap of this type exists (note that, in particular, path/set swaps are not d-improving for M ). As a consequence, any oblivious local search with constant locality gap needs to sport a move that removes edges from multiple components of the current solution. In order to restrict to local moves that only remove edges from a single component, we therefore introduced the potential φ. B Making the Algorithm Polynomial So far, we have shown that any locally optimal solution is also within a constant factor of the global optimum. In order to ensure that the local search can find such a local optimum in polynomial time, two issues have to be addressed. First, we need to show that each improving move can be carried out in polynomial time (or it can be decided in polynomial time that no such move exists). While it is easy to see that improving edge/edge, edge/set, and path/set swaps can be found in polynomial time, finding an improving connecting move is NP-hard in general. However, as we saw in Section 8.1, it is sufficient to restrict the neighborhood of the local search to c-approximate connecting moves. In Section B.1, we show that the task of finding an approximate connecting move reduces to approximating the weighted k-MST problem. In Section B.2 we discuss constant factor approximation algorithms for this problem. In particular, we get the following theorem: Theorem 38. Let ε > 0. There exists a polynomial time algorithm, called Improving-Connecting-Move, such that given a Steiner forest A and a metric distance d : E → R≥0 on the edges then either: (i) the algorithm finds an improving connecting move with respect to φ, or (ii) it guarantees that there is no 42 c(1 + ε)-approximate connecting move, that is, for every tree T of GA it holds that X e∈A )  d(e) ≥ c(1 + ε) ·  X i∈VA  w(Ai ) − max w(Ai ) , i∈VA where {A1 , . . . , Ap } is the set of connected components of A . The second thing we need to show for guaranteeing polynomiality of the local search is that the total number of improving moves is bounded by a polynomial in the input size. This can easily be achieved done via a standard rounding technique incurring only a loss of a factor of 1 + ε over the original guarantee for local optima, for an arbitrarily small ε > 0; see Section B.3 for details. We finally get the following theorem: Theorem 39. For every ε > 0, there is a local search algorithm that computes in polynomial time a solution A to Steiner Forest such that d(A ) ≤ (1 + ε)69 · OPT. B.1 How to ensure approximate connecting move optimality Assume that we are given an algorithm Tree-Approx that computes a c-approximation for the following minimization problem. We call the problem weighted (rooted) k-MST problem, and approximating it is further discussed in Section B.2. Given G = (V, E) with a root r, a metric d : V × V → R+ , a function γ : V → R+ with P γ(r) = 0, and a lower bound Γ, find a tree T in G with r ∈ V [T ] and v∈V [T ] γ(v) ≥ Γ that P minimizes e∈T d(e). We see how to use Tree-Approx to ensure ((1 + ε) · c)-approximate connecting move optimality. We apall ply Tree-Approx to Gall A . Recall that the vertices in GA are {1, . . . , p}, corresponding to the components all A1 , . . . , Ap of our solution. We try |V (GA )| possibilities for the component with the largest width in the connecting move. After choosing the largest component to be the one with index i, we delete all vertices from Gall A with indices larger than i. Then we set γ(i) := 0 and γ(j) := w(Aj ) for j < i. We can collect prices between wmin := min{w(Ai ) | i ∈ {1, . . . , p}, w(Ai ) > 0}, the smallest strictly positive width of P ℓ any component, and i−1 j=1 w(Aj ) < p · w(Ap ). We call Tree-Approx for Γ = (1 + ε/2) wmin for all ℓ ≥ 1 until (1 + ε/2)ℓ ≥ pw(Ap ). The largest ℓ that we have to test is at most log1+ε/2 p p) p · log1+ε/2 p w(A wmin w(Ap ) wmin . Thus, our total ≤ n · log1+ε/2 n∆, where ∆ is the largest number of calls of Tree-Approx is bounded by distance between a terminal and its partner divided by the smallest such distance that is non-zero. P P Assume that Tree-Approx returns a solution T with e∈E[T ] d(e) > v∈T γ(v) for all calls, which means that it does not find an improving connecting move. Furthermore, assume that there exists a ((1 + ε) · c)P approximate connecting move T ∗ that we should have found, i.e., which satisfies that e∈E[T ∗ ] d(e) ≤ P P 1 ℓ ∗ ∗ v∈T ∗ γ(v). Let ℓ be the index that satisfies (1 + ε/2) wmin ≤ Γ < v∈T ∗ γ(v). Set Γ := (1+ε)c (1 + ε/2)ℓ+1 wmin and consider the run with the correct choice of the largest width and the lower bound Γ′ := (1 + ε/2)ℓ wmin . Notice that T ∗ is a feasible solution for this run: w(T ∗ ) = Γ∗ ≥ Γ′ satisfies the lower bound. Thus, the P optimal solution to the input has a cost of at most e∈E[T ∗ ] d(e). Tree-Approx computes a c-approximation, 43 i.e., a solution T̂ with X P v∈V [T̂ ] γ(v) d(e) ≤ c e∈T̂ X ≥ Γ′ and e∈E[T ∗ ] d(e) ≤ X c γ(v) (1 + ε)c v∈V [T ∗ ] ≤ (1 + ε/2) X c γ(v), Γ′ < Γ′ ≤ (1 + ε)c v∈V [T̂ ] which means that Tree-Approx computes an improving connecting move. B.2 Weighted k-MST This section is about ways to provide the algorithm Tree-Approx. The problem we want to solve is a weighted version of the rooted k-MST problem. Given G = (V, E) with a root r, a metric d : V ×V → R+ and a lower bound k ∈ N, the rooted k-MST problem is to compute a tree T in G with r ∈ V [T ] and |V [T ]| ≥ k that P minimizes e∈E[T ] d(e). The unrooted k-MST problem is defined verbatim except that no distinguished root has to be part of the tree. Work on k-MST. Fischetti et al. [FHJM94] show that the unrooted k-MST problem is NP-hard. Any algorithm for the rooted k-MST problem transfers to an algorithm for the unrooted case with the same approximation guarantee by testing all possible nodes and returning the best solution that was found. This in particular holds for optimal algorithms, so the rooted k-MST problem is also NP-hard. As for example observed by Garg [Gar05], we can also use algorithms for the unrooted k-MST problem to compute solutions for the rooted k-MST problem with the same approximation guarantee. To do so, create n vertices with zero distance to the designated root vertex and search for a tree with n + k vertices. Any such tree has to include at least one copy of the root, and at least k − 1 other vertices. Thus, any solution for the unrooted k-MST problem is a feasible solution for the rooted k-MST problem, and the cost is the same. Thus, the rooted and unrooted version of the k-MST problem are equivalent. Blum, Ravi and Vempala [BRV96] develop the first constant-factor approximation for the k-MST problem, the factor is 17. Subsequently, Garg [Gar96] gave a 3-approximation, Arya and Ramesh [AR98] developed a 2.5-approximation, Arora and Karakostas [AK00] proposed a (2 + ε)-approximation, and, finally, Garg [Gar05] published a 2-approximation algorithm for the k-MST problem. Chudak, Roughgarden and Williamson [CRW04] show that an easier 5-approximation also proposed by Garg [Gar96] bears resemblances to the primal dual algorithm by Jain and Vazirani [JV01] for the k-median problem, in particular to the utilization of Lagrangean relaxation. Connection to weighted k-MST. Johnson, Minkoff and Phillips [JMP00] observe the following reduction from the weighted k-MST problem to the unweighted k-MST problem, assuming all γ(v) are integers. To create the unweighted instance G′ = (V ′ , E ′ ), start with V ′ = V . Then, for any vertex v, add 2γ(v)n − 1 vertices at distance zero of v (thus, there are 2γ(n)n vertices ‘at’ v), and set k to 2nΓ. Any solution T for the weighted k-MST problem can be interpreted as a solution T ′ for the modified unweighted instance P with v∈V [T ] 2nγ(v) = 2nΓ vertices. Given a solution for the unweighted input, we can first change the solution thus that for any v ∈ V , either v ′ ∈ V ′ is not picked or v ′ is picked and its 2γ(v)n − 1 copies are picked as well. This is possible since picking more vertices at the same location incurs no additional cost. After this step, the solution can be transformed into a weighted solution with enough weight by picking the corresponding vertices in V . This reduction constructs an input for the unweighted k-MST problem that is of pseudo-polynomial size. Johnson et al. [JMP00] note that algorithms for the unweighted k-MST problem can typically be adapted to handle the clouds of vertices at the same location implicitly without incurring a super-polynomial running 44 time. They specifically state that this is true for the 3-approximation algorithm by Garg [Gar96] for the rooted k-MST problem. The more recent 2-approximation algorithm by Garg [Gar05] can also be adapted for the weighted case such that the running time remains independent of the weights [Gar16]. This yields a polynomial 2-approximation algorithm for weighted k-MST. B.3 Convergence It is easy to see that a straightforward execution of the local search algorithm discussed in this paper runs in pseudo-polynomial time, as each improving move decreases the potential at least by the length of the shortest edge. We apply a standard rounding technique to make the algorithm polynomial. Algorithm X 1. Set i := 0 and let A0 = T. 2. β := ε·max{v,v̄}∈T d(v,v̄) , |E| dβ (e) := l d(e) β m β. 3. While Ai admits an improving path/set swap w.r.t to φβ , or Improving-Connecting-Move finds an improving connecting move w.r.t. φβ , set Ai+1 to be the resulting solution after applying the move, and i := i + 1. 4. Return the solution A ′ obtained by dropping all inessential edges of Ai . Lemma 40. Assuming that the locality gap for swap-optimal and c-approximate connecting move optimal solutions is C, Algorithm X computes in polynomial time a (1 + ε)C-approximation to Steiner Forest. Proof. We first observe that the algorithms runs in polynomial time. To see this, first note that dβ (e) ≥ β for all e ∈ E. Therefore, every improving path/set swap and every successful run of Improving-ConnectingP Move decreases the potential by at least β, i.e., φβ (Ai+1 ) ≤ φβ (Ai )−β. As φβ (A0 ) = 2 {v,v̄}∈T dβ (v, v̄) ≤ we conclude that the algorithm terminates after at most 2 ntε|E| iterations, each of which can be executed in polynomial time. 2nt |E| ε β, Now consider the output A ′ of Algorithm X. As it is path/set swap optimal and c-approximately connecting move optimal w.r.t. dβ , our assumption on the locality gap implies that dβ (A ′ ) ≤ Cdβ (Fβ ), where Fβ is the optimal solution of the Steiner Forest instance defined by the metric dβ . Furthermore dβ (Fβ ) ≤ dβ (F ), where F is an optimal solution to the original Steiner Forest instance defined by the metric d. We hence observe that ′ ′ d(A ) ≤ dβ (A ) ≤ Cdβ (Fβ ) ≤ Cdβ (F ) = C · X  d(e)  e∈F ≤C· X  d(e) e∈F β  β β + 1 β ≤ C · (d(F ) + |F |β) ≤ (1 + ε)C · d(F ), where the last inequality follows from |F | ≤ |E| and d(F ) ≥ max{v,v̄}∈T d(v, v̄). Note that Corollary 37 asserts that we can choose C = 23(1 + c), and [Gar05, Gar16] yields that c = 2 is a feasible choice. Thus Lemma 40 yields a polynomial-time (1+ε)·69-approximation local search algorithm, proving Theorem 1. 45
8cs.DS
Optimal high-level descriptions of dynamical systems David H. Wolpert∗ [email protected] Joshua A. Grochow* [email protected] Simon DeDeo*† [email protected] Eric Libby* [email protected] arXiv:1409.7403v2 [cs.IT] 3 Jun 2015 June 4, 2015 Abstract To analyze high-dimensional systems, many fields in science and engineering rely on highlevel descriptions, sometimes called “macrostates,” “coarse-grainings,” or “effective theories”. Examples of such descriptions include the thermodynamic properties of a large collection of point particles undergoing reversible dynamics, the variables in a macroeconomic model describing the individuals that participate in an economy, and the summary state of a cell composed of a large set of biochemical networks. Often these high-level descriptions are constructed without considering the ultimate reason for needing them in the first place. Here, we formalize and quantify one such purpose: the need to predict observables of interest concerning the high-dimensional system with as high accuracy as possible, while minimizing the computational cost of doing so. The resulting State Space Compression (SSC) framework provides a guide for how to solve for the optimal high-level description of a given dynamical system, rather than constructing it based on human intuition alone. In this preliminary report, we introduce SSC, and illustrate it with several informationtheoretic quantifications of “accuracy”, all with different implications for the optimal compression. We also discuss some other possible applications of SSC beyond the goal of accurate prediction. These include SSC as a measure of the complexity of a dynamical system, and as a way to quantify information flow between the scales of a system. ∗ † Santa Fe Institute, 1399 Hyde Park Road, Santa Fe, NM, 87501 School of Informatics and Computing, Indiana University, 901 E. 10th St., Bloomington, IN 47408 1 Contents 1 Introduction 3 2 State space compression 2.1 The benefit of state space compression . . . . . . . . . . . . . . . . . . . . . . 2.2 Basic concepts and notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 5 3 Illustrations of our notation 8 4 Related work 9 4.1 Causal states & computational mechanics . . . . . . . . . . . . . . . . . . . . 9 4.2 State aggregation, decomposition, and projection methods . . . . . . . . . . . 11 4.3 Generally applicable accuracy costs . . . . . . . . . . . . . . . . . . . . . . . 13 5 Accuracy costs 14 5.1 Exogenously provided accuracy costs . . . . . . . . . . . . . . . . . . . . . . 14 5.2 Information-theoretic accuracy costs . . . . . . . . . . . . . . . . . . . . . . . 15 6 Computation costs 18 6.1 Defining computation cost in terms of X, Y, π, φ, and γ . . . . . . . . . . . . . 19 6.2 Computation cost measures based on theoretical computer science . . . . . . . 19 7 The full SSC objective function 20 7.1 The trade-off between accuracy cost and computation cost . . . . . . . . . . . 20 7.2 Heuristics for minimizing the SSC objective function . . . . . . . . . . . . . . 21 8 Applications of SSC – beyond improving prediction 22 8.1 A form of complexity motivated by SSC . . . . . . . . . . . . . . . . . . . . . 22 8.2 Using SSC to define information flow among scales of a system . . . . . . . . 24 9 Conclusions 25 2 1 Introduction Historically, scientists have defined the “level”, “scale”, or “macrostate” of a system in an informal manner, based on insight and intuition. In evolutionary biology, for example, a macrostate may be defined by reference to species count, despite a great degree of within-species diversity, fundamental dependencies between organisms, and complicated subunits such as tissues and cells which can also reproduce. In economics, the macrostates of the world’s socio-economic system are often defined in terms of firms, industrial sectors, or even nation-states, neglecting the internal structure of these highly complex entities. How do we know that these choices for the macrostates are the best ones? Might there be superior alternatives? How do we even quantify the quality of a choice of macrostate? Given an answer to this question, can we solve for the optimal macroscopic state space with which to analyze a system? This is the general problem of state space compression. Stated more formally, the first step in State Space Compression (SSC) is to specify a measure of the quality of any proposed map xt → yt used to compress a dynamically evolving “fine-grained” variable xt into a dynamically evolving “coarse-grained” variable yt .1 We will take a utilitarian approach in deciding what makes for a good compression of the dynamics of a system: state space compression has a practical benefit, and quantifying that benefit as an objective function drives our analysis. Given such an objective function and an evolving fine-grained variable xt , we can try to solve for the best map compressing xt into a higher-scale macrostate yt . The dynamics of such an optimally chosen compression of a system can be viewed as defining its emergent properties. Indeed, we may be able to iterate this process, producing a hierarchy of scales and associated emergent properties, by compressing the macrostate y to a yet higher-scale macrostate y′ . In this preliminary report we formalize and quantify one objective function for compressing a high-dimensional state: The need to predict observables of interest concerning the highdimensional system with as high accuracy as possible, while minimizing the computational cost of doing so. Many of the observables of interest that are theoretically and experimentally analyzed in the sciences are considered interesting precisely because they make good macrostates according to this objective function: we use them because they lower the resultant computation and measurement costs while still accurately predicting a given observable of interest. For instance, in physics, macrostates of a fine-grained system reference thermodynamic variables, such as temperature or pressure, that characterize relevant features which can be measured and used for accurate prediction of many observables of interest — at very little computation cost. Our objective function also provides several natural ways to construct a hierarchy of scales, extending from less-compressed spaces (higher computation cost but more accurate predictions) to more-compressed spaces (less computation cost but less accurate predictions). For example, we can use the values in the less compressed spaces to give (perhaps additive) corrections to predictions from the more compressed spaces. After introducing this SSC framework and relating it to other work in the literature, we illustrate it by investigating several information-theoretic quantifications of “accuracy”, all with different implications for the optimal compression. We end with a discussion of some other 1 Here we will use the term “coarse-graining” interchangeably with “compression”, and so will allow arbitrary coarse-graining maps. There is a large literature that instead interprets the term “coarse-graining” to refer to the special case where x is the spatial position of a set of N particles and we wish to map each x to the spatial position of m < N “effective particles”. See [97] for a review. There is also work that interprets the term “coarse-graining” to refer to the special case where x is a network structure, and we wish to map each x to a smaller network (see [55, 20]). For discussion of the general problem of coarse-graining for computational, cognitive, biological and social systems see, e.g., [68, 35, 36, 67, 37] and references therein. 3 possible applications of SSC, over and above the motivational one of improving our ability to predict the future. These include the use of SSC as a measure of the “complexity” of a dynamic system, and the use of it to quantify information flow among the scales of a system. 2 State space compression 2.1 The benefit of state space compression As mentioned, we adopt the view that the benefit of a candidate compression X → Y is to reduce the cost of computing the dynamics over X. More precisely, our job as scientists is to find a compression map π : X → Y, dynamical laws φ for evolution over Y, and a map ρ from Y to the observable of interest, such that the future values yt ∈ Y accurately predict the associated observable of interest (defined in terms of xt ∈ X), while the three maps π, φ, ρ are relatively easy to compute. Stated prosaically, we wish to simulate the dynamics of xt , using a simulation that optimally trades off its computation and measurement costs with its accuracy in predicting some observable of interest concerning future values of x. From the perspective of coding theory, we are using a lossy code to encode a system’s fine-grained state as an element in a (usually) smaller space, evolving that compressed state, and then using it to predict the observables of interest concerning the future fine-grained state. It is important to emphasize that in measuring the quality of a candidate π, φ, ρ we are often not interested in predicting a given microstate xt in toto. Instead, there are certain observables associated with xt that we are interested in reconstructing. An example of this is in studies of bird flocks, where we are often not interested in predicting where each individual bird is at some future time, but rather the location of the center of mass of birds. (See Ex. 1 below.) It is also important to emphasize that there are at least two general types of “accuracy” concerning our predictions of such observables such that we might be interested in. A key issue in many compressions is how closely the predicted observable of interest matches its actual value. In such cases, it makes sense to use a distance measure over the values of the observable to quantify the accuracy of predictions. When we are not provided such a distance measure exogenously, it may make sense to use an information-theoretic measure, e.g., a variant of mutual information [27, 77]. There are other cases though where we are interested not in how accurately a prediction based on a particular yt matches a truth based on the associated xt , but rather in how accurately the entire distribution over (predictions based on) yt matches the associated distribution based on xt . (For example, this is the case when we are interested in accurately predicting future expectation values, or managing measures of risk such as expected variance.) In these situations a measure like Kullback-Leibler (KL) divergence may be most appropriate. In this paper will be concerned with the prediction of the entire future evolution of a system, rather than a value at a single, particular moment in the future. This reflects the fact that typically we are interested in future behavior, which is an inherently multi-timestep phenomenon. By requiring that the compression / decompression accurately reconstructs the time-series as a whole, we ensure that it captures the dynamics of the system. In addition to SSC’s role in the sciences, where it is often implicitly a central issue in how we choose to analyze a nature-given system, in engineering the problem of optimal design of a system will very often reflect the tradeoffs considered in SSC. So results concerning SSC might be helpful in such design — or benefit from what has been learned about such design. An obvious example of this central role of SSC’s tradeoffs in engineering is in the design of 4 predictive coding algorithms, e.g., for compressing movies so that they can be streamed across the internet to an end-user with minimal bandwidth requirements while still maintaining high fidelity (as perceived by that end-user). Another example occurs in CPU design and the problem of branch prediction. In modern CPUs, whenever a conditional “if-then-else” statement is encountered, the CPU first guesses— based on certain heuristics and a record of previous branches—which branch of the conditional to take. It starts speculatively computing as though that branch were taken; if it later discovers that it guessed wrong, it terminates the speculative computation and continues along the correct branch, having incurred a delay for guessing incorrectly. We see here the tradeoff between accuracy and computation cost: it only makes sense to do branch prediction if there is a computationally efficient predictor that is correct most of the time. In any other case, branch prediction would end up wasting more CPU cycles than it saves. Branch prediction is enormously successful in practice, partly because, based on the prior distribution of how most people (or compilers) write and use conditional statements, relatively simple heuristics give (almost shockingly) accurate results. Interestingly, some of the best branch predictors are in fact based on (very) simple models of neurons, as suggested in the discussion below (see, e.g., Ref. [58]). In many cases, maps x → y that are good compressions of a dynamical system in the sense just outlined have the property that the dynamics of yt is (first-order) Markovian. (Indeed, as mentioned below, obeying exactly Markovian dynamics is a core component of the definition of a “valid compression” considered in [104, 46, 45, 57].) Even if the best compression is not Markovian, so long as we are considering a good compression of xt into yt , once we set the initial value of y often we can well-approximate the future values of yt with a Markovian process, with little further information needed from later xt to correct that dynamics. (As discussed below, this is the desideratum defining “good compression” considered in [54, 53, 89].) For these reasons, we often restrict attention to compressed spaces whose associated dynamics are Markovian. This is not a requirement of SSC however. Finally, we note that compressing the state space of a system to reduce computation cost while maintaining predictive accuracy is not only a core requirement of how human scientists and engineers build their models of physical systems. It is also often a core requirement of those systems themselves. In particular, it is a guiding principle for how the human nervous system operates. Computation is very costly for a biological brain, in terms of heat generated that needs to be dissipated, calories consumed, etc. Moreover, at an abstract level, the (fitness-function mediated) “goal” of one’s senses and the associated computational processes in the brain is to produce a compressed description of the environment that the brain then uses to produce accurate predictions of the future state of certain fitness-relevant attributes of the environment all at minimal caloric cost [25, 66, 100].2 So in “designing” the human brain, natural selection is faced with the precise problem of optimal state space compression as we have formulated it. This suggests that we may be able to construct powerful heuristics for optimal SSC by considering how the human nervous system processes information. 2.2 Basic concepts and notation Throughout this paper we adopt the convention that upper case variables indicate either a space or a random variable defined over that space, with the context making the meaning clear; lower case variables indicate elements of a space or values taken by a random variable, again with 2 Recent work has suggested that biological individuality itself—cells, organisms, species—may be understood as the emergence of new coarse-grained partitions over the biochemical world [67]. 5 the context making the meaning clear. We also adopt the convention of letting the context make clear whether we are talking about a probability distribution or a probability density function, the associated meanings of conditional distributions, and other standard conventions from probability and statistics. In addition, the measures of the integrals we write will all be implicitly matched to the associated space. So when we use the integral symbol for a countable space, we are implicitly using the counting measure, turning that integral into a sum. Formalizing the issues discussed in Sec. 2.1 leads to the following definitions. The first four are specified exogenously by the problem being studied: 1. The microstate x ∈ X, which evolves in time according to a stochastic process P(xt , . . . ), which in particular specifies a prior distribution over the value of x at a current time t0 ; 2. A space of possible values of an observable of interest Ω, and an associated observation conditional distribution O(ω ∈ Ω | x), which may be deterministic.3 3. A (typically) real-valued accuracy function C : Ω × Ω → R—usually a metric— quantifies how good a predicted value is compared to the true observable; 4. A weight function W(t) used to determine the relative importance of predictions for the observable at all moments in the future. When dealing with stochastic processes one may have a distribution over predictions as opposed to a single prediction at each time step. In this case, it may make sense to replace (3) with a function that gives some sort of measure of the difference between two probability distributions over Ω, rather than the difference between two points from Ω. The remaining three objects are chosen by the scientist, possibly, as we suggest here, by SSC optimization: 5. A macrospace or compressed space Y, with elements y, called macrostates, that evolve according to a stochastic process φt,t0 (yt | yt0 ); 6. A compression distribution, π(y | x), which compresses x to y (and may be a deterministic function); 7. A prediction distribution ρ(ω ∈ Ω | y) which gives the prediction for the observable based on the compressed state y. Although there may be many applications in which the dynamics of the microspace and/or the macrospace are first-order Markovian, we do not require this. Furthermore, we also do not require φ and P to be time-homogeneous. We will sometimes refer to the compression distribution as an “encoding” distribution, and refer to the prediction distribution as a “decoding” distribution. We will typically apply the metric C on the observable space to compare the distribution ρ(ω | yt ) with the distribution O(ω | xt ). As an example of a microstate process, there could be a time-homogenous Markov chain with generator p, set by Nature, and a marginal distribution at time 0, P(x0 ), set by a scientist 3 In addition to allowing stochastic dynamics, whenever it was natural to use a function f : A → B between two spaces, we instead use the more general setting of a conditional distribution d f (b|a). 6 (albeit implicitly). The scientist may want to predict the future of the system, the a priori probability, with initial condition x0 . In this case the full Markovian process is given by P(x0 , x1 , . . .) = P(x0 )Π∞ t=1 p(xt | xt−1 ) (1) Three terms will contribute to our overall state compression objective function. The first is the average future value of the accuracy function, evaluated under W(t). We call this the accuracy cost. The second term is the average future computation cost of iterating both φ and ρ. The third term is the cost of evaluating π once—or otherwise performing a measurement, e. g., of the physical world—to initialize y. Although for simplicity we include this in the computation cost, in general it is just a quantification of mapping an initial x to an initial y. This may have nothing to do with “computation”, per se. For example, it may reflect a process of physically measuring an initial value x, with a noisy observation apparatus producing a value z ∈ Z according to a distribution P(z | x), where the observed initial value z is then mapped to the starting R value of our simulation via a distribution P(y0 | z) that we set. In this case π(y | x) = dz P(y0 | z)P(z | x), where P(z | x) might be more accurately described as a “measurement cost”. Whenever we write “computation cost,” it should be understood in this more general manner. Unless specified otherwise, we take the weight function W(t) to be a probability distribution over t. A particularly important type of W(t) is a simple future geometric discounting function, W(t) ∝ [1 − γ]t . This is often appropriate when there is a priori uncertainty on how far into the future the scientist will end up running the computation.4 As alternatives, we could consider the (undiscounted) average accuracy cost and average computation cost over some temporal window t ∈ [0, T ]. Another alternative, for computations known to halt, is to consider the average of those two costs from t = 0 to the (dynamically determined) halting time. Formally, this means extending the definition of W to be a function of both t and yt . We, the scientists, are provided the original stochastic process P(xt′ | xt ) and determine the observable O and weight function W(t) that capture aspects of the system that interest us. Our task is to choose the compression function π, associated space Y, compressed state dynamics φ, and prediction map ρ to the space of observables, such that π, φ, and ρ are relatively simple to calculate, compared to the dynamics of xt directly, and the resultant accuracy costs are minimal (e. g., the resultant predictions for O(xt′ ) for t′ > t are minimal distortions of the true values). The best such tuple {π, Y, φ, ρ} is the one that best trades off the (average) quality of the reconstructed time series with the costs of implementing π and calculating the dynamics of yt . In essence, a good state compression is like a good encoding of a video movie: it produces a compact file that is simple to decode, and from which we can recover the characteristics of the original movie that the human user is attuned to, with high accuracy. SSC is a general framework, and its use requires that we make explicit choices for things such as the accuracy and the computation costs. Rather than provide discipline-independent prescriptions, we emphasize that the problem at hand should determine the choices adopted for the various terms described. For example, one would expect that quite often using several different accuracy costs would all provide physical insight into what is truly driving the dynamics across X. So in practice, it may be beneficial to consider several accuracy costs, not just one. 4 Also see the literature on decision theory, where geometric discounting with a constant γ is justified as necessary to maintain consistency across time in how a decision-maker makes a decision, and especially the literature on reinforcement learning and dynamic programming [114]. 7 3 Illustrations of our notation In this section we present several high-level illustrations to help clarify the meaning of our notation and to give an indication of how SSC could be applied in various settings. Example 1. Consider a flock of N labelled birds exhibiting coordinated flight [18, 3, 26]. The mass of each bird is fixed. The microstate of the flock, x, is the phase space position of the flock, i.e., the positions and velocities of all N birds; in particular, the space of microstates is then X = (R3 )2N . The stochastic dynamics P(xt | x0 ) of the microstate is given by some bird-level rule governing how each bird’s acceleration is determined by its current position and velocity as well as the positions and velocities of other birds in the flock. For the purposes of this example, we assume that higher-order derivatives of the positions of the birds—e.g., their accelerations—are not relevant if we know the positions and velocities of all the birds. Suppose we are interested in predicting the center of mass of the flock at all future times; thus our observable space Ω will be R3 , corresponding to the center of mass, and the observation conditional distribution O(ω | x) is a deterministic function O : R6N → R3 giving the center of mass. We take as our accuracy cost C : Ω × Ω → R the Euclidean distance between two points in Ω = R3 . One way to successfully predict the position of the center of mass is to evolve the stochastic dynamics of the microstate. This may be computationally challenging for large N since X = R6N . As an alternative, a successful state space compression of the microstate dynamics would be a map from the high-dimensional vector x to some other much smaller-dimensional vector of “sufficient statistics”, y, such that we can easily and accurately compute the evolution of y into the future and at each future moment t recover the center of mass of the flock from yt . For example, it may be that due to the details of the microstate dynamics, a macrostate y comprising the R3 × R3 × (R3 )3 = R15 vector {Position of the center of mass of the flock; Momentum of the entire flock; Components of a Gaussian ellipsoid fit to the shape of the flock}, can be easily and accurately evolved forward in time, without concern for any other information in x not reflected in those fifteen real numbers. Since one component of this particular y is precisely the quantity we are interested in (i.e. the position of the flock’s center of mass), we can recover this information from yt with ρ : Y → Ω which in this case is a projection. Since (by hypothesis) the evolution of y is accurate, this is a good state compression, with a small combined value of the computation cost of the dynamics of Y and the Euclidean error of the prediction of the center of mass. Example 2. Consider an agent-based simulation of the behavior of N humans in a set of interacting firms in an economy evolving in real time, where each player has time-varying observational data concerning the history of the entire economy and a (time-varying) set of endowments. The microstate x at each moment is the set of associated observation vectors and endowment sets of each of the N players. Let the dynamics of the system be a set of stochastic rules for each of the players describing what move it makes at each moment as a function of its current observation vector and endowment set. Say that what we are interested in is the total GDP of the economy specified in x, and in particular with how that GDP depends on some exogenous parameter of the system that an external regulator can set. We take the space of observables Ω to be R≥0 , representing the total GDP, and the observation map O(x) to be the total GDP of the economy specified by x. We 8 take the accuracy function C : Ω × Ω → R to be the absolute value of the difference between the simulated and actual GDP. Even if we posit a precise microscopic stochastic dynamics xt , and therefore how GDP depends on the exogenous parameter, it may be very challenging to calculate the GDP for any particular value of the exogenous parameter.. On the other hand, depending on the details of the microscopic rules for how the agents behave, it may be that we can coarse-grain X into a compressed space Y that specifies only the current state of each of the firms—not any individuals within the firms, or non-firm individuals— and that we can both evolve y ∈ Y accurately and then infer the GDP at each time t very accurately knowing only yt . In this case the coarse-graining of the economy into characteristics of the firms in the economy is a good compression of the state space of the economy. However it may be that this state compression does not work well, giving large expected error for the prediction of future GDP. It may be that some other state compression, e.g., that couples the states of players from multiple firms at once, results in better predictions. In this example, if we could find that better compression, it would provide major insight into what drives the evolution of the economy. Working with often highly restricted classes of π’s and φ’s this is the aggregation problem of economics [23, 49]. Example 3. Consider a cylinder of fixed dimensions with a moveable partition separating it into two half-partitions, with an ideal gas on each side of the partition. Let z be the position of the partition. Our microspace X will thus be the space of configurations of the particles in each of the ideal gases, together with the position z of the partition. Assume that at some time t0 the partition has a pre-fixed value of z, and there is a pre-fixed temperature and pressure of the two ideal gases, with higher values of both in the ideal gas lying above the partition, at higher values of z. Assume that at time t1 the partition starts sliding towards smaller values of z at a very slow (essentially adiabatic) constant and pre-fixed rate, stopping when the system reaches equilibrium. Suppose, however, that we do not know t1 ; it is instead distributed according to a Gaussian distribution centered about some particular time. Let the observable of interest be the temperatures and pressures of the two ideal gases; the observable space Ω is thus R4≥0 (with temperatures in Kelvin). We take our accuracy function C : R4≥0 × R4≥0 → R to be Euclidean distance, for simplicity. Consider the compressed space Y which consists only of the position z of the partition. In this case, given the current value yt , we can perfectly predict the future values yt′ with t′ > t, i. e., the future positions of the partition, since we know the rate of movement of the partition. In turn, because we know the dimensions of the cylinder and the initial temperatures and pressures of the two ideal gases, we can calculate the temperatures and pressures of the two gases at time t using knowledge of the position of the partition. That is, the prediction map ρ : Y → Ω computes the pressures and temperatures of the two ideal gases based solely on the position of the partition. (The “knowledge” of the initial values of the temperatures and pressures are built in to the map ρ, but ρ itself is just a function of z, since that is all that is present in the compressed space Y.) So in this case, the compression map π : x → y = z is perfect, in that it allows perfect prediction of the future states of the observables that we are interested in. 4 Related work 4.1 Causal states & computational mechanics While the basic idea of coarse-graining has a long history in the physical sciences, so has the recognition of the troublingly ad hoc nature of many coarse-grainings used in practice [31]. 9 Ref. [32] was an important early analysis of this issue, introducing the notion of causal states, with the associated mathematics known as computational mechanics [29]. Causal states have been the workhorse of a extensive body of of work over the last thirty years; for a recent review, see Ref. [30]. To illustrate the central idea, suppose we are given an ergodic and stationary stochastic process generating bi-infinite time-series’ of the form {. . . , s−1 , s0 , s1, . . .}. An associated causal state at time 0 is a maximal set ǫt of “past” semiinfinite strings s0← ≡ {. . . , s−1 , s0 } such that the probability distribution of any particular “future” semi-infinite string, s0→ ≡ {s1 , s2, . . .} conditioned on any member of ǫt is the same. So all past semi-infinite strings that are in the same causal set result in the same distribution over possible future semi-infinite strings. In the sense that it is maximal, a causal state is an optimal compression of the original time-series when our goal is perfect knowledge of the future. The dynamics of the causal states is given by a (stationary, ergodic) unifilar Hidden Markov Model, which is called an “ǫ-machine”. Any ǫ-machine fixes an associated stationary distribution over its causal states. The statistical complexity of the machine is defined as the entropy of that distribution over the causal states. There are several ways one might try to interpret computational mechanics in terms of SSC. Neither the dynamics of the variable st , nor that of the causal states, can be exactly identified with the dynamics of SSC’s fine-grained space. However because causal states are optimal predictors of the future, the only information they discard is that which is irrelevant to future prediction. This would suggest that we identify the causal states with a coarse-graining close to, but not necessarily identical with, SSC’s fine-grained space. An alternative interpretation is to identify each past semi-infinite string st← as a fine-grained state xt of SSC. In particular, since any such string fixes the associated causal state ǫ(s0← ), it fixes the distribution over the sequence of future causal states, and therefore the distribution over all ′ of the subsequent past strings, st←>t . Under this interpretation of computational mechanics, the next value s1 can be viewed as ω0 , a (noisy) observation of x0 , and the causal state ǫ(s0← ) can be seen as y0 , a compression of x0 . Note though that this interpretation of an ǫ-machine always results in an SSC scenario where X is infinite, the dynamics over xt is ergodic and stationary, and every xt+1 is uniquely determined by (xt , ωt ). It does not provide a way to relate other kinds of SSC scenario to computational mechanics. Refs. [104, 102] analyze ergodic and stationary bi-infinite strings in terms of ǫ-machines, treating statistical complexity as a term in an objective function, V. If we adopt the second interpretation of computational mechanics in terms of SSC suggested above, then the role of statistical complexity in V is loosely analogous to the role of the compression term involving π in the computation cost of SSC’s objective function. Note though that the term in SSC’s objective function based on the computation cost of iterating φ has no obvious analogue in V. In addition, the analysis in [104, 102] does not consider exogenously specified accuracy costs / observation operators. Nonetheless, the similarity between the work in [104, 102] and SSC suggests that we can extend computational mechanics by coarse-graining causal states. Such a coarse-graining would mean that we no longer have maximal predictive power. However it may result in a more than compensating reduction in computation cost. Several papers [103, 28, 112] have suggested using the information bottleneck method [116] to coarse-grain causal states this way, to reduce the complexity of an ǫ-machine representation. Ref. [111] provided a thermodynamic account of this process, and Ref. [79] provides the first explicit treatment for ǫ-machines based on timeseries data; this latter reference found, among other things, that it was generally more accurate to derive these coarse-grained machines from more fine-grained models, rather than from the data directly. 10 This new work quantifies accuracy as the average KL divergence between the optimal prediction of the future distribution, and that made using a coarse-graining over causal state. (See the discussion at the end of Sec. 5.2.3 involving KL divergence as an accuracy cost.) The goal is to optimize that accuracy given a constraint on “coding cost” (measured by the mutual information between the new, coarse-grained causal states and the future distribution). The objective function then becomes (Ref. [28, 112]) a linear combination of coding and accuracy costs, which using the notation of that paper can be written as a minimization of ← − → − L(β) = I[ X ; R] − βI[R; X ], (2) where β provides a single parameter to govern the trade-off between coding costs. By optimizing this objective function we find the “internal states”, R (similar to the compressed states Y → − of SSC), that are as predictive as possible of the future, in that I[R; X ] is large, while at the same time minimizing the coding cost. The “memory cost”, loosely analogous to SSC’s computation cost, is the first term of L(β), ← − I[ X ; R]. It measures the coding costs of a soft-clustering of the original causal states; i.e., a probabilistic map between the original causal states and the coarse-grained space R. One can also imagine a hard clustering (i.e., a deterministic many-to-one map) from the original space; in this case, the coding cost reduces to H(R), the statistical complexity of the new machine. The second term of L(β) is analogous to the accuracy cost of SSC. In Eq. 2, we maximize mutual information between the model state and the semi-infinite future; considering all future times of equal prior importance is common choice [19, 111, 119]. The more general approach is to consider a weight, W(t), that would make, for example, the near-term future more important to predict than times that are more distant. In contrast, as described below, in SSC’s use of mutual information as an accuracy cost, we iteratively evolve the coarse-grained state further and further into the future, and at each iteration evaluate the mutual information between the coarse-grained state at that moment and the fine-grained state at that moment. 4.2 State aggregation, decomposition, and projection methods As early as 1961 [107], one finds discussions of the tradeoff between accuracy cost, the computation cost of a compressed model, and the cost of finding a good compressed model– precisely the three costs we consider.5 This led to studies of aggregating or “lumping” the states of Markov chains in order to construct compressed (in our language) Markov chains [5, 107, 23, 49, 118]. Since some systems do not admit any good aggregations, the limitations of aggregation and lumpability methods have recently been fleshed out [64, 65]. The “finite state projection method” (FSP) [85, 84] is a similar method, developed to map a microstate of a chemical reaction network evolving according to a chemical master equation to a compressed version to speed up simulation of the evolution of that network. Though designed for evolving such reaction networks, the FSP is applicable whenever the set of possible microstates X is countable and the stochastic process generating xt is a Poisson process. The idea behind the FSP is to select a large subset X ′ ⊂ X and group all the states in X ′ into one new, absorbing state. The stochastic process rate constants connecting the elements of X \ X ′ and governing the probability flow from X \ X ′ into X ′ are not changed. The goal is to choose X ′ to be large and at the same time to have the total rate of probability flowing from X \ X ′ into 5 Where we include in the “computation cost of a compressed model” the initial cost of compressing a finegrained state into a compresed state. 11 X ′ be small. While somewhat ad hoc, the FSP has been found to work well in the domain for which it was constructed. These same three costs are also important in control theory and reduced-order modeling [81, 76, 83, 123, 51, 24, 4, 98, 12, 1, 39, 7]. However typically in this work and the aforementioned working on lumpability and FSP the computation cost of the compressed (“reduced”) model is not included in the objective function being optimized, and when it is considered it is typically replaced with the simple proxy of the dimension of the compressed space. It is probably true that in general this dimension is not a bad proxy for computation cost. However there are many specific cases where the actual cost of running the computation in the reduced space would differ considerably from what one would expect based on the dimension of that space. For example, much of this work in control theory restricts itself to computations in the compressed space that work by (local) linear transformation. One would expect that the dimension of the compressed space is often a poor proxy to the computation cost for such computation, for certain sparsities, ranks, and condition numbers of the reduced system — actual computation cost might be smaller with a slightly higher-dimensional compression whose dynamics is significantly sparser, compared to a lower-dimensional but dense one. There are many other properties that might affect the computation cost of evolving the compressed system, both in theory and in practice. As far as we are aware, these issues have not been considered in any great depth. While focusing on accuracy cost as aggregation methods do, reduced-order modeling has typically considered algorithms of the following sort (see the above-referenced books and surveys for details). First we compute a subspace of the fine-grained space that we believe captures key features of the dynamics. Typically this is done by performing a variant of the Singular Value Decomposition (SVD - which often goes by the alternative names of “principal component analysis”, “proper orthogonal decomposition”, or “Karhunen–Loeve expansion”) and then choosing the most significant singular directions (corresponding to the largest singular values in the SVD). There is some art in choosing how many directions to project onto, but often a sharp drop-off is observed in the singular value spectrum, and it is this cutoff that is chosen. This somewhat ad hoc, though well-motivated, choice of cutoff is essentially the only place that there is even an implicit concern for the computation cost of the evolving the reduced system. (Balanced truncation [81, 63, 62, 8, 70] offers a more principled way to select the cutoff, or “truncation,” point, but still does not explicitly take into account the computation cost of the compressed model.) However we choose the subspace, the next step is to project the dynamics over the fine-grained space onto this subspace (“Galerkin projection”) and then run the associated (linear) dynamics. Other methods have also been proposed, under the umbrella term of Krylov iteration, that can frequently make it easier to solve for the optimal compression (again, in terms of accuracy cost), using iterative methods rather than computing the SVD directly. But the end goal, and the way in which accuracy and computation cost of the reduced model are taken into account, are essentially the same in the pure SVD-based methods. More recently, so-called local SVD (or POD) methods have been proposed [88], in which a model is built as above, but instead of being a model of the whole space, it is only designed to model a local portion of the state space. Many local models are then “glued” together, for example, by training a classifier (using standard techniques from machine learning) to decide which of the local models should be used at any given point or trajectory. Yet another set of approaches is the Mori–Zwanzig family of methods [83, 123]. These are most naturally viewed as an expansion of the (fine-grained) dynamics in terms of time, truncating the expansion beyond a certain number of steps in the past. However the survey of 12 Beck, Lall, Liang, and West [12] emphasizes the close relationship between Mori–Zwanzig and the methods of reduced-order modeling discussed above. Polynomial chaos, used in uncertainty quantification, also has a similar flavor: at a high level, it involves expanding in terms of certain nice polynomials and then truncating this expansion.6 Israeli and Goldenfeld [54] also consider the relationship between coarse-graining and the computational cost of prediction, in the context of cellular automata. They consider certain spatial coarse-grainings, which are required to “commute” with the micro-dynamics, in that if one evolves the microdynamics and then coarse-grains, this gives the same result as coarse-graining first and then and evolving the coarse dynamics. They show that even this highly restricting class of compressions of cellular automata can make certain “computationally irreducible” automata easier to predict. They generally measure ease of prediction by a qualitative measure: for example, certainly the CA became easier to predict if it was initially Turing-complete, but the compressed version is not. It would also be natural in this setting to provide a more quantitative measure of “ease of prediction.” However, in addition to only considering a limited class of coarse-grainings, they also do not consider an exogenously specified accuracy cost. Rather, they consider any valid coarse-graining of a CA to be giving some information about (the dynamics of) that CA. Despite these qualifications, this is nonetheless a particularly interesting result suggesting that even limited kinds of state-space compression can be successful in reducing the computational cost of prediction. We suspect that all of these methods will prove useful in certain instances of state-space compression. However it is not immediately obvious how to incorporate more general (or more nuanced) notions of computation cost directly into these methods. 4.3 Generally applicable accuracy costs Another thread of work has tried to define whether a map xt → yt is a “valid” compression, without trying to rank such maps or find an optimal solution. For example, the work in [46, 45, 57, 41, 40] starts with the set of four variables x0 , y0 , xt and yt , where t is some fixed value greater than 0, and y0 is produced by applying a proposed compression map to x0 , while yt is produced by applying that same map to xt . It then considers yt to be a valid compression of xt if the associated dynamics yt is (first-order) Markovian. The work in [54, 53, 89] is also concerned with these four variables, x0 , y0 , xt and yt . Here the stochastic relationship of these four variables is used to assign a real-valued quality measure to the map xt → yt , rather than specify whether it is (not) a valid compression. This quality measure is based on the amount of extra information that is needed from x0 , in addition to the value y0 , for us to accurately predict yt . One difference between this work and SSC in that this work does not take computation or measurement cost into account. In [121], optimal compression was implicitly defined in terms of how accurately a compressed description of a system could predict the fine-grained description. Related work in [122] implicitly defined optimal state compression in terms of how different probability distributions were at coarse-grained and fine-grained scales. As with the works discussed above, these works do not consider computation cost, at least not directly. These previous studies related to state compression makes compelling points, and generally accords with intuition. However one striking feature of this previous work is that none of it considers what a state compression of a fine-grained dynamics xt is for. As a result, some 6 Technically, polynomial chaos does a compression of a probability distribution on the fine-grained space, rather than compressing the fine-grained space itself. But this compression of the probability distribution is still implemented in terms of truncating an expansion. 13 aspects of this earlier work makes no sense from an SSC perspective when applied in certain scenarios. For example, if yt is just a constant, not evolving in time, then the dynamics yt is perfectly Markovian, of first-order. So this state space compression, x → constant, is a “valid” compression, according to some of this earlier work. Similarly, suppose that extra information from the fine-grained value x0 cannot provide extra help in predicting the future value yt beyond just knowing y0 . This would imply that extra information about xt cannot provide extra help in predicting the future value yt beyond just knowing y0 . It might seem that in this case x → y should be deemed a “good” state compression. After all, if extra future information about future fine-grained states xt cannot help us predict future compressed states, then dynamics in the compressed space is “autonomous”, essentially independent of xt . This is the motivation for much of the analysis in [89], for example. However this reasoning differs in important ways from the motivations of SSC. In particular, say we used this reasoning to argue along with [89] that we have a good state space compression π : x → y if the conditional mutual information I(yt ; x0 | y0 ) is small, i.e., if knowing x0 does not help us predict yt any more than knowing y0 does. With this criterion, we would say that the compression map that sends x to a uniformly noisy value of y, which is statistically independent of x, is a “good state space compression”; it results in I(yt ; x0 | y0 ) = 0. In contrast, most SSC objective functions would not assign a high value to such a π . There are also important features of SSC’s focus on the full compression / decompression loop that are absent from this earlier work. For instance, the earlier work considers only the compression π, with no associated “decompression” map ρ that maps Y to an observable of interest. In contrast, we consider the case where one is interested in “decompressing” future values of y, to make predictions of observable functions of xt . In addition, this earlier work assumes that future values of yt are obtained by iteratively applying π to xt . Instead, we allow dynamics in yt to evolve according to an arbitrary map φ from an initial value y0 = π(x0 ). This means that rather than just assign value to a compression map π, we assign value to a triple (π, φ, ρ).7 5 Accuracy costs In this section, we show how one can quantify accuracy cost (i. e., negative reconstruction accuracy). We do this both when an accuracy function is exogenously provided, and when it is not — in which case it may make sense to use an information-theoretic accuracy cost. 5.1 Exogenously provided accuracy costs We begin with an example of accuracy cost appropriate for the case that the dynamics are Markovian. Z Z E (π, φ, ρ; P) ≡ d∆t dx0 dx dω dy0 dy dω′ ∆t>0 W(∆t)P(x0 )π(y0 | x0 )P∆t (x | x0 )O(ω | x)φ∆t (y | y0 )ρ(ω′ | y)C(ω, ω′ ) (3) 7 To state this more formally, note that in this earlier work the Bayes net relating the four variables is P(yt | xt )P(y0 | x0 )P(xt | x0 ). In contrast, the Bayes net relating those four variables in SSC is P(yt | y0 )P(y0 | x0 )P(xt | x0 ). This difference reflects the fact that this earlier work is ultimately concerned with different issues from those central to SSC. 14 In the integrand, C(ω, ω′ ) is the cost if our simulation using the compressed space predicts that the observable has the value ω′ when it is actually ω. ρ(ω′ | y) is the distribution (typically a single-valued function) for how we convert the state y of the compressed space into such a prediction of the value of the observable. φ∆t and P∆t are the first-order Markov chains of our simulation over the compressed space, and of the actual fine-grained system state, respectively. π is the distribution by which we compress the initial state of the fine-grained state, and finally, P(x0 ) is the a priori probability that we will be interested in simulating the fine-grained system that starts in state x0 . Several variants of Eq. (3) for accuracy cost are possible, even in the Markovian case. For example, one might be interested in a worst-case accuracy cost over the initial states, rather than an average. More generally, if the fine-grained dynamics and/or our simulation are not first-order Markovian, then Eq. (3) would have to be modified accordingly. (We don’t present that modification here because in general it can be very messy.) 5.2 Information-theoretic accuracy costs If an accuracy function C is not supplied and is not obvious to construct, it may be appropriate to replace Eq.(3) with an information-theoretic definition of accuracy cost. Similarly, if in the problem at hand it’s more natural to compare the distribution over values of predicted observables with the distribution over values of actual observables, then again a (different) information-theoretic definition of accuracy cost may be appropriate. We consider both of those variants of Eq.(3) in the rest of this subsection. 5.2.1 Accuracy cost based on mutual information for two time-steps We begin by focusing on the special case in which there are only two time steps, t0 and ∆t. Suppose that we know ω′∆t and want to treat that value as a prediction of ω∆t . A natural informationtheoretic measure is the mutual information between the predicted value of ω′∆t ∈ Ω made after state compression and the actual future value of the observable ω∆t , generated by the Markov process P over X and the observable distribution O. Although intuitively straight-forward, the fully formal equation for this accuracy cost is a bit complicated. This is because the random variables whose mutual information we are evaluating are coupled indirectly, through an information channel that goes through the time-0 conditional distribution π. Writing it out, this accuracy cost is: E∆t (π, φ, ρ; P) = −IPπ,φ,ρ;P (Ω′∆t ; Ω∆t ) (4) where the negative sign reflects the fact that large mutual information corresponds to low misfit C, and where the joint probability Pπ,φ,ρ;P(ω′∆t , ω∆t ) defining the mutual information at time ∆t is given by the marginalization Pπ,φ,ρ;P(ω′∆t , ω∆t ) ≡ Z dx0 P(x0 )Pπ,φ,ρ;P(ω′∆t , ω∆t , x0 ) (5) where Pπ,φ,ρ;P(ω′∆t , ω∆t , x0 ) is defined as Z dy0 dy∆t π(y0 | x0 )φ(y∆t | y0 )ρ(ω′∆t | y∆t )P(x∆t | x0 )O(ω∆t | x∆t ). (6) 15 Intuitively, the distribution Pπ,φ,ρ;P(ω′∆t , ω∆t , x0 ) couples ω′∆t and ω∆t by stochastically inferring y∆t from ω′∆t , then “backing up” from y∆t to y0 and on to x0 , and finally evolving forward stochastically from x0 to get an x∆t and thereby ω∆t .8 When there is no exogenously specified observable, we may simply take the microstate to be the observable, and ask about the mutual information between the future microstate and the future macrostate. This is essentially why mutual information has been used in other work related to SSC [104, 102, 54, 53, 89]. However our information-theoretic accuracy cost should be distinguished from these other information-theoretic costs in temrs of which mutual information is considered, and what it is conditioned on. In [89] the analogous accuracy cost, defined for the values of a process at a pair of times t0 and t1 > t0 , is the conditional mutual information I(Y∆t ; Xt0 | Yt0 ). Although there are scenarios in which both this cost and the cost E∆t (π, φ; P) in Eq. (4) are minimal,9 there are also scenarios in which the cost I(Yt1 ; Xt0 | Yt0 ) achieves its minimal value even though the cost E∆t (π, φ; P) is maximal. For example, the latter occurs if π is pure noise, so that dynamics in y implies nothing whatsoever about dynamics of x.10 5.2.2 Accuracy cost based on mutual information for more than two time-steps The natural extension of Eq. (4) to multiple times is Z E (π, φ, ρ; P) = d∆t W(∆t)E∆t (π, φ, ρ; P) Z = − d∆t W(∆t)IPπ,φ,ρ;P (Ω′∆t ; Ω∆t ) (7) with Pπ,φ,ρ;P(ω′∆t , ω∆t ) defined as in Eq. (5) for all values of ∆t. However, the following example illustrates a subtle but important problem with this formula: Example 4. Consider a discrete-time system with X = {0, 1} with dynamics P(xt+1 | xt ) = δxt+1 ,xt , and let Y = X but with non-stationary dynamics that swaps the two values at every time step. Suppose π : {0, 1} → {0, 1} is the identity map. Then at the initial time t0 , the map ρeven : Y → X defined by ρeven (0) = 0 and ρeven (1) = 1 is a perfect predictor of xt0 from yt0 ; indeed, this same predictor works perfectly at every time that is an even number of steps from t0 . At those times t that are an odd number of steps from t0 , xt can still be perfectly predicted from yt , but now by a different map ρodd : Y → X, which swaps the two values (ρodd (0) = 1 and ρodd (1) = 0). In such a situation, mutual information is maximal at all moments in time. However, there is no single, time-invariant map ρ that allows us to interpret yt as a perfect prediction for the associated xt . One way to resolve this problem is to modify that accuracy cost to force the prediction map from Y to Ω to be time-invariant. To state this formally, return to the motivation for using 8 By the data processing equality, including ρ in this definition cannot increase the associated mutual information, and arguably it should be removed, as essentially spurious. That would result in a mutual information between Y and Ω, not between Ω′ and Ω. For pedagogical simplicity though, here we look at the mutual information involving Ω′ , the prediction made via ρ. 9 For example, this occurs if all of the conditional distributions π, φ and P(x∆t | x0 ) are deterministic, measurepreserving functions, so that the dynamics in y uniquely specifies dynamics in x. 10 This distinction between these two measures reflects the fact that they are motivated by different desiderata. The cost I(Y∆t ; Xt0 | Yt0 ) is motivated by the observation that if it is zero, then there is no extra information transfer from the dynamics of X that is needed to predict the dynamics of Y, once we know the initial value yt0 , and in this sense dynamics in Y is “autonomous” from dynamics in X. 16 information theory in the first place: by constructing a space of codewords and an associated (prefix-free) coding function that allow us to map any value in Y to a value in Ω, taking as our accuracy cost the minimal expected length of those codewords (over all codes). To make this expected codelength precise, we need to define an encoding function. So construct a Z and a (time-invariant) encoding function f such that for any y, ω, there is a z ∈ Z such that f (y, z) = ω. From one t to the next, given yt , we have to choose a zt so that we can recover ωt = O(xt ) by evaluating (the time-invariant) function f (yt , zt ). We then want to choose a code for Z that minimizes the length of (codewords for) z’s that allow us to recover x from y, averaged over time according to W and over pairs (ω′t , ωt ) according to Pπ,φ,ρ;P(ω′t , ωt ). So we are interested in the t-average of expectations of (lengths of codewords specifying) z’s where those expectations are evaluated under Pπ,φ,ρ;P(x′t , xt ). This is just the expectation under the single distribution given by t-averaging the distributions Pπ,φ,ρ;P(x′t , xt ). Write that single t-averaged distribution as Z ′ P π,φ,ρ(ω , ω) ≡ dt W(t)Pπ,φ,ρ;P(ω′t , ωt ) (8) The associated minimum of expected codelengths of z’s is just HP π,φ,ρ (Ω | Ω′ ). To normalize this we can subtract it from the entropy of the marginal, HP π,φ,ρ (Ω). (Note that this entropy of the marginal is fixed by P, independent of π, φ or ρ.) This gives us the change in the expected length of codewords for specifying values ωt that arises due to our freedom to have those codewords be generated with a different code for each value of the prediction ω′t . Since higher accuracy corresponds to lower accuracy cost, this motivates an information-theoretic accuracy cost given by C (π, φ, ρ; P) = −IP π,φ,ρ (Ω′ ; Ω) (9) This information-theoretic accuracy cost is the mutual information under the t-average of Pπ,φ,ρ (ω′t , ωt ), rather than Eq. (4)’s t-average of the mutual information under the individual Pπ,φ,ρ(ω′t , ωt )’s. 5.2.3 Alternative information-theoretic accuracy costs While it seems that the distribution Pπ,φ,ρ;P(ω′∆t , ω∆t ) is often a good one to consider, and often we will want to use an information-theoretic accuracy cost, in some circumstances we may not be directly concerned with the mutual information of Pπ,φ,ρ;P(ω′∆t , ω∆t ). For example, in accuracy costs that are not information-theoretic, all we are concerned with is the average discrepancy between the prediction ρ(yt ) and the truth ωt . We do not try to “normalize” that average discrepancy. If it so happens that the distribution over ωt is close to a delta function, independent of xt , and ρ(yt ) just so happens to equal the center of that delta function, we typically say that the accuracy of the prediction is high; we do not try to normalize for the fact that ωt could be accurately predicted even without access to the value yt , due to the fact that it is generated by a distribution that is almost a delta function. In the context of our accuracy cost based on expected codelengths, this suggests that we not try to normalize the conditional entropy, HP π,φ,ρ (Ω | Ω′ ), by subtracting it from HP π,φ,ρ (Ω). In other words, to most closely align with what the term “accuracy cost” means in the context of accuracy costs that are not information- theoretic (i.e., based on accuracy functions), we may want to use that conditional entropy as our information-theoretic accuracy cost, rather than the related mutual information, −IP π,φ,ρ (Ω; Ω′ ). To be precise, in some circumstances we may want to use C (π, φ, ρ; P) = HP π,φ,ρ (Ω | Ω′ ) 17 (10) This accuracy cost will be small if and only if for every prediction ω′t that arises (with significant probability) there is always a unique associated ωt that occurs (with high probability, and averaged over times t). Whether or not you could far more accurately make that prediction by using ω′ than if you didn’t have access to ω′ is irrelevant — after all, you do have access to it. Another example of why we may not want to use Eq. (9) to quantify an accuracy cost is the well-known fact that mutual information in general has a substantial “artifact” arising via the prior distribution over either of its two random variable arguments.11 This is one of the reasons that people often replace mutual information with measures like channel capacity (which, like HP π,φ,ρ (Ω | Ω′ ), only depends on the conditional distribution Pπ,φ,ρ(ωt | ω′t )). As a final example of why we may not want to use Eq. (9), recall it was motivated by presuming that “... we know ω′∆t and want to treat that value as a prediction of ω∆t ”. This use of compressed space computation motivated the accuracy costs discussed above. However there are other reasons to run a computation over a compressed space rather than original space. Some of these are naturally formulated using information-theoretic accuracy costs. An important example of this is when the microstate Markov process P∆t (x | x0 ) (or the observable O, for that matter) is not deterministic, and our goal is to use x0 to predict the future evolution of the entire distribution over ω∆t given by O(ω∆t | x∆t )P(x∆t | x0 ), rather than predict the specific future values ω∆t . In particular, in many situations it may prove useful to use Monte Carlo sampling of the distribution over Y values, Pπ,φ,ρ;P(ω′∆t , x0 ), as an approximation to Monte Carlo sampling of O(ω∆t | x∆t )P(x∆t | x0 ). (For example, this is often the case in the kinds of situations where we might want to use particle filters or some of the techniques of uncertainty quantification.) A natural accuracy cost for this kind of situation is Z Z d∆t W(∆t) dx0 P(x0 )KL[Pπ,φ,ρ;P(Ω′∆t | x0 ) || Pπ,φ,ρ;P(Ω∆t | x0 )] C (π, φ, ρ; P) ≡ − ∆t>0 (11) where the notation “KL[P(A | b) || R(A)]” means the Kullback–Leibler divergence between the two distributions over values a ∈ A given by P(a | b) and R(a) [27, 77].12 6 Computation costs The core concern of SSC is how to choose π, φ, and ρ in a way that minimizes computation cost without sacrificing too much accuracy cost. To quantify this goal we need to quantify the computation cost associated with any tuple (π, φ, ρ; P) (with the associated X, Y and O being implied). This section discusses possible quantifications. We emphasize again that we are not advocating for any one particular quantification of computation or measurement cost, nor even that one be selected from among the list we consider here. As with most aspects of the SSC framework, the computation/measurement cost should be selected appropriately for the problem at hand. We consider three sources of motivation for the computation costs we present: (1) theoretical computer science, (2) information theory, and (3) pragmatism. Although theoretical computer science, and the field of computational complexity in particular, has had a solid quantification of computational resources since the 1960s [48], the types of quantifications considered 11 As an extreme example, if we have covarying random variables A and B and A is almost constant, then the mutual information I(A; B) is very close to zero, even if the conditional distribution P(b | a) is highly accurate. 12 Note that there is not the same issue here involving dynamic changes to how we match each element of y with an element of x that arose in our analysis of accuracy cost based on mutual information. The reason is that both of the distributions in the Kullback–Leibler divergence are defined over the exact same space. 18 do not lend themselves easily to application of optimization techniques. Thus we also consider costs motivated by information theory that we hope are more tractable for optimization. As a final comment, we note that even if we wish to use a mathematical expression for computation cost, often it makes sense to be purely pragmatic, and ignore many of the subtleties discussed above. This is discussed below, in Sec. 7.2. 6.1 Defining computation cost in terms of X, Y, π, φ, and γ Suppose we are concerned with an arbitrary computation, independent of any consideration of state compression. In this case x ∈ X would be a specification of some initial data of that computation, Y would be the state of our computer, π would be a function that uses x (in combination with a specification of the computer program) to initialize the state of the computer, and φ would be the dynamics of the computer. A halt state of the computer is a fixed point of φ. The combination of the computer architecture and the compiler determine both π and φ. So changing either one would change π and φ, even if they do not change the quantity ultimately computed, i.e., do not change the map from an initial data set x to an associated attractor in Y. In general, all those choices of π and φ that result in the same “quantity ultimately computed” will have different computation costs, as the term is used below. The same quantity can be computed using many different programs, all differing in the cost to run those programs. 6.2 Computation cost measures based on theoretical computer science There are many ways to quantify computation cost. Indeed, quantifying scaling relationships among some of the different kinds of computation cost is a core concern of the entire field of computational complexity [82, 52]. One of the kinds of computation cost considered in computational complexity is the running time of the computation. This is also often a primary concern of real-world SSC, where we are interested in expected “wall-clock” time of a simulation. If we restrict attention to von Neumann architectures, then for many purposes this cost can be lower bounded by the sum of the expected codelength of messages that a CPU sends to its RAM, over all iterations of the computer. As a practical issue, this measure is often accessible via profiling of the program (P or φ as the case might be) that is running on the computer. This can then be used to guide the search for a (π, φ, ρ) that optimizes the trade-off between computation cost and accuracy cost (see Sec. 7). Often, though, we want a more broadly applicable specification of computation cost, represented as a mathematical expression; at a minimum this is needed for any kind of mathematical analysis. One obvious way to do this is to use Algorithmic Information Content (AIC), i.e., to quantify computation cost as the minimal size of a Turing machine that performs the desired computation [22]. However as has often been remarked, AIC has the major practical problem that how one measures the size of a Turing machine T (i.e., what universal Turing machine one chooses to use to emulate the running of T ) is essentially arbitrary. Furthermore, AIC is formally uncomputable, so one has to settle for results concerning asymptotic behavior. To get around this issue, people sometimes “approximate” the AIC of a string, e.g., with its length after Lempel–Ziv compression. However this in essence reduces AIC to Bayesian maximum a posterior coding, where the prior probability distribution is implicit in the Lempel–Ziv algorithm. (There are also further problems in using either Lempel–Ziv—see, e. g., [101]—or AIC—see, e. g., [69].) 19 There are several reasonable variants of AIC that might also be appropriate for some types of analysis of SSC. One set of such variants are the many versions of Rissanen’s (minimum) description length (MDL [95, 11]). Another one, quite close to the measure of running time mentioned above, is logical depth [16]. However logical depth is still subject to the practical difficulties associated with AIC. 7 The full SSC objective function Formally speaking, once we have defined both an accuracy cost function and a computation cost function, we are faced with a multi-objective optimization problem of how to choose π, φ, and ρ in order to minimize both cost functions. There are many ways to formalize this problem. For example, as is common in multi-objective optimization, we might only wish to find the set of triples (π, φ, ρ) that lie on the Pareto front of those two functions. Alternatively, we might face a constrained optimization problem. For example, we might have constraints on the maximal allowed value of the accuracy cost, with our goal being to minimize computation cost subject to such a bound. Or conversely we might have constraints on the maximum allowed computation cost (say, in terms of minutes or dollars), with our goal being to minimize accuracy cost subject to such a bound. In this paper, for simplicity we will concentrate on ways to reduce the multi-objective optimization problem into a single-objective optimization problem. To do this requires that we quantify the trade-off between computation and accuracy costs in terms of an overall SSC objective function that we want to minimize. Such an objective function maps any tuple (π, φ, ρ; P) (with the associated X, Y, and O being implied) into the reals. The associated goal of SSC is to solve for the π, φ and ρ that minimize that function, for any given P, X, and O. 7.1 The trade-off between accuracy cost and computation cost Perhaps the most natural overall SSC objective function is simply a linear combination of the computation cost and accuracy cost: K(π, φ, ρ; P) ≡ κC (π, φ, ρ; P) + αE (π, φ, ρ; P) (12) As mentioned throughout the paper, the computation/measurement cost C can (in many situations, should) include the cost of mapping the original state to the compressed state. In this case, the computation cost C might include a term of the form, e. g., Hπ,P (Y0 ). When all these costs are defined information-theoretically, this quantity has a nice interpretation as the minimum of the expected number of bits that must be transmitted to “complete the compressiondecompression circuit”, i. e., the average number of bits needed to map x0 → y0 → yt → ω′t . (13) There are some interesting parallels between these objective functions and various “complexity measures” that have been proposed in the literature to map a (bit string representation of) infinite time-series xt to a real number, in particular those that are based on Turing machines. The cost of computing π can be viewed as (analogous to) the length of a Turing machine that takes in x0 and produces y0 . The remainder of the computation cost can be viewed as analogous to the time it takes to run a Turing machine for the dynamics of y0 . Finally, the accuracy cost term can be viewed as analogous to the amount of extra information that must be added to 20 the result of running that Turing machine to generate (an approximation to) the full observable time-series of interest, ω′t . So if we were to just minimize the computation cost of π, the resultant value is analogous to the algorithmic information content of (an infinite string representation of) the time series of all values xt . Minimizing the combined computation cost of π, φ, and ρ is instead analogous to the logical depth of ω′t . On the other hand, the sum of the cost of π and the cost of ρ is analogous to the “description length” of the time series ω′t [95, 11]. So minimizing the sum of those two terms is analogous to using one of the MDL algorithms. The SSC objective function Eq. (12) combines the concerns of all three of these complexity measures. (This relation of SSC and complexity measures is returned to in Sec. 8 below.) 7.2 Heuristics for minimizing the SSC objective function Because truly optimizing the SSC objective function—or doing some variant of the original multi-objective optimization—will often be quite difficult (if not formally uncomputable), there are several heuristics one might employ that could still yield advantages over the ad hoc nature of intuitive state space compressions. We already started on this path when we decided to focus on the situation where φ is firstorder Markovian (that being a “simpler” dynamics to calculate than higher-order stochastic processes, of the type that are typically used in time-series reconstruction using delay embeddings). An obvious next step—common in real-world instances of SSC, like those discussed in Sec. 4—is to fix Y ahead of time to some space substantially smaller than X, rather than try to optimize it. (In the case of Euclidean X, Y will also be a Euclidean space of much smaller dimension; for finite X, Y is also finite, but far smaller.) We may still optimize over π, φ, and ρ, but in this heuristic the choice of Y is fixed, decreasing the size of the search space dramatically. Another heuristic that will often also make sense is to restrict the set of compression maps π that are considered, for example, to some parametrized class of maps. In particular, when Y is Euclidean, we can restrict π so that it cannot encode an arbitrary dimensional space x ∈ X in an arbitrarily small dimensional y ∈ Y with perfect accuracy, for example by restricting π to a class of maps that are all continuously differentiable of a certain order, or Lipschitz. Without such restrictions, there will often be “valid” π that depend sensitively on all infinitely many digits of x, such as the position along a space-filling curve; as a practical matter, such π are impossible to compute. Even if we wish to consider π that are distributions instead of functions, a parametrized family of distributions (e. g., a parametrized class of Gaussian processes) might prove fruitful. Optimizing the SSC objective function then amounts to optimizing over the parameter space of the chosen class of maps. Note that to evaluate the minimum computation cost for a given map from x0 to values yt would be equivalent to solving for the optimal compilation of a given computer program down to machine code. In real computers, design of optimal compilers is still a very active area of research; calculating the cost of such an optimized compilation will not be possible in general.13 Even calculating such costs for the abstracted version of real-world computers will likely prove intractable. However it should be possible to put bounds on such costs. Moreover, purely pragmatically, one can run a search algorithm over the space of φ’s, finding a good (if not optimal) compilation, and evaluate its associated cost. Examples of heuristic ways to approach SSC are already present in related work, as discussed in Sec. 4. 13 Indeed, even if we allowed an infinitely expandable RAM, such a cost would be uncomputable, in general. 21 8 Applications of SSC – beyond improving prediction Although our SSC framework is most directly concerned with simplifying prediction of the future of a dynamical system, it may have other advantage for analyzing dynamic systems as well. As a particularly simple example, SSC provides a generic method of comparing systems: If two systems of the same type, e. g. two networks, or two economies have very similar optimal SSC compressions, this means that the “underlying” dynamics of them is quite similar. Intriguingly, this is true even for completely different types of systems: If an economy has some good state-space compression that very similar to a good state-space compression of some multicellular organism, that tells us that in an important sense, that economy “is” a multicellular organism, and vice-versa. In the remainder of this section we present two other possible uses of SSC beyond the domain of simplifying prediction that are somewhat more speculative. 8.1 A form of complexity motivated by SSC Suppose we have a compression of a system that substantially reduces the value of the objective function K compared to its “null compression” value (i.e., the value for the identity compression that actually leaves the original space X unchanged). Formally, using “id” to indicate an identity map (with the spaces it operates varying and implicit), such a choice of Y, π, φ, and ρ results in a value of K(π, φ, ρ; P) − K(id, id, id; P) , K(id, id, id; P) (14) close to −1 (assuming the objective function is guaranteed non-negative). When this ratio is close to −1, the compression provides an emulator of the dynamical system that is both easy to evolve computationally and that accurately predicts the future of that dynamical system. When it is large however (i. e., only barely below zero), either the emulation is not very compressed (i.e., computationally difficult to evolve) or it is a poor predictor of the future of the underlying system, or both. Accordingly, we define compression complexity as minπ,φ,ρ K(π, φ, ρ; P) K(id, id, id; P) (15) ranging from 0 for highly compressible (non-complex) systems to 1 for highly incompressible (complex) systems. Note that compression complexity is defined with respect to a given accuracy cost and associated observation operator. So the same fine-grained system may be characterized as “complex” or “not complex” depending on what one wants to predict concerning its future state. Compression complexity of a dynamical system is loosely similar to algorithmic information complexity (AIC) of a string, viewed as a dynamical system. (Perhaps more precisely, it is similar to techniques related to AIC that allow “noisy” reproduction of the string, e.g., minimal description length techniques.) However there are some important differences. To illustrate these, recall that algorithmic information complexity (AIC) is high both for random strings and for “complex” strings. In contrast, SSC compression complexity is low for random strings. More precisely, consider the case where Ω = X, O is the identify map, and the finegrained dynamics is IID noise, i.e., p(xt+1 | xt ) = p(xt+1 ) with a high entropy H(Xt ). Suppose as well that accuracy cost is the time-averaged form of mutual information defined in Eq. (9), −IP π,φ,ρ (X ′ ; X). For this situation, no choice of π, φ, and ρ results in smaller accuracy cost than 22 when no compression is used. So if our SSC objective function were accuracy cost alone, we would conclude that compression complexity is high (just like with AIC). However consider compressing X to a Y that only contains a single element. We lose nothing in accuracy cost. But computation cost is now zero. So the value of the full SSC objective function is greatly reduced. This illustrates that “a fine-grained dynamics that is IID noise” is assigned a small compression complexity. When compression complexity is low, the compressed system {Y, π, φ, ρ} may provide substantial physical insight into the dynamics P of the microstate X, since the compressed system intuitively tell us “what’s important about X’s time-evolution”. As an example, similar to Ex. 2 above, consider a never-ending (multi-stage) noncooperative game among many players that models an economy where the players are employees of many firms interacting with one another. Also posit a particular learning rule whereby the players jointly determine their dynamic behavior. The dynamics of such a game is a stochastic process in a very high-dimensional space. However if its compression complexity is low, then the optimal state compression of that dynamics provides a relatively small set of coarse-grained variables whose dynamics captures the salient aspects of the full underlying game.14 Potentially each component of that optimal coarse-grained macrostate is a characteristic of a separate one of the firms that are being modeled. Intriguingly though, it may well be that the macrostate instead reflects characteristics of the joint behavior of multiple firms, or of sets of individuals spread across multiple firms. This would suggest that the proper way to model this economy is not on a firm-by-firm basis, but rather in terms of macrostate variables that involve the states of multiple firms and individuals simultaneously. Analogously, this is precisely what happens in quantum mechanics: a description of a multiparticle system cannot merely describe the individual states of the particles, but must also include correlations between the particles, i. e. their entanglement. As defined above, compression complexity is normalized, by the value K(id, id, id; P). This is not always appropriate, e.g., if there is some concrete physical meaning associated with the value of the objective function. In such cases, there are several possible modifications to the definition of compression complexity that may make sense. For example, in some situations it may be appropriate to quantify complexity as minπ,φ,ρ K(π, φ, ρ; P). As always with SSC, the precise scenario being analyzed should motivate the precise definitions that are used. Unlike many other complexity measures, compression complexity is tailored to measuring the complexity of dynamic systems. Indeed, in its simplest form, it does not apply to static objects like images. There are various modifications of compression complexity that can apply to static objects though. For example, if we have a generative process that creates images, we could measure the compression complexity of the generative process that produces that image. We also note that in general, as a system evolves its optimal state space compression will change. So as we go from t to t +1 to t +2, etc., if evaluate the associated values of compression complexity taking each of those successive times as the “initial time”, in general we would expect that complexity to undergo a dynamic process. This may provide a useful framework for analyzing informal suppositions of many fields concerning how complexity evolves in time, e.g., concerning how the complexity of large biological systems changes in time. Finally, we emphasize again that we do not promote compression complexity as “the” way to measure complexity. Rather we are simply highlighting that it has many aspects which match well to characteristics of complexity that have been proposed in the past, and that it may lead to novel insight into physical phenomena. 14 Note that the optimizing π in general may be highly nonlinear, and that it may be that the optimizing φ cannot be interpreted as a multi-stage game involving the coarse-grained variables. 23 8.2 Using SSC to define information flow among scales of a system Many measures of “information flow” in a stochastic dynamical system like causal information flow [6], transfer entropy [99, 91, 92], and Granger causality [60] are motivated by considering the flow between physically distinct subsystems of an overall dynamic system. This makes them inherently ill-suited to quantifying information flow among the scales of a single system, in which one would expect there to be a priori “biases” reflecting the fact that behavior at different scales of a single system cannot be completely independent. In fact, the complete opposite is typically the case: the dynamics of the more detailed scale typically completely determine the dynamics of the less detailed scale. As an example of the difficulties such biases cause for those measures of information flow, the most straightforward application of transfer entropy (taking k = l = 1, in Schreiber’s notation) would quantity the information flow from Yt to Xt+1 as the conditional mutual information Iπ,φ;P (Xt+1 ; Yt | Xt ). However this is identically zero, regardless of π, φ, and P. (Note that this is not exactly the case for the calculations of transfer entropy between scales made in [117], since they do not adopt this most straight-forward use of transfer entropy. However the same kinds of statistical biases still apply. From a certain perspective, these biases mean that the very notion of information flowing from a high scale to a small scale of a single system is specious. Nonetheless, going back at least to the seminal work of Maynard-Smith and others, researchers have presumed that information does “flow” from the high (coarse-grained) scale down to the low (fine-grained) scale of a biological system organisms [109, 108, 117, 34]. Indeed, Maynard-Smith averred that not only does such high-to-low scale information flow exist, but that it has increased in each major transition in biological evolution. More recent work has also emphasized the role that information flow between scales may play in understanding the emergence of social complexity [37] and even biological individuality [67] itself. A similar phenomenon is seen in intuitive descriptions of computational algorithms, e.g., as implemented on Turing machines or with Von Neumann architectures. For example, consider an algorithm that determines whether its input is a prime number or not. On the one hand, the behavior of this algorithm is completely specified by its code: how it moves bits around in memory and combines them. On the other hand, the low-level bit-wise behavior of this algorithm may be viewed as being “determined” by its high-level characterization as a search for primality. When at some point the algorithm takes one branch of a conditional “if” statement rather than another, do we say that it took that branch because the memory was just in a certain position, or because (to give an example) the number 6 that was input to the algorithm is not prime? The SSC framework provides ways to formalize the information flowing from a high scale down to a low scale of a single system which are more directly grounded in the relation between the behaviors at different scales of a single system than are measures like transfer entropy. The basic idea is to first use SSC to solve for the scale(s) at which to analyze the system, rather than rely on the scale(s) being pre-specified in an ad hoc manner. We then define the associated information flow from the coarse scale to the fine scale by treating (φ, ρ) as specifying an information channel between Y and the observable function of X. We refer to any such quantification based on SSC as inter-scale causality, in analogy with “Granger causality”. As an example of inter-scale causality, one might argue that the amount of information needed to construct the current value of x, given any particular estimate of it based on the value of y, is an appropriate measure of the “information flow” from the coarse-scale to the fine scale. This can be quantified as the entropy of xt , evaluated under the probability distribution conditioned on the value yt−1 . Expressing this in terms of observables and predictions for them 24 rather than directly in terms of x and y, averaging over yt−1 , and then averaging over t, we arrive at the measure Z − d∆t W(∆t)HPπ,φ,ρ;P (Ω∆t | Ω′∆t−1 ) (16) (using the notation of Sec. 5.2). A slight variant of this measure arises if we wish to normalize each of the conditional entropies HPπ,φ,ρ;P (Ω∆t | Ω′∆t−1 ) by subtracting it from HPπ,φ,ρ;P (Ω∆t ). This difference tells us how much extra information about the value of ωt is provided by ω′t−1 , beyond the prior information concerning ωt . With this normalization our measure of information flow becomes Z − d∆t W(∆t)IPπ,φ,ρ;P (Ω′∆t ; Ω∆t ) (17) This is just the time-averaged mutual information, a natural candidate for an informationtheoretic accuracy cost. However as discussed above, to avoid the problem that two variables can have perfect mutual information by being either perfectly correlated or perfectly anti-correlated at any given time step—and whether they are correlated or anti-correlated at each time step can change without changing the preceding value—it may make more sense to replace the above quantity with the mutual information of the time average, or even with the conditional entropy of the time average, HP π,φ,ρ (Ω | Ω′ ). Any such alternatives based on the concerns raised in the discussion of accuracy cost Sec. 5.2 should be treated carefully though. Here we are interested in quantifying information flow from the time series over Ω′ (predicted from the time series over Y) to the time series over Ω (the observable applied to the time series over X). We are not interested in formalizing how accurately we can predict ωt from ω′t (or yt ). It is worth emphasizing the essential difference between this kind of SSC-based measure of information flow between scales and measures of it like the transfer entropy [99] between scales. Measures like transfer entropy only depend on how much the time series yt tells us about xt that does not arise through direct dependence of xt on xt−1 . For example, if xt → yt is a single-valued invertible mapping, then yt+1 will have high mutual information with xt+1 , even though there is no novel information that flows from yt+1 to xt+1 , only different echoes of xt . Transfer entropy is explicitly designed to remove such effects arising from the direct dependence of xt on xt−1 . However this “direct dependence” that transfer entropy is designed to ignore is precisely what we want to capture when considering information flow among scales. In particular, it is precisely what the measures suggested in Eq. (16) and Eq. (17) are designed to capture, due to how Pπ,φ,ρ;P is defined. Simply put, information flow between scales of a single system is fundamentally different from information flow between physically separate systems, and therefore should be quantified differently. 9 Conclusions This preliminary report has presented a new framework for understanding how we construct higher-level descriptions of complex systems. We have introduced the problem through a series of illustrations, defined the key quantities, and provided three explicit examples of how this framework can be applied to basic problems in biology, economics, and physics. Having built an intuition for the method, we then compared this framework to a number of influential suggestions in the literature. 25 Our framework makes explicit two core questions for both the scientist and engineer: how accurate a theory is, and how difficult it is to work with. We have presented new theoretical results for how to quantify the answers to these questions, and how to combine them into a single objective function. By formalizing the goals of a scientist engaged in providing a coarse-grained description of a system, state space compression allows us to compare and contrast a wide variety of systems. It provides novel ways to address long-standing problems that arise both within fields and between disciplines, where the question of “how much to ignore” becomes critical. Acknowledgements We thank Daniel Polani, Eckehard Olbrich, Nils Bertschinger, Nihat Ay, Cris Moore, and James O’Dwyer for helpful discussion. We also thank the Santa Fe Institute for support. In addition this paper was made possible through the support of Grant No. TWCF0079/AB47 from the Templeton World Charity Foundation. The opinions expressed in this paper are those of the author(s) and do not necessarily reflect the view of Templeton World Charity Foundation. S. D. thanks the City University of New York’s Initiative for the Theoretical Sciences for their hospitality during the course of this work. S. D. was supported in part by National Science Foundation Grant EF-1137929. J. A. G. and E. L. acknowledge the support of Santa Fe Institute Omidyar Fellowships. References [1] Athanasios Antoulas and Dan Sorensen, Approximation of large-scale dynamical systems: an overview, International Journal of Applied Mathematics and Computer Science 11(5):1093–1121, 2001. [2] K. B. Athreya and P. E. Ney, Branching processes, Springer–Verlag, New York, 1972. [3] Alessandro Attanasi, Andrea Cavagna, Lorenzo Del Castello, Irene Giardina, Tomas S Grigera, Asja Jelić, Stefania Melillo, Leonardo Parisi, Oliver Pohl, Edward Shen, et al., Information transfer and behavioural inertia in starling flocks, Nature Physics 10 (2014), no. 9, 691–696. [4] Antoulas, Athanasios C. Approximation of large-scale dynamical systems. With a foreword by Jan C. Willems. Advances in Design and Control, 6. Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2005. [5] Pierre Auger, R Bravo de La Parra, Jean-Christophe Poggiale, E Sánchez, and L Sanz, Aggregation methods in dynamical systems and applications in population and community dynamics, Physics of Life Reviews 5 (2008), no. 2, 79–105. [6] Nihat Ay and Daniel Polani, Information flows in causal networks, Advances in Complex Systems 11 (2008), no. 01, 17–41. [7] Zhaojun Bai, Krylov subspace techniques for reduced-order modeling of large-scale dynamical systems, Applied Numerical Mathematics 43 (2002), no. 1, 9–44. 26 [8] V. Balakrishnan, Q. Su, and C.-K. Koh. Efficient balance-and-truncate model reduction for large scale systems. Purdue University ECE Tech. Report TR-ECE 00-15, 2000. [9] Abhijit V. Banerjee, Arun Chandrasekhar, Esther Duflo, and Matthew O. Jackson, Gossip: Identifying central individuals in a social network, MIT Department of Economics Working Paper, 2014. [10] Alain Barrat, Marc Barthelemy, and Alessandro Vespignani, Dynamical processes on complex networks, Cambridge University Press, Cambridge, UK, 2008. [11] Andrew Barron, Jorma Rissanen, and Bin Yu, The minimum description length principle in coding and modeling, Information Theory, IEEE Transactions on 44 (1998), no. 6, 2743–2760. [12] Beck, C. L., Lall, S., Liang, T., and West, M. Model reduction, optimal prediction, and the Mori–Zwanzig representations of Markov chains, IEEE Conf. Decision and Control, 2009. [13] Charles H Bennett, Logical reversibility of computation, IBM journal of Research and Development 17 (1973), no. 6, 525–532. [14] , The thermodynamics of computation—a review, International Journal of Theoretical Physics 21 (1982), no. 12, 905–940. [15] , Time/space trade-offs for reversible computation, SIAM Journal on Computing 18 (1989), no. 4, 766–776. [16] , Logical depth and physical complexity, The Universal Turing Machine A HalfCentury Survey, Springer, 1995, pp. 207–235. [17] , Notes on landauer’s principle, reversible computation, and maxwell’s demon, Studies In History and Philosophy of Science Part B: Studies In History and Philosophy of Modern Physics 34 (2003), no. 3, 501–510. [18] William Bialek, Andrea Cavagna, Irene Giardina, Thierry Mora, Edmondo Silvestri, Massimiliano Viale, and Aleksandra M Walczak, Statistical mechanics for natural flocks of birds, Proceedings of the National Academy of Sciences 109 (2012), no. 13, 4786–4791. [19] William Bialek, Ilya Nemenman, and Naftali Tishby, Predictability, complexity, and learning, Neural Computation 13 (2001), no. 11, 2409–2463. [20] Neli Blagus, Lovro Šubelj, and Marko Bajec, Self-similar scaling of density in complex real-world networks, Physica A: Statistical Mechanics and its Applications 391 (2012), no. 8, 2794–2802. [21] Lenore Blum, Felipe Cucker, Michael Shub, and Steve Smale, Complexity and real computation, Springer-Verlag New York, Inc., Secaucus, NJ, USA, 1998. [22] Gregory J Chaitin, Algorithmic information theory, vol. 1, Cambridge University Press, 2004. [23] Pierre André Chiappori and Ivar Ekeland, New developments in aggregation economics, Annu. Rev. Econ. 3 (2011), no. 1, 631–668. 27 [24] Chorin, Alexandre J. and Hald, Ole H., Stochastic tools in mathematics and science. Third edition. Texts in Applied Mathematics, 58. Springer, New York, 2013. [25] Andy Clark, Whatever next? predictive brains, situated agents, and the future of cognitive science, Behavioral and Brain Sciences 36 (2013), no. 03, 181–204. [26] Iain D Couzin, Collective cognition in animal groups, Trends in cognitive sciences 13 (2009), no. 1, 36–43. [27] T. Cover and J. Thomas, Elements of information theory, Wiley-Interscience, New York, 1991. [28] Felix Creutzig, Amir Globerson, and Naftali Tishby. Past-future information bottleneck in dynamical systems, Physical Review E 79(4):041925, 2009. [29] J. P. Crutchfield, The calculi of emergence: computation, dynamics, and induction, Physica D, 75:11–54, 1994. [30] J. P. Crutchfield, Between order and chaos, Nature Physics, 8:17–24, 2012. [31] J. P. Crutchfield and B. S. McNamara, Equations of motion from a data series, Complex Systems, 1:417–452, 1987. [32] J. P. Crutchfield and K. Young, Inferring statistical complexity, Phys. Rev. Let., 63:105– 108, 1989. [33] Eric Davidson and Michael Levin, Gene regulatory networks, Proceedings of the National Academy of Sciences of the United States of America 102 (2005), no. 14, 4935–4935. [34] PCW Davies, The epigenome and top-down causation, Interface Focus 2 (2012), no. 1, 42–48. [35] Simon DeDeo, Effective theories for circuits and automata, Chaos: An Interdisciplinary Journal of Nonlinear Science, 21(3):037106, 2011. [36] Simon DeDeo, Group minds and the case of Wikipedia, Human Computation 1:1:5-29 (2014). arXiv:1407.2210. [37] Simon DeDeo, Major transitions in political order, Information and Causality: From Matter to Life, Cambridge University Press, 2015. [38] Simon DeDeo and David C. Krakauer, Dynamics and processing in finite self-similar networks, Journal of The Royal Society Interface 9 (2012), no. 74, 2131–2144. [39] Kun Deng. Model reduction of Markov chains with applications to building systems. Ph.D. thesis, U. Illinois Urbana–Champaign, 2012. [40] Salem Derisavi, A symbolic algorithm for optimal markov chain lumping, Tools and Algorithms for the Construction and Analysis of Systems, Springer, 2007, pp. 139–154. [41] Salem Derisavi, Holger Hermanns, and William H Sanders, Optimal state-space lumping in markov chains, Information Processing Letters 87 (2003), no. 6, 309–315. 28 [42] Raoul Dillenschneider and Eric Lutz, Comment on“minimal energy cost for thermodynamic information processing: Measurement and information erasure”, Physical Review Letters 104 (2010), no. 19, 198903. [43] K.-I. Goh, G. Salvi, B. Kahng, and D. Kim, Skeleton and fractal scaling in complex networks, Phys. Rev. Lett. 96 (2006), 018701. [44] Leslie Ann Goldberg, Martin Grohe, Mark Jerrum, and Marc Thurley, A complexity dichotomy for partition functions with mixed signs, arXiv:0804.1932 [cs.CC], 2009. [45] Olof Görnerup and Martin Nilsson Jacobi, A method for inferring hierarchical dynamics in stochastic processes, Advances in Complex Systems 11 (2008), no. 01, 1–16. [46] , A method for finding aggregated representations of linear dynamical systems, Advances in Complex Systems 13 (2010), no. 02, 199–215. [47] Nicholas J Guido, Xiao Wang, David Adalsteinsson, David McMillen, Jeff Hasty, Charles R Cantor, Timothy C Elston, and JJ Collins, A bottom-up approach to gene regulation, Nature 439 (2006), no. 7078, 856–860. [48] J. Hartmanis and R. E. Stearns, On the computational complexity of algorithms, Trans. Amer. Math. Soc. 117 (1965), 285–306. MR 0170805 (30 #1040) [49] Werner Hildenbrand, Aggregation theory, Entry for The New Palgrave of Economics 2 (2007). [50] Mike Holcombe and WML Holcombe, Algebraic automata theory, vol. 1, Cambridge University Press, 2004. [51] Holmes, Philip, Lumley, John L., Berkooz, Gahl, Turbulence, coherent structures, dynamical systems and symmetry. Second edition. Cambridge Monographs on Mechanics. Cambridge University Press, Cambridge, 2012. [52] John E Hopcroft, Rajeev Motwani, and Ullman Rotwani, Jd: Introduction to automata theory, languages and computability, 2000. [53] N. Israeli and N. Goldenfeld, Computational irreducibility and the predictability of complex physical systems, Physical Review Letters 92 (2004), 074105. [54] Navot Israeli and Nigel Goldenfeld, Coarse-graining of cellular automata, emergence, and the predictability of complex systems, Physical Review E 73 (2006), no. 2, 026203. [55] Shalev Itzkovitz, Reuven Levitt, Nadav Kashtan, Ron Milo, Michael Itzkovitz, and Uri Alon, Coarse-graining and self-dissimilarity of complex networks, Physical Review E 71 (2005), no. 1, 016127. [56] Matthew O. Jackson, Tomas Rodriguez-Barraquer, and Xu Tan, Social capital and social quilts: Network patterns of favor exchange, American Economic Review 102 (2012), no. 5, 1857–97. [57] Martin Nilsson Jacobi and Olof Goernerup, A dual eigenvector condition for strong lumpability of Markov chains, arXiv preprint arXiv:0710.1986, 2007. 29 [58] Daniel A. Jiménez, Improved latency and accuracy for neural branch prediction, ACM Trans. Comput. Syst. 23 (2005), no. 2, 197–218. [59] Leo P Kadanoff, Wolfgang Götze, David Hamblen, Robert Hecht, EAS Lewis, VV Palciauskas, Martin Rayl, J Swift, David Aspnes, and Joseph Kane, Static phenomena near critical points: theory and experiment, Reviews of Modern Physics 39 (1967), no. 2, 395. [60] Maciej Kamiński, Mingzhou Ding, Wilson A Truccolo, and Steven L Bressler, Evaluating causal relations in neural systems: Granger causality, directed transfer function and statistical assessment of significance, Biological cybernetics 85 (2001), no. 2, 145–157. [61] Marek Kimmel and David E. Axelrod, Branching processes in biology, Springer-Verlag New York, Inc., New York, 2002. [62] Georgios Kotsalis, Alexandre Megretski, and Munther A. Dahleh. Balanced truncation for a class of stochastic jump linear systems and model reduction for hidden Markov models. IEEE Trans. Automatic Control, 53(11):2543–2557, 2008. [63] Georgios Kotsalis and Anders Rantzer. Balanced truncation for discrete time Markov jump linear systems. IEEE Trans. Automatic Control, 55(11):2606–2611, 2010. [64] Kotsalis, G. and Shamma, J.S., A counterexample to aggregation based model reduction of Hidden Markov Models, 2011 50th IEEE Conference on Decision and Control and European Control Conference (CDC-ECC), 6558–6563, 2011. [65] Kotsalis, G. and Shamma, J.S., A fundamental limitation to the reduction of Markov chains via aggregation, 2012 50th Annual Allerton Conference on Communication, Control, and Computing (Allerton), 1449–1454, 2012. [66] David C Krakauer, Darwinian demons, evolutionary complexity, and information maximization, Chaos: An Interdisciplinary Journal of Nonlinear Science 21 (2011), no. 3, 037110. [67] David Krakauer, Nils Bertschinger, Eckehard Olbrich, Nihat Ay, and Jessica C. Flack. The information theory of individuality, arXiv:1412.2447, 2014. [68] David Krakauer, Jessica C. Flack, Simon DeDeo, Doyne Farmer, and Daniel Rockmore, Intelligent data analysis of intelligent systems, Advances in Intelligent Data Analysis IX, 8–17, 2010. [69] James Ladyman, James Lambert, and Karoline Wiesner, What is a complex system?, European Journal for Philosophy of Science 3 (2013), no. 1, 33–67. [70] S. Lall and C. Beck. Error-bounds for balanced model-reduction of linear time-varying systems, IEEE Trans. Automatic Control 48(6):946–956, 2003. [71] Rolf Landauer, Irreversibility and heat generation in the computing process, IBM journal of research and development 5 (1961), no. 3, 183–191. [72] , Minimal energy requirements in communication, Science 272 (1996), no. 5270, 1914–1918. [73] , The physical nature of information, Physics letters A 217 (1996), no. 4, 188–193. 30 [74] S. Lloyd, Physical measures of complexity, 1989 Lectures in Complex Systems (E. Jen, ed.), Addison Wesley, 1990. [75] Seth Lloyd, Use of mutual information to decrease entropy: Implications for the second law of thermodynamics, Physical Review A 39 (1989), no. 10, 5378. [76] Lorenz, Edward N., Empirical orthogonal functions and statistical weather prediction, Scientific Report No. 1, Statistical Forecasting Project, MIT Dept. of Meteorology, 1956. [77] D.J.C. Mackay, Information theory, inference, and learning algorithms, Cambridge University Press, 2003. [78] OJE Maroney, Generalizing landauer’s principle, Physical Review E 79 (2009), no. 3, 031105. [79] Sarah Marzen and J. P. Crutchfield, Circumventing the curse of dimensionality in prediction: causal rate-distortion for infinite-order Markov processes, arXiv:1412.2859, 2014. [80] Andrea Montanari and Amin Saberi, The spread of innovations in social networks, Proceedings of the National Academy of Sciences 107 (2010), no. 47, 20196–20201. [81] Moore, Bruce C. Principal component analysis in linear systems: controllability, observability, and model reduction, IEEE Trans. Automatic Control, vol. AC-26, no. 1, 17–32, 1981. [82] Cristopher Moore and Stephan Mertens, The nature of computation, Oxford University Press, 2011. [83] Mori, Hazime. Transport, collective motion, and Brownian motion. Prog. Theoret. Phys. 33(3):423–455, Mar 1965. [84] Brian Munsky and Mustafa Khammash, The finite state projection algorithm for the solution of the chemical master equation, The Journal of chemical physics 124 (2006), 044104. [85] , The finite state projection approach for the analysis of stochastic noise in gene networks, Automatic Control, IEEE Transactions on 53 (2008), no. Special Issue, 201– 214. [86] Mark EJ Newman, The structure and function of complex networks, SIAM review 45 (2003), no. 2, 167–256. [87] David Papo, Massimiliano Zanin, Jos?Angel Pineda-Pardo, Stefano Boccaletti, and Javier M. Buld? Functional brain networks: great expectations, hard times and the big leap forward, Philosophical Transactions of the Royal Society B: Biological Sciences 369 (2014), no. 1653, 20130525. [88] Peherstorfer, B., Butnaru, D., Willcox, K. & Bungartz, H.J. Localized discrete empirical interpolation method. SIAM Journal on Scientific Computing, 36(1):A168-A192, SIAM, 2014. [89] Oliver Pfante, Nils Bertschinger, Eckehard Olbrich, Nihat Ay, and Jürgen Jost, Comparison between different methods of level identification, Tech. Report 11-035, Santa Fe Institute, 2013. 31 [90] Martin B Plenio and Vincenzo Vitelli, The physics of forgetting: Landauer’s erasure principle and information theory, Contemporary Physics 42 (2001), no. 1, 25–60. [91] Mikhail Prokopenko and Joseph T Lizier, Transfer entropy and transient limits of computation, Scientific reports 4 (2014), 5394. [92] Mikhail Prokopenko, Joseph T Lizier, and Don C Price, On thermodynamic interpretation of transfer entropy, Entropy 15 (2013), no. 2, 524–543. [93] Stephen R Proulx, Daniel EL Promislow, and Patrick C Phillips, Network thinking in ecology and evolution, Trends in Ecology & Evolution 20 (2005), no. 6, 345 – 353. [94] Filippo Radicchi, José J. Ramasco, Alain Barrat, and Santo Fortunato, Complex networks renormalization: Flows and fixed points, Phys. Rev. Lett. 101 (2008), 148701. [95] Jorma Rissanen, A universal prior for integers and estimation by minimum description length, The Annals of statistics (1983), 416–431. [96] Takahiro Sagawa and Masahito Ueda, Minimal energy cost for thermodynamic information processing: measurement and information erasure, Physical Review Letters 102 (2009), no. 25, 250602. [97] Marissa G Saunders and Gregory A Voth, Coarse-graining methods for computational biology, Annual review of biophysics 42 (2013), 73–93. [98] Wilhelmus HA Schilders, Henk A Van der Vorst, and Joost Rommes, Model order reduction: theory, research aspects and applications, vol. 13, Springer, 2008. [99] Thomas Schreiber, Measuring information transfer, Physical Review Letters 85 (2000), no. 2, 461–464. [100] Reza Shadmehr, Maurice A Smith, and John W Krakauer, Error correction, sensory prediction, and adaptation in motor control, Annual review of neuroscience 33 (2010), 89–108. [101] Cosma Shalizi, Complexity, entropy and the physics of gzip, 2003, http://vserver1.cscs.lsa.umich.edu/˜ crshalizi/notebooks/cep-gzip.html. [102] Cosma Rohilla Shalizi, Causal architecture, complexity and self-organization in the time series and cellular automata, Ph.D. thesis, University of Wisconsin–Madison, 2001. [103] , C. R. Shalizi and J. P. Crutchfield, Information bottlenecks, causal states, and statistical relevance bases: how to represent relevant information in memoryless transduction, Advances in Complex Systems 5(1):91–95, 2002. [104] Cosma Rohilla Shalizi and Cristopher Moore, What is a macrostate? subjective observations and objective dynamics, arXiv preprint cond-mat/0303625, 2003. [105] Robert Shaw, The dripping faucet as a model chaotic system, Aerial Press, Santa Cruz, CA, 1984, Science Frontier Express Series. ISBN 0-942344-05-7. [106] Kousuke Shizume, Heat generation required by information erasure, Physical Review E 52 (1995), no. 4, 3495. 32 [107] Herbert A Simon and Albert Ando, Aggregation of variables in dynamic systems, Econometrica: journal of the Econometric Society (1961), 111–138. [108] J. Maynard Smith, Time in the evolutionary process, Studium Generale 23 (1970), 266– 272. [109] J Maynard Smith, The concept of information in biology, Philosophy of Science 67 (2000), no. 2, 177–194. [110] Chaoming Song, Shlomo Havlin, and Hernan A. Makse, Self-similarity of complex networks, Nature 433 (2005), no. 7024, 392–395. [111] Susanne Still, Information bottleneck approach to predictive inference, Entropy 16 (2014), no. 2, 968–989. [112] susanne Still, James P. Crutchfield, and Christopher J. Ellison. Optimal causal inference: Estimating stored information and approximating causal architecture. Chaos: An Interdisciplinary Journal of Nonlinear Science, 20(3):037111, 2010. [113] Susanne Still, David A. Sivak, Anthony J. Bell, and Gavin E. Crooks, Thermodynamics of prediction, Phys. Rev. Lett. 109 (2012), 120604. [114] R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction, MIT Press, Cambridge, MA, 1998. [115] Ross M. Thompson, Ulrich Brose, Jennifer A. Dunne, Robert O. Hall Jr., Sally Hladyz, Roger L. Kitching, Neo D. Martinez, Heidi Rantala, Tamara N. Romanuk, Daniel B. Stouffer, and Jason M. Tylianakis, Food webs: reconciling the structure and function of biodiversity, Trends in Ecology & Evolution 27 (2012), no. 12, 689 – 697. [116] Naftali Tishby, Fernando C Pereira, and William Bialek, The information bottleneck method, arXiv:physics/0004057, 2000. [117] Sara Imari Walker, Luis Cisneros, and Paul CW Davies, Evolutionary transitions and top-down causation, arXiv preprint arXiv:1207.4808, 2012. [118] Langford B White, Robert Mahony, and Gary D Brushe, Lumpable hidden markov models-model reduction and reduced complexity filtering, Automatic Control, IEEE Transactions on 45 (2000), no. 12, 2297–2306. [119] Karoline Wiesner, Mile Gu, Elisabeth Rieper, and Vlatko Vedral, Information-theoretic lower bound on energy cost of stochastic computation, Proceedings of the Royal Society A: Mathematical, Physical and Engineering Science 468 (2012), no. 2148, 4058–4066. [120] D. H. Wolpert, The minimal entropy generated during an irreversible computation, In preparation, 2014. [121] D. H. Wolpert and W. Macready, Self-dissimilarity: An empirically observable complexity measure, Unifying Themes in Complex Systems, New England Complex Systems Institute, 2000, pp. 626–643. [122] , Using self-dissimilarity to quantify complexity, Complexity 12 (2007), 77–85. [123] Zwanzig, Robert. Problems in nonlinear transport theory. In Systems far from equilibrium (Garrido, L., ed.), 198–225, 1980. 33
5cs.CE
Explicit size distributions of failure cascades redefine systemic risk on finite networks Rebekka Burkholz1,* , Hans J. Herrmann2,3 , and Frank Schweitzer4 1 ETH Zurich, Computer Science, Zurich, 8092, Switzerland Zurich, Computational Physics for Engineering Materials, IfB, Zurich, 8093, Switzerland 3 Universidade Federal do Ceará, Fı́sica, Fortaleza Ceará, 60451-970, Brazil 4 ETH Zurich, Management, Technology and Economics, Zurich, 8092, Switzerland * [email protected] arXiv:1802.03286v1 [physics.soc-ph] 8 Feb 2018 2 ETH ABSTRACT How big is the risk that a few initial failures of nodes in a network amplify to large cascades that span a substantial share of all nodes? Predicting the final cascade size is critical to ensure the functioning of a system as a whole. Yet, this task is hampered by uncertain or changing parameters and missing information. In infinitely large networks, the average cascade size can often be well estimated by established approaches building on local tree approximations and mean field approximations. Yet, as we demonstrate, in finite networks, this average does not even need to be a likely outcome. Instead, we find broad and even bimodal cascade size distributions. This phenomenon persists for system sizes up to 107 and different cascade models, i.e. it is relevant for most real systems. To show this, we derive explicit closed-form solutions for the full probability distribution of the final cascade size. We focus on two topological limit cases, the complete network representing a dense network with a very narrow degree distribution, and the star network representing a sparse network with a inhomogeneous degree distribution. Those topologies are of great interest, as they either minimize or maximize the average cascade size and are common motifs in many real world networks. Introduction Systemic risk is defined as the risk that a large fraction, ρ → 1, of a system fails. This can happen because extreme events shock the system1 or because the failures of a few system elements cause new failures. This propagation results in failure cascades that can eventually reach the size of the system. In the aftermath of the financial crisis in 2008/2009, systemic risks induced by such cascades received attention especially in the context of financial contagion of bank defaults2–4 . Also the increasing complexity of economic value chains5 raised awareness for similar effects6 , in particular concerning critical resources7 and food8 . Many of these works are inspired by stability analyses of ecological food webs9–11 . But also generic models from physics and related areas have been utilized to study failure cascades. Examples include Ising models12 , models of fiber bundles that break under stress13 , models of epidemic spreading14, 15 , voter models16 , and models of overload failures in power grids or other infrastructure17 . Many of these cascade models have in common that they can be mapped to a generic threshold model for propagating failures on a graph G, or a complex network, where nodes represent the system elements and links between nodes their interactions. Formally G = (V, E) is a constant undirected network consisting of N = |V | nodes, which are elements of the node set V . The link set E contains tuples of the form (i, j), each representing a pairwise connection between nodes i and j. Network topologies vary between Erdös-Rényi random networks, where the number of links per node can be described by an average degree, and scale-free networks, where the number of links vastly differs between core nodes, or hubs with very many links, and peripheral nodes with very few links. In this paper, we discuss limit cases of these two topologies, i.e. the complete network, where each node has the same number of links, N − 1, and the star network, where the center node has N − 1 links, but the peripheral nodes have only one link to the center. Both are recurring motifs of real world networks and an approximation of prevailing core periphery structures. In particular, financial and economic networks often have densely connected core nodes with peripheral nodes loosely connected to them18, 19 . Most importantly, for many models, one of the two, the complete network or the star, minimizes while the other maximizes average systemic risk20, 21 , when systemic risk is measured by the cascade size, i.e. the fraction of failed nodes in the network. Network model A failure of a node i at time t is indicated by its binary state variable si (t) = 1. Otherwise, it is healthy or functional, si (t) = 0, and can switch to failed in each of the discrete time steps t = 0, . . . , T . For simplicity, we exclude the possibility to recover, i.e. node states can only change from 0 to 1 but not vice versa. Each node state si (t) is characterized by Cascade processes two node variables, a threshold θi and the load λi (t). θi summarizes the “robustness” of a node, its ability to withstand shocks. It is assumed to stay fixed over time. Individual thresholds are initially drawn independently at random from an arbitrary cumulative distribution function (cdf) F(θ ), often also called the response function. A node i fails at time t + 1, if its load exceeds its threshold, i.e. si (t + 1) = Θ[λi (t) − θi ], where Θ[x] is the Heaviside function with Θ[x] = 1 if x ≥ 0 and Θ[x] = 0 otherwise. The load λi (t) can change because of interaction with neighboring nodes involving a load distribution process. This basically describes how a failure can propagate along a link if two nodes interact, because a load increase can result in λi (t) ≥ θi . Initially, all nodes with θi ≤ λ0 fail, where λi (0) = λ0 denotes the initial load of a node. This allows us to define the size of a cascade at time t as the fraction of failed nodes in the network: ρ(t) = 1/N ∑Ni=1 si (t). A cascade maximally lasts T = N − 1 time steps because at least one node needs to fail at each time step to keep the process going. The final size of the cascade, ρ = ρ(T ), i.e. the final fraction of failed nodes, is a common measure for systemic risk. While the cascade dynamics itself is deterministic, ρ is a random variable, as it depends on the thresholds that are drawn initially independently at random according to the distribution F(θ ). This randomness can model uncertainty (e.g.g incomplete data or information) or changing exposures of nodes, for instance, due to fluctuating markets or aging system components in an engineering setting. Based on combinatorial arguments, in the materials and  methods section and the SI, we derive a closed-form solution for the probability distribution of ρ on complete graphs, p ρ4 ), and stars, p (ρ? )), of finite arbitrary size N. We discuss three exemplary load distribution mechanisms well established in different fields. We refer to the first one22 as exposure diversification (ED). It means that a node is exposed equally to the risk that any of its neighbors fail. The more neighbors, the better for hedging against such exposures (in low systemic risk regimes)23 . A node carries simply the fraction of its failed neighbors as load. Thus, in complete networks each functional node carries the load λ [k] = k/(N − 1) when k nodes have failed. The ED mechanism has not only attracted theoretical interest24–28 , it is also used to explain opinion formation29 and financial contagion2, 30, 31 , where random thresholds correspond to fluctuating exposures between banks and changing capital buffers. The randomness can also be interpreted as model uncertainty in such complex systems32 . The second mechanism, denoted as damage diversification (DD)23, 33 , assumes that a failing node distributes its total load 1 equally among its network neighbors. Consequently, DD coincides with ED for complete networks. The third mechanism defines the prominent fiber bundle model13, 34 in material science. A force, applied to a bundle of fibers, is modeled by a load λ0 carried by each node in a network, while a node’s threshold determines the strength of a fiber. When a fiber i breaks, it distributes its full load λi (t) equally to its still functional network neighbors, which become connected afterwards. On complete networks, this mechanism is also known as global load sharing rule and translates into λ [k] = λ0 + kλ0 /(N − k) that each functional node carries when k nodes have failed. For the special and simplifying case of uniformly distributed thresholds, a formula for the cascade size distribution is known already35 . With our new derivations, now arbitrary threshold distributions and thus different fiber materials can be studied. For the star network, we focus on a local load sharing variant where no new edges are created36, 37 Three paradigmatic load distribution mechanisms Results The only random ingredient that we study is the cumulative threshold distribution F(θ ). Our derivations apply to an arbitrary choice. Yet to be consistent and to allow for comparisons, we discuss only F ∼ N (µ + λ0 , σ 2 ), i.e. a normal distribution with mean µ + λ0 and standard deviation σ . For ED and DD, λ0 does not influence the results, so we set the initial load to λ0 = 0. For the fiber bundle model, we assume λ0 = 1, i.e. a value large enough that we can observe both cascades that span the whole network (ρ = 1), and cascades that stop early. We are especially interested in parameter regions (µ, σ ) that lead to medium average cascade sizes. This implies that such cascades would not encompass the whole system in case of an infinitely large network. We then investigate, for such “safe” parameter regions, the size of cascades for finite networks. As a reference case, Fig. 1(a) shows the phase diagram for ρ4 for infinitely large systems, assuming a complete network and the ED/DD mechanism23, 33 . ρ4 is taken as a measure of systemic risk. If the mean value of the threshold distribution, µ, is large, the system is less prone to large failure cascades. Taking a small, but fixed value of µ, we recall two important observations, (i) the sharp phase transition between completely safe systems (white, average cascade size zero) and completely failed systems at a critical value of (µ, σ ), (ii) the gradual decrease of systemic risk in areas with high σ . This means, the heterogeneity in thresholds plays a crucial role in amplifying, or preventing, systemic risks. Therefore, we first study the impact of increasing heterogeneity σ on failure cascades in finite networks. Fig. 1(b) shows the broad distribution of the final cascade size, spanning values between 0 and 1. Only for large values of σ we find distributions that match our expectations derived from the behavior of infinite systems, i.e. they are unimodal and symmetric. As σ decreases, however, the distributions become asymmetric and broader and even bi-modal. Only very close to a phase transition, broader distributions in finite systems are expected by theoretical physicists and, usually, explicit formulas for such distributions are unknown. But even for parameters 2/9 (b) 1 1 0.06 (0.5,1.0) (0.5,0.7) (0.5,0.6) 0.8 P (0.5,0.5) 0.6 σ (0.5,0.4) 0.5 0.4 ●● ● ● ● ● ● 0.04 ● ● 0.02 ● 0.2 0 0 0.00 0.2 0.4 0.6 µ 0.8 1 0 ● σ ● ● 0.4 0.5 0.6 0.7 1 ● ● ● ● ● ● ● ● ●● ●●●●● ●● ●● ● ●● ●●● ●●●●●●●●●●● ● ● ● 0.00 0.25 0.50 0.75 1.00 ρ△  Figure 1. ED/DD mechanism on complete network and normally distributed thresholds, i.e F ∼ N µ, σ 2 , with mean µ and standard deviation σ . (a) (Average) final fraction of failed nodes ρ4 (color coded) on infinitely large network. The darker the color, the higher is ρ4 . (b) Distribution of ρ4 on finite network of size N = 50 with respect to different σ . µ = 0.5 is fixed. further away from the phase transition in Fig. 1(a), the average cascade size is meaningless to characterize the system. Instead, we can expect either small cascades or, as a new observation, very big ones that are likely to destroy the whole system and are relevant for systemic risk estimations. Counter-intuitively, the smaller the threshold heterogeneity, the the less predictive the system behavior becomes. This strong bi-modality is a new observation that only applies to finite systems and is not captured by risk approximations for infinite systems. To further investigate how this behavior depends on the system size N, we simulate, for parameters (µ, σ ) = (0.5, 0.4), the distribution of final cascade sizes. Monte Carlo simulations are necessary because, for systems up to N = 108 , the products of large binomial terms and small probabilities that appear in our exact derivations become unfeasible to solve numerically. Fig. 2 shows the results. We see that the bi-modality persists even for networks of size N = 107 . So, the question whether networks of that size can be reasonably described by approximations for infinite networks, is clearly answered by “no”. On the other hand, real economic networks which are prone to failure cascades are often of the order 104 -106 , for example ownership networks or collaboration networks of firms5 . Hence, it is of importance to correctly reflect finite-size effects in risk estimations of such systems. Fig. 3 shows the corresponding cascade size distributions for the star-shaped networks. Here, we have to distinguish the ED and the DD mechanisms of load distribution, which coincide only for complete networks. Fig. 3(a) shows the results for the ED mechanism. Again, we observe bi-modality in the distribution of cascade sizes that vanishes only for large threshold heterogeneity σ . The bi-modality has a clear interpretation with respect to the central node. In smaller cascades, the center does not fail, which explains the peak at low values of ρ? . But if the center fails, it triggers a significant number of further failures of leaf nodes that explains the right peak in the distribution. This bi-modality is so fundamental that it does not even vanish in the limit N → ∞, as we show in the materials and methods section. The results for the DD mechanism presented in Fig. 3(b) show that, in contrast to the ED mechanism, the distributions of the final cascade size are unimodal, even for smaller σ . Again, this can be explained with the role of the central node. Although the center fails with high probability, with the DD mechanism, its failure distributes only a small amount of load equally to the (large number) of leaf nodes. Hence, this does not cause substantial additional failures. As in infinitely large systems23 , in the presence of hubs, failure cascades involving the DD mechanism expose the system to a smaller failure risk than cascades involving the ED mechanism - at the expense that hubs usually fail. Eventually, we also discuss the third load distribution mechanism used in the fiber bundle model. Because of the additional load λ0 , more load is distributed after a cascade started. As a result, in complete networks large cascades amplify to a full system break-down shown in the very right peak at ρ4 = 1 in Fig. 4(a). This is an extreme case of the bi-modal distribution, where also small cascades can occur with high probability. As Fig. 4(b) shows, in star-like networks the range of probable cascade sizes is usually bigger. Dependent on the (µ, σ ) values of the threshold distribution, bi-modal cascade-size distributions can still occur. The peaks of the cascade-size distribution can be explained again by the survival or the failure of the central 3/9 (b) ● counts 200 ● ● ● ● N ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● 0 ● ●● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ●● ●● ● ●● ● ● ●● ●● ● ● ● ●●● ● ● ● ● ● ● ●● ● ●● ●●●● ●●● ● ● ● ● ●●● 0.3 0.6 ● ● ● 100 10000 1e+05 1e+06 1e+07 1e+08 ● ● ● ●●●●●●● 0.4 0.5 ρ△ 0.6 0.7 ρc ● ● ● 0.4 ● ● Max ● ● 0.2 left right ● 102 103 104 105 106 107 108 N Figure 2. (a) Final cascade size distribution for complete networks of several sizes N obtained via 104 independent simulations of the ED mechanism, i.e. draws from P ρ4 . The thresholds are independently normally distributed with mean µ = 0.5 and standard deviation σ = 0.4 (F ∼ N 0.5, 0.42 ). (b) Position of the two local maxima of the distributions in (a) with respect to the network size N. node. In comparison with complete networks, these peaks are often close together. Further, the lower connectivity of the star-like networks reduces the risk of large cascades. Discussion Our driving question was whether systemic risk in finite systems can be reasonably estimated from approximations valid for infinite systems. We have to negate this question for two reasons. First, taking the final size of failure cascades as a risk measure, we could demonstrate, for the first time, that the distribution of this quantity changes fundamentally in finite systems. While a unimodal and narrow distribution, typical for infinite systems, would allow to use the average cascade size as a reasonable measure, we could show that for finite systems we often have a very broad and even bi-modal distribution. Hence, an estimated average does not quantify the real risk. Instead, small cascades but also extreme larger failure cascades become more likely. Even though a complete system break-down is unlikely as we show (which may be expected for infinite, but not for finite systems), large cascades in finite systems are much more frequent than expected so far. Secondly, we could also estimate the range of sizes for which such finite size effects play a role. We found that they are important for system sizes up to 107 , i.e. these systems are quite large, even though finite. This demonstrates that corrections are needed not just for small systems of a few to a few hundred nodes. Instead, they are already necessary for all real-world systems, up to a hundred million nodes. In addition to these insights, we were able to derive novel explicit closed-form solutions to calculate the full distribution of the final cascade size, for two exemplary topologies. Our results are unique, as we derive exact solutions that apply to networks of arbitrary finite size N, a wide range of load distribution mechanisms, and arbitrary threshold distribution to characterize the robustness of the nodes. In light of the combinatorial complexity of the problem, such results are rare and crucially depend on the high symmetry of the considered networks. Complete networks and stars are of particular interest, as they appear to be systemic risk minimizing or maximizing when only the average cascade size is considered20, 21 . Intuitively, this is reasonable, as the complete graph represents the limit case of perfect risk diversification, where the risk is shared between all system components. The star network can be less prone to the amplification of failures in the course of a cascade, in particular when its central node is very robust. For that reason, central counter parties are often favored to reduce systemic risk. Yet, we have to reconsider our assessment of robust finite network topologies and take the probability of large system break-downs into account, as these are relevant for risk averse decision makers. Many further real world networks, especially economic networks, show a core-periphery structure18, 19 with densely connected core nodes and peripheral nodes loosely connected to the core. Thus, their topology can be understood as a superposition of the sample topologies discussed here, the complete network and the star network. Sparse topologies, with the star network as a paragon, occur frequently in real world networks38 and play an important role in the spreading of failures39 . These systems usually have sizes that require to consider the full cascade size distribution for the estimation of systemic risk, as we propose with our solutions. 4/9 (b) ● ● 0.15 ● ● ● ● ● P ● ● 0.4 0.5 0.8 2 4 ● P ● 0.10 0.15 σ ● 0.05 ● ● ● ● ● ● 0.00 0.4 0.5 0.8 2 4 ● ● ● ● 0.10 ● 0.05 0.00 σ ● ● ● ● ● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 0.25 0.50 ρ* 0.75 ● ● ● 1.00 ● ● 0.00 ● 0.00 ● ● ●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● 0.25 0.50 ρ* 0.75 1.00 Figure 3. Probability distribution of the final fraction of failed nodes ρ? on a star network with N = 50 nodes for the (a) ED mechanism and (b)  DD mechanism. The thresholds are normally distributed with mean µ = 0.5 and standard deviation σ (i.e. F ∼ N 0.5, σ 2 . Beyond their elegance, such closed-form formulas have the advantage that they enable explicit optimization strategies for control of the involved parameters. For instance, we can derive derivatives with respect to those parameters that inform gradient based optimization methods. This allows to design robust systems, by controlling e.g. the broadness or the convergence of the cascade size distribution. It can be also applied in restoration strategies for failed systems40 . Yet, we cannot expect to derive such analytic results for arbitrary network topologies. In this case, we have to rely on Monte Carlo simulations to estimate the broadness and shape of the cascade size distribution. We hope to inspire systemic risk analysts to base their insights and decisions on risk measures that can capture such broadness and multi-modality. Methods Derivation of cascade size distributions In finite networks, the final cascade size ρ takes discrete values in the set {0, 1/N, 2/N,  . . . , 1}. To determine the distributions P(ρ4 ) and P(ρ? ), we can calculate the probabilities for each event P ρ4 = k/N and P (ρ? = k/N), where k denotes the number of failed nodes at the end of the cascading process. Complete networks For complete networks, we can decompose the probability of k final failures into the product of the probability that N − k out of N nodes do not fail and the probability pk that exactly k nodes fail     N k = (1 − F (λ [k]))N−k pk . (1) P ρ4 = N k Recall that λ [k] denotes the load that a node with k failed neighbors carries so that F (λ [k]) is the probability that this load exceeds the node’s threshold. With the help of the inclusion-exclusion principle41 , pk can be expressed as k−1 pk = ∑ (−1)k+l+1 l=0   k F (λ [l])k−l pl . l (2) The details of this derivation and proofs are provided in the supplementary information. Apparently, our derivations apply to an even larger class of models than threshold models. The failure probability of a node, here F (λ [k]), can be any function of the number of its failed neighbors. Star networks The central node with degree d = N − 1 has a prominent role, as it is the only node that can distribute accumulated load received by other nodes. We allow it to have a different threshold cdf Fc and load function λc than the remaining N − 1 leaf nodes, which 5/9 (b) (µ,σ) ● ●● 0.15 ● P ● (µ,σ) (5,5) (1,5) (0.5,0.3) (1,1) (0.5,5) ● 0.10 P 0.20 ● 0.10 ●● ● ● ● ● 0.05 ● ● 0.05 ● ● ● ● ● ● ● ● ●●●●●●●●●●●●●●●●●● ● 0.00 ● ● 0.00 0.25 ●●●●●●●●●●●●●●●●●●● 0.50 ρ△ 0.75 1.00 (0,1) (0.3,0.5) (0.5,0.5) (0.5,1) (0.7,0.5) 0.00 0.00 0.25 0.50 ρ* ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●●●● ● 0.75 1.00 Figure 4. Fiber bundle model with initial load λ0 = 1. Probability distribution of the final fraction of failed nodes with respect  to normally distributed thresholds, i.e. F ∼ N µ + λ0 , σ 2 , on (a) complete network of size N = 30 and (b) star of size N = 50. have degree 1, threshold cdf F and carry loads of the form λr . A leaf node can fail initially with probability F (λr [0]) (with 0 neighboring failures) or, if the center has failed before, it can carry the load λr [ j, l], which depends on two additional variables that are determined by the history of the center: j and l. j denotes the number of failed leaf nodes that have distributed load to the center, before the center has failed. l indicates the number of nodes among which the accumulated load of the center is shared (when the center fails). We simply add the probabilities for all possible cases and obtain:     N −1 k = (1 − Fc (λc [k])) F (λr [0])k (1 − F (λr [0]))N−1−k P ρ? = N k     N − 1 k−1 k − 1 + Fc (λc [0]) ∑ j F (λr [0]) j (F (λr [ j, N − 1 − j]) − F (λr [0]))k−1− j k − 1 j=0     N − 1 k−1 k − 1 × (1 − F (λr [ j, N − 1 − j]))N−k + ∑ j F (λr [0]) j (Fc (λc [ j]) − Fc (λ [0])) k − 1 j=1 (3) × (F (λr [ j, N − 1 − j]) − F (λr [0]))k−1− j (1 − F (λr [ j, N − 1 − j]))N−k . The first summand considers the case when the center does not fail, while the second term adds the probability for the case when the center fails initially. Then, each of the other k − 1 failures of leaves can either occur initially or because of a load distribution by the center. The size of this load might depend on the number of nodes l that fail initially together with the center, since these nodes cannot receive load after the failure of the center. The index j in the third term finally takes the events into account when j leaves have failed before the center. Remarkably, this distribution converges for N → ∞ to a discrete distribution with non-zero probability at three events, if λc [k] and λr [ j, l] only depend on fractions of nodes (λc [k] = λc [k/N], λr [ j, l] = λr [ j/N, l/N]). In an infinitely large star, exactly F(λ0 ) of the leaves fail initially. With probability Fc (λ0 ), the center node fails as well initially so that ρ? = F(λr [0, 1 − F(λ0 )]) of the nodes fail in total. With probability Fc (λc [F(λ0 )]) − Fc (λ0 ), the center fails after the initial failures, which leads to ρ? = F(λr [F(λ0 ), 1 − F(λ0 )]). Or with probability 1 − Fc (λc [F(λ0 )]), the center does not fail and we have ρ? = F(λ0 ). In case of the ED model, two cases collapse to one because λr [0, 1 − F(λ0 )] = λr [F(λ0 ), 1 − F(λ0 )] = 1. Thus, the observed bi-modality of the distributions in Fig. 3 (a) persists for increasing network size N. Exemplary load distribution mechanisms We have discussed three basic load distribution mechanisms corresponding to the exposure diversification (ED) model, the damage diversification (DD) model and a fiber bundle model. In the following, we specify how these models define the loads used in the derivations above. 6/9 ED load redistribution In the complete graph, each load carries the load λ [k] = k/(N − 1). For the star network, λc [k] = k/(N − 1) holds for the center node and λr [0] = 0, λr [ j, l] = 1 for the leaf nodes. DD load redistribution In the complete graph, each load carries the load λ [k] = k/(N − 1). On the star network, DD corresponds to the choice λc [k] = k, λr [0] = 0, λr [ j, l] = 1/(N − 1). Fiber bundle model load redistribution On complete networks, the total load λ0 k has been redistributed so that each functional node carries λ [k] = λ0 + kλ0 /(N − k). For stars, we have λc [k] = (k + 1)λ0 , λr [0] = λ0 , λr [ j, l] = ( j + 1)λ0 /l. For finite networks of arbitrary size N, we have obtained explicit closed forms of the full probability distribution of final cascade sizes for two prominent topologies. This is a major achievement that allows us to calculate the systemic risk in a highly efficient manner. More detailed information can be found in the supplementary information. References 1. Tessone, C. J., Garas, A., Guerra, B. & Schweitzer, F. How Big Is Too Big? Critical Shocks for Systemic Failure Cascades. J. Stat. Phys. 151, 765–783 (2013). 2. Gai, P. & Kapadia, S. Contagion in financial networks. Proc. R. Soc. A 466, 2401–2423 (2010). 3. Haldane, A. G. & May, R. M. Systemic risk in banking ecosystems. Nat. 469, 351–355 (2011). 4. Delli Gatti, D., Gallegati, M., Greenwald, B., Stiglitz, J. & Battiston, S. Liaisons dangereuses: Increasing connectivity, risk sharing and systemic risk. J. economic dynamics control 36, 1121–1141 (2012). 5. Schweitzer, F. et al. Economic networks: the new challenges. Sci. 325, 422 (2009). 6. Contreras, M. G. A. & Fagiolo, G. Propagation of economic shocks in input-output networks: A cross-country analysis. Phys. Rev. E 90, 062812 (2014). URL http://link.aps.org/doi/10.1103/PhysRevE.90.062812. DOI 10.1103/PhysRevE.90.062812. 7. Klimek, P., Obersteiner, M. & Thurner, S. Systemic trade risk of critical resources. Sci. Adv. 1 (2015). URL http://advances.sciencemag.org/content/1/10/e1500522. DOI 10.1126/sciadv.1500522. http: //advances.sciencemag.org/content/1/10/e1500522.full.pdf. 8. Burkholz, R. Systemic Risk: From Generic Models to Food Trade Networks. Ph.D. thesis, ETH Zurich (2016). 9. Battiston, S. et al. Complexity theory and financial regulation. Sci. 351, 818–819 (2016). URL http:// science.sciencemag.org/content/351/6275/818. DOI 10.1126/science.aad0299. http://science. sciencemag.org/content/351/6275/818.full.pdf. 10. Kondoh, M. Foraging adaptation and the relationship between food-web complexity and stability. Sci. 299, 1388–1391 (2003). URL http://science.sciencemag.org/content/299/5611/1388. DOI 10.1126/science.1079154. http://science.sciencemag.org/content/299/5611/1388.full.pdf. 11. Briand, F., Cohen, J. E., Briand, F. & Newman, C. M. Community food webs: data and theory (Springer-Verlag Inc, Berlin; New York, 1990). 12. Sethna, J. P. et al. Hysteresis and hierarchies: Dynamics of disorder-driven first-order phase transformations. Phys. Rev. Lett. 70, 3347–3350 (1993). URL http://link.aps.org/doi/10.1103/PhysRevLett.70.3347. DOI 10.1103/PhysRevLett.70.3347. 13. Pradhan, S., Hansen, A. & Chakrabarti, B. K. Failure processes in elastic fiber bundles. Rev. Mod. Phys. 82, 499–555 (2010). URL http://link.aps.org/doi/10.1103/RevModPhys.82.499. DOI 10.1103/RevModPhys.82.499. 14. Pastor-Satorras, R., Castellano, C., Van Mieghem, P. & Vespignani, A. Epidemic processes in complex networks. Rev. Mod. Phys. 87, 925–979 (2015). URL http://link.aps.org/doi/10.1103/RevModPhys.87.925. DOI 10.1103/RevModPhys.87.925. 15. Heesterbeek, H. et al. Modeling infectious disease dynamics in the complex landscape of global health. Sci. 347 (2015). URL http://science.sciencemag.org/content/347/6227/aaa4339. DOI 10.1126/science.aaa4339. http://science.sciencemag.org/content/347/6227/aaa4339.full.pdf. 7/9 16. Stark, H.-U., Tessone, C. J. & Schweitzer, F. Decelerating microdynamics can accelerate macrodynamics in the voter model. Phys. Rev. Lett. 101, 018701 (2008). URL http://link.aps.org/doi/10.1103/PhysRevLett.101. 018701. DOI 10.1103/PhysRevLett.101.018701. 17. Motter, A. E. & Lai, Y.-C. Cascade-based attacks on complex networks. Phys. Rev. E 66, 065102 (2002). URL http://link.aps.org/doi/10.1103/PhysRevE.66.065102. DOI 10.1103/PhysRevE.66.065102. 18. Verma, T., Russmann, F., Araujo, N. A. M., Nagler, J. & Herrmann, H. J. Emergence of core-peripheries in networks. Nat. Commun. 7, 10441– (2016). 19. Glasserman, P. & Young, H. P. Contagion in financial networks. J. Econ. Lit. 54, 779–831 (2016). URL http: //www.aeaweb.org/articles?id=10.1257/jel.20151228. DOI 10.1257/jel.20151228. 20. Acemoglu, D., Ozdaglar, A. & Tahbaz-Salehi, A. Systemic risk and stability in financial networks. Am. Econ. Rev. 105, 564–608 (2015). URL http://www.aeaweb.org/articles?id=10.1257/aer.20130456. DOI 10.1257/aer.20130456. 21. Acemoglu, D., Ozdaglar, A. & Tahbaz-Salehi, A. Networks, shocks, and systemic risk. Working Paper 20931, National Bureau of Economic Research (2015). URL http://www.nber.org/papers/w20931. 22. Watts, D. J. A Simple Model of global cascades on random networks. Proc. Natl. Acad. Sci. U.S.A. 99, 5766 (2002). 23. Burkholz, R., Garas, A. & Schweitzer, F. How damage diversification can reduce systemic risk. Phys. Rev. E 93, 042313 (2016). URL http://link.aps.org/doi/10.1103/PhysRevE.93.042313. DOI 10.1103/PhysRevE.93.042313. 24. Gleeson, J. P. & Cahalane, D. Seed size strongly affects cascades on random networks. Phys. Rev. E 75, 1–4 (2007). 25. Payne, J., Dodds, P. & Eppstein, M. Information cascades on degree-correlated random networks. Phys. Rev. E 80, 026125 (2009). 26. Hurd, T. & Gleeson, J. On Watts’ cascade model with random link weights. J. Complex Networks 1, 1–24 (2013). 27. Burkholz, R., Leduc, M. V., Garas, A. & Schweitzer, F. Systemic risk in multiplex networks with asymmetric coupling and threshold feedback. Phys. D: Nonlinear Phenom. 323–324, 64 – 72 (2016). URL http://www.sciencedirect. com/science/article/pii/S0167278915001943. DOI http://dx.doi.org/10.1016/j.physd.2015.10.004. Nonlinear Dynamics on Interconnected Networks. 28. Burkholz, R. & Schweitzer, F. Correlations between thresholds and degrees: An analytic approach to model attacks and failure cascades. arXiv:1706.04451 (2017). arXiv:1706.04451. 29. Watts, D. J. & Dodds, P. S. Influentials, networks, and public opinion formation. J. consumer research 34, 441–458 (2007). 30. Battiston, S., Delli Gatti, D., Gallegati, M., Greenwald, B. C. N. & Stiglitz, J. E. Credit Default Cascades: When Does Risk Diversification Increase Stability? J. Financial Stab. 8, 138–149 (2012). 31. Amini, H., Cont, R. & Minca, A. Resilience to contagion in financial networks. Math. Finance 26, 329–365 (2016). URL http://dx.doi.org/10.1111/mafi.12051. DOI 10.1111/mafi.12051. 32. Battiston, S., Caldarelli, G., May, R. M., Roukny, T. & Stiglitz, J. E. The price of complexity in financial networks. Proc. Natl. Acad. Sci. 113, 10031–10036 (2016). URL http://www.pnas.org/content/113/36/10031. abstract. DOI 10.1073/pnas.1521573113. http://www.pnas.org/content/113/36/10031.full.pdf. 33. Lorenz, J., Battiston, S. & Schweitzer, F. Systemic risk in a unifying framework for cascading processes on networks. Eur. Phys. J. B 71, 441–460 (2009). 34. Daniels, H. E. The statistical theory of the strength of bundles of threads. i. Proc. Royal Soc. Lond. Ser. A, Math. Phys. Sci. (1934-1990) 183, 405–435 (1945). URL http://dx.doi.org/10.1098/rspa.1945.0011. 35. Dobson, I., Carreras, B. A. & Newman, D. E. A loading-dependent model of probabilistic cascading failure. Probab. Eng. Informational Sci. 19, 15–32 (2005). URL http://journals.cambridge.org/article_ S0269964805050023. DOI 10.1017/S0269964805050023. 36. Moreno, Y., Gómez, J. B., Pacheco, A. F., Gomez, J. B. & Pacheco, A. F. Instability of scale-free networks under nodebreaking avalanches. Europhys. Lett. (EPL) 58, 630–636 (2002). URL http://stacks.iop.org/0295-5075/ 58/i=4/a=630?key=crossref.806b054987dc0de948793132992f082d. DOI 10.1209/epl/i2002-00442-2. 37. Burkholz, R. & Schweitzer, F. A framework for cascade size calculations on random networks. arXiv preprint (2017). URL https://arxiv.org/abs/1701.06970. 1701.06970. 8/9 38. Barabási, A.-L. & Albert, R. Emergence of scaling in random networks. Sci. 286, 509–512 (1999). URL http://science.sciencemag.org/content/286/5439/509. DOI 10.1126/science.286.5439.509. http: //science.sciencemag.org/content/286/5439/509.full.pdf. 39. Dorogovtsev, S. N. & Mendes, J. F. F. Evolution of Networks: From Biological Nets to the Internet and WWW (Physics) (Oxford University Press, Inc., New York, NY, USA, 2003). 40. Liu, C., Li, D., Zio, E. & Kang, R. A modeling framework for system restoration from cascading failures. PLoS ONE 9, e112363 (2014). URL http://dx.doi.org/10.1371%2Fjournal.pone.0112363. DOI 10.1371/journal.pone.0112363. 41. Szpankowski, W. Inclusion-Exclusion Principle, 49–72 (John Wiley & Sons, Inc., 2001). URL http://dx.doi.org/ 10.1002/9781118032770.ch3. Acknowledgements RB acknowledges support by the ETH48 project. FS acknowledges support by the EU-FET project MULTIPLEX 317532. Author contributions statement R.B., F.S., H.J.H. designed the research. R.B. derived the formulas for the cascade size distribution, implemented them, and performed corresponding simulations. All authors discussed the results and wrote the paper. Additional information The authors declare no competing financial interests. 9/9
10math.ST
Artificial Intelligence and Statistics arXiv:1712.03779v1 [stat.ML] 8 Dec 2017 Bin Yu1,2 and Karl Kumbier1 Departments of 1 Statistics and 2 EECS University of California at Berkeley December 12, 2017 Abstract Artificial intelligence (AI) is intrinsically data-driven. It calls for the application of statistical concepts through human-machine collaboration during generation of data, development of algorithms, and evaluation of results. This paper discusses how such human-machine collaboration can be approached through the statistical concepts of population, question of interest, representativeness of training data, and scrutiny of results (PQRS). The PQRS workflow provides a conceptual framework for integrating statistical ideas with human input into AI products and research. These ideas include experimental design principles of randomization and local control as well as the principle of stability to gain reproducibility and interpretability of algorithms and data results. We discuss the use of these principles in the contexts of self-driving cars, automated medical diagnoses, and examples from the authors’ collaborative research. Modern Artificial Intelligence (AI) can be traced back to at least work from 1943 that highlighted the connection between neural events and propositional logic1 . Over the years, AI has grown into a transdisciplinary field, integrating and transforming ideas from computer science, statistics/machine learning, psychology, neuroscience, materials science, mechanical engineering, and computer hardware design. Excitement surrounding AI is now exploding. Ideas drawn from the field form the core of both start-ups and academic divisions, and new developments are being reported throughout the media with increased frequency. This excitement is driven in part by the empirical successes of AI products that are now available to consumers world-wide. The “magic” of AI can be captivating, with new AI products like the Amazon echo responding almost effortlessly with in depth answers to user queries. However, once one recognizes that these detailed responses barely extend beyond quoted Wikipedia articles, the substantial human input behind the “magic” of AI is illuminated. The Echo is a smart speaker that uses a wireless connection to search information over the internet. This information is created by humans in the form of writing, speech, and music. In other words, the Echo’s responses are derived from human-machine collaboration, analyzing manually generated data through algorithms designed and tested by Amazon’s researchers (with the help of powerful computing and IT technologies). Similarly, AI products based on computer vision 1 Warren S. McCulloch and Walter Pitts (1943). A logical calculus of the ideas immanent in nervous activity. Bulletin of Mathematical Biophysics 5:115-133. 1 rely on powerful human-machine collaborations through deep learning algorithms engineered by researchers and manually generated data such as the ImageNet Database, which contains roughly 14 million labeled images representing over 1000 categories. Current AI research shares this reliance on human-machine collaboration, in both the data-generation phase and in algorithm design and testing. For example, we are working with the Gallant neuroscience Lab at UC Berkeley to combine convolutional neural networks (CNNs) (trained on ImageNet) and regression methods to characterize neurons in primate visual cortex area V4. Poster children of today’s AI applications include self-driving cars and automated medical diagnoses, such as those that identify the cause of a stroke using CT scans2 . Both applications rely heavily on computer vision algorithms, which in turn rely on manually generated data. Mr. Tim Bradshaw declared in his 2017 Financial Times article3 : “Self-driving cars prove to be labour-intensive for humans”. He went on to describe that most self-driving car companies hire hundreds or thousands of people to label video footage in order to teach algorithms to recognize obstacles such as pedestrians. He then quoted Matt Bencke, founder and chief executive of Mighty.Ai, saying “AI practitioners, in my mind, have collectively had an arrogant blind spot, which is that computers will solve everything.” Properly framing data collection and analysis is critical for AI products, and can be achieved through human-machine collaboration using classical statistical concepts: population, question of interest, representativeness of training data, and scrutiny of results (PQRS). The PQRS workflow represents key steps in arriving at data-driven decisions, and was coined by the first author in the process of co-creating and co-teaching a new advanced undergraduate data science course at Berkeley4 . A population (P) reflects the conditions under which observations were generated and forms the foundation of sampling inference. Understanding P helps one recognize randomness in the data generating process, and hence the uncertainty (or errors) in a data result. The question of interest (Q) provides context for an analysis and allows one to incorporate domain knowledge. In statistical and causal inference, Q is related to the estimand of interest. Representativeness of training data (R) is closely related to P and plays a similarly central role in sampling inference. It assesses whether the available training data provide relevant information on a population (relative to the question asked). The thought process of asking whether the population has changed, or whether the training and test data are similar addresses P and R simultaneously. Finally, scrutiny (S) describes the process of evaluating data results or algorithm outputs in the context of PQR. Scrutiny relates to ideas from model checking5 , including both exploratory data analysis and confirmatory data anlysis. The PQRS workflow provides four concrete steps to think through the cycle of data analysis and algorithm development for data-driven decisions, including those required for self-driving cars and automated medical diagnosis. For instance, answering how dynamic weather, traffic, and construction conditions affect pedestrian recognition can be viewed through the lens of PQRS. Similarly, the relationship between patient characteristics such as age, gender, and previous medical conditions and automated medical diagnoses can be approached using the steps of PQRS. These steps require human input from both domain experts who understand a problem’s context and analysts 2 https://www.newyorker.com/magazine/2017/04/03/ai-versus-md https://www.ft.com/content/36933cfc-620c-11e7-91a7-502f7ee26895 4 http://www.ds100.org/sp17/ 5 Gelman, Andrew. ”A Bayesian Formulation of Exploratory Data Analysis and Goodness?of?fit Testing.” International Statistical Review 71.2 (2003): 369-382. 3 2 who must obtain data results. It is always the case that such data results will be applied to new individuals or situations. Framing the data collection and analysis can prevent incorrect answers that result from improper context, which can be fatal in the case of self-driving cars and medical diagnoses. PQRS provide effective conceptual devices to integrate human input into these tasks, rescuing the “magic” of AI from failure and meeting the challenges of a dynamic environments head-on. The final component of the PQRS workflow, S (scrutiny), builds on notions of interpretability to evaluate data results. Interpretability comes in a variety of forms that include, but are not limited to: algorithmic interpretability (i.e. how does an algorithm map features to responses), and domain interpretability (i.e. what does a data result say in the context of a particular problem). Human input is critical here as well, since interpretability must be defined with respect to an individual (e.g. expert v. non-expert). In the area of automated medical diagnosis, and more broadly, human interpretability of algorithms and data results is becoming a necessity. In fact, the EU General Data Protection Regulation (2016) has stipulated the “right” of users to explanations of algorithms and data results. Thus automated medical diagnosis algorithms have to be explainable to both doctors and patients. Currently, many supervised learning algorithms widely used in AI products cannot be well-explained. For example, deep learning algorithms are notoriously difficult to interpret even for deep learning researchers, despite the fact that they deliver state-of-the-art prediction performances. To aid interpretability and increase reproducibility of algorithms and data results, the first author has advocated for the use of the stability principle6 . This principle is conceptually simple to understand and practically easy to use. It unifies a myriad of works in the literature, starting at least in the 40’s, and provides a platform to develop new stability-based methods. On one hand, it combines the philosophical principle of stability of knowledge with the reproducibility principle of science. On the other hand, it connects to statistical inference or uncertainty assessment. Applying the stability principle requires human input to clearly define both appropriate perturbation(s) to data and/or models and stability measure(s). For instance, deep learning algorithms are stable for prediction-based metrics, but not for interpretability metrics that rely on the fitted weights. Appropriateness is a heavily loaded word and is to be judged carefully by humans in terms of both the data generation process and domain knowledge. For algorithm development related to automated medical diagnosis, at least two forms of data perturbations seem appropriate. One is to use a sub-sample of all CT scans from all patients in the training set and study the stability of the algorithm outputs relative to the different subsamples. The other is to add a small amount of noise to the scans to see how the diagnosis changes. The tolerable level of instability is a domain matter that users must develop in context and in collaboration with subject matter experts such as doctors. It is one measure of uncertainty to take into account when conveying the diagnosis result to a patient. The stability principle can be applied to interpret supervised learning algorithms whose means of prediction are otherwise impenetrable, making it easier for humans to scrutinize results. For example, the authors’ research group incorporates stability into their current genomics work to identify candidate regulatory interactions. Specifically, they stabilize Random Forest decision paths through the iterative Random Forests (iRF)7 algorithm to recover the high-order, non-linear interactions 6 7 Bin Yu (2013). Stability. Bernoulli 19(4), 1484 - 1500. Sumanta Basu, Karl Kumbier, James B. Brown, Bin Yu (2017). Iterative Random Forests to detect predictive 3 learned by the popular supervised learning method. The algorithm integrates domain knowledge regarding the thresholding phenomenon of biomolecular interactions8 through the thresholding mechanism of decision trees. iRF empirically demonstrates the value of the stability principle, identifying a high-quality set of stable interactions, of which 80% of the pairwise interactions have been previously reported in fruitfly genomics experiments. It holds great promise for effectively directing experimental efforts to discover third or higher-order interactions at the frontiers of systems biology. We note that the scrutiny step in this project required both stable, interpretable interactions and human-generated wet lab data to evaluate the quality of pairwise results. Causal effects can also be viewed through the lens of stability as interpretable and stable mechanisms underlying a data generating process. To help doctors decide on drug treatment plans, randomized experiments (or A/B tests) are used to assign patients to treatment and control groups and evaluate the effect of a drug. This brings up the randomization principle of statistical experimental design for effective data collection in causal inference9 . For personal or precision medical diagnosis and treatment, it can be preferable to find a smaller subgroup of patients that are similar to the patient under consideration and carry out the stability analysis for this group. This type of analysis represents an instance of the “local control” principle of statistical experimental design, which reduces uncertainty or variability induced by conditioning, or grouping, according to features of a patient that are related to the outcome. This is a challenging proposition since it is difficult to find the relevant dimensions over which to group the patients, even with “big data”, and such groups can be very small with low estimation power. Once again, interpreting algorithmic outputs so they can be scrutinized by subject matter experts, relative to a question of interest, can aid in this decision process. Data-driven decisions are at the core of AI. These decisions often rely on human input, particularly for cutting-edge AI products such as Amazon Echo, self-driving cars, and automated medical diagnosis. For these particular products, reliance on manual inputs will likely decrease. However, the demand will be taken up by new AI applications. The PQRS workflow provides one approach for incorporating human input into AI products through simple statistical ideas including experimental design principles10 of randomization and local control as well as the stability principle. Integrating these concepts into analyses is useful for efficient and effective collection and use of data as well as for interpretability and reproducibility of AI algorithms and data results. The authors view it as AI’s holy grail to reproduce the unconscious mind, which is yet to be clearly defined for human intelligence, and see an AI future in which humans and statistics continue to play indispensable roles. Acknowledgements The authors thank Bryan Liu and Rebecca Barter for their helpful comments. Partial supports are gratefully acknowledged from ARO grant W911NF1710005, NSF grants DMS1613002 and IIS 1741340, the Center for Science of Information (CSoI), a US NSF Science and Technology Center, under grant agreement CCF-0939370, and the National Library Of Medicine of the NIH under Award Number T32LM012417. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH. and stable high-order interactions. https://arxiv.org/abs/1706.08457 8 Wolpert, Lewis. ”Positional information and the spatial pattern of cellular differentiation.” Journal of theoretical biology 25.1 (1969): 1-47. 9 Guido W. Imbens and Donald B. Rubin (2015). Causal Inference for Statistics, Social, and Biomedical Sciences: An Introduction. Cambridge University Press. 10 George E. P. Box, J. Stuart Hunter, William G. Hunter (2005). Statistics for Experimenters: Design, Innovation, and Discovery, 2nd Edition, Wiley. 4
2cs.AI
Data-Efficient Policy Evaluation Through Behavior Policy Search Josiah P. Hanna 1 Philip S. Thomas 2 3 Peter Stone 1 Scott Niekum 1 arXiv:1706.03469v1 [cs.AI] 12 Jun 2017 Abstract We consider the task of evaluating a policy for a Markov decision process (MDP). The standard unbiased technique for evaluating a policy is to deploy the policy and observe its performance. We show that the data collected from deploying a different policy, commonly called the behavior policy, can be used to produce unbiased estimates with lower mean squared error than this standard technique. We derive an analytic expression for the optimal behavior policy—the behavior policy that minimizes the mean squared error of the resulting estimates. Because this expression depends on terms that are unknown in practice, we propose a novel policy evaluation sub-problem, behavior policy search: searching for a behavior policy that reduces mean squared error. We present a behavior policy search algorithm and empirically demonstrate its effectiveness in lowering the mean squared error of policy performance estimates. 1. Introduction Many sequential decision problems, including diabetes treatment (Bastani, 2014), digital marketing (Theocharous et al., 2015), and robot control (Lillicrap et al., 2015), are modeled as Markov decision processes (MDPs) and solved using reinforcement learning (RL) algorithms. One important problem when applying RL to real problems is policy evaluation. The goal in policy evaluation is to estimate the expected return (sum of rewards) produced by a policy. We refer to this policy as the evaluation policy, πe . The standard policy evaluation approach is to repeatedly deploy πe and average the resulting returns. While this naı̈ve Monte Carlo estimator is unbiased, it may have high variance. 1 The University of Texas at Austin, Austin, Texas, USA The University of Massachusetts, Amherst, Massachusetts, USA 3 Carnegie Mellon University, Pittsburgh, Pennsylvania, USA. Correspondence to: Josiah P. Hanna <[email protected]>. Methods that evaluate πe while selecting actions according to πe are termed on-policy. Previous work has addressed variance reduction for on-policy returns (Zinkevich et al., 2006; White & Bowling, 2009; Veness et al., 2011). An alternative approach is to estimate the performance of πe while following a different, behavior policy, πb . Methods that evaluate πe with data generated from πb are termed offpolicy. Importance sampling (IS) is one standard approach for using off-policy data in RL. IS reweights returns observed while executing πb such that they are unbiased estimates of the performance of πe . Presently, IS is usually used when off-policy data is already available or when executing πe is impractical. If πb is not chosen carefully, IS often has high variance (Thomas et al., 2015). For this reason, an implicit assumption in the RL community has generally been that on-policy evaluation is more accurate when it is feasible. However, IS can also be used for variance reduction when done with an appropriately selected distribution of returns (Hammersley & Handscomb, 1964). While IS-based variance reduction has been explored in RL, this prior work has required knowledge of the environment’s transition probabilities and remains onpolicy (Desai & Glynn, 2001; Frank et al., 2008; Ciosek & Whiteson, 2017). In contrast to this earlier work, we show how careful selection of the behavior policy can lead to lower variance policy evaluation than using the evaluation policy and do not require knowledge of the environment’s transition probabilities. In this paper, we formalize the selection of πb as the behavior policy search problem. We introduce a method for this problem that adapts the policy parameters of πb with gradient descent on the variance of importance-sampling. Empirically we demonstrate behavior policy search with our method lowers the mean squared error of estimates compared to on-policy estimates. To the best of our knowledge, this work is the first to propose adapting the behavior policy to obtain better policy evaluation in RL. Furthermore we present the first method to address this problem. 2 Proceedings of the 34 th International Conference on Machine Learning, Sydney, Australia, PMLR 70, 2017. Copyright 2017 by the author(s). 2. Preliminaries This section details the policy evaluation problem setting, the Monte Carlo and Advantage Sum on-policy methods, and importance-sampling for off-policy evaluation. Data-Efficient Policy Evaluation Through Behavior Policy Search 2.1. Background 2.3. Advantage Sum Estimates We use notational standard MDPNv1 (Thomas, 2015), and for simplicity, we assume that S, A, and R are finite.1 Let H := (S0 , A0 , R0 , S1 , . . . , SL , AL , RL ) be a trajectory PL and g(H) := t=0 γ t Rt be the discounted return of trajectory H. Let ρ(π) := E[g(H)|H ∼ π] be the expected discounted return when the stochastic policy π is used from S0 sampled from the initial state distribution. In this work, we consider parameterized policies, πθ , where the distribution over actions is determined by the vector θ. We assume that the transitions and reward function are unknown and that L is finite. Like the Monte-Carlo estimator, the advantage sum (ASE) estimator selects θ i = θ e for all i. However, it introduces a control variate to reduce the variance without introducing bias. This control variate requires an approximate model of the MDP to be provided. Let the reward function of this model be given as r̂(s, a). Let q̂ πe (st , at ) = PL 0 E[ t0 =t γ t r̂(st0 , at0 )] and v̂ πe (st ) = E[q̂ πe (st , at )|at ∼ πe ], i.e., the action-value function and state-value function of πe in this approximate model. Then, the advantage sum estimator is given by: We are given an evaluation policy, πe , for which we would like to estimate ρ(πe ). We assume there exists a policy parameter vector θ e such that πe = πθe and that this vector is known. We consider an incremental setting where, at iteration i, we sample a single trajectory Hi with a policy πθi and add {Hi , θ i } to a set D. We use Di to denote the set at iteration i. Methods that always (i.e., ∀i) choose θ i = θ e are on-policy; otherwise, the method is off-policy. A policy evaluation method, PE, uses all trajectories in Di to estimate ρ(πe ). Our goal is to design a policy evaluation algorithm that produces estimates of ρ(πe ) that have low mean squared error (MSE). Formally, the goal of policy evaluation with PE is to minimize (PE(Di ) − ρ(πe ))2 . While other measures of policy evaluation accuracy could be considered, we follow earlier work in using MSE (e.g., (Thomas & Brunskill, 2016; Precup et al., 2000)). AS(Di ) := We focus on unbiased estimators of ρ(πe ). While biased estimators (e.g., bootstrapping methods (Sutton & Barto, 1998), approximate models (Kearns & Singh, 2002), etc.) can sometimes produce lower MSE estimates they are problematic for high risk applications requiring confidence intervals. For unbiased estimators, minimizing variance is equivalent to minimizing MSE. 2.4. Importance Sampling i L 1 XX t γ (Rt − q̂ πe (St , At ) + v̂ πe (St )). i + 1 j=0 t=0 Intuitively, ASE is replacing part of the randomness of the Monte Carlo return with the known expected return under the approximate model. Provided q πe (St , At ) − v̂ πe (St ) is sufficiently correlated with Rt , the variance of ASE is less than that of MC. Notice that, like the MC estimator, the ASE estimator is on-policy, in that the behavior policy is always the policy that we wish to evaluate. Intuitively it may seems like this choice should be optimal. However, we will show that it is not—selecting behavior policies that are different from the evaluation policy can result in estimates of ρ(πe ) that have lower variance. Importance Sampling is a method for reweighting returns from a behavior policy, θ, such that they are unbiased returns from the evaluation policy. In RL, the re-weighted IS return of a trajectory, H, sampled from πθ is: IS(H, θ) := g(H) 2.2. Monte-Carlo Estimates Perhaps the most commonly used policy evaluation method is the on-policy Monte-Carlo (MC) estimator. The estimate of ρ(πe ) at iteration i is the average return: L Y πe (St |At ) . π (St |At ) t=0 θ The IS off-policy estimator is then a Monte Carlo estimate of E [IS(H, θ)|H ∼ πθ ]: i i L i IS(Di ) := 1 X 1 XX t γ Rt = g(Hj ). MC(Di ) := i + 1 j=0 t=0 i + 1 j=0 This estimator is unbiased and strongly consistent given mild assumptions.2 However, this method can have high variance. 1 The methods, and theoretical results discussed in this paper are applicable to both finite and infinite S, A and R as well as partially-observable Markov decision processes. 2 Being a strongly consistent estimator of ρ(πe ) means that 1 X IS(Hj , θ j ). i + 1 j=0 In RL, importance sampling allows off-policy data to be used as if it were on-policy. In this case the variance of the IS estimate is often much worse than the variance of on-policy MC estimates because the behavior policy is not Pr  lim MC(Di ) = ρ(πe ) i→∞  = 1. If ρ(πe ) exists, MC is strongly consistent by the Khintchine Strong law of large numbers (Sen & Singer, 1993). Data-Efficient Policy Evaluation Through Behavior Policy Search chosen to minimize variance, but is a policy that is dictated by circumstance. 3. Behavior Policy Search Importance sampling was originally intended as a variance reduction technique for Monte Carlo evaluation (Hammersley & Handscomb, 1964). When an evaluation policy rarely samples trajectories with high magnitude returns a Monte Carlo evaluation will have high variance. If a behavior policy can increase the probability of observing such trajectories then the off-policy IS estimate will have lower variance than an on-policy Monte Carlo estimate. In this section we first describe the theoretical potential for variance reduction with an appropriately selected behavior policy. In general this policy will be unknown. Thus, we propose a policy evaluation subproblem — the behavior policy search problem — solutions to which will adapt the behavior policy to provide lower mean squared error policy performance estimates. To the best of our knowledge, we are the first to propose behavior policy adaptation for policy evaluation. 3.1. The Optimal Behavior Policy An appropriately selected behavior policy can lower variance to zero. While this fact is generally known for importance-sampling, we show here that this policy exists for any MDP and evaluation policy under two restrictive assumptions: all returns are positive and the domain is deterministic. In the following section we describe how an initial policy can be adapted towards the optimal behavior policy even when these conditions fail to hold. QL Let wπ (H) := t=0 π(At |St ). Consider a behavior policy πb? such that for any trajectory, H: ρ(πe ) = IS(H, πb? ) = g(H) wπe (H) . wπb? (H) Rearranging the terms of this expressions yields: wπb? (H) = g(H) wπe (H) . ρ(πe ) Thus, if we can select πb? such that the probability of obg(H) serving any H ∼ πb? is ρ(π times the likelihood of obe) serving H ∼ πe then the IS estimate has zero MSE with only a single sampled trajectory. Regardless of g(H), the importance-sampled return will equal ρ(πe ). Furthermore, the policy πb? exists within the space of all feasible stochastic policies. Consider that a stochastic policy can be viewed as a mixture policy over time-dependent (i.e., action selection depends on the current time-step) deterministic policies. For example, in an MDP with one state, two actions and a horizon of L there are 2L possible time-dependent deterministic policies, each of which defines a unique sequence of actions. We can express any evaluation policy as a mixture of these deterministic policies. The optimal behavior policy πb? can be expressed similarly and thus the optimal behavior policy exists. Unfortunately, the optimal behavior policy depends on the unknown value ρ(πe ) as well as the unknown reward function R (via g(H)). Thus, while there exists an optimal behavior policy for IS – which is not πe – in practice we cannot analytically determine πb? . Additionally, πb? may not be representable by any θ in our policy class. 3.2. The Behavior Policy Search Problem Since the optimal behavior policy cannot be analytically determined, we instead propose the behavior policy search (BPS) problem for finding πb that lowers the MSE of estimates of ρ(πe ). A BPS problem is defined by the inputs: 1. An evaluation policy πe with policy parameters θ e . 2. An off-policy policy evaluation algorithm, OPE(H, θ), that takes a trajectory, H ∼ πθ , or, alternatively, a set of trajectories, and returns an estimate of ρ(πe ). A BPS solution is a policy, πθb such that off-policy estimates with OPE have lower MSE than on-policy estimates. Methods for this problem are BPS algorithms. Recall we have formalized policy evaluation within an incremental setting where one trajectory for policy evaluation is generated each iteration. At the ith iteration, a BPS algorithm selects a behavior policy that will be used to generate a trajectory, Hi . The policy evaluation algorithm, OPE, then estimates ρ(πe ) using trajectories in Di . Naturally, the selection of the behavior policy depends on how OPE estimates ρ(πe ). In a BPS problem, the ith iteration proceeds as follows. i−1 First, given all of the past behavior policies, {θ i }i=0 , and i−1 the resulting trajectories, {Hi }i=0 , the BPS algorithm must select θ i . The policy πθi is then run for one episode to create the trajectory Hi . Then the BPS algorithm uses OPE to estimate ρ(πe ) given the available data, Di := {(θ i , Hi )}ii=0 . In this paper, we consider the one-step problem of selecting θ i and estimating ρ(πe ) at iteration i in a way that minimizes MSE. That is, we do not consider how our selection of θ i will impact our future ability to select an appropriate θ j for j > i and thus to produce more accurate estimates in the future. One natural question is: if we are given a limit on the number of trajectories that can be sampled, is it better to “spend” some of our limited trajectories on BPS instead of using on-policy estimates? Since each OP E(Hi , θ i ) is an unbiased estimator of ρ(πe ), we can use all sampled trajectories to compute OPE(Di ). Provided for all itera- Data-Efficient Policy Evaluation Through Behavior Policy Search tions, Var[OPE(H, θ i )] ≤ V ar[M C] then, in expectation, a BPS algorithm will always achieve lower MSE than MC, showing that it is, in fact, worthwhile to do so. This claim is supported by our empirical study. 4. Behavior Policy Gradient Theorem We now introduce our primary contributions: an analytic expression for the gradient of the mean squared error of the IS estimator and a stochastic gradient descent algorithm that adapts θ to minimize the MSE between the IS estimate and ρ(πe ). Our algorithm — Behavior Policy Gradient (BPG) — begins with on-policy estimates and adapts the behavior policy with gradient descent on the MSE with respect to θ. The gradient of the MSE with respect to the policy parameters is given by the following theorem: Theorem 1. " L X ∂ ∂ MSE[IS(H, θ)] = E − IS(H, θ)2 log πθ (At |St ) ∂θ ∂θ t=0 # where the expectation is taken over H ∼ πθ . Proof. Proofs for all theoretical results are included in Appendix A. BPG uses stochastic gradient descent in place of exact gradient descent: replacing the intractable expectation in Theorem 1 with an unbiased estimate of the true gradient. In our experiments, we sample a batch, Bi , of k trajectories with πθi to lower the variance of the gradient estimate at iteration i. In the BPS setting, sampling a batch of trajectories is equivalent to holding θ fixed for k iterations and then updating θ with the k most recent trajectories used to compute the gradient estimate. Full details of BPG are given in Algorithm 1. At iteration i, BPG samples a batch, Bi , of k trajectories and adds {(θ i , Hi )ki=0 } to a data set D (Lines 4-5). Then BPG updates θ with an empirical estimate of Theorem 1 (Line 6). After n iterations, the BPG estimate of ρ(πe ) is IS(Dn ) as defined in Section 2.4. Given that the step-size, αi , is consistent with standard gradient descent convergence conditions, BPG will converge to a behavior policy that locally minimizes the variance (Bertsekas & Tsitsiklis, 2000). At best, BPG converges to the globally optimal behavior policy within the parameterization of πe . Since the parameterization of πe determines the class of representable distributions it is possible that the theoretically optimal behavior policy is unrepresentable under this parameterization. Nevertheless, a suboptimal behavior policy still yields better estimates of ρ(πe ), provided it decreases variance compared to on-policy returns. Algorithm 1 Behavior Policy Gradient Input: Evaluation policy parameters, θ e , batch size k, a step-size for each iteration, αi , and number of iterations n. Output: Final behavior policy parameters θ n and the IS estimate of ρ(πe ) using all sampled trajectories. 1: θ 0 ← θ e 2: D0 = {} 3: for all i ∈ 0...n do 4: Bi = Sample k trajectories H ∼ πθi 5: Di+1 = Di ∪ Bi L X X ∂ 6: θ i+1 = θ i + αki IS(H, θ)2 log πθi (At |St ) ∂θ t=0 H∈B 7: end for 8: Return θ n , IS(Dn ) 4.1. Control Variate Extension In cases where an approximate model is available, we can further lower variance adapting the behavior policy of the doubly robust estimator (Jiang & Li, 2016; Thomas & Brunskill, 2016). Based on a similar intuition as the Advantage Sum estimator (Section 2.3), the Doubly Robust (DR) estimator uses the value functions of an approximate model as a control variate to lower the variance of importancesampling.3 We show here that we can adapt the behavior policy to lower the mean squared error of DR estimates. We denote this new method DR-BPG for Doubly Robust Behavior Policy Gradient. Qt Let wπ,t (H) = i=0 π(At |St ) and recall that v̂ πe and q̂ πe are the state and action value functions of πe in the approximate model. The DR estimator is: L X wπe ,t (Rt −q̂ πe (St , At )+v̂ πe (St+1 )). DR(H, θ) := v̂(S0 )+ w πθ ,t t=0 We can reduce the mean squared error of DR with gradient descent using unbiased estimates of the following corollary to Theorem 1: Corollary 1. L X ∂ ∂ MSE [DR(H, θ)] = E[(DR(H, θ)2 log πθ (At |St ) ∂θ ∂θ t=0 L t X wπ ,t X ∂ − 2 DR(H, θ)( γ t δt e log πθ (Ai |Si ))] wθ,t i=0 ∂θ t=0 where δt = Rt − q̂(St , At ) + v̂(St+1 ) and the expectation is taken over H ∼ πθ . ∂ M SE is analogous to the gradient of The first term of ∂θ the importance-sampling estimate with IS(H, θ) replaced 3 DR lowers the variance of per-decision importance-sampling which importance samples the per time-step reward. Data-Efficient Policy Evaluation Through Behavior Policy Search by DR(H, θ). The second term accounts for the covariance of the DR terms. AS and DR both assume access to a model, however, they make no assumption about where the model comes from except that it must be independent of the trajectories used to compute the final estimate. In practice, AS and DR perform best when all trajectories are used to estimate the model and then used to estimate ρ(πe ) (Thomas & Brunskill, 2016). However, for DR-BPG, changes to the model change the surface of the MSE objective we seek to minimize and thus DR-BPG will only converge once the model stops changing. In our experiments, we consider both a changing and a fixed model. 4.2. Connection to REINFORCE BPG is closely related to existing work in policy gradient RL (c.f., (Sutton et al., 2000)) and we draw connections between one such method and BPG to illustrate how BPG changes the distribution of trajectories. REINFORCE (Williams, 1992) attempts to maximize ρ(πθ ) through gradient ascent on ρ(πθ ) using the following unbiased gradient of ρ(πθ ): # " L X ∂ ∂ ρ(πθ ) = E g(H) log πθ (At |St ) H ∼ πθ . ∂θ ∂θ t=0 Intuitively, REINFORCE increases the probability of all actions taken during H as a function of g(H). This update increases the probability of actions that lead to high return trajectories. BPG can be interpreted as REINFORCE where the return of a trajectory is the square of its importance-sampled return. Thus BPG increases the probability of all actions taken along H as a function of IS(H, θ)2 . The magnitude of IS(H, θ)2 depends on two qualities of H: 1. g(H)2 is large (i.e., a high magnitude event). 2. H is rare relative to its probability under the evaluaQL t |St ) tion policy (i.e., t=0 ππθe (A (At |St ) is large). These two qualities demonstrate a balance in how BPG changes trajectory probabilities. Increasing the probability of a trajectory under πθ will decrease IS(H, θ)2 and so BPG increases the probability of a trajectory when g(H)2 is large enough to offset the decrease in IS(H, θ)2 caused by decreasing the importance weight. 5. Empirical Study This section presents an empirical study of variance reduction through behavior policy search. We design our experiments to answer the following questions: • Can behavior policy search with BPG reduce policy evaluation MSE compared to on-policy estimates in both tabular and continuous domains? • Does adapting the behavior policy of the Doubly Robust estimator with DR-BPG lower the MSE of the Advantage Sum estimator? • Does the rarety of actions that cause high magnitude rewards affect the performance gap between BPG and Monte Carlo estimates? 5.1. Experimental Set-up We address our first experimental question by evaluating BPG in three domains. We briefly describe each domain here; full details are available in appendix C. The first domain is a 4x4 Gridworld. We obtain two evaluation policies by applying REINFORCE to this task, starting from a policy that selects actions uniformly at random. We then select one evaluation policy, π1 , from the early stages of learning – an improved policy but still far from converged – and one after learning has converged, π2 . We run all experiments once with πe := π1 and a second time with πe := π2 . Our second and third tasks are the continuous control Cartpole Swing Up and Acrobot tasks implemented within RLLAB (Duan et al., 2016). The evaluation policy in each domain is a neural network that maps the state to the mean of a Gaussian distribution. Policies are partially optimized with trust-region policy optimization (Schulman et al., 2015) applied to a randomly initialized policy. 5.2. Main Results Gridworld Experiments Figure 1 compares BPG to Monte Carlo for both Gridworld policies, π1 and π2 . Our main point of comparison is the mean squared error (MSE) of both estimates at iteration i over 100 trials. For π1 , BPG significantly reduces the MSE of on-policy estimates (Figure 1a). For π2 , BPG also reduces MSE, however, it is only a marginal improvement. At the end of each trial we used the final behavior policy to collect 100 more trajectories and estimate ρ(πe ). In comparison to a Monte Carlo estimate with 100 trajectories from π1 , MSE is 85.48 % lower with this improved behavior policy. For π2 , the MSE is 31.02 % lower. This result demonstrates that BPG can find behavior policies that substantially lower MSE. To understand the disparity in performance between these two instances of policy evaluation, we plot the distribution of g(H) under πe (Figures 1c and 1d). These plots show the variance of π1 to be much higher; it sometimes samples returns with twice the magnitude of any sampled by π2 . To quantify this difference, we also measure the variance of  2 IS(H, θ i ) as E IS(H)2 H ∼ πθi − E [IS(H)|H ∼ πθi ] where the expectations are estimated with 10,000 trajecto- Data-Efficient Policy Evaluation Through Behavior Policy Search (a) Mean Squared Error (b) Mean Squared Error (a) Cart-pole Swing Up MSE (b) Acrobot MSE Figure 2: Mean squared error reduction on the Cart-pole Swing Up and Acrobot domains. We adapt the behavior policy for 200 iterations and average results over 100 trials. Error bars are for 95% confidence intervals. (c) Histogram of π1 Returns (d) Histogram of π2 Returns (e) Variance Reduction step size parameter α. If α is set too high we risk making too large of an update to θ — potentially stepping to a worse behavior policy. If we are too conservative then it will take many iterations for a noticeable improvement over Monte Carlo estimation. Figure 1f shows variance reduction for a number of different α values in the GridWorld domain. We found BPG in this domain was robust to a variety of step size values. We do not claim this result is representative for all problem domains; stepsize selection in the behavior policy search problem is an important area for future work. (f) Learning Rate Sensitivity Figure 1: Gridworld experiments when πe is a partially optimized policy, π1 , (1a) and a converged policy, π2 , (1b). The first and second rows give results for π1 on the left and π2 on the right. Results are averaged over 100 trials of 1000 iterations with error bars given for 95 % confidence intervals. In both instances, BPG lowers MSE more than on-policy Monte Carlo returns (statistically significant, p < 0.05). The second row shows the distribution of returns under the two different πe . Figure 1e shows a substantial decrease in variance when evaluating π1 with BPG and a lesser decrease when evaluating π2 with BPG. Figure 1f shows the effect of varying the step-size parameter for representative α (BPG diverged for high settings of α). We ran BPG for 250 iterations per value of α and averaged over 5 trials. Axes in 1a, 1b, and 1e are log-scaled. ries. This evaluation is repeated 5 times per iteration and the reported variance is the mean over these evaluations. The decrease in variance for each policy is shown in Figure 1e. The high initial variance means there is much more room for BPG to improve the behavior policy when θ e is the partially optimized policy. We also test the sensitivity of BPG to the learning rate parameter. A critical issue in the use of BPG is selecting the Continuous Control Figure 2 shows reduction of MSE on the Cartpole Swing-up and Acrobot domains. Again we see that BPG reduces MSE faster than Monte Carlo evaluation. In contrast to the discrete Gridworld experiment, this experiment demonstrates the applicability of BPG to the continuous control setting. While BPG significantly outperforms Monte Carlo evaluation in Cart-pole Swingup, the gap is much smaller in Acrobot. This result also demonstrates BPG (and behavior policy search) when the policy must generalize across different states. 5.3. Control Variate Extensions In this section, we evaluate the combination of modelbased control variates with behavior policy search. Specifically, we compare the AS estimator with Doubly Robust BPG (DR-BPG). In these experiments we use a 10x10 stochastic gridworld. The added stochasticity increases the difficulty of building an accurate model from trajectories. Since these methods require a model we construct this model in one of two ways. The first method uses all trajectories in D to build the model and then uses the same set to estimate ρ(πe ) with ASE or DR. The second method uses trajectories from the first 10 iterations to build the model and then fixes the model for the remaining iterations. For DR-BPG, behavior policy search starts at iteration 10 un- Data-Efficient Policy Evaluation Through Behavior Policy Search 5.4. Rareness of Event (a) Control Variate MSE (b) Rare Event Improvement Figure 3: 3a: Comparison of DR and ASE on a larger stochastic Gridworld. For the fixed model methods, the significant drop in MSE at iteration 10 is due to the introduction of the model control variate. For clarity we do not show error bars. The difference between the final estimate of DR-BPG and ASE with the fixed model is statistically significant (p < 0.05); the difference between the same methods with a constantly improving model is not. 3b: Varying the probability of a high rewarding terminal action in the GridWorld domain. Each point on the horizontal axis is the probability of taking this action. The vertical axis gives the relative decrease in variance after adapting θ for 500 iterations. Denoting the initial variance as vi and the final variance as vf , the relative decrease is computed v −v as i vi f . Error bars for 95% confidence intervals are given but are small. der this second condition. We call the first method “update” and the second method “fixed.” The update method invalidates the theoretical guarantees of these methods but learns a more accurate model. In both instances, we build maximum likelihood tabular models. Figure 3 demonstrates that combining BPG with a modelbased control variate (DR-BPG) can lead to further reduction of MSE compared to the control variate alone (ASE). Specifically, with the fixed model, DR-BPG outperformed all other methods. DR-BPG using the update method for building the model performed competitively with ASE although not statistically significantly better. We also evaluate the final learned behavior policy of the fixed model variant of DR-BPG. For a batch size of 100 trajectories, the DR estimator with this behavior policy improves upon the ASE estimator with the same model by 56.9 %. For DR-BPG, estimating the model with all data still allowed steady progress towards lower variance. This result is interesting since a changing model changes the surface of our variance objective and thus gradient descent on the variance has no theoretical guarantees of convergence. Empirically, we observe that setting the learning rate for DRBPG was more challenging for either model type. Thus while we have shown BPG can be combined with control variates, more work is needed to produce a robust method. Our final experiment aims to understand how the gap between on- and off-policy variance is affected by the probability of rare events. The intuition for why behavior policy search can lower the variance of on-policy estimates is that a well selected behavior policy can cause rare and high magnitude events to occur. We test this intuition by varying the probability of a rare, high magnitude event and observing how this change affects the performance gap between on- and off-policy evaluation. For this experiment, we use a variant of the deterministic Gridworld where taking the UP action in the initial state (the upper left corner) causes a transition to the terminal state with a reward of +50. We use π1 from our earlier Gridworld experiments but we vary the probability of choosing UP when in the initial state. So with probability p the agent will receive a large reward and end the trajectory. We use a constant learning rate of 10−5 for all values of p and run BPG for 500 iterations. We plot the relative decrease of the variance as a function of p over 100 trials for each value of p. We use relative variance to normalize across problem instances. Note that under this measure, even when p is close to 1, the relative variance is not equal to zero because as p approaches 1 the initial variance also goes to zero. This experiment illustrates that as the initial variance increases, the amount of improvement BPG can achieve increases. As p becomes closer to 1, the initial variance becomes closer to zero and BPG barely improves over the variance of Monte Carlo (in terms of absolute variance there is no improvement). When the πe rarely takes the high rewarding UP action (p close to 0), BPG improves policy evaluation by increasing the probability of this action. This experiment supports our intuition for why off-policy evaluation can outperform on-policy evaluation. 6. Related Work Behavior policy search and BPG are closely related to existing work on adaptive importance-sampling. While adaptive importance-sampling has been studied in the estimation literature, we focus here on adaptive importancesampling for MDPs and Markov Reward Processes (i.e., an MDP with a fixed policy). Existing work on adaptive IS in RL has considered changing the transition probabilities to lower the variance of policy evaluation (Desai & Glynn, 2001; Frank et al., 2008) or lower the variance of policy gradient estimates (Ciosek & Whiteson, 2017). Since the transition probabilities are typically unknown in RL, adapting the behavior policy is a more general approach to adaptive IS. Ciosek and Whiteson also adapt the distribution of trajectories with gradient descent on the variance (Ciosek & Whiteson, 2017) with respect to parameters of the transition probabilities. The main focus of this work is increasing Data-Efficient Policy Evaluation Through Behavior Policy Search the probability of simulated rare events so that policy improvement can learn an appropriate response. In contrast, we address the problem of policy evaluation and differentiate with respect to the (known) policy parameters. The cross-entropy method (CEM) is a general method for adaptive importance-sampling. CEM attempts to minimize the Kullback-Leibler divergence between the current sampling distribution and the optimal sampling distribution. As discussed in Section 3.1, this optimal behavior policy only exists under a set of restrictive conditions. In contrast we adapt the behavior policy by minimizing variance. Other methods exist for lowering the variance of on-policy estimates. In addition to the control variate technique used by the Advantage Sum estimator (Zinkevich et al., 2006; White & Bowling, 2009), Veness et al. consider using common random numbers and antithetic variates to reduce the variance of roll-outs in Monte Carlo Tree Search (MCTS) (2011). These techniques require a model of the environment (as is typical for MCTS) and do not appear to be applicable to the general RL policy evaluation problem. BPG could potentially be applied to find a lower variance rollout policy for MCTS. In this work we have focused on unbiased policy evaluation. When the goal is to minimize MSE it is often permissible to use biased methods such as temporal difference learning (van Seijen & Sutton, 2014), model-based policy evaluation (Kearns & Singh, 2002; Strehl et al., 2009), or variants of weighted importance sampling (Precup et al., 2000). It may be possible to use similar ideas to BPG to reduce bias and variance although this appears to be difficult since the bias contribution to the mean squared error is squared and thus any gradient involving bias requires knowledge of the estimator’s bias. We leave behavior policy search with biased off-policy methods to future work. 7. Discussion and Future Work Our experiments demonstrate that behavior policy search with BPG can lower the variance of policy evaluation. One open question is characterizing the settings where adapting the behavior policy substantially improves over on-policy estimates. Towards answering this question, our Gridworld experiment showed that when πe has little variance, BPG can only offer marginal improvement. BPG increases the probability of observing rare events with a high magnitude. If the evaluation policy never sees such events then there is little benefit to using BPG. However, in expectation and with an appropriately selected step-size, BPG will never lower the data-efficiency of policy evaluation. It is also necessary that the evaluation policy contributes to the variance of the returns. If all variance is due to the environment then it seems unlikely that BPG will offer much improvement. For example, Ciosek and Whiteson (2017) consider a variant of the Mountain Car task where the dynamics can trigger a rare event — independent of the action — in which rewards are multiplied by 1000. No behavior policy adaptation can lower the variance due to this event. One limitation of gradient-based BPS methods is the necessity of good step-size selection. In theory, BPG can never lead to worse policy evaluation compared to on-policy estimates. In practice, a poorly selected step-size may cause a step to a worse behavior policy at step i which may increase the variance of the gradient estimate at step i + 1. Future work could consider methods for adaptive step-sizes, second order methods, or natural behavior policy gradients. One interesting direction for future work is incorporating behavior policy search into policy improvement. A similar idea was explored by Ciosek and Whiteson who explored off-environment learning to improve the performance of policy gradient methods (2017). The method presented in that work is limited to simulated environments with differential dynamics. Adapting the behavior policy is a potentially much more general approach. 8. Conclusion We have introduced the behavior policy search problem in order to improve estimation of ρ(πe ) for an evaluation policy πe . We present a solution — Behavior Policy Gradient — for this problem which adapts the behavior policy with stochastic gradient descent on the variance of the importance-sampling estimator. Experiments demonstrate BPG lowers the mean squared error of estimates of ρ(πe ) compared to on-policy estimates. We also demonstrate BPG can further decrease the MSE of estimates in conjunction with a model-based control variate method. 9. Acknowledgements We thank Daniel Brown and the anonymous reviewers for useful comments on the work and its presentation. This work has taken place in the Personal Autonomous Robotics Lab (PeARL) and Learning Agents Research Group (LARG) at the Artificial Intelligence Laboratory, The University of Texas at Austin. PeARL research is supported in part by NSF (IIS-1638107, IIS-1617639). LARG research is supported in part by NSF (CNS-1330072, CNS-1305287, IIS-1637736, IIS-1651089), ONR (21C184-01), AFOSR (FA9550-14-1-0087), Raytheon, Toyota, AT&T, and Lockheed Martin. Josiah Hanna is supported by an NSF Graduate Research Fellowship. Peter Stone serves on the Board of Directors of Cogitai, Inc. The terms of this arrangement have been reviewed and approved by the University of Texas at Austin in accordance with its policy on objectivity in research. Data-Efficient Policy Evaluation Through Behavior Policy Search References Bastani, Meysam. Model-free intelligent diabetes management using machine learning. PhD thesis, Masters thesis, Department of Computing Science, University of Alberta, 2014. Bertsekas, Dimitri P. and Tsitsiklis, John N. Gradient convergence in gradient methods with erros. 10:627–642, 2000. Ciosek, Kamil and Whiteson, Shimon. OFFER: Offenvironment reinforcement learning. In Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI), 2017. Desai, Paritosh Y and Glynn, Peter W. Simulation in optimization and optimization in simulation: A Markov chain perspective on adaptive Monte Carlo algorithms. In Proceedings of the 33rd conference on Winter simulation, pp. 379–384. IEEE Computer Society, 2001. Duan, Yan, Chen, Xi, Houthooft, Rein, Schulman, John, and Abbeel, Pieter. Benchmarking deep reinforcement learning for continuous control. In In Proceedings of the 33rd International Conference on Machine Learning, 2016. Frank, Jordan, Mannor, Shie, and Precup, Doina. Reinforcement learning in the presence of rare events. In Proceedings of the 25th International Conference on Machine learning, pp. 336–343. ACM, 2008. Hammersley, JM and Handscomb, DC. Monte Carlo methods, methuen & co. Ltd., London, pp. 40, 1964. Jiang, Nan and Li, Lihong. Doubly robust off-policy evaluation for reinforcement learning. In Proceedings of the 33rd International Conference on Machine Learning (ICML), 2016. Kearns, Michael and Singh, Satinder. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49(2-3):209–232, 2002. Lillicrap, Timothy P., Hunt, Jonathan J., Pritzel, Alexander, Heess, Nicolas, Erez, Tom, Tassa, Yuval, Silver, David, and Wierstra, Daan. Continuous control with deep reinforcement learning. CoRR, abs/1509.02971, 2015. Precup, D., Sutton, R. S., and Singh, S. Eligibility traces for off-policy policy evaluation. In Proceedings of the 17th International Conference on Machine Learning, pp. 759–766, 2000. Schulman, John, Levine, Sergey, Moritz, Philipp, Jordan, Michael, and Abbeel, Pieter. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning ( ICML), 2015. Sen, P.K. and Singer, J.M. Large Sample Methods in Statistics: An Introduction with Applications. Chapman & Hall, 1993. Strehl, Alexander L, Li, Lihong, and Littman, Michael L. Reinforcement learning in finite mdps: PAC analysis. Journal of Machine Learning Research, 10:2413–2444, 2009. Sutton, Richard S. and Barto, Andrew G. Reinforcement Learning: An Introduction. MIT Press, 1998. Sutton, Richard S., McAllester, David, Singh, Satinder, and Mansour, Yishay. Policy gradient methods for reinforcement learning with function approximation. In Proceedings of the 13th Conference on Neural Information Processing Systems (NIPS), 2000. Theocharous, Georgios, Thomas, Philip S., and Ghavamzadeh, Mohammad. Personalized ad recommendation systems for life-time value optimization with guarantees. In Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI), pp. 1806–1812, 2015. Thomas, Philip S. A notation for Markov decision processes. ArXiv, arXiv:1512.09075v1, 2015. Thomas, Philip S. and Brunskill, Emma. Data-efficient off-policy policy evaluation for reinforcement learning. In Proceedings of the 33rd International Conference on Machine Learning (ICML), 2016. Thomas, Philip S., Theocharous, Georgios, and Ghavamzadeh, Mohammad. High confidence off-policy evaluation. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), 2015. van Seijen, Harm and Sutton, Richard S. True online TD (λ). In Proceedings of the 31st International Conference on Machine Learning (ICML), volume 14, pp. 692–700, 2014. Veness, J., Lanctot, M., and Bowling, M. Variance reduction in Monte-Carlo tree search. In Proceedings of the 24th Conference on Neural Information Processing Systems, pp. 1836–1844, 2011. White, M. and Bowling, M. Learning a value analysis tool for agent evaluation. In Proceedings of the 21st International Joint Conference on Artificial Intelligence (IJCAI), pp. 1976–1981, 2009. Williams, Ronald J. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. Data-Efficient Policy Evaluation Through Behavior Policy Search Zinkevich, M., Bowling, M., Bard, N., Kan, M., and Billings, D. Optimal unbiased estimators for evaluating agent performance. In Proceedings of the 21st National Conference on Artificial Intelligence (AAAI), pp. 573– 578, 2006. Data-Efficient Policy Evaluation Through Behavior Policy Search A. Proof of Theorem 1 In Appendix A, we give the full derivation of our primary theoretical contribution — the importance-sampling (IS) variance gradient. We also present the variance gradient for the doubly-robust (DR) estimator. We first derive an analytic expression for the gradient of the variance of an arbitrary, unbiased off-policy policy evaluation estimator, OPE(H, θ). Importance-sampling is one such off-policy policy evaluation estimator. From our general derivation we derive the gradient of the variance of the IS estimator and then extend to the DR estimator. A.1. Variance Gradient of an Unbiased Off-Policy Policy Evaluation Method We first present a lemma from which ∂ ∂θ MSE[IS(H, θ)] and ∂ ∂θ MSE[DR(H, θ)] can both be derived. Lemma 1 gives the gradient of the mean squared error (MSE) of an unbiased off-policy policy evaluation method. Lemma 1. # " L X ∂ ∂ ∂ 2 2 MSE[OPE(H, θ)] = E OPE(H, θ) ( log πθ (At |St )) + OPE(H, θ) H ∼ πθ ∂θ ∂θ ∂θ t=0 Proof. We begin by decomposing Pr(H|π) into two components—one that depends on π and the other that does not. Let wπ (H) := L Y π(At |St ), t=0 and p(H) := Pr(H|π)/wπ (H), for any π such that H ∈ supp(π) (any such π will result in the same value of p(H)). These two definitions mean that Pr(H|π) = p(H)wπ (H). The MSE of the OPE estimator is given by: 2 MSE[OPE(H, θ)] = Var[OPE(H, θ)] + (E[OPE(H, θ)] − ρ(πe )) . | {z } bias2 Since the OPE estimator is unbiased, i.e., E[OPE(H, θ)] = ρ(πe ), the second term is zero and so: MSE(OPE(H, θ)) = Var(OPE(H, θ))   =E OPE(H, θ)2 H ∼ πθ − E[OPE(H, θ)|H ∼ πθ ]2   =E OPE(H, θ)2 H ∼ πθ − ρ(πe )2 To obtain the MSE gradient, we differentiate MSE(OPE(H, θ)) with respect to θ:   ∂ ∂   MSE[OPE(H, θ)] = E OPE(H, θ)2 H ∼ πθ − ρ(πe )2 ∂θ ∂θ   ∂ = EH∼πθ OPE(H, θ)2 ∂θ ∂ X = Pr(H|θ) OPE(H, θ)2 ∂θ H X ∂ ∂ = Pr(H|θ) OPE(H, θ)2 + OPE(H, θ)2 Pr(H|θ) ∂θ ∂θ H X ∂ ∂ = Pr(H|θ) OPE(H, θ)2 + OPE(H, θ)2 p(H) wπθ (H) ∂θ ∂θ H (1) Data-Efficient Policy Evaluation Through Behavior Policy Search Consider the last factor of the last term in more detail: L ∂ ∂ Y wπθ (H) = πθ (At |St ) ∂θ ∂θ t=0 ! L L X (a) Y = πθ (At |St ) t=0 t=0 =wπθ (H) ∂ ∂θ πθ (At |St ) ! πθ (At |St ) L X ∂ log (πθ (At |St )) , ∂θ t=0 where (a) comes from the multi-factor product rule. Continuing from (1) we have that: # " L X ∂ ∂ ∂ 2 2 MSE(OPE(H, θ)) =E OPE(H, θ) log (πθ (At |St )) + OPE(H, θ) H ∼ πθ . ∂θ ∂θ ∂θ t=0 A.2. Behavior Policy Gradient Theorem We now use Lemma 1 to prove the Behavior Policy Gradient Theorem which is our main theoretical contribution. Theorem 2. " # L X ∂ ∂ MSE[IS(H, θ)] = E − IS(H, θ)2 log πθ (At |St ) H ∼ πθ ∂θ ∂θ t=0 where the expectation is taken over H ∼ πθ . Proof. We first derive Lemma 1. ∂ ∂θ IS(H, θ)2 . Theorem 1 then follows directly from using ∂ ∂θ IS(H, θ)2 as ∂ ∂θ OPE(H, θ)2 in 2 wπe IS(H, θ) = g(H) wθ  2 ∂ wπe (H) ∂ IS(H, θ)2 = g(H) ∂θ ∂θ wθ (H)   wπ (H) ∂ wπ (H) g(H) e =2 · g(H) e wθ (H) ∂θ wθ (H)   L wπ (H) wπ (H) X ∂ (a) = − 2 · g(H) e g(H) e log πθ (At |St ) wθ (H) wθ (H) t=0 ∂θ 2  = − 2 IS(H, θ)2 L X ∂ log πθ (At |St ) ∂θ t=0 where (a) comes from the multi-factor product rule and using the likelihood-ratio trick (i.e., ∂ ∂θ πθ (A|S) πθ (A|S) Substituting this expression into Lemma 1 completes the proof: " # L X ∂ ∂ 2 MSE[IS(H, θ)] = E − IS(H, θ) log πθ (At |St ) H ∼ πθ ∂θ ∂θ t=0 = log πθ (A|S)) Data-Efficient Policy Evaluation Through Behavior Policy Search A.3. Doubly Robust Estimator Our final theoretical result is a corollary to the Behavior Policy Gradient Theorem: an extension of the IS variance gradient to the Doubly Robust (DR) estimator. Recall that for a single trajectory DR is given as: DR(H, θ) := v̂ πe (S0 ) + L X γt t=0 wπe ,t (Rt − q̂ πe (St , At ) + v̂ πe (St+1 )) wθ,t where v̂ πe is the state-value function of πe under an approximate model, q̂ πe is the action-value function of πe under the Qt model, and wπ,t := j=0 π(Aj |Sj ). The gradient of the mean squared error of the DR estimator is given by the following corollary to the Behavior Policy Gradient Theorem: Corollary 2. ∂ MSE [DR(H, θ)] ∂θ = E[(DR(H, θ)2 L L t X X ∂ wπ ,t X ∂ log πθ (At |St ) − 2 DR(H, θ)( log πθ (Ai |Si ))] γ t δt e ∂θ wθ,t i=0 ∂θ t=0 t=0 where δt = Rt − q̂(St , At ) + v̂(St+1 ) and the expectation is taken over H ∼ πθ . Proof. As with Theorem 1, we first derive ∂ 2 ∂θ OPE(H, θ) in Lemma 1. 2 DR(H, θ) = ∂ ∂θ DR(H, θ)2 . Corollary 1 then follows directly from using πe v̂ (S0 ) + L X γ t wπe ,t t=0 ∂ ∂ DR(H, θ)2 = ∂θ ∂θ πe v̂ (S0 ) + ∂ =2 DR(H, θ) ∂θ = − 2 DR(H, θ)( L X γ t=0 t wπe ,t wθ,t πe v̂ (S0 ) + wθ,t t=0 γt DR(H, θ)2 as !2 πe πe (Rt − q̂ (St , At ) + v̂ (St+1 )) !2 πe πe (Rt − q̂ (St , At ) + v̂ (St+1 )) L X t=0 L X ∂ ∂θ γ t wπe ,t wθ,t ! πe πe (Rt − q̂ (St , At ) + v̂ (St+1 )) t X wπe ,t ∂ log πθ (Ai |Si )) (Rt − q̂ πe (St , At ) + v̂ πe (St+1 )) wθ,t ∂θ i=0 Thus the DR(H, θ) gradient is: " L L t X X X ∂ wπ ,t ∂ = E DR(H, θ) log πθ (At |St ) − 2 DR(H, θ)( γ t e (Rt − q̂ πe (St , At ) + v̂ πe (St+1 )) log πθ (Ai |Si )) H ∼ πθ ∂θ w ∂θ θ,t t=0 t=0 i=0 2 The expression for the DR behavior policy gradient is more complex than the expression for the IS behavior policy gradient. Lowering the variance of DR involves accounting for the covariance of the sum of terms. Intuitively, accounting for the covariance increases the complexity of the expression for the gradient. B. BPG’s Off-Policy Estimates are Unbiased This appendix proves that BPG’s estimate is an unbiased estimate of ρ(πe ). If only trajectories from a single θ i were used then clearly IS(·, θ i ) is an unbiased estimate of ρ(πe ). The difficulty is that the BPG’s estimate at iteration n depends on all θ i for i = 1 . . . n and each θ i is not independent of the others. Nevertheless, we prove here that BPG produces an unbiased # Data-Efficient Policy Evaluation Through Behavior Policy Search estimate of ρ(πe ) at each iteration. Specifically, we will show that E [IS(Hn , θ n )|θ 0 = θ e )] is an unbiased estimate of ρ(πe ), where the IS estimate is conditioned on θ 0 = θ e . To make the dependence of θ i on θ i−1 explicit, we will write f (Hi−1 ) := θ i where Hi−1 ∼ πθi−1 . We use Pr(h|θ) as shorthand for Pr(H = h|θ). E [IS(Hn , θ n )|θ = θ e )] = X Pr(h0 |θ 0 ) X Pr(h1 |f (h0 )) · · · Pr(hn |f (hn−1 )) IS(hn ) hn h1 h0 X | =ρ(πe ) X Pr(h0 |θ 0 ) X {z ρ(πe ) } Pr(h1 |f (h0 )) · · · h1 h0 =ρ(πe ) Notice that, even though BPG’s off-policy estimates at each iteration are unbiased, they are not statistically independent. This means that concentration inequalities, like Hoeffding’s inequality, cannot be applied directly. We conjecture that the conditional independence properties of BPG (specifically that Hi is independent of Hi−1 given θi ), are sufficient for Hoeffding’s inequality to be applicable. C. Supplemental Experiment Description This appendix contains experimental details in addition to the details contained in Section 5 of the paper. Gridworld: This domain is a 4x4 Gridworld with a terminal state with reward 10 at (3, 3), a state with reward −10 at (1, 1), a state with reward 1 at (1, 3), and all other states having reward −1. The action set contains the four cardinal directions and actions move the agent in its intended direction (except when moving into a wall which produces no movement). The agent begins in (0,0), γ = 1, and L = 100. All policies use softmax action selection with temperature 1 where the probability of taking an action a in a state s is given by: eθsa θsa0 a0 e π(a|s) = P We obtain two evaluation policies by applying REINFORCE to this task, starting from a policy that selects actions uniformly at random. We then select one evaluation policy from the early stages of learning – an improved policy but still far from converged –, π1 , and one after learning has converged, π2 . We run our set of experiments once with πe := π1 and a second time with πe := π2 . The ground truth value of ρ(πe ) is computed with value iteration for both πe . Stochastic Gridworld: The layout of this Gridworld is identical to the deterministic Gridworld except the terminal state is at (9, 9) and the +1 reward state is at (1, 9). When the agent moves, it moves in its intended direction with probability 0.9, otherwise it goes left or right with equal probability. Noise in the environment increases the difficulty of building an accurate model from trajectories. Continuous Control: We evaluate BPG on two continuous control tasks: Cart-pole Swing Up and Acrobot. Both tasks are implemented within RLLAB (Duan et al., 2016) (full details of the tasks are given in Appendix 1.1). The single task modification we make is that in Cart-pole Swing Up, when a trajectory terminates due to moving out of bounds we give a penalty of −1000. This modification increases the variance of πe . We use γ = 1 and L = 50. Policies are represented as conditional Gaussians with mean determined by a neural network with two hidden layers of 32 tanh units each and a state-independent diagonal covariance matrix. In Cart-pole Swing Up, πe was learned with 10 iterations of the TRPO algorithm (Schulman et al., 2015) applied to a randomly initialized policy. In Acrobot, πe was learned with 60 iterations. The ground truth value of ρ(πe ) in both domains is computed with 1,000,000 Monte Carlo roll-outs. Domain Independent Details In all experiments control variate (or baseline) in the gradient  we subtract a constant  estimate from Theorem 1. The baseline is bi = E − IS(H)2 H ∼ θ i−1 and our new gradient estimate is: " L X ∂ E (− IS −bi ) log πθ (At |St ) H ∼ πθ ∂θ t=0 2 # Data-Efficient Policy Evaluation Through Behavior Policy Search hP i L ∂ Adding or subtracting a constant does not change the gradient in expectation since bi · E log π (A |S ) = 0. θ t t t=0 ∂θ BPG with a baseline has lower variance so that the estimated gradient is closer in direction to the true gradient. We use batch sizes of 100 trajectories per iteration for Gridworld experiments and size 500 for the continuous control tasks. The step-size parameter was determined by a sweep over [10−2 , 10−6 ] Early Stopping Criterion In all experiments we run BPG for a fixed number of iterations. In general, BPS can continue for a fixed number of iterations or until the variance of the IS estimator stops decreasing. The true variance is unknown but can be estimated by sampling a set of k trajectories with θ i and computing the uncentered variance: Pk 1 2 j=0 OPE(Hj , θ j ) . This measure can be used to empirically evaluate the quality of each θ or determine when a BPS k algorithm should terminate behavior policy improvement.
2cs.AI
arXiv:1311.5375v2 [math.GT] 13 Feb 2018 Ann. Inst. Fourier, Grenoble Working version – 14 février 2018 SUR LA CONVERGENCE DES ORBI-VARIÉTÉS ARITHMÉTIQUES by Jean RAIMBAULT (*) Résumé. Cet article est consacré à l’étude de la géométrie globale de certaines orbi-variétés localement isométriques à un produit d’espaces tridimensionnels et de plans hyperboliques. On démontre que pour les peties dimensions (pour l’espace ou le plan hyperbolique, ou un produit de plans hyperboliques) certaines suites de telles orbivariétés non-compactes de volume fini convergent vers l’espace symétrique en un sens géométrique précis (“convergence de Benjamini–Schramm”). On traite aussi le cas des réseaux arithmétiques maximaux en dimension trois dont les corps de traces sont quadratiques ou cubiques. Une des principales motivations est d’étudier l’asymptotique des nombres de Betti des groupes de Bianchi. On the convergence of arithmetic orbifolds Résumé. We discuss the geometry of some arithmetic orbifolds locally isometric to a product X of real hyperbolic spaces Hm of dimension m = 2, 3, and prove that certain sequences of non-compact orbifolds are convergent to X in a geometric (“Benjamini–Schramm”) sense for low-dimensional cases (when X is equal to H2 × H2 or H3 ). We also deal with sequences of maximal arithmetic three–dimensional hyperbolic lattices defined over a quadratic or cubic field. A motivating application is the study of Betti numbers of Bianchi groups. Keywords: Variétés hyperboliques arithmétiques, Multiplicités limites, Variétés tridimensionnelles. Math. classification: 22E40, 11F75, 11F72, 57M27. (*) During the writing of this paper I was supported by a research grant from the Max-Planck Gesellschaft. I am grateful to Miklos Abért, Misha Belolipetsky, Nicolas Bergeron, Ian Biringer, Aurel Page, Alexander Rahm, Juan Souto and Akshay Venkatesh for valuable input to or remarks on the contents of this paper. The referees also pointed out numerous imprecisions, mistakes and typos in previous versions of this paper. 2 JEAN RAIMBAULT 1. Introduction Let X be a Riemannian symmetric space without Euclidean or compact factors : this means that X is obtained as a quotient G∞ /K∞ of a semisimple, noncompact real Lie group G∞ by a maximal compact subgroup K∞ . The space X is a contractible manifold (homeomorphic to an Euclidean space) and can be endowed with the unique (up to homothety in each irreducible factor) Riemannian metric invariant under the action of G∞ by left translations. For any discrete subgroup Γ in G∞ the quotient M = Γ\X then has the structure of a Riemannian orbifold (i.e. there is a subset of codimension > 2 where the smooth structure and the metric can have singularities), and in particular various metric invariants can be associated to Γ : — the Riemannian volume vol(M ) ∈]0, +∞] ; — for each x ∈ M the injectivity radius injx (M ) is defined to be the largest R such that the ball of radius R around x in M is isometric to a ball in X ; equivalently, choosing a lift x̃ of x to X one has 1 inf d(x̃, γ x̃) injx (M ) = 2 γ∈Γ−{1} and the global injectivity radius inj(M ) is then defined as inf x∈M injx (M ) ; — the maximal radius of M is defined by max inj(M ) = supx∈M injx (M ). All these invariants have been well–studied in the case of real hyperbolic manifolds, usually with the purpose of establishing universal constraints (or the lack thereof) for a given dimension : we refer to the introduction of [24] for a recent survey on this type of result. In this paper we are interested in the relations of the volume to the other invariants in some specific sequences of arithmetic locally symmetric orbifolds (of finite volume) ; this is related to the Benjamini–Schramm convergence which was studied (in [3]) by M. Abért, N. Bergeron, I. Biringer, T. Gelander, N. Nikolov, I. Samet and the author for locally symmetric orbifolds, which in turn has consequences on the Betti numbers (among other things) of these spaces. 1.1. Geometric convergence of locally symmetric orbifolds 1.1.1. Benjamini–Schramm convergence to the universal cover The R-thin part of a Riemannian orbifold M is by definition (M )6R = {x ∈ M : injx (M ) 6 R}. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 3 Its volume is a metric invariant of M . Fix X a contractible complete Riemannian manifold ; in [3] the notion of Benjamini–Schramm (BS) convergence of a sequence of finite–volume orbifold quotients Mn of X to X was introduced by the following definition : (Mn ) is BS-convergent to X if and only if for all R > 0 we have vol(Mn )6R −−−−→ 0. (1.1) n→∞ vol Mn In informal terms this means that ‘the injectivity radius of Mn goes to infinity at almost every point’. One should see this notion of convergence as a middle ground between the so-called pointed Gromov–Hausdorff convergence to X, which asks that the maximal radius of the Mn go to infinity, and the stronger statement that the global injectivity radius goes to infinity. Pointed Gromov–Hausdorff convergence is defined in a more general setting, and in fact any sequence of pointed Riemannian manifolds has accumulation points in this sense (the limit of course does not have to be a manifold itself), we refer to [34, Chapter 10] for more information. Benjamini– Schramm convergence is also defined for more general sequences than only those satisfying (1.1), and the limits arising in this context are invariant random subgroups of the group of isometries of X (see 2.1 below for a short introduction to this). An analogous notion was first considered in the context of regular graphs by I. Benjamini and O. Schramm in [6], elaborated upon by M. Abért, Y. Glasner and B. Virág in [2] and is the main tool used in [3]. In this Benjamini–Schramm topology, every sequence of lattices in G∞ is relatively compact (see 2.1 below). Thus, to prove (1.1) for a given sequence one can argue by compactness as follows : any subsequence of µΓn has a limit, and if one can show in some way that any such limit must be equal to X then (1.1) must hold for the whole sequence. This line of argument was used in [3] to prove that if G∞ is simple and of real rank larger than 2 then any sequence of X–orbifolds must satisfy (1.1). 1.1.2. Questions on the convergence of arithmetic orbifolds For this section we fix the Lie group G∞ . Recall that a lattice in G∞ is a discrete subgroup such that the quotient Γ\G∞ carries a finite, G∞ invariant Borel measure. An important class of lattices in G∞ are the socalled arithmetic subgroups, which are ‘integral points’ of Q-groups whose real points are isomorphic to G∞ up to a compact factor (see [30, Section 10.3] for a short introduction to arithmetic groups). This work is mainly concerned with them and their convergence properties, and especially with the following question : SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 4 JEAN RAIMBAULT Question. — Let Γn be a sequence (a) of maximal arithmetic irreducible lattices in G∞ ; are the orbifolds Γn \X Benjamini–Schramm convergent to X ? Recall that a lattice in G∞ is said to be maximal if it is not contained in a strictly larger discrete subgroup of G∞ , and in the case where G∞ has more than one simple factor, a lattice it is said to be irreducible if its projection on every simple factor is dense. In the case where all simple factors of G∞ are of real rank 2 or higher an affirmative answer to the above question is provided by the much stronger result that all sequences of finite-volume irreducible X-orbifolds are BS-convergent to X [3, Theorem 1.5]. The irreducibility condition is needed in all cases, as is easily seen by considering the example of a sequence of maximal lattices which all contain a fixed lattice in one factor. In real rank one it is likely that the condition that the lattices be maximal (or congruence–see below) is needed ; for all lattices in real hyperbolic spaces, and for some in complex hyperbolic ones there are sequences of finite covers which are not BS-convergent to the symmetric space (this is related to the failure of the congruence subgroup property in real rank one (see for example the survey in [29, Chapter 7]), as can be seen from [3, Theorem 1.12]). The arithmetic lattices in G∞ can be constructed as follows. We need a number field F whose embeddings into R we denote by σ1 , . . . , σr1 , and σr1 +1 , . . . , σr2 are the remaining embeddings into C up to complex conjugation (thus the degree r = [F : Q] equals r1 + 2r2 ). We also need an algebraic group G over F , and we require that the group r2 r1 Y Y Gσi (C) Gσj (R) × G′∞ := G(F ⊗Q R) = j=1 i=r1 +1 has a surjective map to G∞ , with compact kernel. Suppose moreover that there is an F -embedding of G into some SLm , and let Γ be the subgroup G(F ) ∩ SLm (OF ) where OF is the ring of integers of F . Then the image of Γ is a lattice in G∞ by a theorem of A. Borel and Harish–Chandra. The construction above actually defines (without need to refer to an embedding into SLm ) a commensurability class (b) of lattices in G∞ . This commensurability class contains infinitely many maximal lattices, and thus we see that there are two ways to generate sequences of maximal arithmetic lattices : a. In this paper such sequences will always satisfy the following nontriviality assumption : for distinct n, n′ the subgroups Γn , Γ′n are not conjugated in G∞ . b. Recall that two subgroups Γ1 , Γ2 of G∞ are said to be commensurable if their intersection has finite index in both. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 5 — By taking a sequence of maximal lattices inside a commensurability class ; — By changing the group G and/or the field of definition F . We expect that in the first situation the sequence will always be BSconvergent to the universal cover. In the second situation we expect, with much less certainty however, that if the degree of the field is kept bounded the sequence will be convergent. One of the aims of this paper is to substantiate these expectations for low–dimensional examples with R-rank one factors, in particular hyperbolic three–manifolds. An alternative to considering maximal lattices is to study sequences of socalled congruence lattices. It is more usual to consider congruence subgroups of a given arithmetic group : if Γ stabilizes a lattice L in a representation of G∞ on a real vector space, one defines the principal congruence subgroups of Γ as the kernels Γ(n) of the reduction maps Γ → GL(L/nL) (where n is a positive integer and L/nL is considered as a Z/nZ-module), and a congruence subgroup of Γ is any subgroup containing some Γ(n) (see also [29, Chapter 6]). In general, given a F -form G of G∞ , the congruence lattices in G(F ) are defined as the subgroups of G(F ) which are equal to the intersection of G(F ) with their closure in the group of points over finite adèles G(Af ) (if Γ is a congruence lattice in G(F ) then the congruence subgroups of Γ as defined above are also congruence lattices in G(F )). Some of these are closely related to maximal arithmetic lattices (see [41]), and we expect also that in a sequence of commensurability classes the congruence subgroups be BS-convergent to the universal cover when the degree of the field F in the construction above is bounded. The case of congruence subgroups of a fixed arithmetic lattice was dealt with in [3] (actually only in the case of compact orbifolds–but the general case can be deduced from Theorem 1.11 in loc. cit. with little effort, see Proposition 2.2 below). 1.1.3. Non-arithmetic lattices We should say a word on the arithmeticity assumption in the question above. The only semisimple Lie groups G∞ known to contain infinitely many commensurability classes of irreducible non-arithmetic lattices (c) are the groups G∞ = SO(m, 1) for m > 2 (and groups isogenic to those). The c. The only other groups with known non-arithmetic lattices are SU(2, 1) and SU(3, 1), and these fall into finitely many commensurability classes (see for example [18]). SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 6 JEAN RAIMBAULT symmetric space associated to SO(m, 1) is real hyperbolic space Hm ; for each m it can be seen that there are sequences of nonarithmetic minimal hyperbolic m-orbifolds which are far from being BS-convergent to the universal cover. For m = 2, 3 there are in fact sequences of nonconjugated maximal lattices in SO(m, 1) with bounded covolume (obtained by gluing pants for m = 2, and by Thurston’s hyperbolic Dehn surgery in dimension 3). For general m > 4 this latter phenomenon is impossible because of H. C. Wang’s finiteness theorem, but the variation on Gromov and PiatetskiShapiro’s construction of nonarithmetic lattices [26] given in [40] implies (for every m > 3) that there is a C > 0 and a sequence of pairwise noncommensurable hyperbolic m-manifolds Mn such that for all n and x ∈ Mn we have injx (Mn ) 6 C, so that if we take the manifold with minimal volume in the commensurability class of Mn we obtain a sequence of maximal lattices with covolume going to infinity but injectivity radius 6 C at every point. The limit points in the BS-topology in this case are the IRS studied in section 13 of [3]. 1.1.4. Unbounded maximal radius One can also ask whether the maximal injectivity radius is unbounded in a sequence of maximal (or congruence) arithmetic manifolds ; this is obviously weaker than asking for BS-convergence of the sequence but still fails for sequences of nonarithmetic manifolds because of the same example. We ask the following questions. Question. — Let R > 0 and m > 2 ; is there only a finite number of maximal (or congruence) arithmetic hyperbolic m-orbifolds M with max inj M 6 R ? More generally, without fixing the dimension, is there only a finite number of maximal (or congruence) arithmetic hyperbolic manifolds M with max inj M 6 R ? As a particular case of the second question one can ask whether for the sequence Mn = SO(n, 1; Z)\Hn we have max inj(Mn ) −−−−−→ +∞ or n→+∞ not (d) . d. This question was communicated to the author by M. Belolipetsky, who heard it from Jun-Muk Hwang who asked it out of algebro-geometric motivations. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 7 1.2. Results on Benjamini–Schramm convergence 1.2.1. Arithmetic hyperbolic three–manifolds and Bianchi groups In the case where G∞ is a product of factors isomorphic to SL2 (R) or SL2 (C) and Γ is an irreducible lattice in G∞ one can use the field F generated by the set tr(adΓ) to define the commensurability class of Γ as above (this field is independant of the choic of Γ in the commensurability class ; it is called the invariant trace field of Γ, see [30, 3.3]). The main result in this paper is then the following. Theorem A. — Let Γn be a sequence of maximal arithmetic or congruence lattices in SL2 (C) and Fn the invariant trace field of Γn . Suppose that the Fn are quadratic, or that they are cubic and either the Γn are derived from a quaternion algebra or the size of the 2-torsion subgroup of Fn is ≪ Dn0.24 (where Dn is the discriminant of Fn ). Let Mn = Γn \H3 . Then the oribifolds Mn are Benjamini–Schramm convergent to H3 . In fact there is a δ > 0 such that for every R > 0 there is a constant C so that vol(Mn )6R 6 C(vol Mn )1−δ holds for all n. Here are a few remarks about the hypothesis on the class group in the cubic case : it is conjectured that the p-torsion subgroup is of size ≪ DFε for all p and F , with a bound depending on p and the degree of F (see for example [22], which also provides some bounds in this direction). In the case of interest to us (p = 2 and degree 3) the best currently known bound, due to Bhargava–Shankar–Taniguchi–Thorne–Tsimerman–Zhao [8], is DF0.2785 , which misses what we need by about 0.04. On the other hand the mean size of the 2-torsion is bounded by a result of Bhargava [9], so the hypothesis that it is ≪ DF0.24 is true for a subset of density one in the set of all cubic fields. The bound on the size of the thin part is reminescent of that obtained for congruence covers in [3, Theorem 1.12] ; however there is a big difference between the latter result and the one above, which is that in [3] the dependancy of C on R is made explicit (for compact orbifolds ; the case of congruence covers of non-compact arithmetic three–manifolds is dealt with in [39]), which we do not do here (we use a non-explicit finiteness argument at some point). An important example which the result above covers is that of the sequence of the Bianchi groups. These were historically among the first arithmetic groups studied in relation with hyperbolic geometry, by L. Bianchi SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 8 JEAN RAIMBAULT in his paper [10] ; they are parametrized by positive square–free integers m as follows : for such m let D = m if m = 3 (mod 4) or 4m otherwise and √ FD be the quadratic imaginary number field Q( −m) (whose discriminant equals −D) and OD its ring of integers. The Bianchi group associated to m or D is defined to be : ΓD = SL2 (OD ). Then ΓD is obviously a congruence lattice in SL2 (C) with invariant trace field FD . As we will now explain the proof of Theorem A rests on this special case (for which we actually can take δ = 1/3 − ε for every ε > 0, see Theorem C below). The non-cocompact arithmetic lattices in SL2 (C) are all commensurable to one of the Bianchi groups [30, Theorem 8.2.3], and it is not very hard to deduce Theorem A in the case of maximal nonuniform lattices from the special case of Bianchi groups ; the congruence case then follows from this together with the statement that in a commensurability class a sequence of congruence lattices is BS-convergent to H3 . For the compact case one uses the ‘classical’ proof of the Jacquet–Langlands correspondance given in [12], which relates the length spectra of compact congruence lattices in SL2 (C) defined over a quadratic imaginary field with that of congruence subgroups of the Bianchi groups. For the cubic case, instead of considering Bianchi orbifolds one needs to consider the irreducible noncompact quotients of H3 × H2 . Using the compactness argument outlined in 1.1.1 we also prove the following result. Theorem B. — Let Mn be a sequence of arithmetic hyperbolic three– orbifolds with fields of definition Fn such that — for each n, Fn is a quadratic extension of a totally real subfield Bn ; — the relative discriminants DFn /Bn go to infinity ; — the absolute degree [Fn : Q] is bounded. Then Mn is BS-convergent to H3 . The first hypothesis on Mn is equivalent to the statement that Mn is an arithmetic manifold of the simplest type (in the commonly used terminology), i.e. it contains immersed totally geodesic hypersurfaces, or equivalently its commensurability class is defined by a quadratic form over Bn (using the isogeny from SO(3, 1) to SL2 (C)). Note that Theorem B includes the case of lattices defined over imaginary quadratic fields whose discriminant goes to infinity but not that of lattices defined over cubic fields. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 9 1.2.2. SL2 As explained above, the proof we give for Theorem A in the quadratic case rests on the study of the special case of Bianchi groups. We will actually study the latter within a slightly larger problem which we now explain. Fix (r1 , r2 ) and let F be the set of all number fields which have signature equal to (r1 , r2 ) ; we will denote by r = r1 + 2r2 the degree of those fields. For F ∈ F let ΓF be the group SL2 (OF ) ; then all ΓF are nonuniform arithmetic lattices in the Lie group G∞ = SL2 (R)r1 × SL2 (C)r2 , and we let MF be the finite–volume orbifold ΓF \X where X = (H2 )r1 × (H3 )r2 is the symmetric space associated to G∞ . Then we can ask the following question. Question. — Are the orbifolds MF BS-convergent to X as DF → +∞ and F ∈ F ? Here and in the remainder of this paper, we use DF to denote the absolute value of the discriminant of the field F . As stated in Theorem A, this has a positive answer for the Bianchi orbifolds (the case (r1 , r2 ) = (0, 1)). Theorem C. — For all R > 0, ε > 0 there is a C > 0 such that for any imaginary quadratic field F we have vol(MF )6R 6 C(vol MF )1−(1/3−ε) . We also study real quadratic fields F , for which we get the following result. Theorem D. — There exists a sequence Fn of pairwise distinct real quadratic fields for which the following holds : for all R > 0, ε > 0 there is a C > 0 such that for all n we have vol(MFn )6R 6 C(vol MFn )1−1/10+ε . The 1/10 is not optimal, even with our arguments. We note that a solution to Gauss’ conjecture that there are infinitely many real quadratic number fields of class-number one would yield such a sequence (with a much better estimate), and actually a good enough approximation to it √ also does. Let us make this rigorous : if Fn = Q( Dn ) satisfies hFn ≪ DFa n for some 0 < a < 1/4 then the sequence MFn BS-converges to H2 × H2 , with an estimate on the volume of the thin part of the order DF1+2a+ε for n all ε > 0 ; in particular an estimate like hFn ≪ log DFn is as efficient as the SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 10 JEAN RAIMBAULT solution to Gauss conjecture would be here. Let us now briefly discuss the proof of these theorems ; until the last steps we actually work with fields of arbitrary signature. Recall that in both 3/2 cases the total volume of MF is of order DF . To estimate the volume of the thin part of MF it is natural to distinguish between components according to whether they correspond to cuspidal elements (belonging to an F -rational parabolic subgroup) or not. The part corresponding to the cuspidal elements is sufficiently explicit, and we can relate its volume to well–known invariants of the number field F (namely its discriminant, classnumber and regulator) to prove that it is bounded above by a power < 1 of the volume. The rest of the thin part corresponds to compact flats and we use a method already present in Bianchi’s work to estimate the number of such flats in MF . Namely, reduction theory provides us with a covering of MF by horoball regions (‘Siegel domains’), one for each cusp of MF . We actually need a quantitative description of the reduction theory of G, for which we rely on results of S. Ohno and T. Watanabe [32]. It is then easy to count the number of geodesics of a given length through one of these horoballs, and summing over all cusps we get an estimate for the number of geodesics of a given length. Since the cusps of MF are in one-to-one correspondance with the class group of F , we get a sum over the latter. r−1 P −r+2 , where Cj are The upper bound we obtain is then roughly DF 2 j |Cj | representants of least possible norm for the ideal classes of F . It simplifies to DF for r = 2 ; for r > 4 it diverges because of the cusp at infinity (C = OF ), and for r = 3 we can estimate it using an elementary argument about the distribution of norms of ideal classes (note that a much more precise statement holds : by a difficult result of M. Einsiedler, E. Lindenstrauss, P. Michel and A. Venkatesh [20] the ideal classes become equidistributed in the space of unimodular three–dimensional Euclidean lattices as the discriminant goes to infinity). The difficulties do not stop there, since we must then estimate the volume of the flats entering the count : these volumes are related to the relative regulators of quadratic extensions of F , and in general we did not manage to get good enough estimates for them. For F imaginary quadratic there is no problem (this is the only case where the flats are 1-dimensional, i.e. geodesics), and for F real quadratic we can use an ad hoc argument to find a sequence where we can control them. For the cubic case we do not know how to deal with this. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 11 Finally, note that via the Jacquet–Langlands correspondance, if we can estimate the number of maximal compact flats with given systole in MF for F of signature (r1 , r2 ) = (r − 2, 1) we get as a corollary the statement that a sequence of minimal arithmetic hyperbolic 3–orbifolds defined over fields of degree r is BS-convergent to H3 (we do not need estimates for the volume of the flats for this–in fact we care only about those of dimension 1). This is how the cubic case of Theorem A is proven. 1.2.3. Other cases We could also deduce from our methods a few other examples of BSconvergent maximal sequences ; since our interest is mostly in hyperbolic three–manifolds we will only state them briefly : — Sequences of maximal arithmetic Fuchsian lattices defined over totally real fields of degree less than 3 are BS-convergent to H2 ; — Sequences of irreducible cocompact lattices in SL2 (R × R) defined over the fields in Theorem D are BS-convergent to H2 × H2 . The argument of Theorem B can also be applied to higher-degree CM-fields to yield results of convergence towards (H3 )r for r > 1. 1.3. Applications 1.3.1. Quadratic forms As we mentioned the proof of Theorem C we give is a quantification of some of Bianchi’s arguments in [10] ; one of the purposes of his work was to establish the finiteness of the number hF (d) of classes of integral quadratic forms over F modulo SL2 (OF ) with discriminant d. Bianchi’s paper does not give an explicit estimate in terms of either d or DF : using our result we obtain the following estimate. Corollary. — For every ε > 0 there is a Cε > 0 such that for every discriminant d ∈ OF and every quadratic field F we have hF (d) 6 Cε (d · DF )1+ε . There are δ, Cε > 0 such that for every cubic field F we have hF (d) 6 3/2−δ . Cε d3/2+ε · DF SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 12 JEAN RAIMBAULT 1.3.2. Fibered arithmetic manifolds We can use Theorem A to prove a result on the virtual fibrations of arithmetic manifolds ; the proof of this was suggested by a discussion with J. Souto. We need to introduce some more terminology on hyperbolic three– manifolds to state the result. It is a seminal result of W. Thurston that for a so–called pseudo-Anosov diffeomorphism φ of a finitely triangulated surface S of Euler characteristic χ(S) < 0, the three–manifold Mφ obtained as the mapping torus Mφ = S × [0, 1]/ ∼, (φ(x), 1) ∼ (x, 0) has a complete hyperbolic structure of finite volume (this is proven for example in J. P. Otal’s book [33]). Amazingly, the converse is true up to finite covers : it was conjectured by Thurston, and recently proven by I. Agol [4] (following work of D. Wise) that any complete hyperbolic three– manifold M of finite volume admits a finite cover which is a fiber bundle over the circle ; the image of a fiber in such a fibration under the covering map to M is called a virtual fiber of M . Theorem 1.1 in [11], together with the fact that the Laplacian spectra on functions for congruence hyperbolic three–manifolds have a uniform lower bound [17], implies that for a given r there are only finitely many maximal or congruence lattices with invariant trace field of degree r having a virtual fiber of a given genus : see Theorem 7.2 in loc. cit.. From our results we can recover the following special case of this. Corollary. — For any g > 2 there are at most finitely many congruence arithmetic hyperbolic 3–manifolds defined over quadratic or cubic fields which contain a virtual fiber of genus g. Démonstration. — Suppose the contrary, and let S be a surface of genus g which is a virtual fiber for infinitely many such manifolds. Then by Theorem A we get that there exists a sequence of hyperbolic manifolds Mn which is BS-convergent to H3 and such that every Mn is fibered over the circle with fiber S. But the latter fact implies that any pointed Gromov– Hausdorff accumulation point of the sequence Mn has to be a so-called doubly degenerate manifold (cf. the proof of Theorem 12.8 in [3]), which contradicts the fact that Mn BS-converges to H3 .  Replacing “genus > 2” by “Euler characteristic < 0” we get a statement which deals also with noncompact manifolds and has the same proof. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 13 1.3.3. Heegard genera A handlebody H of genus g is a regular neighbourhood of an embedding in R3 of a wedge of g circles. Taking two copies H1 , H2 of H and identifying their boundaries via an diffeomorphism of the boundary ∂H (a closed surface of genus g) we get a closed three–manifold. The Heegard genus of a given closed three–manifold is defined to be the smallest g such that M can be obtained by the above construction with a handlebody of genus g. As in the case of fibered manifolds, bounds on the Heegard genus imply strong constraints on the geometry for hyperbolic manifolds. More precisely, D. Bachman, D. Cooper and M. White prove in [5] that for every g there is a C(g) such that any hyperbolic three–manifold M of Heegard genus g has max inj(M ) 6 C(g). Together with Theorem A this implies the following result, which is a particular case of the results discussed by M. Gromov and L. Guth in [27, Appendix A]. Corollary. — Given g > 0 there are at most finitely many congruence closed arithmetic hyperbolic three–manifolds of Heegard genus g whose invariant trace-field is of degree 2 or 3. 1.3.4. Growth of Betti numbers One of the original motivations for the study of BS-convergent sequences of manifolds is that in such sequences one can relate the growth of Betti numbers to the so-called L2 -Betti numbers of the limit [3, Theorem 1.15]. For hyperbolic three–manifolds, when the limit is the universal cover the L2 -Betti numbers vanish. Thus we get the following corollary of Theorem B. Corollary. — Let Γn be a sequence of maximal arithmetic or congruence lattices in SL2 (C) whose invariant trace fields are quadratic, or cubic and satisfying the conditions in Theorem A. Then lim n→+∞ b1 (Γn ) = 0. vol(Γn \H3 ) Démonstration. — Let Γ′n be any sequence of torsion-free, finite index subgroups of Γn . Then by Proposition C in [38] (in the compact case it is Theorem 1.8 in [3]) we get that b1 (Γ′n ) = o(vol Γ′n \H3 ). Since b1 (Γn ) 6 b1 (Γ′n ), it suffices to prove that there exists a constant C independant of n such that all Γn have a torsion-free subgroup of index less than C. SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 14 JEAN RAIMBAULT We will actually prove the following more general (well-known) claim : if r, G∞ are given, there is a C such that for any arithmetic lattice Γ in G∞ defined over a field F of degree r, there is a torsion-free subgroup of Γ of index less than C. To prove this we use a theorem of Minkowski (see [7, Théorème 2.13]) stating that if Π is a subgroup of GLd (Z), the kernel of the reduction map from Π to GLd (Z/3Z) is torsion-free. Thus the claim reduces to showing that we can find a morphism from Γ into GLd (Z) whose kernel is of uniformly bounded order, with a d depending only on G∞ and r. This is well-known, and can be proven as follows. Let G be the algebraic goup over F defining the commensurability class of Γ, and let G be its adjoint group and gF the F -Lie algebra of G. By [14, Proposition 1.2], we have that the image Γ of Γ in the adjoint group of G∞ is contained in G(F ) ; hence we get a map ρ : Γ → GL(gF ), whose kernel contains only central elements of Γ, and hence is of order less than the number of roots of unity contained in F (itself bounded by a constant depending only on r). By a local-global argument it is easily seen that ρ(Γ) stabilizes an OF -lattice in gF , hence ρ induces a map Γ → GLd (OF ) where d = dimF (gF ) whose kernel has its order bounded by a constant depending only on r. Weil’s restriction of scalars yields an embedding of GLd (OF ) into GLrd (Z), which concludes the proof of the claim.  In particular for Bianchi groups, whose covolume has the asymptotic behaviour vol(ΓD \H3 ) ≍ D3/2 , we get the following limit : b1 (ΓD ) =0 D→+∞ D 3/2 which does not seem to have been previously known. Lower bounds of 2 the order D ≍ (vol MD ) 3 are known for b1 (ΓD ) (see [42]), and there are computations of H1 (ΓD ) for D 6 1867 in [36]. An interesting question would be to determine whether the limit log b1 (ΓD ) lim D→+∞ log D exists, and to evaluate it. The existing data indicates that it could be as small as possible, i.e. one : it may well be that almost all the cuspidal cohomology of the Bianchi groups comes from base change (which gives a lower bound of the order of Rohlfs’) ; cf. [37] for more information. lim 1.3.5. Torsion homology As in [3, Section 10] one can apply the convergence result above (Theorem A) to the growth of the torsion homology of uniform arithmetic lattices in ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 15 SL2 (C), with coefficients in nontrivial modules. Here is a sample of what can be proven : if Γn is a sequence of maximal lattices with quadratic trace field and we choose for each n an adΓn -stable latticeLn inside sl2 (C) then we have log |H1 (Γn , Ln )| 13 (1.2) lim = . n→+∞ vol(Γn \H3 ) 6π and this generalizes without much problem to cubic lattices and to higherdimensional local systems. On the other hand the problem for Bianchi groups seem more complicated. It seems that the arguments of [31] can be adapted to this setting to prove the required asymptotics of analytic torsion, but assuming that there would still be some nontrivial analysis to perform to be able to conclude that (1.2) holds. Let us mention here that the computations of A. Rahm alluded to above show that the order of torsion classes in the first homology with trivial coefficients of the Bianchi groups can be quite large. 1.3.6. Trace formulae and limit multiplicities The following ‘limit multiplicities’ result is an immediate consequence of Theorem A and [3, Theorem 1.2]. Corollary. — Let Γn be a sequence of maximal or congruence uniform arithmetic lattices in G∞ = SL2 (C) defined over quadratic or cubic fields with the conditions in Theorme A ; for a unitary representation π of G∞ let m(π, Γn ) denote the multiplicity of π in L2 (Γn \G∞ ). Then for any regular, bounded open subset S of the unitary dual of G∞ we have P π∈S m(π, Γn ) = ν G∞ (S) lim n→+∞ vol Γn \H3 where ν G∞ is the Plancherel measure on the unitary dual. Since SL2 (C) has no discrete series this implies that for a single representation π we have m(π, Γn )/ vol(Γn \H3 ) → 0 (see [3, Corollary 1.3]). In particular this result implies Corollary 1.3.4 on Betti numbers for uniform lattices. For the nonuniform case, rather than using an indirect argument as in the proof of above it would be more natural (and more susceptible of generalizing to other symmetric spaces, where the magic of hyperbolic Dehn surgery is not available) to give a proof using the trace formula. Such a proof was given in [39] for congruence covers of Bianchi orbifolds, but it needed an additional assumption on the asymptotic geometry, that the sum P 2 j |τj | over the cusps (see (2.2) for the definition of τ ) be an o(vol). This SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 16 JEAN RAIMBAULT condition is easily seen to be realized for Bianchi groups (I am grateful to Akshay Venkatesh for pointing this out to me) as can be established using an argument similar to that in Lemma 5.3 below, and thus we have another proof of the Corollary. This proof is also the first step towards establishing limit multiplicities for the sequence of Bianchi groups ; the missing ingredient for this more precise result is the control of intertwining operators at large eigenvalues (see [39, Section 3.2]). There is a reverse result for the problem of limit multiplicities. In [1] Miklós Abért, Nicolas Bergeron and Balı́nt Virág extend the results of [2] to the setting of IRSs in Lie groups to obtain the following result. Let G∞ is a simple Lie group ; if Y is a Riemannian manifold let λ0 (Y ) denote the infimum of the spectrum of the Laplace operator on functions on Y . Then if ν is any IRS of G∞ supported on discrete subgroups and for ν-almost all Λ we have λ0 (Λ\X) > λ0 (X) then ν is trivial. This implies that if a sequence of lattices Γn 6 PSL2 (C) satisfies the condition sthat X dim ker(∆n − λ) = o(vol(Mn ) λ∈σ(∆n ) λ61 (where ∆n is the Laplacian of Mn = Γn \H3 ) then the associated locally symmetric spaces BS-converge to X. In particular it follows that the Ramanujan conjecture for GL2 implies (a more general version of) our nonquantitative results. 1.4. Outline In Section 2 we recall the notion of Benjamini–Schramm convergence from [3] and make various general observations about it which were not included there. The next section 4 recalls (mostly) well-known results on the geometry of the groups SL2 (OF ). We prove Theorem B in Section 3, and then Theorems C and D in Section 5. The end of the proof of Theorem A is finally completed in the last section 6 after recalling the description of maximal arithmetic lattices. 2. Finite–volume orbifolds and Benjamini–Schramm convergence In this section we fix a real, noncompact, semisimple Lie group G∞ (we will also suppose for clarity that G∞ has no center), a maximal compact ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 17 subgroup K∞ and let X = G∞ /K∞ be the associated symmetric space. We will study the volume of the thin part of X-orbifolds of finite volume by decomposing it into cuspidal and compact components. We will also recall the notion of Benjamini–Schramm convergence from [3] and prove criteria for BS-convergence to the universal cover. These results were not in the original paper [3] since the focus there was on compact manifolds rather than general finite-volume orbifolds ; this section should be seen as an appendix to this paper rather than a new development. We have however tried to be a little self-contained by recalling some important definitions from loc. cit.. 2.1. A recapitulation of Benjamini–Schramm convergence As stated in the introduction, Benjamini–Schramm convergence of a sequence of X-orbifolds Mn = Γn \X of finite volume towards X means that Mn converges almost everywhere in the Gromov–Hausdorff sense to X as n tends to infinity. This can be rephrased in more group–theoretic terms as follows : for any Chabauty neighbourhood (e) W of the trivial subgroup Id of G∞ the proportion of g ∈ G/Γn for which gΓn g −1 intersects W trivially tends to 1. This allows us to define a more general notion of convergence for finite– volume X-orbifolds. Let SubG∞ be the compact space of closed subgroups of G∞ with its Chabauty topology ; an invariant random subgroup (IRS) of G∞ is a probability measure on SubG∞ which is invariant under conjugation (this term was first coined in [2]). Endowed with the topology of weak convergence the set IRS(G∞ ) of IRS of G∞ is compact. Moreover, there is a map from the isometry classes of finite-volume X-orbifolds to IRS(G∞ ) defined as follows : for any such orbifold M we may choose a monodromy from π1 (M ) to a lattice Γ in G∞ . To a lattice Γ we may then associate the only G∞ -invariant probability measure µΓ on SubG∞ which is supported on the conjugacy class of Γ ; in other terms we take µΓ to be the pushforward of the G∞ -invariant probability on G∞ /Γ by the map gγ 7→ gΓg −1 . This measure does not depend on the choice of the monodromy group Γ and we say that a sequence Mn is BS-convergent to an IRS µ if the sequence of IRS µΓn converges weakly to µ. It is established in [3, Lemma 3.5] that BS-convergence to the Dirac mass δId on the trivial subgroup is the same as e. For the definition of the Chabauty topology we refer to the beginning of section 2 of [3]. SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 18 JEAN RAIMBAULT BS-convergence to X in the sense given in (1.1). This is intuitively clear : (1.1) translates in group-theoretical terms to the statement that for almost all gn ∈ G/Γn the sequence gn Γn gn−1 converges in Chabauty topology to the trivial group. Invariant random subgroups should be thought of as a generalization of lattices and their normal subgroups ; there is a neat analogue of Borel’s density theorem for IRS ([3, Theorem 2.6]) which states that any nontrivial IRS of G∞ is supported on discrete, Zariski–dense subgroups of G∞ . Recall that an isometry of X is said to be elliptic if it has a fixed point in X, unipotent if it has a unique fixed point on the boundary at infinity and hyperbolic otherwise. Since a Zariski–dense subgroup must contain hyperbolic elements we get the following consequence : Lemma 2.1. — Let µ ∈ IRS(G∞ ) and suppose that there exists an open subset U in SubG∞ such that any Λ ∈ U does not contain an hyperbolic element of G∞ and µ(U ) > 0. Then µ = δId . In more informal language this means that for an IRS µ 6= δId a µ-random subgroup must contain an hyperbolic element. 2.2. A criterion for BS–convergence in rank one If M is a closed Riemannian manifold with (strictly) negative sectional curvature and R > 0 we define NR (M ) to be equal to the number (f) of closed geodesics of length less than R in M . Proposition 2.2. — Let X be a rank-one irreducible symmetric space and Mn be a sequence of finite-volume X-orbifolds. Suppose that there exists a δ > 0 such that for all n the systole sys(Mn ) is larger than δ. Then Mn is BS–convergent to X if and only if for all R > 0 we have NR (Mn ) = 0. lim n→+∞ vol Mn This allows to deduce from [3, Theorem 1.11] the following corollary. Corollary. — Let G∞ be a Lie group of real rank 1 and let Γ be an nonuniform arithmetic lattice in G∞ . If Γn is a sequence of congruence subgroups of Γ then the sequence Γn \X is BS-convergent to X. f. This number is well-known to be finite : in the Hausdorff topology the set of closed geodesics of length 6 R is compact, and the negative curvature forbids that it has an accumulation point. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 19 Proof of Proposition 2.2. — For each n fix a monodromy Γn for π1 (Mn ) and let µ be any limit point of a subsequence of µΓn . We will prove that µ-random subgroups do not contain hyperbolic elements, from which it follows by the generalization of Borel’s density theorem to IRS [3, Theorem 2.6] (see Lemma 2.1 above) that we must have µ = δId . Let g0 ∈ G∞ be any hyperbolic isometry, let U be a relatively compact, open neighbourhood of g0 in G∞ which contains only hyperbolic elements, and let WU ⊂ SubG∞ be the set of closed subgroups of G∞ which contain at least one element in U ; then WU is open in the Chabauty topology. We will see that for any U as above we have (2.1) lim µΓn (WU ) = 0 n→+∞ whence it follows by a standard argument that for any µ as above we must have µ(WU ) = 0 for all U , which finally yields the claim that a µ-random subgroup does not contain hyperbolic elements. To prove (2.1) it suffices to show that there is a R > 0 depending on U such that µΓn (WU ) ≪ (vol Mn )−1 NR (Mn ), which we will now do. Let x0 be the fixed point of K∞ in X and R = sup dX (x0 , hx0 ). h∈U Now let Sn be the compact subset of points in Mn through which passes a closed curve of length 6 R which is homotopic to a closed geodesic in Mn . Then for all x ∈ Mn \ Sn and g such that x = gΓn x0 we have that (gΓn g −1 ) ∩ U = ∅ (for any h ∈ g −1 Γn g the image in Mn of the geodesic segment [x0 , hx0 ] is a closed curve homotopic to a closed geodesic and of length 6 R), and it follows that µΓn (WU ) 6 vol Sn . vol Mn On the other hand by Lemma 2.3 below we have that vol Sn ≪ NR (Mn ), so (2.1) follows from the hypothesis. The converse statement is [3, Proposition 6.7] : we note that we do not use it in the paper.  2.3. Estimating the volume of the thin part for products of hyperbolic spaces In this subsection we restrict to G∞ = SL2 (R)r1 × SL2 (C)r2 (so that X = (H2 )r1 × (H3 )r2 ) and we let Γ be an arithmetic irreducible lattice SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 20 JEAN RAIMBAULT in G∞ (if r1 + r2 > 1 then arithmeticity is a consequence of Margulis’ arithmeticity theorem). Then either Γ is co-compact or it is commensurable to SL2 (OF ) for some number field F of signature (r1 , r2 ). Here we will give a rough description of the R-thin part of Γ\X in terms of the geometry of its compact flats and its cusps (the latter will be described in Section 4 in terms of number-theoretic quantities). 2.3.1. Geometry of flat manifolds For the contents of this section we refer the reader to Siegel’s book [45]. If Λ is a lattice in Euclidean space Rr we denote by α1 (Λ) 6 . . . 6 αr (Λ) the successive minima of L, by vol Λ the covolume of Λ and we put vol Λ α2 (Λ) . . . αr (Λ) (2.2) τ (Λ) = ≍ . α1 (Λ)r α1 (Λ)r−1 The asymptotics on the right follow from Minkowski’s second theorem and thus depend only on r ; note that Mahler’s criterion affirms that a set of unimodular lattices is bounded in SLn (R)/SLn (Z) if and only if τ is bounded on this set. For a compact Euclidean manifold T = ∆\Rr we define τ (T ) = τ (Λ) and also α1 (T ) = α1 (Λ) where Λ is the translation subgroup of ∆. 2.3.2. Neighbourhoods of compact flats If g is a semisimple isometry of X = (H2 )r1 × (H3 )r2 there is a maximal subset in X which is a union of flats on which g acts as a Euclidean translation or trivially. We will denote it by Min(g), and by ℓ(g) the distance d(x, gx) for x ∈ Min(g) (this is the minimal displacement of g, and Min(g) is the set on which it is attained—see [15, II.6] for a discussion in a larger context). Lemma 2.3. — There is a function f :]0, +∞[→]0, +∞[ such that for any R > 0 and any semisimple g with ℓ(g) 6 R, the subset {x ∈ X : d(x, gx) 6 R} is contained in the f (R)-neighbourhood of Min(g). Démonstration. — This is easily seen for a semisimple isometry of H2 or H . The result on a product follows immediately (note that the isometry may be trivial in some factor, in which case Min(g) is not a flat subspace but a union of such).  3 ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 21 Lemma 2.4. — If Γ is an irreducible lattice in G∞ then Min(g) is a flat of X for every semisimple g ∈ Γ. Moreover, if Γ is co-compact, or if Γ is commensurable to SL2 (OF ) and g does not fix a point in P1 (F ), then Min(g) projects to a compact subset in Γ\X. Démonstration. — The first statement follows immediately from the fact that a non-trivial element in an irreducible lattice in G∞ cannot be trivial in any factor (since the lattice is arithmetic, hence obtained by restriction of scalars from a F -form G of SL2 for some number field F ). If g does not belong to a F -rational proper parabolic subgroup of G∞ , then it is contained in a maximal torus T of G which is anisotropic over F . On the other hand, Min(g) is contained in the flat preserved by T. By Godement’s compactness criterion we know that (T(F ⊗Q R) ∩ Γ)\T(F ⊗Q R) is compact (see for example [35, Proposition 10.16]) and it follows that Min(g) itself must map to a compact set in the quotient Γ\X.  2.3.3. Cusps Here we suppose that Γ is not uniform, so that it is a lattice in G∞ commensurable to SL2 (OF ). The cusps of Γ\X correspond to the points of the projective space P1 (F ). If ξ ∈ P1 (F ) the corresponding cusp is described as follows. Let P be the Borel subgroup of SL2 (F ) stabilising ξ and ΓP = Γ ∩ P . Then the cusp associated to ξ (or P ) is C = ΓP \X. Let N be the unipotent subgroup of P and Λ = Γ ∩ N , viewed as a lattice in the Euclidean space N and let T = Λ\N , a flat torus of dimension r = r1 + 2r2 . Let A be a maximal (split of rank r1 + r2 ) torus in P with the following property : ΓP is generated by Λ and U = Γ ∩ A. Let M be the (r1 + r2 − 1)-dimensional subtorus of A containing U , in other words ) (    Y r1 a1 0 0 ar1 +r2 |ai | = 1 g −1 M =g ,..., : 0 a−1 0 a−1 r1 +r2 1 i=1 for g such that g∞ = ξ and let S be the compact manifold U \M . Then C is topologically ]0, +∞[×B where B is a flat torus bundle with fiber T over S, and the fibers over {a} × S are isometric to T scaled by a factor proportional to a−1 . The length element on ]0, +∞[ is da/a and the metric on S is constant along a so the volume of the cusp truncated at ε is ε−r vol(T ) vol(S). We choose the parameter a so that α1 (T ) = 1 and let η ∈ Λ realise it (as an euclidean translation). Then the euclidean displacement of η on SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 22 JEAN RAIMBAULT the horosphere at height a is equal to a−1 and its dispacement in X is ≍ log(1 + a−1 ). We now fix R > 0 ; we see that the part of C where there is some unipotent element with a displacement less than R is of volume C(R) vol(T ) vol(S) (where CR ≍ erR , which we won’t use in the sequel). To express this in terms of the conformal geometry of T we use (2.2) : we have vol(T ) ≍ τ (Λ). We record the conclusion of the discussion in the following lemma : let M6R,Λ = {x ∈ M : ∃x̃ a lift of x, λ ∈ Λ \ {1} : d(x, λx) 6 R} be the subset of M where some non-trivial element of (the conjugacy class of) Λ displaces less than R. Lemma 2.5. — Let R > 0. Then vol(M6R,Λ ) ≪R τ (Λ) vol(S) for any maximal unipotent subgroup Λ where S is the flat (r1 +r2 −1)-torus associated to Λ as above. We still have to estimate the volume of the chunk of the thin part of Γ\X coming from non-unipotent elements of ΓP . For this we define, for ζ ∈ P1 (F ), ζ 6= ξ, a subgroup Uζ = StabΓP (ζ). Then ΓP is the disjoint union of Λ and all Uζ − {1}. There is a unique maximal flat Fζ stabilised by Uζ , foliated by hyperplanes on which it acts cocompactly with quotient Sξ,ζ . Now we fix R > 0 and we suppose that the injectivity radius of Sξ,ζ is 6 R (there are only finitely many ζ with this property). By Lemma 2.3 the part of X where some non-trivial element of Uζ displaces of less than R is an f (R)-neighbourhood of Fζ . We do not need to estimate the volume of its image in Γ\X, only that of the part where there in no unipotent element which displaces less than all non-trivial elements of Uζ . Let : nu M6R,ξ = {x ∈ M : for all unipotent λ ∈ Γ : d(x̃, λx̃) > R and ∃γ ∈ ΓP \Λ : d(x̃, γ x̃) 6 R} S the subset of M \ Λ′ M6R,Λ′ where some element of ΓP \ Λ displaces less than R. Projecting that to Fζ we find a subset bounded by two parallel hyperplanes : we let ℓ(ζ) be the distance between these two hyperplanes. Then the volume we want to estimate is bounded by ℓ(ζ) vol(Sξ,ζ ) and we get the following lemma. Lemma 2.6. — Let R > 0. Then nu vol(M6R,ξ )≪ ANNALES DE L’INSTITUT FOURIER X ζ∈P1 (F ), ζ6=ξ inj(Sξ,ζ )6R ℓ(ζ) vol(Sξ,ζ ). CONVERGENCE DES ORBI-VARIÉTÉS 23 for all ξ ∈ P1 (F ), with a constant depending only on R. 2.3.4. Conclusion Putting together all lemmas proven in this subsection we get the following result. Proposition 2.7. — Fix δ, R > 0 ; then for any irreducible arithmetic non-uniform lattice Γ in G∞ , such that M = Γ\X has a systole sys(M ) > δ, we have : e h h X X X X X qj vol M ℓ(ζ) vol(Sξj ,ζ )+ vol(Sj )τ (Λj )+ vol T + vol M6R ≪ T :α1 (T )6R j=1 j=1 ζ∈P1 (F ), ζ6=ξj inj(Sξj ,ζ )6R where the constant depends only on R, δ, X. The first sum on the right is over top-dimensional compact flats T of M , q1 , . . . , qj are the orders of γ1 , . . . , γe where the γj are generators for a set of representatives for the conjugacy classes of maximal finite cyclic subgroups in Γ, and M [γj ] is the image in M of the fixed flat of γj . Finally, N1 , . . . , Nh are representatives for the Γ-conjugacy classes of maximal unipotent subgroups of SL2 (F ), Λj = Γ ∩ Nj (R), ξj is the fixed point in P1 (F ) of Nj and the Sj are compact quotients of the Levi subgroups of the parabolics associated with the Λj . In the case where M is compact we have the same result, without the second and third term in the sum above. Démonstration. — If g ∈ Γ is a semisimple element of infinite order with ℓ(g) 6 R, then by Lemmas 2.3 and 2.4 the image in M of the region of X where g displaces by distance less than R is contained in an f (R)neighbourhood of a compact flat T . The volume of the former is bounded by C(R) vol(T ) where C(R) depends only on X and R (for example it can be taken to be the volume of a R-ball in X). Hence the first term ; the last one is obtained in the same way. The second and third terms follow immediately from Lemmas 2.5 and 2.6.  3. Proof of Theorem B 3.1. Closed geodesics in arithmetic orbifolds Here we briefly explain how to describe the lengths of closed geodesics in hyperbolic arithmetic three–orbifolds (up to multiplication by a rational) SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX j=1 24 JEAN RAIMBAULT and prove a finiteness result. We will suppose the reader familiar with the description of arithmetic lattices in SL2 (C) (which can be found for example in [30]). If Γ is any arithmetic subgroup of SL2 (C) defined over a number field F it is well–known that we can relate the lengths of closed geodesics in Γ\H3 to the norms of units in quadratic extensions of F . More precisely : Γ is commensurable to an arithmetic subgroup of G(F ) for some quaternion algebra A over F and G = SL1 (A). We will now state a general result on translation lengths on products of hyperbolic planes and spaces, to be re-used later (see also [30, 12.3]). We use m to denote the logarithmic Mahler measure defined for a ∈ Q by X (3.1) m(a) = max(0, log |aσ |) σ where the sum runs over all conjugates of a in Q. Let γ ∈ G(F ) have eigenvalues λ±1 and let σ : F → C is a real (resp. imaginary) embedding of F . There is a unique extension of σ to F (λ) such that |λσ | > 1, and the minimal displacement of γ σ ∈ SL2 (R) (resp. SL2 (C)) on H2 (resp. H3 ) is then equal to log |λσ |. Note that the formula is also valid in case A ramifies at σ since it gives 0 in this case. So in the end we get that the double of the minimal displacement on the relevant symmetric space is equal to P σ σ δ max(0, log |λ |) where the sum is over all conjugates of λ in C and σ δ = 2 if λ ∈ R and 1 otherwise. Let r1Ram be the number of real places where A ramifies and r1′ = r1 − r1Ram and ℓ(γ) the minimal displacement of ′ γ on (H2 )r1 × (H3 )r2 . By the Cauchy-Schwarz inequality we finally obtain (3.2) m(λ) p 6 ℓ(γ) 6 2m(λ). r2 + r1′ Now we suppose that F has exactly one complex place and A ramifies at all real places. We may suppose that F ⊂ C such that RF = C, and we will view Γ as a subgroup of SL1 (A ⊗ C) ∼ = SL2 (C). Let tr be the reduced trace of A ; any γ ∈ Γ has integral trace t = tr(γ) ∈ OF , and √ if it is moreover a semisimple element it can be diagonalized over E = F ( d), d = t2 −4, with eigenvalues ε±1 where ε is a unit of E such that NE/F (ε) = 1. Note that this kernel is an abelian group of rank 1 since E/F is inert at all infinite places but one. The proof for the following lemma follows an argument of N. Elkies [21]. Lemma 3.1. — Fix an integer r > 1 and a real R > 0 ; there exists a finite set {t1 , . . . , tm } of algebraic integers (depending only on R and the degree r) such that the following holds : for any number field F of degree ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 25 [F : Q] 6 r, any quaternion algebra A/F (split at an infinite place) and any hyperbolic γ ∈ A1 with integral trace, of minimal displacement 6 R (on the symmetric space associated to (A ⊗Q R)1 ) there is i ∈ {1, . . . , m} such that tr γ = ti . × Démonstration. — The set TR = {u ∈ Z : [Q(u) : Q] 6 r, m(u) 6 R} is finite for all R > 0, as the coefficients of the minimal polynomial of such an u are bounded by polynomials in exp(m(u)). By (3.2) (in this case the lefmost term there is simply m(λ)), the eigenvalues of a γ as in the statement must be some εi in TR . Putting TR = {ε1 , . . . , εm } and setting ti = εi + εi−1 we get the result.  3.2. Convergence of orbifolds of the simplest type We prove here Theorem B. The ingredients are only Lemma 3.1 and the following result. Lemma 3.2. — Suppose that Γn is a sequence of finite-covolume Kleinian groups such that for any R > 0, for large enough n any hyperbolic element in Γn with minimal displacement less than R has real trace. Then the sequence of orbifolds Γn \H3 is BS-convergent to H3 . Démonstration. — To prove this it suffices to prove that any limit of a subsequence of µΓn is equal to the trivial IRS δId . We will show that any such limit must be supported on non Zariski-dense subgroups of PSL2 (C), which forces it to be trivial by ‘Borel’s density theorem’ [3, Theorem 2.6]. The proof of this claim is similar to that of Proposition 2.2 : if U is an open, relatively compact subset of (C \ R)/{±1} let WU be the open subset of SubG (G = PSL2 (C)) of subgroups which contain an element having its trace in U . We can choose a countable set U of such U s so S S that U∈U U = (C \ R)/{±1}. Then the complement of U∈U WU in SubG contains only non-Zariski-dense subgroups. Indeed, the condition ± tr(g) = ±tr(g) describes a Zariski-closed subset in PSL2 (C), so every Zariski-dense subgroup of G must contain an element with trace in (C \ R)/{±1} and so belongs to WU for some U ∈ U. Thus it suffices to prove that for every U ∈ U we have : lim µΓn (WU ) = 0 n→+∞ (from which the result follows by the σ-additivity of any limit measure). But since for any given U , there is a R > 0 so that WU is contained in  {z : |z| 6 R} we have in fact that µΓn (WU ) = 0 for large enough n. SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 26 JEAN RAIMBAULT We now check the condition of Lemma 3.2 for the sequence Γn in the statement of Theorem B. Fix R > 0, and let t1 , . . . , tm be the finite set given by Lemma 3.1, ordered so that the totally real ones are exactly t1 , . . . , tl . Then for any l < i 6 m we have ti 6∈ Fn for n large enough : indeed, since ti is not totally real we have ti ∈ Fn ⇒ Fn = Bn (ti ) but the relative discriminants DBn (ti )/Bn for i = 1, . . . , m are bounded so we must have ti 6∈ Fn for large n since DFn /Bn is by hypothesis unbounded. Thus, for n large enough, the traces of the elements in Γn of displacement less than R are among those of the ti which are totally real numbers. 4. Geometry of MF Recall from the introduction that if F is a number field with signature (r1 , r2 ) we denote by MF the finite-volume orbifold MF = PSL2 (OF )\(H2 )r1 × (H3 )r2 . This section is preliminary to the proof of our main results ; we record various known results about the global geometry of the orbifolds MF . We will also set notation as we go along. We begin by recalling the volume formula for MF given in [13] : (4.1) vol MF = 2ζF (2) 23r2 π r1 +2r2 3 DF2 . 4.1. Reduction theory for SL2 We describe here the well–known reduction theory for the groups ΓF = SL2 (OF ) in a manner suitable to the use we will make of it later. We will work with the adelic version of reduction theory, which is much better suited to the study of manifolds which have more than one cusp. For this subsection we fix a number field F with r1 real places and r2 complex ones, and let r = r1 + 2r2 be its absolute degree. We will denote by Vf , V∞ the set of finite and infinite places of F . For each v either finite of infinite we denote by |·|v the absolute value at v and by Fv the metric completion of F for | · |v . We will use Af to signify the ring of finite adèles of F , and denote Q F∞ = v∈V∞ Fv and A = F∞ × Af the complete ring of adèles. If v is a finite place of F we let Kv = SL2 (Ov ), and we denote by Kf the closure Q of ΓF in SL2 (Af ) (which equals v∈Vf Kv ). For each v ∈ V∞ we choose the maximal compact subgroup Kv of SL2 (Fv ) to be SO(2) if Fv = R and Q SU(2) if Fv ∼ = C. The product K = Kf × v∈V∞ Kv is then a compact subgroup of SL2 (A). ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 27 4.1.1. Minkowski–Hermite reduction Let B be the standard Borel subgroup (upper triangular matrices) over F for SL2 , N its unipotent subgroup and T the maximal F -split torus of diagonal matrices. Let hF be the class-number of F and C1 = OF , C2 , . . . , ChF a set of representatives for the class-group of F . For each i = 1, . . . , hF we choose ai to be an idèle of (idélic) norm 1 such that for all v ∈ Vf we  have ai Ov = Ci Ov ; we will (abusively) also denote by ai the matrix ai 0 ∈ SL2 (A). Let T∞ = T(F∞ ) and for any c > 1 define −1 0 ai T∞ (c) =  t 0 0 t−1   ∈ T∞ : |t|∞ > c , Q where we put |t|∞ = v∈V∞ |tv |v . The following result is then a straighforward consequence of classical reduction theory (see for example [25]) : for small enough cF we have (g) : (4.2) SL2 (A) = hF [ i=1 SL2 (F ) · N(A)T∞ (cF )ai K. There is an estimate for cF for number fields due to S. Ohno and T. Watanabe [32] : they prove that ! 2 1 kgvk r 6 CDFr (4.3) γ(F ) := sup inf 2 1 | det g| r g∈GL2 (A) v∈F where k · k is a norm on A2 given at each place v by a norm preserved by Kv and normalized so that ke1 k = 1. It is easy to see that we can take r cF > γ(F )− 2 in (4.2). Using strong approximation for G it is possible to replace each ai in (4.2) by an element of SL2 (A) which is equal to some γi ∈ SL2 (F ) at all finite places. We will give an explicit choice for these γi (which will actually circumvent the use of the strong approximation property of G). For ξ ∈ F we put   0 1 (4.4) γξ = . −1 ξ g. To make the sets on the right-hand side of finite volume one usually replace N(A) by a compact subset U such that N(A) = N(F )U ; we will not need to do so here. SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 28 JEAN RAIMBAULT Let v ∈ Vf ; if v(ξ) 6 1 then γξ ∈ Kv ; if v(ξ) > 1 then one can easily compute the Iwasawa decomposition of γξ at v :  −1   ξ 1 1 0 (4.5) γξ = . 0 ξ −ξ −1 1 Fix i = 1, . . . , hF ; choose α, β ∈ OF such that (h) Ci = (β)/(α, β) and let ξ = α/β then it follows from (4.5) that N(Af )ai Kf = N(Af )γξ Kf . Putting γi = γξ we thus get from (4.2) SL2 (A) = hF [ i=1 = hF [ i=1 SL2 (F ) · N(A)T∞ (cF )(ai )∞ K∞ (ai )f Kf SL2 (F ) · N(A)T∞ (|ai |∞ cF )K∞ γi Kf , as we have |ai |∞ = |Ci | we can write the last equality as : (4.6) SL2 (A) = hF [ i=1 where ci = |Ci | · cF . SL2 (F )N(A)T∞ (ci )K∞ (γi Kf ) 4.1.2. Height functions Let α be the simple root of T defined over F given by   t 0 α = t2 . 0 t−1 We extend it as a character of B trivial on N, and we define a function on SL2 (A) by α(bk) = α(b). Then the height function yA on SL2 (A) is defined by yA (g) = maxγ∈SL2 (F ) |α(γg)|. We will identify this adelic function with height functions on the symmetric space X in the sense of [38, 2.1,2.2]. First we need to fix once and for all a model for X : for v ∈ V∞ we identify Xv = SL2 (Fv )/Kv with Fv ×]0, +∞[ using the Iwasawa decomposition in the usual manner where (0, 1) is the fixed point of Kv , so that Q X = G∞ /K∞ = v∈V∞ is identified with a product F∞ ×]0, +∞[r of halfplanes and -spaces. We define a height function y on X as follows : for h. This is possible since a=every ideal of OF is generated by two elements, hence if we take α, β to generate a representative for the inverse class of Ci we get that the integral ideal (β)/(α, β) is a representative of Ci . ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 29 Q (z, y) ∈ F∞ ×]0, +∞[r put y∞ (z, y) = v∈V∞ |yv |v , and for ξ ∈ P1 (F ) choose a γ ∈ SL2 (F ) such that γ · ξ = ∞ and an Iwasawa decomposition γ = bf kf with kf ∈ Kf , bf ∈ B(Af ) (see [16, Proposition 4.5.2]), and put (4.7) yξ (x) = |α(bf )|f · y∞ (γx) (which does not depend on the particular γ chosen). Then y(x) = maxξ∈P1 (F ) yξ (x) is a ΓF -invariant height function, and if π is the natural isomorphism SL2 (F )\SL2 (A)/K → ΓD \H3 we have yA = y ◦ π. We record that if ξ ∈ F and γξ is defined as in (4.4) then (4.5) yields : (4.8) yξ (x) = |B|−1 y∞ (γξ x) where B is the ideal (β)/(α, β) if ξ = α/β. 4.1.3. A fundamental set in classical setting From the decomposition (4.6) one can deduce a fundamental set for ΓF in X : let x0 be the fixed point of K∞ and for Y > 0 let B∞ (Y ) = {x ∈ X : y∞ (x) > Y } be the horoball about infinity of height Y ; one has B∞ (Y ) = T∞ (Y )N(F∞ )· x0 . Thus it follows from (4.6) that (4.9) X = ΓF hF [ i=1 γi−1 B∞ (Yi ). where for each i = 1, . . . , hF we put Yi = ci = cF |Ci |. 4.2. Cusps In this subsection we make the discussion of cusps in section 2.3 more explicit. 4.2.1. Cusp stabilizers Let ξ ∈ P1 (F ) = F ∪ {∞} and let Pξ its stabiliser in G∞ = SL2 (R)r1 × SL2 (C)r2 . Let Γξ = Γ ∩ Pξ ; if ξ = ∞ then we have    t z × (4.10) Γ∞ = . : t ∈ O , z ∈ O F F t−1 SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 30 JEAN RAIMBAULT For ξ = α β ∈ F let as before B be the ideal (β)/(α, β). Then an easy computation yields (4.11)   t−1 − zξ zξ 2 + (t − t−1 )ξ : t ∈ OF× , z ∈ B, zξ + (t − t−1 ) ∈ B . Γξ = −z t + zξ 4.2.2. Unipotent part Let Nξ be the unipotent radical of Pξ : in this subsection we study the shape of the flat tori Tξ = (Nξ ∩ Γ)\Nξ . The unipotent subgroup of Γ∞ is   0 1 1 + OF X where X = . It follows that T∞ is isometric to OF \F∞ . 0 0 From (4.11) we compute that the unipotent part of Γξ is :     −zξ zξ 2 2 (4.12) Λξ = 1 + : z∈B −z zξ and it follows that Tξ is isometric to (B2 \F∞ ). There is a crude estimate for the shape of the lattice in F∞ associated to an ideal of OF . Let A be an ideal and a ∈ A such that kak = α1 (A). Then A contains the finite-index lattice aOF which has the same α1 , and 1/2 it follows that τ (A) 6 τ (aOF ) = τ (OF ) = DF . So we get : (4.13) 1/2 τ (Tξ ) = τ (B2 ) 6 DF . We will also need (because of the term ℓ(u) in Proposition 2.7) an estimate of the displacement of elements in Λξ at a given height. It follows easily from the explicit description (4.12) and Minkowski’s first theorem implies that on the horosphere H = {yξ = 1}, we have α1 (Λξ \H) ≪ |B| with an absolute constant. 4.2.3. Levi component Here we describe the geometry of the flat tori Sξ (which may be called the “Levi components” of the cusps, since they come from the Levi components of the Pξ ). We will use the usual notation Log for the map OF× → Rr1 +r2 −1 defined by u 7→ (log |u|v )v∈V∞ , where we have fixed an isometry Rr1 +r2 −1 ∼ = P {(xv )v∈V∞ ∈ RV∞ : v xv = 0}, and RF for the regulator, i.e. the covolume of Log OF× . We will work at all places of F and hence need to describe things using F -algebraic groups. We fix ξ ∈ P1 (F ) and let Bξ be the stabiliser of ξ in SL2 /F , and Nξ its unipotent radical. Recall that for any finite place v of ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 31 F we have defined Kv = SL2 (Ov ). In the sequel we will make use of the Bruhat-Tits tree of SL2 (Fv ) which we will denote by Xv . Lemma 4.1. — There exists an F -split torus Tξ in Bξ such that for every finite place v, Tξ (Fv )∩Kv is a maximal compact subgroup in Tξ (Fv ). Démonstration. — Let xv be the fixed point of Kv in Xv . It suffices to show that there exists a ζ ∈ F such that for each v ∈ Vf the geodesic ]ξ, ζ[ determined by ξ, ζ in Xv goes through xv ; starting from any ζ0 ∈ F we can move it at each v by an nv ∈ N(Fv ) so that xv ∈]ξ, nv ζ0 [ ; strong approximation for N tells us that there is a n ∈ N(F ) such that nv N(Ov ) = nN(Ov ) for all v, and since N(Ov ) fixes xv it follows that ζ = nζ0 yields what we need.  We have an identification of Tξ (F ) ∩ Γξ with the group of units OF× , so that Sξ,ζ0 is isometric to Log (OF× )\Rr1 +r2 −1 . The following lemma gives a similar description for the other Sξ,ζ , where we denote by OF× (I) the congruence subgroup (1 + IOF ) ∩ OF× . Lemma 4.2. — Let ζ ∈ P1 (F ), ζ 6= ξ, let x′v ∈ Xv such that ]ζ, ξ[∩]ζ0 , ξ[= [x′v , ξ[, and mv = dXv (xv , x′v ) in case xv lies on [x′v , ξ[ and 0 otherwise. Put Q Iξ,ζ = v∈Vf Pmv ; then Sξ,ζ is isometric to Log (OF× (I))\Rr1 +r2 −1 . Démonstration. — We denote by Tξ,ζ the F-torus in SL  2 fixing ξ and Q ζ. Let Uv = Kv ∩ Tξ,ζ (Fv ) and Uζ = Tξ,ζ (F ) ∩ v∈Vf Uv . Let α be any nontrivial F -character of Tξ,ζ and let Mξ,ζ be the Q-subgroup ker(NF/Q ◦ α). Then Uζ ⊂ Mξ,ζ (F ) and we have M := Mξ,ζ (R) ∼ = Rr1 +r2 −1 × U(1)r2 . r2 We get that Sξ,ζ is isometric to Uζ \M/U(1) , so we need to describe Uζ . In case xv lies on [x′v , ξ[ we have that Uv is a maximal compact subgroup. Now suppose that mv > 0. We prove that for every v ∈ Vf we have that v Uv = Tξ,ζ (Fv ) ∩ Kv is a subgroup identified with 1 + Pm v Ov in a maximal × compact subgroup of Tξ,ζ (Fv ) identified with Ov . We have that Uv fixes x′v since this point is on [xv , ξ[ and Uv fixes both xv and ξ. Thus we see that Uv is the subgroup of the maximal compact subgroup StabTξ,ζ (Fv ) (x′v ) acting trivially on the ball of radius mv , which is exactly the right subgroup. By strong approximation for SL2 we can conclude that Uζ ⊂ Tξ,ζ (F ) is conjugated by an element of SL2 (F ) to       u 0 t 0 × × (4.14) : u ∈ OF (I) ⊂ . : t∈F 0 u−1 0 t−1 It follows from (4.14) that Sξ,ζ is isometric to (Log OF× (I))\Rr1 +r2 −1 . SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX  32 JEAN RAIMBAULT It follows from Lemma 4.2 that vol Sξ,ζ = RF · φ(I) (4.15) where φ(I) is the number of units of the ring OF /I, so that φ(I) 6 |I|. We also get that : inj Sξ,ζ ≫ log |I| (4.16) with a constant depending only on r. Indeed, the coefficients of the elements in Log OF× (I) in any basis of Log (OF× ) are > log |I|, and the minimal norm of an element of log OF× is bounded below by a constant depending only on r. Finally, we can also describe ℓ(ζ) in this setting : let ζ ∈ P1 (F ), ζ 6= ξ, then on the geodesic between them in X we have 1 (4.17) | log yξ − log yζ | 6 log |Iξ,ζ | + log DF . 2 To see this we argue as follows : let Tξ,ζ as above and choose γ0 ∈ SL2 (F ) sending (0, ∞) to (ζ, ξ). For each v ∈ Vf let x′v be the projection on the geodesic (ζ, ξ) in Xv of the point xv and x′′v = γ0 xv . We can choose for each v an element av ∈ Tξ,ζ (Fv ) such that av x′′v = x′v , and then (av )v∈Vf can be approximated, up to an element C of the idèle class-group, by  an element  0 −1 ′ a0 ∈ T(F ). Let γ1 = a0 γ0 , γ1 = γ1 w (where as usual w = ), so 1 0 that we have : (i) γ1 · ∞ = ξ and γ1′ · ∞ = ζ ; (ii) For all v ∈ Vf , dXv (xv , γ1−1 xv ) = dXv (xv , (γ1′ )−1 xv ) 6 logqv |Cv | + mv . The claim that (4.17) holds then follows from (i) and (ii) and the defi1/2 nition (4.7), as we have |C| 6 DF , | log α(bv )| 6 log dXv (xv , bv xv ) and Q v α(wbw−1 ) = α(b)−1 for all b ∈ B(Fv ) (and recall that Iξ,ζ = v Pm v ). By using (4.17) and the bound mentioned above on the displacement of unipotent elements on horospheres of height one we finally get the following upper bound on ℓ(ζ) : (4.18) ℓ(ζ) ≪ log DF + log |I| with an absolute constant. 4.3. Flats There is a well–known bijection between the ΓF -equivalence classes of quadratic forms over OF and the top-dimensional compact flats in MF ANNALES DE L’INSTITUT FOURIER 33 CONVERGENCE DES ORBI-VARIÉTÉS which we will now briefly describe ; for details we refer to [43, Section 4] and [19, Chapitre I.5] (which treat respectively the case of imaginary quadratic and totally real F , but similar arguments work in general). We will also relate the geometry of the flats to the invariants of the quadratic forms for later use. 4.3.1. Correspondance with quadratic forms The set of fundamental discriminants of F is defined as follows : DF = {d ∈ OF : d 6∈ OF2 , ∃x ∈ OF : d = x2 (mod 4)}; it is the set of discriminants d = b2 − 4ac of quadratic forms q = az12 + bz1 z2 + cz22 on F 2 when a, b, c ∈ OF have no common factor in OF (note that it may not be the case that the ideal (a, b, c) is the whole of OF ). To such a quadratic form q we can associate an abelian subgroup of ΓF as follows : Γq = SO(q) ∩ ΓF . We will now construct a flat subspace Z ⊂ X of maximal dimension, whose (setwise) stabilizer in ΓF is Γq which will act cocompactly. For v ∈ V∞ let σv be the corresponding embedding of F in C and define Zv to be : — If Fv ∼ = H3 between the isotropic lines in = C, the geodesic in Xv ∼ 1 P (Fv ) = ∂Xv of the quadratic form q σv ; — If Fv ∼ = R and dσv > 0, the geodesic between the isotropic lines in 1 P (Fv ) = ∂Xv of the quadratic form q σv ; — If Fv ∼ = R and dσv < 0, the point in Xv ⊂ P1 (Fv ⊗ C) corresponding to an isotropic line of q σv . Let r′ = |{v ∈ V∞ : Fv ∼ = R, dσ > 0}, m = r2 + r′ ; 1 1 note that m is the dimension of maximal flats in X. There is a unique flat Zq in X of dimension m which contains all Zv ; clearly the setwise stabiliser StabΓF Zq = Γq , and we will now explain (following [19, Theorem 5.6]) that Γq is of rank m, and thus acts cocompactly on Zq (since it acts properly discontinuously). Let A be the √ ideal generated by a, b, c in OF , let E be the quadratic extension F ( d) of F , and let Oq be the order : ) ( √ t+u d : t ∈ OF , u ∈ A−1 Oq = 2 SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 34 JEAN RAIMBAULT in OE . It is proven in [19] that the group Γq consists of the matrices : ( ) √  t+bu t + u d cu 2 (4.19) Γq = ∈ Oq , NE/F (ε) = 1 : ε= −au t−bu 2 2 where NE/F denotes the relative norm of the field extension E/F . A quick computation shows that E has exactly 2r1′ real places and 2r2 + r1 − r1′ × complex ones ; it follows that the rank of the abelian group OE ∩ker(NE/F ) equals r2 + r1′ = m. 4.3.2. Volume and systole Let us define the notation : ( {d ∈ DF : ∃σ, dσ > 0} + DF = DF if r2 = 0; otherwise. Thus the results of the previous paragraph mean that there is a bijection between maximal compact flats (of dimension > 0) in MF and ΓF equivalence classes of integral quadratic forms on F 2 whose discriminant belongs to DF+ . We will now describe the geometry of the flats in function of d. Recall that m is the logarithmic Mahler measure defined in 3.1. As the matrices on the right-hand side of (4.19) has eigenvalues equal to ε±1 it follows from (3.2) that the lengths of closed geodesics in Γq \Zq are, up to a bounded factor, equal to m(ε) for ε ∈ Oq× , NE/F (ε) = 1. As for the volume, it is proven in [19, Chapitre I.7] that the volume of Γq \Zq is equal to the covolume of Log (Oq× ∩ ker(NE/F )) in its R-span in RV∞ (E) ; it is easily seen that Log OF× is orthogonal in RV∞ (E) to ker(NE/F ), and it follows that vol(Γq \Zq ) = vol(Oq× ∩ ker(NE/F )) = × : Oq× ] [OE × [NE/F (OE ) : NE/F (Oq× )] vol ker(NE/F ) and since we have RF = vol OF× = 2− ′ r2 +r1 2 × −1 [OF× : NE/F (OE )] × vol OE vol ker(NE/F ) we finally get that (4.20) vol(Γq \Zq ) = 2− ANNALES DE L’INSTITUT FOURIER ′ r2 +r1 2 [O× : Oq× ] RE . × × E RF [OF : NE/F (Oq× )] CONVERGENCE DES ORBI-VARIÉTÉS 35 × Note that the term [OE : Oq× ] on the right-hand side is bounded above by a constant depending only on d, r : indeed, it is bounded by a constant depending only on p, NF/Q (d) at each place of F dividing p, and equal to 1 if v does not divide d. 4.4. Singular locus We will be very brief here ; since the eigenvalues of elliptic elements belong to quadratic extensions of F their order is bounded by a constant depending only on r. As for the volume of their fixed flat we have the following (see [43, equation (4.8)]). Lemma 4.3. — If d ∈ DF and |d|∞ > 4 then Γq is torsion-free for all q whose discriminant equals d. Démonstration. — If Γq contains torsion this means that there exists a ε ∈ Oq× , NE/F (ε) = 1 such that |ε|v = 1 for all v ∈ V∞ (E) ; writing √ √ ε = (t + u d)/2 with t2 − u2 d = 4 we get that |t ± u d|∞ = 1 and it follows that |t|2∞ + |u|2∞ |d|∞ = 4, hence |d|∞ 6 4.  5. Geometry of MF as DF → +∞ 5.1. Counting flats in a cusp neighbourhood In this section we establish upper bounds for the number of flats containing geodesic of length less than a given R ; in view of Proposition 2.2 they BS would be sufficient to prove than MF −−−−−−→ X. DF →+∞ 5.1.1. A criterion for going through an horoball For ξ = α β ∈ F recall that we have defined B as the ideal (β)/(α, β). We recall that we denote by Bξ (Y ) the horoball around ξ of height |B|−1 Y ; it follows from the description (4.8) of heights functions that it is equal to γξ−1 B∞ (Y ). Lemma 5.1. — Let ξ ∈ F , a, b, c ∈ OF , q = ax21 + bx1 x2 + cx22 and d = b2 − 4ac. Then the flat Zq goes through the horoball Bξ (Y ) is and only if 1/2 |d|∞ > 2r1 +r2 Y. 2 |aξ + bξ + c|∞ SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 36 JEAN RAIMBAULT If ξ = ∞ this condition degenerates to 1/2 |d|∞ > 2r1 +r2 Y. |a|∞ Démonstration. — It is simpler to prove this at infinity and then pass to a given ξ than to√try to do all√computations for ξ ; thus we will do so. Let z± = (−b ± d)/2a ∈ F ( d) be the roots of az 2 + bz + c. If v is a complex place or a real place such that dσv > 0 then the highest point in Zv with respect to ∞ is the point on the geodesic line between z± which is directly height of this point equals p above (z+ + z− )/2, and the |z+ − z− |v /2 = p |d|v /2|a|v . If v is real and dσv < 0 then Zv is a point of height Im(z+ ) = |d|v /2|a|v . Thus the maximal height of a point on Zq 1/2 equals |d|∞ /2r1 +r2 |a|∞ , and this proves the lemma for ξ = ∞. Now let ξ ∈ F , and recall that we have defined   0 1 γξ = . −1 ξ Let c be the flat of X corresponding to the quadratic form q = ax21 + bx1 x2 + cx22 . Then the image of c under γξ corresponds to the quadratic form γξ · q := q ◦ γξ−1 and we can compute that : γξ · q = a(ξx1 − x2 )2 + b(ξx1 − x2 )x1 + cx21 = (aξ 2 + bξ + c)x21 − (b + 2aξ)x1 x2 + ax22 . Thus the lemma follows from the computation we did just above.  5.1.2. We will need the following classical counting result : if Λ is a lattice in Rr then we have ρr + τ (Λ) (5.1) |{v ∈ Λ : |v| 6 ρ}| ≪ vol Λ where the constant depends only on r. This follows rather immediately from Minkowski’s second theorem and the fact that one can find a basis of Λ whose vectors realize its successive minima (see [38, Lemma 2.2] for a detailed proof in the two-dimensional case). Let Nξ,d (Y ) be the number of closed flats which intersect Bξ (Y ) and correspond to forms of discriminant d. We will now prove : ANNALES DE L’INSTITUT FOURIER 37 CONVERGENCE DES ORBI-VARIÉTÉS Lemma 5.2. — For any ε > 0 we have −1 Nξ,d (Y ) ≪ Y −r−ε |B|2+ε DF 2 with a constant depending only on d, ε. Démonstration. — Let Se ⊂ OF3 be the set of triples (a, b, c), b2 − 4ac = d corresponding to closed geodesics meeting B, and let Φξ be the self-map of F 3 defined by Φξ (a, b, c) = (aξ 2 + bξ + c, 2aξ + b, a); in other words Φξ corresponds to the map q 7→ γξ ·q in the space of quadratic forms. Thus it preserves the quadratic form b2 − 4ac, and it follows from Lemma 5.1 above that e ⊂ Φξ (S) ( 1/2 −2 (a, b, c) ∈ B −1 ×B 2 × OF : b − 4ac = d, a 6 2 r1 +r2 |d|∞ Y ) . Since Φξ intertwines the actions of Λξ and γξ Λξ γξ−1 (which we identify with B2 according to (4.12)) and the latter is given by  B2 × B−2 × B−1 × OF ∋ (u, (a, b, c)) 7→ (a, b + 2ua, c + ub + u2 a) we get that the quotient S of Se by Γξ is identified through Φξ with a subset of ′ S = ( −2 (a, b) ∈ B −1 ×B : |a| 6 2 r1 +r2 ) 1/2 |d|∞ 2 , ∃c ∈ OD : b − 4ac = d /B2 Y where the action of B2 is given by u · (a, b) = (a, b + 2ua). Now we fix an ε > 0 ; it is easily seen that for a given d ∈ OF the number of solutions to the congruence b2 = d (mod 2a) has ≪ |a|ε solutions in B−1 modulo 2aB2 , where the constant is absolute : indeed, at each finite place there are at most two solutions, so the total number is bounded by 2l (where l is the number of prime divisors of B) which is ≪ |B|ε for all ε > 0. So we get that for a given a ∈ B−2 there are ≪ |B−1 /aB|ε possible choices for SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 38 JEAN RAIMBAULT b ∈ B−1 (mod 2aB) such that (a, b) ∈ S ′ . It follows that X  |S ′ | = | b ∈ B−1 /2aB2 : b2 = d (mod 2aB2 ) | ≪ −2 a∈B√ |a|∞ 6 d/Y X 64 ε −2 a∈B√ |a|∞ 6 d/Y ε 2 ε |aB| 6 |B| (d/Y ) 2 ε ≪ |B| (d/Y ) ε ( −2 a∈B : |a|∞ X [B−1 : 2aB2 ]ε −2 a∈B√ |a|∞ 6 d/Y √ ) d 6 Y ! r/2 |d|∞ + τ (B) . Y r vol(B−2 ) (using (5.1) for Λ = B at the third line) for any ideal I in OF the volume of its inverse I−1 is equal to |I|−1 vol OF so the right-hand side is bounded above by 1 1 Y −r−2ε |B|2+2ε D− 2 + Y −2ε |B|2ε D 2 which finishes the proof of the lemma.  5.2. Estimating the volume of the thin part of MF Let C1 , . . . , ChF associated to ξj are the integral representatives of lowest norm for the ideal classes of F and ξj = αj /βj , j = 1, . . . , hF such that Cj = (βj )/(αj , βj ). Let γj = Γξj ; by (4.9) we know that the projections −1/2 to MF of the horoballs γj B∞ (Yj ) cover it entirely when Yj = c0 |Cj |DF for a constant c0 depending only on r. For a field F let DR,F be the set of fundamental discriminants for F which yield units in the set TR in the P proof of Lemma 3.1. We put Nξ (Y ) = d∈DR,F Nξ,d (Y ) ; it follows from Lemma 5.2 that for all ε > 0 we have :   hF X X RF (√d) Nξj (Yj ) max Cd · vol T 6 d∈DR,F RF j=1 T,α1 (T )6R !−r−ε   hF RF (√d) X |Cj | −1/2 ≪ max Cd · · |Cj |2+ε · DF 1/2 d∈DR,F RF D j=1 F   hF X r−1 RF (√d) +ε |Cj |−r+2+ε ≪ max Cd · DF 2 d∈DR,F RF j=1 × Here Cd is a constant independant of F , since the term [OE : Oq× ] on the right-hand side of (4.20) is bounded independantly of F . In particular, ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 39 when r = 2 (which is the case of interest for later) we get using the estimate 1/2 hF ≪ DF log D that :   X RF (√d) vol T ≪ DF1+ε max Cd · (5.2) . d∈DR,F RF T,α1 (T )6R For cubic fields we record independently the following estimates for the number of compact flats. Lemma 5.3. — For all R, ε > 0 there exists Cr,ε > 0 such that for 5/4+2ε , where NR (M ) is the all cubic fields F we have NR (MF ) 6 CR,ε DF number of maximal compact flats in M whose systole is less than R. Démonstration. — From Lemma 5.2 and (4.9) we get the estimate : NR (MF ) ≪ε,R DF1+ε hF X j=1 |Cj |−1/2+ε . The number of ideals Cj of norm 6 DFa is less than Cε DFa+ε for some absolute Cε > 0 (this follows from elementary arguments, see for example the proof of Theorem 3.5 in [28]) and we get that for any a > 0 we have : NR (MF ) ≪ε,R DF1+2ε−a |hF | + DF1+2ε DFa+ε . Taking a = 1/4 we get the estimate in the lemma.  Now we deal with the cusps : for a given ξ, the S[u] which contribute to the R-thin part are those with log |I| 6 CR according to (4.16) (where C depends only on r). Thus there is a uniform bound on their number, the volume of each of the associated compact flats is bounded above by RF , and we have ℓ(u) ≪ log DF by (4.18). In particular, since hF RF ≪ 1 DF2 (log DF )r−1 we get that X 1/2 (5.3) vol ℓ(u)S[u] ≪ CR hF log(DF )RF ≪ DF (log DF )r . ξ,u On the other hand, by (4.13) and the description of the Levi component of cusps we have that the contribution of the unipotent elements is bounded by X 1/2 (5.4) RF τ (Λξ ) ≪ hF RF DF ≪ DF (log DF )r−1 ξ Finally, the description of the compact singular locus yields that there exists a R0 such that for r = 2 we have   e X X RF (√d) . vol T ≪ DF1+ε max Cd · vol Mn [γj ] ≪ (5.5) d∈DR0 RF j=1 T,α1 (T )6R0 SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 40 JEAN RAIMBAULT 5.3. Bianchi orbifolds √ We are interested here in the sequence MD = MF , F = Q( −m), D = DF as the square-free, positive integer m tends to infinity. In this case we have that OF× is trivial as soon as D > 6. The proof of Lemma 3.1 yields that for any R, for D large enough the only discriminants d ∈ DF which yield closed geodesics of length less than R in MD are among a finite set d1 , . . . , dk ∈ Z, and for each d among these the unit group OF×(√d) is equal ×√ . It follows that maxd∈DR Cd RF (√d ) is bounded independantly of to OQ( d) F and thus (5.2) yields that for all ε > 0 we have vol(MD )6R ≪ D1+ε (there is no Levi part in the cusps, and the contribution of unipotents is ≪ D log D by (5.4)). This finishes the proof of Theorem C. 5.4. Hilbert–Blumenthal surfaces √ Here we consider the sequence of fields F = Q( D) for square–free D > 0, as above we denote MF = MD . This case is more subtle, as we × have that OF× is of rank one, and OE is of rank three for any totally real extension of F , and we will have to use some elementary manipulations to circumvent this problem. In the sequel we arbitrarily choose an embedding F → R for all real fields we encounter and denote by | · | the absolute value we get this way. Recall that for any number field L of degree r we have the bound (5.6) 1/2 RL ≪ DL (log DL )r−1 . √ + Now let D, d ∈ DQ be two square-free positive integers, F = Q( D), F ′ = √ √ √ Q( dD) and E = F ( d) = F ′ ( d). Let ε, ε′ and √ εd be fundamental ′ units (such that |ε|, |ε√′ | > 1) for the fields F, F and Q( d) respectively, so √ that we have RF = 2 log |ε| and RF ′ = 2 log |ε′ |. We number the real embeddings √ : σ1 is√the identity, and √ of E√as follows — σ2 (√d) = √ d, σ2 ( √ D) = −√D ; D; — σ3 (√d) = −√d, σ2 (√D) = √ — σ4 ( d) = − d, σ2 ( D) = − D. Then we have εσi = ε for i = 1, 3 and ε−1 for i = 2, 4, (ε′ )σi = ε′ for i = 1, 2 and (ε′ )−1 for i = 3, 4 and finally εσd i = εd for i = 1, 4 and ε−1 d for i = 2, 3. It follows that the images of ε, ε′ and εd by Log are pairwise ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 41 × orthogonal and thus they generate a sublattice of finite index in Log OE . This implies that (5.7) RE 6 C(d)RF RF ′ √ where C(d) ≪ d1/2 by (5.6) for L = Q( d). Now there are two possibilities : 1/5 1/5 (i) both RF 6 DF and RF ′ 6 DF ′ ; 1/5 (ii) RF ′ > DF ′ . If we are in case (i) then we get from (5.7) that 1/5 RE /RF ≪d DF . (5.8) + On the other hand, if we are in case (ii) we get in that for all d′ ∈ DQ , √ ′ ′ ′ E = F ( d ) we have 1/2 1/2 RE ′ ≪ DE ′ (log DE ′ )3 ≪ DF ′ (log DF ′ )3 so that we finally obtain (5.9) 3/10 2/5 RE ′ /RF ′ ≪ DF ′ (log DF ′ )3 ≪ DF ′ with a constant depending only on d. Now we will define a sequence Fn as follows : let Rn = n ; by Lemma + + 3.1 there is a D(n) ∈ DQ such that for all D ∈ DQ , D > D(n) the only d ∈ DQ(√D) contibuting geodesics of length less than Rn belong to a finite . Now define : set DRn ⊂ Z>0p — Fn = Q(pD(n)) if we are in situation (i) for all d ∈ DRn ; — Fn = Q( dD(n)) if we are in situation (ii) for some d ∈ DRn . Thus in any case we obtain by (5.8) or by (5.9) that for all d ∈ DRn , √ 2/5 En = Fn ( d) we have REn /RFn ≪ DFn and in the proof of (5.2) we get (5.10) (vol MFn )6Rn ≪ C(Rn )(vol MFn )1−1/10 where C(Rn ) = maxd∈DRn C(d) : by increasing D(n) we may suppose that C(Rn ) ≪ D(n)ε for all ε > 0, so that Theorem D follows from (5.10). 6. Convergence of congruence and maximal lattices 6.1. Description of maximal lattices 6.1.1. Unit groups of quaternion algebras We recall for the reader’s convenience, and for fixing notation, the description of the maximal lattices in an arithmetic commensurability class SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 42 JEAN RAIMBAULT in G∞ = SL2 (C). For details we refer to the book [30]. Such classes are in correspondance with certain quaternion algebras. We restrict in what follows to lattices defined over quadratic or cubic fields, hence we will only need to consider quaternion algebras defined over quadratic or cubic fields. Moreover, in the cubic case we need only consider fields which have only one real place and algebras which ramify at that place. Fix a field F and a quaternion algebra A/F satisfying to the requirements above ; then the classification of quaternion algebras implies that there exists a set S of places of F not containing its complex place, containing the real place if F is cubic, and of even cardinality, such that A is isomorphic over F to the unique quaternion algebra whose ramification locus is exactly S. Suppose we are in this setting ; we let G = SL1 (A) be the F -algebraic group defined by the units of norm 1 in A, and at each place v 6∈ S (including the complex place) we fix an isomorphism Iv : G(Fv ) ∼ = SL2 (Fv ) and we put (i)    a b −1 −1 ∈ SL2 (Ov ) : |c|v < 1 . Kv = Iv SL2 (Ov ), K0,v = Iv c d For each finite set of places T ⊂ Vf − S we define a compact-open subgroup of G(Af ) as follows : Y Y Y KS (T ) = G(Fv ) × K0,v × Kv . v∈S∩Vf v∈T v∈Vf −S∪T We finally define : ΓS (T ) = G(F ) ∩ KS (T ). Then all maximal arithmetic subgroups of G(F ) are locally conjugated to a ΓS (∅) for some collection of isomorphisms Iv as above. The conjugation is in general not global (see [30, Chapter 6.7]) but for our purposes (counting closed geodesics) all lattices obtained this way are equivalent (see Lemma 6.4 below) and we will not introduce further notation to distinguish between them. We recall that the lattice ΓS (T ) is nonuniform if and only if S = ∅. Finally, we remark that the usual definition of the lattices ΓS (T ) uses maximal orders and Eichler orders rather than the isomorphisms Iv : this is in particular the case in [30]. It is however trivial to pass from one to the other : the maximal order corresponding to (Iv ) is the one which is normalized by Kv at each v. i. This is equivalent to choosing a vertex of the Bruhat–Tits tree Xv and an adjacent edge in Xv , and taking Kv , K0,v to be the stabilizers in the action of G(Fv ) on Xv of this vertex and edge respectively (see for example [44, II.1.3]). ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 43 6.1.2. Maximal lattices The lattices ΓS (∅) are usually not maximal in SL2 (C), and not every maximal lattice in their commensurability class contains them. However any maximal lattice in SL2 (C) is obtained as the normalizer of some ΓS (T ). We will denote this normalizer by ΓS (T ) = NSL2 (C) ΓS (T ). We have a very good control over the index of ΓS (T ) in ΓS (T ) : Lemma 6.1. — We have for all F, S, T the equality (2) [ΓS (T ) : ΓS (T )] 6 22+|T |+|S| hF (6.1) (2) where hF is the order of the 2-torsion subgroup of the class group of F . Démonstration. — By [30, Theorem 11.5.1] we have Y [ΓS (∅) : ΓS (T )] = 2−m (|P| + 1) [ΓS (T ) : ΓS (T )] P∈T for some 0 6 m 6 |T |. It follows that [ΓS (∅) : ΓS (T )] [ΓS (T ) : ΓS (T )] 6 2|T | Q = 2|T | [ΓS (∅) : ΓS (∅)] P∈T (|P| + 1) Q since [ΓS (∅) : ΓS (T )] = P∈T (|P| + 1). The result then follows from [30, Corollary 11.6.4, Theorem 11.6.5]. More precisely, there is a subgroup Γ between ΓS (∅) and ΓS (∅) such that [Γ : ΓS (∅)] 6 2|S|+2 [30, Corollary 11.6.4] and ΓS (∅)/Γ embeds in the 2-torsion subgroup of the class-group of F [30, Theorem 11.6.5].  6.1.3. Fixed points The following result is similar to [3, Theorem 1.11] (but much, much simpler to prove). For any finite place v of a number field we denote by Pv the prime ideal {a ∈ OF , v(a) < 1} and by qv the cardinality of the residue field fv = OF /Pv . Lemma 6.2. — There is a δ > 0 such that the for any R > 0, any imaginary quadratic field F , any finite set S ⊂ Vf and any loxodromic γ ∈ Γ = ΓS (∅) whose minimal displacement is 6 R and any T ⊂ Vf − S we have FixΓ/ΓS (T ) 6 C2|T | with a constant C depending only on R. SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 44 JEAN RAIMBAULT Démonstration. — We will use the notation Kv (m) for v ∈ Vf , m ∈ N to denote the subgroup of matrices in Kv congruent to the identity modulo m Pm v Ov . First we oserve that if qv > 2 cosh(R/2) + 2 and γ is as in the statement then we must have γ 6∈ Kv (m). To see this, just note that if γ ∈ Kv (m) is not unipotent then we have | tr(γ) − 2| > qvm ; in particular we get that qvm 6 2 cosh(R/2) + 2, which proves the claim. Q Now we put C = v:qv 62 cosh(R/2)+2 (qv + 1). For any T ⊂ Vf − S we let T0 = {v ∈ T, qv 6 2 cosh(R/2)+ 2} and T1 = T − T0 . Let v ∈ T1 ; the action of Γ on Kv /K0,v is equivalent to the action on P1 (fv ) via Γ → PSL2 (fv ). So since γ does not belong to the kernel ±Kv (1) of the latter action it acts non-trivially. Any non-trivial element of PSL2 (fv ) has at most two fixed directions, so we get that γ has at most two fixed points on Kv /K0,v . It follows that : Y |FixΓ/ΓS (T ) (γ)| = |FixKv /ΓS (T ) (γ)| v∈Vf −S = Y v∈T |FixKv /K0,v (γ)| 6 2|T1 | 6 C2|T | . Y v∈T0 |Kv /K0,v |  6.2. Length spectra 6.2.1. A complicated formula In the adelic proof of the Jacquet–Langlands correspondance one does not care about the length spectra since all congruence subgroups are considered at once. However, when one wants results linking the spectrum of explicit orbifolds it is necessary to be more precise about that. This is developed for Riemann surfaces in [12], the French-reading reader is also refered to Chapter 8 of the book [7] ; here we “generalize” their results to imaginary quadratic number fields using the following result which we quote (j) from M.F. Vignéras’ book [46, Corollaire 5.17]. We use the standard notation (same as in loc. cit.) : for an order B in aquadratic extension E/F , and a finite place v of F the Eichler symbol Bv is given by : — 1 if Bv := BOv is not a maximal order in Ev or if v splits in E ; j. The quotation is not verbatim : her statement is in the language of orders, she considers also S-arithmetic groups and there are additional conditions in her statement which trivialize in our case. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 45 — −1 if Bv is maximal, and v is inert in E ; — 0 if Bv is maximal, and v ramifies in E. We also define an ad hoc Eichler symbol at infinity by : ( 1 if F is quadratic or E = F (λ) has no real place or A splits at the real p ε∞ (λ; A) = 0 otherwise. for λ ∈ Z of degree 2 over F . Let also h(B) denote the class-number of B ; the result is then : Theorem 6.3. — Let F be a quadratic or cubic field ; A a quaternion algebra over F . Let E = F (λ) be a quadratic extension, where λ ∈ OE . Then the number of ΓS (T )-conjugacy classes among the elements in ΓS (T ) which have λ as an eigenvalue is given by :     Y  X h(B) Y  B B · 1+ · 1− ε∞ (λ; A) · hE v v B∋λ v∈S w∈T where the sum runs over all orders of L which contain λ. 6.2.2. Comparison of length spectra First we have the obvious corollary of Theorem 6.3 above : Lemma 6.4. — The length spectrum of a group ΓS (∅) does not depend on the collection Iv (equivalently on the maximal order in AS ) chosen to define it. The precise form of the formula in 6.3 can be used to compare between the cases where S = ∅ or not ; the following lemma has a proof which follows exactly that of [12, Lemma 3.4] (see also [7, Lemme 8.23]), as the arguments used there are purely combinatorial. Lemma 6.5. — Let F be a quadratic field, and for ℓ > 0 let µ(S, T ; ℓ) be the number of closed geodesics of length ℓ in ΓS (T )\H3 . X ′ µ(S, T ; ℓ) = (−2)|S | µ(∅, S ′ ∪ T ; ℓ). S ′ ⊂S If F is a cubic field we want to compare the length spectra of compact maximal congruence orbifolds defined over F with that of the 5-dimensional orbifolds Γ∅ (T )\(H3 × H2 ) where Γ∅ = SL2 (OF ). Let µ1 (∅, T ′ ; ℓ) is the number of 1-dimensional maximal compact flats of length ℓ in Γ∅ (T ′ )\(H3 × H2 ) (corresponding to elements which are elliptic at the real place). SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 46 JEAN RAIMBAULT Lemma 6.6. — Let F be a cubic field with one real place, then we have : X ′ µ(S, T ; ℓ) = (−2)|S | µ1 (∅, S ′ ∪ T ; ℓ) S ′ ⊂S where 6.3. Proof of Theorem A Theorem A follows from Proposition 2.7 with input from Proposition 6.7 (taking into account the fact that in rank 1, vol(T ) 6 R for a R-thin flat) and 6.3.4 in the compact case, and from the same plus (6.7) in the noncompact case. 6.3.1. Covolume of maximal lattices We begin by a remark about the covolumes of maximal lattices. For a field F and S, T ⊂ Vf , S ∩ T = ∅ we denote by MS (T ) the hyperbolic three-orbifold ΓS (T )\H3 . The volume of MS (T ) is given by the formula : Q 3 Y P∈T (|P| + 1) 2 (|P| − 1) (6.2) vol MS (T ) ≍ DF [ΓS (T ) : ΓS (T )] P ∈S with constants depending only on the degree of F (this follows from [30, (11.3) on page 333] and the formula for the index of ΓS (T ) in ΓS (∅)). In case F is quadratic, the 2-torsion subgroup of the class group is generated by the prime divisors of DF (see [23, Corollary 1 to Theorem 39]) (2) and in particular hF is less than the number of rational prime factors of DF so we have by comparing with (6.2) : (6.3) (2) [ΓS (T ) : ΓS (T )] 6 2|S|+|T |+2hF ≪ (vol MS (T ))ε for all F, S, T and all ε > 0, where the constant depends only on ε. In the (2) case where F is cubic and we have hF ≪ DF0.24 we get (6.4) (2) [ΓS (T ) : ΓS (T )] 6 2|T |+|S|+1 hF ≪ (vol MS (T ))1/6−δ0 for some δ0 > 0. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 47 6.3.2. Closed geodesics Recall that for an hyperbolic three–orbifold we denote by NR (M ) the number of closed geodesics of length 6 R in M . Proposition 6.7. — There is a δ > 0 such that for any R > 0 there is a CR such that for all cubic or quadratic fields F and all S, T we have NR (MS (T )) 6 CR (vol MS (T ))1−δ . Démonstration. — Let MS′ (T ) = ΓS (T )\H3 ; we will deduce below that for all R > 0 we have ′ (vol MS′ (T ))5/6+ε NR (MS′ (T )) 6 CR (6.5) for any ε > 0. The proposition then follows easily from this and Lemma 6.1, by the following argument : a theorem of Takeuchi [30, Corollary 8.3.3] states that for every γ ∈ ΓS (T ) we have γ 2 ∈ ΓS (T ), and it follows that NR (MS (T )) 6 N2R (MS′ (T )). It follows from (6.5) and Lemma 6.1 that (2) ′ NR (MS (T )) 6 C2R · 2|T | hF · (vol MS (T ))5/6+ε) (2) and since 2|T | hF ≪ (vol MS (T ))1/6−δ0 by (6.3) (in this case we actually get a much better bound) or (6.4) we can conclude that NR (MS (T )) ≪ vol(MS (T ))1−δ with δ = δ0 − ε, which can be made positive by taking ε small enough. The proof of (6.5) will follow from Theorem C by using Jacquet–Langlands and Lemma 6.2 with arguments similar to those used in [3],[39] ; we will repeat them here for the reader’s convenience. Fix F, S and let γ1 , . . . , γr be representatives of the hyperbolic conjugacy classes in Γ = ΓS (∅) corresponding to geodesics of length less than R in MS (∅) : we include in this count the conjugacy classes which are nonprimitive. For T ⊂ Vf − S and i = 1, . . . , r let ni (T ) be the number of ΓS (T )-conjugacy classes (in ΓS (T )) which are Γ-conjugated to γi ; then we have r X ′ ni (T ). NR (MS (T )) = i=1 Now ni (T ) is equal to the number of fixed points of γi in Γ/ΓS (T ) : indeed, for any subgroup Γ′ ⊂ Γ we see that g ∈ Γ conjugates γi into Γ′ if and only if γi fixes gΓ′ ∈ Γ/Γ′ . Thus it follows from Lemma 6.2 that (6.6) NR (MS′ (T )) 6 C2|T | NR (MS′ (∅)) ≪R,ε (vol MS′ (∅))ε NR (MS′ (∅)) SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 48 JEAN RAIMBAULT since 2|T | ≪ (vol MS′ (∅))ε for all ε > 0. We now see that (6.5) can be deduced as follows : — For F quadratic and S = T = ∅ it follows from Theorem C (the case of Bianchi groups) and Lemma 6.4 for the other maximal congruence lattices in the commensurability class ; — For F quadratic and S = ∅ it follows from the previous case and (6.6) ; — When F is quadratic, S 6= ∅ we deduce (6.5) from the previous cases and Lemma 6.5 : we have X ′ NR (MS′ (T )) 6 2|S−S | NR (M∅′ (S ′ ∪ T )) S ′ ⊂S 6 2|S| · |2S | · 2|S| NR (M∅′ (T )) = 8|S| NR (M∅′ (T )) and 8|S| ≪ (vol MS′ (T ))ε for all ε > 0. — When F is cubic the same sequence of arguments applies (for S = 6 5/4 ∅) by using Lemma 5.3 instead of Theorem C (note that DF ≍ (vol MF )5/6 ) and Lemma 6.6 instead of 6.5. This completes the proof of the proposition.  Note that Propositions 6.7 and 2.2 suffice to imply the mere statement of BS-convergence in Theorem A. 6.3.3. Unipotent elements 1/2 Since we have τ (I) 6 τ (OF ) 6 DF for all F and ideals I of OF , we 1/2 have τ (Λ′ ) 6 DF for any cuspidal subgroup Λ′ of any Γ∅ (T ) (see (4.12)). Now if Λ is a cuspidal subgroup of Γ∅ (T ) and Λ′ the corresponding cuspidal subgroup of Γ∅ (T ) we have 2Λ ⊂ Λ′ and it follows that τ (Λ) 6 2τ (Λ′ ). On the other hand the number of cusps of MT′ is less than 2|T | hF and it follows that the volume of the contribution of unipotent elements to the R-thin part of M∅ (T ) is bounded above by (6.7) 1/2 CR · 2|T | hF · 2DF ≪ DF1+ε . 6.3.4. Singular locus We give here an estimate on the length of the singular locus of MS (T ) ; we will be quite sketchy about this. First, the proof of Lemma 4.3 applies in general and we thus have that there is a finite set Ds ⊂ Z of discriminants ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 49 such that the singular geodesics in an arithmetic manifold in a commensurability class defined by an algebraic group over an√imaginary quadratic field F are associated to the quadratic extensions F ( d), d ∈ Ds . Now, the singular locus of the MS′ (T ) can be dealt with using Lemma 6.2 : we leave the details to the reader, one obtains that its length is 6 ′ (vol MS′ (T ))1−δ with the same δ ′ as for the number of geodesics. It remains to bound the length of those geodesics which are singular for the elements of order 2 in ΓS (T ) not in ΓS (T ). The key point here is that those geodesics correspond to tori whose reduction modulo the primes in T belong to the reduction of K0,v : this can be seen by a local argument at each v ∈ T ; it follows that the length of the corresponding geodesics in MS′ (T ) is equal to the length of their projections in MS′ (∅), thus bounded, and the result follows from Proposition 6.7. BIBLIOGRAPHY [1] M. Abért, N. Bergeron & B. Virág, “Convergence of weakly ramanujan locally symmetric spaces”, In preparation. [2] M. Abért, Y. Glasner & B. Virág, “Kesten’s theorem for invariant random subgroups”, Duke Math. J. 163 (2014), no. 3, p. 465-488. [3] M. Abrt, N. Bergeron, I. Biringer, T. Gelander, N. Nikolov, J. Raimbault & I. Samet, “On the growth of L2 -invariants for sequences of lattices in Lie groups”, Annals of Math. (2017). [4] I. Agol, “The virtual Haken conjecture”, Doc. Math. 18 (2013), p. 1045-1087, With an appendix by Agol, Daniel Groves, and Jason Manning. [5] D. Bachman, D. Cooper & M. E. White, “Large embedded balls and Heegaard genus in negative curvature”, Algebr. Geom. Topol. 4 (2004), p. 31-47 (electronic). [6] I. Benjamini & O. Schramm, “Recurrence of distributional limits of finite planar graphs”, Electron. J. Probab. 6 (2001), p. no. 23, 13 pp. (electronic). [7] N. Bergeron, Le spectre des surfaces hyperboliques, Savoirs Actuels (Les Ulis). [Current Scholarship (Les Ulis)], EDP Sciences, Les Ulis, 2011, x+338 pages. [8] M. Bhargava, A. Shankar, T. Taniguchi, F. Thorne, J. Tsimerman & Y. Zhao, “Bounds on 2-torsion in class groups of number fields and integral points on elliptic curves”, ArXiv e-prints (2017). [9] M. Bhargava, “The density of discriminants of quartic rings and fields”, Ann. of Math. (2) 162 (2005), no. 2, p. 1031-1063. [10] L. Bianchi, “Sui gruppi di sostituzioni lineari con coefficienti appartenenti a corpi quadratici immaginarı̂”, Math. Ann. 40 (1892), no. 3, p. 332-412. [11] I. Biringer & J. Souto, “A finiteness theorem for hyperbolic 3-manifolds”, J. Lond. Math. Soc. (2) 84 (2011), no. 1, p. 227-242. [12] J. Bolte & S. Johansson, “A spectral correspondence for Maaß waveforms”, Geom. Funct. Anal. 9 (1999), no. 6, p. 1128-1155. [13] A. Borel, “Commensurability classes and volumes of hyperbolic 3-manifolds”, Ann. Scuola Norm. Sup. Pisa Cl. Sci. (4) 8 (1981), no. 1, p. 1-33. [14] A. Borel & G. Prasad, “Finiteness theorems for discrete subgroups of bounded covolume in semi-simple groups”, Inst. Hautes Études Sci. Publ. Math. (1989), no. 69, p. 119-171. SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX 50 JEAN RAIMBAULT [15] M. R. Bridson & A. Haefliger, Metric spaces of non-positive curvature, Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences], vol. 319, Springer-Verlag, Berlin, 1999, xxii+643 pages. [16] D. Bump, Automorphic forms and representations, Cambridge Studies in Advanced Mathematics, vol. 55, Cambridge University Press, Cambridge, 1997, xiv+574 pages. [17] L. Clozel, “Démonstration de la conjecture τ ”, Invent. Math. 151 (2003), no. 2, p. 297-328. [18] M. Deraux, J. R. Parker & J. Paupert, “New non-arithmetic complex hyperbolic lattices”, Invent. Math. 203 (2016), no. 3, p. 681-771. [19] I. Y. Efrat, “The Selberg trace formula for PSL2 (R)n ”, Mem. Amer. Math. Soc. 65 (1987), no. 359, p. iv+111. [20] M. Einsiedler, E. Lindenstrauss, P. Michel & A. Venkatesh, “Distribution of periodic torus orbits and Duke’s theorem for cubic fields”, Ann. of Math. (2) 173 (2011), no. 2, p. 815-885. [21] N. D. Elkies, “Fundamental units of imaginary quartic fields”, MathOverflow, http://mathoverflow.net/q/137480. [22] J. S. Ellenberg & A. Venkatesh, “Reflection principles and bounds for class group torsion”, Int. Math. Res. Not. IMRN (2007), no. 1, p. Art. ID rnm002, 18. [23] A. Fröhlich & M. J. Taylor, Algebraic number theory, Cambridge Studies in Advanced Mathematics, vol. 27, Cambridge University Press, Cambridge, 1993, xiv+355 pages. [24] M. Gendulphe, “Systole et rayon interne des variétés hyperboliques non compactes”, Geom. Topol. 19 (2015), no. 4, p. 2039-2080. [25] R. Godement, “Domaines fondamentaux des groupes arithmétiques”, in Séminaire Bourbaki, 1962/63. Fasc. 3, No. 257, Secrétariat mathématique, Paris, 1964, p. 25. [26] M. Gromov & I. Piatetski-Shapiro, “Nonarithmetic groups in Lobachevsky spaces”, Inst. Hautes Études Sci. Publ. Math. (1988), no. 66, p. 93-103. [27] M. Gromov & L. Guth, “Generalizations of the Kolmogorov-Barzdin embedding estimates”, Duke Math. J. 161 (2012), no. 13, p. 2549-2603. [28] H. W. Lenstra, Jr., “Algorithms in algebraic number theory”, Bull. Amer. Math. Soc. (N.S.) 26 (1992), no. 2, p. 211-244. [29] A. Lubotzky & D. Segal, Subgroup growth, Progress in Mathematics, vol. 212, Birkhäuser Verlag, Basel, 2003, xxii+453 pages. [30] C. Maclachlan & A. W. Reid, The arithmetic of hyperbolic 3-manifolds, Graduate Texts in Mathematics, vol. 219, Springer-Verlag, New York, 2003, xiv+463 pages. [31] W. Müller & J. Pfaff, “The analytic torsion and its asymptotic behaviour for sequences of hyperbolic manifolds of finite volume”, J. Funct. Anal. 267 (2014), no. 8, p. 2731-2786. [32] S. Ohno & T. Watanabe, “Estimates of Hermite constants for algebraic number fields”, Comment. Math. Univ. St. Paul. 50 (2001), no. 1, p. 53-63. [33] J.-P. Otal, “Le théorème d’hyperbolisation pour les variétés fibrées de dimension 3”, Astérisque (1996), no. 235, p. x+159. [34] P. Petersen, Riemannian geometry, second ed., Graduate Texts in Mathematics, vol. 171, Springer, New York, 2006, xvi+401 pages. [35] M. S. Raghunathan, Discrete subgroups of Lie groups, Springer-Verlag, New YorkHeidelberg, 1972, Ergebnisse der Mathematik und ihrer Grenzgebiete, Band 68, ix+227 pages. [36] A. D. Rahm, “Higher torsion in the Abelianization of the full Bianchi groups”, LMS J. Comput. Math. 16 (2013), p. 344-365. ANNALES DE L’INSTITUT FOURIER CONVERGENCE DES ORBI-VARIÉTÉS 51 [37] A. D. Rahm & M. H. Şengün, “On level one cuspidal Bianchi modular forms”, LMS J. Comput. Math. 16 (2013), p. 187-199. [38] J. Raimbault, “Asymptotics of analytic torsion for hyperbolic three–manifolds”, ArXiv e-prints (2012). [39] ——— , “Analytic, Reidemeister and homological torsion for congruence three– manifolds”, ArXiv e-prints (2013). [40] J. Raimbault, “A note on maximal lattice growth in SO(1, n)”, Int. Math. Res. Not. 2013 (2013), no. 16, p. 3722-3731. [41] J. Rohlfs, “Die maximalen arithmetisch definierten Untergruppen zerfallender einfacher Gruppen”, Math. Ann. 244 (1979), no. 3, p. 219-231. [42] ——— , “On the cuspidal cohomology of the Bianchi modular groups”, Math. Z. 188 (1985), no. 2, p. 253-269. [43] P. Sarnak, “The arithmetic and geometry of some hyperbolic three-manifolds”, Acta Math. 151 (1983), no. 3-4, p. 253-295. [44] J.-P. Serre, Arbres, amalgames, SL2 , Société Mathématique de France, Paris, 1977, Avec un sommaire anglais, Rédigé avec la collaboration de Hyman Bass, Astérisque, No. 46, 189 pp. (1 plate) page. [45] C. L. Siegel, Lectures on the geometry of numbers, Springer-Verlag, Berlin, 1989, Notes by B. Friedman, Rewritten by Komaravolu Chandrasekharan with the assistance of Rudolf Suter, With a preface by Chandrasekharan, x+160 pages. [46] M.-F. Vignéras, Arithmétique des algèbres de quaternions, Lecture Notes in Mathematics, vol. 800, Springer, Berlin, 1980, vii+169 pages. Jean RAIMBAULT Institut de Mathématiques de Toulouse ; UMR5219 Université de Toulouse ; CNRS UPS IMT, F-31062 Toulouse Cedex 9, France [email protected] SUBMITTED ARTICLE : ORBIFOLD˙FINAL˙AF.TEX
4math.GR
Vers une ommande multivariable sans modèle arXiv:math/0603155v3 [math.OC] 21 Dec 2007 Mi hel 1, FLIESS Cédri 2, JOIN Mamadou 3, MBOUP Hebertt SIRA-RAMÍREZ 4 1 Projet ALIEN, INRIA Futurs & Équipe MAX, LIX (UMR-CNRS 7161) É ole polyte hnique, 91128 Palaiseau, Fran e 2 Projet ALIEN, INRIA Futurs & CRAN (UMR-CNRS 7039) Université Henri Poin aré (Nan y I), BP 239, 54506 Vand÷uvre-lès-Nan y, Fran e 3 Projet ALIEN, INRIA Futurs & UFR de Mathématiques et Informatique Université René-Des artes, 45 rue des Saints-Pères, 75270 Paris edex 06, Fran e 4 Departamento de Ingeniería Elé tri a, Se ión de Me atróni a, Cinvestav-IPN Aven. IPN No. 2508, Colonia San Pedro Za aten o, AP 14740, 07300 Méxi o, D.F., Mexique Mi hel.Fliesspolyte hnique.edu, Cedri .Join ran.uhp-nan y.fr Mamadou.Mboupmath-info.univ-paris5.fr, hsira investav.mx  Onde propose unenie,ommande deousystèmes multivariables, dimension linéaires non, sans en onnaître le modèle mathématique. Nos deux outils essentiels desontsignaux l'algèbre diérentielle, et une estimation dessimudérivées bruités, ré emment mise au point. Les lations numériques de deuxhe.exemples, l'un linéaire, l'autre non, valident notre démar Mots- lés  Systèmes linéaires multivariables, systèmes non linéaires multivariables, identi ation boîtediérentielle, noire, estimation, dérivées de signaux bruités, algèbre alul opérationnel. Résumé I. Introdu tion Cette ommuni ation présente une généralisation multivariable de [16℄, où étaient jetées les bases d'une ommande sans modèle pour systèmes monovariables de dimension nie, linéaires ou non. Est-il besoin de rappeler ( f. [29℄) la di ulté redoutable d'obtenir un modèle mathématique able dans bien des situations quelque peu omplexes ? Ainsi s'explique l'in royable popularité industrielle des orre teurs PID, en dépit de réglages souvent malaisés ( f. [2℄, [8℄). Notre démar he se distingue par sa méthodologie et sa  philosophie  des identi ations de type  boîte noire , telles qu'on les trouve dans la littérature (voir, par exemple, [37℄ et [26℄). Elle repose sur une nouvelle appro he1 , qui a permis l'estimation en temps réel des dérivées de signaux bruités [22℄2 . Nous substituons aux modèles mathématiques dé rivant les ma hines dans une plage de fon tionnement aussi large que possible des équations diérentielles  phénoménologiques , valides sur un ourt laps de temps, et a tualisées pas à pas. Nous é rivons un système multivariable, de dimension nie, à m entrées u = (u1 , . . . , um ) et p sorties y = (y1 , . . . , yp ), sous la forme (n ) y1 1 = F1 + α1,1 u1 + · · · + α1,m um + β1 ... (n ) yp p = Fp + αp,1 u1 + · · · + αp,m um + βp (1) où 1 Cette appro he, née en [21℄ à propos d'identi ation paramétrique linéaire en bou le fermée, a été étendue au signal [20℄. Elle onduit à un hangement radi al de paradigme ( f. [10℄, [11℄). Voir, par exemple, [3℄, [23℄ pour des appli ations on rètes. 2 Voir [12℄, [13℄, [14℄, [15℄, [22℄, [24℄, [34℄ pour les déjà nombreuses appli ations en automatique non linéaire et traitement du signal.  nj ≥ 1, j = 1, . . . , p, et, le plus souvent, nj = 1, ou 2 ;  αj,i , βj ∈ R, i = 1, . . . , m, j = 1, . . . , p, sont des paramètres onstants non physiques, hoisis par le pratiien ;  les Fj sont déterminés grâ e à la onnaissan e de yj(nj ) , ui , αj,i , βj , i = 1, . . . , m, j = 1, . . . , p.  Si p m, on garde seulement m sorties de manière à obtenir un système arré, inversible. Le omportement désiré s'obtient par orre teurs de type proportionnel intégral généralisé (GPI) [19℄ autour d'une traje toire de référen e. Dans les deux exemples i-dessous, on utilise, omme en [16℄, un PID ou un PI. Le Ÿ II rappelle omment obtenir, grâ e à l'algèbre diérentielle, les équations diérentielles entrée-sortie d'un système non linéaire. Le Ÿ III sur l'estimation des dérivées d'un signal bruité in lut ertains des progrès ré ents sur la mise en ÷uvre numérique. On évoque au Ÿ IV les prin ipes essentiels de notre identi ation boîte noire. Le Ÿ V ontient deux exemples, l'un linéaire, l'autre non, et leurs simulations numériques. Une brève on lusion évoque quelques perspe tives futures. II. Rappels sur les systèmes non linéaires A. Corps diérentiels Un orps diérentiel3 K est un orps ommutatif, muni d , 'est-à-dire une appli ation K → K d'une dérivation dt telle que, ∀ a, b ∈ K,   d (a + b) = ȧ + ḃ, dt d (ab) = ȧb + aḃ. dt Une onstante c ∈ K est un élément tel que ċ = 0. L'ensemble des onstantes est le sous- orps des onstantes. Une extension de orps diérentiels L/K onsiste en la donnée de deux orps diérentiels K, L, telles que :  K ⊆ L,  la dérivation de K est la restri tion à K de elle de L. Notons KhSi, S ⊂ L, le sous- orps diérentiel de L engendré par K et S . Supposons L/K niment engendré, 'està-dire L = KhSi, où S est ni. Un élément ξ ∈ L est dit 3 Voir [5℄, [27℄ pour plus de details et, en parti ulier, [5℄ pour des rappels sur les orps usuels, 'est-à-dire non diérentiels. Tous les orps onsidérés i i sont de ara téristique nulle. diérentiellement algébrique par rapport à K si, et seule- Le système est dit arré si, et seulement si, m = p. Alors, ment si, il satisfait une équation diérentielle algébrique P (ξ, . . . , ξ (n) ) = 0, où P est un polynme sur K en n + 1 indéterminées. L'extension L/K est dite diérentiellement algébrique si, et seulement si, tout élément de L de diérentiellement algébrique par rapport à K. Le résultat suivant est important : L/K est diérentiellement algébrique si, et seulement si, son degré de trans endan e est ni. Un élément de L non diérentiellement algébrique par rapport à K est dit diérentiellement trans endant par rapport à K. Une extension L/K non diérentiellement algébrique est dit diérentiellement trans endante. Un ensemble {ξι ∈ L | ι ∈ I} est dit diérentiellement algébriquement indépendant par rapport à K si, et seulement si, au une relation diérentielle non triviale par rapport à K n'existe : Q(ξι(νι ) ) = 0, où Q est un polynme sur K, implique Q ≡ 0. Deux ensembles maximaux d'éléments diérentiellement algébriquement indépendants ont même ardinalité, 'est-à-dire même nombre d'éléments : 'est le degré de trans endan e diérentielle de l'extension L/K. Un tel ensemble est une base de trans endan e diérentielle. Enn, L/K est diérentiellement algébrique si, et seulement si, son degré de trans endan e diérentielle est nulle. inversibilités à gau he et à droite oïn ident. On dit, si es propriétés sont vériées, que le système est inversible. Remarque 1 Supposons notre système inversible à gau he. Le omportement qualitatif de (2), onsidéré omme système d'équations différentielles en u, y étant donné, permet de dénir le déphasage non minimal (voir aussi [25℄). III. Estimation des dérivées temporelles P t À la série onvergente x(t) = n≥0 an n! , an ∈ C, orrespond la série opérationnelle onvergente5 x = P an le développement de Taylor tronqué n≥0 sn+1 . Ave PN dN +1 tn xN (t) n=0 an n! , l'équation diérentielle dt N +1 = xN = 0 orrespond dans le domaine opérationnel à (N) sN+1 xN − sN xN (0) − sN−1 ẋN (0) . . . − xN (0) = 0 Les dérivées à l'origine x(i) N (0) sont ainsi obtenues à partir du système d'équations linéaires s−ν B. Systèmes non linéaires Donnons-nous un orps diérentiel de base k . Un système4 est une extension diérentiellement trans endante de K/k , niment engendrée. Soit m son degré de transendan e diérentielle. Un ensemble de ommandes (independantes) u = (u1 , . . . , um ) est une base de transendan e diérentielle de K/k . L'extension K/khui est don diérentiellement algébrique. Un ensemble de sorties y = (y1 , . . . , yp ) est un sous-ensemble de K . Soit x = (x1 , . . . , xn ) une base de trans endan e de K/khui, de degré de trans endan e n. Il en dé oule la représentation d'état généralisée : Aι (ẋι , x, u, . . . , u(α) ) = 0 Bκ (yκ , x, u, . . . , u(β) ) = 0 o dm n (N) (N−1) xN (0) + xN (0)s + . . . + xN (0)sN = m ds o dm n s−ν m sN+1 xN ds (2) où Φj , j = 1, . . . , p, est un polynme sur k . Venons-en à l'inversibilité entrée-sortie :  Le système est dit inversible à gau he si, et seulement si, l'extension khu, yi/khyi est diérentiellement algébrique. C'est dire que l'on peut ré upérer l'entrée à partir de la sortie grâ e à un système diérentiel. Alors, m ≤ p.  Il est dit inversible à droite si, et seulement si, le degré de trans endan e diérentielle de khyi/k vaut p. C'est dire que les sorties sont diérentiellement algébriquement indépendantes par rapport à k . Alors, p ≤ m. 4 Pour plus de détails, voir [6℄, [17℄, [35℄, [36℄. Rappelons que l'on emploie aussi l'algèbre diérentielle dans diverses questions relatives à l'identi ation et l'observabilité (voir, par exemple, [28℄). (3) m = 0, . . . , N , ν > N + 1. Ce système étant triangu- laire ave des éléments diagonaux non nuls, les paramètres xN (0), et, par onséquent, les oe ients a0 , . . . , aN sont linéairement identiables [13℄, [21℄. Remplaçons xN par x dans (3) : on obtient ainsi l'estimée opérationnelle [x(i) (0)]eN de x(i) (0). (i) Pour le passage au numérique, il sut, selon les règles usuelles du al ul opérationnel ( f. [30℄, [31℄, [33℄), de rempla er en (3) tα−1 , t ≥ 0;  scα , α ≥ 1, c ∈ C, par c (α−1)! 1 dn x  sα dsn par l'intégrale itérée d'ordre α où Aι , ι = 1, . . . , n, Bκ , κ = 1, . . . , p, sont des polynmes sur k . La représentation entrée-sortie suivante résulte du fait que y1 , . . . , yp sont diérentiellement algébriques par rapport à khui : Φj (y, . . . , y(N̄j ) , u, . . . , u(M̄j ) ) = 0 n Z tZ 0 0 tα−1 ··· Z 0 t1 (−1)n τ n x(τ )dtα−1 · · · dt1 dτ = (−1)n (α − 1)! Z 0 t (t − τ )α−1 τ n x(τ )dτ (4) Notons, [x(i) (0)]eN (t) l'estimée numérique ainsi obtenue de x(i) (0), pour un temps d'estimation t. La mise en ÷uvre repose sur le résultat suivant : lim[x(i) (0)]eN (t) = t↓0 lim [x(i) (0)]eN (t) = x(i) (0) N→+∞ Remarque 2 Les itérations des intégrales produisent une moyennisation, don un ltrage passe-bas, qui permet d'atténuer les bruits (voir [10℄). Remarque 3 La fenêtre temporelle d'estimation peut être hoisie très petite, e qui permet une implémentation en temps réel. 5 Voir [30℄, [31℄. Renvoyons à [13℄, [14℄ pour plus de détails. IV. Pro édures d'identifi ation boîte noire On requiert les propriétés suivantes pour éviter, notamment, toute bou le algébrique : 1. On suppose le système inversible à gau he. Si le nombre de sorties est stri tement supérieur à elui des entrées, 'est-à-dire p m, on hoisit m sorties pour obtenir un système arré inversible, et onstruire (1). 2. L'ordre de dérivation nj en (1) est relié à (2) par nj ≤ N̄j j et, plus pré isément, par ∂y∂Φ (nj ) 6≡ 0. 3. La valeur numérique de Fj , égale à yj(nj ) − αj,1 u1 − · · · − αj,m um − βj est obtenue grâ e à la dis rétisation (nj ) Fj (κ) = [yj (κ)]e − m X i=1 Remarque 4 Ave des systèmes à déphasage non minimal, nos pro édures peuvent onduire à des valeurs divergentes des uj pour t grand, et, don , à des valeurs numériquement inadmissibles des Fj . V. Deux exemples On utilise les modèles mathématiques i-dessous pour les besoins évidents des simulations numériques. A. Système linéaire Soit le système linéaire à deux entrées et deux sorties, ave ples instables et large spe tre : y1 = y2 = Après quelques essais, nous hoisissons (1) sous la forme dé ouplée : ÿ2 = F2 + 10u2 La stabilisation autour d'une traje toire de référen e est assurée par un régulateur PID (voir [16℄) : u1 = u2 = 1 10 1 10 Le système des trois uves de la gure 1, très populaire dans la ommunauté du diagnosti 8 , vérie les équations : où 8 ẋ1 = > > > > > ẋ2 = > > > > > > > < ẋ = 3 > > > > > > y1 = > > > > y2 = > > : y3 = p −C1 sign(x1 − x3 ) |x1 − x3 | + u1 /S p C3 sign(x3 − x2 ) |x3 − x2 | p −C2 sign(x2 ) |x2 | + u2 /S p C1 sign(x1 − x3 ) |x1 − x3 | p −C3 sign(x3 − x2 ) |x3 − x2 | x1 x2 x3 √ Cn = (1/S).µn .Sp 2g, n = 1, 2, 3 ; S = 0.0154 m (se tion des uves) ; Sp = 5.10−5 m (se tion des tuyaux inter- uves) ; g = 9.81 m.s−2 (a élération de la pesanteur) ; µ1 = µ3 = 0.5, µ2 = 0.675 ( oe ients de vis osité). Selon les re ommandations du Ÿ IV, on onstruit (1), déouplé omme au Ÿ V-A : ẏi = Fi +200ui, i = 1, 2. La gure 4-(a) fournit le suivi de traje toires. L'estimation des dérivées (gure 4-(b)) possède un omportement remarquable en dépit du bruit additif de mesure, de même ara téristique qu'au Ÿ V-A. Les ommandes nominales (gure 4-( )) sont assez pro hes de elles que nous aurions al ulées en utilisant la platitude (voir [15℄). Elles sont omplétées par des orre teurs PI ui = 1 200 „ ẏi∗ − Fi + 10ei + 2.10−2 Z ei « i = 1, 2 u (s+0.01)(s+0.1)(s−1)s 1 s+1 u (s+0.003)(s−0.03)(s+0.3)(s+3) 1 s2 u2 + (s+0.004)(s+0.04)(s−0.4)(s+4) ẏ1 = F1 + 10u1 B. Système non linéaire des trois uves αj,i ui (κ − 1) − βj où [•(κ)]e désigne l'estimée au temps κ. Le prati ien suit les étapes suivantes : 1. hoix de m sorties si p > m ; 2. hoix des nj en (1) ; 3. hoix de traje toires de référen e pour les yj , ainsi qu'il est usuel en ommande par platitude (voir, par exemple, [17℄, [35℄, [36℄)6 ; 4. hoix des paramètres αj,i en (1) an que que la grandeur des ommandes u soient onvenables ; 5. hoix des paramètres βj en (1) diérent de 0 si u n'apj (u = 0) ≡ 0. paraît pas linéairement en (2), 'est-à-dire ∂Φ ∂uj s3 Le omportement en suivi de traje toires, ave bruit de sortie additif (loi normale N (0, 0.01)), est bon7 . Les estimations des signaux né essaires à la synthèse de la ommande sont présentées dans les gures 2-(b) à 2-(h). Notons la différen e d'é helle entre u1 (gure 2-(g)) et u2 (gure 2-(h)), d'où l'inégalité des paramètres des orre teurs (5). La gure 3-(b) montre le omportement du système en appliquant une ommande PID plus  traditionnelle , 'est-à-dire en posant F1 ≡ F2 ≡ 0. La omparaison des gures 3-(a) et 3-(b) est éloquente. ` ∗ R ´ `ẏ1∗ − F1 + KP 1 e1 + KI1 R e1 + KD1 ė1 ´ ÿ2 − F2 + KP 2 e2 + KI2 e2 + KD2 ė2 (5) où  KP 1 = 1, KI1 = KD1 = 0, KP 2 = KI2 = 50, KD2 = 10 ;  y1∗ , y2∗ sont les traje toires de référen e ;  e1 = y1∗ − y1 , e2 = y2∗ − y2 . 6 C'est don une ommande prédi tive sans modèle. Renvoyons à [18℄ et [7℄ pour les avantages de la platitude en prédi tif ave modèle. où yi∗ est la traje toire de référen e, ei = yi∗ − yi . Pour évaluer ei nous utilisons yi débruité (voir gure 4-(d)) selon les te hniques du Ÿ III (voir aussi [13℄, [14℄). VI. Con lusion Les règles ardues d'identi ation du Ÿ IV seront pré isées dans le futur9 . On exposera bientt des résultats en ourageants sur le déphasage non minimal ainsi que eux sur l'égalisation aveugle ( f. [9℄), qui est, en un ertain sens, le pendant en signal de la ommande sans modèle. 7 C'est pourquoi nous espérons, omme déjà dit en [16℄, que nos méthodes pourraient fournir une alternative e a e à elles sur la rédu tion de modèles (voir, par exemple, [1℄). 8 Renvoyons à [15℄ pour plus de détails et les référen es bibliographiques. Que l'on nous permette de rappeler que [15℄ propose, sans doute pour la première fois, le diagnosti , la ommande et la re onguration d'un système non linéaire à paramètres in ertains. 9 Elles ne peuvent être toutes déduites de onsidérations purement mathématiques. L'expérien e pratique y joue bien entendu, omme pour les PID, un rle onsidérable. pompe 2 pompe 1 u1 uve 1 u2 uve 3 uve 2 S S x1 x3 Sp , µ1 S x2 Sp , µ3 Sp , µ2 Fig. 1: Système non linéaire des trois uves Une mathématisation élaborée, omme elle présentée i i, an d'abandonner une modélisation aussi  globale  que possible dans une dis ipline empirique, omme l'automatique, semble nouvelle10 . Il onviendrait d'en explorer les impli ations épistémologiques, ne serait- e que pour les liens entre physique, omplexité, ommande et résolution temporelle ( f. [32℄). Référen es [1℄ A.C. Antoulas, Approximation of Large-S ale Dynami al Systems, SIAM, Philadelphie, 2005. [2℄ K.J. Aström et T. Hägglund, PID Controllers : Theory, Design and Tuning, 2nd ed., Instrument So . Amer., Resear h Triangle Park, NC, 1995. [3℄ F. Beltrán-Carvajal, G. Silva-Navarro, H. Sira-Ramírez et J. Quezada-Andrade,  A tive vibration ontrol using on-line algebrai identi ation of harmoni vibrations , Pro . Amer. Control Conf., Portland, OR, 2005. [4℄ F. Bonnans et P. Rou hon, Commande et optimisation de systèmes dynamiques, Éd. É ole Polyte hnique, Palaiseau, 2005. [5℄ A. Chambert-Loir, A Field Guide to Algebra, Springer, Berlin, 2005. [6℄ E. Delaleau,  Algèbre diérentielle , Mathématiques pour les Systèmes Dynamiques, J.P. Ri hard (Éd.), vol. 2, hap. 6, pp. 245-268, Hermès, Paris, 2002. [7℄ E. Delaleau et V. Hagenmeyer,  Commande prédi tive non linéaire fondée sur la platitude diérentielle , La ommande prédi tive : Avan ées et perspe tives, D. Dumur (Éd.), Hermès, Paris, 2006 [8℄ A. O'Dwyer, Handbook of PI and PID Controller Tuning Rules, Imperial College Press, Londres, 2003. [9℄ I. Fijalkow et K. Abed-Meraim,  Égalisation aveugle , Signal et télé oms, P. Loubaton (Éd.), pp. 17-54, Hermès, Paris, 2004. [10℄ M. Fliess,  Analyse non standard du bruit , C.R. A ad. S i. Paris, ser. I, vol. 342, 2006 (a essible sur http://hal.inria.fr/inria-00001134). [11℄ M. Fliess,  Observer, identier, estimer, diagnostiquer autrement pour mieux ommander , en préparation. [12℄ M. Fliess, C. Join, M. Mboup et A. Sedoglavi ,  Estimation des dérivées d'un signal multidimensionnel ave appli ations aux images et aux vidéos , A tes 20e Coll. GRETSI, Louvain-la-Neuve, 2005 (a essible sur http://hal.inria.fr/inria-00001116). [13℄ M. Fliess, C. Join, M. Mboup et H. Sira-Ramírez,  Compression diérentielle de transitoires bruités , C.R. A ad. S i. Paris, ser. I, vol. 339, pp. 821-826, 2004. [14℄ M. Fliess, C. Join, M. Mboup et H. Sira-Ramírez,  Analyse et représentation de signaux transitoires : appli ation à la ompression, au débruitage et à la déte tion de ruptures , A tes 20e Coll. GRETSI, Louvain-la-Neuve, 2005 (a essible sur http://hal.inria.fr/inria-00001115). [15℄ M. Fliess, C. Join et H. Sira-Ramírez,  Closed-loop faulttolerant ontrol for un ertain nonlinear systems , Control and Observer Design for Nonlinear Finite and Innite Dimensional Systems, T. Meurer, K. Grai hen, E.D. Gilles (Eds), Le t. Notes 10 Voir, ependant, l'utilisation des dynamiques lentes-rapides pour simplier la mise en équation ( f. [4℄). Control Informat. S i., vol. 322, pp. 217-233, Springer, Berlin, 2005. [16℄ M. Fliess, C. Join et H. Sira-Ramírez,  Complex ontinuous nonlinear systems: their bla k box identi ation and their ontrol , Pro . 14th IFAC Symp. System Identif. (SYSID 2006), New astle, Australie, 2006 (a essible sur http://hal.inria.fr/inria-00000824). [17℄ M. Fliess, J. Lévine, P. Martin et P. Rou hon,  Flatness and defe t of non-linear systems: introdu tory theory and examples , Internat. J. Control, vol. 61, pp. 1327-1361, 1995. [18℄ M. Fliess et R. Marquez,  Continuous-time linear predi tive ontrol and atness: a module-theoreti setting with examples , Internat. J. Control, vol. 73, pp. 606-623, 2000. [19℄ M. Fliess, R. Marquez, E. Delaleau et H. Sira-Ramírez,  Corre teurs proportionnels-intégraux généralisés , ESAIM Control Optim. Cal . Variat., vol. 7, pp. 23-41, 2002. [20℄ M. Fliess, M. Mboup, H. Mounier et H. Sira-Ramírez,  Questioning some paradigms of signal pro essing via on rete examples , Algebrai Methods in Flatness, Signal Pro essing and State Estimation, H. Sira-Ramírez, G. Silva-Navarro (Eds.), pp. 1-21, Editiorial Lagares, Méxi o, 2003 (a essible sur http://hal.inria.fr/inria-00001059). [21℄ M. Fliess et H. Sira-Ramírez,  An algebrai framework for linear identi ation , ESAIM Control Optim. Cal . Variat., vol. 9, pp. 151-168, 2003. [22℄ M. Fliess et H. Sira-Ramírez,  Control via state estimations of some nonlinear systems , Pro . Symp. Nonlinear Control Systems (NOLCOS 2004), Stuttgart, 2004 (a essible sur http://hal.inria.fr/inria-00001096). [23℄ S. Fu hshumer, Algebrai Linear Identi ation, Modelling, and Appli ations of Flatness-based Control, Thèse, Joannes Kepler Univesität, Linz, 2006. [24℄ C. Gar ía-Rodríguez et H. Sira-Ramírez,  Seguimiento de traye torias via estima ión de estados por métodos algebrái os , IEEE 3er Cong. Interna . Innov. Desarrolo Te onol., Cuernava a Morelos, Mexique, 2005. [25℄ A. Isidori, Nonlinear Control Systems II, Springer, Berlin, 1999. [26℄ G. Kers hen, K. Worden, A.F. Vakakis et J.-C. Golinval,  Past, present and future of nonlinear system identi ation in stru tural dynami s , Me h. Systems Signal Pro ess., vol. 20, pp. 505-592, 2006. [27℄ E.R. Kol hin, Dierential Algebra and Algebrai Groups, A ademi Press, New York, 1973. [28℄ L. Ljung et T. Glad,  On global identiability of arbitrary model parameterization , Automati a, vol. 30, pp. 265-237, 1994. [29℄ L. Ljung et T. Glad, Modeling of Dynami System, Prenti e Hall, Englewood Clis, NJ, 1994. [30℄ J. Mikusi«ski, Operational Cal ulus, 2nd ed., vol. 1, PWN, Varsovie & Oxford University Press, Oxford, 1983. [31℄ J. Mikusi«ski et T.K. Boehme, Operational Cal ulus, 2nd ed., vol. 2, PWN, Varsovie & Oxford University Press, Oxford, 1987. [32℄ L. Nottale, J. Chaline et P. Grou, Les arbres de l'évolution, Hahette, Paris, 2000. [33℄ B. van der Pol et H. Bremmer, Operational Cal ulus Based on the Two-Sided Lapla e Integral, 2nd ed., Cambridge University Press, Cambridge, 1955. [34℄ J. Reger, H. Sira-Ramírez et M. Fliess,  On non-asymptoti observation of nonlinear systems , Pro . CDC-ECC'05, Seville, 2005. [35℄ J. Rudolph, Beiträge zur a heitsbasierten Folgeregelung linea- rer und ni htlinearer Syteme endli her und undendli her Dimension, Shaker Verlag, Aix-la-Chapelle, 2003. [36℄ H. Sira-Ramírez et S. Agrawal, Dierentially Flat Systems, Marel Dekker, New York, 2004. [37℄ J. Sjöberg, Q. Zhang, L. Ljung, A. Benveniste, B. Delyon, P.-Y. Glorenne , H. Hjalmarsson et A. Juditsky,  Nonlinear bla k-box modeling in system identi ation : a unied overview , Automati a, vol. 31, pp. 1691-1724, 1995. 0.10 10 0.08 8 0.06 6 0.04 4 0.02 2 0.00 0 -0.02 -2 -0.04 -4 -0.06 -6 -0.08 -8 Time (s) -0.10 0 1 2 3 4 5 6 7 8 9 10 Time (s) -10 0 1 2 (a) Bruits de sortie 3 4 5 6 7 8 9 10 8 9 10 8 9 10 8 9 10 (b) Estimation de ẏ1 10 100 8 80 6 60 4 40 2 20 0 0 -2 -20 -4 -40 -6 -60 -8 -80 Time (s) -10 0 1 2 3 4 5 6 7 8 9 Time (s) -100 10 0 1 2 ( ) Estimation de ẏ2 3 4 5 6 7 (d) Estimation de ÿ2 25 300 21 200 17 13 100 9 5 0 1 -3 -100 -7 Time (s) -11 0 1 2 3 4 5 6 7 8 9 Time (s) -200 10 0 1 2 (e) Estimation de F1 3 4 5 6 7 (f) Estimation de F2 1.5 50 1.1 40 0.7 30 0.3 -0.1 20 -0.5 10 -0.9 -1.3 0 -1.7 -10 -2.1 Time (s) -2.5 0 1 2 3 4 5 6 7 8 9 10 Time (s) -20 0 1 2 3 4 5 6 7 1.8 15 1.6 13 1.4 11 1.2 9 1.0 7 0.8 5 0.6 3 0.4 1 0.2 -1 0.0 -3 Time (s) -0.2 0 1 2 3 4 (a) Référen 5 6 7 8 9 Time (s) -5 10 0 1 2 3 4 5 6 7 8 9 10 450 500 (b) Sorties sans utiliser F1 et F2 es (- -) et sorties Fig. 3: Système linéaire (suite) 0.31 0.04 0.27 0.03 0.23 0.02 0.19 0.15 0.01 0.11 0.00 0.07 −0.01 0.03 Time (s) -0.01 0 100 200 (a) Référen 300 400 500 −0.02 0 Time (s) 50 100 150 200 250 300 350 400 (b) Estimation des dérivées ẏ1 (-) et ẏ2 (- -), dé es (- -) et sorties 2.0e-04 alé de 0.02 0.25 1.8e-04 0.24 1.6e-04 0.23 1.4e-04 1.2e-04 0.22 1.0e-04 0.21 8.0e-05 6.0e-05 0.20 4.0e-05 0.19 2.0e-05 Time (s) 0.0e+00 0 100 200 300 400 ( ) Commandes u1 (-) et u2 (- -) 500 0.18 120 Time (s) 130 140 150 160 170 180 (d) Gros plan sur le débruitage Fig. 4: Système non linéaire des trois uves 190 200 0.03 0.02 0.01 0.00 -0.01 -0.02 Time ( -0.03 0 100 200 300 400 500 18 17 16 15 14 13 12 11 10 9 Time ( 8 0 1 2 3 4 5 6 7 8 9 10 2.7 2.3 1.9 1.5 1.1 0.7 0.3 Time ( -0.1 0 1 2 3 4 5 6 7 8 9 10 80 60 40 20 0 -20 -40 -60 Time ( -80 0 1 2 3 4 5 6 7 8 9 10 1.8 1.6 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0.0 Time ( -0.2 0 1 2 3 4 5 6 7 8 9 10 5 4 3 2 1 0 Time ( -1 0 1 2 3 4 5 6 7 8 9 10 1.5 1.1 0.7 0.3 -0.1 -0.5 -0.9 -1.3 -1.7 -2.1 Time ( -2.5 0 1 2 3 4 5 6 7 8 9 10 40 30 20 10 0 -10 -20 Time ( -30 0 1 2 3 4 5 6 7 8 9 10 10 8 6 4 2 0 -2 -4 -6 -8 Time ( -10 0 1 2 3 4 5 6 7 8 9 10 10 8 6 4 2 0 -2 -4 -6 -8 Time ( -10 0 1 2 3 4 5 6 7 8 9 10 100 80 60 40 20 0 -20 -40 -60 -80 Time ( -100 0 1 2 3 4 5 6 7 8 9 10 0.06 0.05 0.04 0.03 0.02 0.01 0.00 Time ( -0.01 0 1 2 3 4 5 6 7 8 9 10 0.6 0.5 0.4 0.3 0.2 0.1 0.0 Time ( -0.1 0 1 2 3 4 5 6 7 8 9 10 4e-04 3e-04 2e-04 1e-04 0e+00 -1e-04 -2e-04 -3e-04 Time ( -4e-04 0 1 2 3 4 5 6 7 8 9 10 i y0 y 0.10 0.08 0.06 0.04 0.02 0.00 -0.02 -0.04 -0.06 -0.08 Time ( -0.10 0 1 2 3 4 5 6 7 8 9 10 18 17 16 15 14 13 12 11 10 9 Time (s) 8 0 1 2 3 4 5 6 7 8 9 10 0.20 0.16 0.12 0.08 0.04 0.00 -0.04 -0.08 -0.12 -0.16 Time ( -0.20 0 1 2 3 4 5 6 7 8 9 10 2.0 1.6 1.2 0.8 0.4 0.0 -0.4 -0.8 -1.2 -1.6 Time ( -2.0 0 1 2 3 4 5 6 7 8 9 10
5cs.CE
Raising The Bar For V ERTEX C OVER: Fixed-parameter Tractability Above A Higher Guarantee Shivam Garg1 and Geevarghese Philip2 2 1 IIT Bombay, Mumbai, India, [email protected] Max Planck Institute for Informatics, Saarbrücken, Germany, [email protected] Abstract arXiv:1509.03990v1 [cs.DS] 14 Sep 2015 The standard parameterization of the V ERTEX C OVER problem (Given an undirected graph G and k ∈ N as input, does G have a vertex cover of size at most k?) has the solution size k as the parameter. The following more challenging parameterization of V ERTEX C OVER stems from the observation that the size M M of a maximum matching of G lower-bounds the size of any vertex cover of G: Does G have a vertex cover of size at most M M + kµ ? The parameter is the excess kµ of the solution size over the lower bound M M . Razgon and O’Sullivan (ICALP 2008) showed that this above-guarantee parameterization of V ERTEX C OVER is fixed-parameter tractable and can be solved1 in time O⋆ (15kµ ). This was first improved to O⋆ (9kµ ) (Raman et al., ESA 2011), then to O⋆ (4kµ ) (Cygan et al., IPEC 2011, TOCT 2013), then to O⋆ (2.618kµ ) (Narayanaswamy et al., STACS 2012) and finally to the current best bound O⋆ (2.3146kµ ) (Lokshtanov et al., TALG 2014). The last two bounds were in fact proven for a different parameter: namely, the excess kλ of the solution size over LP , the value of the linear programming relaxation of the standard LP formulation of V ERTEX C OVER. Since LP ≥ M M for any graph, we have that kλ ≤ kµ for Y ES instances. This is thus a stricter parameterization—the new parameter is, in general, smaller—and the running times carry over directly to the parameter kµ . We investigate an even stricter parameterization of V ERTEX C OVER, namely the excess k̂ of the solution size over the quantity (2LP − M M ). We ask: Given a graph G and k̂ ∈ N as input, does G have a vertex cover of size at most (2LP − M M ) + k̂? The parameter is k̂. It can be shown that (2LP −M M ) is a lower bound on vertex cover size, and since LP ≥ M M we have that (2LP − M M ) ≥ LP , and hence that k̂ ≤ kλ holds for Y ES instances. Further, (kλ − k̂) could be as large as (LP − M M ) and—to the best of our knowledge—this difference cannot be expressed as a function of kλ alone. These facts motivate and justify our choice of parameter: this is indeed a stricter parameterization whose tractability does not follow directly from known results. We show that V ERTEX C OVER is fixed-parameter tractable for this stricter parameter k̂: We derive an algorithm which solves V ERTEX C OVER in time O⋆ (3k̂ ), thus pushing the envelope further on the parameterized tractability of V ERTEX C OVER. 1 The O⋆ notation hides polynomial factors. 1 Introduction The input to the V ERTEX C OVER problem consists of an undirected graph G and an integer k, and the question is whether G has a vertex cover—a subset S ⊆ V (G) of vertices such that every edge in G has at least one end-point in S—of size at most k. This problem is among Karp’s original list of 21 NP-complete problems [14]; it is also one of the best-studied problems in the field of parameterized algorithms and complexity [5, 15, 18, 24]. The input to a parameterized version of a classical decision problem consists of two parts: the classical input and a specified parameter, usually an integer, usually denoted by the letter k. A fixed-parameter tractable (FPT) algorithm [8, 10] for this parameterized problem is one which solves the underlying decision problem in time f (k) · nc where (i) f is a computable function of k alone, (ii) n is the size of the (classical) input instance, and (iii) c is a constant independent of n and k. This running time is often written as O⋆ (f (k)); the O⋆ notation hides constant-degree polynomial factors in the running time. A parameterized algorithm which has an FPT algorithm is itself said to be (in) FPT. The “standard” parameter for V ERTEX C OVER is the number k which comes as part of the input and represents the size of the vertex cover for which we look—hence referred to, loosely, as the “solution size”. This is the most extensively studied parameterization of V ERTEX C OVER [1, 4, 5, 15, 22]. Starting with a simple two-way branching algorithm (folklore) which solves the problem in time O⋆ (2k ) and serves as the de facto introduction-cum-elevator-pitch to the field, a number of FPT algorithms with improved running times have been found for V ERTEX C OVER, the current fastest of which solves the problem in O⋆ (1.2738k ) time [5]. It is also known that unless the Exponential Time Hypothesis (ETH) fails, there is no algorithm which solves V ERTEX C OVER in O⋆ (2o(k) ) time [13]. This last point hints at a fundamental drawback of this parameterization of V ERTEX C OVER: In cases where the size of a smallest vertex cover (called the vertex cover number) of the input graph is “large”—say, Ω(n) where n is the number of vertices in the graph—one cannot hope to use these algorithms to find a smallest vertex cover “fast”. This is, for instance, the case when the input graph G has a large matching, which is a set of edges of G no two of which share an end-point. Observe that since each edge in a matching has a distinct representative in any vertex cover, the size of a largest matching in G is a lower bound on the vertex cover number of G. So when input graphs have matchings of size Ω(n)—which is, in a real sense, the most common case by far (see, e.g.; [2, Theorem 7.14])—FPT algorithms of the kind described in the previous paragraph take Ω(cn ) time for some constant c, and one cannot hope to improve this to the form O(co(n) ) unless ETH fails. Put differently: consider the standard parameterization of V ERTEX C OVER, and let M M denote the size of a maximum matching—the matching number— of the input graph. Note that we can find M M in polynomial time [9]. When k < M M the answer is trivially N O, and thus such instances are uninteresting, and when k ≥ M M , FPT algorithms for this parameterization of the problem are impractical for those (most common) instances for which M M = Ω(n). Such considerations led to the following alternative parameterization of V ERTEX C OVER, where the parameter is the “excess” above the matching number: A BOVE -G UARANTEE V ERTEX C OVER (AGVC) Input: A graph G and kµ ∈ N. Question: Does G have a vertex cover of size at most M M + kµ ? Parameter: kµ The parameterized complexity of AGVC was settled by Razgon and O’Sullivan [25] in 2008; they showed that the problem is FPT and can be solved in O⋆ (15kµ ) time. A sequence of faster FPT algorithms followed: In 2011, Raman et al. [24] improved the running time to O⋆ (9kµ ), 1 and then Cygan et al. [6,7] improved it further to O⋆ (4kµ ). In 2012, Narayanaswamy et al. [19] developed a faster algorithm which solved AGVC in time O⋆ (2.618kµ ). Lokshtanov et al. [16] improved on this to obtain an algorithm with a running time of O⋆ (2.3146kµ ). This is currently the fastest FPT algorithm for A BOVE -G UARANTEE V ERTEX C OVER. The algorithms of Narayanaswamy et al. and Lokshtanov et al. in fact solve a “stricter” parameterization of V ERTEX C OVER. Let LP denote the minimum value of a solution to the linear programming relaxation of the standard LP formulation of V ERTEX C OVER (See Section 2 for definitions.). Then LP is a lower bound on the vertex cover number of the graph. Narayanaswamy et al. introduced the following parameterization2 of V ERTEX C OVER, “above” LP : V ERTEX C OVER A BOVE LP (VCAL) Input: A graph G and kλ ∈ N. Question: Does G have a vertex cover of size at most LP + kλ ? Parameter: kλ The two algorithms solve VCAL in times O⋆ (2.618kλ ) and O⋆ (2.3146kλ ), respectively. Since the inequality LP ≥ M M holds for every graph we get that VCAL is a stricter parameterization of V ERTEX C OVER, in the sense that these algorithms for VCAL directly imply algorithms which solve AGVC in times O⋆ (2.618kµ ) and O⋆ (2.3146kµ ), respectively. To see this, consider an instance (G, kµ ) of AGVC where M M is the matching number and V Copt is the (unknown) vertex cover number of the input graph G, and let x = M M + kµ . The question is then whether V Copt ≤ x. To resolve this, find the value LP for the graph G (in polynomial time) and set kλ = x − LP . Now we have that V Copt ≤ x ⇐⇒ V Copt ≤ LP + kλ , and we can check if the latter inequality holds—that is, we can solve VCAL—in O⋆ (2.3146kλ ) time using the algorithm of Lokshtanov et al. Now LP ≥ M M =⇒ (x − LP ) ≤ (x − M M ) =⇒ kλ ≤ kµ , and so this algorithm runs in O⋆ (2.618kµ ) time as well. This leads us naturally to the next question: can we push this further? Is there an even stricter lower bound for V ERTEX C OVER, such that V ERTEX C OVER is still fixed-parameter tractable when parameterized above this bound? To start with, it is not clear that a stricter lower bound even exists for V ERTEX C OVER: what could such a bound possibly look like? It turns out that we can indeed derive such a bound; we are then left with the task of resolving tractability above this stricter bound. Our Problem. Motivated by an observation of Lovász and Plummer [17] we show—see Lemma 1— that the quantity (2LP − M M ) is a lower bound on the vertex cover number of a graph, and since LP ≥ M M we get that (2LP − M M ) ≥ LP . This motivates the following parameterization of V ERTEX C OVER: V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER (VCAL-P) Input: A graph G and k̂ ∈ N. Question: Does G have a vertex cover of size at most (2LP − M M ) + k̂? Parameter: k̂ Since (2LP − M M ) ≥ LP we get, following similar arguments as described above, that V ER C OVER A BOVE L OV ÁSZ -P LUMMER is a stricter parameterization than V ERTEX C OVER A BOVE LP. Further, (kλ − k̂) could be as large as (LP − M M ) and—to the best of our knowledge— this difference cannot be expressed as a function of kλ alone for the purpose of solving V ERTEX C OVER. These facts justify our choice of parameter: V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER is indeed a stricter parameterization than both A BOVE -G UARANTEE V ERTEX C OVER and V ERTEX C OVER A BOVE LP, and its tractability does not follow directly from known results. TEX 2 To be precise, Narayanaswamy et al. used the value ⌈LP ⌉ instead of just LP in their definition of V ERTEX C OVER A BOVE LP, but this makes no essential difference. 2 Our Results. The main result of this work is that V ERTEX C OVER is fixed-parameter tractable even when parameterized above this stricter lower bound: Theorem 1. V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER is fixed-parameter tractable and can be solved in O⋆ (3k̂ ) time. By the discussions above, this directly implies similar FPT algorithms for the two weaker parameterizations: Corollary 1. V ERTEX C OVER A BOVE LP can be solved in O⋆ (3kλ ) time, and A BOVE -G UARANTEE V ERTEX C OVER can be solved in O⋆ (3kµ ) time. Our Methods. We now sketch the main ideas behind our FPT algorithm for V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER; the details are in Section 3. Let k = (2LP − M M ) + k̂ denote the “budget”, which is the maximum size of a vertex cover in whose existence we are interested; we want to find if there is a vertex cover of size at most k. At its core, our algorithm is a simple branching algorithm which (i) manages to drop the measure k̂ by at least 1 on each branch, and (ii) has a worst-case branching factor of 3. To achieve this kind of branching we need to find, in polynomial time, constant-sized structures in the graph, on which we can branch profitably. It turns out that none of the “local” branching strategies traditionally used to attack V ERTEX C OVER—from the simplest “pick an edge and branch on its end-points” to more involved ones based on complicated structures (e.g., those of Chen et al. [5])—serve our purpose. All of these branching strategies give us a drop in k in each branch—because we pick one or more vertices into the solution—but give us no control over how LP and M M change. So we turn to the more recent ideas of Narayanaswamy et al. [19] who solve a similar problem: they find a way to preprocess the input graph using reduction rules in such a way that branching on small structures in the resulting graph would make their measure (k − LP ) drop on each branch. We find that their reduction rules do not increase our measure, and hence that we can safely apply these rules to obtain a graph where we can pick up to two vertices in each branch and still have control over how LP changes. The branching rules of Narayanaswamy et al., however, are not of use to us: these rules help control the drop in LP , but they provide no control over how M M changes. Note that for our measure k̂ to drop we need, roughly speaking, (i) a good drop in k, (ii) a small drop in LP , and (iii) a good drop in M M . None of the branching strategies of Narayanaswamy et al. or Lokshtanov et al. (or others in the literature which we tried) help with this. To get past this point we look at the classical Gallai-Edmonds decomposition of the reduced graph, which can be computed in polynomial time [9, 11, 12, 17]. We prove that by carefully choosing edges to branch based on this decomposition, we can ensure that both LP and M M change in a way which gives us a net drop in the measure k̂. The key ingredient and the most novel aspect of our algorithm—as compared to existing algorithms for V ERTEX C OVER—is the way in which we exploit the Gallai-Edmonds decomposition to find small structures—edges and vertices—on which we can branch profitably. While this part is almost trivial to implement, most of the technical effort in the paper has gone into proving that our choices are correct. See Algorithm 1 for an outline which highlights the new parts, and Algorithm 2 on page 9 for the complete algorithm. 2 Preliminaries We use ⊎ to denote the disjoint union of sets. All our graphs are undirected and simple. V (G) and E(G) denote, respectively, the vertex and edge sets of a graph G. G[X] is the subgraph of 3 Algorithm 1 An outline of the algorithm for V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: function VCAL-P((G, k̂)) Exhaustively apply the three reduction rules of Narayanaswamy et al. to (G, k̂). Let (G, k̂) denote the resulting graph on which no rule applies. if (G, k̂) is a trivial instance then return True or False as appropriate. Compute the Gallai-Edmonds decomposition V (G) = O ⊎ I ⊎ P of G. if G[I ∪ P ] contains at least one edge {u, v} then Branch on the edge {u, v}. k̂ drops by 1 on each branch. else ⊲ Now P = ∅. Branch on a vertex u ∈ O = V (G) and two of its neighbours v, w ∈ O: When we pick both of v, w into the solution in one branch, k̂ drops by 1. When we pick u into the solution in the other branch, k̂ may not drop. We find a suitable edge in G′ = (G \ u) and branch on its end-points to make k̂ drop. G induced by a vertex subset X ⊆ V (G): G[X] = (X, F ) ; F = {{v, w} ∈ E(G) ; v, w ∈ X}. M M (G) is the matching number of graph G, and OP T (G) is the vertex cover number of G. A matching M in graph G saturates each vertex which is an end-point of an edge in M , and exposes every other vertex in G. M is a perfect matching if it saturates all of V (G). M is a nearperfect matching if it saturates all but one vertex of V (G). Graph G is said to be factor-critical if for each v ∈ V (G) the induced subgraph G[(V (G) \ {v})] has a perfect matching. For X ⊆ V (G), N (X) is the set of neighbours of X which are not in X: N (X) = {v ∈ (V (G) \ X) ; ∃w ∈ X : {v, w} ∈ E(G)}. X ⊆ V (G) is an independent set in graph G if no edge in G has both its end-points in X. The surplus of an independent set X ⊆ V (G) is surplus(X) = (|N (X)| − |X|). The surplus of a graph G, surplus(G), is the minimum surplus over all independent sets in G. Graph G is a bipartite graph if V (G) can be partitioned as V (G) = X ⊎ Y such that every edge in G has exactly one end point in each of the sets X, Y . Hall’s Theorem tells us that a bipartite graph G = ((X ⊎ Y ), E) contains a matching which saturates all vertices of the set X if and only if ∀S ⊆ X : |N (S)| ≥ |S|. König’s Theorem tells us that for a bipartite graph G, OP T (G) = M M (G). The linear programming (LP) relaxation of the standard LP formulation for V ERTEX C OVER for a graph G (the relaxed V ERTEX C OVER LP for G for short), denoted LP V C(G), is: minimize X xv v∈V (G) subject to xu + xv ≥ 1 , {u, v} ∈ E 0 ≤ xv ≤ 1 , v ∈ V (G) A feasible solution to this LP is an assignment of values to the variables xv ; v ∈ V (G) which satisfies all the conditions in the LP, and an P optimum solution is a feasible solution which minimizes the value of the objective function v∈V (G) xv . We use w(x) to denote the value (of the objective function) of a feasible solution x to LP V C(G), and LP (G) to denote the value of an optimum solution to LP V C(G). OP T (G) and M M (G) are then the values of optimum solutions to the integer programs corresponding to LP V C(G) and to its LP dual, respectively [3]. It follows that for any graph G, M M (G) ≤ LP (G) ≤ OP T (G). Our stronger lower bound for OP T (G) is motivated by a similar bound due to Lovász and Plummer [17, Theorem 6.3.3]: Lemma 1. For any graph G, OP T (G) ≥ (2LP (G) − M M (G)). 4 Proof. Let S be a smallest vertex cover of graph G, and let H = ((S ⊎ (V (G) \ S)), F ) be the bipartite subgraph of G with F = {u, v} ∈ E(G) ; u ∈ S, v ∈ (V (G) \ S). That is, the vertex set of H is V (G) with the bipartition (S, (V (G) \ S)), and the edge set of H consists of exactly those edges of G which have one end-point in S and the other in (V (G)\S). Let T be a smallest vertex cover of graph H. Then |T | = OP T (H) = M M (H), where the second equality follows from König’s Theorem. Consider the following assignment y of values to variables yv ; v ∈ V (G): yv =   1 1 2  0 if v ∈ (S ∩ T ) if v ∈ ((S ∪ T ) \ (S ∩ T )) otherwise. Observe that 0 ≤ yv ≤ 1 for each v ∈ V (G). We claim that y is a feasible solution to LP V C(G). Indeed, since S is a vertex cover of G, every edge {u, v} ∈ E(G) must have at least one end-point in S. If {u, v} ∩ (S ∩ T ) 6= ∅ then y assigns the value 1 to at least one of yu , yv , and so we have that yu + yv ≥ 1. Otherwise, if {u, v} ⊆ (S \ (S ∩ T )) then y assigns the value 21 to both of yu , yv , and so we have that yu + yv = 1. In the only remaining case, exactly one of {u, v} is in S, and the other vertex is in (V (G) \ S). Without loss of generality, suppose {u, v} ∩ S = {u}, v ∈ (V (G) \ S). Then {u, v} ∈ E(H) and u ∈ / T , hence we get—since T is a vertex cover of H—that v ∈ T . Thus {u, v} ⊆ ((S ∪ T ) \ (S ∩ T )), and so y assigns the value 12 to both of yu , yv and we have that yu + yv = 1. Thus the assignment y satisfies all the conditions in the LP V C(G), and hence is a feasible solution to LP V C(G). Thus w(y) ≥ LP (G). Observe now that w(y) = |S| + |T | OP T (G) + OP T (H) OP T (G) + M M (H) OP T (G) + M M (G) = = ≤ , 2 2 2 2 where the first equality follows from the way we defined y, and the inequality follows from the observation that the matching number of the subgraph H of G cannot be larger than that of G M (G) , which in turn gives itself. Putting these together we get that LP (G) ≤ w(y) ≤ OP T (G)+M 2 the bound in the lemma. For any graph G there exists an optimum solution to LP V C(G) in which xv ∈ {0, 12 , 1} ; v ∈ V (G) [20]. Such an optimum solution is called a half-integral solution to LP V C(G), and we can find such a solution in polynomial time [21]. Whenever we refer to an optimum solution to LP V C(G) in the rest of the paper, we mean a half-integral solution. Given a half-integral solution x to LP V C(G), we define Vix = {v ∈ V (G) ; xv = i} for each i ∈ {0, 21 , 1}. For any optimal half-integral solution x we have that N (V0x ) = V1x . Given a graph G as input we can, in polynomial time, compute an optimum half-integral solution x to LP V C(G) such that for x ], setting all variables to the value 1 is the unique optimum the induced subgraph H = G[V1/2 2 solution to LP V C(H) [21]. Graphs which satisfy the latter property must have positive surplus, and conversely: Lemma 2. [23] For any graph G, all- 12 is the unique optimum solution to LP V C(G) if and only if surplus(G) > 0. In fact, the surplus of a graph G is a lower bound on the number of vertices that we can delete from G, and have a guaranteed drop of exactly 12 per deleted vertex in LP (G): Lemma 3. Let G be a graph with surplus(G) ≥ s. Then deleting any subset of s vertices from G results in a graph G′ such that LP (G′ ) = LP (G) − 2s . 5 Proof. The proof is by induction on s. Let n = |V (G)|. The case s = 0 is trivially true. Suppose s = 1. Then by Lemma 2 all- 21 is the unique optimum solution to LP V C(G), and so LP (G) = n2 . Let v ∈ V (G), and let G′ = G[V (G)\{v}]. Then |V (G′ | = (n−1). Since all- 21 is a feasible solution = LP (G) − 12 . If possible, let x′ be an optimum to LP V C(G′ ), we get that LP (G′ ) ≤ (n−1) 2 solution for LP V C(G′ ) such that w(x′ ) < (n−1) 2 . From the half-integrality property of relaxed V ERTEX C OVER LP formulations we get that w(x′ ) ≤ ( n2 − 1). Now we can assign the value 1 to vertex v and the values x′ to the remaining vertices of graph G, to get a solution x such that w(x) = n2 = LP (G). Thus x is an optimum solution to LP V C(G) which is not all- 21 , a contradiction. So we get that LP (G′ ) = LP (G) − 12 , proving the case s = 1. For the induction step, let s ≥ 2. Then by Lemma 2 all- 21 is the unique optimum solution to LP V C(G), and so LP (G) = n2 . Let v be an arbitrary vertex in G, and let G′ = G[V (G) \ {v}]. Since deleting a single vertex from G cannot cause the surplus of G to drop by more than 1, we get that surplus(G′ ) ≥ (s − 1) ≥ 1. So from Lemma 2 we get that LP (G′ ) = (n−1) 2 . Applying the induction hypothesis to G′ and s − 1, we get that deleting any subset of s − 1 vertices from G′ results in a graph G′′ such that LP (G′′ ) = LP (G′ ) − (s−1) = (n−1) − (s−1) = (n−s) 2 2 2 2 . This completes the induction step. There is a matching between the vertex sets which get the values 0 and 1 in an optimal half-integral solution to the LP. Lemma 4. Let G be a graph, and let x be an optimal half-integral solution to LP V C(G). Let H = ((V1x ⊎ V0x ), F ) be the bipartite subgraph of G where F = {u, v} ∈ E(G) ; u ∈ V1x , v ∈ V0x . Then there exists a (maximum) matching of H which saturates all of V1x . Proof. It is enough to show that for every X ⊆ V1x the inequality |N (X)| ≥ |X| holds in the graph H, and the rest will follow by Hall’s Theorem. So let there exist some X ⊆ V1x such that |N (X)| < |X| in H. Now consider a solution x∗ to LP V C(G) in which all the vertices of G have same values as in x, except that all vertices in X ∪ N (X) get the value 21 . It is not difficult < w(x), to verify that x∗ is a feasible solution to LP V C(G). Now w(x∗ ) = w(x) + |N (X)|−|X| 2 which is a contradiction since we assumed that x is a solution to LP V C(G) with the minimum value. The lemma follows. We make critical use of the classical Gallai-Edmonds decomposition of graphs. Definition 1 (Gallai-Edmonds decomposition). The Gallai-Edmonds decomposition of a graph G is a partition of its vertex set V (G) as V (G) = O ⊎ I ⊎ P where: • O = {v ∈ V (G) ; some maximum matching of G leaves v exposed} • I = N (O) • P = V (G) \ (I ∪ O) We now list a few of the many useful properties of Gallai-Edmonds decompositions. Theorem 2. [9, 11, 12, 17] The Gallai-Edmonds decomposition of a graph G is unique, and can be computed in polynomial time in the size of G. Let V (G) = O ⊎ I ⊎ P be the Gallai-Edmonds decomposition of G. Then the following hold: 1. Every component of the induced subgraph G[O] is factor-critical. 2. A matching M in graph G is a maximum matching of G if and only if: 6 (a) For each connected component H of the induced subgraph G[O], the edge set M ∩ E(H) forms a near perfect matching of H; (b) For each vertex i ∈ I there exists some vertex i ∈ O such that {i, o} ∈ M , and; (c) The edge set M ∩ E(G[P ]) forms a perfect matching of the induced subgraph G[P ]. 3. In particular: Any maximum matching M of G is a disjoint union of (i) a perfect matching of G[P ], (ii) near-perfect matchings of each component of G[O], and (iii) an edge from each vertex in I to a distinct component of G[O]. 4. The Stability Lemma: For a vertex v ∈ V (G) let G− v = G[V (G) \ v]. Let O(H), I(H), P (H) denote the three parts in the Gallai-Edmonds decomposition of a graph H. • Let v ∈ O. Then O(G − v) ⊆ (O \ {v}), I(G − v) ⊆ I, and P (G − v) ⊇ P . • Let v ∈ I. Then O(G − v) = O, I(G − v) = (I \ {v}), and P (G − v) = P . • Let v ∈ P . Then O(G − v) ⊇ O, I(G − v) ⊇ I, and P (G − v) ⊆ (P \ {v}). Corollary 2. Let V (G) = O ⊎ I ⊎ P be the Gallai-Edmonds decomposition of graph G. Then the following hold: 1. If I ∪ P is an independent set in G, then P = ∅. 2. Let v, w ∈ O be two vertices which are part of the same connected component of the induced subgraph G[O], and let G′ = G[(V (G) \ {v, w})]. Then M M (G′ ) ≤ (M M (G) − 1). Proof. We prove each statement. 1. From the assumption, G[P ] contains no edges. By Theorem 2, G[P ] has a perfect matching. Both of these can hold simultaneously only when P = ∅. 2. Let C be the connected component of G[O] which contains both v and w. From part (3) of Theorem 2 we get that any maximum matching of graph G which exposes vertex v contains a perfect matching of the subgraph C ′′ = C[(V (C) \ {v})]. Therefore, every maximum matching of G which survives in G′′ = G[(V (G) \ {v})] contains a perfect matching of C ′′ . It follows that if we delete w ∈ V (C ′′ ) as well from G′′ to get G′ , then the matching number reduces by at least one, since no perfect matching of C ′′ can survive the deletion of vertex w ∈ V (C ′′ ). When the set I ∪ P is independent in a graph of surplus at least 2, we get more properties for the set O: Lemma 5. Let G be a graph with surplus(G) ≥ 2, and let V (G) = O ⊎ I ⊎ P be the GallaiEdmonds decomposition of graph G. If I ∪ P is an independent set in G, then: 1. There is at least one vertex o ∈ O which has at least two neighbours in the set O. 2. Let v ∈ O be a neighbour of some vertex o ∈ O. Let G′ = G[(V (G) \ {o})], and let V (G′ ) = O ′ ⊎ I ′ ⊎ P ′ be the Gallai-Edmonds decomposition of graph G′ . Then the induced subgraph G′ [P ′ ] contains at least one edge. Proof. We prove each statement. 7 1. Each component of G[O] is factor critical (Theorem 2), and so has an odd number of vertices. So to prove this part it is enough to show that there is at least one component in G[O] which has at least two (and hence, at least three) vertices. Suppose to the contrary that each component in G[O] has exactly one vertex. Then the set O is an independent set in graph G. Since the set I ∪ P is independent by assumption, we get from Corollary 2 that P = ∅. Thus G is a bipartite graph with O and I being two parts of the bipartition. In particular, N (O) ⊆ I and N (I) ⊆ O both hold. But since surplus(G) ≥ 2 this implies that both |I| ≥ (|O| + 2) and |O| ≥ (|I| + 2) hold simultaneously, which cannot happen. The claim follows. 2. Observe that by the definition of the set O, we have that M M (G′ ) = M M (G). If G′ [P ′ ] contains no edge, then the fact that G[P ′ ] has a perfect matching (Theorem 2) implies that P ′ = ∅. Together with the Stability Lemma (see Theorem 2) this implies that v ∈ O′ in graph G′ . Then by the definition of the set O ′ there is a maximum matching M M ′ of G′ which exposes the vertex v. But then the matching M M ′ together with the edge {o, v} forms a matching in graph G of size M M (G′ ) + 1 = M M (G) + 1, a contradiction. Therefore G′ [P ′ ] must contain at least one edge. 3 The Algorithm In this section we describe our algorithm which solves V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER in O⋆ (3k̂ ) time. We start with an overview of the algorithm. We then state the reduction and branching rules which we use, and prove their correctness. We conclude the section by proving that the algorithm correctly solves V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER and that it runs within the stated running time. 3.1 Overview The V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER problem can be stated as: V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER (VCAL-P) Input: A graph G and k̂ ∈ N. Question: Let k = (2LP (G) − M M (G)) + k̂. Is OP T (G) ≤ k? Parameter: k̂ At its core the algorithm is a simple branching algorithm. Indeed, we employ only two basic branching steps which are both “natural” for V ERTEX C OVER: We either branch on the two endpoints of an edge, or on a vertex v and a pair u, w of its neighbours. We set k̂ as the measure for analyzing the running time of the algorithm. We ensure that this measure decreases by 1 in each branch of a branching step in the algorithm. Since OP T (G) ≥ (2LP (G) − M M (G)) for every graph G—See Lemma 1—and k ≥ OP T (G) holds—by definition—for a Y ES instance, it follows that k̂ = (k + M M (G) − 2LP (G)) is never negative for a Y ES instance. Hence we can safely terminate the branching at depth k̂. Since the worst-case branching factor is three, we get that the algorithm solves VCAL-P in time O⋆ (3k̂ ). The algorithm—see Algorithm 2 on page 9—modifies the input graph G in various ways as it runs. In our description of the algorithm we will sometimes, for the sake of brevity, slightly abuse the notation and use G to refer to the “current” graph at each point in the algorithm. Since the intended meaning will be clear from the context, this should not cause any confusion. 8 Algorithm 2 The O⋆ (3k̂ ) FPT algorithm for V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER . 1: 2: 3: 4: 5: 6: 7: 8: function VCAL-P((G, k̂, reduce)) ⊲ Initially invoked with reduce == T rue. k ← (2LP (G) − M M (G)) + k̂ if reduce == T rue then ⊲ Do the preprocessing only if reduce is True. while At least one of Reduction Rules 1, 2, and 3 applies to (G, k) do Apply the first such rule to (G, k), to get (G′ , k′ ). G ← G′ , k ← k′ G ← G′ , k ← k′ k̂ ← k + M M (G) − 2LP (G) ⊲ Renaming for brevity ⊲ Preprocessing ends. ⊲ Check for the base cases. 11: 12: if k̂ < 0 then return False else if G has no vertices then return True 13: Compute the Gallai-Edmonds decomposition V (G) = O ⊎ I ⊎ P of G. 14: 17: 18: if G[I ∪ P ] contains at least one edge {u, v} then ⊲ Branch on edge {u, v}. G1 ← (G \ u), G2 ← (G \ v) k ← (k − 1) k̂1 = (k + M M (G1 ) − 2LP (G1 )), k̂2 = (k + M M (G2 ) − 2LP (G2 )) return (VCAL-P(G1 , k̂1 , T rue) ∨ VCAL-P(G2 , k̂2 , T rue)) 19: else 9: 10: 15: 16: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: ⊲ Since I ∪ P is independent, P = ∅. Choose a vertex u ∈ O and two of its neighbours v, w ∈ O. ⊲ Such vertices must exist. G1 ← (G \ u) ⊲ Pick u in the solution. k ← (k − 1) k̂1 = (k + M M (G1 ) − 2LP (G1 )), if VCAL-P(G1 , k̂1 , F alse)==True then ⊲ No reduction rule will be applied now. return True else ⊲ Pick both v and w in the solution. G2 ← (G \ {v, w}) k ← (k − 1) ⊲ Effectively reducing k by two. k̂2 = (k + M M (G2 ) − 2LP (G2 )) return VCAL-P(G2 , k̂2 , T rue) The crux of the algorithm is the manner in which it finds in G a small structure—such as an edge—on which to branch such that the measure k̂ drops on each branch. Clearly, picking an arbitrary edge—say—and branching on its end-points will not suffice: this will certainly reduce the budget k by one on each branch, but we will have no guarantees on how the values M M (G) and LP (G) change, and so we cannot be sure that k̂ drops. Instead, we apply a two-pronged strategy to find a small structure in the graph which gives us enough control over how the values k, M M (G), LP (G) change, in such a way as to ensure that k̂ = (k + M M (G) − 2LP (G)) drops in each branch. 9 First, we employ a set of three reduction rules which give us control over how LP (G) changes when we pick a vertex into the solution and delete it from G. These rules have the following nice properties: • Each rule is sound—see subsection 3.2—and can be applied in polynomial time; • Applying any of these rules does not increase the measure k̂, and; • If none of these rules applies to G, then we can delete up to two vertices from G with an assured drop of 0.5 per deleted vertex in the value of LP (G). In this we follow the approach of Narayanaswamy et al. [19] who came up with this strategy to find a small structure on which to branch so that their measure—which was (k − LP )—would reduce on each branch. Indeed, we reuse three of their reduction rules, after proving that these rules do not increase our measure k̂. While these rules give us control over how LP (G) changes when we delete a vertex, they do not give us such control over M M (G). That is: let G be a graph to which none of these rules applies and let v be a vertex of G. Picking v into a solution and deleting it from G to get G′ would (i) reduce k by 1, and (ii) make LP (G′ ) = LP (G) − 0.5, but will not result in a drop in k̂ if it so happens that the matching number of G′ is the same as that of G. Thus for our approach to succeed we need to be able to consistently find, in a graph reduced with respect to the reduction rules, a small structure—say, an edge—on which to branch, such that deleting a small set of vertices from this structure would reduce the matching number of the graph by at least 1. The search for such a structure led us to the second and novel part of our approach, namely the use of the classical Gallai-Edmonds decomposition of graphs (Definition 1). We found that by first reducing the input graph with respect to the three reduction rules and then carefully choosing edges to branch based on the Gallai-Edmonds decomposition of the resulting graph, we could make the measure k̂ drop on every branch. We describe the reduction and branching rules in the next two subsections. 3.2 The Reduction Rules Given an instance (G, k̂) of V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER our algorithm first computes the number k = (2LP (G) − M M (G) + k̂) so that (G, k) is the equivalent instance of (classical) V ERTEX C OVER. Each of our three reduction rules takes an instance (G = (V, E), k) of V ERTEX C OVER, runs in polynomial time, and outputs an instance (G′ = (V ′ , E ′ ), k′ ) of V ER TEX C OVER. We say that a reduction rule is sound if it always outputs an equivalent instance. That is, if it is always the case that G has a vertex cover of size at most k if and only if G′ has a vertex cover of size at most k′ . We say that a reduction rule is safe if it never increases the measure k̂. That is, if it is always the case that k′ +M M (G′ )−2LP (G′ ) ≤ k+M M (G)−2LP (G). In the algorithm we apply these reduction rules exhaustively, in the order they are presented. That is, we take the input instance (G, k) and apply the first among Reduction Rule 1, Reduction Rule 2, and Reduction Rule 3 which applies—see definitions below—to (G, k) to obtain a modified instance (G′ , k′ ). We now set G ← G′ , k ← k′ and repeat this procedure, till none of the rules applies to the instance (G, k). We say that such an instance is reduced with respect to our reduction rules. The point of these reduction rules is that they help us push the surplus of the input graph to at least 2 in polynomial time, while not increasing the measure k̂. Reduction Rule 1. Compute an optimal solution x to LPVC(G) such that all- 21 is the unique x ]). Set G′ = G[V x ], k ′ = k − |V x |. optimum solution to LPVC(G[V1/2 1 1/2 10 Reduction Rule 1 applies to (G, k) if and only if all- 21 is not the unique solution to LPVC(G). Reduction Rule 2. If there is an independent set Z ⊆ V (G) such that surplus(Z) = 1 and N (Z) is not an independent set in G, then set G′ = G \ (Z ∪ N (Z)), k′ = k − |N (Z)|. Reduction Rule 2 applies to (G, k) if and only if (i) Reduction Rule 1 does not apply, and (ii) G has a vertex subset Z with the properties stated in Reduction Rule 2. Reduction Rule 3. If there is an independent set Z ⊆ V (G) such that surplus(Z) = 1 and N (Z) is an independent set in G, then remove Z from G and identify the vertices of N (Z)— that is, delete all of N (Z), add a new vertex z, and make z adjacent to all vertices of the set (N (N (Z)) \ Z)—to get G′ , and set k′ = k − |Z|. Reduction Rule 3 applies to (G, k) if and only if (i) neither of the previous rules applies, and (ii) G has a vertex subset Z with the properties stated in Reduction Rule 3. All our reduction rules are due to Narayanaswamy et al. [19, Preprocessing Rules 1 and 2]. The soundness of these rules and their running-time bounds also follow directly from their work. We need to argue, however, that these rules are safe for our measure k̂. Lemma 6. [19] All the three reduction rules are sound, and each can be applied in time polynomial in the size of the input (G, k). It remains to show that none of these reduction rules increases the measure k̂ = k + M M (G) − 2LP (G). That is, let (G = (V, E), k) be an instance of V ERTEX C OVER to which one of these rules applies, and let (G′ = (V ′ , E ′ ), k′ ) be the instance obtained by applying the rule to (G, k). Then we have to show, for each rule, that k̂′ = k′ + M M (G′ ) − 2LP (G′ ) ≤ k̂ holds. We establish this by examining how each rule changes the values k, M M and LP . In each case, let x be an optimum half-integral solution to LP V C(G) such that all- 21 is the unique x ]), and let LP (G) be the (optimum) value of this solution. optimum solution to LP V C(G[V1/2 Also, let x′ be an optimum half-integral solution to LP V C(G′ ), and let LP (G′ ) be the value of this solution. Lemma 7. Reduction Rule 1 is safe. Proof. From the definition of the rule we get that k′ = k − |V1x |. Now since x′ ≡ 21 is the unique x ], we get that LP (G′ ) = LP (G) − |V x |, and optimum solution to LP V C(G′ ), and G′ = G[V1/2 1 ′ x hence that 2LP (G ) = 2LP (G) − 2|V1 |. From Lemma 4 and the construction of the graph G′ we get that M M (G) ≥ M M (G′ ) + |V1x |, and hence that M M (G′ ) ≤ M M (G) − |V1x |. Putting these together, we get that k̂′ ≤ k̂. Lemma 8. Reduction Rule 2 is safe. Proof. From the definition of the rule we get that k′ = k − |N (Z)|. We bound the other two quantities. Claim 1. LP (G′ ) ≥ LP (G) − |N (Z)| + 21 . Proof of the claim. Since Reduction Rule 1 did not apply to (G, k) we know that all- 21 is the unique optimum solution to LP V C(G). It follows from this and the construction of graph P 1 1 x′ x′ ′ ′ ′ G that LP (G ) = u∈V ′ x (u) = LP (G) − 2 (|Z| + |N (Z)|) + 2 (|V1 | − |V0 |). Adding and ′ ′ subtracting 12 (|N (Z)|), we get LP (G′ ) = LP (G) − |N (Z)| + 21 (|N (Z)| − |Z|) + 21 (|V1x | − |V0x |) = ′ ′ LP (G) − |N (Z)| + 21 (|N (Z)| + |V1x |) − 21 (|Z| + |V0x |). Now since V (G′ ) = (V (G) \ (Z ∪ N (Z))) ′ ′ ′ and V0x ⊆ V (G′ ), we get that Z ∪ V0x is an independent set in G, and that N (Z ∪ V0x ) = 11 ′ N (Z) ∪ V1x in G (Recall that N (V0x ) = V1x for any half-integral optimal solution x.). Since ′ ′ surplus(G) ≥ 1—Lemma 2—we get that in G, |N (Z ∪ V0x )| − |Z ∪ V0x | ≥ 1, which gives ′ ′ ′ ′ (|N (Z)| + |V1x |) − (|Z| + |V0x |) ≥ 1, and so we get that 12 (|N (Z)| + |V1x |) − 12 (|Z| + |V0x |) ≥ 12 . Substituting this in the equation for LP (G′ ), we get that LP (G′ ) ≥ LP (G) − |N (Z)| + 12 . Now we bound the drop in M M (G). Claim 2. M M (G′ ) ≤ M M (G) − |Z|. Proof of the claim. Consider the bipartite graph Ĝ obtained from the induced subgraph G[Z ∪ N (Z)] of G by deleting every edge which has both endpoints in N (Z). Observe that since surplus(Z) = 1 in G, we get that |N (X)| ≥ |X| + 1 ∀X ⊆ Z, both in G and in Ĝ. Hence by Hall’s Theorem we get that Ĝ contains a matching saturating Z, and hence that M M (Ĝ) = |Z|. But from the construction of graph G′ we get that M M (G) ≥ M M (G′ ) + M M (Ĝ). Substituting for M M (Ĝ), we get that M M (G′ ) ≤ M M (G) − |Z|. Putting all these together, we get that k̂′ = k′ + M M (G′ ) − 2LP (G′ ) ≤ (k − |N (Z)|) + (M M (G) − |Z|) − 2(LP (G) − |N (Z)| + 21 ) = k + M M (G) − 2LP (G) + (|N (Z)| − |Z| − 1) = k + M M (G)−2LP (G) = k̂, where the last-but-one equality follows from the fact that surplus(Z) = 1. Thus we have that k̂′ ≤ k̂. Lemma 9. Reduction Rule 3 is safe. Proof. From the definition of the rule we get that k′ = k − |Z|. We bound the other quantities. Let z be the vertex in G′ which results from identifying the vertices of N (Z) as stipulated by the reduction rule. Claim 3. LP (G′ ) ≥ LP (G) − |Z|. Proof of the claim. Suppose not. Then we get—from the half-integrality property of the relaxed LP for V ERTEX C OVER—that LP (G′ ) ≤ LP (G) − |Z| − 12 . We show that this inequality leads to a contradiction. We consider three cases based on the value of x′ (z), which must be one of {0, 12 , 1}. Recall that surplus(Z) = 1 and so |N (Z)| = |Z| + 1. Case 1: x′ (z) = 1. Consider a function x′′ : V → {0, 12 , 1} defined as follows. For every vertex v in V ′ \ {z}, x′′ retains the value assigned by x′ ; that is, x′′ (v) = x′ (v). For every vertex v in the set N (Z), set x′′ (v) = 1 and for every vertex v in the set Z, x′′ (v) = 0. It is not difficult to check that x′′ is a feasible solution to the relaxed V ERTEX C OVER LP for G. But now the value of this solution, w(x′′ ) = LP (G′ ) − x′ (z) + |N (Z)| = LP (G′ ) − 1 + (|Z| + 1) ≤ LP (G)− 21 . Thus x′′ is a feasible solution for G whose value is less than that of the optimal solution, a contradiction. Case 2: x′ (z) = 0. Now consider the following function x′′ : V → {0, 12 , 1}. For every vertex v in V ′ \ {z}, x′′ retains the value assigned by x′ : x′′ (v) = x′ (v). For every vertex v ∈ Z set x′′ (v) = 1 and for every vertex v ∈ N (Z), set x′′ (v) = 0. It is again not difficult to check that x′′ is a feasible solution to the relaxed V ERTEX C OVER LP for G. And the value of this solution, w(x′′ ) = LP (G′ ) + |Z| ≤ LP (G) − 21 , again a contradiction. Case 3: x′ (z) = 12 . Consider again a function x′′ : V → {0, 12 , 1}, defined as follows. For every vertex v in V ′ \ {z}, x′′ —once again—retains the value assigned by x′ : x′′ (v) = x′ (v). For every vertex v ∈ (Z ∪ N (Z)), set x′′ (v) = 21 . This is once again easily verified to be a feasible solution to the relaxed V ERTEX C OVER LP for G, and its value is w(x′′ ) = LP (G′ ) − x′ (z) + 21 (|Z| + |N (Z)|) = LP (G′ ) − 21 + 12 (|Z| + |Z| + 1) ≤ LP (G) − 21 , once again a contradiction. 12 Thus our contrary assumption leads to a contradiction in all possible cases, and this proves the claim. Now we bound the drop in M M (G). Claim 4. M M (G′ ) ≤ M M (G) − |Z|. Proof. For an arbitrary vertex u ∈ N (Z), let Gu be the bipartite subgraph G[Z ∪ (N (Z) \ {u})], which is an induced subgraph of G. Since surplus(Z) = 1 in G and only one vertex from N (Z) is missing in Gu , we get that |N (X)| ≥ |X| ∀X ⊆ Z holds in Gu . Hence by Hall’s Theorem we get that Gu contains a matching saturating Z, and hence that M M (Gu ) = |Z|. Now consider a maximum matching M M ′ of G′ . Starting with M M ′ we can construct a matching M M ′′ of size |M M ′ | in the original graph G which saturates at most one vertex of N (Z) and none of Z, as follows: There is at most one edge in M M ′ which saturates the vertex z. If there is no edge in M M ′ which saturates the vertex z, then we set M M ′′ = M M ′ . It is not difficult to see that M M ′′ saturates no vertex in Z ∪ N (Z). If there is an edge {z, v} ∈ M M ′ , then we pick an arbitrary vertex u ∈ N (Z) such that {u, v} is an edge in G—such a vertex must exist since the edge {z, v} exists in G′ . We set M M ′′ = (M M ′ \ {{z, v}}) ∪ {{u, v}}. It is not difficult to see that M M ′′ is a matching in G which saturates exactly one vertex—u ∈ N (Z)—in Z ∪ N (Z). If the matching M M ′′ , constructed as above, does not saturate any vertex of N (Z), then we choose u to be an arbitrary vertex of N (Z). If M M ′′ does saturate a vertex of N (Z), then we set u to be that vertex. In either case, the union of M M ′′ and any maximum matching of the induced bipartite subgraph Gu is itself a matching of G, of size M M (Gu ) + M M (G′ ) = |Z| + M M (G′ ). It follows that M M (G) ≥ |Z| + M M (G′ ), which implies M M (G′ ) ≤ M M (G) − |Z|. Putting all these together, we get that k̂′ = k′ +M M (G′ )−2LP (G′ ) ≤ (k −|Z|)+(M M (G)− |Z|) − 2(LP (G) − |Z|) = k + M M (G) − 2LP (G) = k̂. Thus we have that k̂′ ≤ k̂. Observe that if surplus(G) = 1 then at least one of Reduction Rule 2 and Reduction Rule 3 necessarily applies. From this and Lemma 2 we get the following useful property of graphs on which none of these rules applies. Lemma 10. None of the three reduction rules applies to an instance (G, k) of V ERTEX C OVER if and only if surplus(G) ≥ 2. Summarizing the results of this section, we have: Lemma 11. Given an instance (G, k̂) of V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER we can, in time polynomial in the size of the input, compute an instance (G′ , k̂′ ) such that: 1. The two instances are equivalent: G has a vertex cover of size at most (2LP (G)−M M (G))+k̂ if and only if G′ has a vertex cover of size at most (2LP (G′ ) − M M (G′ )) + k̂′ ; 2. k̂′ ≤ k̂, and surplus(G′ ) ≥ 2. 3.3 The Branching Rules Let (G = (V, E), k) be the instance of V ERTEX C OVER obtained after exhaustively applying the reduction rules to the input instance, and let k̂ = k + M M (G) − 2LP (G). Then surplus(G) ≥ 2. If k̂ < 0 then the instance (G, k̂) of VCAL-P is trivially a N O instance (See subsection 3.1), 13 and we return N O and stop. In the remaining case k̂ ≥ 0, and we apply one of two branching rules to the instance to reduce the measure k̂. Each of our branching rules takes an instance (G, k̂) of VCAL-P, runs in polynomial time, and outputs either two or three instances (G1 , k̂1 ), (G2 , k̂2 )[, (G3 , k̂3 )] of VCAL-P. The algorithm then recurses on each of these instances in turn. We say that a branching rule is sound if the following holds: (G, k̂) is a Y ES instance of VCAL-P if and only if at least one of the (two or three) instances output by the rule is a YES instance of VCAL-P. We now present the branching rules, prove that they are sound, and show that the measure k̂ drops by at least 1 on each branch of each rule. Before starting with the branching, we compute the Gallai-Edmonds decomposition of the graph G = (V, E). This can be done in polynomial time [17] and yields a partition of the vertex set V into three parts V = O ⊎ I ⊎ P , one or more of which may be empty—see Definition 1. We then branch on edges in the graph which are carefully chosen with respect to this partition. Branching Rule 1 applies to the graph G if and only if the induced subgraph (G[I ∪ P ]) contains at least one edge. Branching Rule 1. Branch on the two end-points of an edge {u, v} in the induced subgraph (G[I ∪ P ]). More precisely, the two branches generate two instances as follows: Branch 1: G1 ← (G \ {u}), k1 ← (k − 1), kˆ1 ← k1 + M M (G1 ) − 2LP (G1 ) Branch 2: G2 ← (G \ {v}), k2 ← (k − 1), kˆ2 ← k2 + M M (G2 ) − 2LP (G2 ) This rule outputs the two instances (G1 , k̂1 ) and (G2 , k̂2 ). Branching Rule 2 applies to graph G if and only if Branching Rule 1 does not apply to G. Branching Rule 2. Pick a vertex u ∈ O of G which has at least two neighbours v, w ∈ O. Construct the graph G′ = G \ {u} and compute its Gallai-Edmonds decomposition O ′ ⊎ I ′ ⊎ P ′ . Pick an edge {x, y} in G′ [P ′ ]. The three branches of this branching rule generates three instances as follows: Branch 1: G1 ← (G \ {v, w}), k1 ← (k − 2), kˆ1 ← k1 + M M (G1 ) − 2LP (G1 ) Branch 2: G2 ← (G′ \ {x}), k2 ← (k − 2), kˆ2 ← k2 + M M (G2 ) − 2LP (G2 ) Branch 3: G3 ← (G′ \ {y}), k3 ← (k − 2), kˆ3 ← k3 + M M (G3 ) − 2LP (G3 ) This rule outputs the three instances (G1 , k̂1 ), (G2 , k̂2 ), and (G3 , k̂3 ). Note that in the pseudocode of Algorithm 2 we have not, for the sake of brevity, written out the three branches of the second rule. Instead, we have used a boolean switch (reduce) as a third argument to the procedure to simulate this behaviour. Lemma 12. Both branching rules are sound, and each can be applied in time polynomial in the size of the input (G, k). Proof. We first prove that the rules can be applied in polynomial time. Recall that we can compute the Gallai-Edmonds decomposition of graph G in polynomial time [17]. Branching Rule 1: Follows more or less directly from the definition of the branching rule. Branching Rule 2: It is not difficult to see that the applicability of this rule can be checked in polynomial time. If the rule does apply, then the set P is empty and the set I is an independent set in G (Corollary 2). By Lemma 5, there is at least one vertex in the set O which has at least two neighbours in O. Hence vertices u, v, w of the kind required in the rule necessarily exist in G. From Lemma 5 we also get that an edge {x, y} of the required kind also exists. Given the existence of these, it is not difficult to see that the rule can be applied in polynomial time. 14 We now show that the rules are sound. Recall that a branching rule is sound if the following holds: any instance (G, k̂) of VCAL-P is a Y ES instance if and only if at least one of the instances obtained by applying the rule to (G, k̂) is a Y ES instance. Branching Rule 1: The soundness of this rule is not difficult to see since it is a straightforward branching on the two end-points of an edge. Nevertheless, we include a full argument for the sake of completeness. So let (G, k̂) be a Y ES instance of VCAL-P, and let (G1 , kˆ1 ), (G2 , kˆ2 ) be the two instances obtained by applying Branching Rule 1 to (G, k̂). Since (G, k̂) is a Y ES instance, the graph G has a vertex cover, say S, of size at most k = 2LP (G) − M M (G) + k̂. Then (S ∩ {u, v}) 6= ∅. Suppose u ∈ S. Then S1 = S \ {u}) is a vertex cover of the graph G1 = G \ {u}, of size at most k1 = (k − 1). It follows that for kˆ1 = k1 + M M (G1 ) − 2LP (G1 ), (G1 , kˆ1 ) is a Y ES instance of VCAL-P. A symmetric argument gives us the Y ES instance (G2 , kˆ2 ) of VCAL-P for the case v ∈ S. Conversely, suppose (G1 , kˆ1 ) is a Y ES instance of VCAL-P where G1 = G \ {u}, k1 = (k − 1), kˆ1 = k1 + M M (G1 ) − 2LP (G1 ). Then graph G1 has a vertex cover, say S1 , of size at most k1 = (k − 1). S = S1 ∪ {u} is then a vertex cover of graph G of size at most k, and so (G, k̂), where k̂ = k + M M (G) − 2LP (G) is a Y ES instance of VCAL-P as well. An essentially identical argument works for the case when (G2 , kˆ2 ) is a Y ES instance of VCAL-P. Branching Rule 2: It is not difficult to see that this rule is sound, either, since it consists of exhaustive branching on a vertex u. We include the arguments for completeness. So let (G, k̂) be a Y ES instance of VCAL-P, and let (G1 , kˆ1 ), (G2 , kˆ2 ), (G2 , kˆ2 ) be the three instances obtained by applying Branching Rule 2 to (G, k̂). Since (G, k̂) is a Y ES instance, the graph G has a vertex cover, say S, of size at most k = 2LP (G) − M M (G) + k̂. We consider two cases: u ∈ S, and u ∈ / S. First consider the case u ∈ / S. Then all the neighbours of u must be in S. In particular, {v, w} ⊆ S. It follows that the set S \ {v, w} is a vertex cover of the graph G1 = (G \ {v, w}), of size at most k1 = (k − 2). Hence we get that for kˆ1 = k1 + M M (G1 ) − 2LP (G1 ), (G1 , kˆ1 ) is a Y ES instance of VCAL-P. Now consider the case u ∈ S. Then the set S ′ = S \ {u} is a vertex cover of the graph G′ = G \ {u}, of size at most k − 1. Since {x, y} is an edge in the graph G′ , we get that (S ′ ∩ {x, y}) 6= ∅. Suppose x ∈ S ′ . Then S2 = (S ′ \ {x}) is a vertex cover of the graph G2 = G′ \{x}, of size at most k2 = (k−2). It follows that for kˆ2 = k2 +M M (G2 )−2LP (G2 ), (G2 , kˆ2 ) is a Y ES instance of VCAL-P. A symmetric argument gives us the Y ES instance (G3 , kˆ3 ) of VCAL-P for the case y ∈ S. Conversely, suppose (G1 , kˆ1 ) is a Y ES instance of VCAL-P where G1 = G \ {v, w}, k1 = (k − 2), kˆ1 = k1 + M M (G1 ) − 2LP (G1 ). Then graph G1 has a vertex cover, say S1 , of size at most k1 = (k − 2). S = S1 ∪ {v, w} is then a vertex cover of graph G of size at most k, and so (G, k̂) where k̂ = k + M M (G) − 2LP (G), is a Y ES instance of VCAL-P as well. Essentially identical arguments work for the cases when (G2 , kˆ2 ) or (G3 , kˆ3 ) is a Y ES instance of VCAL-P. Our choice of vertices on which we branch ensures that the measure drops by at least one on each branch of the algorithm. Lemma 13. Let (G, k̂) be an input given to one of the branching rules, and let (Gi , k̂i ) be an instance output by the rule. Then k̂i ≤ (k̂ − 1). 15 Proof. Recall that by definition, k̂ = k + M M (G) − 2LP (G). We consider each branching rule. We reuse the notation from the description of each rule. Branching Rule 1: Consider Branch 1. Since u ∈ (I ∪ P ), every maximum matching of graph G saturates vertex u (Theorem 2). Hence we get that M M (G1 ) = (M M (G) − 1). Since surplus(G) ≥ 2 we get—from Lemma 3—that LP (G1 ) = (LP (G) − 21 ). And since k1 = (k−1) by definition, we get that k̂1 = k1 +M M (G1 )−2LP (G1 ) = (k−1)+(M M (G)−1)− 2(LP (G) − 12 ) = k + M M (G) − 2LP (G) − 1 = (k̂ − 1). An essentially identical argument applied to the (symmetrical) Branch 2 tells us that k̂2 = (k̂ − 1). Branching Rule 2: Consider Branch 1. Since {u, v, w} ⊆ O and v, w are neighbours of vertex u, we get that vertices v and w belong to the same connected component of the induced subgraph G[O] of G. It follows (Corollary 2) that M M (G1 ) ≤ (M M (G) − 1). Since surplus(G) ≥ 2 and G1 = G \ {v, w} we get—from Lemma 3—that LP (G1 ) = (LP (G) − 1). And since k1 = (k − 2) by definition, we get that k̂1 = k1 + M M (G1 ) − 2LP (G1 ) ≤ (k − 2) + (M M (G) − 1) − 2(LP (G) − 1) = k + M M (G) − 2LP (G) − 1 = (k̂ − 1). Now consider Branch 2. Since u ∈ O we get—from the definition of the Gallai-Edmonds decomposition—that M M (G′ ) = M M (G). Now since x ∈ P ′ we get— Theorem 2—that M M (G2 ) = (M M (G′ ) − 1) = (M M (G) − 1). Since surplus(G) ≥ 2 and G2 = G \ {u, x} we get—from Lemma 3—that LP (G2 ) = (LP (G)−1). And since k2 = (k−2) by definition, we get that k̂2 = k2 + M M (G2 ) − 2LP (G2 ) = (k − 2) + (M M (G) − 1) − 2(LP (G) − 1) = k + M M (G) − 2LP (G) − 1 = (k̂ − 1). An essentially identical argument applied to the (symmetrical) Branch 3 tells us that k̂3 = (k̂ − 1). 3.4 Putting it All Together: Correctness and Running Time Analysis The correctness of our algorithm and the claimed bound on its running time follow more or less directly from the above discussion. Proof of Theorem 1. We claim that Algorithm 2 solves V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER in O⋆ (3k̂ ) time. The correctness of the algorithm follows from the fact that both the reduction rules and the branching rules are sound—Lemma 6 and Lemma 12. This means that (i) no reduction rule ever converts a Y ES instance into a N O instance or vice versa, and (ii) each branching rule outputs at least one Y ES instance when given a Y ES instance as output, and all N O instances when given a N O instance as input. It follows that if the algorithm outputs Y ES or N O, then the input instance must also have been Y ES or N O, respectively. The running time bound follows from three factors. Firstly, all the reduction rules are safe, and so they never increase the measure k̂—see Lemma 7, Lemma 8, Lemma 9, and Lemma 11. Also, each reduction rule can be executed in polynomial time, and since each reduction rule reduces the number of vertices in the graph by at least one, they can be exhaustively applied in polynomial time. Secondly, each branch of each branching rule reduces the measure by at least 1—Lemma 13—from which we get that each path from the root of the recursion tree—where the measure is the original value of k̂—to a leaf—where the measure first becomes zero or less— has length at most k̂. Further, the largest branching factor is 3, which means that the number of nodes in the recursion tree is O(3k̂ ). Thirdly, we know that the computation at each node in the recursion tree takes polynomial time. This follows from Lemma 12 for the nodes where we do branching. As for the leaf nodes: Since we know that the measure will never be negative for a Y ES instance (Lemma 1), since we can check for the applicability of each branching rule 16 in polynomial time, and since each branching rule reduces the measure by at least one, we can solve the instance at each leaf node in polynomial time. 4 Conclusion Motivated by an observation of Lovász and Plummer, we derived the new lower bound 2LP (G)− M M (G) for the vertex cover number of a graph G. This bound is at least as large as the bounds M M (G) and LP (G) which have hitherto been used as lower bounds for investigating above-guarantee parameterizations of V ERTEX C OVER. We took up the parameterization of the V ERTEX C OVER problem above our “higher” lower bound 2LP (G) − M M (G), which we call the Lovász-Plummer lower bound for V ERTEX C OVER. We showed that V ERTEX C OVER remains fixed-paramter tractable even when parameterized above the Lovász-Plummer bound. The main result of this work is an O⋆ (3k̂ ) algorithm for V ERTEX C OVER A BOVE L OV ÁSZ -P LUMMER. The presence of both (−2LP (G)) and M M (G)—in addition to the “solution size”—in our measure made it challenging to find structures on which to branch; we had to be able to control each of these values and their interplay in order to ensure a drop in the measure at each branch. The main new idea which we employed for overcoming this hurdle is the use of the Gallai-Edmonds decomposition of graphs for finding structures on which to branch profitably. The main technical effort in this work has been expended in proving that our choice of vertices/edges from the Gallai-Edmonds decomposition actually work in the way we want. Note, however, that the branching rules themselves are very simple; it is only the analysis which is involved. The most immediate open problem is whether we can improve on the base 3 of the FPT running time. Note that any such improvement directly implies FPT algorithms of the same running time for A BOVE -G UARANTEE V ERTEX C OVER and V ERTEX C OVER A BOVE LP. Tempted by this implication, we have tried to bring this number down but, so far, in vain. Another question which suggests itself is: Is this the best lower bound for vertex cover number above which V ERTEX C OVER is FPT? How far can we push the lower bound before the problem becomes intractable? 17 References [1] R. Balasubramanian, Michael R. Fellows, and Venkatesh Raman. An improved fixed-parameter algorithm for vertex cover. Information Processing Letters, 65(3):163–168, 1998. [2] Béla Bollobás. Random Graphs. Cambridge University Press, second edition, 2001. [3] Jean-Marie Bourjolly and William R Pulleyblank. König-egerváry graphs, 2-bicritical graphs and fractional matchings. Discrete Applied Mathematics, 24(1):63–82, 1989. [4] L. Sunil Chandran and Fabrizio Grandoni. Refined memorization for vertex cover. Information Processing Letters, 93(3):125–131, 2005. [5] Jianer Chen, Iyad A. Kanj, and Ge Xia. Improved upper bounds for vertex cover. Theoretical Computer Science, 411(40-42):3736–3756, 2010. [6] Marek Cygan, Marcin Pilipczuk, Michal Pilipczuk, and Jakub Onufry Wojtaszczyk. On multiway cut parameterized above lower bounds. In Dániel Marx and Peter Rossmanith, editors, Parameterized and Exact Computation - 6th International Symposium, IPEC 2011, Saarbrücken, Germany, September 6-8, 2011. Revised Selected Papers, volume 7112 of Lecture Notes in Computer Science, pages 1–12. Springer, 2012. [7] Marek Cygan, Marcin Pilipczuk, Michal Pilipczuk, and Jakub Onufry Wojtaszczyk. On multiway cut parameterized above lower bounds. Theory of Computing Systems, 5(1):3, 2013. [8] Rodney G. Downey and Michael R. Fellows. Fundamentals of Parameterized Complexity. Texts in Computer Science. Springer, 2013. [9] Jack Edmonds. Paths, trees, and flowers. Canadian Journal of Mathematics, 17:449–467, 1965. [10] Jörg Flum and Martin Grohe. Parameterized Complexity Theory. Springer-Verlag, 2006. [11] Tibor Gallai. Kritische graphen ii. Magyar Tud. Akad. Mat. Kutató Int. Közl, 8:373–395, 1963. [12] Tibor Gallai. Maximale systeme unabhängiger kanten. Magyar Tud. Akad. Mat. Kutató Int. Közl, 9(9):401–413, 1964. [13] Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63(4):512–530, 2001. [14] Richard M. Karp. Reducibility Among Combinatorial Problems. In Proceedings of a symposium on the Complexity of Computer Computations, held March 20-22, 1972, at the IBM Thomas J. Watson Research Center, Yorktown Heights, New York, The IBM Research Symposia Series, pages 85–103. Plenum Press, New York, 1972. [15] Michael Lampis. A kernel of order 2k − c log k for vertex cover. Information Processing Letters, 111(23-24):1089–1091, 2011. [16] Daniel Lokshtanov, N. S. Narayanaswamy, Venkatesh Raman, M. S. Ramanujan, and Saket Saurabh. Faster parameterized algorithms using linear programming. ACM Transactions on Algorithms, 11(2):15:1–15:31, 2014. [17] L. Lovász and D. Plummer. Matching Theory. AMS Chelsea Publishing Series. American Mathematical Society, 2009. [18] Sounaka Mishra, Venkatesh Raman, Saket Saurabh, Somnath Sikdar, and C. R. Subramanian. The complexity of könig subgraph problems and above-guarantee vertex cover. Algorithmica, 61(4):857–881, 2011. [19] N. S. Narayanaswamy, Venkatesh Raman, M. S. Ramanujan, and Saket Saurabh. LP can be a cure for Parameterized Problems. In 29th International Symposium on Theoretical Aspects of Computer Science, STACS 2012, February 29th - March 3rd, 2012, Paris, France, volume 14 of LIPIcs, pages 338–349, 2012. [20] George L Nemhauser and Leslie E Trotter Jr. Properties of vertex packing and independence system polyhedra. Mathematical Programming, 6(1):48–61, 1974. [21] George L Nemhauser and Leslie E Trotter Jr. Vertex packings: structural properties and algorithms. Mathematical Programming, 8(1):232–248, 1975. [22] Rolf Niedermeier and Peter Rossmanith. Upper bounds for vertex cover further improved. In Christoph Meinel and Sophie Tison, editors, STACS 99, 16th Annual Symposium on Theoretical Aspects of Computer Science, Trier, Germany, March 4-6, 1999, Proceedings, volume 1563 of Lecture i Notes in Computer Science, pages 561–570. Springer, 1999. [23] WR Pulleyblank. Minimum node covers and 2-bicritical graphs. Mathematical programming, 17(1):91–103, 1979. [24] Venkatesh Raman, M. S. Ramanujan, and Saket Saurabh. Paths, flowers and vertex cover. In Camil Demetrescu and Magnús M. Halldórsson, editors, Algorithms - ESA 2011 - 19th Annual European Symposium, Saarbrücken, Germany, September 5-9, 2011. Proceedings, volume 6942 of Lecture Notes in Computer Science, pages 382–393. Springer, 2011. [25] Igor Razgon and Barry O’Sullivan. Almost 2-sat is fixed-parameter tractable (extended abstract). In Luca Aceto, Ivan Damgård, Leslie Ann Goldberg, Magnús M. Halldórsson, Anna Ingólfsdóttir, and Igor Walukiewicz, editors, Automata, Languages and Programming, 35th International Colloquium, ICALP 2008, Reykjavik, Iceland, July 7-11, 2008, Proceedings, Part I: Tack A: Algorithms, Automata, Complexity, and Games, volume 5125 of Lecture Notes in Computer Science, pages 551–562. Springer, 2008. ii
8cs.DS
Does Outside-In Teaching Improve the Learning of Object-Oriented Programming? Erica Janke⇤ , Philipp Brune⇤ and Stefan Wagner† ⇤ University of Applied Sciences Neu-Ulm Neu-Ulm, Germany Email: {erica.janke, philipp.brune}@hs-neu-ulm.de † University of Stuttgart Stuttgart, Germany Email: [email protected] Abstract—Object-oriented programming (OOP) is widely used in the software industry and university introductory courses today. Following the structure of most textbooks, such courses frequently are organised starting with the concepts of imperative and structured programming and only later introducing OOP. An alternative approach is to begin directly with OOP following the Outside-In teaching method as proposed by Meyer. Empirical results for the effects of Outside-In teaching on students and lecturers are sparse, however. We describe the conceptual design and empirical evaluation of two OOP introductory courses from different universities based on Outside-In teaching. The evaluation results are compared to those from a third course serving as the control group, which was taught OOP the “traditional” way. We evaluate the initial motivation and knowledge of the participants and the learning outcomes. In addition, we analyse results of the endterm exams and qualitatively analyse the results of interviews with the lecturers and tutors. Regarding the learning outcomes, the results show no significant differences between the Outside-In and the “traditional” teaching method. In general, students found it harder to solve and implement algorithmic problems than to understand object oriented (OO) concepts. Students taught OOP by the Outside-In method, however, were less afraid that they would not pass the exam at the end of term and understood the OO paradigm more quickly. Therefore, the Outside-In method is no silver bullet for teaching OOP regarding the learning outcomes but has positive effects on motivation and interest. I. I NTRODUCTION “Nowadays, object oriented programming is the predominant programming paradigm and Java is completely object oriented” [8]. In addition, Java is probably the most used language among IT service providers [15]. Therefore, students frequently learn Java and object oriented programming (OOP) already in introductory courses. This provides a perfect basis for a “later introduction to other paradigms such as logical or functional programming” [11]. Moreover, OOP also helps introducing students to concepts like specification, construction and verification [11]. The classical approach for teaching OOP starts with the basic principles of imperative and structured programming. Teachers introduce variables, data types, control structures, functions or methods and algorithms before the introduction of classes (as an extension of composed data types) and objects. This approach reflects the historical evolution of programming languages and thus the order in which most programmers once have learned these concepts themselves. Yet, this order is meaningless for today’s beginners. Moreover, fully objectoriented (OO) languages like Java require the use of OO concepts for all non-trivial (and therefore motivating) tasks. This is especially important for problems which do not have a mathematical character but originate from the field of business information systems. Therefore, in the last years various approaches for teaching OOP have been proposed following the inverse approach: an “inverted curriculum”. These approaches start by introducing objects, interfaces, classes and functions from the beginning [17], e.g. the Outside-In teaching method for OOP based on the programming language Eiffel [12]. Problem Statement: Despite several lecturers having already used the Outside-In teaching method in their courses, little empirical evidence on its effects exists. Some authors examined the program compilation behaviour of involved students [16], [9], but its impact on learning outcomes as well as motivation and interest has not been studied so far. Research Objective: Teaching OO concepts to novices is an important task of software engineering education. Therefore, in this paper the feasibility and effects of using Outside-In teaching for teaching OOP in university-level introductory courses using Java are empirically evaluated. In particular, the objective was to understand its impact on learning outcomes as well as on interest and motivation of the participants. Context: We evaluated Outside-In teaching in parallel in two introductory courses for computer science and OOP (Bachelor level, 1st year) at two German universities in the winter term 2012/13. The courses were Programming and Software Development (PSD) at the University of Stuttgart (Stuttgart) and Programming Technique from the study program “Information Management Automotive” (IMA) at the University of Applied Sciences Neu-Ulm (Ulm). PSD at Stuttgart is part of the curriculum of the Computer Science program as well as of related programs like e.g. software engineering, mechatronics, simulation technology and cybernetics. We used a second course called Programming Technique from the program “Information Management and Corporate © 2015 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other users, including reprinting/ republishing this material for advertising or promotional purposed, creating new collective works for resale or redistribution to servers or lists, or reuse of any copyrighted components of this work in other works. Communication” (IMUK) at Ulm as the control group, which was taught in the “traditional” way. The scope and educational objectives of both identically named courses are the same. The lectures at Ulm are given by the same lecturer, who has already taught the IMUK course for several years in an unchanged style. The programming language used in all courses was Java. Contribution: We propose a course design for teaching OOP in introductory courses using the Outside-In method and the Java programming language. We systematically evaluate the application of the proposed course design and teaching method to the two undergraduate courses listed above. The paper presents empirical data resulting from the analysis of two surveys among the students and the evaluation of the exams. We also describe qualitative results from interviews with the involved lecturers and tutors. Our findings indicate that while the approach has its strengths, it cannot be considered as a didactical silver bullet for teaching programming basics as claimed by other authors [12]. II. R ELATED W ORK Originally, the idea of the “inverted curriculum” was proposed by Cohen [5]. It was adopted by various approaches like e.g. the objects-first strategy for introducing OOP. They all follow the “Early Birds” teaching pattern, which requires the introduction of important concepts, the “big ideas”, at the very beginning [3]. To support the method, various software tools have been developed which intend to expose students intuitively to using objects (see e.g. [6], [18], [10]). Meyer picked up the idea of the “inverted curriculum” and developed the Outside-In method for introductory courses of OOP. He used Eiffel as the programming language. In his approach students are provided with high quality software with libraries. Students start as “consumers” of re-usable components and evolve to “producers” of such components [12]. Beside the ETH Zurich, some universities in the USA and Australia successfully apply this concept [6], [18], [10]. A core concept of Outside-In teaching is the use of a sufficiently realistic and complex software system from the very beginning, which students have to get acquainted with and learn to modify and extend [12]. Some authors do not consider the concept of Outside-In teaching but also discuss a similar use of complex software in their lectures. Untch and Offutt [21] describe a system which can be adjusted to different levels of difficulty when teaching software development projects. The application of a software tool implemented in C++ and Eiffel for the introduction to OOP is shown in [14]. However, both systems are not real true-to-life examples for the students. Brügge [4] describes an approach which is more realistic. Their software system enables students to walk through all phases of the software development process, in particular also the phase of system integration. Ramakrishnan et al. [19] present a tool which can mimic huge industrial software projects and thus enables students to understand the benefit of reuse. Although various lecturers have used similar approaches to Outside-In teaching for some time, only little empirical evidence on its impact can be found in the literature. There are controversial discussions on the effectiveness of the Outside-In method [1] but no empirical results were presented. Cheong Vee, Mannock and Meyer describe a method for evaluating typical errors made by novices in object-oriented programming [16] and Jadud [9] analyses “compilation behaviours of novice programmers”. A systematic empirical validation and comparison to the traditional approach is still missing, however. Therefore, in the following we not only describe a course and software tool design for teaching introductory programming courses Outside-In but also evaluate the approach empirically and compare its outcomes to the traditional course design. III. C OURSE D ESIGN Based on the approach described in [13], we jointly developed a curriculum for a one-term course. The differences in programming language, scope and the embedding in other lecture courses at the corresponding university were taken into account. The major challenge was the replacement of Eiffel by Java. Eiffel is more puristic in its object-oriented constructs than Java. For example, for Java an early introduction of static methods is necessary because the program is executed with the static main method. The concept of executing a program in Eiffel is considerably easier. Compared to Eiffel, Java lacks a native support for contracts, so additional tools have to be used. Regarding the scope, the two courses at Ulm and Stuttgart distinctly differ. Programming and Software Development (PSD) at Stuttgart consists of four hours lecture and two hours tutorials with teaching assistants per week. Programming Technique at Ulm consists of two hours lecture and two hours lecturer-guided tutorials. Furthermore, two additional hours of optional tutorial per week are offered. Some topics like the setup and the functional principle of a computer or data structures are units of separate lecture courses at Ulm. For this reason, these units are not taken into account here. Thus, compared to Ulm, at Stuttgart much more topics are discussed during a semester. PSD at Stuttgart is similar to an introduction to computer science. The aim of the course is a broad introduction to the field of computer science and at least to strike all basic topics. Hence, topics like the principles of computer hardware or the complexity of algorithms are also briefly discussed. Those topics are deepened in corresponding courses like Algorithms and Data Structures, Theoretical Principles of Computer Science and Technical Principles of Computer Science. The course Programming Technique at Ulm is embedded in business-oriented information management study courses and for this reason more oriented towards application and less towards theoretical foundations. Nevertheless, as an important course relevant to information systems in the first term, it has the objective to give at least an overview of the essential basics of information systems development. Another objective is the preparation for courses like Databases and Car IT as well as TABLE I S TRUCTURE OF THE COURSES Ulm Stuttgart Introduction After discussing organisational issues, the course starts with a general discussion on computers and programming. We explain the classical “Hello, World” program with the purpose to show students how a program looks like, how it is compiled and executed. With the help of this program, we introduce the Java Virtual Machine. x x Objects We introduce object orientation and emphasise thinking in objects. We discuss objects in the real world, abstract objects and pure software objects. We also talk about how they can be used to define the operations of a computer. We introduce classes as blueprints for objects. We also explain primitive data types and typecasts which are necessary to program in Java. x x Execution We discuss how objects are created and methods are called. In Java, this means we introduce the main method. For that, we present static methods and static attributes. Students learn the structure of a block in the source code and how access can be limited with the help of visibility attributes. There is a short introduction to the integrated development environment (IDE) – in our case Eclipse. In this stage students are able to write first programs by calling a sequence of methods on objects. x x Interfaces First, we discuss interfaces of systems and classes. We introduce the concept of contracts to better describe interfaces. As Java has limited possibilities to implement them, they are used as a concept to think about interfaces and to document them. After that, we introduce formal languages using the example of Java and its grammar. x x UML We discuss how classes and interfaces can be modelled and documented. For this purpose, we introduce UML class diagrams and UML sequence diagrams. They are used to think about the structuring and interaction of objects. x x Boolean logic Boolean logic is essential for computer programming. We define Java’s boolean and relational operators as a basis for branching. x x Branches and loops Based on the boolean logic, we dive into the implementation of methods. We introduce branches and loops in Java. The set of data types is enlarged by fields, Java Collections and generics. x x Routines We introduce the concept of routines and accordingly methods in Java and their meaning. We discuss abstraction, modularisation and information hiding and their representation in Java. Moreover, we talk about exception handling as an additional control structure. x x Variables We introduce the concept of variables late. So far, variables have not been mentioned. There were attributes in objects or parameters passed to methods – the core concept are objects. When we implement methods more imperative concepts and, finally, variables are necessary. We then can explain references and memory contents. x x Hardware We deepen the knowledge about computers which students gained earlier. What is a computer? Of which parts does a computer consist? Which further hardware is important? x Also building on earlier lectures, we take a deeper look at the grammar of Java described in EBNF and the syntax tree. x Programming languages We take a step back from Java. Which other programming paradigms do exist? How do they differ? Which are prominent examples for these paradigms? Also other programming tools like the debugger are explored in more detail. x Data structures and algorithms We take a closer look at basic data structures and algorithms and discuss their complexity and efficiency. This does not replace separate lecture courses on algorithms and data structures but lays first foundations. x We introduce recursion as an important concept in programming. As an example data structure, we employ binary trees. x Syntax Recursion Sorting We use simple sorting algorithms as examples for developing a general procedure for the design of algorithms. x x Inheritance and polymorphy We complete the object oriented concepts by introducing inheritance and polymorphism. They are introduced late because of their complexity, and they are not necessary for basic object oriented programming. The apply these concepts in Java and the corresponding UML diagrams. We now can also talk about Java interfaces. x x Semantics We introduce the concept of semantics of programming languages and their formal description. Students gain insight into formal verification. GUI Students should be enabled to build realistic programs. For this purpose, we introduce graphical user interfaces (Eclipse SWT). The task of the students is to expand the media player. Test Programming does not only include the initial generation of source code. Another important point is testing by the developer. We cover the development of unit tests and (briefly) test-driven development. x Quality This leads to the more general concept of software quality. We discuss the difference between process quality and product quality, quality factors and their influence on programming and the importance of maintenance and evolution. x Software engineering The last block represents the direct link to a software engineering course. Students learn which further activities of a development process are necessary to create larger software systems. x x x x x Software Engineering and Web Engineering in the second and third semester. unit is covered by lessons at Ulm or Stuttgart. The numbering also reflects the chronological order in the lecture course. To master such a wide range of topics while being able to support each other, we developed 21 teaching units representing the core topics. One unit consists of one or two double weeks of lectures and the respective tutorials. Table I presents an overview of the different units. The “x” marks whether the Essential is the introduction to objects. The first five teaching units (the first weeks of the course) solely deal with objects. Only after that we delve into the implementation of methods. Here, branches, loops and finally also variables are introduced. In this phase the classical imperative development is described. This approach should foster the students to think in objects and not in sequences of imperative instructions. After that, we deal with several general topics, depending on the scope of the lecture. Finally, the step from “programming in the small” to “programming in the large” is prepared. In Table I every teaching unit is briefly described. Example Software System: In [13] the Eiffel software package TRAFFIC is used as an example system. This software represents a traffic and tourist information system for visitors in Paris. However, in our setting the usage of this system was not possible because Java is used as the programming language. Because of this, a different example system was developed, which is also closer to the everyday experience and software used by the students than the TRAFFIC system. A MP3-player application was selected, which was realised in Java and is similar to other popular music programs for PCs. The so called “CodeTunes-System” uses the open source library JLayer (see http://www.javazoom.net) for playing back music files and the Standard Widget Toolkit (SWT) (see http://www.eclipse.org/swt) for the implementation of the graphical user interface. Figure 1 shows a screenshot of the main window of the application in its current development state. Fig. 1. Screenshot of the Java-based example software system CodeTunes (a media player) developed for the courses. The selected topic offers enough potential for future projects in further courses, e.g. the implementation and integration of an online music shop. Currently, the software only offers the basic functionality of a media player. During the lessons, students are intended to continually further develop the system, e.g. in the context of student research projects. Especially at the beginning, in the original TRAFFIC system, the Eiffel classes TOURISM (touristic activity in Paris), STATION (Metro station) and LINE (Metro line) are used as substantial concepts of the application domain [13]. The logical pendants in CodeTunes are the Java classes MediaPlayer (rendering of music titles in various forms), Title (piece of music) and PlayList (a list of pieces of music). Based on this, the programming examples in [13] can be reproduced similarly. For example, in unit 2 students begin with the following simple example class: public class MyFavouriteSongs extends SimpleMediaPlayer { public void play() { title1.play(); title3.play(); } } In this class, using title1 and title3, students apply existing objects of the class Title. With the help of those they can play a sequence of music titles. IV. C ASE S TUDY D ESIGN The objectives of our case study are expressed by the following research questions: RQ 1: How does the self-assessment and motivation of students taught OOP with the Outside-In method differ from those taught with the “traditional” method? RQ 2: Which learning outcomes does the Outside-In method generate compared to the “traditional” method? RQ 3: How and to which extent does Outside-In teaching contribute to an improvement of teaching OOP from the lecturers’ perspective? Data Collection Procedure: To answer RQ 1, we needed data from the students. Therefore, at the beginning of the term (measuring point I, MPI) we conducted a survey at Ulm and Stuttgart to determine the initial motivation, self-assessment and previous knowledge of the participants. By means of this survey, we were able to take into account the heterogeneous background and personality types of the participants in the two different bachelor programs (Computer Science and related courses at the university in contrast to Information Management at a university of applied sciences). In Germany, universities must select undergraduate students only according to their respective high-school diploma grade and are not allowed to use other selection criteria. Therefore, students are very heterogeneous with respect to their motivation, interest, and study-related skills. After three weeks of teaching (measuring point II, MPII), we conducted the second survey to measure the achieved learning success and motivation changes of the participants. With the results of this survey, RQ 1 and RQ 2 could be answered. To evaluate the learning outcomes, the second survey contained a test. Students were given a Java class construct and they had to answer different questions about this class. To measure the self-assessment and motivation of the students and their interest in the lectures, we asked the students seven questions which they could answer on a fivepoint scale. The questions are listed in the catalogue below. In addition to these surveys, we analysed the results of the end-term exams to extend the empirical basis on learning outcomes and to obtain a broader basis for answering RQ 2. To obtain a picture of the lecturers’ perspective on the efficiency of Outside-In teaching and to answer RQ 3, we interviewed all involved lecturers (two of them are authors) and exercise instructors by means of partially standardised interviews, so the interviewer used a guideline for the interview and the interviewees were free in their answers. Figure 2 shows a quick overview over the different measuring points and the values which were measured at these points. After three weeks (MP II): ‐ Achieved learning success (test) ‐ Motivation changes Answers to RQ1 Answers to RQ2 t Beginning of the term (MP I): ‐ Initial motivation ‐ Self‐assessment ‐ Previous knowledge Background Personality types End of the term: ‐ Results of end‐term exams ‐ Interviews with lecturers Answers to RQ3 Fig. 2. Timeline overview of the data collection process including measuring points. The catalogue of questions for the surveys was subdivided into three groups of questions. One for determining motivation and previous knowledge, the second for measuring selfassessment, students’ expectations and the perception of the lecture. The third group tested the technical understanding of the principles of OOP. Not all questions were asked at both measuring points. Questions on motivation and previous knowledge were asked on MPI, questions on expectations and perception were asked on MPI and MPII and questions on the learning success were asked on MPII. The first group of questions for the determination of the knowledge and the motivation included the following questions and possible answers: 1) Have you already completed a job training? (yes / no) 2) Do you have previous knowledge in one or more subjects? (yes / no) 3) I have always been interested in the courses of the study program I have chosen. (applies – does not apply, 4 levels) 4) I think I chose the right study program. (applies – does not apply, 4 levels) 5) I am very interested in the lecture. (applies – does not apply, 5 levels) 6) I will devote myself to the topics of the lecture in my spare time. (applies – does not apply, 5 levels) 7) I will frequently participate in the lecture with questions and comments. (applies – does not apply, 5 levels) The 4-point scale in questions 3–4 was chosen to force a clear answer. The subjects mentioned in question 2 are not necessarily restricted to IT related topics. In question group 2 seven questions were asked, to which the participants could respond by choosing one value on a five-point scale from ”applies” (= 1) to ”does not apply” (= 5): 1) The subject is a challenge for me. 2) I am afraid not to pass the exam. 3) I am devoted to the topics of the lecture in my spare time. 4) I execute my tasks on time. 5) The course has a clear outline. 6) At the end of the semester, my performance will be better than the average. 7) At the end of the semester, I will not have passed. Question group 3 determine the learning success with respect to basic concepts of OOP in the first weeks of the term. A Java class was presented to the students, who had to answer nine single- or multiple-choice-comprehension questions that referred to different OOP concepts. The tested concepts were “class”, “object” and “fundamentals of programming”. The questions in the end-term exams tested different dimensions of knowledge. These dimensions were structured according to [20] in “remember”, “understand”, “explain”, “use”, “apply” and “develop”. “Remember” means that the student is able to remember information and to reproduce it word for word. The knowledge dimension “understand” implies that the student understands the meaning of information, is able to define it and is able to link new but thematically related information to it. When students are able to identify correlations, dependencies and similarities between information and are able to explain it in their own words, they have reached the dimension “explain”. “Use” means that the student is able to apply knowledge in a pre-defined limited context and / or under guidance. Autonomous, independent appliance / application, even in a difficult environment, is described by the knowledge dimension “apply”. “Develop” means the creation of new knowledge. Table II illustrates the structure of the questions in the endterm exam for the course PSD at Stuttgart and Programming Technique at Ulm. To obtain the lecturers’ point of view on the effectiveness of Outside-In teaching, we conducted partially standardised interviews with the two lecturers and two exercise instructors and recorded them. Analysis Procedure: In preparation for the evaluation of the answers to the surveys, we checked the distributions of the answers to the questions of both groups with the help of a Kruskal-Wallis-Test. We chose this test because the measured values are not normally distributed and there are more than two samples. We also checked the results from the exams to determine if the two groups Stuttgart and Ulm IMUK have the same distribution or if the results are significantly different. For this purpose we used the Mann-Whitney-U-Test, because the measured values are not normally distributed but of an ordinal scale and we compared exactly two samples. For analyzing the answers to questions linked to motivation (i.e. questions 3–7 of question group one), we computed the median of the answers and compared them to the median of Code Comprehension Fundamental Concepts loops S S S S S S S S S S S S S S S S U U U S U S S U U S U U S S S S U S U S S U U use explain Algorithms Issue definition of objects method overloading interfaces / inheritance polymorphism / dynamic binding overload / override (inheritance) information hiding / static class diagrams / Java / algorithms class relations exceptions / exception handling static methods GUI computation of the Fibonacci-numbers static methods / algorithms loops recursive functions understand Cluster Object Orientation remember TABLE II C LUSTERED QUESTIONS OF THE EXAM AT S TUTTGART (S) AND U LM (U) AND THEIR KNOWLEDGE DIMENSIONS . U S U U U U U the optimal answers. The percentages of the students who answered to questions 1–2 of question group one with “yes” were averaged. To evaluate the results of the exam, first we selected the questions related to object orientation. Second, we clustered those questions in four groups, “Concepts of Object Orientation”, “Algorithms”, “Code Comprehension” and “Fundamental Concepts”. We analysed the percentages of points achieved in the exam and compared the results of the involved groups. The analysis of the qualitative data started with a verbatim transcription of the recorded interviews. Concerning the method, we used selected elements of Grounded Theory following [7]. Where it was not possible to apply elements of Grounded Theory, we substituted them. The number of interviewees was a priori restricted because we examined only two lecture courses. So the sampling followed the a-prioridetermination. We chose an inductive approach to coding, which involved open coding, axial coding and selective coding [7]. Validation Procedure: In our investigation, we compared two different kinds of universities. Stuttgart represents a German university which aims to provide students with a broad theoretical basis of knowledge and skills. Ulm is a typical German university of applied sciences which focuses more on training students in a practical way for work in industry. This implies different teaching objectives and also different backgrounds of students. To enable a comparison, in our evaluation we considered the motivation and prior knowledge of the students. The importance of the exams is different at the two universities. In addition to this, students of different majors attend the course at Stuttgart. This fact was given for our experiment and has to be taken into account when interpreting the results. One objective of our investigation was to compare the results for those two different kinds of university the influence of these boundary conditions. The exams followed different didactic approaches. To enable a comparison, in the presentation of our research results we include the knowledge dimensions tested by the different exercises in the exams. Two different lecturers taught the lessons, differing in their didactic approach. Nevertheless, the lecturers presented the same basic theoretical knowledge. The technical understanding of OOP was tested in all groups by asking the same questions of question group 3. To ensure unbiased results in the qualitative research part, two different researchers were involved in the coding of the transcribed interviews. To verify the obtained codes, an additional person was involved to review the codes.The number of interviewees was given a priori and could not be influenced. For statistical evaluations, the number of participants in the investigated groups has to be comparable. From the Ulm IMA group, only 12 students took part in the exam. At Ulm, students are eligible to postpone exams to the future. Also, at examination time some students already left the study program with the result that not every participating student took part in the exam. So we could not draw any statistical conclusions from that exam. The background of the students is very different at the two universities. For this reason, we list the most significant differences and deliver statistical data for these cases. V. R ESULTS Course Participants: The background of the students differs between the two universities. At Ulm, 36.1 % of the IMUK students have already completed a vocational training, at Stuttgart only 6.9 %. At Stuttgart, 95.3 % of the PSD students have a general high school diploma (German “Abitur”) for university entrance, while at Ulm only 58.1 % of the IMUK students and 57.6 % of the IMA students have such a graduation. There, 33.3 % (IMUK) and 42.4 % (IMA) of the students qualified for their studies with a university of applied sciences entrance qualification, which is a more technical certificate. 33.3 % of the PSD students at Stuttgart state to aim at a master’s degree. Only 18.3 % of the Ulm IMUK students and 3.2 % of the Ulm IMA students state this. Also the gender distribution is not equal in the three study courses. At Stuttgart, 18.5 % of the PSD students are female. At Ulm, in the study course IMA 27.3 % of the Programming Technique students are female, in the study course IMUK this number amounts to 71.7 %. These results are summarized in Table III. TABLE III BACKGROUND INFORMATION OF THE STUDENTS CLUSTERED BY THE THREE DIFFERENT STUDY COURSES S TUTTGART PSD (S TUTTGART ), U LM IMA (HA) AND U LM IMUK (HU, CONTROL GROUP ). Background Information Completed vocational training General high school diploma University of applied sciences entrance qualification Aim at master’s degree Female students Stuttgart HA 6.9% 21.2% 95.3% 57.6% HU 36.1% 58.1% 0.3% 42.4% 33.3% 33.3% 18.5% 3.2% 27.3% 18.3% 71.7% Qualitative Experiences of the Lecturers (RQ3): The analysis of the interviews revealed interesting results. Depending on the role – lecturer or exercise instructor – different impressions were gained in some parts of effectiveness of the Outside-In method. The main categories, which arose from coding, were the following ones (also shown in Figure 3): Motivation Better preparation for professional life World of experience Quantification of added value is hard OO thinking/ abstraction/big picture Added Value Educational background Comprehensibility No reduction of severity Focusing Intuitive Teaching More complex than procedural Effectivity of Outside-In Too complex/abstract for some students Clear structure Challenges Problems Rethink Superficial knowledge Mixing of concepts because of Java Missing literature Algorithms Basic concepts understood by most students Confusion of students because of mixing of concepts Problems with programming tasks Fig. 3. Categories resulting from open, axial and selective coding and the corresponding categories of the first tier. Teaching objectives: All four experts agreed that with the help of Outside-In teaching students gain a better understanding of complex systems and are more able to deal with such systems. They receive a realistic picture of software engineering. Students are forced to think on a more abstract level. The Outside-In method also enables a better and sustainable understanding of the object oriented perspective. Students gain a better understanding and feeling for objects. Another result is described by the following statement: “I approve to start with this way of thinking. Not starting with the procedural way, which might come naturally to them. But in a long-term view, the OO way is the lasting approach”. Added value: As added value from using the Outside-In method, the interviewees listed motivation and a better preparation for professional life. “Objects First enables impressive results of the own programming after a relative short time. ... I think, this contributes to a higher motivation.” It was also mentioned that it is hard to quantify an added value of the usage of the Outside-In teaching method. Comprehensibility: In the lecturers’ point of view this teaching method is especially appropriate for students who have not yet gained any experience with programming. The exercise instructors had the opposite impression - the OutsideIn method makes it harder for students without any prior programming experience to immerse themselves in the object oriented paradigm. The interviewees also mentioned the applicability for all students because of the connection to their world of experience. The lecturers as well as one exercise instructor got the impression that with the help of the OutsideIn method, students gained a better understanding of the object oriented paradigm in a comparatively short time. The concept is intuitive, for lecturers as well as for students. It delivers a clear structure, in which structural concepts have to be addressed. Some interviewees had the impression that for some students this structure is too complex and deterrent. They also had the impression that students are confused because of the mixing of concepts during explaining. Another point mentioned was: “I do not think it makes it easier for students. It becomes different, maybe more meaningful, but it does not become easier.” Challenges: The lecturers themselves were forced to rethink basics of the object-oriented paradigm because they had to explain it in a different, unfamiliar way. Both lecturers mentioned challenges in explaining concepts. The Outside-In method requires a fixed order of topics. In combination with Java, this implies that certain concepts have to be explained using concepts that are going to be explained in detail later. One lecturer had the impression that this led to confusion for some students. Another challenge is the lack of textbooks which treat the object oriented paradigm in combination with Java and the Outside-In method. Problems: Not enough time is spent on basic programming. Problems occur when students have to develop their own algorithms and e.g. think about how to efficiently use the storage. Students are overwhelmed with the task of building an algorithm. “I think, next time I will invest more time in strengthening algorithmic thinking.” And students are overchallenged when they have to think of basic programming concepts. Quantitative Results of the Surveys: At Stuttgart, 237 students attended at MPI and 253 at MPII. They were aged between 17 and 30 years. The lectures at Ulm have been visited by 154 students at MPI and by 117 at MPII, which were aged between 18 and 25 years. Of these, there were 33 students at MPI and 19 at MPII in the study course IMA and 121 at MPI as well as 98 at MPII in the study course IMUK (control group). To illustrate the prior knowledge of the participants, the arithmetic average of the answers to question 1 and 2 from the first group of questions has been used. The motivation was represented by the median of questions 3 to 7 from the first group of questions. For all three groups (Stuttgart PSD, Ulm IMUK and Ulm IMA) the median to those questions is 2. Calculating the median of the optimal answers (completely agreement) would result in a median of 5. The calculated indicators for prior knowledge at MPII are plotted in Figure 80.00% 4 for IMA, IMUK and Stuttgart PSD. 70.00% Prior Knowledge 60.00% 49.50% 50.00% 34.85% 40.00% 34.45% TABLE IV R ESULTS OF THE K RUSKAL -WALLIS - TEST FOR INDEPENDENT SAMPLES TO VERIFY IF THE DISTRIBUTIONS OF THE ANSWERS TO THE QUESTIONS LINKED TO MOTIVATION AND PRIOR KNOWLEDGE ARE THE SAME FOR S TUTTGART PSD, U LM IMUK AND U LM IMA WITH CONFIDENCE INTERVAL 95 % AND SIGNIFICANCE LEVEL 0.05. category question motivation interest in study course interest in lecture study course was a good decision self study in spare time participation in lecture completed vocational training knowledge in one or more subjects 30.00% 20.00% 10.00% 0.00% 1 ‐ Ulm US ‐ PSDStuttgart HNU ‐ IMA ‐ PSD IMA MUK prior knowledge Ulm‐‐IMUK HNU IMUK Fig. 4. Proportion of students with previous knowledge at MPI in the three courses. better worse ‐1 0 1 1 ‐1 2 0 0 ‐1 3 0 4 0 ‐1 1 0.5 0.5 Stuttgart ‐ PSD 1 0.5 5 6 0 7 0 0.5 Ulm ‐ IMA 1 Ulm ‐ IMUK change (scale: ‐5 to 5) 1) challenge 2) not pass exam 3) devoted in spare time 4) do tasks on time 8.5% 5) clear outline 6) better performance than average 7) not pass semester Fig. 5. Changes of self-assessment and the course perception in the three groups of participants between MPI and MPII. Percentage of Right Answers in the Test 6.6% Class1 81% 15% 73% 78% 0.000 accept / reject reject 0.000 0.795 reject accept 0.137 accept 0.000 reject 0.000 reject 0.290 accept of basic concepts of OOP was only measured at MPII. The answers are a snap-shot of the learning success of the students and allow a direct comparison of Outside-In with the “traditional” approach. Figure 6 shows the number of right answers to the questions related to different OOP concepts for each course. Statistical tests reveal the distribution of the answers to questions related to motivation and prior knowledge. The null hypothesis tested was “The distribution of the answers to a single questions is similar for the different study groups Stuttgart PSD, Ulm IMUK and Ulm IMA.” For testing this hypothesis, we used the Kruskal-Wallis-test for independent samples. The chosen confidence interval was 95 %. Table IV shows the results. Quantitative Results of the Exams: At Stuttgart, 449 students took part in the exam. At Ulm, in the study course IMUK – which is the control group – 144 students took part in the exam. In the study course IMA, only 12 students took part in the exam. This number is too small to make reliable statistical statements. Because of this, the results of the exam of Stuttgart and the control group at Ulm are compared. Figure 7 shows the question clusters and corresponding percentage of all achieved points with respect to the achievable points. 19% Percentage of Right Answers in the Exam Method2 21% 1.7% significance 25% Concepts of 40% Object1 Orientation 38% Object3 59.5% 77.4% 68% 4.5 Elementary 5 4 Questions 42% 47% 59% Algorithms2 Stuttgart ‐ PSD Ulm ‐ IMA 44.7% Ulm ‐ IMUK Fig. 6. Percentage of correct answers to the questions about basic concepts of OOP (question group 3) at MPII. Self-assessment and perception of the course were measured at MPI and MPII. The differences between the medians at MPI in relation to MPII are shown in Figure 5 (comparison of IMA, IMUK and the University of Stuttgart). The understanding Code Comprehension +3 Fundamental Concepts 60.2% 62.8% Stuttgart ‐ PSD 63.1% Ulm ‐ IMUK Fig. 7. Percentage of achieved points in the exams for the two courses Stuttgart PSD and Ulm IMUK sorted by question cluster and size. Analysis of results: (RQ1) The survey results presented in Figure 4 show that in both courses (PSD at Stuttgart and IMA at Ulm) the proportions of students with previous knowledge are of similar size. However, this proportion of students is significantly higher in the control group of the IMUK students. The subjects students mentioned to have previous knowledge in are not necessarily IT-related. The motivation of all test groups is on a comparable and relatively high level. IMA students tend to perceive the course as rather demanding. This feeling increases during the first weeks of the lectures as the change in the responses to question 2 indicates (see Figure 5). The rating of the lecture difficulty developed positively in both groups – the PSD students at Stuttgart as well as the IMA students at Ulm – compared to the control group, as the change in the answers to question 1 in Figure 5 indicates. Moreover, students who are taught using the Outside-In method seem to perceive the lecture as more clearly structured than the control group, which is shown by the change in the answers to question 5 in Figure 5. The IMA students did not change their perception at all, whereas the perception of the control group significantly became more negative. In accordance with the lecturers, the students perceived the lecture as better structured and more logical when being taught using the Outside-In method. The differences between Ulm and Stuttgart could be reasoned in the two different instructors. (RQ2) Considering the learning outcomes, the results for the third question group show that the proportion of correct answers does not differ much between all three groups. In the first question group, only the control group differed strongly with respect to one question in the first category. Also a strong difference can be observed for one question in the third category. One reason for the learning achievements of the IMUK students could be the higher proportion of students with previous knowledge. The survey also offered the possibility of a direct comparison between the learning outcomes of students at a University and a University of Applied Sciences. Interestingly, no characteristic differences were found. The results of the exams show that students taught OO using the Outside-In method predominantly understand the OO concepts and are able to explain parts of it. In seven questions related to OO concepts students achieved 77.4 % of the achievable points. In five out of seven questions they achieved more than 75 % of the points. Only run-time exceptions and exception handling seemed to be more difficult, here 68.3 % of the possible points were achieved. Regarding polymorphism and dynamic binding students achieved 57.2 % of all possible points, which still is more than the half. Considering the “Algorithms” part, students seem to have some difficulties in creating algorithms, they achieved 60.2 % of the achievable points. This impression is supported by the results for the “Code Comprehension” part. Here students gained 58.2 % of the points. Understanding a given algorithmic program and creating and implementing new algorithms seem to be the main challenges. The fundamental concepts part seemed to be easier for the students. Here they achieved 67.0 % of the maximum points. The same is observed in the control group. Whenever students had to create and program algorithms on their own, they achieved only 44.7 % of the maximum points. The amount of achieved points with respect to OO concepts is 59.5%, which indicates the understanding of the OO paradigm is also still improvable. However, when we compare the results of the two groups, we have to keep in mind the different knowledge dimensions tested in the exams at Stuttgart and Ulm. The interviews revealed that by the Outside-In teaching method students gain a quicker understanding of the OO paradigm. Their perspective is OO from the very beginning, they are able to think in components after a very short time. At the same time, they have problems when asked to build an algorithm and write a program for it, i.e. when it comes down to the very basic concepts of programming. In general, the observed effects are relatively small and require further empirical examination. With this first investigation there is currently no statistical significance. However, we observe a tendency in the qualitative impressions of the lecturers that has to be verified by further studies over a longer time interval. Evaluation of Validity: One significant threat to validity was the difference of the two compared universities and the students involved in the surveys. To enable a comparison of the results, we presented the percentage of students with prior knowledge and their motivation. We also described the course designs and the different types of universities which were compared and their roles in the educational landscape. We delivered statistical data on completed vocational training, qualification for studies, intended degree and gender distribution to support the analysis of the results. To be able to compare the results of the exams having different didactic approaches, we clustered the questions and identified the knowledge dimensions tested by the different exercises. We evaluated the distributions of both, the answers to the questions on motivation and prior knowledge as well as the results of the exams. This revealed that the three groups are very heterogeneous to a large extent. The only observables which had the same distribution for all three courses were prior knowledge, the choice of the study program and the amount of self-studying in spare time. For the qualitative analysis of the interviews, two researchers coded the transcribed interviews to keep bias to a minimum. VI. C ONCLUSION Overall, the use of Outside-In teaching can be seen as successful. For the teacher, it sometimes is unusual and requires discipline in the implementation and sometimes argumentative tricks need to be used not to anticipate some concepts. But in general, it does not seem to be an impossible task. In return, we have seen many positive aspects, such as a more rigorous representation and working with realistic programs. Students as well have predominantly seen the structure of the courses as understandable. The self-assessmant of students, taught OO with the Outside-In method did not significantly differ from the self-assessment of students who were taught OO the “traditional” way. Results from the test in the second survey and results of the exam did not show any significant differences of the two groups. The lecturers had the opinion, that students who were taught OO with the Outside-In method had a quick understanding and feeling of the object-oriented paradigm. A clear statement of whether it benefits the specific learning, cannot be delivered, yet. Relation to Existing Evidence: In the actual state, our results confirm the statement of Schiaffino: “I have found that, for the most part, the greatest obstacle for students in CS1 is learning to analyze a problem and design an algorithm for its solution. ... Whether you use objects first or not does not seem to be particularly important.” [2] We also saw that students had problems in building algorithms. The understanding of OO did not significantly differ between the groups taught with and without Outside-In. Further investigations will need to show, if this result holds. Impact/Implications: Our results show, that the introduction of OO with the help of Outside-In teaching does not reduce the teaching results. Students seem to have a quick understanding of the object oriented paradigm. To obtain a clearer picture of the implications, we need replications and extensions of this study. Limitations: Our investigations encompassed only three courses at two universities. One course had a small number of students. Hence, the generalisation is difficult. The two universities are of a different kind and so are the students enrolled in these universities. They have a different qualification, different background. The comparison of the results must respect this. Also two different lecturers with their personal didactic approach taught the students. Future Work: In the following semesters, we will gather more data to be able to evaluate the Outside-In teaching method on a broader base. We will also collect the impressions of the students. The future will then provide a wider base of data. ACKNOWLEDGMENTS The present work as part of the EVELIN project was funded by the German Federal Ministry of Education and Research under grant number 01PL12022E. The authors are responsible for the content of this publication. R EFERENCES [1] F. Bailie, G. Blank, K. Murray, and R. Rajaravivarma. Java visualization using BlueJ. Journal of Computing Sciences in Colleges, 18(3):175–176, 2003. [2] F. Bailie, M. Courtney, K. Murray, R. Schiaffino, and S. Tuohy. Objects First - does it work? Journal of Computing Sciences in Colleges, 19(2):303–305, 2003. [3] J. Bergin. Fourteen pedagogical patterns, 12.01.2006. [4] B. Bruegge. Teaching an industry-oriented Software Engineering course. In Proceedings of the Software Engineering Education Conference, SEI 1992, volume 640 of Lecture Notes in Computer Science, pages 63–87. Springer, 1992. [5] B. Cohen. The education of the Information Systems engineer: To meet the present and future needs for staffing of the IT industry with appropriately qualified and trained people, new and radical approached to education and training are required. Electronics and Power, 33(3):203– 205, 1987. [6] S. Cooper, W. Dann, and R. Pausch. Teaching Objects-First in introductory Computer Science. In Proceedings of the 34th SIGCSE Technical Symposium on Computer Science Education, volume 35, pages 191–195, 2003. [7] J. M. Corbin and A. L. Strauss. Basics of Qualitative Research: Techniques and Procedures for Developing Grounded Theory. Sage Publications, 3 edition, 2008. [8] C. S. Horstmann and G. Cornell. Core Java 2 Vol.1: Fundamentals. Prentice Hall, 8th edition, 2007. [9] M. C. Jadud. A first look at novice compilation behaviour using BlueJ. Computer Science Education, 15(1):25–40, 2005. [10] M. Kölling and J. Rosenberg. Guidelines for teaching Object Orientation with Java. In Proceedings of the 6th Annual Conference on Innovation and Technology in Computer Science Education, volume 33, pages 33– 36, 2001. [11] B. Meyer. Towards an Object-Oriented curriculum. In Proceedings of 11th International TOOLS Conference, pages 585–594, 1993. [12] B. Meyer. The outside-in method of teaching introductory programming. In Perspectives of Systems Informatics, 5th International Andrei Ershov Memorial Conference, PSI 2003, volume 2890 of Lecture Notes in Computer Science, pages 66–78. Springer, 2003. [13] B. Meyer. Touch of Class: Learning to Program Well with Object Technology, Design by Contract, and Steps to Software Engineering. Springer, 2003. [14] C. Mingins, J. Miller, M. Dick, and M. Postema. How we teach Software Engineering. Journal of Object-Oriented Programming, 11(9):64–66, 74, 1999. [15] A. Neumann. Umfrage: Java ist verbreitetste Programmiersprache bei IT-Dienstleistern (in German), 2011. [16] M. H. Ng Cheong Vee, B. Meyer, and K. L. Mannock. Empirical study of novice errors and error paths in Object-Oriented programming. In Proceedings of the 7th Annual HEA-ICS Conference, 2006. [17] M. Pedroni and B. Meyer. The Inverted Curriculum in practice. In Proceedings of the 37th SIGCSE Technical Symposium on Computer Science Education, volume 38, pages 481–485, 2006. [18] V. K. Proulx, J. Raab, and R. Rasala. Objects from the beginning — with GUIs. In Proceedings of the 7th Annual Conference on Innovation and Technology in Computer Science Education, volume 34, pages 65–69, 2002. [19] S. Ramakrishnan, C. Mingins, B. Henderson-Sellers, and R. Duke. Planned software reuse in Object-Oriented Software Engineering education. In Proceedings of the 1994 Software Education Conference, pages 250–254, 1994. [20] Y. Sedelmaier, S. Claren, and D. Landes. Welche Kompetenzen benötigt ein Software Ingenieur? (in German). In H. Lichter and A. Spillner, editors, Proceedings of the SEUH 2013, pages 117–128, 2013. [21] R. H. Untch and A. J. Offutt. Integrating research, reuse, and integration into Software Engineering course. In Proceedings of the Software Engineering Education Conference, SEI 1992, volume 640 of Lecture Notes in Computer Science, pages 88–98. Springer, 1992.
6cs.PL
1 Dynamic Cross-Layer Beamforming in Hybrid Powered Communication Systems With Harvest-Use-Trade Strategy arXiv:1709.06625v1 [cs.IT] 19 Sep 2017 Yanjie Dong, Student Member, IEEE, Md. Jahangir Hossain, Member, IEEE, Julian Cheng, Senior Member, IEEE, and Victor C.M. Leung, Fellow, IEEE Abstract—The application of renewable energy is a promising solution to realize the Green Communications. However, if the cellular systems are solely powered by the renewable energy, the weather dependence of the renewable energy arrival makes the systems unstable. On the other hand, the proliferation of the smart grid facilitates the loads with two-way energy trading capability. Hence, a hybrid powered cellular system, which combines the smart grid with the base stations, can reduce the grid energy expenditure and improve the utilization efficiency of the renewable energy. In this paper, the long-term grid energy expenditure minimization problem is formulated as a stochastic optimization model. By leveraging the stochastic optimization theory, we reformulate the stochastic optimization problem as a per-frame grid energy plus weighted penalized packet rate minimization problem, which is NP-hard. As a result, two suboptimal algorithms, which jointly consider the effects of the channel quality and the packet reception failure, are proposed based on the successive approximation beamforming (SABF) technique and the zero-forcing beamforming (ZFBF) technique. The convergence properties of the proposed suboptimal algorithms are established, and the corresponding computational complexities are analyzed. Simulation results show that the proposed SABF algorithm outperforms the ZFBF algorithm in both grid energy expenditure and packet delay. By tuning a control parameter, the grid energy expenditure can be traded for the packet delay under the proposed stochastic optimization model. Index Terms—Beamforming, cross-layer design, energy harvesting, harvest-use-trade, smart grid, stochastic optimization. I. I NTRODUCTION The wireless data traffic will exceed 700 exabytes in 2016, and this amount will increase nearly threefold over the next 5 years [1]. The wireless data traffic requires a drastic increase in energy consumption, which translates to a significant amount of greenhouse gas emissions and a surge of the energy bill [2]. These emerging issues motivate the information and communication technology sector to search for the green communication solutions. The base stations (BSs) account for 70% to 80% of the overall energy bill of a typical wireless communication system (WCS) [2]–[4], and tremendous number of BSs will be deployed by 2020 to cope with the target of 1000X objective [5]. Therefore, a promising way to reduce the energy bill of the WCSs is to facilitate the Yanjie Dong and Victor C.M. Leung are with the Department of Electrical and Computer Engineering, The University of British Columbia, Vancouver, BC, V6T 1Z4 Canada (email:{ydong16, vleung}@ece.ubc.ca). Md. Jahangir Hossain and Julian Cheng are with the School of Engineering, The University of British Columbia, Kelowna, BC, V1V 1V7 Canada (email:{jahangir.hossain, julian.cheng}@ubc.ca). application of the renewable energy resources, such as solar radiation and wind energy, at the BSs [6]. As an ecology and economy friendly solution, energy harvesting (EH) technology has been intensively researched for the past several decades [6]–[9]. Equipped with energy harvesters, the BSs can harvest energy from the renewable energy resources. As a result, the high grid energy expenditure caused by the huge traffic demand is reduced [6], [10]–[12]. Nevertheless, the renewable energy resources are highly weather dependent and space-varying [6]; therefore, it is impossible to maintain an acceptable communication quality-of-service (QoS) when the BSs are solely powered by the renewable energy resources. Hence, a hybrid powered communication (HPC) system is preferred and it is therefore the focus of this paper. In the HPC systems, multiple energy usage strategies are proposed to deal with the uncertainty of the renewable energy resources, such as harvest-store-use (HSU) strategy [10]–[12] and harvest-use-store (HUS) strategy [13], [14]. In the first strategy, the BS stores the harvested energy into a storage medium before usage. Unlike the HSU strategy, the HUS strategy prioritizes the usage of the harvested energy and the surplus is stored in the storage medium. Yet, both the HSU and the HUS strategies require the energy storage medium, which suffers from imperfections such as storage loss and energy leakage [8], [13]–[15]. The authors in [15] investigated the long-term grid energy minimization problem in the HPC systems with HUS strategy. However, the two-way energy trading, which can help the cellular operators generate extra revenue, is ignored. On the other hand, the traditional electricity grid is experiencing a paradigm shift to a smart grid, where the twoway energy trading between the loads and the grid becomes applicable [16]. With the two-way trading capability in the HPC systems, a harvest-use-trade (HUT) strategy is preferred to thoroughly resolve the imperfections of the storage medium, which can improve the utilization efficiency of the harvested energy [17]. A. Related Works and Motivations There are two major topics in the HPC systems, namely minimizing the grid energy expenditure under certain performance requirements [14]–[24] and improving the system performance subject to short-term and/or long-term power constraints [11], [18], [23]–[27]. Several research efforts have 2 been made on the first topic, the scenarios under which are point-to-point systems [14], [18], single-cell systems [15], [19], [26], [27] and multi-cell systems [16], [17], [20]–[22], [25]. For example, considering the non-causal channel state information (CSI) and non-causal energy state information (ESI), the authors in [14] optimized the total energy cost of the point-to-point system under the energy harvesting constraint and the outage constraint over multiple fading slots. In [19], several online algorithms were proposed to minimize the grid energy expenditure based on a prior knowledge of hourlyvarying energy price. The authors in [21] investigated both multi-stage energy allocation problem and multi-cell energy balancing problem, and proposed power allocation and energy balancing algorithms to minimize the grid energy expenditure. For the second topic, the authors in [11] studied the power allocation problem in the point-to-point HPC systems, and both online and offline algorithms were proposed to maximize the throughput. In [23], they further investigated the energy efficiency in the orthogonal frequency division multiple access (OFDMA) based HPC systems. The authors in [24] proposed the EH based cognitive radio systems, where the secondary users are solely powered by the renewable energy. The tradeoff between the expected throughput of the EH secondary user and spectrum sensing was investigated. Besides, the authors in [18] investigates both the data rate maximization problem and the grid energy minimization problem in hybrid powered point-topoint systems via offline optimization and online optimization. Although the works in [11], [14]–[24] consider uncertainty of the CSI and the ESI, it is difficult to implement the proposed algorithms in practical systems because the statistical properties of the CSI and the ESI are either difficult or costly to obtain. Therefore, it is preferable to design online algorithms that are independent of the statistical distributions of the CSI and the ESI. Limited literature investigated the beamforming design in the HPC systems [17], [20], [22], [25]–[27]. Using the bounded CSI model, robust beamforming algorithms were proposed to minimize the short-term worst-case grid expenditure [20] and the long-term grid expenditure [22] subject to the worst-case SINR requirement for the coordinated multipoint systems. However, the harvested renewable energy is stored in batteries for further usage, which still suffers from the imperfection of the batteries. The authors in [17], [25] first proposed the HUT strategy in the HPC systems. Yet, the algorithms in [17], [25] are based on the instantaneous CSI and ESI, and the accumulated impact of previous CSI and ESI are ignored, which cannot be used to optimize the long-term performance metrics. Exploiting the uplink-downlink duality of capacity region of dirty paper code, the authors investigated the power allocation over the finite scheduling horizon of the HPC systems in [26]. Later, the authors in [27] extended the scheduling horizon to infinity, and solved the power allocation in the HPC systems via the stochastic subgradient method. Different from [17], [20], [22], [25], we study the long-term grid energy expenditure minimization subject to the packet reception rate requirements, which is modeled as sigmoid function. Instead using the well-known log-concave function for the data rate [15], [17], [20], [22]–[27], we model the packet reception rate as a sigmoid function, which captures effects of packet transmission failure and the data rate. Therefore, algorithm design based on the sigmoidal packet rate provides a realistic insight of the practical systems. However, the non-convexity of the sigmoid function gives new challenges in the beamforming algorithm design. B. Contributions We study the long-term grid energy expenditure minimization problem in the HPC systems with HUT strategy. In our system model, the BS is equipped with both smart meter and energy harvesters such that the BS is able to perform the two-way energy trading. Different from previous works in [15], [17], [20], [22]–[27], we consider the joint effect of the data rate and the transmission reliability during the packet transmission. The contributions of this work are summarized as follows. • By taking into account of the uncertainties of the renewable energy arrival and the packet arrival, we formulate the long-term grid energy expenditure minimization problem via the stochastic optimization theory [28]. In the formulated problem, we consider the effects of the channel quality and the packet reception failure while designing beamforming algorithms. Therefore, the considered optimization problem is a cross-layer one. • By leveraging the Lyapunov optimization technique, we reformulate the stochastic optimization problem, which is named as a per-frame grid energy plus weighted packet rate (GEWPR) minimization problem. The problem is NP-hard. • Two suboptimal beamforming algorithms are proposed based on the successive approximation beamforming (SABF) technique and the zero-forcing beamforming (ZFBF) technique. The convergence properties are established, and the corresponding computational complexities are analyzed. Numerical results are used to verify the performance of the packet delay and the grid energy expenditure of the proposed algorithms. By tuning a control parameter V , the suboptimal grid energy expenditure can be traded for the packet delay of each wireless node (WN). The proposed iterative SABF algorithm can achieve a lower packet delay and a lower grid energy expenditure than that of the ZFBF algorithm. The rest of this paper is organized as follows. In Section II, we describe the HPC system model and formulate the optimization problem. The tradeoff between the grid energy expenditure and the packet delay is revealed via the stochastic optimization technique, and a dynamic beamforming framework is proposed in Section III. In Section IV, two different techniques are used to facilitate the development of lowcomplexity beamforming algorithms in each frame. Simulation results are provided in Section V, and Section VI concludes this paper. Notations: Boldface letters refer to vectors (lowercase) or matrices (uppercase). C and N+ denote the set of complex numbers and the set of positive integers, respectively. k·k2 T H † refers to `2 -norm. (·) , (·) and (·) denote, respectively, the 3 transpose operation, the conjugate transpose operation and the pseudo-inverse operation. The notation diag (w) stands for the diagonal matrix whose diagonal elements consist of w. I and 0 denote an identity matrix and an all-zero matrix, respectively. B. Signal Model In this paper, each BS-WN link is assigned with a beamforming vector. Hence, the transmitted signal in the t-th frame at the BS is denoted by xTx (t) = II. S YSTEM M ODEL AND P ROBLEM F ORMULATION A. Overall System Description where wn (t) ∈ CNT ×1 and xn (t), respectively, represent the beamforming vector and the information-bearing signal for the 2 n-th BS-WN link in the t-th frame, where E[|xn (t)| ] = 1 with E [·] denoting the expectation operator. Thus, the received signal at the n-th WN in the t-th frame is denoted by . .. yn (t) = Smart Meter N X m=1 WN 2 BS Grid Energy WN 1 Fig. 1. An illustration of a single cell HPC system, where the BS can use energy from both smart grid and the harvested energy via solar panels and wind turbines. We consider the downlink transmission of an HPC system that consists of a BS and N WNs. The BS is equipped with NT > 1 antennas, and each WN is equipped with a single antenna. Without loss of generality, we assume there is no correlation among the transmission antennas at the BS1 . As shown in Fig. 1, the BS can use the energy from both smart grid and energy harvesting devices, such as solar panels and wind turbines. The BS can obtain the instantaneous CSI by exploiting the channel reciprocity and hand shaking signals. Let N = {1, 2, . . . , N } denote the set of WNs in the HPC system. All the WNs receive information from the BS via beamforming in the downlink period. The HPC system operates in discrete-time mode with the index of t-th frame denoting a unit duration [t, t + 1), t = {0, 1, 2, . . .}; therefore, the “power” and “energy” can be used interchangeably. We assume the channel fading and renewable energy arrival follow the block-based model, where the channel coefficients and the EH rate remain constant during each frame and vary over different time scales. Specifically, the channel coefficients change over different frames, and the EH rate fluctuates over several frames. This assumption is reasonable because the coherence time of the renewable energy arrival is generally longer than the channel coherence time [31]. In this paper, we do not consider the energy storage capability at the BS due to the low utilization efficiency of the renewable energy. Via the smart meter, the BS can either purchase energy from the smart grid due to the shortage of the harvested energy or sell the extra harvested energy to the smart grid in order to reduce the grid energy expenditure of the HPC system. 1 This (1) wn (t) xn (t) n=1 WN N Harvested Energy N X corresponds to antennas that are physically separated by at least half of the wavelength [29], [30]. hH n (t) wm (t) xm (t) + zn (t) , n ∈ N (2)  where zn (t) ∼ CN 0, σn2 denotes the noise-plusbackground-interference2 at the n-th WN; hn (t) ∈ CNT ×1 is the complex channel coefficient vector of the n-th BS-WN link in the t-th frame; each entry of hn (t) is a circularly-symmetric complex Gaussian random variable with mean zero and variance d−χ n , where dn and χ are, respectively, the link length of the n-th BS-WN link and the pathloss exponent. Here, we note that the vector hn (t) captures the composite effects of multipath fading and pathloss. In (2), wm (t) and xm (t) represent the beamforming vector and the information-bearing signal of the m-th BS-WN link in the t-th frame, respectively. The received signal-to-interference-plus-noise ratio (SINR) at the n-th WN in the t-th frame is denoted as hH n (t) wn (t) SINRn (t) = N P m=1,m6=n hH (t) w n m 2 (t) . 2 + (3) σn2 On the other hand, a certain amount of power is consumed to enable the information transmission [3]. In particular, the power consumption of the considered HPC system in the t-th frame, Ptot (t), is denoted as Ptot (t) = N 1 X 2 kwn (t)k2 + Psp ψ n=1 (4) where the constant ψ is the power amplifier efficiency; the term Psp is the power consumption of signal processing, and it is calculated as [3]  Psp = Psp,b 0.87 + 0.1NT + 0.03NT2 (5) where Psp,b is set at 115mW in the HPC system. In (5), the linear term of NT represents energy overhead due to multiple-input single-output (MISO) pilots, and the quadratic term stands for MISO signal processing overhead. 2 We model the noise-plus-background-interference as a circularly symmetric complex Gaussian random variable due to the large quantities of interferers from the other cells [32]. 4 C. Grid Energy Cost Model Assuming the rate of harvesting energy3 remains constant during each frame, we obtain the amount of harvested energy by the BS during t-th frame as Ehav (t). We set the price for purchasing (selling) a unit power from (to) the smart grid as ab > 0 (as > 0). Thus, the grid energy expenditure in the t-th frame is calculated as HPC system. We denote the normalized backlog4 of the nth traffic queue in the t-th frame as qn (t). As a result, the backlog of the n-th traffic queue evolves as + qn (t + 1) = [qn (t) − Un (t)] + Un,req (t) , n ∈ N (10) (6) + where [x] = max [x, 0]. To avoid the operator of the HPC system making non-justifiable profit, the operator of the smart grid should set ab ≥ as > 0. where Un,req (t) denotes the normalized packet arrival process with Un,req (t) ∈ [0, 1]. Here, the normalized packet arrival process Un,req (t) is independent and identically distributed over all frames with E [Un,req (t)] = un,req . Definition 1: (Mean Rate Stable [28]) A discrete-time = 0. queue Ξ (t) is mean rate stable if lim E[|Ξ(t)|] t t→∞ A mean rate stable discrete-time queue indicates that the time average arrival rate is smaller than or equal to the time average departure rate. D. Packet Correct Reception Rate and Traffic Queues E. Problem Formulation For the wireless data traffic, multiple modulation and coding schemes (MCSs) can be used to achieve tradeoff between the data rate and the transmission reliability [30]. High order modulation schemes, which allow more information bits to be transmitted per symbol, shorten the Euclidean distance of the signal constellation points. Therefore, more errors occur in the decoding process. Various coding schemes, accompanied with the modulation schemes, are used to adapt to the channel variations. Decreasing the coding rate leads to a decrease in the effective data rate. Generally, a packet consists of L information bits. An error occurs when one of the L information bits is erroneously decoded. Hence, the correct packet reception rate at the nth WN can be denoted by Based on the aforementioned description, the grid energy expenditure minimization problem in the HPC with HUT is formulated mathematically. After obtaining the instantaneous CSI and the ESI, the BS performs the dynamic beamforming with the following constraints: • Traffic queue constraints: + + G (t) = ab [Ptot (t) − Ehav (t)] − as [Ehav (t) − Ptot (t)] Πn (t) = Mn L Y l=1 (1 − πl (SINRn (t))) (7) where Mn and πl (SINRn (t)) denote, respectively, the packet transmission rate for the n-th WN and the error probability of the l-th information bits of the packet in the t-th frame. Using the approximation method developed in [33], we obtain the correct packet reception rate as Πn (t) = Mn 1 + exp (−cn (10 log10 (SINRn (t)) − bn )) (8) where cn and bn are MCS specific parameters. Dividing the packet departure process and packet arrival process at the n-th WN by Mn , the normalized packet departure process of the n-th WN in the BS is denoted by Un (t) = 1 . 1 + exp (−cn (10 log10 (SINRn (t)) − bn )) (9) As the BS, N traffic queues are used to buffer the random arrival packets for the corresponding N BS-WN links in the 3 The BS can obtain real-time solar radiation rate and wind rate. Based on the real-time solar radiation rate and the wind rate, the BS can estimate the amount of harvested energy due to the fact that the real-time solar radiation rate and the wind rate change slowly when compared with the variation of the channel state information. Traffic queues qn (t) are mean rate stable, n ∈ N . • WNs’ SINR constraints: SINRn (t) ≥ Γn,req , n ∈ N • (11) (12) where Γn,req denotes the instantaneous SINR requirements of the n-th WN. This set of constraints is used to guarantee that the packet error probability of each WN is at an acceptable level in the t-th frame. Transmission power constraint: Due to the circuit limitation, the transmission power is limited under a threshold N X n=1 2 kwn (t)k2 ≤ P max (13) where P max represents the maximum transmission power of the BS. In this paper, we perform the dynamic beamforming to minimize the long-term grid energy expenditure in the HPC system with HUT strategy under the traffic queue constraints, WNs’ SINR constraints and transmission power constraint. To incorporate the uncertainty of the renewable energy arrival, the objective function is defined as the time average expectation of the grid energy expenditure. Therefore, we can formulate the corresponding problem via a stochastic optimization model as min wn (t) T −1 1 X E [G (t)] T →∞ T t=0 lim s.t. (11) − (13). (14a) (14b) The optimization problem in (14) is cross-layer optimization because it considers the effects of the channel quality and 4 We note that the packet departure process and the packet arrival process are normalized by Mn . Hence, the backlog of the traffic queue is also normalized by Mn . 5 the packet reception failure while designing beamforming algorithms. Moreover, the optimization problem in (14) can also be used to reveal the tradeoff between the grid energy expenditure and packet delay quantitatively. Remark 1: In our formulation, we consider that HPC system utilizes the HUT strategy to use the harvested energy; therefore, we only consider the traffic queues of the UEs. The case that jointly consider the traffic queues and the energy queue will be investigated in our future work. III. DYNAMIC C ROSS -L AYER B EAMFORMING VIA S TOCHASTIC O PTIMIZATION By leveraging the stochastic optimization theory [28], we reformulate (14) as a problem whose objective function is the grid energy expenditure plus the weighted packet rate. We deal with the time average issue in the objective function and the constraints of the optimization problem (14) by constructing a Lyapunov drift-plus-penalty function with respect to (14a) and (11) as ∆ (q (t)) + V E [ G (t)| q (t)] (15) where q (t) , [q1 (t) , q2 (t) , . . . , qN (t)] and the introduced control parameter V > 0; the one frame conditional Lyapunov drift function ∆ (q (t)) is defined as ∆ (q (t)) , i 1 1 h 2 2 E kq (t + 1)k2 q (t) − kq (t)k2 2 2 (16) where E [·] is for the channel coefficients {hn (t)}n∈N and the beamforming vectors wn (t). Lemma 1: Supposing the channel coefficients {hn (t)}n∈N , are independent and identically distributed over different frames. We obtain the upper bound of the Lyapunov driftplus-penalty in (15) as [28] ∆ (q (t)) + V E [ G (t)| q (t)] ≤ N + V E [ G (t)| q (t)] + N X n=1 qn (t) E [ Un,req (t) − Un (t)| q (t)] . (17) Proof: See Appendix A. It can be shown that any solution that minimizes righthand side (RHS) of (17) subject to (12) and (13) given the channel coefficients {hn (t)}n∈N and the backlog of traffic queues q (t) is also a solution to the original problem (14). The detailed proof will be presented in Proposition 1. Thus, the RHS of (17) is useful in developing the dynamic cross-layer beamforming algorithm. The introduced control parameter V is used to control the tradeoff between the grid energy expenditure and the average backlog of the traffic queues. In the RHS of (17), we observe that the constant N and the term E [ Un,req (t)| q (t)] have no effect on designing the beamforming vectors wn (t). Besides, minimizing the conditional expectation terms E [ G (t)| q (t)] and E [ −Un (t)| q (t)] can be manipulated as minimizing G (t) and −Un (t) given q (t) and {hn (t)}n∈N according to the principle of opportunistically minimizing an expectation [28, Section 1.8]. As a result, we can simplify the original optimization problem (14) according to (17) as the GEWPR minimization problem min V G (t) − wn (t) s.t. N X N X qn (t)Un (t) (18a) n=1 2 kwn (t)k2 ≤ P max (18b) SINRn (t) ≥ Γn,req , ∀n. (18c) n=1 The optimization problem (18) has non-convex objective function and non-convex constraints. Following the similar arguments in [34], we can prove the optimization problem (18) is NP-hard. Hence, we are motivated to obtain the suboptimal solutions to the optimization problem (18). Based on the beamforming technique, the methods to check the feasibility are different. We will review the feasibility check methods separately for the beamforming techniques. Algorithm 1 Dynamic Beamforming Algorithm 1: At the start of each frame, the BS observes the backlogs of traffic queues qn (t), complex channel coefficient vectors {hn (t)}n∈N and the amount of harvested energy Ehav (t). 2: if the optimization problem (18) is feasible then 3: The BS obtains the utility of each WN via solving the optimization problem (18) suboptimally. 4: else 5: The BS obtains the utility of each WN via randomly choosing the beamforming vector {wn (t)}n∈N , under the transmission power constraint (18b). 6: end if 7: The BS updates the backlogs of virtual queues qn (t) according to (18). Proposition 1: With the independent and identically distributed {hn (t)}n∈N , and supposing [u1,req , . . . , uN,req ] ∈ λ + , where λ and  denotes the capacity region of (14) achieved by the suboptimal solutions and a small positive constant.h The initial i expected backlog of traffic queues sat2 isfies E kq (t)k2 < ∞. The properties of Algorithm 1 are described as follows: 1) Each virtual queue qn (t) is mean rate stable, n ∈ N . 2) The total grid energy expenditure is upper bounded by t−1 1X N E [G (τ )] ≤ + GSUBOPT t→∞ t V τ =0 lim (19) where GSUBOPT is the maximum suboptimal value of the grid energy cost in (18). 3) The average queue backlog of the traffic queues is upper bounded by  t−1 N N + V GSUBOPT − Gmin 1 XX lim E [qn (τ )] ≤ (20) t→∞ t  τ =0 n=1 where Gmin is the smallest value of grid energy expenditure. Proof: See Appendix B. We obtain two conclusions from Proposition 1: 1) the output of the Algorithm 1 is a feasible solution to the optimization problem in (14); and 2) the tradeoff between the grid energy expenditure and the packet delay is quantitatively revealed. 6 Remark 2: The proposed dynamic cross-layer beamforming framework does not have limitation on the number of antennas of the WNs. Hence, the developed dynamic beamforming framework can be used to the HPC systems with multipleinput and multiple-output channels. IV. S UBOPTIMAL S OLUTIONS For brevity, we omit the frame index in this section. We note that the constraints in (18c) require the BS to consume a certain amount of power. However, the transmission power of the BS is limited. The optimization problem (18) can be infeasible under certain CSI and network scenarios when Γn,req is too high, n ∈ N . Before solving (18), the feasibility of (18) should be checked via solving the following optimization problem find {wn } N X n=1 2 kwn k2 ≤ P max (21) min V G − s.t. N X qn n=1 1 (22a) 1 + exp (−cn (10 log10 (αn ) − bn )) 2 kwn k2 ≤ P max (22b) SINRn ≥ Γn,req , ∀n (22c) n=1 SINRn ≥ αn , ∀n. (22d) Note that the constraints in (22d) are active at each suboptimal point; otherwise, the objective function (22a) can take a strictly smaller value by increasing {αn }n∈N . Based on this observation, we can also conclude that each local optimal value of αn makes the following inequality holds, i.e., αn∗ ≥ Γn,req , ∀n (23) where represents a local optimal value of αn . The major challenges in solving (22) are two folds: 1) the sum-of-ratios component in the objective function (22a); 2) the non-convex constraints (22c) and (22d). We leverage the Lagrangian duality theorem to deal with sum-of-ratios component in (22a) and obtain an equivalent form of the optimization problem (22). αn∗ wn ,αn s.t. N X n=1 (24a) (24b) N X $n γn exp (−cn (10 log10 (αn ) − bn )) (25a) 2 kwn k2 ≤ P max (25b) SINRn ≥ Γn,req , ∀n (25c) n=1 SINRn ≥ αn , ∀n. (25d) Proof: See Appendix C. We note that the grid energy expenditure G in (25a) can be reformulated as + The optimization problem (21) can be solved by the standard optimization techniques, such as a second-order cone programming (SOCP) [35] and uplink-downlink duality based algorithm [36]. To deal with the non-convexity of the SINRn in the objective function (18a), we introduce positive auxiliary variables {αn }n∈N . After some mathematical manipulation, the optimization problem (18) is recast as wn ,αn min V G + G = (ab − as ) [Ptot − Ehav ] + as [Ptot − Ehav ] SINRn ≥ Γn,req , ∀n. N X 1 1 + exp (−cn (10 log10 (αn ) − bn )) qn $n = 1 + exp (−cn (10 log10 (αn ) − bn )) γn = such that an optimization problem has the same KKT conditions as in (22), which is shown as A. Beamforming for a Given Frame s.t. Proposition 2: If {wn , αn }n∈N satisfy the Karush-KuhnTucker (KKT) conditions of the optimization problem (22), we can conclude that there exist parameters (26) which PN is a convex function. In (25a), the second term n=1 $n γn exp (−cn (10 log10 (αn ) − bn )) is strictly convex. Hence, the objective function in (25a) is a strictly convex function. Proposition 2 shows that the objective function in sum-ofratios form of the optimization problem (22) can be equivalently transformed into a summation form with introduced auxiliary variables. However, the objective function in the summation form is strictly convex, which reduces the complexity in the design of the algorithm. Hereinafter, the design of the algorithm is based on the optimization problem (25) with (24a) and (24b). B. Convex Approximation Based Beamforming To deal with the nonconvexity, we use the successive approximation technique. Introducing another set of auxiliary variables βn , n ∈ N , we can reformulate the optimization problem (25) as min wn ,αn ,βn s.t. N X $n γn exp (−cn (10 log10 (αn ) − bn )) N X kwn k2 ≤ P max n=1 n=1 +VG (27a) 2 (27b) hH n wn ≥ β n H p √ (27c) Γn,req , ∀n hn wn ≥ βn αn , ∀n v u N X u tσ 2 + hH n n wm m=1,m6=n   Im hH n wn = 0, ∀n. (27d) 2 ≤ βn , ∀n (27e) (27f) 7 We justify the equivalence between the optimization problems (25) and (27) via the following two perspectives: 1) forcing the phase of the term hH n wn to zero does not change the value of the objective function as rotating the phase of wn leads to the same value of hH n wn ; 2) constraints in (27e) are active, and see Appendix D for detailed proof. We observe that the objective function in the optimization problem (27) is convex, and the only set of non-convex constraints is in (27d). The constraints in (27d) are equivalent to 2 hH n wn ≥ βn2 , ∀n (28) αn where the left hand side is a quadratic-over-linear term, which is a joint convex function of wn and αn and has a linear lower bound as   H 2  (τ ) H (τ ) 2 2Re w h h w n n n n hH n wn hH n wn  αn ≥ − (τ ) (τ ) αn αn αn ) = Ψ(τ n (wn , αn ) , ∀n (29) (τ ) (τ ) where τ represents the iteration index; wn and αn are, respectively, the beamforming vector and the auxiliary variable for the n-th WN-BS link in the τ -th iteration. Using (29), we obtain the convex approximation of the non-convex constraints in (27d) successively in the τ -th iteration as ) 2 Ψ(τ n (wn , αn ) ≥ βn . (30) As a result, we finally obtain the following convex optimization problem as min wn ,αn ,βn s.t. VG+ N X n=1 N X n=1 $n γn exp (−cn (10 log10 (αn ) − bn )) 2 kwn k2 ≤ P max hH n wn ≥ β n ) Ψ(τ n p Γn,req , ∀n (wn , αn ) ≥ βn2 , ∀n i σn , hH ≤ βn , ∀n n W−n 2   Im hH n wn = 0, ∀n h (31) where W−n = [w1 , . . . , wn−1 , wn+1 , . . . , wN ], n ∈ N . Based on (24a) and (24b), we summarize the procedure of the SABF algorithm in Algorithm 2. Proposition 3: The proposed SABF algorithm converges to a point that satisfies the KKT conditions of (22). Proof: See Appendix E. C. Zero-Forcing Beamforming In previous subsection, we have obtained the SABF algorithm for the optimization problem (22) which introduces multiple auxiliary variables. As a result, solving such a problem incurs high computation complexity. Therefore, we consider in this subsection a suboptimal solution with lower computation Algorithm 2 SABF Algorithm 1: BS sets the iteration index τ = 0, the stop threshold , the maximum number of iteration T max and o traffic queue backlog qn (t). n initial (0) . 2: BS obtains a feasible point wn n o n o n∈N n o (0) (0) (0) 3: BS updates $n , γn and αn via (70), (71) n∈N n∈N n∈N and (3), respectively. 4: repeat 5: τ := τn + 1 o (τ −1) (τ −1) (τ −1) 6: With wn , γn , $n , BS solves the optimization n∈N (τ ) problem (31) and obtains the beamforming vector wn and correspond(τ ) (τ ) ing auxiliary variables αn and βn for τ -th iteration. 7: BS updates the following parameters: (τ ) wn (τ ) γn (τ ) $n (τ −1) (32) = wn 1      (τ −1) − bn 1 + exp −cn 10 log10 αn qn      = (τ −1) 1 + exp −cn 10 log10 αn − bn = h i (τ ) (τ ) (τ ) where γ (τ ) , γ1 , γ2 , . . . , γn h i (τ ) (τ ) (τ ) $1 , $2 , . . . , $n . 8: until γ (τ ) −γ (τ −1) γ (τ −1) k k2 2 ≤  and $ (τ ) −$ (τ −1) k$(τ −1) k2 and 2 $ (τ ) (33) (34) , ≤  or τ > T max . complexity via the ZFBF technique, where the beamforming vectors are designed to null the interference among WNs. However, to perform the ZFBF, the number of transmission antennas should be equal to or larger than the number of WNs, i.e., NT ≥ N . To derive the ZFBF vector, we first decouple the power pn of the n-th WN from the corresponding beamforming vector wn , n ∈ N . Then, we define the complex channel coefficient matrix and the beamforming matrix for all WNs, respectively, as H , [h1 , h2 , . . . , hn ] and W , [w1 , w2 , . . . , wn ]. Accordingly, the signal model (2) can be shown in compact form as √ (35) y = H H W diag ( p) x + z where the power vector, signal vector and noise vector are respectively denoted by p , [p1 , p2 , . . . , pn ], x , [x1 , x2 , . . . , xn ] and z , [z1 , z2 , . . . , zn ]. Thus, the ZFBF matrix is written as  †  −1 WZF = H H = H H H H . (36) With (36), we obtain the beamforming vector for the n-th BSWN link under the ZFBF technique as wn,ZF = WZF (:, n) , ∀n. (37) Because H H WZF = I, we obtain the received signal model √  for all WNs as y = diag p x + z. As a result, the received signal-to-noise ratio (SNR) of the n-th WN is denoted by SNRn = pn , ∀n. σn2 (38) 8 Using (37) and (38), we can obtain the optimization problem (25) under the ZFBF technique as      N X pn min $n γn exp −cn 10 log10 − b n pn σn2 n=1 (39a) + V G̃ s.t. N X n=1 2 pn kwn,ZF k2 ≤ P max (39b) pn ≥ Γn,req σn2 , ∀n (39c) where #+ N 1 X 2 G̃ = (ab − as ) pn kwn,ZF k2 + Pcir − Ehav ψ n=1 " N # 1 X 2 − as pn kwn,ZF k2 + Pcir − Ehav . (40) ψ n=1 " Note that the feasibility check of (39) is a linear problem as find {pn } s.t. N X n=1 2 which is easy to solve. The corresponding (24a) and (24b) reduce to  1  D. Complexity Discussion The ZFBF based optimization problem (39) contains N variables, and the SABF based optimization problem (31) contains (NT + 2) N variables. The computational complexities of SABF algorithm and ZFBF algorithm are, respectively,   3 3 O (NT + 2) N and O N 3 via the interior point method [37]. Obviously, the computation complexity for solving (39) is lower than that for solving (27) via the same numerical method. V. S IMULATION R ESULTS In this section, we present simulation results to demonstrate the performances of the proposed algorithms. The simulation parameters are specified in Table I. TABLE I S IMULATION PARAMETERS S ETTING (41) pn kwn,ZF k2 ≤ P max pn ≥ Γn,req σn2 , ∀n    1 + exp −cn 10 log10 σpn2 − bn n qn  .     $n = 1 + exp −cn 10 log10 σpn2 − bn γn = Proposition 4: The proposed ZFBF algorithm converges to a KKT point of (22) with NT ≥ N . Proof: The proof is similar to the that of the Proposition 3, and we omit the proof due to the space limitation. (42a) (42b) n Parameters Number of UEs, N Number of antenna on the BS, NT 2 Noise plus background interference power, σn Circuit power cost of the BS, Psp,b Maximum TX power of each RRH, P max Minimum SINR requirement, Γn,req , uavg Distance between WN and RRH Price for buying a unit energy, ab Price for selling a unit energy, as Forming factors, bn , cn Pathloss factor, χ Values 3 4 10−3 mW 115 mW 200 mW 2 dB, 0.3 10 m 1.2 Cents/mW 1 Cents/mW 20, 0.451 3 Based on above analysis, we propose the ZFBF algorithm, and the detailed procedure is summarized in Algorithm 3. A. Iteration of the SABF and ZFBF Algorithms 1: BS sets the iteration index τ = 0, the stop threshold  and the maximum number of iteration T max , traffic queue backlog qn (t), ∀n. (0) 2: BS obtains anfeasible o point p nvia (41). o (0) (0) 3: BS updates $n and γn via (70) and (71), respecn∈N n∈N tively. 4: repeat 5: τ := τn + 1 o (τ −1) (τ −1) 6: With γn , $n , BS solves the optimization problem n∈N (39) and obtains the power vector p(τ ) for the τ -th iteration. 7: BS updates the following parameters: (τ ) γn  = 1 + exp −cn (τ ) $n =  1 10 log10 qn  (τ −1) pn 2 σn  − bn       (τ −1) 1 + exp −cn 10 log10 pnσ2 − bn (43) (τ ) (τ ) (τ ) where γ (τ ) , γ , γ2 , . . . , γn h i 1 (τ ) (τ ) (τ ) $1 , $2 , . . . , $n . 8: until γ (τ ) −γ (τ −1) γ (τ −1) k k2 2 ≤  and i $ (τ ) −$ (τ −1) k$(τ −1) k2 and 2 $ (τ ) ZFBF SABF 25 20 15 10 5 (44) 0 1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930 Channel Realization Index n h 30 Number of Iterations Algorithm 3 ZFBF Algorithm , ≤  or τ > T max . Fig. 2. Iteration numbers for the SABF and ZFBF algorithms, obtained for 30 different channel realizations with control parameter V = 0.001 and initial traffic queue backlog qn (0) = 5. Figure 2 illustrates the iteration numbers of the SABF algorithm and the ZFBF algorithm obtained for 30 different 9 Fig. 3. An illustration of the variations of the backlog of the traffic queues with different control parameters V. channel realizations. We select the initial point of the SABF algorithm as the output of the ZFBF algorithm when the ZFBF algorithm is feasible; otherwise, we randomly select a feasible point for the SABF algorithm in the feasible region. As a result, the iteration numbers of the SABF algorithm is counted as the summation of iterations for finding the feasible points via the ZFBF algorithm and the iterations for finding the local optimal solution. We observe that in most of the considered channel realizations, the SABF algorithm and the ZFBF algorithm can converge to the local optimal value within 20 iterations. B. Dynamics of Traffic Queues and Grid Energy Expenditure Figure 3 illustrates the dynamics of the traffic queue of each WN in 4000 frames. This observation demonstrates that combining the proposed dynamic beamforming framework with the proposed SABF algorithm and ZFBF algorithm can stabilize the traffic queues in the HPC system. We also observe that a larger V leads to a larger backlog of the traffic queue of each WN, which indicates a larger packet delay of each WN according to the Little’s law. In other words, the packet delay of each WN increases with the increasing control parameter V. Figure 4 illustrates that the dynamic of the grid energy expenditure over 4000 frames. We consider that the energy arrival varies per 1000 frames. The amount of energy arrival of each frame in the four time durations are 200 mW, 100 mW, 150 mW and 300 mW. The price of selling a unit of harvested energy is 1 Cent/mW, and the price of purchasing a unit of grid energy varies per 500 frames. The prices of purchasing a unit of grid energy for the 8 segments are 1.2 Cents/mW, 1.3 Cents/mW, 1.9 Cents/mW, 1.8 Cents/mW, 1.6 Cents/mW, 1.7 Cents/mW, 1.2 Cents/mW and 1.1 Cents/mW. We observe that the average grid energy consumption fluctuates at the 500th, 1000-th, 1500-th, 2000-th, 2500-th, 3000-th, 3500-th and 4000-th frame. For the 500-th, 1500-th, 2500-th and 3500-th frame, the fluctuations of the average grid energy consumption is due to the variation of the price of purchasing grid energy. However, the fluctuations of the average grid energy expenditure for the 1000-th, 2000-th, 3000-th and 4000-th frame are two folds: 1) the varying price of purchasing grid energy; 2) the varying amount of harvested energy. We also observe that the BS usually uses the maximum transmission power when the control parameter V is 0.001, and the BS rarely uses the maximum transmission power with V = 0.007. This observation indicates that the average transmission power is reduced via increasing V ; therefore, the proposed Algorithm 1 can effectively control the average transmission power via tuning V . C. Tradeoff Between Grid Energy Expenditure and Packet Delay Figures 5 and 6 show the tradeoff between the grid energy expenditure and the delay of WN under different transmission power budgets of the BS and different minimum QoS requirements, respectively. From Figs. 5(a) and 6(a), we observe that the average grid energy expenditure decreases monotonically with the control parameter V . The rate of average grid energy expenditure decreasing becomes diminishing as the value of V increases. On the other hand, the packet delay increases with V as shown in Figs. 5(b) and 6(b). Therefore, the operator of the HPC system can tune the control parameter to achieve the 10 700 ZFBF INS SABF INS ZFBF AVG SABF AVG 600 500 400 300 200 100 0 −100 500 1000 1500 2000 2500 3000 3500 4000 Average Grid Energy Consumption (Cents) Average Grid Energy Consumption (Cents) 700 ZFBF INS SABF INS ZFBF AVG SABF AVG 600 500 400 300 200 100 0 −100 500 Control Parameter, V = 0.001 1000 1500 2000 2500 3000 3500 4000 Control Parameter, V = 0.007 (a) V = 0.001 (b) V = 0.007 Fig. 4. An illustration of the variations of the grid energy expenditure. 360 max Average Grid Energy Expenditure (Cents) Average Grid Energy Expenditure (Cents) 400 ZFBF, P = 23 dBm SABF, Pmax = 23 dBm max ZFBF, P = 27 dBm SABF, Pmax = 27 dBm 350 300 250 200 150 1 2 3 4 5 6 Control Parameter, V n,req = 2 dB SABF, Γn,req = 2 dB 320 ZFBF, Γn,req = 8 dB SABF, Γn,req = 8 dB 300 280 260 240 220 200 180 160 7 ZFBF, Γ 340 1 2 3 4 5 6 Control Parameter, V −3 x 10 (a) 7 −3 x 10 (a) 4.5 3.5 5 Average Service Time (Frames) Average Service Time (Frames) max ZFBF, P = 23 dBm SABF, Pmax = 23 dBm max ZFBF, P = 27 dBm SABF, Pmax = 27 dBm 4 3 2.5 2 1.5 ZFBF, Γn,req = 2 dB 3.2 SABF, Γn,req = 2 dB 3.1 ZFBF, Γ 4.5 n,req = 8 dB 3 SABF, Γn,req = 8 dB 4 4.5 5 5.5 −3 x 10 3.5 3 2.5 2 1.5 1 1 2 3 4 5 Control Parameter, V 6 7 −3 x 10 1 2 3 4 5 Control Parameter, V 6 7 −3 x 10 (b) (b) Fig. 5. Tradeoff between the grid energy expenditure and the packet delay of WN with different power budgets. Fig. 6. Tradeoff between the grid energy expenditure and the packet delay of WN with different SINR requirements. target grid energy expenditure at the expense of the packet delay of the UEs. Besides, the SABF algorithm performs better than the ZFBF algorithm in the average grid energy expenditure and the packet delay under different parameter settings. As shown in Fig. 5(a), the performance gain in average grid energy expenditure of the case P max = 27 dBm diminishes compared with the case P max = 23 dBm when the value of V is greater than 0.005. However, the packet 11 delay of the case P max = 27 dBm can still have around 1% improvement than the case P max = 23 dBm. This is due to the fact that the BS with more transmission power budget can enhance the sigmoidal packet departure rate when the channel condition is severe. As a result, the packet delay with P max = 27 dBm can reduce the packet delay compared with the case P max = 23 dBm. D. The Impact of SINR Requirements on Grid Energy Expenditure and Packet Delay Average Grid Energy Expenditure (Cents) 260 ZFBF, V = 0.003 SABF, V = 0.003 ZFBF, V = 0.005 SABF, V = 0.005 ZFBF, V = 0.006 SABF, V = 0.006 250 240 230 220 210 200 190 180 170 160 0 2 4 6 8 SINR Requirements per UE (dB), Γn, req obtain a near optimal solution in the high SINR region, for example, Γn,req ≥ 10 dB in our setting. VI. C ONCLUSION We developed the cross-layer beamforming in the HPC systems with HUT strategy, where the BS can purchase electricity from the smart grid if the harvested energy is insufficient and sell the surplus harvested energy to generate revenue. We leverage a stochastic optimization model to formulate the long-term grid energy expenditure minimization problem. Reformulating the stochastic optimization model as a per-frame GEWPR minimization problem, we revealed tradeoff between the long-term grid energy expenditure and the packet delay. For example, setting a large value of control parameter V , the grid expenditure can be reduced at the expense of large packet delay of each WN. Therefore, the operators can set the control parameter according to the arrival rate of the renewable energy. Due to the NP-hardness of the per-frame GEWPR problem, two suboptimal algorithms, namely SABF algorithm and ZFBF algorithm, were proposed. The SABF algorithm outperforms the ZFBF algorithm in both the long-term grid energy expenditure and the packet delay at the expense of higher computational complexity. 10 A PPENDIX A P ROOF OF L EMMA 1 (a) Grid energy expenditure v.s. control parameter V . 3.8 Substituting (10) into (16), we have Average Service Time (Frames) 3.6 ∆ (q (t)) 3.4 3.2 ZFBF, V = 0.003 SABF, V = 0.003 ZFBF, V = 0.005 SABF, V = 0.005 ZFBF, V = 0.006 SABF, V = 0.006 2.8 2.6 2.4 2.2 2 N   1X  2 E qn (t + 1) − qn2 (t) |q (t) 2 n=1   N (a) X  1 2 2 E ≤ qn (t) + Un2 (t) + Un,req (t) 2 n=1  N X  1 2 + E qn (t) (Un,req (t) − Un (t)) − qn (t) |q (t) 2 n=1 = 3 0 2 4 6 8 SINR Requirements per UE (dB), Γn, req 10 (b) Delay v.s. control parameter V . Fig. 7. The impact of SINR requirements on the grid energy expenditure and the delay of WN. Figure 7 illustrates the impact of SINR on the grid energy expenditure and the delay of WN. As shown in Fig. 7(a), the grid energy expenditure increases monotonically with the instantaneous SINR requirements for the SABF algorithm and the ZFBF algorithm. This can be explained by the fact that the more power needs to be consumed in order to satisfy the instantaneous SINR requirements. From Fig. 7(b), we also observe that the packet delay of the proposed SABF algorithm performs better than that of the ZFBF algorithm. Increasing the instantaneous SINR requirements leads to the gap of the packet delay diminishes between the SABF algorithm and the ZFBF algorithm. This is due to the fact that the ZFBF algorithm can (b) ≤N+ N X n=1 E [qn (t) (Un,req (t) − Un (t)) |q (t) ] (45)  2 + where (a) is due to the fact [a − b, 0] + c ≤ a2 + b2 + c2 + 2a (c − b) with a, b, c ≥ 0, and (b) is due to the fact that 2 the upper bound of 21 Un2 (t) + Un,req (t) is one from the the definition in (9). Submitting the penalty term V E [G (t) |q (t) ] to both sides of (45), we obtain (17). A PPENDIX B P ROOF OF P ROPOSITION 1 The major steps follow the proof of [28, Theorem 4.2], and we will only sketch the proof for our formulated optimization problem. The optimization problem (18) is NP-hard; therefore, we are motivated to seek the suboptimal solutions within the 12 feasible region. Given {hn (t) , qn (t)}n∈N , we defined the RHS of (17) as  f {wn (t)}n∈N = N + V E [G (t) |q (t) ] + N X n=1 qn (t) E [ Un,req (t) − Un (t)| q (t)] ∆ (q (t)) G (t) = G̃ {wn (t)}n∈N  Un (t) = Ũn {wn (t)}n∈N . ≤N + V (GSUBOPT − E [ G (t)| q (t)]) (47) (48) Generally, the suboptimal solutions lead to a gap between the optimal value of (46) and the suboptimal value of (46), and this gap is generally difficult to obtain. Given {hn (t) , qn (t)}n∈N , we denote the suboptimal solutions and the optimal solution, OPT respectively, as {wn∗ (t)}n∈N  and {w∗n (t)}n∈N . Moreover, OPT we have f {wn (t)}n∈N ≤ f {wn(t)}n∈N . Therefore,  the term ℵ equals to f {wnOPT (t)}n∈N − f {wn∗ (t)}n∈N , which is smaller than or equals to zero. Thus, the upper bound of RHS of (17) is denoted by ∆ (q (t)) + V E [ G (t)| q (t)]  ≤ℵ + f {wn∗ (t)}n∈N  ≤f {wn∗ (t)}n∈N . (49) When [u1,req , . . . , uN,req ] ∈ λ +  and the channel coefficients {hn }n∈N are independent identically distributed over different frames, we have the following two inequalities E [ G∗ (t)| q (t)] ≤ GSUBOPT + δ E [ Un∗ (t)| q (t)] ≥ un,req +  (50) (51) where GSUBOPT is the maximum suboptimal value of (14). Here, the value of δ is equal to zero or arbitrarily close to zero [28, Appendix 4.A]. Although it is possible to stabilize the traffic queues when [u1,req , . . . , uN,req ] is outside the capacity region achieved by the suboptimal solutions λ, the computation complexity is extremely high and impractical for the real systems. Once [u1,req , . . . , uN,req ] is outside the capacity region λ, we can improve the maximum transmission power in order to stabilize the traffic queues at the design stage of the HPC system. Besides, the expected grid energy expenditure is lower bounded as E [G (t)] ≥ Gmin (52) where Gmin is the smallest value of grid energy expenditure. This constraint is reasonable because any physical parameter is bounded below and above in practical systems. Substituting (50) and (51) into (49) and letting δ → 0, we obtain ∆ (q (t)) + V E [ G (t)| q (t)] ≤N + V GSUBOPT −  N X n=1 qn (t). ≤N + V (GSUBOPT − E [ G (t)| q (t)]) −  (46) where  1) In order to prove the first part, we make some algebraic manipulation of (53) as (53) N X qn (t) n=1 (54) Taking the iterated expectation over q (t) of (54), we have i 1 h i 1 h 2 2 E kq (t + 1)k2 − E kq (t)k2 2 2 ≤N + V (GSUBOPT − E [G (t)])  ≤N + V GSUBOPT − Gmin . (55) Using the telescoping sum over {0, 1, 2, . . . , t − 1}, we obtain h i 2 E kq (t)k2 h i  2 ≤2t N + V GSUBOPT − Gmin + E kq (0)k2 . (56) On the other hand, we have h i 2 Var [|qn (t)|] = E |qn (t)| − E2 [|qn (t)|] ≥ 0 h i h i 2 2 E |qn (t)| ≤ E kq (t)k2 . (57) (58) Substituting (57) and (58) into (56) and performing some algebraic operations, we can achieve ≤ E [|qn (t)|] r h i 2 2t (N + V (GSUBOPT − Gmin )) + E kq (0)k2 . (59) Dividing (59) by t and letting t → ∞, we obtain 1 E [|qn (t)|] = 0. (60) t→∞ t Hence, we conclude that the virtual queue is mean rate stable. 2) Taking iterated expectation over q (t) of (53) and using the telescoping sum over {0, 1, 2, . . . , t − 1}, we have lim t−1 i 1 h i X 1 h 2 2 E [G (τ )] E kq (t)k2 − E kq (0)k2 + V 2 2 τ =0 ≤t (N + V G SUBOPT )− t−1 X N X E [qn (τ )]. (61) τ =0 n=1 Dividing (61) by V t and making some algebraic manipulations, we obtain t−1 1X E [G (τ )] t τ =0 t−1 N h i N  XX 1 2 + GSUBOPT − E kq (0)k2 E [qn (τ )] + V V t τ =0 n=1 2V t h i N 1 2 ≤ + GSUBOPT + E kq (0)k2 . (62) V 2V t Letting t → h i ∞, we prove (19) due to the fact that 2 E kq (t)k2 < ∞. ≤ 13 3) From (61), we have The KKT conditions related to the proof are listed as t−1 i X 1 h 2  E [qn (τ )] − E kq (0)k2 + V E [G (τ )] 2 τ =0 n=1 τ =0 t−1 X N X (63) ≤t (N + V GSUBOPT ) . Substituting (52) into (63) and performing some algebraic manipulations, we have t−1 N 1 XX E [qn (τ )] t τ =0 n=1 SUBOPT ≤ N +V G  ∂L (67) ∂$n =$n (γn (1 + exp (−cn (10 log10 (αn ) − bn ))) − 1) = 0, ∀n ∂L (68) ∂γn =$n (1 + exp (−cn (10 log10 (αn ) − bn ))) − qn = 0, ∀n $n From (68), we obtain the expression for $n as min −G  h i 1 2 + E kq (0)k2 . 2t $n = (64) Letting t → h i ∞, we obtain (20) due to the fact that 2 E kq (t)k2 < ∞. A PPENDIX C P ROOF OF P ROPOSITION 2 min s.t. VG− N X (65a) n=1 2 kwn k2 max (65b) SINRn ≥ Γn,req , ∀n (65c) n=1 ≤P SINRn ≥ αn , ∀n (65d) γn (1 + exp (−cn (10 log10 (αn ) − bn ))) ≤ 1, ∀n. (65e) The equivalence of (65) and (22) can be easily justified. We note that all constraints in (65e) are active at the optimum. Otherwise, the value of the objective function (65a) is decreased by increasing γn . The Lagrangian of (65) is denoted as L =V G − + + + N X n=1 N X n=1 N X n=1 N X n=1 qn γn + ς N X n=1 2 kwn k2 −P max ! $n (γn (1 + exp (−cn (10 log10 (αn ) − bn ))) − 1) %n (Γn,req − SINRn ) ζn (αn − SINRn ) (66) where ς and ($n , %n , ζn )n∈N are non-negative Lagrange multipliers. 1 . 1 + exp (−cn (10 log10 (αn ) − bn )) (71) With (70) and (71), we obtain the following optimization problem min qn γn (70) γn = Introducing a set of auxiliary variables γn > 0, n ∈ N , we obtain an equivalent form of the optimization problem (22) as wn ,αn ,γn qn > 0. 1 + exp (−cn (10 log10 (αn ) − bn )) Hence, we can obtain the expression of γn from (67) as wn ,αn N X (69) $n ≥ 0, ∀n. N X n=1 $n (γn (1 + exp (−cn (10 log10 (αn ) − bn ))) − 1) +VG− s.t. N X n=1 N X qn γn (72a) n=1 2 kwn k2 ≤ P max SINRn ≥ Γn,req , ∀n SINRn ≥ αn , ∀n. (72b) (72c) (72d) With (70) and (71), the optimization problem (72) has the same KKT conditions with the optimization problem (22). Dropping the constant in the objective function (72a), we obtain the optimization problem (25). A PPENDIX D ACTIVENESS OF C ONSTRAINTS IN (27e) p √ With (23), we can obtain the βn αn∗ ≥ βn Γn,req , where αn∗ represents a local optimal value of αn . Thus, we only discuss the relation between (27d) and (27e) in this proof. Suppose some of the constraints in (27e) are inactive. We denote the set of indices of inactive constraints as  v  N  u  X u 2 I = i tσi2 + hH < βi . (73) i wm   m=1,m6=i Then, there must be a positive constant µ > 1 such that q PN 2 2 σi + m=1,m6=i hH = β̂i and β̂i = βµi , i ∈ I. To i wm keep the corresponding constraint p in (27d)√unchanged, we set α̂i = µ2 αi∗ such that βi αi∗ = β̂i α̂i . Obviously, α̂i = µ2 αi∗ > αi∗ for µ > 1. Then, the term α̂i leads to a smaller value of (27a), which contradicts the fact that the term αi∗ obtains its local optimal value. As a result, we conclude that constraints in (27e) are always active. 14 A PPENDIX E P ROOF OF P ROPOSITION 3 The proposed Algorithm 2 uses successive approximation procedures. Let F (τ ) and OBJ (τ ) respectively denote the approximated feasible region and the optimal value of the objective function of the optimization problem (27) in the τ th iteration. From Line 2-3 of Algorithm 2, we obtain that (τ −1) (τ −1) (τ −1) (τ −1) (τ −1) the point (wn , αn , βn , $n , γn ) is in the feasible region F (τ ) . Therefore, we conclude that OBJ (τ ) ≤ OBJ (τ −1) (74) (τ ) (τ ) (τ ) (τ ) (τ ) (wn , αn , βn , $n , γn ) because the point is the optimal point in the τ -th iteration according to Line 6 of Algorithm 2. On the other hand, the transmission power of the BS is limited by P max , which indicates that the value of the objective function in (27) is lower bounded. Hence, the generated (τ ) (τ ) (τ ) (τ ) (τ ) sequence (wn , αn , βn , $n , γn ) converges as τ → ∞. Because the objection function (27a) is strictly convex, we can prove the convergent point (∞) (∞) (∞) (∞) (∞) (wn , αn , βn , $n , γn ) is a KKT point of the optimization problem (22) via similar arguments in [38, Proposition 3.2]. R EFERENCES [1] Cisco, Cisco Visual Networking Index: Forecast and Methodology, 2015– 2020, June 2016. [2] Z. Hasan, H. Boostanimehr, and V. K. Bhargava, “Green cellular networks: A survey, some research issues and challenges,” IEEE Commun. Surveys Tuts., vol. 13, no. 4, pp. 524–540, Fourth quarter 2011. [3] A. Attar, H. Li, and V. C. M. Leung, “Green last mile: How fiberconnected massively distributed antenna systems can save energy,” IEEE Wireless Commun., vol. 18, no. 5, pp. 66–74, Oct. 2011. [4] X. Li, X. Ge, X. Wang, J. Cheng, and V. C. M. Leung, “Energy efficiency optimization: Joint antenna-subcarrier-power allocation in OFDM-DASs,” IEEE Trans. Wireless Commun., vol. 15, no. 11, pp. 7470–7483, Nov. 2016. [5] Qualcomm, Rising To Meet 1000x Mobile Data Challenge, June 2012. [6] J. Xu, L. Duan, and R. Zhang, “Cost-aware green cellular networks with energy and communication cooperation,” IEEE Commun. Mag., vol. 53, no. 5, pp. 257–263, May 2015. [7] Ericsson Inc., Sustainable Energy Use in Mobile Communications, Aug. 2007. [8] S. Sudevalayam and P. Kulkarni, “Energy harvesting sensor nodes: Survey and implications,” IEEE Commun. Surveys Tuts., vol. 13, no. 3, pp. 443–461, Third quarter 2011. [9] 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., vol. 33, no. 3, pp. 360– 381, Mar. 2015. [10] Y. Cui, V. K. N. Lau, and F. Zhang, “Grid power-delay tradeoff for energy harvesting wireless communication systems with finite renewable energy storage,” IEEE J. Sel. Areas Commun., vol. 33, no. 8, pp. 1651– 1666, Aug. 2015. [11] I. Ahmed, A. Ikhlef, D. W. K. Ng, and R. Schober, “Power allocation for an energy harvesting transmitter with hybrid energy sources,” IEEE Trans. Commun., vol. 12, no. 12, pp. 6255–6267, Dec. 2013. [12] Y. Mao, J. Zhang, and K. B. Letaief, “A Lyapunov optimization approach for green cellular networks with hybrid energy supplies,” IEEE J. Sel. Areas Commun., vol. 33, no. 12, pp. 2463–2477, Dec. 2015. [13] F. Yuan, Q. T. Zhang, S. Jin, and H. Zhu, “Optimal harvest-use-store strategy for energy harvesting wireless systems,” IEEE Trans. Wireless Commun., vol. 14, no. 2, pp. 698–710, Feb. 2015. [14] X. Kang, Y. K. Chia, C. K. Ho, and S. Sun, “Cost minimization for fading channels with energy harvesting and conventional energy,” IEEE Trans. Wireless Commun., vol. 13, no. 8, pp. 4586–4598, Aug. 2014. [15] D. Zhai, M. Sheng, X. Wang, and Y. Li, “Leakage-aware dynamic resource allocation in hybrid energy powered cellular networks,” IEEE Trans. Commun., vol. 63, no. 11, pp. 4591–4603, Nov. 2015. [16] S. Bu, F. R. Yu, Y. Cai, and X. P. Liu, “When the smart grid meets energy-efficient communications: Green wireless cellular networks powered by the smart grid,” IEEE Trans. Wireless Commun., vol. 11, no. 8, pp. 3014–3024, Aug. 2012. [17] J. Xu and R. Zhang, “Cooperative energy trading in CoMP systems powered by smart grids,” IEEE Trans. Veh. Technol., vol. 65, no. 4, pp. 2142–2153, Apr. 2016. [18] C. Hu, J. Gong, X. Wang, S. Zhou, and Z. Niu, “Optimal green energy utilization in MIMO systems with hybrid energy supplies,” IEEE Trans. Veh. Technol., vol. 64, no. 8, pp. 3675–3688, Aug. 2015. [19] J. Leithon, T. J. Lim, and S. Sun, “Online energy management strategies for base stations powered by the smart grid,” in Proc. of IEEE SmartGridComm,, Oct. 2013, pp. 199–204. [20] X. Wang, Y. Zhang, G. B. Giannakis, and S. Hu, “Robust smartgrid-powered cooperative multipoint systems,” IEEE Trans. Wireless Commun., vol. 14, no. 11, pp. 6188–6199, Nov. 2015. [21] T. Han and N. Ansari, “On optimizing green energy utilization for cellular networks with hybrid energy supplies,” IEEE Trans. Wireless Commun., vol. 12, no. 8, pp. 3872–3882, Aug. 2013. [22] X. Wang, Y. Zhang, T. Chen, and G. B. Giannakis, “Dynamic energy management for smart-grid-powered coordinated multipoint systems,” IEEE J. Sel. Areas Commun., vol. 34, no. 5, pp. 1348–1359, May 2016. [23] D. W. K. Ng, E. S. Lo, and R. Schober, “Energy-efficient resource allocation in OFDMA systems with hybrid energy harvesting base station,” IEEE Trans. Wireless Commun., vol. 12, no. 7, pp. 3412–3427, July 2013. [24] S. Yin, Z. Qu, and S. Li, “Achievable throughput optimization in energy harvesting cognitive radio systems,” IEEE J. Sel. Areas Commun., vol. 33, no. 3, pp. 407–422, Mar. 2015. [25] J. Xu and R. Zhang, “CoMP meets smart grid: A new communication and energy cooperation paradigm,” IEEE Trans. Veh. Technol., vol. 64, no. 6, pp. 2476–2488, June 2015. [26] S. Hu, Y. Zhang, X. Wang, and G. B. Giannakis, “Weighted sum-rate maximization for MIMO downlink systems powered by renewables,” IEEE Trans. Wireless Commun., vol. 15, no. 8, pp. 5615–5625, Aug. 2016. [27] X. Wang, T. Chen, X. Chen, X. Zhou, and G. B. Giannakis, “Dynamic resource allocation for smart-grid powered MIMO downlink transmissions,” IEEE J. Sel. Areas Commun., vol. 34, no. 12, pp. 3354–3365, Dec. 2016. [28] M. J. Neely, Stochastic Network Optimization with Application to Communication and Queueing Systems. San Rafael, USA: Morgan & Claypool, 2010. [29] Y. Dong, M. J. Hossain, and J. Cheng, “Performance of wireless powered amplify and forward relaying over Nakagami-m fading channels with nonlinear energy harvester,” IEEE Commun. Lett., vol. 20, no. 4, pp. 672–675, Apr. 2016. [30] A. Goldsmith, Wireless Communications. Cambridge University Press, 2005. [31] H. Li, J. Xu, R. Zhang, and S. Cui, “A general utility optimization framework for energy-harvesting-based wireless communications,” IEEE Commun. Mag., vol. 53, no. 4, pp. 79–85, Apr. 2015. [32] Y. Dong, M. J. Hossain, and J. Cheng, “Joint power control and time switching for SWIPT systems with heterogeneous QoS requirements,” IEEE Commun. Lett., vol. 20, no. 2, pp. 328–331, Feb. 2016. [33] D. Krishnaswamy, “Game theoretic formulations for network-assisted resource management in wireless networks,” in Proc. of IEEE VTC-Fall, vol. 3, Vancouver, Canada, Sept. 2002, pp. 1312–1316. [34] Y. F. Liu, Y. H. Dai, and Z. Q. Luo, “Coordinated beamforming for MISO interference channel: Complexity analysis and efficient algorithms,” IEEE Trans. Signal Process., vol. 59, no. 3, pp. 1142–1157, Mar. 2011. [35] A. Wiesel, Y. C. Eldar, and S. Shamai, “Linear precoding via conic optimization for fixed MIMO receivers,” IEEE Trans. Signal Process., vol. 54, no. 1, pp. 161–176, Jan. 2006. [36] W. Yu and T. Lan, “Transmitter optimization for the multi-antenna downlink with per-antenna power constraints,” IEEE Trans. Signal Process., vol. 55, no. 6, pp. 2646–2660, June 2007. [37] S. P. Boyd and L. Vandenberghe, Convex Optimization. Cambridge University Press, 2004. [38] A. Beck, A. Ben-Tal, and L. Tetruashvili, “A sequential parametric convex approximation method with applications to nonconvex truss topology design problems,” J. Glob. Optim., vol. 47, no. 1, pp. 29–51, 2009.
7cs.IT
Going Wider: Recurrent Neural Network With Parallel Cells Danhao Zhu, Si Shen, Xin-Yu Dai and Jiajun Chen Department of Computer Science, Nanjing University, China Abstract: Recurrent Neural Network (RNN) has been widely applied for sequence modeling. In RNN, the hidden states at current step are full connected to those at previous step, thus the influence from less related features at previous step may potentially decrease model’s learning ability. We propose a simple technique called parallel cells (PCs) to enhance the learning ability of Recurrent Neural Network (RNN). In each layer, we run multiple small RNN cells rather than one single large cell. In this paper, we evaluate PCs on 2 tasks. On language modeling task on PTB (Penn Tree Bank), our model outperforms state of art models by decreasing perplexity from 78.6 to 75.3. On Chinese-English translation task, our model increases BLEU score for 0.39 points than baseline model. 1.Introduction Recurrent neural network (RNN) has been one of the most powerful sequence models in natural language processing. Many important applications achieve state of the art performance with RNN, including language modeling(Mikolov et al.,2010; Zaremba et al., 2014 ), machine translation (Luong and Manning, 2016; Wu et al., 2016) and so on. The features learned by RNN are stored in the hidden states. At each time step, the cell extracts features from data and updates its hidden states. The left side of figure 1 concisely shows the transition of hidden states in naïve RNN. We can see that all units at the previous step are fully connected to all units at the current step. Thus, each pair of features can affect each other. Such design is not reality because many features are not that related. The influence between unrelated features may harm the learning ability of models. We can expect learning models automatically set the weight of all unnecessary connections to zero. However, in practice, because the data size is limited and the algorithms are not that strong, these unrelated connections will harm the learning ability. For example, that is why we have to do feature selections before training. To address the problem, many successful neural models benefit from replacing global connection with local connection. For example, Long Short-Term Memory(LSTM) (Hochreiter and Schmidhuber, 1997) and Gated Recurrent Units(GRU) (Cho et al., 2014) have been the most popular RNN cells. In the core, such models use gates to control the data flow, allow part of connections to be activated. Another example is Convolution Neural Networks(CNN)(Lecun et al, 1998), one of the most successful models in deep learning nowadays. CNN uses local receptive fields to extract features from previous feature map. With local receptive fields, neurons can extract elementary visual features such as oriented edges, end-points, corners. ht+1 ht ... ... ... ... xt xt+1 xt xt+1 ht ht+1 Figure 1: The Transition of RNN hidden states. The left side is naïve RNN. The right side is RNN with Parallel Cells. ht and xt denote hidden states and input vector at time step t respectively. In this line, we propose a model named RNN-PCs (Recurrent Neural Network with Parallel Cells) to improve the learning ability of RNN, meanwhile to largely reduce the number of parameters. The model replaces global recurrent connections with small local connections. We replace a single large cell with many smaller ones (the hidden states have less units). As in the right part of figure 1, the hidden states are no longer full connected but only connected in a local manner. Figure 2 shows an unrolled 2 layer RNN with 2 parallel cells. In each layer of RNN, each small cell extracts and saves features from outputs of previous layer independently. And the outputs of small cells are concatenated as the output of current layer. The design has several advantages. First, each cell extracts features independently. Features in one cell transferred by its own recurrent connection and are not impacted by features in other cells. Second, parameters for recurrent connection decrease significantly. Also, one cell has to be placed entirely in one GPU. Now we have multiple small cells rather than one single larger cell, thus we can place these cells in different GPUs to optimize the training. Thirdly, Parallel Cells(PCs) does not modify the inner structure of cells, as a result, PCs can be used along with any type of RNN cells, such as LSTM. Indeed, our idea of RNN-PCs is inspired by the multi-filter mechanisms in CNN. CNN uses multi filters to generate multi feature maps. Next, the feature maps are stacked as the input of following steps. RNN-PCs works in a similar manner. We use multi cells to extract different features from current inputs. And the outputs are stacked as the inputs of following steps. On the empirical stage, CNN shows that different filters are running for different features. We also make an empirical study on language modeling task, and show that different cells offer different set of features. y1 y2 cell 22 yn … cell22 cell22 Layer 2 cell 21 … cell21 concat … concat cell 12 cell21 concat … cell12 cell12 Layer 1 cell 11 … cell11 x1 x2 cell11 … xn Figure 2. A unrolled 2 layer RNN with 2 parallel cells. xi,yi denote the input vector and output vector at time step i. Celli denotes the parallel cell i. We evaluate RNN-PCs on two tasks: language modeling and Chinese-English translation. The language modeling task is conducted on Penn Tree Bank (PTB). Our model outperforms state of art systems by decreasing perplexity from 78.6 to 75.3. On the task of Chinese-English machine translation, the proposed model achieves BLEU score X, outperforms the strong baseline model of BLEU score Y. The rest of the paper is organized as follows. Section 2 describes models, including background models and parallel cells. Section 3 reports experiments. In section 4, based on the task of language modeling, we make some empirical study to observe the behavior of RNN-PCs. Finally, section 5 draws conclusions. 2.Methods 2.1 Background Models We briefly go through background models used in the paper, including recurrent neural network(RNN), long-short term memories(LSTM) and their variants. Naïve Recurrent Neural Network RNN cell is the basic computation component in RNN. A cell is mainly composed by three parts, input vector,hidden states and recurrent connection. Generally, the output of the cell are the hidden states. RNN dynamics can be viewed as a deterministic transition from the past hidden states to current states given current input. Recurrent connection defines how to the transition procedure happens. We let subscript denote time step and subscript denote layers. Let h ∈ ℝ be hidden states of RNN cell in time step t at layer l. Let T , : ℝ → ℝ be a linear transform with a bias, e.g. y = Wx + b, for some W and b, where x ∈ ℝ and y ∈ ℝ . Let f(. ) be sigmoid, tanh, relu or other non-linear activate functions. Let ⨀ be element-wise multiplication. At time step t in layer l, the hidden state h is determined by previous hidden state h and current input x . h = f(T , h + x ) Long Short-Term Memories Long short-term memory (LSTM) (Hochreiter and Schmidhuber 1997) addresses the problem of learning long range dependencies by augmenting the RNN with a memory cell vector c ∈ ℝ . In this paper, we follow LSTM architecture by Graves (2013). LSTM uses forget gate f, input gate i, output gate o to control the data flow. The equations are as follows. x ⎛i⎞ ⎛sigm⎞ f = ⎜ ⎟ ⎜sigm⎟ T , h o sigm ⎝g⎠ ⎝ tanh ⎠ c = f ⊙ c + i ⊙g h = o ⊙ tanh (c ) RNN Variants Two commonly used variants of basic RNN architecture are the Bidirectional RNN and Multilayer RNN. Bidirectional RNN contains of two RNN cells that are in parallel: one on the input sequence and the other on the reverse of the input sequence. At each time step, the hidden states of forward RNN and backward RNN are concatenated as output. In Multilayer RNN, there are multilayer of RNN, each layer contains a single RNN cell. The output of lower layer is fed into its upper layer as input. 2.2 Parallel cells The key idea of PCs is to replace a single large cell with several small parallel cells. Figure 3 shows the a basic RNN cell and its counterpart parallel cells solution. The left side is a basic RNN cell whose hidden states has m units. Let RC be the cell’s recurrent connection. Let x,h be the input vector and hidden vector respectively. The right side shows a counterpart parallel cells solution. There are n small parallel cells, each with m/n unit of hidden states. Thus both the left and the right side have equal total unit of hidden states to retain information from the past. The small cells accept input x and generate outputs h_1,h_2…h_n respectively. The final output h is concatenated by h_1,h_2…h_n. h concatenate h_1 h RC Cell size = m h_n h_2 RC_1 Cell_1 size = m/n Cell_2 size = m/n x x Cell RC_n RC_2 Parallel Cells … Cell_n size = m/n Figure 3. Rnn cell & counterpart Parallel cells solution. PCs can be easily used along with LSTM or other complex RNN cells. As shown in the figure, parallel cells do not modify any internal structure of cells. For example, LSTM cell also accepts a input, outputs its hidden units. The mainly modification of LSTM are the memory vector and recurrent connection, which have no impact with PCs. Compared to naïve RNN, here we add a new hyper-parameter wide, denotes the amount of parallel cells. When we set wide=1, the model is exactly the same as naïve RNN. Note that we replace one cell with many parallel small cells by equally dividing the units of hidden states. It is really a arbitrary setting just for convenience of turning. Maybe a more delicate splitting method will be more helpful for improving learning ability. Parameters amount For basic RNN cell with m units , the parameters are T , , with total parameter size m + m. Suppose we use PCs with wide=n, there are n T , , with total number of parameters + m. When m is large, PCs with wide=n can reduce the parameter size of the origin RNN cell to about . For LSTM with m units, the parameters are T , for calculating i,f,o,g, with total parameter size 8m + 4m. Suppose we use parallel cells with wide=n, there are n T number of parameters , , with total + 4m. When m is large, Pcs with wide=n can reduce the parameters size of the origin LSTM cell to about . 3.Experiments We present results in language modeling, machine translation and part-of-speech(POS) tagging. 3.1 language modeling Task and Dataset We conduct word-level word prediction experiments on the Penn Tree Bank (PTB) dataset. The data is from Tomas Mikolov’s webpage1. We use exactly the same training data and test data as other researchers(Zaremba et al., 2014; Kim et al., 2016), about 90% for training and 10% for testing. The vocabulary size is 10k. We use a UNK symbol for the rest of rare words. Model and Training Details Zaremba et al.(2014) achieved state of art performance on PTB with a two layer regularized LSTM. At each time step, word is mapped to a fix length word vector and then fed into LSTM. LSTM outputs a probability distribution of the next word. Our models are regularized LSTM with PCs. For convenience of comparison, we follow most of Zaremba’s settings. LSTMs in all experiments have two layers and are unrolled in 35 steps. The initial states are 0 and we use the final states of previous batch as the initial states of the next batch. The size of batch is 20. We use cross entropy loss function and stochastic gradient decent for optimization. Model parameters are initialized uniformly between [-0.04,0.04]. We train the model with learning rate 1 in first 14 epochs, and apply weight decay by 1/1.15 in the rest 41 epochs. We clip the norm of the gradients at 5(Mikolov et al., 2010). We dropout 65% of recurrent connections(Srivastava et al., 1 http://www.fit.vutbr.cz/˜imikolov/rnnlm/simple-examples.tgz 2014) to avoid overfitting. Results Table 1 shows results of previous systems and our model. Zaremba et al.(2014) achieved perplexity 78.4, the state of art result for language modeling on PTB, and significantly outperformed all previous works. Their model has 1500 hidden units. Kim et al.(2016) proposed a model with pure character input, and got comparable perplexity 78.9. Our model achieves perplexity 75.3 when wide=3, hidden units are 1950, decreases 3.1 perplexity than state of art results. Model Test Perplexity LSTM-1500h(Zaremba et al., 2014) 78.4 LSTM-Char(Kim et al, 2016) 78.9 Parallel_Cells_LSTM_1950h_3wide 75.3 Table 1: Perplexity of our model versus previous works on PTB In table 2, We show the performance of our model with different wide. When wide=1, the model is a plain 2 layer LSTM. When wide=3 to 10, the models get similar performance. Note that when wide=10, the LSTM cell contains about only 10% of parameters, while reduce 4.5 perplexity than plain LSTM. However, continue to add parallel cells will harm the performance. For wide=15, the perplexity increases to 77.5. We suggest that use PCs will reduce the unnecessary connections from unrelated features. But when the cell is getting too small to afford a necessary feature sets, the overall performance will decrease. For plain LSTM, setting the units of hidden states larger than 1500 will not improve the performance. From 1500 to 1950, the perplexity grows from 78.4 to 80.0. However, parallel cells can still benefit from increasing units of hidden states. wide Recurrent Parameters Size perplexity 1 30.4m 80.0 2 15.2m 76.4 3 10.1m 75.3 4 7.6m 75.4 5 6.1m 75.6 10 3.4m 75.5 15 2.4m 77.5 Table 2: the perplexity on different wide. The models are all 1950h and 2 lays. 3.2 Machine Translation Task and Dataset We conduct experiments on a Chinese-English translation task. The purpose of this experiment is to evaluate that whether PCs has a substantial improvement on large RNN. For consideration of speed, we only include training and testing samples when both sides contain less than 50 words. We limit the source and target vocabularies to the most frequent 30K words in Chinese and English, including a UNK symbol for other words, a PAD symbol for padding and a EOS for end of the sentence. Our training data for the translation task consists of 1.25M sentence pairs extracted from LDC corpora2. The development dataset is NIST 2002 dataset, contains 824 sentence pairs. The test datasets are the NIST 2003, 2004, 2005 and 2006 datasets, contains 4910 sentence pairs. We use the case insensitive 4-gram NIST BLEU score (Papineni et al., 2002) for evaluating the translation task. Model and Training Details Bahdanau et al.(2015) proposed a encoder-decoder model with attention for machine translation. Both the encoder and decoder were RNNs and the cell type was Gate Recurrent Units(GRU). The encoder RNN read source words one by one, and the final hidden states encoded all the information of the source sequences. The hidden states were then fed into decoder RNN. At each time step, took states of aligned source states and previous generated target words as inputs, the decoder output current target word. They used bidirectional RNN for the all layers of the encoder to catch both forward and backward information. Wu et al.(2016) used LSTM cells for translation. For speed and parallel running consideration, they only used bidirectional RNN in the first layer of the encoder. Their systems were also comparable to other state of art systems. The baseline model for machine translation in this paper is the same as Bahdanau’ work, while there are two minus differences. First, only the first layer of encoder is bidirectional. Second, the cells used in RNNs are LSTM. We implement PCs for both encoder and the decoder RNN. The bidirectional layer and other layers in encoder does not share parameters. The encoder contains 4 layers, 1 bidirectional bottom layer and 3 single directional layers. The decoder contains 3 layers. The word embedding dimension and size of hidden states are 1024. We use cross entropy loss function and stochastic gradient decent for optimization. The batch size is 32. We train the model with initial learning rate 0.5, and apply weight decay by 0.93 in every 3000 batches if the cost of validation set does not decrease. We clip the norm of the gradients at 5. We dropout 20% of recurrent connections. We train each model for about 800k batches. Results Table 3 shows the results of baseline model and our model. For the baseline model, it takes about 824000 batches to get the best bleu score in dev set. For translation model with parallel cells, it takes about 714000 batches to get best bleu score. With parallel cells, the translation model gets a improvement of 0.39 on bleu score. Model NIST2002(DEV) NIST2003 NIST2004 NIST2005 overall Bi-LSTM + Attention(Baseline) 28.08 25.71 29.81 25.90 27.14 28.39(+0.31) 26.04(+0.33) 30.26(+0.45) 26.28(+0.38) 27.53(+0.39) RNN_PCs + Bi-LSTM + Attention(Wide =3) Table 3: The results of Machine Translation As 2 examples, table 4 shows some translation samples in the test sets translated by baseline model vs by parallel cells model. 1 Chinese 印度 国防部 在 其 发表 的 一 项 远景 规划 中 也 认 为 , 中国 对 印度 没有 军事 威胁 。 Golden Translation india 's ministry of defense also said in its long-term plan that china has not posed any military threat to india . Baseline Translation 2 in his recent planning plan published by india defense The corpora include LDC2002E18, LDC2003E07, LDC2003E14, Hansards portion of LDC2004T07, LDC2004T08 and LDC2005T06. department , india also held that china did not pose any military threat to india . Parallel cells(wide=3) a long-term plan issued by indian defense ministry also believes that china has no military threat to india . 2 Chinese 蒙方 感谢 中方 多年 来 对 蒙古 提供 的 援助 。 Golden Translation the mongolian side thanked china for its assistance to mongolia over the years . Baseline Translation the mongolian side thanked china for its many years to aid the mongolian government . Parallel cells(wide=3) the mongolian side thanked china for its assistance to mongolia over the past years . Table 4: Example of Translation Results 4 Empirical Study of PCs Previous, we have shown PCs can substantially improve the performance of RNN with less parameters. In this section, We make a empirical study on language modeling task to show whether parallel cells work in the manner we expected, e.g. difference cells learning different set of features. Also, we compare the performance of PCs with model average techniques. 4.1 Different cells for Different Set of Features Unlike conditional random fields or support vector machine, neural network does not have explicit features. Moreover, texts are not as easy to be visualized as pictures to see what kind of features have been extracted. As a result, we investigate in a indirect way by seeing how result changes when we mask different cells. We suppose that predict a word requires a set of features offered by cells. As a result, when we mask a cell, if the prediction of target word depends heavily on the features in the cell, the perplexity will increase sharply, and vice versus. We run a single layer LSTM, with 420 unit of hidden states and wide=3, dropout rate=0.2 on PTB. On test set, we mask the parallel cells in turns to see what changes. Figure 4 shows how we mask the cells. h h concatenate concatenate h_1 h_2 Cell_1 Cell_2 h_3 Cell_3 h_1 0 Cell_1 Cell_2 x x Training Testing: mask Cell_2 h_3 Cell_3 Figure 4: Mask the cell. The training procedure makes no difference as previous RNN-PCs. On testing, the right side of the figure shows that we mask cell_2 by setting its hidden states to 0. Figure 5 show three group of samples selected from test set. The words are all selected from about top 100 most frequency word set. It can be seen that for similar words, masked models have similar performance on perplexity. For example, when we consider copular verbs, generally, mask1 gets the lowest average perplexity on all words, while mask2 gets almost the highest perplexity. We can conclude that when predicting copular verbs, cell1 provides less important features than cell2. Figure 5: Results of masked models. The vertical axis shows the average perplexity in test set. The horizon axis maski represents the model masking the cell i. 4.2 comparison with model averaging A PCs-RNN with m hidden units and n parallel cells consumes as much computing and memory resource as n small naïve RNN with m/n hidden units. Thus, we want to compare the performance between PCs-RNN and its counterpart ensemble models that consumes the same resource. Table 3 compares the results of model averaging. 2 model1 cost as much resource as 6 model3. However, 2 model1 outperform 10 model3 on model averaging. 38 model2 achieve previous state of art perplexity on model averaging. However, we outperform that by using only 10 model1. We can conclude that, after model averaging, PCs can still substantially outperforms naïve RNN with equivalent, or less computing and memory resource. Single Model Model Averaging Model Test Perplexity Model1 75.3 Model2 82.7 Model3 78.4 10 model3 72.0 2 model1 71.7 10 model2 69.5 38 model2 68.7 10 model1 68.6 Table 3: Results of Model Averaging. Model1: Parallel_Cells_LSTM_1950h_3wide in table 1, with 3 parallel cells and 1950 hidden units. Model2: LSTM-1500h in table 1, the naïve LSTM with 1500 hidden units. Model3: A naïve LSTM with 650 hidden states. All data about model2 and model3 are the results reported in Zaremba et al.(2014). 5 Conclusion In this paper, we proposed Parallel Cells technique for RNN. Parallel cells can reduce the impact from unrelated features coming from recurrent connections. On all 3 evaluation tasks, models with PCs get significantly improvement on results with less parameters. We investigated the results of language modeling task by masking cells. The results show a strong evidence that different cells are coping with different set of features. Also, we found that even after model averaging, PCs can still beat the baseline model, and get new state of art perplexity. There are much work to be done in the line of PCs. For example, parallel cells with different hidden units maybe better, because a equally dividing strategy is really arbitrary. Also, we can test the performance of PCs on many downstream models based on RNN. References [Mikolov et al., 2010] T. Mikolov, M. Karafiát, L. Burget, J. Cernocký, and S. Khudanpur. Recurrent neural network based language model. In INTERSPEECH, pages 1045–1048, 2010. [Zaremba et al., 2014] W. Zaremba, I. Sutskever, and O. Vinyals. Recurrent neural network regularization. In arXiv:1409.2329, 2014. [Luong and Manning, 2016] Luong M T, Manning C D, Minh-Thang Luong and Christopher D. Manning. 2016. Achieving open vocabulary neural machine translation with hybrid word-character models. In ACL, pages 1054-1063, 2016 [Wu et al., 2016] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. 2016. Google’s neural machine translation system: Bridging the gap between human and machine translation. In arXiv:1609.08144. [Hochreiter and Schmidhuber, 1997] Hochreiter, Sepp and Schmidhuber, Jürgen. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [Cho et al., 2014]Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, Yoshua Bengio. On the Properties of Neural Machine Translation: Encoder-Decoder Approaches. In EMNLP 2014, pages 103-111. [Lecun et al., 1998] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [Burt, 1988] Burt P J. Attention mechanisms for vision in a dynamic world. International Conference on Pattern Recognition. Pages 977-987, 1988, vol.2. [Denil et al., 2012] Denil M, Bazzani L, Larochelle H, et al. Learning where to attend with deep architectures for image tracking. Neural Computation, pages 2151-2184, 2012, 24(8). [Bahdanau et al., 2015] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. ICLR 2015. [Luong et al., 2015] Thang Luong, Hieu Pham, and Christopher D. Manning. Effective Approaches to Attention based Neural Machine Translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1412–1421. [Chung et al., 2014] Chung J, Gulcehre C, Cho K H, et al. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. Eprint Arxiv, 2014. [Graves, 2013] Graves, Alex. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013. [Kim et al., 2016]Yoon Kim, Yacine Jernite, David Sontag and Alexander M. Rush. Character-aware neural language models. In AAAI 2016, pages 2741-2749. [Srivastava et al., 2014]Srivastava N, Hinton G, Krizhevsky A, et al. Dropout: a simple way to prevent neural networks from overfitting[J]. Journal of Machine Learning Research, 2014, 15(1):1929-1958. [Papineni et al., 2002] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automatic evaluation of machine translation. In ACL 2002, 311-318. [Hinton et al., 2012] G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R. R. Salakhutdinov. Improving neural networks by preventing coadaptation of feature detectors. arXiv:1207.0580, 2012. [Collins,2002]Michael Collins. 2002. Discriminative Training Methods for Hidden Markov Models: Theory and Experiments with Perceptron Algorithms. In Proceedings of EMNLP, pages 1–8, Stroudsburg, PA, USA. [Wang et al., 2015] Wang P, Qian Y, Soong F K, et al. A Unified Tagging Solution: Bidirectional LSTM Recurrent Neural Network with Word Embedding. arXiv preprint arXiv:1511.00215, 2015.
9cs.NE
arXiv:1710.09961v1 [cs.DS] 27 Oct 2017 Edge-Based Wedge Sampling to Estimate Triangle Counts in Very Large Graphs Duru Türkoğlu Ata Turk DePaul University, Chicago, IL [email protected] Boston University, Boston, MA [email protected] Abstract—The number of triangles in a graph is useful to deduce a plethora of important features of the network that the graph is modeling. However, finding the exact value of this number is computationally expensive. Hence, a number of approximation algorithms based on random sampling of edges, or wedges (adjacent edge pairs) have been proposed for estimating this value. We argue that for large sparse graphs with powerlaw degree distribution, random edge sampling requires sampling large number of edges before providing enough information for accurate estimation, and existing wedge sampling methods lead to biased samplings, which in turn lead to less accurate estimations. In this paper, we propose a hybrid algorithm between edge and wedge sampling that addresses the deficiencies of both approaches. We start with uniform edge sampling and then extend each selected edge to form a wedge that is more informative for estimating the overall triangle count. The core estimate we make is the number of triangles each sampled edge in the first phase participates in. This approach provides accurate approximations with very small sampling ratios, outperforming the state-of-the-art up to 8 times in sample size while providing estimations with 95% confidence. I. I NTRODUCTION Graphs are heavily employed in modeling relationships, networks, and interactions of many real world applications. User interactions and usage patterns in social or mobile networks, compound/atom/amino-acid/molecule bonding/interaction tendencies in chemistry or biology, process/data/resource interaction/communication/dependency patterns in parallel/distributed systems can be listed among the examples where graph-based modeling is heavily used. Triangles in a graph represent ternary relationships among the modeled objects/entities. The count of triangles in a graph is an important metric that can be used in determining the degree of clustering of the modeled networks. Graph metrics such as clustering coefficient [1] or transitivity ratio [2] make use of triangle count, and they are used as features for critical applications such as social network analysis [3], gene expression microarray data analysis [4], or text summarization [5]. Currently, the best known theoretical algorithm for identifying the exact number of triangles in a given graph G  has a complexity of O m2γ/(γ+1) ≈ O(m1.407 ) [6], where m is the number of edges in G, and γ < 2.372864. This algorithm computes the third power of the adjacency matrix on the high-degree vertices and γ is the exponent of the stateof-the-art matrix multiplication algorithm [7]. The practically used triangle counting and listing algorithms, however, take O(m3/2 ) time [8]. Moreover, since finding the exact triangle count is computationally expensive for very large graphs with billions of edges that do not fit in memory, some studies focus on minimizing the number of disk I/Os performed [23], [24] during counting. In many scenarios finding the exact triangle count is not necessary and an approximate number is sufficient as the graphs are very dynamic. A number of studies propose approximation solutions for estimating the triangle count [8]–[16]. These studies can be categorized based on the settings they consider: the streaming setting where graph components arrive as a data stream [9]–[11], [14], the semi-streaming setting where a constant number of passes over the edges are allowed [17], [18], and the static setting where the entire graph is available for analysis [13], [15], [19]. Another vein of studies consider efficient parallelization of this estimation process [20]–[22]. In this paper, we focus on the triangle count estimation problem under the static sequential setting. However, the intuition we provide can be used in a streaming setting as well. The state-of-the-art approximation approaches are mostly based on random edge or wedge sampling. Random wedge sampling approaches first sample random vertices where vertex sampling probability is proportional to wedge participation probability of that vertex. After vertex sampling, two edges of each selected vertex are sampled to form wedges. The ratio of sampled wedges to closed wedges is used to estimate the number of triangles in the original graph [15]. When deployed on power-law degree graphs, wedge sampling approaches can suffer from bias (mostly high degree vertices are selected as hinge points of selected wedges), as they start with vertex sampling. Random edge sampling approaches count the number of triangles [13] or the number of wedges that are “closed” [16] (that have a third closing edge in the original graph) in the sampled subgraph, and use this count to estimate the triangle count. However, if graphs are sparse and the sampling ratio is low, these approaches can suffer from scarcity of valuable information (e.g. triangles, wedges) in the sampled subgraph. We propose an algorithm for the graph triangle count estimation problem that combines the strong points of edge and wedge sampling while alleviating their deficiencies. Our approach starts with random edge sampling to avoid challenges arising in power-law graphs. Then we first estimate the number of triangles the sampled edges participate in the original graph. We use that first estimate to estimate the triangle count of the original graph. We accomplish this by turning the sampled edges into wedges in a second random edge selection phase and by checking if these sampled wedges are closed. Our contributions can be listed as follows: (i) We propose an approach that offers highly accurate triangle count estimations even when employed over sparse power-law degree graphs and the sampling ratio is low. (ii) We theoretically prove the bounds of our algorithm and show with experiments that found bounds are tight. We also provide theoretical bounds for the state-of-the-art approaches. (iii) We theoretically and practically show that the proposed approach achieves up to eight times sampling size reduction over the state-of-the-art on large-scale real-world graphs. The remainder of this paper is organized as follows. We present existing approximation approaches in Section II along with our observations that led to the development of the proposed algorithm. Section III discusses details of our proposed edge-based wedge selection algorithm. We provide a theoretical analysis of the proposed method and other methods in the literature in Section IV. We evaluate the performance of the proposed method and compare it against the state-of-theart in Section V. In Section VI we conclude. II. C OUNTING T RIANGLES IN A G RAPH Given an undirected graph G = (V, E) defined by a set of vertices V and a set E of pairwise relations (edges) among vertices in V, we would like to estimate ∆, the number of triangles (three edge cycles) in G. Approximation approaches to this problem mostly consider randomly sampling edges or adjacent edge pairs (wedges) from the original graph G and try to estimate the number of triangles in G based on analysis conducted on the sampled graph entities. Existing approximation methods have certain deficiencies when applied to graphs modeling real networks that exhibit power-law degree distributions with many low-degree vertices and few very high-degree vertices [25]. Using the current random edge sampling methods, sampled subgraphs can be too sparse to reveal sufficient information for accurate estimation when low sampling ratios are employed. Using the current random wedge-sampling methods, the uniformity on the wedge selection scheme favors high-degree vertices, and this leads to less accurate estimations. In the remainder of this section, we explain the state-ofthe-art edge and wedge sampling based approaches in detail, discuss their strengths and deficiencies, and provide our intuitions to address these deficiencies. In Table I we summarize the important notations that we use in our discussions and in the remainder of the paper. A. Random edge sampling Random edge sampling based approaches first construct a subgraph GS of G by traversing over each edge in E and adding each edge to the subgraph GS with probability p. They then extract features from GS for estimating ∆. Symbol G ∆ Λ GS ∆S Λ+ S T (e) TS τ du δ(e) σ(t) Description Original graph with vertex set V and edge set E Number of triangles in G Number of wedges in G Random subgraph by edge selection Number of triangles in GS Number of closed wedges in GS Number of triangles in G that contain edge e P Sum of T (e) for edges in GS : e∈GS T (e) Estimate on TS (EWS AMPLE) Degree of vertex u Degree of lower degree end vertex of edge e=(u, v): δ(e)=min(du , dv ) P Sum of δ(e) for edges in triangle t: e∈t δ(e) TABLE I: Summary of the notations. 1) Counting triangles in GS : The idea of random edge sampling to construct a subgraph GS was first proposed by Tsourakakis et al. [13]. In their work, they use the number of triangles in GS to estimate ∆ as ∆S /p3 , where ∆S = |{(u, v, w) | (u, v), (v, w), (w, u) ∈ GS }|. This estimation is based on the fact that all three edges of any triangle in GS has to be selected with probability p from G. A drawback of this approach is that when p is small, GS is very unlikely to contain even one triangle, making this approach impractical for small sampling ratios. 2) Counting closed wedges in GS : Recently, Etemadi et al. [16] proposed an approach that improves upon [13]. They first identify all of the wedges formed in GS , and then check for edges in G to determine whether the wedges in GS are closed in G. That is, for any wedge u−v−w in GS , they check whether the third edge (w, u) is in G or not. They use the 2 count of such closed wedges to estimate ∆ as Λ+ S /3p , where + 1 ΛS =|{(u, v, w) | (u, v), (v, w) ∈ GS , (w, u) ∈ G}|. This estimation is due to the following two facts that the two edges forming a wedge in GS have to be independently selected with probability p, and that any triangle contains three wedges. Although [16] enables selection of smaller p values compared to the proposed approach in [13], we note that achieving accurate estimates still requires a large sampling probability p as the chance of observing sufficient number of wedges remains low when sampling edges from large sparse graphs. In particular, for a graph G with m edges and ∆ triangles, the expected number of wedges in the sampled graph that is part of a triangle in the original graph is 3∆p2 [16] . In our subsequent experiments, ∆ can be in the order of 1010 , and we would like to support p values in the range [10−5 , 10−6 ]. In such a scenario, clearly, the number of closed wedges in the sampled subgraph (each of which form a triangle in the original graph) will be too low to provide accurate estimations. 3) Strengths of edge-based sampling approaches: Random edge-based sampling methods do not require any previous knowledge on the structure of G and can be applied without any preprocessing. Furthermore, in power-low graphs, factoring computations over edges instead of vertices can alleviate challenges associated with the power-law degree distribution of vertices and can also ease parallelism [26]. 1 The original definition in [16] has the 1 multiplier but we instead count 3 the actual number of closed wedges and report one third to estimate ∆. B. Random wedge sampling Random wedge sampling approaches extract wedges from G and analyze properties of extracted wedges to estimate ∆. 1) Uniform wedge sampling: Random uniform wedge sampling for triangle counting was first proposed by Schank and Wagner [27]. More recently, Seshadhri et al. [15], [19] analyze this approach in depth for counting various triadic measures, including counting triangles. Similar appraoches have also been considered in a streaming setting [14]. In a nutshell, uniform random wedge sampling first picks a vertex v in V based on the number of wedges hinging at v and then investigates if a randomly created wedge that consists of two randomly selected edges of v is a closed wedge or not. The ratio of closed wedges to sampled wedges is used to estimate ∆ by multiplying one third of the ratio with Λ, the total number of wedges in G. This estimation is based on the fact that there are three different closed wedges for each triangle in G. 2) Strengths of uniform wedge sampling: This approach does not get adversely impacted from the sparsity of graphs and can support small sampling probabilities as each sampled entity (wedge) is an entity of interest and overall search target (the number of triangles in the graph) is directly proportional to the findings about sampled entities (ratio of closed wedges). Web-Google percent entities (wedges or triangles) 4) Deficiencies of edge-based sampling approaches: The core problem of existing edge-based sparsification approaches is that the relationship between the findings they extract from the sampled graph GS and the estimation they make for triangle count in G is a cubic or quadratic function of p. This prevents accurate estimation for low p values. Ideally, the estimation should be directly proportional to p. 5) Proposed improvement over edge sampling: The intuition behind our proposed approach is similar in nature to the improvement proposed by [16] over [13]. In [16], they point out that instead of counting entities that appear with probability p3 (triangles in GS ), they can count entities that appear with probability p2 (closed wedges in GS ) and thus enable using lower sampling ratios while achieving the same accuracy. In this work, we take one more step further and estimate ∆ using entities that appear with probability p. In our approach, we also start with randomly selecting a set of edges ES ⊂ E. Then, using each edge e in ES , we directly estimate the number of triangles that e is a part of. More formally, let T (e) be the number of triangles in G that e is a part of. Furthermore, let TS be the total number Pof triangles in G that each edge in ES is a part of, i.e. TS = e∈ES T (e). In our approach, we estimate TS , which can also be written as: TS = |{(u, v, w) | (u, v) ∈ ES , (v, w), (w, u) ∈ G}|. We call our estimation for TS as τ and further estimate ∆ as τ /3p, since an edge can be selected with probability p and since each triangle has three edges. Our estimate of TS is directly proportional to p. We explain in detail how we estimate TS and why the probability associated with TS estimation is proportional to p in Section III and Section IV respectively. wedge percentage by degree triangle percentage by degree 2% 1% 0 1000 2000 3000 4000 5000 vertex degree Fig. 1: Wedge and triangle distribution per vertex degree for the Web-Google dataset [28]. 3) Deficiencies of uniform wedge sampling: For graphs with power-law degree distributions, triangles are not uniformly distributed across wedges, as shown on an example in Figure 1. In this figure, we present the percentage of wedges hinging at vertices with a given degree (indicated via green circles) and the percentage of triangles that vertices with a given degree participate in (indicated via red triangles) for a real-world power-law Web graph from Google [28]. As can be seen from the figure, the uniform wedge sampling approach would select more wedges hinging at higher degree vertices simply because there are more such wedges. In fact, as expected, as the vertex degree d increases, the number of wedges hinging at vertices with degree d increases almost quadratically. However, the number of triangles that vertices with degree d participate in have a linear relationship with the degree. These characteristics demonstrate that uniform wedge sampling will provide biased estimations. We observe similar characteristics in many real world networks and they become more prominent as graphs grow larger and sparser. It is also important to note that, for applying uniform wedge sampling, one needs to compute the degree distribution of the vertices and the number of wedges in G; therefore, such approaches require a preprocessing step which takes linear time in the number of edges. 4) Proposed improvement over uniform wedge sampling: To avoid favoring high degree vertices, our algorithm starts by random edge sampling instead of uniform wedge sampling. We then extend each sampled edge to a wedge, and check for the existence of the closing edge in G to determine whether the vertices of the wedge define a triangle or not. To increase the accuracy of our estimate, we only consider the wedges that hinge at the lower degree vertex of the selected edges. By selecting random edges in the first step, we ensure that we start with a good sampling distribution. Note that the probability of sampling a wedge in our schema is linearly proportional with the degree of the vertex that the wedge hinges at, whereas for uniform wedge sampling, that probability is quadratically proportional with the degree of the hinge vertex. III. E DGE -BASED W EDGE S AMPLING Our approach to estimating the number of triangles in G is based on sampling a set of edges ES and estimating the number of triangles in G that the sampled edges are part of. To accomplish this, after sampling a set of edges ES in a first step, we keep sampling further edges in a second step to form wedges with each sampled edge in ES . To increase the accuracy of our estimate, in the second step, we only consider edges that form wedges hinging at the lower degree vertices of the edges selected in the first step. In a third step, we perform a check for the third edge to determine whether the vertices of a selected wedge define a triangle or not. If any such wedge is closed, we estimate the number of triangles the originally sampled edge contributes in to be the degree of its lowerend vertex. If a sampled wedge is not closed, we estimate the number of triangles the originally sampled edge contributes in to be zero. Using these estimates, we then estimate the total number of triangles in the original graph. Since our approach is initially based on random edge sampling, we do not need to perform a preprocessing step to obtain degree distributions of vertices in G; we only consider degrees of vertices of sampled edges ES . Furthermore, via edge sampling, we avoid being highly biased towards high degree vertices. By constructing wedges via a second sampling stage we ensure that all sampled edges turn into entities of interest. By selecting low-end of each sampled edge as wedge hinge points, we reduce the search space. Finally, by making an estimation associated with each sampled edge (i.e. the number of triangles that edge participates in), we ensure that our overall estimation correlates linearly with the sampling size, which enables us to significantly reduce sampling ratio. Next, we discuss in detail our edge-based wedge selection and triangle estimation algorithm EWS AMPLE. Pseudocode of EWS AMPLE is depicted in Algorithm 1. Given a graph G and a sampling probability p, we first randomly sample edges ES as shown in lines 2–5. For any edge e = (u, v) ∈ ES selected in the first step, let us assume dv ≤ du without loss of generality. In lines 6–7, for any selected edge in ES , we randomly select one more edge, say (v, w) among the remaining edges incident to v to form a path or wedge u-v-w. In lines 8–9, we check for the existence of the edge (u, w) in the original graph. If the original graph indeed contains the edge (u, w), we increment the total triangle count τ by dv − 1. That is, if the sampled wedge originating from e = (u, v) is closed and forms a triangle, then we estimate T (e), the number of triangles e participates in, as the number of edges adjacent to e at v, which is equal to dv − 1. The rationale of this estimation is based on a single wedge, hence, we estimate T (e) to be 0 or dv − 1 depending on the outcome. Finally, in line 10, we return τ /3p as an estimate for ∆ since a triangle can be counted by all of its three edges’ estimates. The complexity of our algorithm is O(m): the subgraph sampling takes O(m) time, and the rest of the algorithm takes O(pm) time. We illustrate our algorithm EWS AMPLE on an example (see Figure 2). Our example graph G contains 11 vertices, 16 edges and 5 triangles (Figure 2(a)). The triangles are {v1 , v2 , v6 }, {v1 , v2 , v7 }, {v1 , v3 , v4 }, {v1 , v7 , v8 }, and {v2 , v5 , v6 }. Running EWS AMPLE with probability p = 3/16, let us assume that the sampled edges ES in the first step are (v2 , v5 ), (v1 , v4 ), and (v7 , v8 ) (Figure 2(b)). In the second step, we randomly select an edge incident to the low degree vertices of these edges (Figure 2(c)); for e = (v2 , v5 ) let the randomly selected edge be e0 = (v5 , v4 ), for e = (v1 , v4 ) let e0 = (v4 , v3 ), and for e = (v7 , v8 ) let e0 = (v8 , v1 ) (note that the last selection is with probability 1 since dv8 − 1 = 1). Then, we compute τ based on whether these wedges are closed or not (Figure 2(d)): v2 −v5 −v4 is not closed so that wedge does not increase τ , but the other two wedges v1 −v4 −v3 and v7 −v8 −v1 are closed and they both increase τ by their low degrees - 1 respectively. In particular, τ gets increased by 2 for the edge (v1 , v4 ) and by 1 for the edge (v7 , v8 ). Finally, EWS AMPLE outputs the final estimate as: 3 16 τ = ≈ 5.33 = 3 3p 3 3 × 16 To compare our approach to existing approaches, Figure 3(a) showcases a potential run of the algorithm proposed in [15] with a sampling rate of p = 3/16, i.e., k = 3 random wedges. As seen in the figure, their randomly selected wedges are v1 −v4 −v5 , v1 −v2 −v7 , and v11 −v1 −v3 , and only one of them is closed: v1 −v2 −v7 . In this graph number of wedges Λ = 56, therefore their estimate can be calculated as: 1× 56 Λ = ≈ 6.22 3k 9 Figure 3(b) showcases a potential run of the algorithm proposed in [16]. One can argue that since our approach and uniform wedge sampling work with wedges, the random edge sampling method should be allowed to pick twice the number of edges. However, note that random edge selection requires constructing the subgraph GS , and identifying all the wedges in GS , which can be very costly. Practically, sampling an edge and sampling a wedge have similar costs and algorithms should be compared based on their performance when they sample the same number of entities (edges or wedges). We note that when p is very low, finding even one closed wedge using the algorithm in [16] becomes very difficult even in our simple example. So we pick twice the number of edges to be able to find some closed wedges in the sampled graph, i.e., we use a sampling rate of 2p. As seen in the figure, their sample graph contains 6 edges and these sampled edges form 4 wedges. Out of these 4 wedges, Λ+ S = 3 of them are closed: v5 −v2 −v6 , v1 −v2 −v6 , and v1 −v4 −v3 . Noting that the probability used in their first step is 3/8, their estimate can be computed as: Λ+ 3 64 S = = ≈ 7.11 3 2 2 3p 9 3 × (8) (a) Example graph G with 11 vertices, 16 edges, and 5 triangles. Sampling probability p is given as p=3/16. (b) Random edge sampling over the example graph G provides three selected edges: ES ={(v2 , v5 ), (v1 , v4 ), (v7 , v8 )}. (c) Informed wedge sampling for selected edges. Each wedge hinges on the lower degree end of the initially selected edges. (d) Triangle check in G. Wedges hinging at v4 , v8 form triangles, τ =(dv4 − 1)+(dv8 − 1)=3. Estimate is τ /3p ≈ 5.33. Fig. 2: Illustration of EWS AMPLE on an example graph. Algorithm 1 EWS AMPLE(G = (V, E), p) 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: τ ← 0, ES ← ∅ for each edge e ∈ E do randomly select edge e = (u, v) with probability p if e is selected then ES ← ES ∪ {e} for each selected edge e = (u, v) ∈ ES do randomly select an edge e0 = (v, w) incident to v, where dv ≤ du and w 6= u if e00 = (u, w) ∈ E then τ ← τ + dv − 1 return τ /3p A. Expected Value, Variance, and RSE of EWS AMPLE To provide this analysis we first express our output in terms of indicator variables. First, we number the edges in the original graph as e1 , . . . , em . For any given edge ei , we represent each of the T (ei ) triangles that ei participates in by the wedges that hinge on the lower degree vertex of ei . To that extent, we number each such edge that belongs to a triangle with ei and adjacent to ei on the lower degree vertex. Letting these edges be ei1 , . . . , eiT (ei ) , we define our indicator variable wij as the indicator for selecting ei in the first step and eij in the second step as the wedge for ei . Finally, defining δ(ei ) to be the degree of the lower degree vertex of ei , we express τ , our estimate for TS as: τ= (ei ) m TX X wij · (δ(ei ) − 1). i=1 j=1 Using this expression, we show that the expected value of τ is 3p∆, and thus the expected value of the output of EWS AMPLE is ∆. (a) Random-wedge sampling algorithm proposed in [15]. Out of the 3 sampled wedges, only 1 wedge is closed. Estimate is 56/9≈6.22. (b) Random-edge sampling and wedge counting algorithm proposed in [16]. The edges form 4 wedges, 3 of which are closed. Estimate is 64/9≈7.11. Fig. 3: Illustration of applying the state-of-the-art approaches: (a) uniform wedge sampling approach proposed in [15], and (b) random edge sampling approach proposed in [16]. Lemma 1. The expected value of τ is 3p∆. Pm PT (e ) Proof. We have τ = i=1 j=1i wij · (δ(ei ) − 1) for the EWS AMPLE algorithm. Hence: E(τ ) = (ei ) m TX X The probability that wij = 1 is p/(δ(ei ) − 1), therefore: E(τ ) = (ei ) m TX X i=1 j=1 IV. E XPECTED VALUE , VARIANCE , AND RSE We analyze the expected value, variance, and relative standard error (RSE) of our estimate τ in order to investigate the confidence interval of the outputs of EWS AMPLE. We also analyze the same terms for the state-of-the-art approaches to provide theoretical comparisons. We provide the theoretical analysis in this section, and show empirical evidences that corroborate our theory in the next section. E(wij ) · (δ(ei ) − 1) i=1 j=1 p= m X pT (ei ) = 3p∆ i=1 where the latter equality holds as each triangle is counted in each of its edges’ T (e) values. Next, we argue that the variance of τ is low, however, our arguments involve some features of the original graph G. More specifically, the variance of τ involves the terms K and φ, where K is the number of pairs ofP triangles that share an edge ∆ in G [16], and we define φ as φ = i=1 σ(ti )−3, P where σ(ti ) is the sum of δ(e) for edges in triangle ti : σ(ti ) = e∈ti δ(e). Intuitively, one can think of φ as the sum of the degrees of each vertex in each triangle in G, except that instead of summing the maximum degree vertex, the sum involves the minimum degree vertex twice. This is due to fact that we select the low degree vertex of the initially selected edge as hinge point in our edge-based wedge construction mechanism. 2 Lemma P∆ 2. The variance of τ is pφ − p (3∆ + 2K), where φ = i=1 σ(ti ) − 3. Proof. Since the indicator variables wi1 j1 and wi2 j2 are independent for i1 6= i2 , we have:   T (ei ) m X X var(τ ) = var  wij · (δ(ei ) − 1) i=1 The above formula is complex, however, we can approximate it by simply dropping the negative term inside the square root. We argue that this will not affect our actual RSE values too much since the p values we choose for our experiments will be very low, and in addition the actual value of the negative term, (3∆ + 2K)/9∆2 , will be too low for the graphs we consider making the negative term very insignificant. Therefore, we approximate our RSE using the following formula: s RSE(τ ) ≈ φ 9p∆2 (1) j=1 This can be rewritten as  T (ei ) m X X  var(τ ) = (δ(ei ) − 1)2 · var(wij ) P∆ where φ = i=1 σ(ti ) − 3 is a constant depending only on the original graph G. In our experiments, we show that we achieve RSE values that are very close to the approximation we provide in Equation 1. j=1 i=1  + X (δ(ei ) − 1)2 · covar(wij , wik ) j6=k We have var(wij ) = (p/(δ(ei ) − 1) − p2 /(δ(ei ) − 1)2 ) and since we are selecting only one wedge for each edge, we have covar(wij , wik ) = (0 − p2 /(δ(ei ) − 1)2 ). Further simplifying:   T (ei ) T (ei ) m X X X X  var(τ ) = p · (δ(ei ) − 1) − p2 − p2  i=1 =p m X j=1 j=1 T (ei ) · (δ(ei ) − 1) − p2 i=1 m X 2 −p m X j6=k T (ei ) i=1 T (ei )(T (ei ) − 1) i=1 The first term can be written as a sum over the triangles where for each triangle, the value δ(e) − 1 is summed for each of its edges. The second term can be written in terms of ∆, the number of triangles in G. And, the third term can be written in terms of K, the number of pairs of triangles that share an edge in G. Finally, we prove: ! ∆ X var(τ ) = p σ(ti ) − 3 − p2 (3∆ + 2K) i=1 where σ(ti ) is the sum of δ(e) for edges in triangle ti . In order to compare our method to previous work, we use the Relative Standard Error (RSE) values of all of the methods and base our arguments on the RSE values. Applying p the formula for the relative standard error RSE(τ ) = var(τ )/E(τ ), we obtain: s p pφ − p2 (3∆ + 2K) φ 3∆ + 2K RSE(τ ) = = − 3p∆ 9p∆2 9∆2 B. RSE of Other Methods We also analyze the expected value, variance, and the RSE of the other methods to offer a theoretical comparison with our method. We consider two state-of-the-art methods, the method introduced by Etemadi et al. [16], which we call E DGE S AMPLE, as well as the method introduced by Seshadhri at al. [15], which we call W EDGE S AMPLE. We begin with the analysis of W EDGE S AMPLE, the method introduced by Seshadhri et al. [15]. We define indicator variables for each of the 3∆ closed wedges in order to express the random variable that counts the number of closed wedges observed in W EDGE S AMPLE. Letting wi to be an indicator for the ith closed wedge, indicator for whether it is one of the randomly selected k = pm wedges, we define: ω= 3∆ X wi i=1 Using ω, W EDGE S AMPLE outputs ωΛ/3k to estimate ∆. In the next lemma, we provide the expected value and the variance analysis of ω to be used in the relative standard error analysis of ω, where C = 3∆/Λ is the clustering coefficient: Lemma 3. The expected  value ofω is pmC, and the variance of ω is pmC(1 − C) 1 − pm−1 Λ−1 . P3∆ P3∆ Proof. We have E(ω) = i=1 E(wi ) = i=1 k/Λ = 3∆k/Λ, which implies E(ω) = pmC by definition. For variance, we have var(wi ) = Λk (1 − Λk ). Also, we have k−1 covar(wj , wk ) = Λk ( Λ−1 − Λk ) for any wj 6= wk . Therefore, we write variance as: var(ω) = 3∆ X var(ri ) + i=1 X covar(rj , rk ) j6=k     k k k k−1 k = 3∆ 1− + 3∆(3∆ − 1) − Λ Λ Λ Λ−1 Λ     k k−1 k = kC 1 − + kC(3∆ − 1) − Λ Λ−1 Λ    k−1 k−1 k−1 1 = kC 1 − + 3∆ − − Λ−1 Λ−1 Λ Λ   k−1 k−1 1 = kC 1 − + 3∆ − 3∆ Λ−1 Λ(Λ − 1) Λ  The last equation simplifies as pmC(1 − C) 1 − proving the variance stated in the lemma. pm−1 Λ−1  Using this lemma, we obtain p the formula for their relative standard error RSE(ω) = var(ω)/E(ω): r  pmC(1 − C) 1 − RSE(ω) = = pm−1 Λ−1  pmC s 1−C pmC  1− pm − 1 Λ−1 In the next section, we provide empirical evidence that verifies the above approximation given in Equation 2. Next, we analyze E DGE S AMPLE, the method proposed by Etemadi et al. [16]. Once again, we define an indicator variable for each of the 3∆ closed wedges in order to express the closed wedge count of this method. Letting ri to be an indicator for the ith closed wedge, indicator for whether it is included in GS in the first step of E DGE S AMPLE, we define: 3∆ X Once again, we can drop the insignificant negative terms from the above formula to get an approximation with fewer simpler terms. s 1 8K (3) RSE(ρ) ≈ + 2 3p ∆ 9p∆2 Note that the approximation in Equation 3 is different than the one in proposed in the work of Etemadi et al. [16] and the main reason to include the extra term is to ensure a much better approximation. In the next section, we verify the validity of our approximation schemes and argue that we can simply use the theoretical approximations to compare the performance of the three methods. V. E VALUATION In this section, we provide an empirical and theoretical evaluation of the proposed algorithm.  Similarly, we can drop the insignificant negative terms from the above formula and get an approximation with fewer simpler terms: s 1−C RSE(ω) ≈ (2) pmC ρ= p 3∆(p2 − p4 ) + 8K(p3 − p4 ) 3p2 ∆ s 1 8K 1 8K = − − + 2 2 3p ∆ 3∆ 9p∆ 9∆2 RSE(ρ) = ri i=1 Using ρ, E DGE S AMPLE outputs ρ/3p2 to estimate ∆. In the next lemma, we provide the expected value and variance of ρ based on the discussion from their original work [16]: Lemma 4. The expected value of ρ is 3p2 ∆, and the variance of ρ is 3∆(p2 − p4 ) + 8K(p3 − p4 ). Using this lemma, we obtain p the formula for their relative standard error RSE(ρ) = var(ρ)/E(ρ): A. Experimental Setup We compare the performance of our edge-based wedge sampling algorithm (EWS) with the state-of-the-art edge sampling (ES) and wedge sampling (WS) approaches proposed by Etemadi et al. [16] and Seshadhri et al. [15] both theoretically and experimentally using graphs modeling real-world largescale networks. We also corroborate the theoretical analysis we provided in Section IV with empirical evidence. In the forthcoming experiments and analysis, we sample the same number of entities for the three different approaches; edges for ES, and wedges for WS and EWS. All approaches perform closed wedge checks as necessary; however, we do not account for the cost of those checks. In practice, the costs are almost exactly the same for WS and EWS, however, ES performs more checks as it considers closed wedge checks for any pair of adjacent edges in the sampled subgraph. For comparison and also in order to verify our theoretical analysis, we observe the relative standard error (RSE) values of different algorithms for each of the datasets and compare these values with the theoretical analysis we provided in Section IV. In order to provide comparable results, as was done in [16], we either fix the sampling probability, and report the corresponding RSE values of the three algorithms, or fix an RSE value and report the corresponding sampling rates. We calculate the experimental RSE values observed with k different runs of the algorithms using the formula: q P k 1 i=1 (∆i − µ) k RSE = , ∆ TABLE II: Datasets used in experiments and their features. Dataset Ego-Facebook [29] Enron-email [28] Brightkite [29] Dblp-coauthor [29] Amazon [29] Web-NotreDame [28] Citeseer [28] Dogster [28] Web-Google [28] YouTube [29] DBLP [28] As-skitter [29] Flicker [28] Orkut [28] LiveJournal [29] Orkut2 [30] Web-Arabic [30] MicrosoftAG [31] Twitter [28] Friendster [28] n m ∆ C= 3∆ Λ 3∆ m φ 3∆ K ∆ 4K 36K 58K 317K 334K 325K 384K 426K 875K 1134K 1314K 1696K 2302K 3072K 3997K 11514K 22743K 46742K 41652K 65608K 88K 183K 214K 1049K 925K 1090K 1736K 8543K 4322K 2987K 5362K 11095K 22838K 117185K 34681K 327036K 553903K 528463K 1202513K 1806067K 1612K 727K 494K 2224K 667K 8910K 1351K 83499K 13391K 3056K 12184K 28769K 837605K 627584K 177820K 223127K 36895360K 578188K 34824916K 4173724K 0.5192 0.0853 0.1106 0.3064 0.2052 0.0877 0.0496 0.0143 0.0552 0.0062 0.1703 0.0054 0.1076 0.0413 0.1253 0.0003 0.0313 0.0151 0.0008 0.0174 54.8 11.9 6.9 6.4 2.2 24.5 2.3 29.3 9.3 3.1 6.8 7.8 110.0 16.1 15.4 2.0 199.8 3.3 86.9 6.9 115.5 102.1 76.6 37.6 7.1 119.4 26.6 1085.2 35.4 257.7 38.0 796.4 1239.9 371.3 204.3 1229.0 2047.7 97.1 11638.5 311.6 141.9 50.2 59.1 47.2 5.3 174.2 11.6 503.8 46.4 82.4 35.8 713.3 732.8 106.9 222.1 155.4 3042.7 33.9 5061.5 44.4 where ∆i is the estimate obtained in the Pki-th run and µ is the mean of all of the k runs, i.e., µ = k1 i=1 ∆i . In all of our experiments, we use k = 1000. The experiments are conducted on a server with 16 CPUs and 64 GB of RAM. In our experimental analysis we use 20 real-world datasets that were also used in [16]. These datasets vary in size; largest containing vertices in the order of ten millions and triangles in the order of ten billions, and the smallest containing vertices in the order of thousands and triangles in the order of millions. Features of these datasets are presented in Table II. In addition to graph features, we also provide metrics of graphs that impact the performance of ES, WS and EWS in Table II as well. For example the higher the value of global clustering coefficient C = 3∆/Λ, the better the performance of WS, as the chances of finding closed wedges during sampling increase. Similarly, 3∆/m indicates the number of triangles an average edge participates in a graph, and the higher this number the better the performance of EWS in general. EWS performance also gets impacted from the value of φ/3∆ as well, which can be considered as the degree of the lowest degree or medium degree vertex in an average triangle. The higher this number gets, the courser the estimations made by EWS, hence the worse its performance. A similar argument can be made for ES and K/∆. B. Empirical Analysis and Verification of Theory Figure 4, provides an empirical analysis of ES, WS, and EWS over the 20 datasets listed in Table II. The figure also depicts the RSE estimations indicated by Equations 1, 2, and 3 for EWS, WS, and ES, respectively. In this figure, the x-axis ranges between the sampling probabilities that provides RSE values between 0.50 and 0.04 for EWS and we report the corresponding RSE values for ES, WS, and EWS when using the same sampling rates. For all datasets depicted in Figure 4, the empirical RSE observations we make for EWS, WS, and ES match the Description Online social network (OSN) in Facebook Email communication network in Enron OSN in Brightkite Co-authorship network in DBLP Co-purchasing network from Amazon Web graph of Notre Dame Citation network in Citeseer OSN from dogster.com website Web graph from Google OSN in Youtube Co-authorship network in DBLP Internet connections from Skitter project Online social network in Flicker Online social network in Orkut OSN in LiveJournal OSN in Orkut Web graph from Arabian countries Citation network from Microsoft Academic OSN from Twitter OSN of website Friendster theoretical bounds EWS-est, WS-est, and ES-est that we compute using Equations 1, 2, and 3, respectively. This proves the validity of our theoretical analysis. Interestingly, we can observe in Figure 4 that the datapoints for EWS and WS follow a similar pattern and they exhibit parallel trends irrespective of the sampling ratio. In fact, this is to be expected as the theoretical RSE approximations in Equations 1 and 2 both depend linearly on the sampling ratio and hence the estimations EWS-est and WS-est are parallel. Therefore, the ratio of their RSE values remain the same accross various sampling probabilities. Whichever of these two algorithms will perform better is based on the parameters of the graph. In 14 of the datasets EWS performs better than WS and in 6 datasets WS performs better than EWS. We note that since this is a log-log figure, the slight difference between the two lines in fact indicate a multiplicative difference. In Figure 4, for all datasets and most p values, EWS and WS perform significantly better than ES. On the other hand, the slope for ES-est is much steeper—also to be expected because of the quadratic dependence on the sampling ratio—and even though ES provides much higher RSE values for low p values, as p increases, the accuracy of ES increases significantly. To provide a deeper understanding of the difference between the three algorithms we compare, we also present Table III, where we fix the RSE to 0.05 (95% confidence value) and compare the number of sampled entities that allows all approaches to achieve this given RSE value using the theoretic approximations from Equations 1, 2, and 3. As seen in the table, in all datasets either EWS or WS provides the lowest sampling size. Hence, in the last column of the table we provide the ratio of the sampling sizes for WS and EWS. Similar to the results provided in Figure 4, in 14 datasets WS the EW S value is higher than one, indicating that EWS outperforms WS, and for 6 datasets it is lower. Furthermore, because the RSE values of both approaches depend linearly on WS the sampling ratio, the EW S ratio in Table III would remain 0.48 0.48 0.48 0.48 0.23 0.11 0.02 9.6e-05 ES-est ES WS-est WS EWS-est EWS 0.23 0.11 0.05 0.02 2.9e-04 8.6e-04 7.7e-03 2.6e-03 1.9e-04 p (log scale) ES-est ES WS-est WS EWS-est EWS 0.02 5.1e-03 ES-est ES WS-est WS WS-est EWS 0.11 0.05 0.02 6.2e-04 1.5e-02 0.23 1.9e-03 5.6e-03 2.3e-05 1.7e-02 (c) Brightkite. Web-NotreDame 0.48 0.48 0.48 0.05 0.02 ES-est ES WS-est EWS-est WS EWS 0.05 0.02 4.3e-05 1.3e-04 3.8e-04 1.2e-03 1.8e-05 ES-est ES WS-est WS EWS-est EWS 0.23 0.11 0.05 0.02 5.3e-05 p (log scale) 4.7e-04 1.6e-04 1.4e-03 RSE (log-scale) 0.48 RSE (log-scale) 1.00 0.11 2.6e-05 ES-est ES WS-est WS EWS-est EWS (e) Amazon. (f) Web-NotreDame. Web-Google 0.23 0.11 0.05 0.02 7.8e-05 p (log scale) 2.4e-04 7.1e-04 2.1e-03 1.7e-05 0.48 0.05 0.02 7.8e-06 0.05 0.02 1.7e-05 3.9e-05 1.9e-04 8.6e-05 4.2e-04 1.1e-04 ES-est ES WS-est WS EWS-est EWS 3.0e-04 0.23 0.11 0.05 0.02 7.9e-04 2.1e-03 5.5e-03 1.5e-02 RSE (log-scale) 0.48 RSE (log-scale) 0.48 RSE (log-scale) 0.48 0.11 4.2e-06 ES-est ES WS-est WS EWS-est EWS (i) Web-Google. 2.9e-05 2.1e-04 7.7e-05 5.4e-04 3.7e-05 (k) DBLP. Orkut LiveJournal 0.48 0.48 0.05 0.02 5.2e-06 0.11 0.05 0.02 1.4e-05 3.7e-05 9.7e-05 7.9e-07 2.6e-04 ES-est ES WS-est WS EWS-est EWS 1.9e-06 p (log scale) 0.23 0.11 0.05 0.02 4.7e-06 1.1e-05 2.8e-05 6.8e-05 RSE (log-scale) 0.48 RSE (log-scale) 0.48 RSE (log-scale) 1.00 ES-est ES WS-est WS EWS-est EWS 1.5e-06 ES-est ES WS-est WS EWS-est EWS (m) Flicker. 1.8e-05 6.0e-05 2.0e-04 7.3e-06 (o) LiveJournal. MicrosoftAG Twitter 0.48 0.48 0.05 0.02 ES-est ES WS-est WS EWS-est EWS 0.05 0.02 7.4e-08 1.6e-07 3.3e-07 6.9e-07 1.4e-06 3.0e-06 6.3e-06 p (log scale) (q) Web-Arabic. ES-est ES WS-est WS EWS-est EWS 0.23 0.11 0.05 0.02 2.2e-07 4.5e-07 9.2e-07 1.9e-06 3.8e-06 7.7e-06 1.6e-05 p (log scale) (r) MicrosoftAG. RSE (log-scale) 0.48 RSE (log-scale) 0.48 RSE (log-scale) 1.00 0.11 4.5e-07 ES-est ES WS-est WS EWS-est EWS 0.11 0.02 3.1e-06 8.3e-06 p (log scale) (s) Twitter. Fig. 4: RSE vs p for the 20 datasets. 9.8e-04 0.23 0.05 1.2e-06 2.9e-04 Friendster 1.00 0.23 8.5e-05 (p) Orkut2. 1.00 0.11 2.5e-05 p (log scale) 1.00 0.23 ES-est ES WS-est WS EWS-est EWS p (log scale) (n) Orkut. Web-Arabic 0.11 0.02 5.2e-06 4.8e-03 0.23 0.05 p (log scale) 1.8e-03 6.9e-04 Orkut2 1.00 0.23 2.6e-04 (l) As-skitter. 1.00 0.11 9.8e-05 p (log scale) 1.00 0.23 ES-est ES WS-est WS EWS-est EWS p (log scale) (j) YouTube. Flicker 0.11 0.02 1.1e-05 2.2e-03 0.23 0.05 p (log scale) p (log scale) 8.3e-04 As-skitter DBLP 1.00 ES-est ES WS-est WS EWS-est EWS 3.2e-04 (h) Dogster. 1.00 0.23 1.2e-04 (g) Citeseer. 1.00 0.11 4.6e-05 p (log scale) 1.00 0.23 ES-est ES WS-est WS EWS-est EWS p (log scale) YouTube 1.8e-03 6.1e-04 Dogster Citeseer 0.23 2.0e-04 (d) Dblp-Coau. 1.00 0.11 6.8e-05 p (log scale) 1.00 0.23 ES-est ES WS-est WS EWS-est EWS p (log scale) 1.00 RSE (log-scale) RSE (log-scale) 1.7e-03 (b) Enron-email. Amazon RSE (log-scale) 0.11 p (log scale) (a) Ego-Facebook. RSE (log-scale) 0.23 0.05 5.6e-04 RSE (log-scale) 1.00 RSE (log-scale) 1.00 0.05 RSE (log-scale) Dblp-Coau Brightkite Enron-email 1.00 RSE (log-scale) RSE (log-scale) Ego-Facebook 1.00 2.2e-05 5.8e-05 1.0e-07 ES-est ES WS-est WS EWS-est EWS 3.3e-07 1.1e-06 3.4e-06 p (log scale) (t) Friendster. 1.1e-05 TABLE III: Sample sizes to achieve RSE=0.05. Dataset Ego-Facebook Enron-email Brightkite Dblp-coauthor Amazon Web-NotreDame Citeseer Dogster Web-Google Youtube DBLP As-skitter Flicker Orkut LiveJournal Orkut2 Web-Arabic MicrosoftAG Twitter Friendster m ES WS EW S WS EW S 88K 183K 214K 1049K 925K 1090K 1736K 8543K 4322K 2987K 5362K 11095K 22838K 117185K 34681K 327036K 553903K 528463K 1202513K 1806067K 2978 5619 10299 13005 14460 9459 20102 23326 16556 38692 20763 103336 13332 57679 38703 296516 42394 259340 111704 326237 370 4288 3217 905 1549 4162 7660 27631 6842 63923 1949 73852 3315 9293 2791 1519667 12363 26135 472194 22621 843 3443 4417 2369 1316 1948 4554 14805 1525 33586 2228 40950 4507 9244 5314 240184 4098 11836 53584 17976 0.44 1.25 0.73 0.38 1.18 2.14 1.68 1.87 4.49 1.90 0.87 1.80 0.74 1.01 0.52 6.33 3.02 2.21 8.81 1.26 the same if some other fixed RSE value was used instead. Noticeably, the datasets that WS outperforms EWS are datasets with high global clustering coefficient values (e.g. C ≥ 0.1). This is expected as in these datasets the probability of observing closed wedges when sampling wedges increase significantly and the advantage of EWS over WS is lost. However, EWS outperforms WS for all graphs with low global clustering coefficient values (C < 0.1) as the performance of WS is directly tied to this coefficient. We also note that advantage of EWS over WS becomes more prominent as the sizes of graphs increase. Complexity of EWS, ES, and WS are all O(m) and practical runtimes of these algorithms with low sampling ratios over very large graphs are very fast. As an example, on the Twitter dataset, with a sampling ratio of p ≈ 0.00006, EWS, ES, and WS takes 1.12, 1.11, and 0.26 seconds. VI. C ONCLUSION We proposed an edge-based wedge sampling approach for estimating the number of triangles in very large power-law degree graphs. Our approach combines the benefits of edge and wedge sampling to offer highly accurate estimations even for very large sparse graphs and for very low sampling ratios. Furthermore, it does not require any preprocessing to be performed over the graphs. Through analysis conducted over graphs modeling large-scale real-world networks, we theoretically and empirically show that our approach offers highly confident estimations and up to eight times sampling size reduction over the state-of-the-art alternatives even when the sampling ratio is low. R EFERENCES [1] M. E. Newman, “The structure and function of complex networks,” SIAM review, vol. 45, no. 2, pp. 167–256, 2003. [2] S. Wasserman and K. Faust, Social network analysis: Methods and applications. Cambridge university press, 1994, vol. 8. [3] Z. Yang, C. Wilson, X. Wang, T. Gao, B. Y. Zhao, and Y. Dai, “Uncovering social network sybils in the wild,” ACM Transactions on Knowledge Discovery from Data (TKDD), vol. 8, no. 1, p. 2, 2014. [4] G. Kalna and D. J. Higham, “A clustering coefficient for weighted networks, with application to gene expression data,” AI Commun., vol. 20, no. 4, pp. 263–271, Dec. 2007. [5] Y. A. AL-Khassawneh, N. Salim, and O. A. Isiaka, “Extractive text summarisation using graph triangle counting approach: Proposed method,” in 1 st International Conference of Recent Trends in Information and Communication Technologies in Universiti Teknologi Malaysia, Johor, Malaysia, 2014, pp. 300–311. [6] N. Alon, R. Yuster, and U. Zwick, “Finding and counting given length cycles,” Algorithmica, vol. 17, no. 3, pp. 209–223, Mar 1997. [7] F. Le Gall, “Powers of tensors and fast matrix multiplication,” in Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation, ser. ISSAC ’14. New York, NY, USA: ACM, 2014, pp. 296–303. [8] T. Schank and D. Wagner, “Finding, counting and listing all triangles in large graphs, an experimental study,” in Experimental and Efficient Algorithms: 4th International Workshop, WEA, S. E. Nikoletseas, Ed. Berlin, Heidelberg: Springer Berlin Heidelberg, 2005, pp. 606–609. [9] Z. Bar-Yossef, R. Kumar, and D. Sivakumar, “Reductions in streaming algorithms, with an application to counting triangles in graphs,” in Proceedings of the Thirteenth Annual ACM-SIAM Symposium on Discrete Algorithms, ser. SODA’02. Society for Industrial and Applied Mathematics, 2002, pp. 623–632. [10] H. Jowhari and M. Ghodsi, “New streaming algorithms for counting triangles in graphs,” in Proceedings of the 11th Annual International Conference on Computing and Combinatorics, ser. COCOON’05. Berlin, Heidelberg: Springer-Verlag, 2005, pp. 710–716. [11] L. S. Buriol, G. Frahling, S. Leonardi, A. Marchetti-Spaccamela, and C. Sohler, “Counting triangles in data streams,” in Proceedings of the Twenty-fifth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, ser. PODS ’06, 2006, pp. 253–262. [12] M. Latapy, “Main-memory triangle computations for very large (sparse (power-law)) graphs,” Theoretical Computer Science, vol. 407, no. 1-3, pp. 458–473, 2008. [13] C. E. Tsourakakis, U. Kang, G. L. Miller, and C. Faloutsos, “Doulion: Counting triangles in massive graphs with a coin,” in Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ser. KDD ’09. ACM, 2009, pp. 837–846. [14] M. Jha, C. Seshadhri, and A. Pinar, “A space efficient streaming algorithm for triangle counting using the birthday paradox,” in Proceedings of the 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ser. KDD ’13. ACM, 2013, pp. 589– 597. [15] C. Seshadhri, A. Pinar, and T. G. Kolda, “Wedge sampling for computing clustering coefficients and triangle counts on large graphs,” Statistical Analysis and Data Mining, vol. 7, no. 4, pp. 294–307, 2014. [16] R. Etemadi, J. Lu, and Y. H. Tsin, “Efficient estimation of triangles in very large graphs,” in Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, ser. CIKM ’16. New York, NY, USA: ACM, 2016, pp. 1251–1260. [17] L. Becchetti, P. Boldi, C. Castillo, and A. Gionis, “Efficient semistreaming algorithms for local triangle counting in massive graphs,” in Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ser. KDD’08, 2008, pp. 16–24. [18] M. N. Kolountzakis, G. L. Miller, R. Peng, and C. E. Tsourakakis, Efficient Triangle Counting in Large Graphs via Degree-Based Vertex Partitioning, 2010, pp. 15–24. [19] C. Seshadhri, A. Pinar, and T. G. Kolda, “Triadic measures on graphs: The power of wedge sampling,” in Proceedings of the 2013 SIAM International Conference on Data Mining. SIAM, 2013, pp. 10–18. [20] S. Suri and S. Vassilvitskii, “Counting triangles and the curse of the last reducer,” in Proceedings of the 20th International Conference on World Wide Web, ser. WWW ’11, 2011, pp. 607–614. [21] R. Pagh and C. E. Tsourakakis, “Colorful triangle counting and a mapreduce implementation,” Information Processing Letters, vol. 112, no. 7, pp. 277 – 281, 2012. [22] T. G. Kolda, A. Pinar, T. Plantenga, C. Seshadhri, and C. Task, “Counting triangles in massive graphs with mapreduce,” SIAM Journal on Scientific Computing, vol. 36, no. 5, pp. S48–S77, 2014. [23] X. Hu, Y. Tao, and C.-W. Chung, “I/O-efficient algorithms on triangle listing and counting,” ACM Trans. Database Syst., vol. 39, no. 4, pp. 27:1–27:30, Dec. 2014. [24] H. Kim, J. Lee, S. S. Bhowmick, W.-S. Han, J. Lee, S. Ko, and M. H. Jarrah, “Dualsim: Parallel subgraph enumeration in a massive graph on a single machine,” in Proceedings of the 2016 International Conference on Management of Data, ser. SIGMOD’16, 2016, pp. 1231–1245. [25] A.-L. Barabási and R. Albert, “Emergence of scaling in random networks,” Science, vol. 286, no. 5439, pp. 509–512, 1999. [26] J. E. Gonzalez, Y. Low, H. Gu, D. Bickson, and C. Guestrin, “Powergraph: Distributed graph-parallel computation on natural graphs,” in Presented as part of the 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI 12). USENIX, 2012, pp. 17–30. [27] T. Schank and D. Wagner, “Approximating clustering coefficient and transitivity,” Journal of Graph Algorithms and Applications, vol. 9, p. 2005, 2005. [28] J. Kunegis, “Konect: the koblenz network collection,” in Proceedings of the 22nd International Conference on World Wide Web. ACM, 2013, pp. 1343–1350. [29] J. Leskovec and A. Krevl, “{SNAP Datasets}:{Stanford} large network dataset collection,” 2015. [30] P. Boldi, M. Rosa, M. Santini, and S. Vigna, “Layered label propagation: A multiresolution coordinate-free ordering for compressing social networks,” in Proceedings of the 20th international conference on World wide web. ACM, 2011, pp. 587–596. [31] “Microsoft academic graph.” http://research.microsoft.com/en-us/ projects/mag/, 2015.
8cs.DS